• 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)
119 # define HAS_CHARS(enc, ptr, end, count) (end - ptr >= count * MINBPC(enc)) argument
121 # define HAS_CHAR(enc, ptr, end) HAS_CHARS(enc, ptr, end, 1) argument
123 # define REQUIRE_CHARS(enc, ptr, end, count) \ argument
125 if (! HAS_CHARS(enc, ptr, end, count)) { \
130 # define REQUIRE_CHAR(enc, ptr, end) REQUIRE_CHARS(enc, ptr, end, 1) argument
135 PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
137 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
138 if (! CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
139 *nextTokPtr = ptr; in PREFIX()
142 ptr += MINBPC(enc); in PREFIX()
143 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
144 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
145 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
147 ptr += MINBPC(enc); in PREFIX()
148 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
149 if (CHAR_MATCHES(enc, ptr, ASCII_MINUS)) { in PREFIX()
150 ptr += MINBPC(enc); in PREFIX()
151 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
152 if (! CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
153 *nextTokPtr = ptr; in PREFIX()
156 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
161 ptr += MINBPC(enc); in PREFIX()
172 PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
174 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
175 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
177 return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
179 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
183 ptr += MINBPC(enc); in PREFIX()
186 *nextTokPtr = ptr; in PREFIX()
189 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
190 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
192 REQUIRE_CHARS(enc, ptr, end, 2); in PREFIX()
194 switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { in PREFIX()
199 *nextTokPtr = ptr; in PREFIX()
206 *nextTokPtr = ptr; in PREFIX()
210 ptr += MINBPC(enc); in PREFIX()
213 *nextTokPtr = ptr; in PREFIX()
221 PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
226 if (end - ptr != MINBPC(enc) * 3) in PREFIX()
228 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
237 ptr += MINBPC(enc); in PREFIX()
238 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
247 ptr += MINBPC(enc); in PREFIX()
248 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
266 PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
269 const char *target = ptr; in PREFIX()
270 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
271 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
272 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
274 *nextTokPtr = ptr; in PREFIX()
277 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
278 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
279 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
283 if (! PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
284 *nextTokPtr = ptr; in PREFIX()
287 ptr += MINBPC(enc); in PREFIX()
288 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
289 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
290 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
292 ptr += MINBPC(enc); in PREFIX()
293 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
294 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
295 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
300 ptr += MINBPC(enc); in PREFIX()
306 if (! PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { in PREFIX()
307 *nextTokPtr = ptr; in PREFIX()
310 ptr += MINBPC(enc); in PREFIX()
311 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
312 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
313 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
318 *nextTokPtr = ptr; in PREFIX()
326 PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
333 REQUIRE_CHARS(enc, ptr, end, 6); in PREFIX()
334 for (i = 0; i < 6; i++, ptr += MINBPC(enc)) { in PREFIX()
335 if (! CHAR_MATCHES(enc, ptr, CDATA_LSQB[i])) { in PREFIX()
336 *nextTokPtr = ptr; in PREFIX()
340 *nextTokPtr = ptr; in PREFIX()
345 PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
347 if (ptr >= end) in PREFIX()
350 size_t n = end - ptr; in PREFIX()
355 end = ptr + n; in PREFIX()
358 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
360 ptr += MINBPC(enc); in PREFIX()
361 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
362 if (! CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
364 ptr += MINBPC(enc); in PREFIX()
365 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
366 if (! CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
367 ptr -= MINBPC(enc); in PREFIX()
370 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
373 ptr += MINBPC(enc); in PREFIX()
374 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
375 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
376 ptr += MINBPC(enc); in PREFIX()
377 *nextTokPtr = ptr; in PREFIX()
380 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
382 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
384 ptr += MINBPC(enc); in PREFIX()
387 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
388 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
391 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
392 *nextTokPtr = ptr; \ in PREFIX()
395 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, const char *end, in PREFIX()
423 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
424 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
425 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
427 *nextTokPtr = ptr; in PREFIX()
430 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
431 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
432 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
436 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
437 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
443 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
446 *nextTokPtr = ptr; in PREFIX()
455 ptr += MINBPC(enc); in PREFIX()
459 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
462 *nextTokPtr = ptr; in PREFIX()
472 PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
474 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
475 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
480 *nextTokPtr = ptr; in PREFIX()
483 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
484 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
489 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
492 *nextTokPtr = ptr; in PREFIX()
503 PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
505 if (HAS_CHAR(enc, ptr, end)) { in PREFIX()
506 if (CHAR_MATCHES(enc, ptr, ASCII_x)) in PREFIX()
507 return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
508 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
512 *nextTokPtr = ptr; in PREFIX()
515 for (ptr += MINBPC(enc); HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
516 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
520 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
523 *nextTokPtr = ptr; in PREFIX()
534 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()
567 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
568 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
569 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
573 *nextTokPtr = ptr; in PREFIX()
577 ptr += MINBPC(enc); in PREFIX()
578 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
579 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
580 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
582 *nextTokPtr = ptr; in PREFIX()
593 ptr += MINBPC(enc); in PREFIX()
594 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
595 t = BYTE_TYPE(enc, ptr); in PREFIX()
604 *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()
641 int tok = PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, &ptr); in PREFIX()
644 *nextTokPtr = ptr; in PREFIX()
650 *nextTokPtr = ptr; in PREFIX()
653 ptr += MINBPC(enc); in PREFIX()
657 ptr += MINBPC(enc); in PREFIX()
658 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
659 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
669 *nextTokPtr = ptr; in PREFIX()
674 ptr += MINBPC(enc); in PREFIX()
675 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
676 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
677 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
684 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
688 ptr += MINBPC(enc); in PREFIX()
689 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
690 if (! CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
691 *nextTokPtr = ptr; in PREFIX()
694 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
697 *nextTokPtr = ptr; in PREFIX()
705 *nextTokPtr = ptr; in PREFIX()
715 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), end, nextTokPtr); in PREFIX()
732 *nextTokPtr = ptr; in PREFIX()
735 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
737 return PREFIX(scanEndTag)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
739 *nextTokPtr = ptr; in PREFIX()
746 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
747 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
748 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
752 *nextTokPtr = ptr; in PREFIX()
756 ptr += MINBPC(enc); in PREFIX()
757 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
758 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
759 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
761 *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()
780 ptr += MINBPC(enc); in PREFIX()
783 *nextTokPtr = ptr; in PREFIX()
786 return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); in PREFIX()
792 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
796 ptr += MINBPC(enc); in PREFIX()
797 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
798 if (! CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
799 *nextTokPtr = ptr; in PREFIX()
802 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
805 *nextTokPtr = ptr; in PREFIX()
813 PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
815 if (ptr >= end) in PREFIX()
818 size_t n = end - ptr; in PREFIX()
823 end = ptr + n; in PREFIX()
826 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
828 return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
830 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
832 ptr += MINBPC(enc); in PREFIX()
833 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
835 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
836 ptr += MINBPC(enc); in PREFIX()
837 *nextTokPtr = ptr; in PREFIX()
840 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
843 ptr += MINBPC(enc); in PREFIX()
844 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
846 if (! CHAR_MATCHES(enc, ptr, ASCII_RSQB)) in PREFIX()
848 ptr += MINBPC(enc); in PREFIX()
849 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
851 if (! CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
852 ptr -= MINBPC(enc); in PREFIX()
855 *nextTokPtr = ptr; in PREFIX()
857 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
859 ptr += MINBPC(enc); in PREFIX()
862 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
863 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
866 if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ in PREFIX()
867 *nextTokPtr = ptr; \ in PREFIX()
870 ptr += n; \ in PREFIX()
877 if (HAS_CHARS(enc, ptr, end, 2)) { in PREFIX()
878 if (! CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { in PREFIX()
879 ptr += MINBPC(enc); in PREFIX()
882 if (HAS_CHARS(enc, ptr, end, 3)) { in PREFIX()
883 if (! CHAR_MATCHES(enc, ptr + 2 * MINBPC(enc), ASCII_GT)) { in PREFIX()
884 ptr += MINBPC(enc); in PREFIX()
887 *nextTokPtr = ptr + 2 * MINBPC(enc); in PREFIX()
899 *nextTokPtr = ptr; in PREFIX()
902 ptr += MINBPC(enc); in PREFIX()
906 *nextTokPtr = ptr; in PREFIX()
913 PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
915 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
916 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
917 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
922 *nextTokPtr = ptr; in PREFIX()
925 *nextTokPtr = ptr; in PREFIX()
928 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
929 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
930 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
932 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
935 *nextTokPtr = ptr; in PREFIX()
943 PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
945 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
946 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
947 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
949 *nextTokPtr = ptr; in PREFIX()
952 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
953 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
954 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
962 *nextTokPtr = ptr; in PREFIX()
965 *nextTokPtr = ptr; in PREFIX()
973 PREFIX(scanLit)(int open, const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
975 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
976 int t = BYTE_TYPE(enc, ptr); in PREFIX()
978 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
981 ptr += MINBPC(enc); in PREFIX()
984 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
986 *nextTokPtr = ptr; in PREFIX()
987 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
999 ptr += MINBPC(enc); in PREFIX()
1007 PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1010 if (ptr >= end) in PREFIX()
1013 size_t n = end - ptr; in PREFIX()
1018 end = ptr + n; in PREFIX()
1021 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1023 return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1025 return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1027 ptr += MINBPC(enc); in PREFIX()
1028 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1029 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1031 return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1033 return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1040 *nextTokPtr = ptr - MINBPC(enc); in PREFIX()
1043 *nextTokPtr = ptr; in PREFIX()
1047 if (ptr + MINBPC(enc) == end) { in PREFIX()
1056 ptr += MINBPC(enc); in PREFIX()
1057 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1059 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1065 if (ptr + MINBPC(enc) != end) in PREFIX()
1069 *nextTokPtr = ptr; in PREFIX()
1073 *nextTokPtr = ptr; in PREFIX()
1076 return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1078 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1081 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1084 ptr += MINBPC(enc); in PREFIX()
1085 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1087 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1088 REQUIRE_CHARS(enc, ptr, end, 2); in PREFIX()
1089 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { in PREFIX()
1090 *nextTokPtr = ptr + 2 * MINBPC(enc); in PREFIX()
1094 *nextTokPtr = ptr; in PREFIX()
1097 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1100 ptr += MINBPC(enc); in PREFIX()
1101 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1103 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1105 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1108 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1111 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1120 *nextTokPtr = ptr; in PREFIX()
1123 *nextTokPtr = ptr; in PREFIX()
1126 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1129 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1132 return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1135 if (end - ptr < n) \ in PREFIX()
1137 if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ in PREFIX()
1138 ptr += n; \ in PREFIX()
1142 if (IS_NAME_CHAR(enc, ptr, n)) { \ in PREFIX()
1143 ptr += n; \ in PREFIX()
1147 *nextTokPtr = ptr; \ in PREFIX()
1156 ptr += MINBPC(enc); in PREFIX()
1165 ptr += MINBPC(enc); in PREFIX()
1168 if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1169 ptr += MINBPC(enc); in PREFIX()
1173 if (IS_NAME_CHAR_MINBPC(enc, ptr)) { in PREFIX()
1174 ptr += MINBPC(enc); in PREFIX()
1180 *nextTokPtr = ptr; in PREFIX()
1183 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1184 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1185 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1195 *nextTokPtr = ptr; in PREFIX()
1199 ptr += MINBPC(enc); in PREFIX()
1202 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1204 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1205 CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) in PREFIX()
1219 *nextTokPtr = ptr; in PREFIX()
1222 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1226 *nextTokPtr = ptr; in PREFIX()
1229 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1233 *nextTokPtr = ptr; in PREFIX()
1236 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1239 *nextTokPtr = ptr; in PREFIX()
1247 PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1250 if (ptr >= end) in PREFIX()
1252 else if (! HAS_CHAR(enc, ptr, end)) { in PREFIX()
1260 start = ptr; in PREFIX()
1261 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1262 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1265 ptr += n; \ in PREFIX()
1272 if (ptr == start) in PREFIX()
1273 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1274 *nextTokPtr = ptr; in PREFIX()
1278 *nextTokPtr = ptr; in PREFIX()
1281 if (ptr == start) { in PREFIX()
1282 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1285 *nextTokPtr = ptr; in PREFIX()
1288 if (ptr == start) { in PREFIX()
1289 ptr += MINBPC(enc); in PREFIX()
1290 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1292 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1293 ptr += MINBPC(enc); in PREFIX()
1294 *nextTokPtr = ptr; in PREFIX()
1297 *nextTokPtr = ptr; in PREFIX()
1300 if (ptr == start) { in PREFIX()
1301 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1304 *nextTokPtr = ptr; in PREFIX()
1307 ptr += MINBPC(enc); in PREFIX()
1311 *nextTokPtr = ptr; in PREFIX()
1316 PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1319 if (ptr >= end) in PREFIX()
1321 else if (! HAS_CHAR(enc, ptr, end)) { in PREFIX()
1329 start = ptr; in PREFIX()
1330 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1331 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1334 ptr += n; \ in PREFIX()
1341 if (ptr == start) in PREFIX()
1342 return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1343 *nextTokPtr = ptr; in PREFIX()
1346 if (ptr == start) { in PREFIX()
1347 int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); in PREFIX()
1350 *nextTokPtr = ptr; in PREFIX()
1353 if (ptr == start) { in PREFIX()
1354 *nextTokPtr = ptr + MINBPC(enc); in PREFIX()
1357 *nextTokPtr = ptr; in PREFIX()
1360 if (ptr == start) { in PREFIX()
1361 ptr += MINBPC(enc); in PREFIX()
1362 if (! HAS_CHAR(enc, ptr, end)) in PREFIX()
1364 if (BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1365 ptr += MINBPC(enc); in PREFIX()
1366 *nextTokPtr = ptr; in PREFIX()
1369 *nextTokPtr = ptr; in PREFIX()
1372 ptr += MINBPC(enc); in PREFIX()
1376 *nextTokPtr = ptr; in PREFIX()
1383 PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1387 size_t n = end - ptr; in PREFIX()
1390 end = ptr + n; in PREFIX()
1393 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1394 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1395 INVALID_CASES(ptr, nextTokPtr) in PREFIX()
1397 ptr += MINBPC(enc); in PREFIX()
1398 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1399 if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { in PREFIX()
1400 ptr += MINBPC(enc); in PREFIX()
1401 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1402 if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { in PREFIX()
1404 ptr += MINBPC(enc); in PREFIX()
1409 ptr += MINBPC(enc); in PREFIX()
1410 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1411 if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { in PREFIX()
1412 ptr += MINBPC(enc); in PREFIX()
1413 REQUIRE_CHAR(enc, ptr, end); in PREFIX()
1414 if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { in PREFIX()
1415 ptr += MINBPC(enc); in PREFIX()
1417 *nextTokPtr = ptr; in PREFIX()
1425 ptr += MINBPC(enc); in PREFIX()
1435 PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1437 ptr += MINBPC(enc); in PREFIX()
1439 for (; HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { in PREFIX()
1440 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1464 if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { in PREFIX()
1465 *badPtr = ptr; in PREFIX()
1471 if (! (BYTE_TO_ASCII(enc, ptr) & ~0x7f)) in PREFIX()
1475 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1480 *badPtr = ptr; in PREFIX()
1495 PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax, in PREFIX()
1502 for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { in PREFIX()
1503 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1507 atts[nAtts].name = ptr; \ in PREFIX()
1514 START_NAME ptr += (n - MINBPC(enc)); \ in PREFIX()
1529 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1535 atts[nAtts].valueEnd = ptr; in PREFIX()
1542 atts[nAtts].valuePtr = ptr + MINBPC(enc); in PREFIX()
1548 atts[nAtts].valueEnd = ptr; in PREFIX()
1560 && (ptr == atts[nAtts].valuePtr in PREFIX()
1561 || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE in PREFIX()
1562 || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE in PREFIX()
1563 || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) in PREFIX()
1588 PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) { in PREFIX()
1592 ptr += 2 * MINBPC(enc); in PREFIX()
1593 if (CHAR_MATCHES(enc, ptr, ASCII_x)) { in PREFIX()
1594 for (ptr += MINBPC(enc); ! CHAR_MATCHES(enc, ptr, ASCII_SEMI); in PREFIX()
1595 ptr += MINBPC(enc)) { in PREFIX()
1596 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1634 for (; ! CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { in PREFIX()
1635 int c = BYTE_TO_ASCII(enc, ptr); in PREFIX()
1646 PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, in PREFIX()
1649 switch ((end - ptr) / MINBPC(enc)) { in PREFIX()
1651 if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { in PREFIX()
1652 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1661 if (CHAR_MATCHES(enc, ptr, ASCII_a)) { in PREFIX()
1662 ptr += MINBPC(enc); in PREFIX()
1663 if (CHAR_MATCHES(enc, ptr, ASCII_m)) { in PREFIX()
1664 ptr += MINBPC(enc); in PREFIX()
1665 if (CHAR_MATCHES(enc, ptr, ASCII_p)) in PREFIX()
1671 switch (BYTE_TO_ASCII(enc, ptr)) { in PREFIX()
1673 ptr += MINBPC(enc); in PREFIX()
1674 if (CHAR_MATCHES(enc, ptr, ASCII_u)) { in PREFIX()
1675 ptr += MINBPC(enc); in PREFIX()
1676 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1677 ptr += MINBPC(enc); in PREFIX()
1678 if (CHAR_MATCHES(enc, ptr, ASCII_t)) in PREFIX()
1684 ptr += MINBPC(enc); in PREFIX()
1685 if (CHAR_MATCHES(enc, ptr, ASCII_p)) { in PREFIX()
1686 ptr += MINBPC(enc); in PREFIX()
1687 if (CHAR_MATCHES(enc, ptr, ASCII_o)) { in PREFIX()
1688 ptr += MINBPC(enc); in PREFIX()
1689 if (CHAR_MATCHES(enc, ptr, ASCII_s)) in PREFIX()
1719 PREFIX(nameLength)(const ENCODING *enc, const char *ptr) { in PREFIX()
1720 const char *start = ptr; in PREFIX()
1722 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1725 ptr += n; \ in PREFIX()
1740 ptr += MINBPC(enc); in PREFIX()
1743 return (int)(ptr - start); in PREFIX()
1749 PREFIX(skipS)(const ENCODING *enc, const char *ptr) { in PREFIX()
1751 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1755 ptr += MINBPC(enc); in PREFIX()
1758 return ptr; in PREFIX()
1764 PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end, in PREFIX()
1766 while (HAS_CHAR(enc, ptr, end)) { in PREFIX()
1767 switch (BYTE_TYPE(enc, ptr)) { in PREFIX()
1770 ptr += n; \ in PREFIX()
1779 ptr += MINBPC(enc); in PREFIX()
1783 ptr += MINBPC(enc); in PREFIX()
1784 if (HAS_CHAR(enc, ptr, end) && BYTE_TYPE(enc, ptr) == BT_LF) in PREFIX()
1785 ptr += MINBPC(enc); in PREFIX()
1789 ptr += MINBPC(enc); in PREFIX()