40 { PREFIX(prologTok), PREFIX(contentTok), PREFIX(cdataSectionTok) }, \
41 { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
43 PREFIX(nameMatchesAscii), \
47 PREFIX(charRefNumber), \
48 PREFIX(predefinedEntityName), \
49 PREFIX(updatePosition), \
52#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
54#define UCS2_GET_NAMING(pages, hi, lo) \
55 (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F)))
61#define UTF8_GET_NAMING2(pages, byte) \
62 (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \
63 + ((((byte)[0]) & 3) << 1) \
64 + ((((byte)[1]) >> 5) & 1)] \
65 & (1 << (((byte)[1]) & 0x1F)))
71#define UTF8_GET_NAMING3(pages, byte) \
72 (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \
73 + ((((byte)[1]) >> 2) & 0xF)] \
75 + ((((byte)[1]) & 3) << 1) \
76 + ((((byte)[2]) >> 5) & 1)] \
77 & (1 << (((byte)[2]) & 0x1F)))
79#define UTF8_GET_NAMING(pages, p, n) \
81 ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
83 ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \
86#define UTF8_INVALID3(p) \
88 ? (((p)[1] & 0x20) != 0) \
90 ? ((p)[1] == 0xBF && ((p)[2] == 0xBF || (p)[2] == 0xBE)) \
93#define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0)
96int isNever(
const ENCODING *enc,
const char *p)
102int utf8_isName2(
const ENCODING *enc,
const char *p)
108int utf8_isName3(
const ENCODING *enc,
const char *p)
113#define utf8_isName4 isNever
116int utf8_isNmstrt2(
const ENCODING *enc,
const char *p)
122int utf8_isNmstrt3(
const ENCODING *enc,
const char *p)
127#define utf8_isNmstrt4 isNever
129#define utf8_isInvalid2 isNever
132int utf8_isInvalid3(
const ENCODING *enc,
const char *p)
138int utf8_isInvalid4(
const ENCODING *enc,
const char *p)
147 int (*byteType)(
const ENCODING *,
const char *);
148 int (*isNameMin)(
const ENCODING *,
const char *);
149 int (*isNmstrtMin)(
const ENCODING *,
const char *);
150 int (*byteToAscii)(
const ENCODING *,
const char *);
151 int (*charMatches)(
const ENCODING *,
const char *, int);
153 int (*
isName2)(
const ENCODING *,
const char *);
154 int (*
isName3)(
const ENCODING *,
const char *);
155 int (*
isName4)(
const ENCODING *,
const char *);
166#define STANDARD_VTABLE(E) \
175#define STANDARD_VTABLE(E)
179#define NORMAL_VTABLE(E) \
190static int checkCharRefNumber(
int);
192#include "xmltok_impl.h"
195#define sb_isNameMin isNever
196#define sb_isNmstrtMin isNever
200#define MINBPC(enc) ((enc)->minBytesPerChar)
206#define SB_BYTE_TYPE(enc, p) \
207 (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
211int sb_byteType(
const ENCODING *enc,
const char *p)
215#define BYTE_TYPE(enc, p) \
216 (((const struct normal_encoding *)(enc))->byteType(enc, p))
218#define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p)
222#define BYTE_TO_ASCII(enc, p) \
223 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p))
225int sb_byteToAscii(
const ENCODING *enc,
const char *p)
230#define BYTE_TO_ASCII(enc, p) (*p)
233#define IS_NAME_CHAR(enc, p, n) \
234 (((const struct normal_encoding *)(enc))->isName ## n(enc, p))
235#define IS_NMSTRT_CHAR(enc, p, n) \
236 (((const struct normal_encoding *)(enc))->isNmstrt ## n(enc, p))
237#define IS_INVALID_CHAR(enc, p, n) \
238 (((const struct normal_encoding *)(enc))->isInvalid ## n(enc, p))
241#define IS_NAME_CHAR_MINBPC(enc, p) \
242 (((const struct normal_encoding *)(enc))->isNameMin(enc, p))
243#define IS_NMSTRT_CHAR_MINBPC(enc, p) \
244 (((const struct normal_encoding *)(enc))->isNmstrtMin(enc, p))
246#define IS_NAME_CHAR_MINBPC(enc, p) (0)
247#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0)
251#define CHAR_MATCHES(enc, p, c) \
252 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c))
254int sb_charMatches(
const ENCODING *enc,
const char *p,
int c)
260#define CHAR_MATCHES(enc, p, c) (*(p) == c)
263#define PREFIX(ident) normal_ ## ident
264#include "xmltok_impl.c"
271#undef IS_NAME_CHAR_MINBPC
273#undef IS_NMSTRT_CHAR_MINBPC
274#undef IS_INVALID_CHAR
284void utf8_toUtf8(
const ENCODING *enc,
285 const char **fromP,
const char *fromLim,
286 char **toP,
const char *toLim)
290 if (fromLim - *fromP > toLim - *toP) {
292 for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
293 if (((
unsigned char)fromLim[-1] & 0xc0) != 0x80)
296 for (to = *toP, from = *fromP; from != fromLim; from++, to++)
303void utf8_toUtf16(
const ENCODING *enc,
304 const char **fromP,
const char *fromLim,
305 unsigned short **toP,
const unsigned short *toLim)
307 unsigned short *to = *toP;
308 const char *from = *fromP;
309 while (from != fromLim && to != toLim) {
312 *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f);
316 *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f);
324 n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
326 to[0] = (
unsigned short)((
n >> 10) | 0xD800);
327 to[1] = (
unsigned short)((
n & 0x3FF) | 0xDC00);
343 {
VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
353 {
VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
355#define BT_COLON BT_NMSTRT
366 {
VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
368#include "iasciitab.h"
377 {
VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 },
379#define BT_COLON BT_NMSTRT
380#include "iasciitab.h"
388void latin1_toUtf8(
const ENCODING *
enc,
389 const char **fromP,
const char *fromLim,
390 char **toP,
const char *toLim)
394 if (*fromP == fromLim)
396 c = (
unsigned char)**fromP;
398 if (toLim - *toP < 2)
401 *(*toP)++ = ((c & 0x3f) | 0x80);
407 *(*toP)++ = *(*fromP)++;
413void latin1_toUtf16(
const ENCODING *
enc,
414 const char **fromP,
const char *fromLim,
415 unsigned short **toP,
const unsigned short *toLim)
417 while (*fromP != fromLim && *toP != toLim)
418 *(*toP)++ = (
unsigned char)*(*fromP)++;
424 {
VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 },
427#include "latin1tab.h"
435 {
VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 },
437#define BT_COLON BT_NMSTRT
440#include "latin1tab.h"
446void ascii_toUtf8(
const ENCODING *
enc,
447 const char **fromP,
const char *fromLim,
448 char **toP,
const char *toLim)
450 while (*fromP != fromLim && *toP != toLim)
451 *(*toP)++ = *(*fromP)++;
457 {
VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 },
468 {
VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 },
470#define BT_COLON BT_NMSTRT
478static int unicode_byte_type(
char hi,
char lo)
480 switch ((
unsigned char)hi) {
481 case 0xD8:
case 0xD9:
case 0xDA:
case 0xDB:
483 case 0xDC:
case 0xDD:
case 0xDE:
case 0xDF:
486 switch ((
unsigned char)lo) {
496#define DEFINE_UTF16_TO_UTF8(E) \
498void E ## toUtf8(const ENCODING *enc, \
499 const char **fromP, const char *fromLim, \
500 char **toP, const char *toLim) \
503 for (from = *fromP; from != fromLim; from += 2) { \
506 unsigned char lo = GET_LO(from); \
507 unsigned char hi = GET_HI(from); \
511 if (*toP == toLim) { \
519 case 0x1: case 0x2: case 0x3: \
520 case 0x4: case 0x5: case 0x6: case 0x7: \
521 if (toLim - *toP < 2) { \
525 *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \
526 *(*toP)++ = ((lo & 0x3f) | 0x80); \
529 if (toLim - *toP < 3) { \
534 *(*toP)++ = ((hi >> 4) | UTF8_cval3); \
535 *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \
536 *(*toP)++ = ((lo & 0x3f) | 0x80); \
538 case 0xD8: case 0xD9: case 0xDA: case 0xDB: \
539 if (toLim - *toP < 4) { \
543 plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
544 *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
545 *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \
547 lo2 = GET_LO(from); \
548 *(*toP)++ = (((lo & 0x3) << 4) \
549 | ((GET_HI(from) & 0x3) << 2) \
552 *(*toP)++ = ((lo2 & 0x3f) | 0x80); \
559#define DEFINE_UTF16_TO_UTF16(E) \
561void E ## toUtf16(const ENCODING *enc, \
562 const char **fromP, const char *fromLim, \
563 unsigned short **toP, const unsigned short *toLim) \
566 if (fromLim - *fromP > ((toLim - *toP) << 1) \
567 && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
569 for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \
570 *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
573#define SET2(ptr, ch) \
574 (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8)))
575#define GET_LO(ptr) ((unsigned char)(ptr)[0])
576#define GET_HI(ptr) ((unsigned char)(ptr)[1])
585#define SET2(ptr, ch) \
586 (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF)))
587#define GET_LO(ptr) ((unsigned char)(ptr)[1])
588#define GET_HI(ptr) ((unsigned char)(ptr)[0])
597#define LITTLE2_BYTE_TYPE(enc, p) \
599 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
600 : unicode_byte_type((p)[1], (p)[0]))
601#define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1)
602#define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c)
603#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \
604 UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
605#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
606 UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0])
611int little2_byteType(
const ENCODING *
enc,
const char *p)
617int little2_byteToAscii(
const ENCODING *
enc,
const char *p)
623int little2_charMatches(
const ENCODING *
enc,
const char *p,
int c)
629int little2_isNameMin(
const ENCODING *
enc,
const char *p)
635int little2_isNmstrtMin(
const ENCODING *
enc,
const char *p)
641#define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16
646#define PREFIX(ident) little2_ ## ident
649#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p)
650#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p)
651#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c)
652#define IS_NAME_CHAR(enc, p, n) 0
653#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
654#define IS_NMSTRT_CHAR(enc, p, n) (0)
655#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
657#include "xmltok_impl.c"
664#undef IS_NAME_CHAR_MINBPC
666#undef IS_NMSTRT_CHAR_MINBPC
667#undef IS_INVALID_CHAR
675#if XML_BYTE_ORDER == 12
683#include "latin1tab.h"
692#if XML_BYTE_ORDER == 12
699#define BT_COLON BT_NMSTRT
702#include "latin1tab.h"
707#if XML_BYTE_ORDER != 21
714#include "iasciitab.h"
715#include "latin1tab.h"
725#define BT_COLON BT_NMSTRT
726#include "iasciitab.h"
728#include "latin1tab.h"
736#define BIG2_BYTE_TYPE(enc, p) \
738 ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
739 : unicode_byte_type((p)[0], (p)[1]))
740#define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1)
741#define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c)
742#define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \
743 UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
744#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
745 UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1])
750int big2_byteType(
const ENCODING *
enc,
const char *p)
756int big2_byteToAscii(
const ENCODING *
enc,
const char *p)
762int big2_charMatches(
const ENCODING *
enc,
const char *p,
int c)
768int big2_isNameMin(
const ENCODING *
enc,
const char *p)
774int big2_isNmstrtMin(
const ENCODING *
enc,
const char *p)
780#define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16
785#define PREFIX(ident) big2_ ## ident
788#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p)
789#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p)
790#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c)
791#define IS_NAME_CHAR(enc, p, n) 0
792#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p)
793#define IS_NMSTRT_CHAR(enc, p, n) (0)
794#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
796#include "xmltok_impl.c"
803#undef IS_NAME_CHAR_MINBPC
805#undef IS_NMSTRT_CHAR_MINBPC
806#undef IS_INVALID_CHAR
814#if XML_BYTE_ORDER == 21
822#include "latin1tab.h"
831#if XML_BYTE_ORDER == 21
838#define BT_COLON BT_NMSTRT
841#include "latin1tab.h"
846#if XML_BYTE_ORDER != 12
853#include "iasciitab.h"
854#include "latin1tab.h"
864#define BT_COLON BT_NMSTRT
865#include "iasciitab.h"
867#include "latin1tab.h"
877int streqci(
const char *s1,
const char *s2)
882 if (
'a' <= c1 && c1 <=
'z')
884 if (
'a' <= c2 && c2 <=
'z')
895void initUpdatePosition(
const ENCODING *
enc,
const char *ptr,
896 const char *end, POSITION *pos)
898 normal_updatePosition(&utf8_encoding.
enc, ptr, end, pos);
902int toAscii(
const ENCODING *
enc,
const char *ptr,
const char *end)
906 XmlUtf8Convert(
enc, &ptr, end, &p, p + 1);
929int parsePseudoAttribute(
const ENCODING *
enc,
932 const char **namePtr,
934 const char **nextTokPtr)
942 if (!isSpace(toAscii(
enc, ptr, end))) {
947 ptr +=
enc->minBytesPerChar;
948 }
while (isSpace(toAscii(
enc, ptr, end)));
955 c = toAscii(
enc, ptr, end);
964 ptr +=
enc->minBytesPerChar;
965 }
while (isSpace(c = toAscii(
enc, ptr, end)));
972 ptr +=
enc->minBytesPerChar;
974 if (ptr == *namePtr) {
978 ptr +=
enc->minBytesPerChar;
979 c = toAscii(
enc, ptr, end);
981 ptr +=
enc->minBytesPerChar;
982 c = toAscii(
enc, ptr, end);
984 if (c !=
'"' && c !=
'\'') {
989 ptr +=
enc->minBytesPerChar;
991 for (;; ptr +=
enc->minBytesPerChar) {
992 c = toAscii(
enc, ptr, end);
995 if (!(
'a' <= c && c <=
'z')
996 && !(
'A' <= c && c <=
'Z')
997 && !(
'0' <= c && c <=
'9')
1005 *nextTokPtr = ptr +
enc->minBytesPerChar;
1010int doParseXmlDecl(
const ENCODING *(*encodingFinder)(
const ENCODING *,
1013 int isGeneralTextEntity,
1014 const ENCODING *
enc,
1017 const char **badPtr,
1018 const char **versionPtr,
1019 const char **encodingName,
1020 const ENCODING **encoding,
1023 const char *val = 0;
1024 const char *name = 0;
1025 ptr += 5 *
enc->minBytesPerChar;
1026 end -= 2 *
enc->minBytesPerChar;
1027 if (!parsePseudoAttribute(
enc, ptr, end, &name, &val, &ptr) || !name) {
1031 if (!XmlNameMatchesAscii(
enc, name,
"version")) {
1032 if (!isGeneralTextEntity) {
1040 if (!parsePseudoAttribute(
enc, ptr, end, &name, &val, &ptr)) {
1045 if (isGeneralTextEntity) {
1053 if (XmlNameMatchesAscii(
enc, name,
"encoding")) {
1054 int c = toAscii(
enc, val, end);
1055 if (!(
'a' <= c && c <=
'z') && !(
'A' <= c && c <=
'Z')) {
1060 *encodingName = val;
1062 *encoding = encodingFinder(
enc, val, ptr -
enc->minBytesPerChar);
1063 if (!parsePseudoAttribute(
enc, ptr, end, &name, &val, &ptr)) {
1070 if (!XmlNameMatchesAscii(
enc, name,
"standalone") || isGeneralTextEntity) {
1074 if (XmlNameMatchesAscii(
enc, val,
"yes")) {
1078 else if (XmlNameMatchesAscii(
enc, val,
"no")) {
1086 while (isSpace(toAscii(
enc, ptr, end)))
1087 ptr +=
enc->minBytesPerChar;
1096int checkCharRefNumber(
int result)
1098 switch (result >> 8) {
1099 case 0xD8:
case 0xD9:
case 0xDA:
case 0xDB:
1100 case 0xDC:
case 0xDD:
case 0xDE:
case 0xDF:
1103 if (latin1_encoding.
type[result] == BT_NONXML)
1107 if (result == 0xFFFE || result == 0xFFFF)
1131 buf[1] = ((c & 0x3f) | 0x80);
1136 buf[1] = (((c >> 6) & 0x3f) | 0x80);
1137 buf[2] = ((c & 0x3f) | 0x80);
1142 buf[1] = (((c >> 12) & 0x3f) | 0x80);
1143 buf[2] = (((c >> 6) & 0x3f) | 0x80);
1144 buf[3] = ((c & 0x3f) | 0x80);
1154 if (charNum < 0x10000) {
1158 if (charNum < 0x110000) {
1160 buf[0] = (charNum >> 10) + 0xD800;
1161 buf[1] = (charNum & 0x3FF) + 0xDC00;
1181int unknown_isName(
const ENCODING *enc,
const char *p)
1191int unknown_isNmstrt(
const ENCODING *enc,
const char *p)
1201int unknown_isInvalid(
const ENCODING *enc,
const char *p)
1205 return (c & ~0xFFFF) || checkCharRefNumber(c) < 0;
1209void unknown_toUtf8(
const ENCODING *enc,
1210 const char **fromP,
const char *fromLim,
1211 char **toP,
const char *toLim)
1213 char buf[XML_UTF8_ENCODE_MAX];
1217 if (*fromP == fromLim)
1225 if (
n > toLim - *toP)
1232 if (
n > toLim - *toP)
1237 *(*toP)++ = *utf8++;
1243void unknown_toUtf16(
const ENCODING *
enc,
1244 const char **fromP,
const char *fromLim,
1245 unsigned short **toP,
const unsigned short *toLim)
1247 while (*fromP != fromLim && *toP != toLim) {
1265 int (*convert)(
void *userData,
const char *p),
1271 ((
char *)mem)[i] = ((
char *)&latin1_encoding)[i];
1272 for (i = 0; i < 128; i++)
1273 if (latin1_encoding.
type[i] != BT_OTHER
1274 && latin1_encoding.
type[i] != BT_NONXML
1277 for (i = 0; i < 256; i++) {
1282 e->
utf16[i] = 0xFFFF;
1293 else if (c < 0x80) {
1294 if (latin1_encoding.
type[c] != BT_OTHER
1295 && latin1_encoding.
type[c] != BT_NONXML
1300 e->
utf8[i][1] = (char)c;
1301 e->
utf16[i] = c == 0 ? 0xFFFF : c;
1303 else if (checkCharRefNumber(c) < 0) {
1306 e->
utf16[i] = 0xFFFF;
1336 e->
normal.
enc.utf8Convert = unknown_toUtf8;
1337 e->
normal.
enc.utf16Convert = unknown_toUtf16;
1356int getEncodingIndex(
const char *name)
1358 static const char *encodingNames[] = {
1369 for (i = 0; i <
sizeof(encodingNames)/
sizeof(encodingNames[0]); i++)
1370 if (streqci(name, encodingNames[i]))
1378#define INIT_ENC_INDEX(enc) ((enc)->initEnc.isUtf16)
1389int initScan(
const ENCODING **encodingTable,
1390 const INIT_ENCODING *
enc,
1394 const char **nextTokPtr)
1396 const ENCODING **encPtr;
1399 return XML_TOK_NONE;
1400 encPtr =
enc->encPtr;
1401 if (ptr + 1 == end) {
1404 if (state != XML_CONTENT_STATE)
1405 return XML_TOK_PARTIAL;
1412 return XML_TOK_PARTIAL;
1414 switch ((
unsigned char)*ptr) {
1419 && state == XML_CONTENT_STATE)
1424 return XML_TOK_PARTIAL;
1428 switch (((
unsigned char)ptr[0] << 8) | (
unsigned char)ptr[1]) {
1431 && state == XML_CONTENT_STATE)
1433 *nextTokPtr = ptr + 2;
1440 && state == XML_CONTENT_STATE)
1443 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1446 && state == XML_CONTENT_STATE)
1448 *nextTokPtr = ptr + 2;
1458 if (state == XML_CONTENT_STATE) {
1464 return XML_TOK_PARTIAL;
1465 if ((
unsigned char)ptr[2] == 0xBF) {
1471 if (ptr[0] ==
'\0') {
1479 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1481 else if (ptr[1] ==
'\0') {
1490 if (state == XML_CONTENT_STATE)
1493 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1499 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1511#define NS(x) x ## NS
1512#define ns(x) x ## _ns
1520XmlInitUnknownEncodingNS(
void *mem,
1522 int (*convert)(
void *userData,
const char *p),
m_outputFile open("YYYY/m_txt_dir/LumTau_XXXX.txt", ios_base::app)
int(* isInvalid4)(const ENCODING *, const char *)
int(* isInvalid2)(const ENCODING *, const char *)
int(* isNmstrt4)(const ENCODING *, const char *)
int(* isName3)(const ENCODING *, const char *)
int(* isName2)(const ENCODING *, const char *)
int(* isNmstrt2)(const ENCODING *, const char *)
int(* isName4)(const ENCODING *, const char *)
int(* isNmstrt3)(const ENCODING *, const char *)
int(* isInvalid3)(const ENCODING *, const char *)
unsigned short utf16[256]
int(* convert)(void *userData, const char *p)
struct normal_encoding normal
#define BIG2_BYTE_TO_ASCII(enc, p)
#define STANDARD_VTABLE(E)
int XmlUtf8Encode(int c, char *buf)
#define UTF8_GET_NAMING3(pages, byte)
#define BIG2_IS_NAME_CHAR_MINBPC(enc, p)
#define DEFINE_UTF16_TO_UTF8(E)
#define BIG2_BYTE_TYPE(enc, p)
int XmlSizeOfUnknownEncoding()
ENCODING * XmlInitUnknownEncoding(void *mem, int *table, int(*convert)(void *userData, const char *p), void *userData)
#define INIT_ENC_INDEX(enc)
int XmlUtf16Encode(int charNum, unsigned short *buf)
#define SB_BYTE_TYPE(enc, p)
#define LITTLE2_CHAR_MATCHES(enc, p, c)
#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
#define LITTLE2_BYTE_TYPE(enc, p)
#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
#define UCS2_GET_NAMING(pages, hi, lo)
#define UTF8_GET_NAMING2(pages, byte)
#define LITTLE2_BYTE_TO_ASCII(enc, p)
#define DEFINE_UTF16_TO_UTF16(E)
#define BIG2_CHAR_MATCHES(enc, p, c)
#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)