annotate plugins/jabber/xmlrole.c @ 1911:db3104dda736

[gaim-migrate @ 1921] Mike Heffner's redesigned UI. I changed around a lot of things from his patch, not because they weren't good or needed or anything like that; most of the changes I made just made the patch smaller. I moved functions back to where they originally where and renamed them back to what they originally were. Granted the names aren't as... good as the changes Mike made, but eh, it made my life a lot easier when I could see the meat of the changes without all the cosmetic details. The only thing I really changed about his patch was I made the list BROWSE instead of SINGLE so that there wouldn't be need for a deselect callback. Oh yeah, and update_show_plugins is called from different places (so that plugins can call load_plugin and have the window update properly). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 May 2001 09:46:05 +0000
parents afa63ac2fd84
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1347
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 The contents of this file are subject to the Mozilla Public License
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 Version 1.1 (the "License"); you may not use this file except in
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 compliance with the License. You may obtain a copy of the License at
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 http://www.mozilla.org/MPL/
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 Software distributed under the License is distributed on an "AS IS"
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 License for the specific language governing rights and limitations
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 under the License.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 The Original Code is expat.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 The Initial Developer of the Original Code is James Clark.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 Portions created by James Clark are Copyright (C) 1998, 1999
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 James Clark. All Rights Reserved.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 Contributor(s):
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 Alternatively, the contents of this file may be used under the terms
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 of the GNU General Public License (the "GPL"), in which case the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 provisions of the GPL are applicable instead of those above. If you
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 wish to allow use of your version of this file only under the terms of
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 the GPL and not to allow others to use your version of this file under
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 the MPL, indicate your decision by deleting the provisions above and
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 replace them with the notice and other provisions required by the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 GPL. If you do not delete the provisions above, a recipient may use
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 your version of this file under either the MPL or the GPL.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 #include "xmldef.h"
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 #include "xmlrole.h"
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 /* Doesn't check:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 that ,| are not mixed in a model group
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 content of literals
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 #ifndef MIN_BYTES_PER_CHAR
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 #define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 #endif
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 typedef int PROLOG_HANDLER(struct prolog_state *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 const ENCODING *enc);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 static PROLOG_HANDLER
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 prolog0, prolog1, prolog2,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 doctype0, doctype1, doctype2, doctype3, doctype4, doctype5,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 internalSubset,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 entity0, entity1, entity2, entity3, entity4, entity5, entity6,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 entity7, entity8, entity9,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 notation0, notation1, notation2, notation3, notation4,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 attlist7, attlist8, attlist9,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 element0, element1, element2, element3, element4, element5, element6,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 element7,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 declClose,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 error;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 int syntaxError(PROLOG_STATE *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 int prolog0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 state->handler = prolog1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 case XML_TOK_XML_DECL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 state->handler = prolog1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 return XML_ROLE_XML_DECL;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 case XML_TOK_PI:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 state->handler = prolog1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 case XML_TOK_COMMENT:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 state->handler = prolog1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 case XML_TOK_BOM:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 case XML_TOK_DECL_OPEN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 if (!XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 "DOCTYPE"))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 state->handler = doctype0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 case XML_TOK_INSTANCE_START:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 state->handler = error;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 return XML_ROLE_INSTANCE_START;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 int prolog1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 case XML_TOK_PI:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 case XML_TOK_COMMENT:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 case XML_TOK_BOM:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 case XML_TOK_DECL_OPEN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 if (!XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 "DOCTYPE"))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 state->handler = doctype0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 case XML_TOK_INSTANCE_START:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 state->handler = error;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 return XML_ROLE_INSTANCE_START;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 int prolog2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 case XML_TOK_PI:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 case XML_TOK_COMMENT:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 case XML_TOK_INSTANCE_START:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 state->handler = error;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 return XML_ROLE_INSTANCE_START;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 int doctype0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 state->handler = doctype1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 return XML_ROLE_DOCTYPE_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 int doctype1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179 case XML_TOK_OPEN_BRACKET:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 state->handler = prolog2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 return XML_ROLE_DOCTYPE_CLOSE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
186 if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
187 state->handler = doctype3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
188 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 state->handler = doctype2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
197 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
200 int doctype2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
201 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
202 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
204 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
205 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
206 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
207 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
208 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 state->handler = doctype3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 return XML_ROLE_DOCTYPE_PUBLIC_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217 int doctype3(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
218 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
223 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
226 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227 state->handler = doctype4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228 return XML_ROLE_DOCTYPE_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
230 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
231 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
232
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
233 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
234 int doctype4(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
235 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
236 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
237 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
238 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
239 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
240 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
241 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
242 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
243 case XML_TOK_OPEN_BRACKET:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
244 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
245 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
246 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
247 state->handler = prolog2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
248 return XML_ROLE_DOCTYPE_CLOSE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
249 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
250 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
251 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
252
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
253 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
254 int doctype5(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
255 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
256 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
257 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
258 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
259 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
260 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
261 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
262 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
263 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 state->handler = prolog2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 return XML_ROLE_DOCTYPE_CLOSE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
266 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
267 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
268 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
269
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
270 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
271 int internalSubset(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
272 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
273 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
274 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
275 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
276 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
277 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
278 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
279 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
280 case XML_TOK_DECL_OPEN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
281 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283 "ENTITY")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
284 state->handler = entity0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
285 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
286 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
287 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
288 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
289 "ATTLIST")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
290 state->handler = attlist0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
292 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
293 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
294 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295 "ELEMENT")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
296 state->handler = element0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
297 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
298 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
299 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
300 ptr + 2 * MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
301 "NOTATION")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
302 state->handler = notation0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
303 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
304 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
305 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
306 case XML_TOK_PI:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
307 case XML_TOK_COMMENT:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
308 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
309 case XML_TOK_PARAM_ENTITY_REF:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310 return XML_ROLE_PARAM_ENTITY_REF;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311 case XML_TOK_CLOSE_BRACKET:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
312 state->handler = doctype5;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
313 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
314 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
315 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
316 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
317
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
318 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
319 int entity0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
320 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
322 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
323 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
324 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
325 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
326 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
327 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
328 case XML_TOK_PERCENT:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
329 state->handler = entity1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
330 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
331 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
332 state->handler = entity2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
333 return XML_ROLE_GENERAL_ENTITY_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
334 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
335 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
336 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
337
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
338 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
339 int entity1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
340 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
341 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
342 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
343 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
344 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
345 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
346 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
347 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
348 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
349 state->handler = entity7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
350 return XML_ROLE_PARAM_ENTITY_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
351 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
352 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
353 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
354
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
355 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
356 int entity2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
357 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
358 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
359 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
361 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
362 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
363 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
364 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
365 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
366 if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
367 state->handler = entity4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
368 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
369 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
370 if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
371 state->handler = entity3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
372 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
373 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
374 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
375 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
376 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
377 return XML_ROLE_ENTITY_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
378 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
379 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
380 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
381
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
382 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
383 int entity3(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
384 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
385 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
386 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
387 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
388 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
389 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
390 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
391 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
392 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
393 state->handler = entity4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
394 return XML_ROLE_ENTITY_PUBLIC_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
395 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
396 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
397 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
398
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
399
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
400 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
401 int entity4(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
402 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
403 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
404 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
405 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
406 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
407 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
408 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
409 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
410 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
411 state->handler = entity5;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
412 return XML_ROLE_ENTITY_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
413 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
414 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
415 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
416
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
417 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418 int entity5(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
419 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
420 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
421 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
422 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
423 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
424 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
425 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
426 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
427 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
428 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
429 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
430 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
431 if (XmlNameMatchesAscii(enc, ptr, "NDATA")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
432 state->handler = entity6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
433 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
434 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
435 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
436 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
437 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
438 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
439
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
440 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
441 int entity6(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
442 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
443 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
444 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
445 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
446 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
447 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
448 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
449 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
450 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
451 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
452 return XML_ROLE_ENTITY_NOTATION_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
453 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
454 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
455 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
456
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
457 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
458 int entity7(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
459 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
460 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
461 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
462 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
463 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
464 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
465 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
466 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
467 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
468 if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
469 state->handler = entity9;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
470 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
471 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
472 if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
473 state->handler = entity8;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
474 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
475 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
476 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
477 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
478 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
479 return XML_ROLE_ENTITY_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
480 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
481 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
482 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
483
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
484 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
485 int entity8(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
486 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
487 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
488 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
489 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
490 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
491 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
492 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
493 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
494 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
495 state->handler = entity9;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
496 return XML_ROLE_ENTITY_PUBLIC_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
497 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
498 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
499 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
500
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
501 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
502 int entity9(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
503 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
504 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
505 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
506 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
507 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
508 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
509 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
510 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
511 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
512 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
513 return XML_ROLE_ENTITY_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
514 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
515 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
516 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
517
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
518 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
519 int notation0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
520 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
521 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
522 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
523 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
524 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
525 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
526 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
527 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
528 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
529 state->handler = notation1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
530 return XML_ROLE_NOTATION_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
531 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
532 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
533 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
534
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
535 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
536 int notation1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
537 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
538 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
539 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
540 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
541 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
542 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
543 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
544 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
545 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
546 if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
547 state->handler = notation3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
548 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
549 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
550 if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
551 state->handler = notation2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
552 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
553 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
554 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
555 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
556 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
557 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
558
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
559 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
560 int notation2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
561 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
562 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
563 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
564 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
565 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
566 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
567 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
568 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
569 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
570 state->handler = notation4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
571 return XML_ROLE_NOTATION_PUBLIC_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
572 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
573 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
574 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
575
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
576 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
577 int notation3(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
578 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
579 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
580 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
581 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
582 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
583 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
584 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
585 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
586 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
587 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
588 return XML_ROLE_NOTATION_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
589 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
590 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
591 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
592
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
593 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
594 int notation4(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
595 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
596 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
597 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
598 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
599 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
600 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
601 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
602 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
603 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
604 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
605 return XML_ROLE_NOTATION_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
606 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
607 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
608 return XML_ROLE_NOTATION_NO_SYSTEM_ID;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
609 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
610 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
611 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
612
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
613 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
614 int attlist0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
615 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
616 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
617 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
618 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
619 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
620 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
621 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
622 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
623 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
624 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
625 state->handler = attlist1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
626 return XML_ROLE_ATTLIST_ELEMENT_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
627 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
628 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
629 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
630
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
631 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
632 int attlist1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
633 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
634 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
635 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
636 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
637 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
638 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
639 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
640 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
641 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
642 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
643 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
644 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
645 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
646 state->handler = attlist2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
647 return XML_ROLE_ATTRIBUTE_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
648 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
649 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
650 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
651
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
652 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
653 int attlist2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
654 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
655 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
656 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
657 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
658 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
659 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
660 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
661 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
662 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
663 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
664 static const char *types[] = {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
665 "CDATA",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
666 "ID",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
667 "IDREF",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
668 "IDREFS",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
669 "ENTITY",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
670 "ENTITIES",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
671 "NMTOKEN",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
672 "NMTOKENS",
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
673 };
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
674 int i;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
675 for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
676 if (XmlNameMatchesAscii(enc, ptr, types[i])) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
677 state->handler = attlist8;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
678 return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
679 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
680 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
681 if (XmlNameMatchesAscii(enc, ptr, "NOTATION")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
682 state->handler = attlist5;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
683 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
684 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
685 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
686 case XML_TOK_OPEN_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
687 state->handler = attlist3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
688 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
689 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
690 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
691 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
692
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
693 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
694 int attlist3(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
695 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
696 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
697 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
698 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
699 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
700 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
701 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
702 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
703 case XML_TOK_NMTOKEN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
704 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
705 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
706 state->handler = attlist4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
707 return XML_ROLE_ATTRIBUTE_ENUM_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
708 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
709 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
710 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
711
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
712 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
713 int attlist4(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
714 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
715 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
716 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
717 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
718 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
719 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
720 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
721 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
722 case XML_TOK_CLOSE_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
723 state->handler = attlist8;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
724 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
725 case XML_TOK_OR:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
726 state->handler = attlist3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
727 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
728 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
729 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
730 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
731
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
732 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
733 int attlist5(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
734 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
735 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
736 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
737 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
738 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
739 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
740 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
741 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
742 case XML_TOK_OPEN_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
743 state->handler = attlist6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
744 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
745 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
746 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
747 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
748
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
749
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
750 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
751 int attlist6(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
752 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
753 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
754 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
755 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
756 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
757 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
758 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
759 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
760 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
761 state->handler = attlist7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
762 return XML_ROLE_ATTRIBUTE_NOTATION_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
763 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
764 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
765 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
766
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
767 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
768 int attlist7(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
769 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
770 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
771 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
772 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
773 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
774 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
775 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
776 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
777 case XML_TOK_CLOSE_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
778 state->handler = attlist8;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
779 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
780 case XML_TOK_OR:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
781 state->handler = attlist6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
782 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
783 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
784 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
785 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
786
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
787 /* default value */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
788 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
789 int attlist8(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
790 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
791 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
792 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
793 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
794 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
795 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
796 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
797 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
798 case XML_TOK_POUND_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
799 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
800 ptr + MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
801 "IMPLIED")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
802 state->handler = attlist1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
803 return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
804 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
805 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
806 ptr + MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
807 "REQUIRED")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
808 state->handler = attlist1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
809 return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
810 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
811 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
812 ptr + MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
813 "FIXED")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
814 state->handler = attlist9;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
815 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
816 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
817 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
818 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
819 state->handler = attlist1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
820 return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
821 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
822 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
823 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
824
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
825 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
826 int attlist9(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
827 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
828 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
829 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
830 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
831 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
832 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
833 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
834 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
835 case XML_TOK_LITERAL:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
836 state->handler = attlist1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
837 return XML_ROLE_FIXED_ATTRIBUTE_VALUE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
838 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
839 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
840 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
841
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
842 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
843 int element0(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
844 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
845 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
846 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
847 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
848 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
849 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
850 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
851 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
852 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
853 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
854 state->handler = element1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
855 return XML_ROLE_ELEMENT_NAME;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
856 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
857 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
858 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
859
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
860 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
861 int element1(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
862 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
863 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
864 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
865 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
866 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
867 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
868 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
869 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
870 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
871 if (XmlNameMatchesAscii(enc, ptr, "EMPTY")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
872 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
873 return XML_ROLE_CONTENT_EMPTY;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
874 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
875 if (XmlNameMatchesAscii(enc, ptr, "ANY")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
876 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
877 return XML_ROLE_CONTENT_ANY;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
878 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
879 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
880 case XML_TOK_OPEN_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
881 state->handler = element2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
882 state->level = 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
883 return XML_ROLE_GROUP_OPEN;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
884 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
885 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
886 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
887
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
888 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
889 int element2(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
890 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
891 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
892 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
893 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
894 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
895 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
896 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
897 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
898 case XML_TOK_POUND_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
899 if (XmlNameMatchesAscii(enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
900 ptr + MIN_BYTES_PER_CHAR(enc),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
901 "PCDATA")) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
902 state->handler = element3;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
903 return XML_ROLE_CONTENT_PCDATA;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
904 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
905 break;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
906 case XML_TOK_OPEN_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
907 state->level = 2;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
908 state->handler = element6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
909 return XML_ROLE_GROUP_OPEN;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
910 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
911 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
912 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
913 return XML_ROLE_CONTENT_ELEMENT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
914 case XML_TOK_NAME_QUESTION:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
915 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
916 return XML_ROLE_CONTENT_ELEMENT_OPT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
917 case XML_TOK_NAME_ASTERISK:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
918 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
919 return XML_ROLE_CONTENT_ELEMENT_REP;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
920 case XML_TOK_NAME_PLUS:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
921 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
922 return XML_ROLE_CONTENT_ELEMENT_PLUS;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
923 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
924 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
925 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
926
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
927 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
928 int element3(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
929 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
930 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
931 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
932 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
933 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
934 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
935 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
936 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
937 case XML_TOK_CLOSE_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
938 case XML_TOK_CLOSE_PAREN_ASTERISK:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
939 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
940 return XML_ROLE_GROUP_CLOSE_REP;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
941 case XML_TOK_OR:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
942 state->handler = element4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
943 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
944 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
945 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
946 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
947
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
948 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
949 int element4(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
950 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
951 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
952 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
953 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
954 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
955 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
956 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
957 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
958 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
959 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
960 state->handler = element5;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
961 return XML_ROLE_CONTENT_ELEMENT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
962 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
963 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
964 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
965
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
966 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
967 int element5(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
968 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
969 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
970 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
971 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
972 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
973 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
974 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
975 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
976 case XML_TOK_CLOSE_PAREN_ASTERISK:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
977 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
978 return XML_ROLE_GROUP_CLOSE_REP;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
979 case XML_TOK_OR:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
980 state->handler = element4;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
981 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
982 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
983 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
984 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
985
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
986 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
987 int element6(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
988 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
989 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
990 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
991 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
992 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
993 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
994 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
995 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
996 case XML_TOK_OPEN_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
997 state->level += 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
998 return XML_ROLE_GROUP_OPEN;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
999 case XML_TOK_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1000 case XML_TOK_PREFIXED_NAME:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1001 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1002 return XML_ROLE_CONTENT_ELEMENT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1003 case XML_TOK_NAME_QUESTION:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1004 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1005 return XML_ROLE_CONTENT_ELEMENT_OPT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1006 case XML_TOK_NAME_ASTERISK:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1007 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1008 return XML_ROLE_CONTENT_ELEMENT_REP;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1009 case XML_TOK_NAME_PLUS:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1010 state->handler = element7;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1011 return XML_ROLE_CONTENT_ELEMENT_PLUS;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1012 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1013 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1014 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1015
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1016 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1017 int element7(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1018 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1019 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1020 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1021 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1022 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1023 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1024 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1025 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1026 case XML_TOK_CLOSE_PAREN:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1027 state->level -= 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1028 if (state->level == 0)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1029 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1030 return XML_ROLE_GROUP_CLOSE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1031 case XML_TOK_CLOSE_PAREN_ASTERISK:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1032 state->level -= 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1033 if (state->level == 0)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1034 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1035 return XML_ROLE_GROUP_CLOSE_REP;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1036 case XML_TOK_CLOSE_PAREN_QUESTION:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1037 state->level -= 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1038 if (state->level == 0)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1039 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1040 return XML_ROLE_GROUP_CLOSE_OPT;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1041 case XML_TOK_CLOSE_PAREN_PLUS:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1042 state->level -= 1;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1043 if (state->level == 0)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1044 state->handler = declClose;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1045 return XML_ROLE_GROUP_CLOSE_PLUS;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1046 case XML_TOK_COMMA:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1047 state->handler = element6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1048 return XML_ROLE_GROUP_SEQUENCE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1049 case XML_TOK_OR:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1050 state->handler = element6;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1051 return XML_ROLE_GROUP_CHOICE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1052 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1053 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1054 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1055
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1056 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1057 int declClose(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1058 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1059 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1060 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1061 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1062 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1063 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1064 case XML_TOK_PROLOG_S:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1065 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1066 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1067 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1068 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1069 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1070 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1071 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1072
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1073 #if 0
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1074
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1075 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1076 int ignore(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1077 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1078 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1079 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1080 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1081 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1082 switch (tok) {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1083 case XML_TOK_DECL_CLOSE:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1084 state->handler = internalSubset;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1085 return 0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1086 default:
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1087 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1088 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1089 return syntaxError(state);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1090 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1091 #endif
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1092
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1093 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1094 int error(PROLOG_STATE *state,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1095 int tok,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1096 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1097 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1098 const ENCODING *enc)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1099 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1100 return XML_ROLE_NONE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1101 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1102
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1103 static
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1104 int syntaxError(PROLOG_STATE *state)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1105 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1106 state->handler = error;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1107 return XML_ROLE_ERROR;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1108 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1109
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1110 void XmlPrologStateInit(PROLOG_STATE *state)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1111 {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1112 state->handler = prolog0;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1113 }