Mercurial > cpython-lru_cache-weakref
annotate Modules/expat/xmlrole.c @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | f19e877281e4 |
| children | e4dc8be9a72f |
| rev | line source |
|---|---|
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
2 See the file COPYING for copying permission. |
| 21930 | 3 */ |
| 4 | |
| 5 #ifdef COMPILED_FROM_DSP | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
6 #include "winconfig.h" |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
7 #elif defined(MACOS_CLASSIC) |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
8 #include "macconfig.h" |
|
38885
f19e877281e4
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
Trent Mick <trentm@activestate.com>
parents:
38080
diff
changeset
|
9 #elif defined(__amigaos4__) |
|
f19e877281e4
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
Trent Mick <trentm@activestate.com>
parents:
38080
diff
changeset
|
10 #include "amigaconfig.h" |
| 21930 | 11 #else |
|
30748
6248dd5d192a
Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents:
27386
diff
changeset
|
12 #ifdef HAVE_EXPAT_CONFIG_H |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
13 #include <expat_config.h> |
|
30748
6248dd5d192a
Update to Expat 1.95.7; there are no changes to the Expat sources.
Fred Drake <fdrake@acm.org>
parents:
27386
diff
changeset
|
14 #endif |
| 21930 | 15 #endif /* ndef COMPILED_FROM_DSP */ |
| 16 | |
|
38080
b8ec689cb2fb
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
Neal Norwitz <nnorwitz@gmail.com>
parents:
32911
diff
changeset
|
17 #include <stddef.h> |
|
b8ec689cb2fb
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
Neal Norwitz <nnorwitz@gmail.com>
parents:
32911
diff
changeset
|
18 |
| 32911 | 19 #include "expat_external.h" |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
20 #include "internal.h" |
| 21930 | 21 #include "xmlrole.h" |
| 22 #include "ascii.h" | |
| 23 | |
| 24 /* Doesn't check: | |
| 25 | |
| 26 that ,| are not mixed in a model group | |
| 27 content of literals | |
| 28 | |
| 29 */ | |
| 30 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
31 static const char KW_ANY[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
32 ASCII_A, ASCII_N, ASCII_Y, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
33 static const char KW_ATTLIST[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
34 ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
35 static const char KW_CDATA[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
36 ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
37 static const char KW_DOCTYPE[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
38 ASCII_D, ASCII_O, ASCII_C, ASCII_T, ASCII_Y, ASCII_P, ASCII_E, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
39 static const char KW_ELEMENT[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
40 ASCII_E, ASCII_L, ASCII_E, ASCII_M, ASCII_E, ASCII_N, ASCII_T, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
41 static const char KW_EMPTY[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
42 ASCII_E, ASCII_M, ASCII_P, ASCII_T, ASCII_Y, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
43 static const char KW_ENTITIES[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
44 ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
45 '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
46 static const char KW_ENTITY[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
47 ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
48 static const char KW_FIXED[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
49 ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
50 static const char KW_ID[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
51 ASCII_I, ASCII_D, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
52 static const char KW_IDREF[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
53 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
54 static const char KW_IDREFS[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
55 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
56 static const char KW_IGNORE[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
57 ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
58 static const char KW_IMPLIED[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
59 ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
60 static const char KW_INCLUDE[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
61 ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
62 static const char KW_NDATA[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
63 ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
64 static const char KW_NMTOKEN[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
65 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
66 static const char KW_NMTOKENS[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
67 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
68 '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
69 static const char KW_NOTATION[] = |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
70 { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
71 '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
72 static const char KW_PCDATA[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
73 ASCII_P, ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
74 static const char KW_PUBLIC[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
75 ASCII_P, ASCII_U, ASCII_B, ASCII_L, ASCII_I, ASCII_C, '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
76 static const char KW_REQUIRED[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
77 ASCII_R, ASCII_E, ASCII_Q, ASCII_U, ASCII_I, ASCII_R, ASCII_E, ASCII_D, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
78 '\0' }; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
79 static const char KW_SYSTEM[] = { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
80 ASCII_S, ASCII_Y, ASCII_S, ASCII_T, ASCII_E, ASCII_M, '\0' }; |
| 21930 | 81 |
| 82 #ifndef MIN_BYTES_PER_CHAR | |
| 83 #define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) | |
| 84 #endif | |
| 85 | |
| 86 #ifdef XML_DTD | |
| 87 #define setTopLevel(state) \ | |
| 88 ((state)->handler = ((state)->documentEntity \ | |
| 89 ? internalSubset \ | |
| 90 : externalSubset1)) | |
| 91 #else /* not XML_DTD */ | |
| 92 #define setTopLevel(state) ((state)->handler = internalSubset) | |
| 93 #endif /* not XML_DTD */ | |
| 94 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
95 typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
96 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
97 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
98 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
99 const ENCODING *enc); |
| 21930 | 100 |
| 101 static PROLOG_HANDLER | |
| 102 prolog0, prolog1, prolog2, | |
| 103 doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, | |
| 104 internalSubset, | |
| 105 entity0, entity1, entity2, entity3, entity4, entity5, entity6, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
106 entity7, entity8, entity9, entity10, |
| 21930 | 107 notation0, notation1, notation2, notation3, notation4, |
| 108 attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, | |
| 109 attlist7, attlist8, attlist9, | |
| 110 element0, element1, element2, element3, element4, element5, element6, | |
| 111 element7, | |
| 112 #ifdef XML_DTD | |
| 113 externalSubset0, externalSubset1, | |
| 114 condSect0, condSect1, condSect2, | |
| 115 #endif /* XML_DTD */ | |
| 116 declClose, | |
| 117 error; | |
| 118 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
119 static int FASTCALL common(PROLOG_STATE *state, int tok); |
| 21930 | 120 |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
121 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
122 prolog0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
123 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
124 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
125 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
126 const ENCODING *enc) |
| 21930 | 127 { |
| 128 switch (tok) { | |
| 129 case XML_TOK_PROLOG_S: | |
| 130 state->handler = prolog1; | |
| 131 return XML_ROLE_NONE; | |
| 132 case XML_TOK_XML_DECL: | |
| 133 state->handler = prolog1; | |
| 134 return XML_ROLE_XML_DECL; | |
| 135 case XML_TOK_PI: | |
| 136 state->handler = prolog1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
137 return XML_ROLE_PI; |
| 21930 | 138 case XML_TOK_COMMENT: |
| 139 state->handler = prolog1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
140 return XML_ROLE_COMMENT; |
| 21930 | 141 case XML_TOK_BOM: |
| 142 return XML_ROLE_NONE; | |
| 143 case XML_TOK_DECL_OPEN: | |
| 144 if (!XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
145 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
146 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
147 KW_DOCTYPE)) |
| 21930 | 148 break; |
| 149 state->handler = doctype0; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
150 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 151 case XML_TOK_INSTANCE_START: |
| 152 state->handler = error; | |
| 153 return XML_ROLE_INSTANCE_START; | |
| 154 } | |
| 155 return common(state, tok); | |
| 156 } | |
| 157 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
158 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
159 prolog1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
160 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
161 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
162 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
163 const ENCODING *enc) |
| 21930 | 164 { |
| 165 switch (tok) { | |
| 166 case XML_TOK_PROLOG_S: | |
| 167 return XML_ROLE_NONE; | |
| 168 case XML_TOK_PI: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
169 return XML_ROLE_PI; |
| 21930 | 170 case XML_TOK_COMMENT: |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
171 return XML_ROLE_COMMENT; |
| 21930 | 172 case XML_TOK_BOM: |
| 173 return XML_ROLE_NONE; | |
| 174 case XML_TOK_DECL_OPEN: | |
| 175 if (!XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
176 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
177 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
178 KW_DOCTYPE)) |
| 21930 | 179 break; |
| 180 state->handler = doctype0; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
181 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 182 case XML_TOK_INSTANCE_START: |
| 183 state->handler = error; | |
| 184 return XML_ROLE_INSTANCE_START; | |
| 185 } | |
| 186 return common(state, tok); | |
| 187 } | |
| 188 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
189 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
190 prolog2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
191 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
192 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
193 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
194 const ENCODING *enc) |
| 21930 | 195 { |
| 196 switch (tok) { | |
| 197 case XML_TOK_PROLOG_S: | |
| 198 return XML_ROLE_NONE; | |
| 199 case XML_TOK_PI: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
200 return XML_ROLE_PI; |
| 21930 | 201 case XML_TOK_COMMENT: |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
202 return XML_ROLE_COMMENT; |
| 21930 | 203 case XML_TOK_INSTANCE_START: |
| 204 state->handler = error; | |
| 205 return XML_ROLE_INSTANCE_START; | |
| 206 } | |
| 207 return common(state, tok); | |
| 208 } | |
| 209 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
210 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
211 doctype0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
212 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
213 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
214 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
215 const ENCODING *enc) |
| 21930 | 216 { |
| 217 switch (tok) { | |
| 218 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
219 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 220 case XML_TOK_NAME: |
| 221 case XML_TOK_PREFIXED_NAME: | |
| 222 state->handler = doctype1; | |
| 223 return XML_ROLE_DOCTYPE_NAME; | |
| 224 } | |
| 225 return common(state, tok); | |
| 226 } | |
| 227 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
228 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
229 doctype1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
230 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
231 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
232 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
233 const ENCODING *enc) |
| 21930 | 234 { |
| 235 switch (tok) { | |
| 236 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
237 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 238 case XML_TOK_OPEN_BRACKET: |
| 239 state->handler = internalSubset; | |
| 240 return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; | |
| 241 case XML_TOK_DECL_CLOSE: | |
| 242 state->handler = prolog2; | |
| 243 return XML_ROLE_DOCTYPE_CLOSE; | |
| 244 case XML_TOK_NAME: | |
| 245 if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { | |
| 246 state->handler = doctype3; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
247 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 248 } |
| 249 if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { | |
| 250 state->handler = doctype2; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
251 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 252 } |
| 253 break; | |
| 254 } | |
| 255 return common(state, tok); | |
| 256 } | |
| 257 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
258 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
259 doctype2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
260 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
261 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
262 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
263 const ENCODING *enc) |
| 21930 | 264 { |
| 265 switch (tok) { | |
| 266 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
267 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 268 case XML_TOK_LITERAL: |
| 269 state->handler = doctype3; | |
| 270 return XML_ROLE_DOCTYPE_PUBLIC_ID; | |
| 271 } | |
| 272 return common(state, tok); | |
| 273 } | |
| 274 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
275 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
276 doctype3(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
277 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
278 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
279 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
280 const ENCODING *enc) |
| 21930 | 281 { |
| 282 switch (tok) { | |
| 283 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
284 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 285 case XML_TOK_LITERAL: |
| 286 state->handler = doctype4; | |
| 287 return XML_ROLE_DOCTYPE_SYSTEM_ID; | |
| 288 } | |
| 289 return common(state, tok); | |
| 290 } | |
| 291 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
292 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
293 doctype4(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
294 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
295 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
296 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
297 const ENCODING *enc) |
| 21930 | 298 { |
| 299 switch (tok) { | |
| 300 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
301 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 302 case XML_TOK_OPEN_BRACKET: |
| 303 state->handler = internalSubset; | |
| 304 return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; | |
| 305 case XML_TOK_DECL_CLOSE: | |
| 306 state->handler = prolog2; | |
| 307 return XML_ROLE_DOCTYPE_CLOSE; | |
| 308 } | |
| 309 return common(state, tok); | |
| 310 } | |
| 311 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
312 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
313 doctype5(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
314 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
315 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
316 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
317 const ENCODING *enc) |
| 21930 | 318 { |
| 319 switch (tok) { | |
| 320 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
321 return XML_ROLE_DOCTYPE_NONE; |
| 21930 | 322 case XML_TOK_DECL_CLOSE: |
| 323 state->handler = prolog2; | |
| 324 return XML_ROLE_DOCTYPE_CLOSE; | |
| 325 } | |
| 326 return common(state, tok); | |
| 327 } | |
| 328 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
329 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
330 internalSubset(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
331 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
332 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
333 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
334 const ENCODING *enc) |
| 21930 | 335 { |
| 336 switch (tok) { | |
| 337 case XML_TOK_PROLOG_S: | |
| 338 return XML_ROLE_NONE; | |
| 339 case XML_TOK_DECL_OPEN: | |
| 340 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
341 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
342 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
343 KW_ENTITY)) { |
| 21930 | 344 state->handler = entity0; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
345 return XML_ROLE_ENTITY_NONE; |
| 21930 | 346 } |
| 347 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
348 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
349 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
350 KW_ATTLIST)) { |
| 21930 | 351 state->handler = attlist0; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
352 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 353 } |
| 354 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
355 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
356 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
357 KW_ELEMENT)) { |
| 21930 | 358 state->handler = element0; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
359 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 360 } |
| 361 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
362 ptr + 2 * MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
363 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
364 KW_NOTATION)) { |
| 21930 | 365 state->handler = notation0; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
366 return XML_ROLE_NOTATION_NONE; |
| 21930 | 367 } |
| 368 break; | |
| 369 case XML_TOK_PI: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
370 return XML_ROLE_PI; |
| 21930 | 371 case XML_TOK_COMMENT: |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
372 return XML_ROLE_COMMENT; |
| 21930 | 373 case XML_TOK_PARAM_ENTITY_REF: |
| 374 return XML_ROLE_PARAM_ENTITY_REF; | |
| 375 case XML_TOK_CLOSE_BRACKET: | |
| 376 state->handler = doctype5; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
377 return XML_ROLE_DOCTYPE_NONE; |
| 32911 | 378 case XML_TOK_NONE: |
| 379 return XML_ROLE_NONE; | |
| 21930 | 380 } |
| 381 return common(state, tok); | |
| 382 } | |
| 383 | |
| 384 #ifdef XML_DTD | |
| 385 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
386 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
387 externalSubset0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
388 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
389 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
390 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
391 const ENCODING *enc) |
| 21930 | 392 { |
| 393 state->handler = externalSubset1; | |
| 394 if (tok == XML_TOK_XML_DECL) | |
| 395 return XML_ROLE_TEXT_DECL; | |
| 396 return externalSubset1(state, tok, ptr, end, enc); | |
| 397 } | |
| 398 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
399 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
400 externalSubset1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
401 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
402 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
403 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
404 const ENCODING *enc) |
| 21930 | 405 { |
| 406 switch (tok) { | |
| 407 case XML_TOK_COND_SECT_OPEN: | |
| 408 state->handler = condSect0; | |
| 409 return XML_ROLE_NONE; | |
| 410 case XML_TOK_COND_SECT_CLOSE: | |
| 411 if (state->includeLevel == 0) | |
| 412 break; | |
| 413 state->includeLevel -= 1; | |
| 414 return XML_ROLE_NONE; | |
| 415 case XML_TOK_PROLOG_S: | |
| 416 return XML_ROLE_NONE; | |
| 417 case XML_TOK_CLOSE_BRACKET: | |
| 418 break; | |
| 419 case XML_TOK_NONE: | |
| 420 if (state->includeLevel) | |
| 421 break; | |
| 422 return XML_ROLE_NONE; | |
| 423 default: | |
| 424 return internalSubset(state, tok, ptr, end, enc); | |
| 425 } | |
| 426 return common(state, tok); | |
| 427 } | |
| 428 | |
| 429 #endif /* XML_DTD */ | |
| 430 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
431 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
432 entity0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
433 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
434 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
435 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
436 const ENCODING *enc) |
| 21930 | 437 { |
| 438 switch (tok) { | |
| 439 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
440 return XML_ROLE_ENTITY_NONE; |
| 21930 | 441 case XML_TOK_PERCENT: |
| 442 state->handler = entity1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
443 return XML_ROLE_ENTITY_NONE; |
| 21930 | 444 case XML_TOK_NAME: |
| 445 state->handler = entity2; | |
| 446 return XML_ROLE_GENERAL_ENTITY_NAME; | |
| 447 } | |
| 448 return common(state, tok); | |
| 449 } | |
| 450 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
451 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
452 entity1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
453 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
454 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
455 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
456 const ENCODING *enc) |
| 21930 | 457 { |
| 458 switch (tok) { | |
| 459 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
460 return XML_ROLE_ENTITY_NONE; |
| 21930 | 461 case XML_TOK_NAME: |
| 462 state->handler = entity7; | |
| 463 return XML_ROLE_PARAM_ENTITY_NAME; | |
| 464 } | |
| 465 return common(state, tok); | |
| 466 } | |
| 467 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
468 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
469 entity2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
470 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
471 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
472 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
473 const ENCODING *enc) |
| 21930 | 474 { |
| 475 switch (tok) { | |
| 476 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
477 return XML_ROLE_ENTITY_NONE; |
| 21930 | 478 case XML_TOK_NAME: |
| 479 if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { | |
| 480 state->handler = entity4; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
481 return XML_ROLE_ENTITY_NONE; |
| 21930 | 482 } |
| 483 if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { | |
| 484 state->handler = entity3; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
485 return XML_ROLE_ENTITY_NONE; |
| 21930 | 486 } |
| 487 break; | |
| 488 case XML_TOK_LITERAL: | |
| 489 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
490 state->role_none = XML_ROLE_ENTITY_NONE; |
| 21930 | 491 return XML_ROLE_ENTITY_VALUE; |
| 492 } | |
| 493 return common(state, tok); | |
| 494 } | |
| 495 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
496 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
497 entity3(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
498 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
499 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
500 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
501 const ENCODING *enc) |
| 21930 | 502 { |
| 503 switch (tok) { | |
| 504 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
505 return XML_ROLE_ENTITY_NONE; |
| 21930 | 506 case XML_TOK_LITERAL: |
| 507 state->handler = entity4; | |
| 508 return XML_ROLE_ENTITY_PUBLIC_ID; | |
| 509 } | |
| 510 return common(state, tok); | |
| 511 } | |
| 512 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
513 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
514 entity4(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
515 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
516 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
517 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
518 const ENCODING *enc) |
| 21930 | 519 { |
| 520 switch (tok) { | |
| 521 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
522 return XML_ROLE_ENTITY_NONE; |
| 21930 | 523 case XML_TOK_LITERAL: |
| 524 state->handler = entity5; | |
| 525 return XML_ROLE_ENTITY_SYSTEM_ID; | |
| 526 } | |
| 527 return common(state, tok); | |
| 528 } | |
| 529 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
530 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
531 entity5(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
532 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
533 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
534 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
535 const ENCODING *enc) |
| 21930 | 536 { |
| 537 switch (tok) { | |
| 538 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
539 return XML_ROLE_ENTITY_NONE; |
| 21930 | 540 case XML_TOK_DECL_CLOSE: |
| 541 setTopLevel(state); | |
| 542 return XML_ROLE_ENTITY_COMPLETE; | |
| 543 case XML_TOK_NAME: | |
| 544 if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) { | |
| 545 state->handler = entity6; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
546 return XML_ROLE_ENTITY_NONE; |
| 21930 | 547 } |
| 548 break; | |
| 549 } | |
| 550 return common(state, tok); | |
| 551 } | |
| 552 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
553 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
554 entity6(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
555 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
556 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
557 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
558 const ENCODING *enc) |
| 21930 | 559 { |
| 560 switch (tok) { | |
| 561 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
562 return XML_ROLE_ENTITY_NONE; |
| 21930 | 563 case XML_TOK_NAME: |
| 564 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
565 state->role_none = XML_ROLE_ENTITY_NONE; |
| 21930 | 566 return XML_ROLE_ENTITY_NOTATION_NAME; |
| 567 } | |
| 568 return common(state, tok); | |
| 569 } | |
| 570 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
571 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
572 entity7(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
573 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
574 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
575 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
576 const ENCODING *enc) |
| 21930 | 577 { |
| 578 switch (tok) { | |
| 579 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
580 return XML_ROLE_ENTITY_NONE; |
| 21930 | 581 case XML_TOK_NAME: |
| 582 if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { | |
| 583 state->handler = entity9; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
584 return XML_ROLE_ENTITY_NONE; |
| 21930 | 585 } |
| 586 if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { | |
| 587 state->handler = entity8; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
588 return XML_ROLE_ENTITY_NONE; |
| 21930 | 589 } |
| 590 break; | |
| 591 case XML_TOK_LITERAL: | |
| 592 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
593 state->role_none = XML_ROLE_ENTITY_NONE; |
| 21930 | 594 return XML_ROLE_ENTITY_VALUE; |
| 595 } | |
| 596 return common(state, tok); | |
| 597 } | |
| 598 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
599 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
600 entity8(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
601 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
602 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
603 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
604 const ENCODING *enc) |
| 21930 | 605 { |
| 606 switch (tok) { | |
| 607 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
608 return XML_ROLE_ENTITY_NONE; |
| 21930 | 609 case XML_TOK_LITERAL: |
| 610 state->handler = entity9; | |
| 611 return XML_ROLE_ENTITY_PUBLIC_ID; | |
| 612 } | |
| 613 return common(state, tok); | |
| 614 } | |
| 615 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
616 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
617 entity9(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
618 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
619 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
620 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
621 const ENCODING *enc) |
| 21930 | 622 { |
| 623 switch (tok) { | |
| 624 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
625 return XML_ROLE_ENTITY_NONE; |
| 21930 | 626 case XML_TOK_LITERAL: |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
627 state->handler = entity10; |
| 21930 | 628 return XML_ROLE_ENTITY_SYSTEM_ID; |
| 629 } | |
| 630 return common(state, tok); | |
| 631 } | |
| 632 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
633 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
634 entity10(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
635 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
636 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
637 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
638 const ENCODING *enc) |
| 21930 | 639 { |
| 640 switch (tok) { | |
| 641 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
642 return XML_ROLE_ENTITY_NONE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
643 case XML_TOK_DECL_CLOSE: |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
644 setTopLevel(state); |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
645 return XML_ROLE_ENTITY_COMPLETE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
646 } |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
647 return common(state, tok); |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
648 } |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
649 |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
650 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
651 notation0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
652 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
653 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
654 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
655 const ENCODING *enc) |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
656 { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
657 switch (tok) { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
658 case XML_TOK_PROLOG_S: |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
659 return XML_ROLE_NOTATION_NONE; |
| 21930 | 660 case XML_TOK_NAME: |
| 661 state->handler = notation1; | |
| 662 return XML_ROLE_NOTATION_NAME; | |
| 663 } | |
| 664 return common(state, tok); | |
| 665 } | |
| 666 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
667 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
668 notation1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
669 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
670 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
671 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
672 const ENCODING *enc) |
| 21930 | 673 { |
| 674 switch (tok) { | |
| 675 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
676 return XML_ROLE_NOTATION_NONE; |
| 21930 | 677 case XML_TOK_NAME: |
| 678 if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { | |
| 679 state->handler = notation3; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
680 return XML_ROLE_NOTATION_NONE; |
| 21930 | 681 } |
| 682 if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { | |
| 683 state->handler = notation2; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
684 return XML_ROLE_NOTATION_NONE; |
| 21930 | 685 } |
| 686 break; | |
| 687 } | |
| 688 return common(state, tok); | |
| 689 } | |
| 690 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
691 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
692 notation2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
693 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
694 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
695 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
696 const ENCODING *enc) |
| 21930 | 697 { |
| 698 switch (tok) { | |
| 699 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
700 return XML_ROLE_NOTATION_NONE; |
| 21930 | 701 case XML_TOK_LITERAL: |
| 702 state->handler = notation4; | |
| 703 return XML_ROLE_NOTATION_PUBLIC_ID; | |
| 704 } | |
| 705 return common(state, tok); | |
| 706 } | |
| 707 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
708 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
709 notation3(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
710 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
711 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
712 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
713 const ENCODING *enc) |
| 21930 | 714 { |
| 715 switch (tok) { | |
| 716 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
717 return XML_ROLE_NOTATION_NONE; |
| 21930 | 718 case XML_TOK_LITERAL: |
| 719 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
720 state->role_none = XML_ROLE_NOTATION_NONE; |
| 21930 | 721 return XML_ROLE_NOTATION_SYSTEM_ID; |
| 722 } | |
| 723 return common(state, tok); | |
| 724 } | |
| 725 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
726 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
727 notation4(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
728 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
729 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
730 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
731 const ENCODING *enc) |
| 21930 | 732 { |
| 733 switch (tok) { | |
| 734 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
735 return XML_ROLE_NOTATION_NONE; |
| 21930 | 736 case XML_TOK_LITERAL: |
| 737 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
738 state->role_none = XML_ROLE_NOTATION_NONE; |
| 21930 | 739 return XML_ROLE_NOTATION_SYSTEM_ID; |
| 740 case XML_TOK_DECL_CLOSE: | |
| 741 setTopLevel(state); | |
| 742 return XML_ROLE_NOTATION_NO_SYSTEM_ID; | |
| 743 } | |
| 744 return common(state, tok); | |
| 745 } | |
| 746 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
747 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
748 attlist0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
749 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
750 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
751 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
752 const ENCODING *enc) |
| 21930 | 753 { |
| 754 switch (tok) { | |
| 755 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
756 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 757 case XML_TOK_NAME: |
| 758 case XML_TOK_PREFIXED_NAME: | |
| 759 state->handler = attlist1; | |
| 760 return XML_ROLE_ATTLIST_ELEMENT_NAME; | |
| 761 } | |
| 762 return common(state, tok); | |
| 763 } | |
| 764 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
765 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
766 attlist1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
767 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
768 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
769 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
770 const ENCODING *enc) |
| 21930 | 771 { |
| 772 switch (tok) { | |
| 773 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
774 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 775 case XML_TOK_DECL_CLOSE: |
| 776 setTopLevel(state); | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
777 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 778 case XML_TOK_NAME: |
| 779 case XML_TOK_PREFIXED_NAME: | |
| 780 state->handler = attlist2; | |
| 781 return XML_ROLE_ATTRIBUTE_NAME; | |
| 782 } | |
| 783 return common(state, tok); | |
| 784 } | |
| 785 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
786 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
787 attlist2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
788 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
789 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
790 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
791 const ENCODING *enc) |
| 21930 | 792 { |
| 793 switch (tok) { | |
| 794 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
795 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 796 case XML_TOK_NAME: |
| 797 { | |
|
38885
f19e877281e4
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
Trent Mick <trentm@activestate.com>
parents:
38080
diff
changeset
|
798 static const char * const types[] = { |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
799 KW_CDATA, |
| 21930 | 800 KW_ID, |
| 801 KW_IDREF, | |
| 802 KW_IDREFS, | |
| 803 KW_ENTITY, | |
| 804 KW_ENTITIES, | |
| 805 KW_NMTOKEN, | |
| 806 KW_NMTOKENS, | |
| 807 }; | |
| 808 int i; | |
| 809 for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
810 if (XmlNameMatchesAscii(enc, ptr, end, types[i])) { |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
811 state->handler = attlist8; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
812 return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
813 } |
| 21930 | 814 } |
| 815 if (XmlNameMatchesAscii(enc, ptr, end, KW_NOTATION)) { | |
| 816 state->handler = attlist5; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
817 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 818 } |
| 819 break; | |
| 820 case XML_TOK_OPEN_PAREN: | |
| 821 state->handler = attlist3; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
822 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 823 } |
| 824 return common(state, tok); | |
| 825 } | |
| 826 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
827 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
828 attlist3(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
829 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
830 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
831 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
832 const ENCODING *enc) |
| 21930 | 833 { |
| 834 switch (tok) { | |
| 835 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
836 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 837 case XML_TOK_NMTOKEN: |
| 838 case XML_TOK_NAME: | |
| 839 case XML_TOK_PREFIXED_NAME: | |
| 840 state->handler = attlist4; | |
| 841 return XML_ROLE_ATTRIBUTE_ENUM_VALUE; | |
| 842 } | |
| 843 return common(state, tok); | |
| 844 } | |
| 845 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
846 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
847 attlist4(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
848 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
849 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
850 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
851 const ENCODING *enc) |
| 21930 | 852 { |
| 853 switch (tok) { | |
| 854 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
855 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 856 case XML_TOK_CLOSE_PAREN: |
| 857 state->handler = attlist8; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
858 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 859 case XML_TOK_OR: |
| 860 state->handler = attlist3; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
861 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 862 } |
| 863 return common(state, tok); | |
| 864 } | |
| 865 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
866 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
867 attlist5(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
868 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
869 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
870 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
871 const ENCODING *enc) |
| 21930 | 872 { |
| 873 switch (tok) { | |
| 874 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
875 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 876 case XML_TOK_OPEN_PAREN: |
| 877 state->handler = attlist6; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
878 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 879 } |
| 880 return common(state, tok); | |
| 881 } | |
| 882 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
883 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
884 attlist6(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
885 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
886 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
887 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
888 const ENCODING *enc) |
| 21930 | 889 { |
| 890 switch (tok) { | |
| 891 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
892 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 893 case XML_TOK_NAME: |
| 894 state->handler = attlist7; | |
| 895 return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; | |
| 896 } | |
| 897 return common(state, tok); | |
| 898 } | |
| 899 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
900 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
901 attlist7(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
902 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
903 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
904 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
905 const ENCODING *enc) |
| 21930 | 906 { |
| 907 switch (tok) { | |
| 908 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
909 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 910 case XML_TOK_CLOSE_PAREN: |
| 911 state->handler = attlist8; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
912 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 913 case XML_TOK_OR: |
| 914 state->handler = attlist6; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
915 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 916 } |
| 917 return common(state, tok); | |
| 918 } | |
| 919 | |
| 920 /* default value */ | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
921 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
922 attlist8(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
923 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
924 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
925 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
926 const ENCODING *enc) |
| 21930 | 927 { |
| 928 switch (tok) { | |
| 929 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
930 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 931 case XML_TOK_POUND_NAME: |
| 932 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
933 ptr + MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
934 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
935 KW_IMPLIED)) { |
| 21930 | 936 state->handler = attlist1; |
| 937 return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; | |
| 938 } | |
| 939 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
940 ptr + MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
941 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
942 KW_REQUIRED)) { |
| 21930 | 943 state->handler = attlist1; |
| 944 return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; | |
| 945 } | |
| 946 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
947 ptr + MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
948 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
949 KW_FIXED)) { |
| 21930 | 950 state->handler = attlist9; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
951 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 952 } |
| 953 break; | |
| 954 case XML_TOK_LITERAL: | |
| 955 state->handler = attlist1; | |
| 956 return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; | |
| 957 } | |
| 958 return common(state, tok); | |
| 959 } | |
| 960 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
961 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
962 attlist9(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
963 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
964 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
965 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
966 const ENCODING *enc) |
| 21930 | 967 { |
| 968 switch (tok) { | |
| 969 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
970 return XML_ROLE_ATTLIST_NONE; |
| 21930 | 971 case XML_TOK_LITERAL: |
| 972 state->handler = attlist1; | |
| 973 return XML_ROLE_FIXED_ATTRIBUTE_VALUE; | |
| 974 } | |
| 975 return common(state, tok); | |
| 976 } | |
| 977 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
978 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
979 element0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
980 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
981 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
982 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
983 const ENCODING *enc) |
| 21930 | 984 { |
| 985 switch (tok) { | |
| 986 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
987 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 988 case XML_TOK_NAME: |
| 989 case XML_TOK_PREFIXED_NAME: | |
| 990 state->handler = element1; | |
| 991 return XML_ROLE_ELEMENT_NAME; | |
| 992 } | |
| 993 return common(state, tok); | |
| 994 } | |
| 995 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
996 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
997 element1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
998 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
999 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1000 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1001 const ENCODING *enc) |
| 21930 | 1002 { |
| 1003 switch (tok) { | |
| 1004 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1005 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1006 case XML_TOK_NAME: |
| 1007 if (XmlNameMatchesAscii(enc, ptr, end, KW_EMPTY)) { | |
| 1008 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1009 state->role_none = XML_ROLE_ELEMENT_NONE; |
| 21930 | 1010 return XML_ROLE_CONTENT_EMPTY; |
| 1011 } | |
| 1012 if (XmlNameMatchesAscii(enc, ptr, end, KW_ANY)) { | |
| 1013 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1014 state->role_none = XML_ROLE_ELEMENT_NONE; |
| 21930 | 1015 return XML_ROLE_CONTENT_ANY; |
| 1016 } | |
| 1017 break; | |
| 1018 case XML_TOK_OPEN_PAREN: | |
| 1019 state->handler = element2; | |
| 1020 state->level = 1; | |
| 1021 return XML_ROLE_GROUP_OPEN; | |
| 1022 } | |
| 1023 return common(state, tok); | |
| 1024 } | |
| 1025 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1026 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1027 element2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1028 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1029 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1030 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1031 const ENCODING *enc) |
| 21930 | 1032 { |
| 1033 switch (tok) { | |
| 1034 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1035 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1036 case XML_TOK_POUND_NAME: |
| 1037 if (XmlNameMatchesAscii(enc, | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1038 ptr + MIN_BYTES_PER_CHAR(enc), |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1039 end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1040 KW_PCDATA)) { |
| 21930 | 1041 state->handler = element3; |
| 1042 return XML_ROLE_CONTENT_PCDATA; | |
| 1043 } | |
| 1044 break; | |
| 1045 case XML_TOK_OPEN_PAREN: | |
| 1046 state->level = 2; | |
| 1047 state->handler = element6; | |
| 1048 return XML_ROLE_GROUP_OPEN; | |
| 1049 case XML_TOK_NAME: | |
| 1050 case XML_TOK_PREFIXED_NAME: | |
| 1051 state->handler = element7; | |
| 1052 return XML_ROLE_CONTENT_ELEMENT; | |
| 1053 case XML_TOK_NAME_QUESTION: | |
| 1054 state->handler = element7; | |
| 1055 return XML_ROLE_CONTENT_ELEMENT_OPT; | |
| 1056 case XML_TOK_NAME_ASTERISK: | |
| 1057 state->handler = element7; | |
| 1058 return XML_ROLE_CONTENT_ELEMENT_REP; | |
| 1059 case XML_TOK_NAME_PLUS: | |
| 1060 state->handler = element7; | |
| 1061 return XML_ROLE_CONTENT_ELEMENT_PLUS; | |
| 1062 } | |
| 1063 return common(state, tok); | |
| 1064 } | |
| 1065 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1066 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1067 element3(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1068 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1069 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1070 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1071 const ENCODING *enc) |
| 21930 | 1072 { |
| 1073 switch (tok) { | |
| 1074 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1075 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1076 case XML_TOK_CLOSE_PAREN: |
| 1077 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1078 state->role_none = XML_ROLE_ELEMENT_NONE; |
| 21930 | 1079 return XML_ROLE_GROUP_CLOSE; |
| 1080 case XML_TOK_CLOSE_PAREN_ASTERISK: | |
| 1081 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1082 state->role_none = XML_ROLE_ELEMENT_NONE; |
| 21930 | 1083 return XML_ROLE_GROUP_CLOSE_REP; |
| 1084 case XML_TOK_OR: | |
| 1085 state->handler = element4; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1086 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1087 } |
| 1088 return common(state, tok); | |
| 1089 } | |
| 1090 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1091 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1092 element4(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1093 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1094 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1095 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1096 const ENCODING *enc) |
| 21930 | 1097 { |
| 1098 switch (tok) { | |
| 1099 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1100 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1101 case XML_TOK_NAME: |
| 1102 case XML_TOK_PREFIXED_NAME: | |
| 1103 state->handler = element5; | |
| 1104 return XML_ROLE_CONTENT_ELEMENT; | |
| 1105 } | |
| 1106 return common(state, tok); | |
| 1107 } | |
| 1108 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1109 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1110 element5(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1111 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1112 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1113 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1114 const ENCODING *enc) |
| 21930 | 1115 { |
| 1116 switch (tok) { | |
| 1117 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1118 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1119 case XML_TOK_CLOSE_PAREN_ASTERISK: |
| 1120 state->handler = declClose; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1121 state->role_none = XML_ROLE_ELEMENT_NONE; |
| 21930 | 1122 return XML_ROLE_GROUP_CLOSE_REP; |
| 1123 case XML_TOK_OR: | |
| 1124 state->handler = element4; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1125 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1126 } |
| 1127 return common(state, tok); | |
| 1128 } | |
| 1129 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1130 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1131 element6(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1132 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1133 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1134 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1135 const ENCODING *enc) |
| 21930 | 1136 { |
| 1137 switch (tok) { | |
| 1138 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1139 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1140 case XML_TOK_OPEN_PAREN: |
| 1141 state->level += 1; | |
| 1142 return XML_ROLE_GROUP_OPEN; | |
| 1143 case XML_TOK_NAME: | |
| 1144 case XML_TOK_PREFIXED_NAME: | |
| 1145 state->handler = element7; | |
| 1146 return XML_ROLE_CONTENT_ELEMENT; | |
| 1147 case XML_TOK_NAME_QUESTION: | |
| 1148 state->handler = element7; | |
| 1149 return XML_ROLE_CONTENT_ELEMENT_OPT; | |
| 1150 case XML_TOK_NAME_ASTERISK: | |
| 1151 state->handler = element7; | |
| 1152 return XML_ROLE_CONTENT_ELEMENT_REP; | |
| 1153 case XML_TOK_NAME_PLUS: | |
| 1154 state->handler = element7; | |
| 1155 return XML_ROLE_CONTENT_ELEMENT_PLUS; | |
| 1156 } | |
| 1157 return common(state, tok); | |
| 1158 } | |
| 1159 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1160 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1161 element7(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1162 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1163 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1164 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1165 const ENCODING *enc) |
| 21930 | 1166 { |
| 1167 switch (tok) { | |
| 1168 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1169 return XML_ROLE_ELEMENT_NONE; |
| 21930 | 1170 case XML_TOK_CLOSE_PAREN: |
| 1171 state->level -= 1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1172 if (state->level == 0) { |
| 21930 | 1173 state->handler = declClose; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1174 state->role_none = XML_ROLE_ELEMENT_NONE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1175 } |
| 21930 | 1176 return XML_ROLE_GROUP_CLOSE; |
| 1177 case XML_TOK_CLOSE_PAREN_ASTERISK: | |
| 1178 state->level -= 1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1179 if (state->level == 0) { |
| 21930 | 1180 state->handler = declClose; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1181 state->role_none = XML_ROLE_ELEMENT_NONE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1182 } |
| 21930 | 1183 return XML_ROLE_GROUP_CLOSE_REP; |
| 1184 case XML_TOK_CLOSE_PAREN_QUESTION: | |
| 1185 state->level -= 1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1186 if (state->level == 0) { |
| 21930 | 1187 state->handler = declClose; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1188 state->role_none = XML_ROLE_ELEMENT_NONE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1189 } |
| 21930 | 1190 return XML_ROLE_GROUP_CLOSE_OPT; |
| 1191 case XML_TOK_CLOSE_PAREN_PLUS: | |
| 1192 state->level -= 1; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1193 if (state->level == 0) { |
| 21930 | 1194 state->handler = declClose; |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1195 state->role_none = XML_ROLE_ELEMENT_NONE; |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1196 } |
| 21930 | 1197 return XML_ROLE_GROUP_CLOSE_PLUS; |
| 1198 case XML_TOK_COMMA: | |
| 1199 state->handler = element6; | |
| 1200 return XML_ROLE_GROUP_SEQUENCE; | |
| 1201 case XML_TOK_OR: | |
| 1202 state->handler = element6; | |
| 1203 return XML_ROLE_GROUP_CHOICE; | |
| 1204 } | |
| 1205 return common(state, tok); | |
| 1206 } | |
| 1207 | |
| 1208 #ifdef XML_DTD | |
| 1209 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1210 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1211 condSect0(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1212 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1213 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1214 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1215 const ENCODING *enc) |
| 21930 | 1216 { |
| 1217 switch (tok) { | |
| 1218 case XML_TOK_PROLOG_S: | |
| 1219 return XML_ROLE_NONE; | |
| 1220 case XML_TOK_NAME: | |
| 1221 if (XmlNameMatchesAscii(enc, ptr, end, KW_INCLUDE)) { | |
| 1222 state->handler = condSect1; | |
| 1223 return XML_ROLE_NONE; | |
| 1224 } | |
| 1225 if (XmlNameMatchesAscii(enc, ptr, end, KW_IGNORE)) { | |
| 1226 state->handler = condSect2; | |
| 1227 return XML_ROLE_NONE; | |
| 1228 } | |
| 1229 break; | |
| 1230 } | |
| 1231 return common(state, tok); | |
| 1232 } | |
| 1233 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1234 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1235 condSect1(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1236 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1237 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1238 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1239 const ENCODING *enc) |
| 21930 | 1240 { |
| 1241 switch (tok) { | |
| 1242 case XML_TOK_PROLOG_S: | |
| 1243 return XML_ROLE_NONE; | |
| 1244 case XML_TOK_OPEN_BRACKET: | |
| 1245 state->handler = externalSubset1; | |
| 1246 state->includeLevel += 1; | |
| 1247 return XML_ROLE_NONE; | |
| 1248 } | |
| 1249 return common(state, tok); | |
| 1250 } | |
| 1251 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1252 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1253 condSect2(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1254 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1255 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1256 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1257 const ENCODING *enc) |
| 21930 | 1258 { |
| 1259 switch (tok) { | |
| 1260 case XML_TOK_PROLOG_S: | |
| 1261 return XML_ROLE_NONE; | |
| 1262 case XML_TOK_OPEN_BRACKET: | |
| 1263 state->handler = externalSubset1; | |
| 1264 return XML_ROLE_IGNORE_SECT; | |
| 1265 } | |
| 1266 return common(state, tok); | |
| 1267 } | |
| 1268 | |
| 1269 #endif /* XML_DTD */ | |
| 1270 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1271 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1272 declClose(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1273 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1274 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1275 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1276 const ENCODING *enc) |
| 21930 | 1277 { |
| 1278 switch (tok) { | |
| 1279 case XML_TOK_PROLOG_S: | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1280 return state->role_none; |
| 21930 | 1281 case XML_TOK_DECL_CLOSE: |
| 1282 setTopLevel(state); | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1283 return state->role_none; |
| 21930 | 1284 } |
| 1285 return common(state, tok); | |
| 1286 } | |
| 1287 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1288 static int PTRCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1289 error(PROLOG_STATE *state, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1290 int tok, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1291 const char *ptr, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1292 const char *end, |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1293 const ENCODING *enc) |
| 21930 | 1294 { |
| 1295 return XML_ROLE_NONE; | |
| 1296 } | |
| 1297 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1298 static int FASTCALL |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1299 common(PROLOG_STATE *state, int tok) |
| 21930 | 1300 { |
| 1301 #ifdef XML_DTD | |
| 1302 if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF) | |
| 1303 return XML_ROLE_INNER_PARAM_ENTITY_REF; | |
| 1304 #endif | |
| 1305 state->handler = error; | |
| 1306 return XML_ROLE_ERROR; | |
| 1307 } | |
| 1308 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1309 void |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1310 XmlPrologStateInit(PROLOG_STATE *state) |
| 21930 | 1311 { |
| 1312 state->handler = prolog0; | |
| 1313 #ifdef XML_DTD | |
| 1314 state->documentEntity = 1; | |
| 1315 state->includeLevel = 0; | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1316 state->inEntityValue = 0; |
| 21930 | 1317 #endif /* XML_DTD */ |
| 1318 } | |
| 1319 | |
| 1320 #ifdef XML_DTD | |
| 1321 | |
|
27384
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1322 void |
|
d363f83c2846
Incorporate Expat 1.95.6.
Martin v. Löwis <martin@v.loewis.de>
parents:
24273
diff
changeset
|
1323 XmlPrologStateInitExternalEntity(PROLOG_STATE *state) |
| 21930 | 1324 { |
| 1325 state->handler = externalSubset0; | |
| 1326 state->documentEntity = 0; | |
| 1327 state->includeLevel = 0; | |
| 1328 } | |
| 1329 | |
| 1330 #endif /* XML_DTD */ |
