5#if defined(__clang__) || defined(__GNUC__)
6#pragma GCC diagnostic ignored "-Wunused-parameter"
7#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
12#ifdef COMPILED_FROM_DSP
14#elif defined(MACOS_CLASSIC)
16#elif defined(__amigaos__)
18#elif defined(__WATCOMC__)
19#include "watcomconfig.h"
21#ifdef HAVE_EXPAT_CONFIG_H
32#define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok)
34#define IGNORE_SECTION_TOK_VTABLE
38 { PREFIX(prologTok), PREFIX(contentTok), \
39 PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \
40 { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
42 PREFIX(nameMatchesAscii), \
46 PREFIX(charRefNumber), \
47 PREFIX(predefinedEntityName), \
48 PREFIX(updatePosition), \
51#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16)
53#define UCS2_GET_NAMING(pages, hi, lo) \
54 (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F)))
60#define UTF8_GET_NAMING2(pages, byte) \
61 (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \
62 + ((((byte)[0]) & 3) << 1) \
63 + ((((byte)[1]) >> 5) & 1)] \
64 & (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)) \
96#define UTF8_INVALID2(p) \
97 ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0)
99#define UTF8_INVALID3(p) \
100 (((p)[2] & 0x80) == 0 \
102 ((*p) == 0xEF && (p)[1] == 0xBF \
106 ((p)[2] & 0xC0) == 0xC0) \
110 (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \
112 ((p)[1] & 0x80) == 0 \
114 ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0)))
116#define UTF8_INVALID4(p) \
117 (((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 \
119 ((p)[2] & 0x80) == 0 || ((p)[2] & 0xC0) == 0xC0 \
123 (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \
125 ((p)[1] & 0x80) == 0 \
127 ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0)))
147#define utf8_isName4 isNever
161#define utf8_isNmstrt4 isNever
202#define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc))
206#define STANDARD_VTABLE(E) \
215#define STANDARD_VTABLE(E)
219#define NORMAL_VTABLE(E) \
236#define sb_isNameMin isNever
237#define sb_isNmstrtMin isNever
241#define MINBPC(enc) ((enc)->minBytesPerChar)
247#define SB_BYTE_TYPE(enc, p) \
248 (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
252sb_byteType(
const ENCODING *enc,
const char *p)
256#define BYTE_TYPE(enc, p) \
257 (AS_NORMAL_ENCODING(enc)->byteType(enc, p))
259#define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p)
263#define BYTE_TO_ASCII(enc, p) \
264 (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p))
266sb_byteToAscii(
const ENCODING *enc,
const char *p)
271#define BYTE_TO_ASCII(enc, p) (*(p))
274#define IS_NAME_CHAR(enc, p, n) \
275 (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p))
276#define IS_NMSTRT_CHAR(enc, p, n) \
277 (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p))
278#define IS_INVALID_CHAR(enc, p, n) \
279 (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p))
282#define IS_NAME_CHAR_MINBPC(enc, p) \
283 (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p))
284#define IS_NMSTRT_CHAR_MINBPC(enc, p) \
285 (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p))
287#define IS_NAME_CHAR_MINBPC(enc, p) (0)
288#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0)
292#define CHAR_MATCHES(enc, p, c) \
293 (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c))
295sb_charMatches(
const ENCODING *enc,
const char *p,
int c)
301#define CHAR_MATCHES(enc, p, c) (*(p) == c)
304#define PREFIX(ident) normal_ ## ident
305#define XML_TOK_IMPL_C
314#undef IS_NAME_CHAR_MINBPC
316#undef IS_NMSTRT_CHAR_MINBPC
317#undef IS_INVALID_CHAR
328 const char **fromP,
const char *fromLim,
329 char **toP,
const char *toLim)
333 if (fromLim - *fromP > toLim - *toP) {
335 for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
336 if (((
unsigned char)fromLim[-1] & 0xc0) != 0x80)
339 for (to = *toP, from = *fromP; from != fromLim; from++, to++)
347 const char **fromP,
const char *fromLim,
348 unsigned short **toP,
const unsigned short *toLim)
350 unsigned short *to = *toP;
351 const char *from = *fromP;
352 while (from != fromLim && to != toLim) {
355 *to++ = (
unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
359 *to++ = (
unsigned short)(((from[0] & 0xf) << 12)
360 | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
368 n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12)
369 | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
371 to[0] = (
unsigned short)((
n >> 10) | 0xD800);
372 to[1] = (
unsigned short)((
n & 0x3FF) | 0xDC00);
401#define BT_COLON BT_NMSTRT
425#define BT_COLON BT_NMSTRT
435 const char **fromP,
const char *fromLim,
436 char **toP,
const char *toLim)
440 if (*fromP == fromLim)
442 c = (
unsigned char)**fromP;
444 if (toLim - *toP < 2)
447 *(*toP)++ = (char)((c & 0x3f) | 0x80);
453 *(*toP)++ = *(*fromP)++;
460 const char **fromP,
const char *fromLim,
461 unsigned short **toP,
const unsigned short *toLim)
463 while (*fromP != fromLim && *toP != toLim)
464 *(*toP)++ = (
unsigned char)*(*fromP)++;
483#define BT_COLON BT_NMSTRT
493 const char **fromP,
const char *fromLim,
494 char **toP,
const char *toLim)
496 while (*fromP != fromLim && *toP != toLim)
497 *(*toP)++ = *(*fromP)++;
516#define BT_COLON BT_NMSTRT
527 switch ((
unsigned char)hi) {
528 case 0xD8:
case 0xD9:
case 0xDA:
case 0xDB:
530 case 0xDC:
case 0xDD:
case 0xDE:
case 0xDF:
533 switch ((
unsigned char)lo) {
543#define DEFINE_UTF16_TO_UTF8(E) \
545E ## toUtf8(const ENCODING *enc, \
546 const char **fromP, const char *fromLim, \
547 char **toP, const char *toLim) \
550 for (from = *fromP; from != fromLim; from += 2) { \
553 unsigned char lo = GET_LO(from); \
554 unsigned char hi = GET_HI(from); \
558 if (*toP == toLim) { \
566 case 0x1: case 0x2: case 0x3: \
567 case 0x4: case 0x5: case 0x6: case 0x7: \
568 if (toLim - *toP < 2) { \
572 *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \
573 *(*toP)++ = ((lo & 0x3f) | 0x80); \
576 if (toLim - *toP < 3) { \
581 *(*toP)++ = ((hi >> 4) | UTF8_cval3); \
582 *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \
583 *(*toP)++ = ((lo & 0x3f) | 0x80); \
585 case 0xD8: case 0xD9: case 0xDA: case 0xDB: \
586 if (toLim - *toP < 4) { \
590 plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
591 *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
592 *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \
594 lo2 = GET_LO(from); \
595 *(*toP)++ = (((lo & 0x3) << 4) \
596 | ((GET_HI(from) & 0x3) << 2) \
599 *(*toP)++ = ((lo2 & 0x3f) | 0x80); \
606#define DEFINE_UTF16_TO_UTF16(E) \
608E ## toUtf16(const ENCODING *enc, \
609 const char **fromP, const char *fromLim, \
610 unsigned short **toP, const unsigned short *toLim) \
613 if (fromLim - *fromP > ((toLim - *toP) << 1) \
614 && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
616 for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \
617 *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
620#define SET2(ptr, ch) \
621 (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8)))
622#define GET_LO(ptr) ((unsigned char)(ptr)[0])
623#define GET_HI(ptr) ((unsigned char)(ptr)[1])
632#define SET2(ptr, ch) \
633 (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF)))
634#define GET_LO(ptr) ((unsigned char)(ptr)[1])
635#define GET_HI(ptr) ((unsigned char)(ptr)[0])
644#define LITTLE2_BYTE_TYPE(enc, p) \
646 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
647 : unicode_byte_type((p)[1], (p)[0]))
648#define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1)
649#define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c)
650#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \
651 UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
652#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
653 UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0])
658little2_byteType(
const ENCODING *
enc,
const char *p)
664little2_byteToAscii(
const ENCODING *
enc,
const char *p)
670little2_charMatches(
const ENCODING *
enc,
const char *p,
int c)
676little2_isNameMin(
const ENCODING *
enc,
const char *p)
682little2_isNmstrtMin(
const ENCODING *
enc,
const char *p)
688#define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16
693#define PREFIX(ident) little2_ ## ident
696#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p)
697#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p)
698#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c)
699#define IS_NAME_CHAR(enc, p, n) 0
700#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
701#define IS_NMSTRT_CHAR(enc, p, n) (0)
702#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
704#define XML_TOK_IMPL_C
713#undef IS_NAME_CHAR_MINBPC
715#undef IS_NMSTRT_CHAR_MINBPC
716#undef IS_INVALID_CHAR
748#define BT_COLON BT_NMSTRT
774#define BT_COLON BT_NMSTRT
785#define BIG2_BYTE_TYPE(enc, p) \
787 ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
788 : unicode_byte_type((p)[0], (p)[1]))
789#define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1)
790#define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c)
791#define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \
792 UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
793#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \
794 UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1])
805big2_byteToAscii(
const ENCODING *
enc,
const char *p)
811big2_charMatches(
const ENCODING *
enc,
const char *p,
int c)
823big2_isNmstrtMin(
const ENCODING *
enc,
const char *p)
829#define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16
834#define PREFIX(ident) big2_ ## ident
837#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p)
838#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p)
839#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c)
840#define IS_NAME_CHAR(enc, p, n) 0
841#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p)
842#define IS_NMSTRT_CHAR(enc, p, n) (0)
843#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
845#define XML_TOK_IMPL_C
854#undef IS_NAME_CHAR_MINBPC
856#undef IS_NMSTRT_CHAR_MINBPC
857#undef IS_INVALID_CHAR
889#define BT_COLON BT_NMSTRT
915#define BT_COLON BT_NMSTRT
984 const char **namePtr,
985 const char **nameEndPtr,
987 const char **nextTokPtr)
1030 if (ptr == *namePtr) {
1090 int isGeneralTextEntity,
1094 const char **badPtr,
1095 const char **versionPtr,
1096 const char **versionEndPtr,
1097 const char **encodingName,
1101 const char *val = NULL;
1102 const char *
name = NULL;
1103 const char *nameEnd = NULL;
1112 if (!isGeneralTextEntity) {
1121 *versionEndPtr = ptr;
1127 if (isGeneralTextEntity) {
1142 *encodingName = val;
1153 || isGeneralTextEntity) {
1181 switch (result >> 8) {
1182 case 0xD8:
case 0xD9:
case 0xDA:
case 0xDB:
1183 case 0xDC:
case 0xDD:
case 0xDE:
case 0xDF:
1190 if (result == 0xFFFE || result == 0xFFFF)
1215 buf[1] = (char)((c & 0x3f) | 0x80);
1220 buf[1] = (char)(((c >> 6) & 0x3f) | 0x80);
1221 buf[2] = (char)((c & 0x3f) | 0x80);
1226 buf[1] = (char)(((c >> 12) & 0x3f) | 0x80);
1227 buf[2] = (char)(((c >> 6) & 0x3f) | 0x80);
1228 buf[3] = (char)((c & 0x3f) | 0x80);
1239 if (charNum < 0x10000) {
1240 buf[0] = (
unsigned short)charNum;
1243 if (charNum < 0x110000) {
1245 buf[0] = (
unsigned short)((charNum >> 10) + 0xD800);
1246 buf[1] = (
unsigned short)((charNum & 0x3FF) + 0xDC00);
1260#define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc))
1298 const char **fromP,
const char *fromLim,
1299 char **toP,
const char *toLim)
1306 if (*fromP == fromLim)
1308 utf8 = uenc->
utf8[(
unsigned char)**fromP];
1313 if (
n > toLim - *toP)
1320 if (
n > toLim - *toP)
1325 *(*toP)++ = *
utf8++;
1332 const char **fromP,
const char *fromLim,
1333 unsigned short **toP,
const unsigned short *toLim)
1336 while (*fromP != fromLim && *toP != toLim) {
1337 unsigned short c = uenc->
utf16[(
unsigned char)**fromP];
1339 c = (
unsigned short)
1360 for (i = 0; i < 128; i++)
1365 for (i = 0; i < 256; i++) {
1370 e->
utf16[i] = 0xFFFF;
1381 else if (c < 0x80) {
1388 e->
utf8[i][1] = (char)c;
1389 e->
utf16[i] = (
unsigned short)(c == 0 ? 0xFFFF : c);
1394 e->
utf16[i] = 0xFFFF;
1408 e->
utf16[i] = (
unsigned short)c;
1469 static const char *
const encodingNames[] = {
1480 for (i = 0; i < (int)(
sizeof(encodingNames)/
sizeof(encodingNames[0])); i++)
1490#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16)
1491#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i)
1507 const char **nextTokPtr)
1514 if (ptr + 1 == end) {
1529 switch ((
unsigned char)*ptr) {
1543 switch (((
unsigned char)ptr[0] << 8) | (
unsigned char)ptr[1]) {
1548 *nextTokPtr = ptr + 2;
1558 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1563 *nextTokPtr = ptr + 2;
1582 if ((
unsigned char)ptr[2] == 0xBF) {
1583 *nextTokPtr = ptr + 3;
1589 if (ptr[0] ==
'\0') {
1599 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1601 else if (ptr[1] ==
'\0') {
1614 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1620 return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
1634#define NS(x) x ## NS
1635#define ns(x) x ## _ns
static const G4double pos
const char * name(G4int ptype)
static int min3(int a, int b, int c)
const char const char const char * int(PTRFASTCALL *isNmstrt2)(const ENCODING *
const char const char const char const char * int(PTRFASTCALL *isNmstrt3)(const ENCODING *
int(PTRFASTCALL *isName2)(const ENCODING *
const char * int(PTRFASTCALL *isName3)(const ENCODING *
const char const char const char const char const char const char const char * int(PTRFASTCALL *isInvalid3)(const ENCODING *
const char const char const char const char const char * int(PTRFASTCALL *isNmstrt4)(const ENCODING *
const char const char const char const char const char const char const char const char * int(PTRFASTCALL *isInvalid4)(const ENCODING *
const char const char const char const char const char const char * int(PTRFASTCALL *isInvalid2)(const ENCODING *
const char const char * int(PTRFASTCALL *isName4)(const ENCODING *
unsigned short utf16[256]
struct normal_encoding normal
#define BIG2_BYTE_TO_ASCII(enc, p)
static void PTRCALL unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
static void PTRCALL latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
static const struct normal_encoding internal_utf8_encoding
static int PTRFASTCALL utf8_isNmstrt3(const ENCODING *enc, const char *p)
#define STANDARD_VTABLE(E)
static const char KW_encoding[]
static const char KW_ISO_8859_1[]
#define UTF8_GET_NAMING3(pages, byte)
static void PTRCALL unknown_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
static const char KW_UTF_16LE[]
static int PTRFASTCALL unknown_isInvalid(const ENCODING *enc, const char *p)
#define BIG2_IS_NAME_CHAR_MINBPC(enc, p)
static void PTRCALL latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
#define DEFINE_UTF16_TO_UTF8(E)
#define BIG2_BYTE_TYPE(enc, p)
static int toAscii(const ENCODING *enc, const char *ptr, const char *end)
static const struct normal_encoding ascii_encoding
static const char KW_UTF_16[]
static int doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *, const char *), int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingName, const ENCODING **encoding, int *standalone)
static const struct normal_encoding latin1_encoding
static const struct normal_encoding internal_big2_encoding
static int PTRFASTCALL unknown_isNmstrt(const ENCODING *enc, const char *p)
static void PTRCALL ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
static void PTRCALL initUpdatePosition(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos)
#define INIT_ENC_INDEX(enc)
static int parsePseudoAttribute(const ENCODING *enc, const char *ptr, const char *end, const char **namePtr, const char **nameEndPtr, const char **valPtr, const char **nextTokPtr)
static const struct normal_encoding internal_little2_encoding
ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData)
static const char KW_yes[]
static int PTRFASTCALL unknown_isName(const ENCODING *enc, const char *p)
int XmlSizeOfUnknownEncoding(void)
static int FASTCALL isSpace(int c)
static int PTRFASTCALL utf8_isNmstrt2(const ENCODING *enc, const char *p)
static int PTRFASTCALL unicode_byte_type(char hi, char lo)
static const struct normal_encoding utf8_encoding
#define SB_BYTE_TYPE(enc, p)
static void PTRCALL utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim)
#define LITTLE2_CHAR_MATCHES(enc, p, c)
static int PTRFASTCALL utf8_isName3(const ENCODING *enc, const char *p)
static const char KW_standalone[]
#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
#define LITTLE2_BYTE_TYPE(enc, p)
static int PTRFASTCALL isNever(const ENCODING *enc, const char *p)
static int initScan(const ENCODING *const *encodingTable, const INIT_ENCODING *enc, int state, const char *ptr, const char *end, const char **nextTokPtr)
#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
static int PTRFASTCALL utf8_isName2(const ENCODING *enc, const char *p)
static int PTRFASTCALL utf8_isInvalid3(const ENCODING *enc, const char *p)
#define AS_UNKNOWN_ENCODING(enc)
static int FASTCALL checkCharRefNumber(int)
static int PTRFASTCALL utf8_isInvalid2(const ENCODING *enc, const char *p)
static const char KW_UTF_8[]
#define UCS2_GET_NAMING(pages, hi, lo)
static const char KW_US_ASCII[]
static void PTRCALL utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim)
#define UTF8_GET_NAMING2(pages, byte)
static const char KW_no[]
int FASTCALL XmlUtf16Encode(int charNum, unsigned short *buf)
static int FASTCALL streqci(const char *s1, const char *s2)
#define LITTLE2_BYTE_TO_ASCII(enc, p)
static const struct normal_encoding little2_encoding
#define DEFINE_UTF16_TO_UTF16(E)
#define BIG2_CHAR_MATCHES(enc, p, c)
static const char KW_UTF_16BE[]
#define AS_NORMAL_ENCODING(enc)
#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
static const char KW_version[]
static int PTRFASTCALL utf8_isInvalid4(const ENCODING *enc, const char *p)
int FASTCALL XmlUtf8Encode(int c, char *buf)
static int FASTCALL getEncodingIndex(const char *name)
static const struct normal_encoding big2_encoding
#define XML_CONTENT_STATE
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim)
ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, void *userData)
#define XML_UTF8_ENCODE_MAX
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2)
int(XMLCALL * CONVERTER)(void *userData, const char *p)
#define XmlTok(enc, state, ptr, end, nextTokPtr)