3 return &
ns(internal_utf8_encoding).enc;
8#if XML_BYTE_ORDER == 12
9 return &
ns(internal_little2_encoding).enc;
10#elif XML_BYTE_ORDER == 21
11 return &
ns(internal_big2_encoding).enc;
14 return *(
const char *)&
n ? &
ns(internal_little2_encoding).enc : &
ns(internal_big2_encoding).enc;
19const ENCODING *
NS(encodings)[] = {
20 &
ns(latin1_encoding).enc,
21 &
ns(ascii_encoding).enc,
22 &
ns(utf8_encoding).enc,
23 &
ns(big2_encoding).enc,
24 &
ns(big2_encoding).enc,
25 &
ns(little2_encoding).enc,
26 &
ns(utf8_encoding).enc
30int NS(initScanProlog)(
const ENCODING *enc,
const char *ptr,
const char *end,
31 const char **nextTokPtr)
33 return initScan(
NS(encodings), (
const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr);
37int NS(initScanContent)(
const ENCODING *enc,
const char *ptr,
const char *end,
38 const char **nextTokPtr)
40 return initScan(
NS(encodings), (
const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr);
45 int i = getEncodingIndex(name);
49 p->initEnc.scanners[XML_PROLOG_STATE] =
NS(initScanProlog);
50 p->initEnc.scanners[XML_CONTENT_STATE] =
NS(initScanContent);
51 p->initEnc.updatePosition = initUpdatePosition;
53 *encPtr = &(p->initEnc);
58const ENCODING *
NS(findEncoding)(
const ENCODING *enc,
const char *ptr,
const char *end)
60#define ENCODING_MAX 128
64 XmlUtf8Convert(enc, &ptr, end, &p, p +
ENCODING_MAX - 1);
68 if (streqci(buf,
"UTF-16") && enc->minBytesPerChar == 2)
70 i = getEncodingIndex(buf);
73 return NS(encodings)[i];
81 const char **versionPtr,
82 const char **encodingName,
83 const ENCODING **encoding,
86 return doParseXmlDecl(
NS(findEncoding),
#define INIT_ENC_INDEX(enc)
int NS() XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr, const char *name)
const ENCODING *NS() XmlGetUtf8InternalEncoding()
const ENCODING *NS() XmlGetUtf16InternalEncoding()
int NS() XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingName, const ENCODING **encoding, int *standalone)