Lines Matching refs:ptr

9 #define IS_INVALID_CHAR(enc, ptr, n) (0)  argument
12 #define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ argument
14 if (end - ptr < n) \
16 if (IS_INVALID_CHAR(enc, ptr, n)) { \
17 *(nextTokPtr) = (ptr); \
20 ptr += n; \
23 #define INVALID_CASES(ptr, nextTokPtr) \ argument
24 INVALID_LEAD_CASE(2, ptr, nextTokPtr) \
25 INVALID_LEAD_CASE(3, ptr, nextTokPtr) \
26 INVALID_LEAD_CASE(4, ptr, nextTokPtr) \
30 *(nextTokPtr) = (ptr); \
33 #define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ argument
35 if (end - ptr < n) \
37 if (!IS_NAME_CHAR(enc, ptr, n)) { \
38 *nextTokPtr = ptr; \
41 ptr += n; \
44 #define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ argument
46 if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \
47 *nextTokPtr = ptr; \
55 ptr += MINBPC(enc); \
57 CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \
58 CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \
59 CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr)
61 #define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ argument
63 if (end - ptr < n) \
65 if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \
66 *nextTokPtr = ptr; \
69 ptr += n; \
72 #define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ argument
74 if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \
75 *nextTokPtr = ptr; \
80 ptr += MINBPC(enc); \
82 CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \
83 CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \
84 CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr)
93 PREFIX(scanComment)(const ENCODING *enc, const char *ptr, in PREFIX()
96 if (ptr != end) { in PREFIX()
97 if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
98 *nextTokPtr = ptr; in PREFIX()
101 ptr += MINBPC(enc); in PREFIX()
102 while (ptr != end) { in PREFIX()
103 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
104 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
106 if ((ptr += MINBPC(enc)) == end) in PREFIX()
108 if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
109 if ((ptr += MINBPC(enc)) == end) in PREFIX()
111 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
112 *nextTokPtr = ptr; in PREFIX()
115 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
120 ptr += MINBPC(enc); in PREFIX()
131 PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, in PREFIX()
134 if (ptr == end) in PREFIX()
136 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
138 return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
140 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
144 ptr += MINBPC(enc); in PREFIX()
147 *nextTokPtr = ptr; in PREFIX()
150 while (ptr != end) { in PREFIX()
151 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
153 if (ptr + MINBPC(enc) == end) in PREFIX()
156 switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { in PREFIX()
158 *nextTokPtr = ptr; in PREFIX()
163 *nextTokPtr = ptr; in PREFIX()
167 ptr += MINBPC(enc); in PREFIX()
170 *nextTokPtr = ptr; in PREFIX()
178 PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, in PREFIX()
183 if (end - ptr != MINBPC(enc)*3) in PREFIX()
185 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
194 ptr += MINBPC(enc); in PREFIX()
195 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
204 ptr += MINBPC(enc); in PREFIX()
205 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
223 PREFIX(scanPi)(const ENCODING *enc, const char *ptr, in PREFIX()
227 const char *target = ptr; in PREFIX()
228 if (ptr == end) in PREFIX()
230 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
231 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
233 *nextTokPtr = ptr; in PREFIX()
236 while (ptr != end) { in PREFIX()
237 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
238 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
240 if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
241 *nextTokPtr = ptr; in PREFIX()
244 ptr += MINBPC(enc); in PREFIX()
245 while (ptr != end) { in PREFIX()
246 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
247 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
249 ptr += MINBPC(enc); in PREFIX()
250 if (ptr == end) in PREFIX()
252 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
253 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
258 ptr += MINBPC(enc); in PREFIX()
264 if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
265 *nextTokPtr = ptr; in PREFIX()
268 ptr += MINBPC(enc); in PREFIX()
269 if (ptr == end) in PREFIX()
271 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
272 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
277 *nextTokPtr = ptr; in PREFIX()
285 PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, in PREFIX()
292 if (end - ptr < 6 * MINBPC(enc)) in PREFIX()
294 for (i = 0; i < 6; i++, ptr += MINBPC(enc)) { in PREFIX()
295 if (!CHAR_MATCHES(enc, ptr, CDATA_LSQB[i])) { in PREFIX()
296 *nextTokPtr = ptr; in PREFIX()
300 *nextTokPtr = ptr; in PREFIX()
305 PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, in PREFIX()
308 if (ptr == end) in PREFIX()
311 size_t n = end - ptr; in PREFIX()
316 end = ptr + n; in PREFIX()
319 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
321 ptr += MINBPC(enc); in PREFIX()
322 if (ptr == end) in PREFIX()
324 if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
326 ptr += MINBPC(enc); in PREFIX()
327 if (ptr == end) in PREFIX()
329 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
330 ptr -= MINBPC(enc); in PREFIX()
333 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
336 ptr += MINBPC(enc); in PREFIX()
337 if (ptr == end) in PREFIX()
339 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
340 ptr += MINBPC(enc); in PREFIX()
341 *nextTokPtr = ptr; in PREFIX()
344 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
346 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
348 ptr += MINBPC(enc); in PREFIX()
351 while (ptr != end) { in PREFIX()
352 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
355 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
356 *nextTokPtr = ptr; \ in PREFIX()
359 ptr += n; \ in PREFIX()
369 *nextTokPtr = ptr; in PREFIX()
372 ptr += MINBPC(enc); in PREFIX()
376 *nextTokPtr = ptr; in PREFIX()
383 PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, in PREFIX()
386 if (ptr == end) in PREFIX()
388 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
389 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
391 *nextTokPtr = ptr; in PREFIX()
394 while (ptr != end) { in PREFIX()
395 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
396 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
398 for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) { in PREFIX()
399 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
403 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
406 *nextTokPtr = ptr; in PREFIX()
415 ptr += MINBPC(enc); in PREFIX()
419 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
422 *nextTokPtr = ptr; in PREFIX()
432 PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, in PREFIX()
435 if (ptr != end) { in PREFIX()
436 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
441 *nextTokPtr = ptr; in PREFIX()
444 for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) { in PREFIX()
445 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
450 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
453 *nextTokPtr = ptr; in PREFIX()
464 PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, in PREFIX()
467 if (ptr != end) { in PREFIX()
468 if (CHAR_MATCHES(enc, ptr, ASCII_x)) in PREFIX()
469 return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
470 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
474 *nextTokPtr = ptr; in PREFIX()
477 for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) { in PREFIX()
478 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
482 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
485 *nextTokPtr = ptr; in PREFIX()
496 PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
499 if (ptr == end) in PREFIX()
501 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
502 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
504 return PREFIX(scanCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
506 *nextTokPtr = ptr; in PREFIX()
509 while (ptr != end) { in PREFIX()
510 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
511 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
513 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
516 *nextTokPtr = ptr; in PREFIX()
526 PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
532 while (ptr != end) { in PREFIX()
533 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
534 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
538 *nextTokPtr = ptr; in PREFIX()
542 ptr += MINBPC(enc); in PREFIX()
543 if (ptr == end) in PREFIX()
545 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
546 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
548 *nextTokPtr = ptr; in PREFIX()
557 ptr += MINBPC(enc); in PREFIX()
558 if (ptr == end) in PREFIX()
560 t = BYTE_TYPE(enc, ptr); in PREFIX()
569 *nextTokPtr = ptr; in PREFIX()
581 ptr += MINBPC(enc); in PREFIX()
582 if (ptr == end) in PREFIX()
584 open = BYTE_TYPE(enc, ptr); in PREFIX()
593 *nextTokPtr = ptr; in PREFIX()
597 ptr += MINBPC(enc); in PREFIX()
601 if (ptr == end) in PREFIX()
603 t = BYTE_TYPE(enc, ptr); in PREFIX()
607 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
610 int tok = PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, &ptr); in PREFIX()
613 *nextTokPtr = ptr; in PREFIX()
619 *nextTokPtr = ptr; in PREFIX()
622 ptr += MINBPC(enc); in PREFIX()
626 ptr += MINBPC(enc); in PREFIX()
627 if (ptr == end) in PREFIX()
629 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
639 *nextTokPtr = ptr; in PREFIX()
644 ptr += MINBPC(enc); in PREFIX()
645 if (ptr == end) in PREFIX()
647 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
648 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
653 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
657 ptr += MINBPC(enc); in PREFIX()
658 if (ptr == end) in PREFIX()
660 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
661 *nextTokPtr = ptr; in PREFIX()
664 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
667 *nextTokPtr = ptr; in PREFIX()
675 *nextTokPtr = ptr; in PREFIX()
685 PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
691 if (ptr == end) in PREFIX()
693 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
694 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
696 if ((ptr += MINBPC(enc)) == end) in PREFIX()
698 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
700 return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
702 return PREFIX(scanCdataSection)(enc, ptr + MINBPC(enc), in PREFIX()
705 *nextTokPtr = ptr; in PREFIX()
708 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
710 return PREFIX(scanEndTag)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
712 *nextTokPtr = ptr; in PREFIX()
719 while (ptr != end) { in PREFIX()
720 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
721 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
725 *nextTokPtr = ptr; in PREFIX()
729 ptr += MINBPC(enc); in PREFIX()
730 if (ptr == end) in PREFIX()
732 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
733 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
735 *nextTokPtr = ptr; in PREFIX()
742 ptr += MINBPC(enc); in PREFIX()
743 while (ptr != end) { in PREFIX()
744 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
745 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
751 ptr += MINBPC(enc); in PREFIX()
754 *nextTokPtr = ptr; in PREFIX()
757 return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); in PREFIX()
763 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
767 ptr += MINBPC(enc); in PREFIX()
768 if (ptr == end) in PREFIX()
770 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
771 *nextTokPtr = ptr; in PREFIX()
774 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
777 *nextTokPtr = ptr; in PREFIX()
785 PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
788 if (ptr == end) in PREFIX()
791 size_t n = end - ptr; in PREFIX()
796 end = ptr + n; in PREFIX()
799 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
801 return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
803 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
805 ptr += MINBPC(enc); in PREFIX()
806 if (ptr == end) in PREFIX()
808 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
809 ptr += MINBPC(enc); in PREFIX()
810 *nextTokPtr = ptr; in PREFIX()
813 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
816 ptr += MINBPC(enc); in PREFIX()
817 if (ptr == end) in PREFIX()
819 if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
821 ptr += MINBPC(enc); in PREFIX()
822 if (ptr == end) in PREFIX()
824 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
825 ptr -= MINBPC(enc); in PREFIX()
828 *nextTokPtr = ptr; in PREFIX()
830 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
832 ptr += MINBPC(enc); in PREFIX()
835 while (ptr != end) { in PREFIX()
836 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
839 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
840 *nextTokPtr = ptr; \ in PREFIX()
843 ptr += n; \ in PREFIX()
848 if (ptr + MINBPC(enc) != end) { in PREFIX()
849 if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { in PREFIX()
850 ptr += MINBPC(enc); in PREFIX()
853 if (ptr + 2*MINBPC(enc) != end) { in PREFIX()
854 if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) { in PREFIX()
855 ptr += MINBPC(enc); in PREFIX()
858 *nextTokPtr = ptr + 2*MINBPC(enc); in PREFIX()
870 *nextTokPtr = ptr; in PREFIX()
873 ptr += MINBPC(enc); in PREFIX()
877 *nextTokPtr = ptr; in PREFIX()
884 PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
887 if (ptr == end) in PREFIX()
889 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
890 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
892 *nextTokPtr = ptr; in PREFIX()
895 *nextTokPtr = ptr; in PREFIX()
898 while (ptr != end) { in PREFIX()
899 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
900 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
902 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
905 *nextTokPtr = ptr; in PREFIX()
913 PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
916 if (ptr == end) in PREFIX()
918 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
919 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
921 *nextTokPtr = ptr; in PREFIX()
924 while (ptr != end) { in PREFIX()
925 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
926 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
929 *nextTokPtr = ptr; in PREFIX()
932 *nextTokPtr = ptr; in PREFIX()
941 const char *ptr, const char *end, in PREFIX()
944 while (ptr != end) { in PREFIX()
945 int t = BYTE_TYPE(enc, ptr); in PREFIX()
947 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
950 ptr += MINBPC(enc); in PREFIX()
953 if (ptr == end) in PREFIX()
955 *nextTokPtr = ptr; in PREFIX()
956 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
964 ptr += MINBPC(enc); in PREFIX()
972 PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
976 if (ptr == end) in PREFIX()
979 size_t n = end - ptr; in PREFIX()
984 end = ptr + n; in PREFIX()
987 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
989 return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
991 return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
994 ptr += MINBPC(enc); in PREFIX()
995 if (ptr == end) in PREFIX()
997 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
999 return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1001 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1008 *nextTokPtr = ptr - MINBPC(enc); in PREFIX()
1011 *nextTokPtr = ptr; in PREFIX()
1015 if (ptr + MINBPC(enc) == end) { in PREFIX()
1023 ptr += MINBPC(enc); in PREFIX()
1024 if (ptr == end) in PREFIX()
1026 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1031 if (ptr + MINBPC(enc) != end) in PREFIX()
1035 *nextTokPtr = ptr; in PREFIX()
1039 *nextTokPtr = ptr; in PREFIX()
1042 return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1044 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1047 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1050 ptr += MINBPC(enc); in PREFIX()
1051 if (ptr == end) in PREFIX()
1053 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1054 if (ptr + MINBPC(enc) == end) in PREFIX()
1056 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { in PREFIX()
1057 *nextTokPtr = ptr + 2*MINBPC(enc); in PREFIX()
1061 *nextTokPtr = ptr; in PREFIX()
1064 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1067 ptr += MINBPC(enc); in PREFIX()
1068 if (ptr == end) in PREFIX()
1070 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1072 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1075 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1078 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1083 *nextTokPtr = ptr; in PREFIX()
1086 *nextTokPtr = ptr; in PREFIX()
1089 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1092 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1095 return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1098 if (end - ptr < n) \ in PREFIX()
1100 if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ in PREFIX()
1101 ptr += n; \ in PREFIX()
1105 if (IS_NAME_CHAR(enc, ptr, n)) { \ in PREFIX()
1106 ptr += n; \ in PREFIX()
1110 *nextTokPtr = ptr; \ in PREFIX()
1117 ptr += MINBPC(enc); in PREFIX()
1126 ptr += MINBPC(enc); in PREFIX()
1129 if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1130 ptr += MINBPC(enc); in PREFIX()
1134 if (IS_NAME_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1135 ptr += MINBPC(enc); in PREFIX()
1141 *nextTokPtr = ptr; in PREFIX()
1144 while (ptr != end) { in PREFIX()
1145 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1146 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1150 *nextTokPtr = ptr; in PREFIX()
1154 ptr += MINBPC(enc); in PREFIX()
1157 if (ptr == end) in PREFIX()
1160 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1161 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1175 *nextTokPtr = ptr; in PREFIX()
1178 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1182 *nextTokPtr = ptr; in PREFIX()
1185 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1189 *nextTokPtr = ptr; in PREFIX()
1192 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1195 *nextTokPtr = ptr; in PREFIX()
1203 PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1207 if (ptr == end) in PREFIX()
1209 start = ptr; in PREFIX()
1210 while (ptr != end) { in PREFIX()
1211 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1213 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1217 if (ptr == start) in PREFIX()
1218 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1219 *nextTokPtr = ptr; in PREFIX()
1223 *nextTokPtr = ptr; in PREFIX()
1226 if (ptr == start) { in PREFIX()
1227 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1230 *nextTokPtr = ptr; in PREFIX()
1233 if (ptr == start) { in PREFIX()
1234 ptr += MINBPC(enc); in PREFIX()
1235 if (ptr == end) in PREFIX()
1237 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1238 ptr += MINBPC(enc); in PREFIX()
1239 *nextTokPtr = ptr; in PREFIX()
1242 *nextTokPtr = ptr; in PREFIX()
1245 if (ptr == start) { in PREFIX()
1246 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1249 *nextTokPtr = ptr; in PREFIX()
1252 ptr += MINBPC(enc); in PREFIX()
1256 *nextTokPtr = ptr; in PREFIX()
1261 PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1265 if (ptr == end) in PREFIX()
1267 start = ptr; in PREFIX()
1268 while (ptr != end) { in PREFIX()
1269 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1271 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1275 if (ptr == start) in PREFIX()
1276 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1277 *nextTokPtr = ptr; in PREFIX()
1280 if (ptr == start) { in PREFIX()
1281 int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), in PREFIX()
1285 *nextTokPtr = ptr; in PREFIX()
1288 if (ptr == start) { in PREFIX()
1289 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1292 *nextTokPtr = ptr; in PREFIX()
1295 if (ptr == start) { in PREFIX()
1296 ptr += MINBPC(enc); in PREFIX()
1297 if (ptr == end) in PREFIX()
1299 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1300 ptr += MINBPC(enc); in PREFIX()
1301 *nextTokPtr = ptr; in PREFIX()
1304 *nextTokPtr = ptr; in PREFIX()
1307 ptr += MINBPC(enc); in PREFIX()
1311 *nextTokPtr = ptr; in PREFIX()
1318 PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1323 size_t n = end - ptr; in PREFIX()
1326 end = ptr + n; in PREFIX()
1329 while (ptr != end) { in PREFIX()
1330 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1331 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
1333 if ((ptr += MINBPC(enc)) == end) in PREFIX()
1335 if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { in PREFIX()
1336 if ((ptr += MINBPC(enc)) == end) in PREFIX()
1338 if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { in PREFIX()
1340 ptr += MINBPC(enc); in PREFIX()
1345 if ((ptr += MINBPC(enc)) == end) in PREFIX()
1347 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1348 if ((ptr += MINBPC(enc)) == end) in PREFIX()
1350 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
1351 ptr += MINBPC(enc); in PREFIX()
1353 *nextTokPtr = ptr; in PREFIX()
1361 ptr += MINBPC(enc); in PREFIX()
1371 PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1374 ptr += MINBPC(enc); in PREFIX()
1376 for (; ptr != end; ptr += MINBPC(enc)) { in PREFIX()
1377 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1401 if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { in PREFIX()
1402 *badPtr = ptr; in PREFIX()
1408 if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) in PREFIX()
1411 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1416 *badPtr = ptr; in PREFIX()
1431 PREFIX(getAtts)(const ENCODING *enc, const char *ptr, in PREFIX()
1439 for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { in PREFIX()
1440 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1444 atts[nAtts].name = ptr; \ in PREFIX()
1450 case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; in PREFIX()
1462 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1469 atts[nAtts].valueEnd = ptr; in PREFIX()
1476 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1483 atts[nAtts].valueEnd = ptr; in PREFIX()
1497 && (ptr == atts[nAtts].valuePtr in PREFIX()
1498 || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE in PREFIX()
1499 || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE in PREFIX()
1500 || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) in PREFIX()
1524 PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) in PREFIX()
1528 ptr += 2*MINBPC(enc); in PREFIX()
1529 if (CHAR_MATCHES(enc, ptr, ASCII_x)) { in PREFIX()
1530 for (ptr += MINBPC(enc); in PREFIX()
1531 !CHAR_MATCHES(enc, ptr, ASCII_SEMI); in PREFIX()
1532 ptr += MINBPC(enc)) { in PREFIX()
1533 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1556 for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { in PREFIX()
1557 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1568 PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, in PREFIX()
1571 switch ((end - ptr)/MINBPC(enc)) { in PREFIX()
1573 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { in PREFIX()
1574 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1583 if (CHAR_MATCHES(enc, ptr, ASCII_a)) { in PREFIX()
1584 ptr += MINBPC(enc); in PREFIX()
1585 if (CHAR_MATCHES(enc, ptr, ASCII_m)) { in PREFIX()
1586 ptr += MINBPC(enc); in PREFIX()
1587 if (CHAR_MATCHES(enc, ptr, ASCII_p)) in PREFIX()
1593 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1595 ptr += MINBPC(enc); in PREFIX()
1596 if (CHAR_MATCHES(enc, ptr, ASCII_u)) { in PREFIX()
1597 ptr += MINBPC(enc); in PREFIX()
1598 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1599 ptr += MINBPC(enc); in PREFIX()
1600 if (CHAR_MATCHES(enc, ptr, ASCII_t)) in PREFIX()
1606 ptr += MINBPC(enc); in PREFIX()
1607 if (CHAR_MATCHES(enc, ptr, ASCII_p)) { in PREFIX()
1608 ptr += MINBPC(enc); in PREFIX()
1609 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1610 ptr += MINBPC(enc); in PREFIX()
1611 if (CHAR_MATCHES(enc, ptr, ASCII_s)) in PREFIX()
1699 PREFIX(nameLength)(const ENCODING *enc, const char *ptr) in PREFIX()
1701 const char *start = ptr; in PREFIX()
1703 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1705 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1717 ptr += MINBPC(enc); in PREFIX()
1720 return (int)(ptr - start); in PREFIX()
1726 PREFIX(skipS)(const ENCODING *enc, const char *ptr) in PREFIX()
1729 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1733 ptr += MINBPC(enc); in PREFIX()
1736 return ptr; in PREFIX()
1743 const char *ptr, in PREFIX()
1747 while (ptr < end) { in PREFIX()
1748 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1751 ptr += n; \ in PREFIX()
1758 ptr += MINBPC(enc); in PREFIX()
1762 ptr += MINBPC(enc); in PREFIX()
1763 if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1764 ptr += MINBPC(enc); in PREFIX()
1768 ptr += MINBPC(enc); in PREFIX()