• Home
  • Raw
  • Download

Lines Matching refs:ptr

36 #define IS_INVALID_CHAR(enc, ptr, n) (0)  argument
39 #define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ argument
41 if (end - ptr < n) \
43 if (IS_INVALID_CHAR(enc, ptr, n)) { \
44 *(nextTokPtr) = (ptr); \
47 ptr += n; \
50 #define INVALID_CASES(ptr, nextTokPtr) \ argument
51 INVALID_LEAD_CASE(2, ptr, nextTokPtr) \
52 INVALID_LEAD_CASE(3, ptr, nextTokPtr) \
53 INVALID_LEAD_CASE(4, ptr, nextTokPtr) \
57 *(nextTokPtr) = (ptr); \
60 #define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ argument
62 if (end - ptr < n) \
64 if (!IS_NAME_CHAR(enc, ptr, n)) { \
65 *nextTokPtr = ptr; \
68 ptr += n; \
71 #define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ argument
73 if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \
74 *nextTokPtr = ptr; \
83 ptr += MINBPC(enc); \
85 CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \
86 CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \
87 CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr)
89 #define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ argument
91 if (end - ptr < n) \
93 if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \
94 *nextTokPtr = ptr; \
97 ptr += n; \
100 #define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ argument
102 if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \
103 *nextTokPtr = ptr; \
109 ptr += MINBPC(enc); \
111 CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \
112 CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \
113 CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr)
120 #define HAS_CHARS(enc, ptr, end, count) \ argument
121 (end - ptr >= count * MINBPC(enc))
123 #define HAS_CHAR(enc, ptr, end) \ argument
124 HAS_CHARS(enc, ptr, end, 1)
126 #define REQUIRE_CHARS(enc, ptr, end, count) \ argument
128 if (! HAS_CHARS(enc, ptr, end, count)) { \
133 #define REQUIRE_CHAR(enc, ptr, end) \ argument
134 REQUIRE_CHARS(enc, ptr, end, 1)
140 PREFIX(scanComment)(const ENCODING *enc, const char *ptr, in PREFIX()
143 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
144 if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
145 *nextTokPtr = ptr; in PREFIX()
148 ptr += MINBPC(enc); in PREFIX()
149 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
150 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
151 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
153 ptr += MINBPC(enc); in PREFIX()
154 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
155 if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
156 ptr += MINBPC(enc); in PREFIX()
157 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
158 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
159 *nextTokPtr = ptr; in PREFIX()
162 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
167 ptr += MINBPC(enc); in PREFIX()
178 PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, in PREFIX()
181 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
182 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
184 return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
186 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
190 ptr += MINBPC(enc); in PREFIX()
193 *nextTokPtr = ptr; in PREFIX()
196 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
197 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
199 REQUIRE_CHARS(enc, ptr, end, 2); in PREFIX()
201 switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { in PREFIX()
203 *nextTokPtr = ptr; in PREFIX()
208 *nextTokPtr = ptr; in PREFIX()
212 ptr += MINBPC(enc); in PREFIX()
215 *nextTokPtr = ptr; in PREFIX()
223 PREFIX(checkPiTarget)(const ENCODING *UNUSED_P(enc), const char *ptr, in PREFIX()
228 if (end - ptr != MINBPC(enc)*3) in PREFIX()
230 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
239 ptr += MINBPC(enc); in PREFIX()
240 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
249 ptr += MINBPC(enc); in PREFIX()
250 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
268 PREFIX(scanPi)(const ENCODING *enc, const char *ptr, in PREFIX()
272 const char *target = ptr; in PREFIX()
273 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
274 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
275 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
277 *nextTokPtr = ptr; in PREFIX()
280 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
281 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
282 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
284 if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
285 *nextTokPtr = ptr; in PREFIX()
288 ptr += MINBPC(enc); in PREFIX()
289 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
290 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
291 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
293 ptr += MINBPC(enc); in PREFIX()
294 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
295 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
296 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
301 ptr += MINBPC(enc); in PREFIX()
307 if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
308 *nextTokPtr = ptr; in PREFIX()
311 ptr += MINBPC(enc); in PREFIX()
312 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
313 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
314 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
319 *nextTokPtr = ptr; in PREFIX()
327 PREFIX(scanCdataSection)(const ENCODING *UNUSED_P(enc), const char *ptr, in PREFIX()
334 REQUIRE_CHARS(enc, ptr, end, 6); in PREFIX()
335 for (i = 0; i < 6; i++, ptr += MINBPC(enc)) { in PREFIX()
336 if (!CHAR_MATCHES(enc, ptr, CDATA_LSQB[i])) { in PREFIX()
337 *nextTokPtr = ptr; in PREFIX()
341 *nextTokPtr = ptr; in PREFIX()
346 PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, in PREFIX()
349 if (ptr >= end) in PREFIX()
352 size_t n = end - ptr; in PREFIX()
357 end = ptr + n; in PREFIX()
360 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
362 ptr += MINBPC(enc); in PREFIX()
363 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
364 if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
366 ptr += MINBPC(enc); in PREFIX()
367 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
368 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
369 ptr -= MINBPC(enc); in PREFIX()
372 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
375 ptr += MINBPC(enc); in PREFIX()
376 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
377 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
378 ptr += MINBPC(enc); in PREFIX()
379 *nextTokPtr = ptr; in PREFIX()
382 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
384 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
386 ptr += MINBPC(enc); in PREFIX()
389 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
390 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
393 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
394 *nextTokPtr = ptr; \ in PREFIX()
397 ptr += n; \ in PREFIX()
407 *nextTokPtr = ptr; in PREFIX()
410 ptr += MINBPC(enc); in PREFIX()
414 *nextTokPtr = ptr; in PREFIX()
421 PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, in PREFIX()
424 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
425 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
426 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
428 *nextTokPtr = ptr; in PREFIX()
431 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
432 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
433 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
435 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
436 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
440 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
443 *nextTokPtr = ptr; in PREFIX()
452 ptr += MINBPC(enc); in PREFIX()
456 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
459 *nextTokPtr = ptr; in PREFIX()
469 PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, in PREFIX()
472 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
473 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
478 *nextTokPtr = ptr; in PREFIX()
481 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
482 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
487 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
490 *nextTokPtr = ptr; in PREFIX()
501 PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, in PREFIX()
504 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
505 if (CHAR_MATCHES(enc, ptr, ASCII_x)) in PREFIX()
506 return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
507 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
511 *nextTokPtr = ptr; in PREFIX()
514 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
515 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
519 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
522 *nextTokPtr = ptr; in PREFIX()
533 PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
536 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
537 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
538 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
540 return PREFIX(scanCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
542 *nextTokPtr = ptr; in PREFIX()
545 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
546 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
547 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
549 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
552 *nextTokPtr = ptr; in PREFIX()
562 PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
568 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
569 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
570 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
574 *nextTokPtr = ptr; in PREFIX()
578 ptr += MINBPC(enc); in PREFIX()
579 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
580 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
581 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
583 *nextTokPtr = ptr; in PREFIX()
592 ptr += MINBPC(enc); in PREFIX()
593 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
594 t = BYTE_TYPE(enc, ptr); in PREFIX()
603 *nextTokPtr = ptr; in PREFIX()
615 ptr += MINBPC(enc); in PREFIX()
616 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
617 open = BYTE_TYPE(enc, ptr); in PREFIX()
626 *nextTokPtr = ptr; in PREFIX()
630 ptr += MINBPC(enc); in PREFIX()
634 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
635 t = BYTE_TYPE(enc, ptr); in PREFIX()
639 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
642 int tok = PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, &ptr); in PREFIX()
645 *nextTokPtr = ptr; in PREFIX()
651 *nextTokPtr = ptr; in PREFIX()
654 ptr += MINBPC(enc); in PREFIX()
658 ptr += MINBPC(enc); in PREFIX()
659 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
660 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
670 *nextTokPtr = ptr; in PREFIX()
675 ptr += MINBPC(enc); in PREFIX()
676 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
677 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
678 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
683 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
687 ptr += MINBPC(enc); in PREFIX()
688 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
689 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
690 *nextTokPtr = ptr; in PREFIX()
693 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
696 *nextTokPtr = ptr; in PREFIX()
704 *nextTokPtr = ptr; in PREFIX()
714 PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
720 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
721 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
722 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
724 ptr += MINBPC(enc); in PREFIX()
725 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
726 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
728 return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
730 return PREFIX(scanCdataSection)(enc, ptr + MINBPC(enc), in PREFIX()
733 *nextTokPtr = ptr; in PREFIX()
736 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
738 return PREFIX(scanEndTag)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
740 *nextTokPtr = ptr; in PREFIX()
747 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
748 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
749 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
753 *nextTokPtr = ptr; in PREFIX()
757 ptr += MINBPC(enc); in PREFIX()
758 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
759 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
760 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
762 *nextTokPtr = ptr; in PREFIX()
769 ptr += MINBPC(enc); in PREFIX()
770 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
771 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
772 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
778 ptr += MINBPC(enc); in PREFIX()
781 *nextTokPtr = ptr; in PREFIX()
784 return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); in PREFIX()
790 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
794 ptr += MINBPC(enc); in PREFIX()
795 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
796 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
797 *nextTokPtr = ptr; in PREFIX()
800 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
803 *nextTokPtr = ptr; in PREFIX()
811 PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
814 if (ptr >= end) in PREFIX()
817 size_t n = end - ptr; in PREFIX()
822 end = ptr + n; in PREFIX()
825 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
827 return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
829 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
831 ptr += MINBPC(enc); in PREFIX()
832 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
834 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
835 ptr += MINBPC(enc); in PREFIX()
836 *nextTokPtr = ptr; in PREFIX()
839 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
842 ptr += MINBPC(enc); in PREFIX()
843 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
845 if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
847 ptr += MINBPC(enc); in PREFIX()
848 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
850 if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
851 ptr -= MINBPC(enc); in PREFIX()
854 *nextTokPtr = ptr; in PREFIX()
856 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
858 ptr += MINBPC(enc); in PREFIX()
861 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
862 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
865 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
866 *nextTokPtr = ptr; \ in PREFIX()
869 ptr += n; \ in PREFIX()
874 if (HAS_CHARS(enc, ptr, end, 2)) { in PREFIX()
875 if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { in PREFIX()
876 ptr += MINBPC(enc); in PREFIX()
879 if (HAS_CHARS(enc, ptr, end, 3)) { in PREFIX()
880 if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) { in PREFIX()
881 ptr += MINBPC(enc); in PREFIX()
884 *nextTokPtr = ptr + 2*MINBPC(enc); in PREFIX()
896 *nextTokPtr = ptr; in PREFIX()
899 ptr += MINBPC(enc); in PREFIX()
903 *nextTokPtr = ptr; in PREFIX()
910 PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
913 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
914 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
915 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
917 *nextTokPtr = ptr; in PREFIX()
920 *nextTokPtr = ptr; in PREFIX()
923 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
924 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
925 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
927 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
930 *nextTokPtr = ptr; in PREFIX()
938 PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
941 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
942 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
943 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
945 *nextTokPtr = ptr; in PREFIX()
948 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
949 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
950 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
953 *nextTokPtr = ptr; in PREFIX()
956 *nextTokPtr = ptr; in PREFIX()
965 const char *ptr, const char *end, in PREFIX()
968 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
969 int t = BYTE_TYPE(enc, ptr); in PREFIX()
971 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
974 ptr += MINBPC(enc); in PREFIX()
977 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
979 *nextTokPtr = ptr; in PREFIX()
980 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
988 ptr += MINBPC(enc); in PREFIX()
996 PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1000 if (ptr >= end) in PREFIX()
1003 size_t n = end - ptr; in PREFIX()
1008 end = ptr + n; in PREFIX()
1011 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1013 return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1015 return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1018 ptr += MINBPC(enc); in PREFIX()
1019 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1020 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1022 return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1024 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1031 *nextTokPtr = ptr - MINBPC(enc); in PREFIX()
1034 *nextTokPtr = ptr; in PREFIX()
1038 if (ptr + MINBPC(enc) == end) { in PREFIX()
1046 ptr += MINBPC(enc); in PREFIX()
1047 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1049 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1054 if (ptr + MINBPC(enc) != end) in PREFIX()
1058 *nextTokPtr = ptr; in PREFIX()
1062 *nextTokPtr = ptr; in PREFIX()
1065 return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1067 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1070 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1073 ptr += MINBPC(enc); in PREFIX()
1074 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1076 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1077 REQUIRE_CHARS(enc, ptr, end, 2); in PREFIX()
1078 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { in PREFIX()
1079 *nextTokPtr = ptr + 2*MINBPC(enc); in PREFIX()
1083 *nextTokPtr = ptr; in PREFIX()
1086 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1089 ptr += MINBPC(enc); in PREFIX()
1090 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1092 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1094 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1097 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1100 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1105 *nextTokPtr = ptr; in PREFIX()
1108 *nextTokPtr = ptr; in PREFIX()
1111 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1114 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1117 return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1120 if (end - ptr < n) \ in PREFIX()
1122 if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ in PREFIX()
1123 ptr += n; \ in PREFIX()
1127 if (IS_NAME_CHAR(enc, ptr, n)) { \ in PREFIX()
1128 ptr += n; \ in PREFIX()
1132 *nextTokPtr = ptr; \ in PREFIX()
1139 ptr += MINBPC(enc); in PREFIX()
1148 ptr += MINBPC(enc); in PREFIX()
1151 if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1152 ptr += MINBPC(enc); in PREFIX()
1156 if (IS_NAME_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1157 ptr += MINBPC(enc); in PREFIX()
1163 *nextTokPtr = ptr; in PREFIX()
1166 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1167 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1168 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1172 *nextTokPtr = ptr; in PREFIX()
1176 ptr += MINBPC(enc); in PREFIX()
1179 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1181 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1182 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1196 *nextTokPtr = ptr; in PREFIX()
1199 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1203 *nextTokPtr = ptr; in PREFIX()
1206 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1210 *nextTokPtr = ptr; in PREFIX()
1213 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1216 *nextTokPtr = ptr; in PREFIX()
1224 PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1228 if (ptr >= end) in PREFIX()
1230 else if (! HAS_CHAR(enc, ptr, end)) { in PREFIX()
1238 start = ptr; in PREFIX()
1239 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1240 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1242 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1246 if (ptr == start) in PREFIX()
1247 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1248 *nextTokPtr = ptr; in PREFIX()
1252 *nextTokPtr = ptr; in PREFIX()
1255 if (ptr == start) { in PREFIX()
1256 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1259 *nextTokPtr = ptr; in PREFIX()
1262 if (ptr == start) { in PREFIX()
1263 ptr += MINBPC(enc); in PREFIX()
1264 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1266 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1267 ptr += MINBPC(enc); in PREFIX()
1268 *nextTokPtr = ptr; in PREFIX()
1271 *nextTokPtr = ptr; in PREFIX()
1274 if (ptr == start) { in PREFIX()
1275 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1278 *nextTokPtr = ptr; in PREFIX()
1281 ptr += MINBPC(enc); in PREFIX()
1285 *nextTokPtr = ptr; in PREFIX()
1290 PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1294 if (ptr >= end) in PREFIX()
1296 else if (! HAS_CHAR(enc, ptr, end)) { in PREFIX()
1304 start = ptr; in PREFIX()
1305 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1306 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1308 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1312 if (ptr == start) in PREFIX()
1313 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1314 *nextTokPtr = ptr; in PREFIX()
1317 if (ptr == start) { in PREFIX()
1318 int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), in PREFIX()
1322 *nextTokPtr = ptr; in PREFIX()
1325 if (ptr == start) { in PREFIX()
1326 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1329 *nextTokPtr = ptr; in PREFIX()
1332 if (ptr == start) { in PREFIX()
1333 ptr += MINBPC(enc); in PREFIX()
1334 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1336 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1337 ptr += MINBPC(enc); in PREFIX()
1338 *nextTokPtr = ptr; in PREFIX()
1341 *nextTokPtr = ptr; in PREFIX()
1344 ptr += MINBPC(enc); in PREFIX()
1348 *nextTokPtr = ptr; in PREFIX()
1355 PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, in PREFIX()
1360 size_t n = end - ptr; in PREFIX()
1363 end = ptr + n; in PREFIX()
1366 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1367 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1368 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
1370 ptr += MINBPC(enc); in PREFIX()
1371 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1372 if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { in PREFIX()
1373 ptr += MINBPC(enc); in PREFIX()
1374 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1375 if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { in PREFIX()
1377 ptr += MINBPC(enc); in PREFIX()
1382 ptr += MINBPC(enc); in PREFIX()
1383 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1384 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1385 ptr += MINBPC(enc); in PREFIX()
1386 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1387 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
1388 ptr += MINBPC(enc); in PREFIX()
1390 *nextTokPtr = ptr; in PREFIX()
1398 ptr += MINBPC(enc); in PREFIX()
1408 PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1411 ptr += MINBPC(enc); in PREFIX()
1413 for (; HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
1414 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1438 if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { in PREFIX()
1439 *badPtr = ptr; in PREFIX()
1445 if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) in PREFIX()
1449 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1454 *badPtr = ptr; in PREFIX()
1469 PREFIX(getAtts)(const ENCODING *enc, const char *ptr, in PREFIX()
1477 for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { in PREFIX()
1478 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1482 atts[nAtts].name = ptr; \ in PREFIX()
1488 case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; in PREFIX()
1500 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1507 atts[nAtts].valueEnd = ptr; in PREFIX()
1514 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1521 atts[nAtts].valueEnd = ptr; in PREFIX()
1535 && (ptr == atts[nAtts].valuePtr in PREFIX()
1536 || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE in PREFIX()
1537 || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE in PREFIX()
1538 || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) in PREFIX()
1562 PREFIX(charRefNumber)(const ENCODING *UNUSED_P(enc), const char *ptr) in PREFIX()
1566 ptr += 2*MINBPC(enc); in PREFIX()
1567 if (CHAR_MATCHES(enc, ptr, ASCII_x)) { in PREFIX()
1568 for (ptr += MINBPC(enc); in PREFIX()
1569 !CHAR_MATCHES(enc, ptr, ASCII_SEMI); in PREFIX()
1570 ptr += MINBPC(enc)) { in PREFIX()
1571 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1594 for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { in PREFIX()
1595 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1606 PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr, in PREFIX()
1609 switch ((end - ptr)/MINBPC(enc)) { in PREFIX()
1611 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { in PREFIX()
1612 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1621 if (CHAR_MATCHES(enc, ptr, ASCII_a)) { in PREFIX()
1622 ptr += MINBPC(enc); in PREFIX()
1623 if (CHAR_MATCHES(enc, ptr, ASCII_m)) { in PREFIX()
1624 ptr += MINBPC(enc); in PREFIX()
1625 if (CHAR_MATCHES(enc, ptr, ASCII_p)) in PREFIX()
1631 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1633 ptr += MINBPC(enc); in PREFIX()
1634 if (CHAR_MATCHES(enc, ptr, ASCII_u)) { in PREFIX()
1635 ptr += MINBPC(enc); in PREFIX()
1636 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1637 ptr += MINBPC(enc); in PREFIX()
1638 if (CHAR_MATCHES(enc, ptr, ASCII_t)) in PREFIX()
1644 ptr += MINBPC(enc); in PREFIX()
1645 if (CHAR_MATCHES(enc, ptr, ASCII_p)) { in PREFIX()
1646 ptr += MINBPC(enc); in PREFIX()
1647 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1648 ptr += MINBPC(enc); in PREFIX()
1649 if (CHAR_MATCHES(enc, ptr, ASCII_s)) in PREFIX()
1679 PREFIX(nameLength)(const ENCODING *enc, const char *ptr) in PREFIX()
1681 const char *start = ptr; in PREFIX()
1683 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1685 case BT_LEAD ## n: ptr += n; break; in PREFIX()
1697 ptr += MINBPC(enc); in PREFIX()
1700 return (int)(ptr - start); in PREFIX()
1706 PREFIX(skipS)(const ENCODING *enc, const char *ptr) in PREFIX()
1709 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1713 ptr += MINBPC(enc); in PREFIX()
1716 return ptr; in PREFIX()
1723 const char *ptr, in PREFIX()
1727 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1728 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1731 ptr += n; \ in PREFIX()
1738 ptr += MINBPC(enc); in PREFIX()
1742 ptr += MINBPC(enc); in PREFIX()
1743 if (HAS_CHAR(enc, ptr, end) && BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1744 ptr += MINBPC(enc); in PREFIX()
1748 ptr += MINBPC(enc); in PREFIX()