6#if defined(__clang__) || defined(__GNUC__)
7#pragma GCC diagnostic ignored "-Wshadow"
8#pragma GCC diagnostic ignored "-Wunused-parameter"
17#define XML_BUILDING_EXPAT 1
19#ifdef COMPILED_FROM_DSP
21#elif defined(MACOS_CLASSIC)
23#elif defined(__amigaos__)
25#elif defined(__WATCOMC__)
26#include "watcomconfig.h"
27#elif defined(HAVE_EXPAT_CONFIG_H)
35#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
36#define XmlConvert XmlUtf16Convert
37#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
38#define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS
39#define XmlEncode XmlUtf16Encode
41#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((char *)(s) - (char *)NULL) & 1))
42typedef unsigned short ICHAR;
44#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX
45#define XmlConvert XmlUtf8Convert
46#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding
47#define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS
48#define XmlEncode XmlUtf8Encode
49#define MUST_CONVERT(enc, s) (!(enc)->isUtf8)
56#define XmlInitEncodingNS XmlInitEncoding
57#define XmlInitUnknownEncodingNS XmlInitUnknownEncoding
58#undef XmlGetInternalEncodingNS
59#define XmlGetInternalEncodingNS XmlGetInternalEncoding
60#define XmlParseXmlDeclNS XmlParseXmlDecl
66#ifdef XML_UNICODE_WCHAR_T
67#define XML_T(x) (const wchar_t)x
68#define XML_L(x) L ## x
70#define XML_T(x) (const unsigned short)x
82#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
87#define memmove(d,s,l) bcopy((s),(d),(l))
89#error memmove does not exist on this platform, nor is a substitute available
116#define CHAR_HASH(h, c) \
117 (((h) * 0xF4243) ^ (unsigned short)(c))
119#define CHAR_HASH(h, c) \
120 (((h) * 0xF4243) ^ (unsigned char)(c))
131#define SECOND_HASH(hash, mask, power) \
132 ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))
133#define PROBE_STEP(hash, mask, power) \
134 ((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))
141#define INIT_TAG_BUF_SIZE 32
142#define INIT_DATA_BUF_SIZE 1024
143#define INIT_ATTS_SIZE 16
144#define INIT_ATTS_VERSION 0xFFFFFFFF
145#define INIT_BLOCK_SIZE 1024
146#define INIT_BUFFER_SIZE 1024
148#define EXPAND_SPARE 24
221#define INIT_SCAFFOLD_ELEMENTS 32
309 const char **endPtr);
318static Processor externalParEntInitProcessor;
320static Processor entityValueInitProcessor;
324static Processor externalEntityInitProcessor;
325static Processor externalEntityInitProcessor2;
326static Processor externalEntityInitProcessor3;
327static Processor externalEntityContentProcessor;
333processXmlDecl(
XML_Parser parser,
int isGeneralTextEntity,
334 const char *s,
const char *
next);
339 const char *end,
int tok,
const char *
next,
const char **nextPtr,
346 const char *start,
const char *end,
const char **endPtr,
350 const char *end,
const char **nextPtr,
XML_Bool haveMore);
354 const char *end,
const char **nextPtr,
XML_Bool haveMore);
382 const char *start,
const char *end);
423 const char *ptr,
const char *end);
426 const char *ptr,
const char *end);
439 const char *ptr,
const char *end);
441static unsigned long generate_hash_secret_salt(
void);
445parserCreate(
const XML_Char *encodingName,
453#define poolStart(pool) ((pool)->start)
454#define poolEnd(pool) ((pool)->ptr)
455#define poolLength(pool) ((pool)->ptr - (pool)->start)
456#define poolChop(pool) ((void)--(pool->ptr))
457#define poolLastChar(pool) (((pool)->ptr)[-1])
458#define poolDiscard(pool) ((pool)->ptr = (pool)->start)
459#define poolFinish(pool) ((pool)->start = (pool)->ptr)
460#define poolAppendChar(pool, c) \
461 (((pool)->ptr == (pool)->end && !poolGrow(pool)) \
463 : ((*((pool)->ptr)++ = c), 1))
550 XML_AttrInfo *m_attInfo;
568#define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
569#define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s)))
570#define FREE(p) (parser->m_mem.free_fcn((p)))
572#define userData (parser->m_userData)
573#define handlerArg (parser->m_handlerArg)
574#define startElementHandler (parser->m_startElementHandler)
575#define endElementHandler (parser->m_endElementHandler)
576#define characterDataHandler (parser->m_characterDataHandler)
577#define processingInstructionHandler \
578 (parser->m_processingInstructionHandler)
579#define commentHandler (parser->m_commentHandler)
580#define startCdataSectionHandler \
581 (parser->m_startCdataSectionHandler)
582#define endCdataSectionHandler (parser->m_endCdataSectionHandler)
583#define defaultHandler (parser->m_defaultHandler)
584#define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler)
585#define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler)
586#define unparsedEntityDeclHandler \
587 (parser->m_unparsedEntityDeclHandler)
588#define notationDeclHandler (parser->m_notationDeclHandler)
589#define startNamespaceDeclHandler \
590 (parser->m_startNamespaceDeclHandler)
591#define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler)
592#define notStandaloneHandler (parser->m_notStandaloneHandler)
593#define externalEntityRefHandler \
594 (parser->m_externalEntityRefHandler)
595#define externalEntityRefHandlerArg \
596 (parser->m_externalEntityRefHandlerArg)
597#define internalEntityRefHandler \
598 (parser->m_internalEntityRefHandler)
599#define skippedEntityHandler (parser->m_skippedEntityHandler)
600#define unknownEncodingHandler (parser->m_unknownEncodingHandler)
601#define elementDeclHandler (parser->m_elementDeclHandler)
602#define attlistDeclHandler (parser->m_attlistDeclHandler)
603#define entityDeclHandler (parser->m_entityDeclHandler)
604#define xmlDeclHandler (parser->m_xmlDeclHandler)
605#define encoding (parser->m_encoding)
606#define initEncoding (parser->m_initEncoding)
607#define internalEncoding (parser->m_internalEncoding)
608#define unknownEncodingMem (parser->m_unknownEncodingMem)
609#define unknownEncodingData (parser->m_unknownEncodingData)
610#define unknownEncodingHandlerData \
611 (parser->m_unknownEncodingHandlerData)
612#define unknownEncodingRelease (parser->m_unknownEncodingRelease)
613#define protocolEncodingName (parser->m_protocolEncodingName)
614#define ns (parser->m_ns)
615#define ns_triplets (parser->m_ns_triplets)
616#define prologState (parser->m_prologState)
617#define processor (parser->m_processor)
618#define errorCode (parser->m_errorCode)
619#define eventPtr (parser->m_eventPtr)
620#define eventEndPtr (parser->m_eventEndPtr)
621#define positionPtr (parser->m_positionPtr)
622#define position (parser->m_position)
623#define openInternalEntities (parser->m_openInternalEntities)
624#define freeInternalEntities (parser->m_freeInternalEntities)
625#define defaultExpandInternalEntities \
626 (parser->m_defaultExpandInternalEntities)
627#define tagLevel (parser->m_tagLevel)
628#define buffer (parser->m_buffer)
629#define bufferPtr (parser->m_bufferPtr)
630#define bufferEnd (parser->m_bufferEnd)
631#define parseEndByteIndex (parser->m_parseEndByteIndex)
632#define parseEndPtr (parser->m_parseEndPtr)
633#define bufferLim (parser->m_bufferLim)
634#define dataBuf (parser->m_dataBuf)
635#define dataBufEnd (parser->m_dataBufEnd)
636#define _dtd (parser->m_dtd)
637#define curBase (parser->m_curBase)
638#define declEntity (parser->m_declEntity)
639#define doctypeName (parser->m_doctypeName)
640#define doctypeSysid (parser->m_doctypeSysid)
641#define doctypePubid (parser->m_doctypePubid)
642#define declAttributeType (parser->m_declAttributeType)
643#define declNotationName (parser->m_declNotationName)
644#define declNotationPublicId (parser->m_declNotationPublicId)
645#define declElementType (parser->m_declElementType)
646#define declAttributeId (parser->m_declAttributeId)
647#define declAttributeIsCdata (parser->m_declAttributeIsCdata)
648#define declAttributeIsId (parser->m_declAttributeIsId)
649#define freeTagList (parser->m_freeTagList)
650#define freeBindingList (parser->m_freeBindingList)
651#define inheritedBindings (parser->m_inheritedBindings)
652#define tagStack (parser->m_tagStack)
653#define atts (parser->m_atts)
654#define attsSize (parser->m_attsSize)
655#define nSpecifiedAtts (parser->m_nSpecifiedAtts)
656#define idAttIndex (parser->m_idAttIndex)
657#define nsAtts (parser->m_nsAtts)
658#define nsAttsVersion (parser->m_nsAttsVersion)
659#define nsAttsPower (parser->m_nsAttsPower)
660#define attInfo (parser->m_attInfo)
661#define tempPool (parser->m_tempPool)
662#define temp2Pool (parser->m_temp2Pool)
663#define groupConnector (parser->m_groupConnector)
664#define groupSize (parser->m_groupSize)
665#define namespaceSeparator (parser->m_namespaceSeparator)
666#define parentParser (parser->m_parentParser)
667#define ps_parsing (parser->m_parsingStatus.parsing)
668#define ps_finalBuffer (parser->m_parsingStatus.finalBuffer)
670#define isParamEntity (parser->m_isParamEntity)
671#define useForeignDTD (parser->m_useForeignDTD)
672#define paramEntityParsing (parser->m_paramEntityParsing)
674#define hash_secret_salt (parser->m_hash_secret_salt)
690static const XML_Char implicitContext[] = {
700generate_hash_secret_salt(
void)
702 unsigned int seed = time(NULL) % UINT_MAX;
717 return setContext(parser, implicitContext);
727 return parserCreate(encodingName, memsuite, nameSep, NULL);
731parserCreate(
const XML_Char *encodingName,
742 if (parser != NULL) {
752 if (parser != NULL) {
826 parserInit(parser, encodingName);
851 ? poolCopyString(&
tempPool, encodingName)
949 while (openEntityList) {
951 openEntityList = openEntity->
next;
961 parserInit(parser, encodingName);
975 if (encodingName == NULL)
1052 parser = parserCreate(encodingName, &parser->
m_mem, tmp, newDtd);
1055 parser = parserCreate(encodingName, &parser->
m_mem, NULL, newDtd);
1083 if (oldUserData == oldHandlerArg)
1087 if (oldExternalEntityRefHandlerArg != oldParser)
1094 paramEntityParsing = oldParamEntityParsing;
1098 if (!dtdCopy(oldParser,
_dtd, oldDtd, &parser->
m_mem)
1099 || !setContext(parser, context)) {
1103 processor = externalEntityInitProcessor;
1116 processor = externalParEntInitProcessor;
1146 if (tagList == NULL) {
1153 tagList = tagList->
parent;
1155 destroyBindings(p->
bindings, parser);
1162 if (entityList == NULL) {
1168 openEntity = entityList;
1169 entityList = entityList->
next;
1181 if (!isParamEntity &&
_dtd)
1213 useForeignDTD = useDTD;
1242 p = poolCopyString(&
_dtd->pool, p);
1487 paramEntityParsing = peParsing;
1496 unsigned long hash_salt)
1555#ifndef XML_CONTEXT_BYTES
1589 nLeftOver = s + len - end;
1595 ? (
char *)
MALLOC(len * 2)
1606 memcpy(
buffer, end, nLeftOver);
1622 memcpy(buff, s, len);
1700#ifdef XML_CONTEXT_BYTES
1708#ifdef XML_CONTEXT_BYTES
1724 if (bufferSize == 0)
1728 }
while (bufferSize < neededSize);
1729 newBuf = (
char *)
MALLOC(bufferSize);
1735#ifdef XML_CONTEXT_BYTES
1782 if (isParamEntity) {
1836 assert(status != NULL);
1865#ifdef XML_CONTEXT_BYTES
1924 reportDefault(parser,
1936 static const XML_LChar*
const message[] = {
1938 XML_L(
"out of memory"),
1939 XML_L(
"syntax error"),
1940 XML_L(
"no element found"),
1941 XML_L(
"not well-formed (invalid token)"),
1942 XML_L(
"unclosed token"),
1943 XML_L(
"partial character"),
1944 XML_L(
"mismatched tag"),
1945 XML_L(
"duplicate attribute"),
1946 XML_L(
"junk after document element"),
1947 XML_L(
"illegal parameter entity reference"),
1948 XML_L(
"undefined entity"),
1949 XML_L(
"recursive entity reference"),
1950 XML_L(
"asynchronous entity"),
1951 XML_L(
"reference to invalid character number"),
1952 XML_L(
"reference to binary entity"),
1953 XML_L(
"reference to external entity in attribute"),
1954 XML_L(
"XML or text declaration not at start of entity"),
1955 XML_L(
"unknown encoding"),
1956 XML_L(
"encoding specified in XML declaration is incorrect"),
1957 XML_L(
"unclosed CDATA section"),
1958 XML_L(
"error in processing external entity reference"),
1959 XML_L(
"document is not standalone"),
1960 XML_L(
"unexpected parser state - please send a bug report"),
1961 XML_L(
"entity declared in parameter entity"),
1962 XML_L(
"requested feature requires XML_DTD support in Expat"),
1963 XML_L(
"cannot change setting once parsing has begun"),
1964 XML_L(
"unbound prefix"),
1965 XML_L(
"must not undeclare prefix"),
1966 XML_L(
"incomplete markup in parameter entity"),
1967 XML_L(
"XML declaration not well-formed"),
1968 XML_L(
"text declaration not well-formed"),
1969 XML_L(
"illegal character(s) in public id"),
1970 XML_L(
"parser suspended"),
1971 XML_L(
"parser not suspended"),
1972 XML_L(
"parsing aborted"),
1973 XML_L(
"parsing finished"),
1974 XML_L(
"cannot suspend in external parameter entity"),
1975 XML_L(
"reserved prefix (xml) must not be undeclared or bound to another namespace name"),
1976 XML_L(
"reserved prefix (xmlns) must not be declared or undeclared"),
1977 XML_L(
"prefix must not be bound to one of the reserved namespace names")
1979 if (
code > 0 &&
code <
sizeof(message)/
sizeof(message[0]))
1980 return message[
code];
1995#define V1(a,b,c) XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c)
1996#define V2(a,b,c) XML_L("expat_")V1(a,b,c)
2027#ifdef XML_UNICODE_WCHAR_T
2033#ifdef XML_CONTEXT_BYTES
2043#ifdef XML_LARGE_SIZE
2067 char *rawNameBuf =
tag->
buf + nameLen;
2096 rawNameBuf = temp + nameLen;
2109 const char **endPtr)
2114 if (!storeRawNames(parser))
2121externalEntityInitProcessor(
XML_Parser parser,
2124 const char **endPtr)
2126 enum XML_Error result = initializeEncoding(parser);
2129 processor = externalEntityInitProcessor2;
2130 return externalEntityInitProcessor2(parser, start, end, endPtr);
2134externalEntityInitProcessor2(
XML_Parser parser,
2137 const char **endPtr)
2139 const char *next = start;
2169 processor = externalEntityInitProcessor3;
2170 return externalEntityInitProcessor3(parser, start, end, endPtr);
2174externalEntityInitProcessor3(
XML_Parser parser,
2177 const char **endPtr)
2180 const char *next = start;
2189 result = processXmlDecl(parser, 1, start, next);
2216 processor = externalEntityContentProcessor;
2218 return externalEntityContentProcessor(parser, start, end, endPtr);
2222externalEntityContentProcessor(
XML_Parser parser,
2225 const char **endPtr)
2230 if (!storeRawNames(parser))
2242 const char **nextPtr,
2248 const char **eventPP;
2249 const char **eventEndPP;
2261 const char *next = s;
2276 reportDefault(parser, enc, s, end);
2280 if (startTagLevel == 0)
2291 if (startTagLevel > 0) {
2324 reportDefault(parser, enc, s, next);
2327 name = poolStoreString(&dtd->
pool, enc,
2348 reportDefault(parser, enc, s, next);
2361 reportDefault(parser, enc, s, next);
2364 result = processInternalEntity(parser, entity,
XML_FALSE);
2371 context = getContext(parser);
2384 reportDefault(parser, enc, s, next);
2425 &fromPtr, rawNameEnd,
2428 if (fromPtr == rawNameEnd) {
2439 toPtr = (
XML_Char *)temp + convLen;
2444 *toPtr =
XML_T(
'\0');
2452 reportDefault(parser, enc, s, next);
2470 result = storeAtts(parser, enc, s, &name, &bindings);
2480 *eventPP = *eventEndPP;
2485 reportDefault(parser, enc, s, next);
2498 return epilogProcessor(parser, next, end, nextPtr);
2505 const char *rawName;
2513 || memcmp(
tag->
rawName, rawName, len) != 0) {
2523 if (
ns && localPart) {
2530 while (*localPart) *uri++ = *localPart++;
2541 reportDefault(parser, enc, s, next);
2552 return epilogProcessor(parser, next, end, nextPtr);
2565 reportDefault(parser, enc, s, next);
2576 reportDefault(parser, enc, s, next);
2600 reportDefault(parser, enc, s, next);
2601 result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
2628 reportDefault(parser, enc, s, end);
2632 if (startTagLevel == 0) {
2645 if (charDataHandler) {
2664 reportDefault(parser, enc, s, next);
2668 if (!reportProcessingInstruction(parser, enc, s, next))
2672 if (!reportComment(parser, enc, s, next))
2677 reportDefault(parser, enc, s, next);
2680 *eventPP = s = next;
2705 const char *attStr,
TAG_NAME *tagNamePtr,
2731 if (
ns && !setElementTypePrefix(parser, elementType))
2742 XML_AttrInfo *temp2;
2755 if (n > oldAttsSize)
2760 for (i = 0; i <
n; i++) {
2763 XML_AttrInfo *currAttInfo = &
attInfo[i];
2773 currAttInfo->nameEnd = currAttInfo->nameStart +
2783 if ((attId->
name)[-1]) {
2788 (attId->
name)[-1] = 1;
2789 appAtts[attIndex++] = attId->
name;
2790 if (!
atts[i].normalized) {
2797 for (j = 0; j < nDefaultAtts; j++) {
2806 result = storeAttributeValue(parser, enc, isCdata,
2807 atts[i].valuePtr,
atts[i].valueEnd,
2816 appAtts[attIndex] = poolStoreString(&
tempPool, enc,
atts[i].valuePtr,
2818 if (appAtts[attIndex] == 0)
2827 appAtts[attIndex], bindingsPtr);
2836 (attId->
name)[-1] = 2;
2846 for (i = 0; i < attIndex; i += 2)
2847 if (appAtts[i] == elementType->
idAtt->
name) {
2856 for (i = 0; i < nDefaultAtts; i++) {
2862 da->
value, bindingsPtr);
2869 appAtts[attIndex++] = da->
id->
name;
2870 appAtts[attIndex++] = da->
value;
2875 appAtts[attIndex++] = da->
id->
name;
2876 appAtts[attIndex++] = da->
value;
2880 appAtts[attIndex] = 0;
2906 for (j = nsAttsSize; j != 0; )
2907 nsAtts[--j].version = version;
2912 for (; i < attIndex; i += 2) {
2925 for (j = 0; j < b->
uriLen; j++) {
2943 unsigned char step = 0;
2944 unsigned long mask = nsAttsSize - 1;
2946 while (
nsAtts[j].version == version) {
2948 if (uriHash ==
nsAtts[j].hash) {
2952 for (; *s1 == *s2 && *s1 != 0; s1++, s2++);
2958 j < step ? (j += nsAttsSize - step) : (j -= step);
2977 nsAtts[j].version = version;
2978 nsAtts[j].hash = uriHash;
2991 for (; i < attIndex; i += 2)
2992 ((
XML_Char *)(appAtts[i]))[-1] = 0;
3000 if (elementType->
prefix) {
3004 localPart = tagNamePtr->
str;
3010 localPart = tagNamePtr->
str;
3023 for (i = 0; localPart[i++];)
3041 memcpy(uri, localPart, i *
sizeof(
XML_Char));
3059 static const XML_Char xmlNamespace[] = {
3067 static const int xmlLen =
3068 (int)
sizeof(xmlNamespace)/
sizeof(
XML_Char) - 1;
3069 static const XML_Char xmlnsNamespace[] = {
3076 static const int xmlnsLen =
3077 (int)
sizeof(xmlnsNamespace)/
sizeof(
XML_Char) - 1;
3105 for (len = 0; uri[len]; len++) {
3106 if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
3109 if (!mustBeXML && isXMLNS
3110 && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
3113 isXML = isXML && len == xmlLen;
3114 isXMLNS = isXMLNS && len == xmlnsLen;
3116 if (mustBeXML != isXML)
3176 const char **endPtr)
3184 processor = externalEntityContentProcessor;
3185 return externalEntityContentProcessor(parser, start, end, endPtr);
3189 return contentProcessor(parser, start, end, endPtr);
3201 const char **startPtr,
3203 const char **nextPtr,
3206 const char *s = *startPtr;
3207 const char **eventPP;
3208 const char **eventEndPP;
3235 reportDefault(parser, enc, s, next);
3248 reportDefault(parser, enc, s, next);
3253 if (charDataHandler) {
3272 reportDefault(parser, enc, s, next);
3296 *eventPP = s = next;
3318 const char **endPtr)
3326 return prologProcessor(parser, start, end, endPtr);
3337 const char **startPtr,
3339 const char **nextPtr,
3344 const char *s = *startPtr;
3345 const char **eventPP;
3346 const char **eventEndPP;
3358 tok = XmlIgnoreSectionTok(enc, s, end, &next);
3361 case XML_TOK_IGNORE_SECT:
3363 reportDefault(parser, enc, s, next);
3400 char encodingBuf[128];
3406 if (i ==
sizeof(encodingBuf) - 1
3408 encodingBuf[0] =
'\0';
3413 encodingBuf[i] =
'\0';
3425processXmlDecl(
XML_Parser parser,
int isGeneralTextEntity,
3426 const char *s,
const char *next)
3428 const char *encodingName = NULL;
3429 const XML_Char *storedEncName = NULL;
3430 const ENCODING *newEncoding = NULL;
3431 const char *version = NULL;
3432 const char *versionend;
3433 const XML_Char *storedversion = NULL;
3434 int standalone = -1;
3447 if (isGeneralTextEntity)
3452 if (!isGeneralTextEntity && standalone == 1) {
3460 if (encodingName != NULL) {
3461 storedEncName = poolStoreString(&
temp2Pool,
3471 storedversion = poolStoreString(&
temp2Pool,
3481 reportDefault(parser,
encoding, s, next);
3490 else if (encodingName) {
3492 if (!storedEncName) {
3493 storedEncName = poolStoreString(
3499 result = handleUnknownEncoding(parser, storedEncName);
3507 if (storedEncName || storedversion)
3519 for (i = 0; i < 256; i++)
3521 info.convert = NULL;
3523 info.release = NULL;
3530 info.release(info.
data);
3546 if (info.release != NULL)
3547 info.release(info.
data);
3556 const char **nextPtr)
3558 enum XML_Error result = initializeEncoding(parser);
3562 return prologProcessor(parser, s, end, nextPtr);
3568externalParEntInitProcessor(
XML_Parser parser,
3571 const char **nextPtr)
3573 enum XML_Error result = initializeEncoding(parser);
3583 return entityValueInitProcessor(parser, s, end, nextPtr);
3587 return externalParEntProcessor(parser, s, end, nextPtr);
3595 const char **nextPtr)
3598 const char *start = s;
3599 const char *next = start;
3622 return storeEntityValue(parser,
encoding, s, end);
3626 result = processXmlDecl(parser, 0, start, next);
3640 return entityValueProcessor(parser, next, end, nextPtr);
3662 const char **nextPtr)
3664 const char *next = s;
3695 return doProlog(parser,
encoding, s, end, tok, next,
3703 const char **nextPtr)
3705 const char *start = s;
3706 const char *next = s;
3729 return storeEntityValue(parser, enc, s, end);
3741 const char **nextPtr)
3743 const char *next = s;
3745 return doProlog(parser,
encoding, s, end, tok, next,
3756 const char **nextPtr,
3762 static const XML_Char atypeCDATA[] =
3765 static const XML_Char atypeIDREF[] =
3767 static const XML_Char atypeIDREFS[] =
3769 static const XML_Char atypeENTITY[] =
3773 static const XML_Char atypeNMTOKEN[] = {
3785 const char **eventPP;
3786 const char **eventEndPP;
3830 if (isParamEntity || enc !=
encoding) {
3849 enum XML_Error result = processXmlDecl(parser, 0, s, next);
3877 case XML_ROLE_TEXT_DECL:
3879 enum XML_Error result = processXmlDecl(parser, 1, s, next);
3891 &dtd->paramEntities,
3902 pubId = poolStoreString(&
tempPool, enc,
3907 normalizePublicId(pubId);
3911 goto alreadyChecked;
3925 normalizePublicId(tem);
3949 &dtd->paramEntities,
3963 if (dtd->paramEntityRead) {
3989 if (useForeignDTD) {
3993 ENTITY *entity = (
ENTITY *)lookup(parser, &dtd->paramEntities,
4006 if (dtd->paramEntityRead) {
4022 return contentProcessor(parser, s, end, nextPtr);
4027 goto checkAttListDeclHandler;
4035 goto checkAttListDeclHandler;
4039 goto checkAttListDeclHandler;
4043 goto checkAttListDeclHandler;
4046 goto checkAttListDeclHandler;
4049 goto checkAttListDeclHandler;
4052 goto checkAttListDeclHandler;
4055 goto checkAttListDeclHandler;
4058 goto checkAttListDeclHandler;
4061 checkAttListDeclHandler:
4079 if (!poolAppend(&
tempPool, enc, s, next))
4152 enum XML_Error result = storeEntityValue(parser, enc,
4198 && !paramEntityParsing
4208 &dtd->paramEntities,
4246 declEntity->notation = poolStoreString(&dtd->
pool, enc, s, next);
4364 normalizePublicId(tem);
4412 case XML_ROLE_IGNORE_SECT:
4416 reportDefault(parser, enc, s, next);
4418 result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore);
4451 int myindex = nextScaffoldPart(parser);
4485 case XML_ROLE_INNER_PARAM_ENTITY_REF:
4487 if (!paramEntityParsing)
4492 name = poolStoreString(&dtd->
pool, enc,
4497 entity = (
ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
4527 result = processInternalEntity(parser, entity, betweenDecl);
4546 if (!dtd->paramEntityRead) {
4585 content->
name = NULL;
4610 goto elementContent;
4613 goto elementContent;
4616 goto elementContent;
4627 int myindex = nextScaffoldPart(parser);
4632 el = getElementType(parser, enc, s, nxt);
4638 for (;
name[nameLen++]; );
4663 if (!handleDefault) {
4678 if (!reportProcessingInstruction(parser, enc, s, next))
4683 if (!reportComment(parser, enc, s, next))
4717 reportDefault(parser, enc, s, next);
4737 const char **nextPtr)
4742 const char *next = NULL;
4749 reportDefault(parser,
encoding, s, next);
4760 reportDefault(parser,
encoding, s, next);
4763 if (!reportProcessingInstruction(parser,
encoding, s, next))
4767 if (!reportComment(parser,
encoding, s, next))
4804 const char *textStart, *textEnd;
4822 openEntity->
entity = entity;
4827 textStart = (
char *)entity->
textPtr;
4843 entity->
processed = (int)(next - textStart);
4861 const char **nextPtr)
4864 const char *textStart, *textEnd;
4871 entity = openEntity->
entity;
4905 return doProlog(parser,
encoding, s, end, tok, next, nextPtr,
4922 const char **nextPtr)
4929 const char *ptr,
const char *end,
4932 enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr,
4945 const char *ptr,
const char *end,
4983 for (i = 0; i <
n; i++) {
4990 if (!poolAppend(pool, enc, ptr, next))
5007 char checkEntityDecl;
5026 if (pool == &dtd->
pool)
5036 if (checkEntityDecl) {
5076 (
char *)textEnd, pool);
5096 const char *entityTextPtr,
5097 const char *entityTextEnd)
5110 if (!poolGrow(pool))
5120 if (isParamEntity || enc !=
encoding) {
5128 goto endEntityValue;
5130 entity = (
ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
5140 goto endEntityValue;
5146 goto endEntityValue;
5159 goto endEntityValue;
5162 if (!dtd->paramEntityRead)
5170 result = storeEntityValue(parser,
5177 goto endEntityValue;
5186 goto endEntityValue;
5189 goto endEntityValue;
5192 if (!poolAppend(pool, enc, entityTextPtr, next)) {
5194 goto endEntityValue;
5201 if (pool->
end == pool->
ptr && !poolGrow(pool)) {
5203 goto endEntityValue;
5205 *(pool->
ptr)++ = 0xA;
5216 goto endEntityValue;
5223 goto endEntityValue;
5225 for (i = 0; i <
n; i++) {
5226 if (pool->
end == pool->
ptr && !poolGrow(pool)) {
5228 goto endEntityValue;
5230 *(pool->
ptr)++ = buf[i];
5238 goto endEntityValue;
5243 goto endEntityValue;
5248 goto endEntityValue;
5250 entityTextPtr = next;
5264 if (*s ==
XML_T(
'\0'))
5284 const char *start,
const char *end)
5291 reportDefault(parser, enc, start, end);
5296 target = poolStoreString(&
tempPool, enc, start, tem);
5300 data = poolStoreString(&
tempPool, enc,
5305 normalizeLines(data);
5313 const char *start,
const char *end)
5318 reportDefault(parser, enc, start, end);
5327 normalizeLines(data);
5335 const char *s,
const char *end)
5338 const char **eventPP;
5339 const char **eventEndPP;
5366 if (value || isId) {
5374 type->
idAtt = attId;
5410 for (name = elementType->
name; *name; name++) {
5414 for (s = elementType->
name; s != name; s++) {
5437 const char *start,
const char *end)
5444 name = poolStoreString(&dtd->
pool, enc, start, end);
5452 if (id->
name != name)
5464 if (name[5] ==
XML_T(
'\0'))
5472 for (i = 0;
name[i]; i++) {
5476 for (j = 0; j < i; j++) {
5496#define CONTEXT_SEP XML_T(ASCII_FF)
5513 for (i = 0; i < len; i++)
5519 hashTableIterInit(&iter, &(dtd->
prefixes));
5539 for (i = 0; i < len; i++)
5556 for (s = e->
name; *s; s++)
5573 while (*context !=
XML_T(
'\0')) {
5581 if (*s !=
XML_T(
'\0'))
5604 for (context = s + 1;
5615 if (*context !=
XML_T(
'\0'))
5629normalizePublicId(
XML_Char *publicId)
5633 for (s = publicId; *s; s++) {
5638 if (p != publicId && p[-1] != 0x20)
5645 if (p != publicId && p[-1] == 0x20)
5656 poolInit(&(p->
pool), ms);
5664 hashTableInit(&(p->paramEntities), ms);
5698 hashTableClear(&(p->paramEntities));
5703 poolClear(&(p->
pool));
5739 hashTableDestroy(&(p->paramEntities));
5744 poolDestroy(&(p->
pool));
5763 hashTableIterInit(&iter, &(oldDtd->
prefixes));
5766 const PREFIX *oldP = (
PREFIX *)hashTableIterNext(&iter);
5772 if (!lookup(oldParser, &(newDtd->
prefixes), name,
sizeof(
PREFIX)))
5858 if (!copyEntityTable(oldParser,
5865 if (!copyEntityTable(oldParser,
5866 &(newDtd->paramEntities),
5868 &(oldDtd->paramEntities)))
5870 newDtd->paramEntityRead = oldDtd->paramEntityRead;
5895 const XML_Char *cachedOldBase = NULL;
5896 const XML_Char *cachedNewBase = NULL;
5898 hashTableIterInit(&iter, oldTable);
5903 const ENTITY *oldE = (
ENTITY *)hashTableIterNext(&iter);
5906 name = poolCopyString(newPool, oldE->
name);
5909 newE = (
ENTITY *)lookup(oldParser, newTable, name,
sizeof(
ENTITY));
5918 if (oldE->
base == cachedOldBase)
5919 newE->
base = cachedNewBase;
5921 cachedOldBase = oldE->
base;
5922 tem = poolCopyString(newPool, cachedOldBase);
5925 cachedNewBase = newE->
base = tem;
5929 tem = poolCopyString(newPool, oldE->
publicId);
5960 for (; *s1 == *s2; s1++, s2++)
5979 if (table->
size == 0) {
5992 memset(table->
v, 0, tsize);
5993 i = hash(parser, name) & ((
unsigned long)table->
size - 1);
5996 unsigned long h = hash(parser, name);
5997 unsigned long mask = (
unsigned long)table->
size - 1;
5998 unsigned char step = 0;
6000 while (table->
v[i]) {
6001 if (keyeq(name, table->
v[i]->
name))
6005 i < step ? (i += table->
size - step) : (i -= step);
6011 if (table->
used >> (table->
power - 1)) {
6012 unsigned char newPower = table->
power + 1;
6013 size_t newSize = (size_t)1 << newPower;
6014 unsigned long newMask = (
unsigned long)newSize - 1;
6015 size_t tsize = newSize *
sizeof(
NAMED *);
6019 memset(newV, 0, tsize);
6020 for (i = 0; i < table->
size; i++)
6022 unsigned long newHash = hash(parser, table->
v[i]->
name);
6023 size_t j = newHash & newMask;
6027 step =
PROBE_STEP(newHash, newMask, newPower);
6028 j < step ? (j += newSize - step) : (j -= step);
6030 newV[j] = table->
v[i];
6034 table->
power = newPower;
6035 table->
size = newSize;
6038 while (table->
v[i]) {
6041 i < step ? (i += newSize - step) : (i -= step);
6048 memset(table->
v[i], 0, createSize);
6058 for (i = 0; i < table->
size; i++) {
6069 for (i = 0; i < table->
size; i++)
6094 while (iter->
p != iter->
end) {
6095 NAMED *tem = *(iter->
p)++;
6152 const char *ptr,
const char *end)
6154 if (!pool->
ptr && !poolGrow(pool))
6160 if (!poolGrow(pool))
6181 if (!pool->
ptr && !poolGrow(pool))
6183 for (;
n > 0; --
n, s++) {
6205 const char *ptr,
const char *end)
6207 if (!poolAppend(pool, enc, ptr, end))
6209 if (pool->
ptr == pool->
end && !poolGrow(pool))
6219 if (pool->
start == 0) {
6242 int blockSize = (int)(pool->
end - pool->
start)*2;
6253 pool->
end = pool->
start + blockSize;
6257 int blockSize = (int)(pool->
end - pool->
start);
6266 tem->
size = blockSize;
6270 memcpy(tem->
s, pool->
start,
6274 pool->
end = tem->
s + blockSize;
6339 dest->
name = *strpos;
6342 *(*strpos)++ = *src;
6357 i < dest->numchildren;
6359 build_node(parser, cn, &(dest->
children[i]), contpos, strpos);
6382 build_node(parser, 0, ret, &cpos, &str);
6401 if (ret->
name != name)
6405 if (!setElementTypePrefix(parser, ret))
#define XML_CONTEXT_BYTES
void(XMLCALL * XML_CommentHandler)(void *userData, const XML_Char *data)
void(XMLCALL * XML_EndElementHandler)(void *userData, const XML_Char *name)
void(XMLCALL * XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix)
void(XMLCALL * XML_SkippedEntityHandler)(void *userData, const XML_Char *entityName, int is_parameter_entity)
int(XMLCALL * XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
@ XML_FEATURE_SIZEOF_XML_LCHAR
@ XML_FEATURE_SIZEOF_XML_CHAR
@ XML_FEATURE_UNICODE_WCHAR_T
@ XML_FEATURE_CONTEXT_BYTES
void(XMLCALL * XML_EndCdataSectionHandler)(void *userData)
int(XMLCALL * XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info)
void(XMLCALL * XML_EndDoctypeDeclHandler)(void *userData)
#define XML_MAJOR_VERSION
void(XMLCALL * XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts)
void(XMLCALL * XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data)
#define XML_MINOR_VERSION
void(XMLCALL * XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri)
void(XMLCALL * XML_XmlDeclHandler)(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
void(XMLCALL * XML_StartCdataSectionHandler)(void *userData)
void(XMLCALL * XML_UnparsedEntityDeclHandler)(void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
@ XML_ERROR_UNCLOSED_TOKEN
@ XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
@ XML_ERROR_NOT_STANDALONE
@ XML_ERROR_INCOMPLETE_PE
@ XML_ERROR_RECURSIVE_ENTITY_REF
@ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
@ XML_ERROR_ENTITY_DECLARED_IN_PE
@ XML_ERROR_DUPLICATE_ATTRIBUTE
@ XML_ERROR_EXTERNAL_ENTITY_HANDLING
@ XML_ERROR_INCORRECT_ENCODING
@ XML_ERROR_MISPLACED_XML_PI
@ XML_ERROR_PARAM_ENTITY_REF
@ XML_ERROR_FEATURE_REQUIRES_XML_DTD
@ XML_ERROR_RESERVED_PREFIX_XML
@ XML_ERROR_UNEXPECTED_STATE
@ XML_ERROR_JUNK_AFTER_DOC_ELEMENT
@ XML_ERROR_NOT_SUSPENDED
@ XML_ERROR_UNCLOSED_CDATA_SECTION
@ XML_ERROR_RESERVED_NAMESPACE_URI
@ XML_ERROR_UNDEFINED_ENTITY
@ XML_ERROR_UNBOUND_PREFIX
@ XML_ERROR_UNDECLARING_PREFIX
@ XML_ERROR_INVALID_TOKEN
@ XML_ERROR_BINARY_ENTITY_REF
@ XML_ERROR_UNKNOWN_ENCODING
@ XML_ERROR_RESERVED_PREFIX_XMLNS
#define XML_STATUS_SUSPENDED
struct XML_cp XML_Content
@ XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
@ XML_PARAM_ENTITY_PARSING_NEVER
void(XMLCALL * XML_AttlistDeclHandler)(void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired)
int(XMLCALL * XML_NotStandaloneHandler)(void *userData)
#define XML_MICRO_VERSION
struct XML_ParserStruct * XML_Parser
void(XMLCALL * XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset)
void(XMLCALL * XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len)
void(XMLCALL * XML_EntityDeclHandler)(void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
void(XMLCALL * XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
void(XMLCALL * XML_DefaultHandler)(void *userData, const XML_Char *s, int len)
void(XMLCALL * XML_ElementDeclHandler)(void *userData, const XML_Char *name, XML_Content *model)
const char * name(G4int ptype)
enum XML_Content_Quant quant
enum XML_Content_Type type
unsigned contentStringLen
CONTENT_SCAFFOLD * scaffold
XML_Bool hasParamEntityRefs
HASH_TABLE generalEntities
STRING_POOL entityValuePool
DEFAULT_ATTRIBUTE * defaultAtts
const ATTRIBUTE_ID * idAtt
const XML_Char * publicId
const XML_Char * systemId
const XML_Char * notation
const XML_Memory_Handling_Suite * mem
const XML_Memory_Handling_Suite * mem
const XML_Char * localPart
void *(* realloc_fcn)(void *ptr, size_t size)
void *(* malloc_fcn)(size_t size)
void(* free_fcn)(void *ptr)
XML_EndDoctypeDeclHandler m_endDoctypeDeclHandler
XML_XmlDeclHandler m_xmlDeclHandler
const ENCODING * m_encoding
XML_CommentHandler m_commentHandler
XML_Bool m_declAttributeIsCdata
XML_ExternalEntityRefHandler m_externalEntityRefHandler
XML_UnknownEncodingHandler m_unknownEncodingHandler
enum XML_Error m_errorCode
XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler
unsigned char m_nsAttsPower
XML_StartElementHandler m_startElementHandler
XML_Bool m_defaultExpandInternalEntities
const char * m_eventEndPtr
const XML_Char * m_doctypeName
void * m_unknownEncodingMem
XML_SkippedEntityHandler m_skippedEntityHandler
XML_EndElementHandler m_endElementHandler
XML_EntityDeclHandler m_entityDeclHandler
XML_Parser m_externalEntityRefHandlerArg
void(XMLCALL *m_unknownEncodingRelease)(void *)
const XML_Memory_Handling_Suite m_mem
XML_Bool m_declAttributeIsId
void * m_unknownEncodingHandlerData
XML_AttlistDeclHandler m_attlistDeclHandler
const XML_Char * m_curBase
XML_Parser m_parentParser
void * m_unknownEncodingData
ELEMENT_TYPE * m_declElementType
ATTRIBUTE_ID * m_declAttributeId
const ENCODING * m_internalEncoding
unsigned long m_hash_secret_salt
XML_Index m_parseEndByteIndex
XML_EndCdataSectionHandler m_endCdataSectionHandler
const XML_Char * m_protocolEncodingName
const XML_Char * m_declAttributeType
const XML_Char * m_declNotationName
XML_NotationDeclHandler m_notationDeclHandler
OPEN_INTERNAL_ENTITY * m_freeInternalEntities
OPEN_INTERNAL_ENTITY * m_openInternalEntities
XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler
BINDING * m_inheritedBindings
BINDING * m_freeBindingList
XML_ElementDeclHandler m_elementDeclHandler
XML_DefaultHandler m_defaultHandler
XML_StartDoctypeDeclHandler m_startDoctypeDeclHandler
INIT_ENCODING m_initEncoding
XML_Char m_namespaceSeparator
const XML_Char * m_declNotationPublicId
XML_ParsingStatus m_parsingStatus
const XML_Char * m_doctypeSysid
const char * m_parseEndPtr
const char * m_positionPtr
XML_NotStandaloneHandler m_notStandaloneHandler
XML_ProcessingInstructionHandler m_processingInstructionHandler
XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler
XML_CharacterDataHandler m_characterDataHandler
PROLOG_STATE m_prologState
unsigned long m_nsAttsVersion
XML_StartCdataSectionHandler m_startCdataSectionHandler
const XML_Char * m_doctypePubid
enum XML_Content_Quant quant
enum XML_Content_Type type
struct binding * prevPrefixBinding
const struct attribute_id * attId
struct binding * nextTagBinding
struct open_internal_entity * next
const char * internalEventEndPtr
const char * internalEventPtr
XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encodingName)
#define externalEntityRefHandlerArg
void *XMLCALL XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
void XMLCALL XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end)
#define defaultExpandInternalEntities
#define endCdataSectionHandler
void XMLCALL XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *data)
enum XML_Status XMLCALL XML_SetBase(XML_Parser parser, const XML_Char *p)
const XML_Feature *XMLCALL XML_GetFeatureList(void)
void XMLCALL XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler)
#define processingInstructionHandler
#define skippedEntityHandler
#define declAttributeIsId
void XMLCALL XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler)
void XMLCALL XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler)
#define elementDeclHandler
#define PROBE_STEP(hash, mask, power)
int XMLCALL XML_GetSpecifiedAttributeCount(XML_Parser parser)
void XMLCALL XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl)
enum XML_Status XMLCALL XML_StopParser(XML_Parser parser, XML_Bool resumable)
#define INIT_SCAFFOLD_ELEMENTS
#define inheritedBindings
void XMLCALL XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler)
void XMLCALL XML_FreeContentModel(XML_Parser parser, XML_Content *model)
const char *XMLCALL XML_GetInputContext(XML_Parser parser, int *offset, int *size)
XML_Parser XMLCALL XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
XML_Parser XMLCALL XML_ParserCreate_MM(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep)
#define INIT_DATA_BUF_SIZE
void XMLCALL XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl)
XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser parser)
void XMLCALL XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end)
#define notationDeclHandler
#define unknownEncodingRelease
XML_Expat_Version XMLCALL XML_ExpatVersionInfo(void)
#define declNotationPublicId
#define unknownEncodingHandler
#define endDoctypeDeclHandler
#define XmlInitUnknownEncodingNS
XML_Parser XMLCALL XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context, const XML_Char *encodingName)
void *XMLCALL XML_MemMalloc(XML_Parser parser, size_t size)
#define unknownEncodingMem
#define INIT_ATTS_VERSION
#define openInternalEntities
XML_Size XMLCALL XML_GetCurrentLineNumber(XML_Parser parser)
int XMLCALL XML_GetIdAttributeIndex(XML_Parser parser)
enum XML_Error XMLCALL XML_GetErrorCode(XML_Parser parser)
#define MUST_CONVERT(enc, s)
enum XML_Status XMLCALL XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
XML_Index XMLCALL XML_GetCurrentByteIndex(XML_Parser parser)
#define startCdataSectionHandler
#define externalEntityRefHandler
#define endElementHandler
const XML_LChar *XMLCALL XML_ErrorString(enum XML_Error code)
void XMLCALL XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end)
#define unknownEncodingHandlerData
void XMLCALL XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
#define declAttributeIsCdata
#define namespaceSeparator
enum XML_Status XMLCALL XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
void *XMLCALL XML_GetBuffer(XML_Parser parser, int len)
void XMLCALL XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end)
#define protocolEncodingName
#define XmlGetInternalEncodingNS
void XMLCALL XML_DefaultCurrent(XML_Parser parser)
#define INIT_TAG_BUF_SIZE
void XMLCALL XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler)
const XML_Char *XMLCALL XML_GetBase(XML_Parser parser)
void XMLCALL XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler)
#define startNamespaceDeclHandler
#define startDoctypeDeclHandler
void XMLCALL XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end)
enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, const char *end, const char **endPtr)
#define startElementHandler
#define unknownEncodingData
struct open_internal_entity OPEN_INTERNAL_ENTITY
void XMLCALL XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler end)
#define entityDeclHandler
#define XmlGetInternalEncoding
void XMLCALL XML_MemFree(XML_Parser parser, void *ptr)
#define notStandaloneHandler
const XML_LChar *XMLCALL XML_ExpatVersion(void)
#define declAttributeType
#define XmlInitEncodingNS
XML_Bool XMLCALL XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
#define attlistDeclHandler
#define freeInternalEntities
#define parseEndByteIndex
void XMLCALL XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start)
#define endNamespaceDeclHandler
void XMLCALL XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler)
#define poolDiscard(pool)
#define unparsedEntityDeclHandler
int XMLCALL XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt)
void XMLCALL XML_SetUserData(XML_Parser parser, void *p)
void XMLCALL XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start)
struct attribute_id ATTRIBUTE_ID
enum XML_Error XMLCALL XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
void XMLCALL XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler)
void XMLCALL XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end)
#define poolAppendChar(pool, c)
void XMLCALL XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end)
void XMLCALL XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler)
void XMLCALL XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start)
void XMLCALL XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start)
#define characterDataHandler
#define poolLastChar(pool)
void XMLCALL XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler)
#define XmlParseXmlDeclNS
int XMLCALL XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing peParsing)
enum XML_Status XMLCALL XML_ResumeParser(XML_Parser parser)
void XMLCALL XML_UseParserAsHandlerArg(XML_Parser parser)
enum XML_Status XMLCALL XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
void XMLCALL XML_SetReturnNSTriplet(XML_Parser parser, int do_nst)
void XMLCALL XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler)
void XMLCALL XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
int XMLCALL XML_GetCurrentByteCount(XML_Parser parser)
void XMLCALL XML_ParserFree(XML_Parser parser)
void XMLCALL XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler)
void XmlPrologStateInit(PROLOG_STATE *state)
#define XmlTokenRole(state, tok, ptr, end, enc)
@ XML_ROLE_NOTATION_PUBLIC_ID
@ XML_ROLE_GROUP_CLOSE_REP
@ XML_ROLE_CONTENT_PCDATA
@ XML_ROLE_CONTENT_ELEMENT_REP
@ XML_ROLE_ENTITY_COMPLETE
@ XML_ROLE_DOCTYPE_INTERNAL_SUBSET
@ XML_ROLE_ATTRIBUTE_TYPE_ENTITY
@ XML_ROLE_NOTATION_NO_SYSTEM_ID
@ XML_ROLE_PARAM_ENTITY_REF
@ XML_ROLE_ATTRIBUTE_TYPE_ENTITIES
@ XML_ROLE_ENTITY_NOTATION_NAME
@ XML_ROLE_GROUP_SEQUENCE
@ XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS
@ XML_ROLE_ATTLIST_ELEMENT_NAME
@ XML_ROLE_GROUP_CLOSE_OPT
@ XML_ROLE_IMPLIED_ATTRIBUTE_VALUE
@ XML_ROLE_ATTRIBUTE_TYPE_CDATA
@ XML_ROLE_ATTRIBUTE_ENUM_VALUE
@ XML_ROLE_ENTITY_SYSTEM_ID
@ XML_ROLE_CONTENT_ELEMENT
@ XML_ROLE_ATTRIBUTE_NOTATION_VALUE
@ XML_ROLE_DOCTYPE_SYSTEM_ID
@ XML_ROLE_NOTATION_SYSTEM_ID
@ XML_ROLE_ATTRIBUTE_NAME
@ XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN
@ XML_ROLE_ATTRIBUTE_TYPE_ID
@ XML_ROLE_ENTITY_PUBLIC_ID
@ XML_ROLE_INSTANCE_START
@ XML_ROLE_CONTENT_ELEMENT_PLUS
@ XML_ROLE_GENERAL_ENTITY_NAME
@ XML_ROLE_PARAM_ENTITY_NAME
@ XML_ROLE_DEFAULT_ATTRIBUTE_VALUE
@ XML_ROLE_GROUP_CLOSE_PLUS
@ XML_ROLE_REQUIRED_ATTRIBUTE_VALUE
@ XML_ROLE_FIXED_ATTRIBUTE_VALUE
@ XML_ROLE_CONTENT_ELEMENT_OPT
@ XML_ROLE_ATTRIBUTE_TYPE_IDREFS
@ XML_ROLE_DOCTYPE_PUBLIC_ID
@ XML_ROLE_ATTRIBUTE_TYPE_IDREF
ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData)
int XmlSizeOfUnknownEncoding(void)
#define XmlGetAttributes(enc, ptr, attsMax, atts)
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 XmlCdataSectionTok(enc, ptr, end, nextTokPtr)
#define XmlNameLength(enc, ptr)
#define XML_TOK_PARTIAL_CHAR
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr)
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS
#define XML_TOK_ENTITY_REF
#define XmlContentTok(enc, ptr, end, nextTokPtr)
#define XML_TOK_DATA_NEWLINE
#define XmlPrologTok(enc, ptr, end, nextTokPtr)
#define XmlIsPublicId(enc, ptr, end, badPtr)
#define XML_TOK_START_TAG_WITH_ATTS
#define XML_TOK_CDATA_SECT_CLOSE
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name)
#define XML_TOK_DATA_CHARS
#define XML_TOK_PARAM_ENTITY_REF
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS
#define XML_TOK_TRAILING_RSQB
#define XmlCharRefNumber(enc, ptr)
#define XmlPredefinedEntityName(enc, ptr, end)
#define XML_TOK_ATTRIBUTE_VALUE_S
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr)
#define XML_TOK_START_TAG_NO_ATTS
#define XmlSkipS(enc, ptr)
#define XML_TOK_TRAILING_CR
#define XML_TOK_CDATA_SECT_OPEN
#define XmlUpdatePosition(enc, ptr, end, pos)