41 return &
ns(internal_utf8_encoding).enc;
47 return &
ns(internal_little2_encoding).enc;
48# elif BYTEORDER == 4321
49 return &
ns(internal_big2_encoding).enc;
52 return (*(
const char *)&n ? &
ns(internal_little2_encoding).enc
53 : &
ns(internal_big2_encoding).enc);
57static const ENCODING *
const NS(encodings)[] = {
58 &
ns(latin1_encoding).enc, &
ns(ascii_encoding).enc,
59 &
ns(utf8_encoding).enc, &
ns(big2_encoding).enc,
60 &
ns(big2_encoding).enc, &
ns(little2_encoding).enc,
61 &
ns(utf8_encoding).enc
65NS(initScanProlog)(
const ENCODING *enc,
const char *ptr,
const char *end,
66 const char **nextTokPtr) {
68 ptr, end, nextTokPtr);
72NS(initScanContent)(
const ENCODING *enc,
const char *ptr,
const char *end,
73 const char **nextTokPtr) {
75 ptr, end, nextTokPtr);
81 int i = getEncodingIndex(name);
87 p->initEnc.updatePosition = initUpdatePosition;
89 *encPtr = &(p->initEnc);
94NS(findEncoding)(
const ENCODING *enc,
const char *ptr,
const char *end) {
95# define ENCODING_MAX 128
96 char buf[ENCODING_MAX] =
"";
103 if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
105 i = getEncodingIndex(buf);
108 return NS(encodings)[i];
113 const char *ptr,
const char *end,
const char **badPtr,
114 const char **versionPtr,
const char **versionEndPtr,
117 return doParseXmlDecl(
NS(findEncoding), isGeneralTextEntity, enc, ptr, end,
118 badPtr, versionPtr, versionEndPtr, encodingName,
const char * name(G4int ptype)
#define SET_INIT_ENC_INDEX(enc, i)
int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr)
#define XML_CONTENT_STATE
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim)
const ENCODING * XmlGetUtf8InternalEncoding(void)
const ENCODING * XmlGetUtf16InternalEncoding(void)
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name)