Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
xmlparse.cc File Reference
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include "ascii.h"
#include "expat.h"
#include "internal.h"
#include "xmltok.h"
#include "xmlrole.h"

Go to the source code of this file.

Classes

struct  NAMED
 
struct  HASH_TABLE
 
struct  HASH_TABLE_ITER
 
struct  binding
 
struct  prefix
 
struct  TAG_NAME
 
struct  tag
 
struct  ENTITY
 
struct  CONTENT_SCAFFOLD
 
struct  block
 
struct  STRING_POOL
 
struct  attribute_id
 
struct  DEFAULT_ATTRIBUTE
 
struct  NS_ATT
 
struct  ELEMENT_TYPE
 
struct  DTD
 
struct  open_internal_entity
 
struct  XML_ParserStruct
 

Macros

#define XML_BUILDING_EXPAT   1
 
#define XML_ENCODE_MAX   XML_UTF8_ENCODE_MAX
 
#define XmlConvert   XmlUtf8Convert
 
#define XmlGetInternalEncoding   XmlGetUtf8InternalEncoding
 
#define XmlGetInternalEncodingNS   XmlGetUtf8InternalEncodingNS
 
#define XmlEncode   XmlUtf8Encode
 
#define MUST_CONVERT(enc, s)   (!(enc)->isUtf8)
 
#define XmlInitEncodingNS   XmlInitEncoding
 
#define XmlInitUnknownEncodingNS   XmlInitUnknownEncoding
 
#define XmlGetInternalEncodingNS   XmlGetInternalEncoding
 
#define XmlParseXmlDeclNS   XmlParseXmlDecl
 
#define XML_T(x)   x
 
#define XML_L(x)   x
 
#define ROUND_UP(n, sz)   (((n) + ((sz) - 1)) & ~((sz) - 1))
 
#define CHAR_HASH(h, c)    (((h) * 0xF4243) ^ (unsigned char)(c))
 
#define SECOND_HASH(hash, mask, power)    ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))
 
#define PROBE_STEP(hash, mask, power)    ((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))
 
#define INIT_TAG_BUF_SIZE   32 /* must be a multiple of sizeof(XML_Char) */
 
#define INIT_DATA_BUF_SIZE   1024
 
#define INIT_ATTS_SIZE   16
 
#define INIT_ATTS_VERSION   0xFFFFFFFF
 
#define INIT_BLOCK_SIZE   1024
 
#define INIT_BUFFER_SIZE   1024
 
#define EXPAND_SPARE   24
 
#define INIT_SCAFFOLD_ELEMENTS   32
 
#define poolStart(pool)   ((pool)->start)
 
#define poolEnd(pool)   ((pool)->ptr)
 
#define poolLength(pool)   ((pool)->ptr - (pool)->start)
 
#define poolChop(pool)   ((void)--(pool->ptr))
 
#define poolLastChar(pool)   (((pool)->ptr)[-1])
 
#define poolDiscard(pool)   ((pool)->ptr = (pool)->start)
 
#define poolFinish(pool)   ((pool)->start = (pool)->ptr)
 
#define poolAppendChar(pool, c)
 
#define MALLOC(s)   (parser->m_mem.malloc_fcn((s)))
 
#define REALLOC(p, s)   (parser->m_mem.realloc_fcn((p),(s)))
 
#define FREE(p)   (parser->m_mem.free_fcn((p)))
 
#define userData   (parser->m_userData)
 
#define handlerArg   (parser->m_handlerArg)
 
#define startElementHandler   (parser->m_startElementHandler)
 
#define endElementHandler   (parser->m_endElementHandler)
 
#define characterDataHandler   (parser->m_characterDataHandler)
 
#define processingInstructionHandler    (parser->m_processingInstructionHandler)
 
#define commentHandler   (parser->m_commentHandler)
 
#define startCdataSectionHandler    (parser->m_startCdataSectionHandler)
 
#define endCdataSectionHandler   (parser->m_endCdataSectionHandler)
 
#define defaultHandler   (parser->m_defaultHandler)
 
#define startDoctypeDeclHandler   (parser->m_startDoctypeDeclHandler)
 
#define endDoctypeDeclHandler   (parser->m_endDoctypeDeclHandler)
 
#define unparsedEntityDeclHandler    (parser->m_unparsedEntityDeclHandler)
 
#define notationDeclHandler   (parser->m_notationDeclHandler)
 
#define startNamespaceDeclHandler    (parser->m_startNamespaceDeclHandler)
 
#define endNamespaceDeclHandler   (parser->m_endNamespaceDeclHandler)
 
#define notStandaloneHandler   (parser->m_notStandaloneHandler)
 
#define externalEntityRefHandler    (parser->m_externalEntityRefHandler)
 
#define externalEntityRefHandlerArg    (parser->m_externalEntityRefHandlerArg)
 
#define internalEntityRefHandler    (parser->m_internalEntityRefHandler)
 
#define skippedEntityHandler   (parser->m_skippedEntityHandler)
 
#define unknownEncodingHandler   (parser->m_unknownEncodingHandler)
 
#define elementDeclHandler   (parser->m_elementDeclHandler)
 
#define attlistDeclHandler   (parser->m_attlistDeclHandler)
 
#define entityDeclHandler   (parser->m_entityDeclHandler)
 
#define xmlDeclHandler   (parser->m_xmlDeclHandler)
 
#define encoding   (parser->m_encoding)
 
#define initEncoding   (parser->m_initEncoding)
 
#define internalEncoding   (parser->m_internalEncoding)
 
#define unknownEncodingMem   (parser->m_unknownEncodingMem)
 
#define unknownEncodingData   (parser->m_unknownEncodingData)
 
#define unknownEncodingHandlerData    (parser->m_unknownEncodingHandlerData)
 
#define unknownEncodingRelease   (parser->m_unknownEncodingRelease)
 
#define protocolEncodingName   (parser->m_protocolEncodingName)
 
#define ns   (parser->m_ns)
 
#define ns_triplets   (parser->m_ns_triplets)
 
#define prologState   (parser->m_prologState)
 
#define processor   (parser->m_processor)
 
#define errorCode   (parser->m_errorCode)
 
#define eventPtr   (parser->m_eventPtr)
 
#define eventEndPtr   (parser->m_eventEndPtr)
 
#define positionPtr   (parser->m_positionPtr)
 
#define position   (parser->m_position)
 
#define openInternalEntities   (parser->m_openInternalEntities)
 
#define freeInternalEntities   (parser->m_freeInternalEntities)
 
#define defaultExpandInternalEntities    (parser->m_defaultExpandInternalEntities)
 
#define tagLevel   (parser->m_tagLevel)
 
#define buffer   (parser->m_buffer)
 
#define bufferPtr   (parser->m_bufferPtr)
 
#define bufferEnd   (parser->m_bufferEnd)
 
#define parseEndByteIndex   (parser->m_parseEndByteIndex)
 
#define parseEndPtr   (parser->m_parseEndPtr)
 
#define bufferLim   (parser->m_bufferLim)
 
#define dataBuf   (parser->m_dataBuf)
 
#define dataBufEnd   (parser->m_dataBufEnd)
 
#define _dtd   (parser->m_dtd)
 
#define curBase   (parser->m_curBase)
 
#define declEntity   (parser->m_declEntity)
 
#define doctypeName   (parser->m_doctypeName)
 
#define doctypeSysid   (parser->m_doctypeSysid)
 
#define doctypePubid   (parser->m_doctypePubid)
 
#define declAttributeType   (parser->m_declAttributeType)
 
#define declNotationName   (parser->m_declNotationName)
 
#define declNotationPublicId   (parser->m_declNotationPublicId)
 
#define declElementType   (parser->m_declElementType)
 
#define declAttributeId   (parser->m_declAttributeId)
 
#define declAttributeIsCdata   (parser->m_declAttributeIsCdata)
 
#define declAttributeIsId   (parser->m_declAttributeIsId)
 
#define freeTagList   (parser->m_freeTagList)
 
#define freeBindingList   (parser->m_freeBindingList)
 
#define inheritedBindings   (parser->m_inheritedBindings)
 
#define tagStack   (parser->m_tagStack)
 
#define atts   (parser->m_atts)
 
#define attsSize   (parser->m_attsSize)
 
#define nSpecifiedAtts   (parser->m_nSpecifiedAtts)
 
#define idAttIndex   (parser->m_idAttIndex)
 
#define nsAtts   (parser->m_nsAtts)
 
#define nsAttsVersion   (parser->m_nsAttsVersion)
 
#define nsAttsPower   (parser->m_nsAttsPower)
 
#define tempPool   (parser->m_tempPool)
 
#define temp2Pool   (parser->m_temp2Pool)
 
#define groupConnector   (parser->m_groupConnector)
 
#define groupSize   (parser->m_groupSize)
 
#define namespaceSeparator   (parser->m_namespaceSeparator)
 
#define parentParser   (parser->m_parentParser)
 
#define ps_parsing   (parser->m_parsingStatus.parsing)
 
#define ps_finalBuffer   (parser->m_parsingStatus.finalBuffer)
 
#define V1(a, b, c)   XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c)
 
#define V2(a, b, c)   XML_L("expat_")V1(a,b,c)
 
#define CONTEXT_SEP   XML_T(ASCII_FF)
 
#define INIT_POWER   6
 

Typedefs

typedef char ICHAR
 
typedef const XML_CharKEY
 
typedef struct binding BINDING
 
typedef struct prefix PREFIX
 
typedef struct tag TAG
 
typedef struct block BLOCK
 
typedef struct attribute_id ATTRIBUTE_ID
 
typedef struct open_internal_entity OPEN_INTERNAL_ENTITY
 

Functions

enum XML_Error PTRCALL Processor (XML_Parser parser, const char *start, const char *end, const char **endPtr)
 
XML_Parser XMLCALL XML_ParserCreate (const XML_Char *encodingName)
 
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)
 
XML_Bool XMLCALL XML_ParserReset (XML_Parser parser, const XML_Char *encodingName)
 
enum XML_Status XMLCALL XML_SetEncoding (XML_Parser parser, const XML_Char *encodingName)
 
XML_Parser XMLCALL XML_ExternalEntityParserCreate (XML_Parser oldParser, const XML_Char *context, const XML_Char *encodingName)
 
void XMLCALL XML_ParserFree (XML_Parser parser)
 
void XMLCALL XML_UseParserAsHandlerArg (XML_Parser parser)
 
enum XML_Error XMLCALL XML_UseForeignDTD (XML_Parser parser, XML_Bool useDTD)
 
void XMLCALL XML_SetReturnNSTriplet (XML_Parser parser, int do_nst)
 
void XMLCALL XML_SetUserData (XML_Parser parser, void *p)
 
enum XML_Status XMLCALL XML_SetBase (XML_Parser parser, const XML_Char *p)
 
const XML_Char *XMLCALL XML_GetBase (XML_Parser parser)
 
int XMLCALL XML_GetSpecifiedAttributeCount (XML_Parser parser)
 
int XMLCALL XML_GetIdAttributeIndex (XML_Parser parser)
 
void XMLCALL XML_SetElementHandler (XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end)
 
void XMLCALL XML_SetStartElementHandler (XML_Parser parser, XML_StartElementHandler start)
 
void XMLCALL XML_SetEndElementHandler (XML_Parser parser, XML_EndElementHandler end)
 
void XMLCALL XML_SetCharacterDataHandler (XML_Parser parser, XML_CharacterDataHandler handler)
 
void XMLCALL XML_SetProcessingInstructionHandler (XML_Parser parser, XML_ProcessingInstructionHandler handler)
 
void XMLCALL XML_SetCommentHandler (XML_Parser parser, XML_CommentHandler handler)
 
void XMLCALL XML_SetCdataSectionHandler (XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end)
 
void XMLCALL XML_SetStartCdataSectionHandler (XML_Parser parser, XML_StartCdataSectionHandler start)
 
void XMLCALL XML_SetEndCdataSectionHandler (XML_Parser parser, XML_EndCdataSectionHandler end)
 
void XMLCALL XML_SetDefaultHandler (XML_Parser parser, XML_DefaultHandler handler)
 
void XMLCALL XML_SetDefaultHandlerExpand (XML_Parser parser, XML_DefaultHandler handler)
 
void XMLCALL XML_SetDoctypeDeclHandler (XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end)
 
void XMLCALL XML_SetStartDoctypeDeclHandler (XML_Parser parser, XML_StartDoctypeDeclHandler start)
 
void XMLCALL XML_SetEndDoctypeDeclHandler (XML_Parser parser, XML_EndDoctypeDeclHandler end)
 
void XMLCALL XML_SetUnparsedEntityDeclHandler (XML_Parser parser, XML_UnparsedEntityDeclHandler handler)
 
void XMLCALL XML_SetNotationDeclHandler (XML_Parser parser, XML_NotationDeclHandler handler)
 
void XMLCALL XML_SetNamespaceDeclHandler (XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end)
 
void XMLCALL XML_SetStartNamespaceDeclHandler (XML_Parser parser, XML_StartNamespaceDeclHandler start)
 
void XMLCALL XML_SetEndNamespaceDeclHandler (XML_Parser parser, XML_EndNamespaceDeclHandler end)
 
void XMLCALL XML_SetNotStandaloneHandler (XML_Parser parser, XML_NotStandaloneHandler handler)
 
void XMLCALL XML_SetExternalEntityRefHandler (XML_Parser parser, XML_ExternalEntityRefHandler handler)
 
void XMLCALL XML_SetExternalEntityRefHandlerArg (XML_Parser parser, void *arg)
 
void XMLCALL XML_SetSkippedEntityHandler (XML_Parser parser, XML_SkippedEntityHandler handler)
 
void XMLCALL XML_SetUnknownEncodingHandler (XML_Parser parser, XML_UnknownEncodingHandler handler, void *data)
 
void XMLCALL XML_SetElementDeclHandler (XML_Parser parser, XML_ElementDeclHandler eldecl)
 
void XMLCALL XML_SetAttlistDeclHandler (XML_Parser parser, XML_AttlistDeclHandler attdecl)
 
void XMLCALL XML_SetEntityDeclHandler (XML_Parser parser, XML_EntityDeclHandler handler)
 
void XMLCALL XML_SetXmlDeclHandler (XML_Parser parser, XML_XmlDeclHandler handler)
 
int XMLCALL XML_SetParamEntityParsing (XML_Parser parser, enum XML_ParamEntityParsing peParsing)
 
enum XML_Status XMLCALL XML_Parse (XML_Parser parser, const char *s, int len, int isFinal)
 
enum XML_Status XMLCALL XML_ParseBuffer (XML_Parser parser, int len, int isFinal)
 
void *XMLCALL XML_GetBuffer (XML_Parser parser, int len)
 
enum XML_Status XMLCALL XML_StopParser (XML_Parser parser, XML_Bool resumable)
 
enum XML_Status XMLCALL XML_ResumeParser (XML_Parser parser)
 
void XMLCALL XML_GetParsingStatus (XML_Parser parser, XML_ParsingStatus *status)
 
enum XML_Error XMLCALL XML_GetErrorCode (XML_Parser parser)
 
XML_Index XMLCALL XML_GetCurrentByteIndex (XML_Parser parser)
 
int XMLCALL XML_GetCurrentByteCount (XML_Parser parser)
 
const char *XMLCALL XML_GetInputContext (XML_Parser parser, int *offset, int *size)
 
XML_Size XMLCALL XML_GetCurrentLineNumber (XML_Parser parser)
 
XML_Size XMLCALL XML_GetCurrentColumnNumber (XML_Parser parser)
 
void XMLCALL XML_FreeContentModel (XML_Parser parser, XML_Content *model)
 
void *XMLCALL XML_MemMalloc (XML_Parser parser, size_t size)
 
void *XMLCALL XML_MemRealloc (XML_Parser parser, void *ptr, size_t size)
 
void XMLCALL XML_MemFree (XML_Parser parser, void *ptr)
 
void XMLCALL XML_DefaultCurrent (XML_Parser parser)
 
const XML_LChar *XMLCALL XML_ErrorString (enum XML_Error code)
 
const XML_LChar *XMLCALL XML_ExpatVersion (void)
 
XML_Expat_Version XMLCALL XML_ExpatVersionInfo (void)
 
const XML_Feature *XMLCALL XML_GetFeatureList (void)
 

Macro Definition Documentation

◆ _dtd

#define _dtd   (parser->m_dtd)

Definition at line 619 of file xmlparse.cc.

◆ attlistDeclHandler

#define attlistDeclHandler   (parser->m_attlistDeclHandler)

Definition at line 585 of file xmlparse.cc.

◆ atts

#define atts   (parser->m_atts)

Definition at line 636 of file xmlparse.cc.

◆ attsSize

#define attsSize   (parser->m_attsSize)

Definition at line 637 of file xmlparse.cc.

◆ buffer

#define buffer   (parser->m_buffer)

Definition at line 611 of file xmlparse.cc.

◆ bufferEnd

#define bufferEnd   (parser->m_bufferEnd)

Definition at line 613 of file xmlparse.cc.

◆ bufferLim

#define bufferLim   (parser->m_bufferLim)

Definition at line 616 of file xmlparse.cc.

◆ bufferPtr

#define bufferPtr   (parser->m_bufferPtr)

Definition at line 612 of file xmlparse.cc.

◆ CHAR_HASH

#define CHAR_HASH (   h,
 
)     (((h) * 0xF4243) ^ (unsigned char)(c))

Definition at line 111 of file xmlparse.cc.

◆ characterDataHandler

#define characterDataHandler   (parser->m_characterDataHandler)

Definition at line 559 of file xmlparse.cc.

◆ commentHandler

#define commentHandler   (parser->m_commentHandler)

Definition at line 562 of file xmlparse.cc.

◆ CONTEXT_SEP

#define CONTEXT_SEP   XML_T(ASCII_FF)

Definition at line 5378 of file xmlparse.cc.

◆ curBase

#define curBase   (parser->m_curBase)

Definition at line 620 of file xmlparse.cc.

◆ dataBuf

#define dataBuf   (parser->m_dataBuf)

Definition at line 617 of file xmlparse.cc.

◆ dataBufEnd

#define dataBufEnd   (parser->m_dataBufEnd)

Definition at line 618 of file xmlparse.cc.

◆ declAttributeId

#define declAttributeId   (parser->m_declAttributeId)

Definition at line 629 of file xmlparse.cc.

◆ declAttributeIsCdata

#define declAttributeIsCdata   (parser->m_declAttributeIsCdata)

Definition at line 630 of file xmlparse.cc.

◆ declAttributeIsId

#define declAttributeIsId   (parser->m_declAttributeIsId)

Definition at line 631 of file xmlparse.cc.

◆ declAttributeType

#define declAttributeType   (parser->m_declAttributeType)

Definition at line 625 of file xmlparse.cc.

◆ declElementType

#define declElementType   (parser->m_declElementType)

Definition at line 628 of file xmlparse.cc.

◆ declEntity

#define declEntity   (parser->m_declEntity)

Definition at line 621 of file xmlparse.cc.

◆ declNotationName

#define declNotationName   (parser->m_declNotationName)

Definition at line 626 of file xmlparse.cc.

◆ declNotationPublicId

#define declNotationPublicId   (parser->m_declNotationPublicId)

Definition at line 627 of file xmlparse.cc.

◆ defaultExpandInternalEntities

#define defaultExpandInternalEntities    (parser->m_defaultExpandInternalEntities)

Definition at line 608 of file xmlparse.cc.

◆ defaultHandler

#define defaultHandler   (parser->m_defaultHandler)

Definition at line 566 of file xmlparse.cc.

◆ doctypeName

#define doctypeName   (parser->m_doctypeName)

Definition at line 622 of file xmlparse.cc.

◆ doctypePubid

#define doctypePubid   (parser->m_doctypePubid)

Definition at line 624 of file xmlparse.cc.

◆ doctypeSysid

#define doctypeSysid   (parser->m_doctypeSysid)

Definition at line 623 of file xmlparse.cc.

◆ elementDeclHandler

#define elementDeclHandler   (parser->m_elementDeclHandler)

Definition at line 584 of file xmlparse.cc.

◆ encoding

#define encoding   (parser->m_encoding)

Definition at line 588 of file xmlparse.cc.

◆ endCdataSectionHandler

#define endCdataSectionHandler   (parser->m_endCdataSectionHandler)

Definition at line 565 of file xmlparse.cc.

◆ endDoctypeDeclHandler

#define endDoctypeDeclHandler   (parser->m_endDoctypeDeclHandler)

Definition at line 568 of file xmlparse.cc.

◆ endElementHandler

#define endElementHandler   (parser->m_endElementHandler)

Definition at line 558 of file xmlparse.cc.

◆ endNamespaceDeclHandler

#define endNamespaceDeclHandler   (parser->m_endNamespaceDeclHandler)

Definition at line 574 of file xmlparse.cc.

◆ entityDeclHandler

#define entityDeclHandler   (parser->m_entityDeclHandler)

Definition at line 586 of file xmlparse.cc.

◆ errorCode

#define errorCode   (parser->m_errorCode)

Definition at line 601 of file xmlparse.cc.

◆ eventEndPtr

#define eventEndPtr   (parser->m_eventEndPtr)

Definition at line 603 of file xmlparse.cc.

◆ eventPtr

#define eventPtr   (parser->m_eventPtr)

Definition at line 602 of file xmlparse.cc.

◆ EXPAND_SPARE

#define EXPAND_SPARE   24

Definition at line 140 of file xmlparse.cc.

◆ externalEntityRefHandler

#define externalEntityRefHandler    (parser->m_externalEntityRefHandler)

Definition at line 576 of file xmlparse.cc.

◆ externalEntityRefHandlerArg

#define externalEntityRefHandlerArg    (parser->m_externalEntityRefHandlerArg)

Definition at line 578 of file xmlparse.cc.

◆ FREE

#define FREE (   p)    (parser->m_mem.free_fcn((p)))

Definition at line 553 of file xmlparse.cc.

◆ freeBindingList

#define freeBindingList   (parser->m_freeBindingList)

Definition at line 633 of file xmlparse.cc.

◆ freeInternalEntities

#define freeInternalEntities   (parser->m_freeInternalEntities)

Definition at line 607 of file xmlparse.cc.

◆ freeTagList

#define freeTagList   (parser->m_freeTagList)

Definition at line 632 of file xmlparse.cc.

◆ groupConnector

#define groupConnector   (parser->m_groupConnector)

Definition at line 645 of file xmlparse.cc.

◆ groupSize

#define groupSize   (parser->m_groupSize)

Definition at line 646 of file xmlparse.cc.

◆ handlerArg

#define handlerArg   (parser->m_handlerArg)

Definition at line 556 of file xmlparse.cc.

◆ idAttIndex

#define idAttIndex   (parser->m_idAttIndex)

Definition at line 639 of file xmlparse.cc.

◆ inheritedBindings

#define inheritedBindings   (parser->m_inheritedBindings)

Definition at line 634 of file xmlparse.cc.

◆ INIT_ATTS_SIZE

#define INIT_ATTS_SIZE   16

Definition at line 135 of file xmlparse.cc.

◆ INIT_ATTS_VERSION

#define INIT_ATTS_VERSION   0xFFFFFFFF

Definition at line 136 of file xmlparse.cc.

◆ INIT_BLOCK_SIZE

#define INIT_BLOCK_SIZE   1024

Definition at line 137 of file xmlparse.cc.

◆ INIT_BUFFER_SIZE

#define INIT_BUFFER_SIZE   1024

Definition at line 138 of file xmlparse.cc.

◆ INIT_DATA_BUF_SIZE

#define INIT_DATA_BUF_SIZE   1024

Definition at line 134 of file xmlparse.cc.

◆ INIT_POWER

#define INIT_POWER   6

Definition at line 5834 of file xmlparse.cc.

◆ INIT_SCAFFOLD_ELEMENTS

#define INIT_SCAFFOLD_ELEMENTS   32

Definition at line 213 of file xmlparse.cc.

◆ INIT_TAG_BUF_SIZE

#define INIT_TAG_BUF_SIZE   32 /* must be a multiple of sizeof(XML_Char) */

Definition at line 133 of file xmlparse.cc.

◆ initEncoding

#define initEncoding   (parser->m_initEncoding)

Definition at line 589 of file xmlparse.cc.

◆ internalEncoding

#define internalEncoding   (parser->m_internalEncoding)

Definition at line 590 of file xmlparse.cc.

◆ internalEntityRefHandler

#define internalEntityRefHandler    (parser->m_internalEntityRefHandler)

Definition at line 580 of file xmlparse.cc.

◆ MALLOC

#define MALLOC (   s)    (parser->m_mem.malloc_fcn((s)))

Definition at line 551 of file xmlparse.cc.

◆ MUST_CONVERT

#define MUST_CONVERT (   enc,
 
)    (!(enc)->isUtf8)

Definition at line 41 of file xmlparse.cc.

◆ namespaceSeparator

#define namespaceSeparator   (parser->m_namespaceSeparator)

Definition at line 647 of file xmlparse.cc.

◆ notationDeclHandler

#define notationDeclHandler   (parser->m_notationDeclHandler)

Definition at line 571 of file xmlparse.cc.

◆ notStandaloneHandler

#define notStandaloneHandler   (parser->m_notStandaloneHandler)

Definition at line 575 of file xmlparse.cc.

◆ ns

#define ns   (parser->m_ns)

Definition at line 597 of file xmlparse.cc.

◆ ns_triplets

#define ns_triplets   (parser->m_ns_triplets)

Definition at line 598 of file xmlparse.cc.

◆ nsAtts

#define nsAtts   (parser->m_nsAtts)

Definition at line 640 of file xmlparse.cc.

◆ nsAttsPower

#define nsAttsPower   (parser->m_nsAttsPower)

Definition at line 642 of file xmlparse.cc.

◆ nsAttsVersion

#define nsAttsVersion   (parser->m_nsAttsVersion)

Definition at line 641 of file xmlparse.cc.

◆ nSpecifiedAtts

#define nSpecifiedAtts   (parser->m_nSpecifiedAtts)

Definition at line 638 of file xmlparse.cc.

◆ openInternalEntities

#define openInternalEntities   (parser->m_openInternalEntities)

Definition at line 606 of file xmlparse.cc.

◆ parentParser

#define parentParser   (parser->m_parentParser)

Definition at line 648 of file xmlparse.cc.

◆ parseEndByteIndex

#define parseEndByteIndex   (parser->m_parseEndByteIndex)

Definition at line 614 of file xmlparse.cc.

◆ parseEndPtr

#define parseEndPtr   (parser->m_parseEndPtr)

Definition at line 615 of file xmlparse.cc.

◆ poolAppendChar

#define poolAppendChar (   pool,
 
)
Value:
(((pool)->ptr == (pool)->end && !poolGrow(pool)) \
? 0 \
: ((*((pool)->ptr)++ = c), 1))

Definition at line 447 of file xmlparse.cc.

◆ poolChop

#define poolChop (   pool)    ((void)--(pool->ptr))

Definition at line 443 of file xmlparse.cc.

◆ poolDiscard

#define poolDiscard (   pool)    ((pool)->ptr = (pool)->start)

Definition at line 445 of file xmlparse.cc.

◆ poolEnd

#define poolEnd (   pool)    ((pool)->ptr)

Definition at line 441 of file xmlparse.cc.

◆ poolFinish

#define poolFinish (   pool)    ((pool)->start = (pool)->ptr)

Definition at line 446 of file xmlparse.cc.

◆ poolLastChar

#define poolLastChar (   pool)    (((pool)->ptr)[-1])

Definition at line 444 of file xmlparse.cc.

◆ poolLength

#define poolLength (   pool)    ((pool)->ptr - (pool)->start)

Definition at line 442 of file xmlparse.cc.

◆ poolStart

#define poolStart (   pool)    ((pool)->start)

Definition at line 440 of file xmlparse.cc.

◆ position

#define position   (parser->m_position)

Definition at line 605 of file xmlparse.cc.

◆ positionPtr

#define positionPtr   (parser->m_positionPtr)

Definition at line 604 of file xmlparse.cc.

◆ PROBE_STEP

#define PROBE_STEP (   hash,
  mask,
  power 
)     ((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))

Definition at line 125 of file xmlparse.cc.

◆ processingInstructionHandler

#define processingInstructionHandler    (parser->m_processingInstructionHandler)

Definition at line 560 of file xmlparse.cc.

◆ processor

#define processor   (parser->m_processor)

Definition at line 600 of file xmlparse.cc.

◆ prologState

#define prologState   (parser->m_prologState)

Definition at line 599 of file xmlparse.cc.

◆ protocolEncodingName

#define protocolEncodingName   (parser->m_protocolEncodingName)

Definition at line 596 of file xmlparse.cc.

◆ ps_finalBuffer

#define ps_finalBuffer   (parser->m_parsingStatus.finalBuffer)

Definition at line 650 of file xmlparse.cc.

◆ ps_parsing

#define ps_parsing   (parser->m_parsingStatus.parsing)

Definition at line 649 of file xmlparse.cc.

◆ REALLOC

#define REALLOC (   p,
 
)    (parser->m_mem.realloc_fcn((p),(s)))

Definition at line 552 of file xmlparse.cc.

◆ ROUND_UP

#define ROUND_UP (   n,
  sz 
)    (((n) + ((sz) - 1)) & ~((sz) - 1))

Definition at line 74 of file xmlparse.cc.

◆ SECOND_HASH

#define SECOND_HASH (   hash,
  mask,
  power 
)     ((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))

Definition at line 123 of file xmlparse.cc.

◆ skippedEntityHandler

#define skippedEntityHandler   (parser->m_skippedEntityHandler)

Definition at line 582 of file xmlparse.cc.

◆ startCdataSectionHandler

#define startCdataSectionHandler    (parser->m_startCdataSectionHandler)

Definition at line 563 of file xmlparse.cc.

◆ startDoctypeDeclHandler

#define startDoctypeDeclHandler   (parser->m_startDoctypeDeclHandler)

Definition at line 567 of file xmlparse.cc.

◆ startElementHandler

#define startElementHandler   (parser->m_startElementHandler)

Definition at line 557 of file xmlparse.cc.

◆ startNamespaceDeclHandler

#define startNamespaceDeclHandler    (parser->m_startNamespaceDeclHandler)

Definition at line 572 of file xmlparse.cc.

◆ tagLevel

#define tagLevel   (parser->m_tagLevel)

Definition at line 610 of file xmlparse.cc.

◆ tagStack

#define tagStack   (parser->m_tagStack)

Definition at line 635 of file xmlparse.cc.

◆ temp2Pool

#define temp2Pool   (parser->m_temp2Pool)

Definition at line 644 of file xmlparse.cc.

◆ tempPool

#define tempPool   (parser->m_tempPool)

Definition at line 643 of file xmlparse.cc.

◆ unknownEncodingData

#define unknownEncodingData   (parser->m_unknownEncodingData)

Definition at line 592 of file xmlparse.cc.

◆ unknownEncodingHandler

#define unknownEncodingHandler   (parser->m_unknownEncodingHandler)

Definition at line 583 of file xmlparse.cc.

◆ unknownEncodingHandlerData

#define unknownEncodingHandlerData    (parser->m_unknownEncodingHandlerData)

Definition at line 593 of file xmlparse.cc.

◆ unknownEncodingMem

#define unknownEncodingMem   (parser->m_unknownEncodingMem)

Definition at line 591 of file xmlparse.cc.

◆ unknownEncodingRelease

#define unknownEncodingRelease   (parser->m_unknownEncodingRelease)

Definition at line 595 of file xmlparse.cc.

◆ unparsedEntityDeclHandler

#define unparsedEntityDeclHandler    (parser->m_unparsedEntityDeclHandler)

Definition at line 569 of file xmlparse.cc.

◆ userData

#define userData   (parser->m_userData)

Definition at line 555 of file xmlparse.cc.

◆ V1

#define V1 (   a,
  b,
 
)    XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c)

◆ V2

#define V2 (   a,
  b,
 
)    XML_L("expat_")V1(a,b,c)

◆ XML_BUILDING_EXPAT

#define XML_BUILDING_EXPAT   1

Definition at line 9 of file xmlparse.cc.

◆ XML_ENCODE_MAX

#define XML_ENCODE_MAX   XML_UTF8_ENCODE_MAX

Definition at line 36 of file xmlparse.cc.

◆ XML_L

#define XML_L (   x)    x

Definition at line 69 of file xmlparse.cc.

◆ XML_T

#define XML_T (   x)    x

Definition at line 68 of file xmlparse.cc.

◆ XmlConvert

#define XmlConvert   XmlUtf8Convert

Definition at line 37 of file xmlparse.cc.

◆ xmlDeclHandler

#define xmlDeclHandler   (parser->m_xmlDeclHandler)

Definition at line 587 of file xmlparse.cc.

◆ XmlEncode

#define XmlEncode   XmlUtf8Encode

Definition at line 40 of file xmlparse.cc.

◆ XmlGetInternalEncoding

#define XmlGetInternalEncoding   XmlGetUtf8InternalEncoding

Definition at line 38 of file xmlparse.cc.

◆ XmlGetInternalEncodingNS [1/2]

#define XmlGetInternalEncodingNS   XmlGetUtf8InternalEncodingNS

Definition at line 51 of file xmlparse.cc.

◆ XmlGetInternalEncodingNS [2/2]

#define XmlGetInternalEncodingNS   XmlGetInternalEncoding

Definition at line 51 of file xmlparse.cc.

◆ XmlInitEncodingNS

#define XmlInitEncodingNS   XmlInitEncoding

Definition at line 48 of file xmlparse.cc.

◆ XmlInitUnknownEncodingNS

#define XmlInitUnknownEncodingNS   XmlInitUnknownEncoding

Definition at line 49 of file xmlparse.cc.

◆ XmlParseXmlDeclNS

#define XmlParseXmlDeclNS   XmlParseXmlDecl

Definition at line 52 of file xmlparse.cc.

Typedef Documentation

◆ ATTRIBUTE_ID

typedef struct attribute_id ATTRIBUTE_ID

◆ BINDING

typedef struct binding BINDING

◆ BLOCK

typedef struct block BLOCK

◆ ICHAR

typedef char ICHAR

Definition at line 42 of file xmlparse.cc.

◆ KEY

typedef const XML_Char* KEY

Definition at line 89 of file xmlparse.cc.

◆ OPEN_INTERNAL_ENTITY

◆ PREFIX

typedef struct prefix PREFIX

◆ TAG

typedef struct tag TAG

Function Documentation

◆ Processor()

enum XML_Error PTRCALL Processor ( XML_Parser  parser,
const char *  start,
const char *  end,
const char **  endPtr 
)

◆ XML_DefaultCurrent()

void XMLCALL XML_DefaultCurrent ( XML_Parser  parser)

Definition at line 1834 of file xmlparse.cc.

1835{
1836 if (defaultHandler) {
1838 reportDefault(parser,
1840 openInternalEntities->internalEventPtr,
1841 openInternalEntities->internalEventEndPtr);
1842 else
1843 reportDefault(parser, encoding, eventPtr, eventEndPtr);
1844 }
1845}
#define eventPtr
Definition: xmlparse.cc:602
#define internalEncoding
Definition: xmlparse.cc:590
#define openInternalEntities
Definition: xmlparse.cc:606
#define defaultHandler
Definition: xmlparse.cc:566
#define eventEndPtr
Definition: xmlparse.cc:603

◆ XML_ErrorString()

const XML_LChar *XMLCALL XML_ErrorString ( enum XML_Error  code)

Definition at line 1848 of file xmlparse.cc.

1849{
1850 static const XML_LChar* const message[] = {
1851 0,
1852 XML_L("out of memory"),
1853 XML_L("syntax error"),
1854 XML_L("no element found"),
1855 XML_L("not well-formed (invalid token)"),
1856 XML_L("unclosed token"),
1857 XML_L("partial character"),
1858 XML_L("mismatched tag"),
1859 XML_L("duplicate attribute"),
1860 XML_L("junk after document element"),
1861 XML_L("illegal parameter entity reference"),
1862 XML_L("undefined entity"),
1863 XML_L("recursive entity reference"),
1864 XML_L("asynchronous entity"),
1865 XML_L("reference to invalid character number"),
1866 XML_L("reference to binary entity"),
1867 XML_L("reference to external entity in attribute"),
1868 XML_L("XML or text declaration not at start of entity"),
1869 XML_L("unknown encoding"),
1870 XML_L("encoding specified in XML declaration is incorrect"),
1871 XML_L("unclosed CDATA section"),
1872 XML_L("error in processing external entity reference"),
1873 XML_L("document is not standalone"),
1874 XML_L("unexpected parser state - please send a bug report"),
1875 XML_L("entity declared in parameter entity"),
1876 XML_L("requested feature requires XML_DTD support in Expat"),
1877 XML_L("cannot change setting once parsing has begun"),
1878 XML_L("unbound prefix"),
1879 XML_L("must not undeclare prefix"),
1880 XML_L("incomplete markup in parameter entity"),
1881 XML_L("XML declaration not well-formed"),
1882 XML_L("text declaration not well-formed"),
1883 XML_L("illegal character(s) in public id"),
1884 XML_L("parser suspended"),
1885 XML_L("parser not suspended"),
1886 XML_L("parsing aborted"),
1887 XML_L("parsing finished"),
1888 XML_L("cannot suspend in external parameter entity"),
1889 XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name"),
1890 XML_L("reserved prefix (xmlns) must not be declared or undeclared"),
1891 XML_L("prefix must not be bound to one of the reserved namespace names")
1892 };
1893 if (code > 0 && unsigned(code) < sizeof(message)/sizeof(message[0]))
1894 return message[code];
1895 return NULL;
1896}
char XML_LChar
#define XML_L(x)
Definition: xmlparse.cc:69

Referenced by xData_parseEndOfXML().

◆ XML_ExpatVersion()

const XML_LChar *XMLCALL XML_ExpatVersion ( void  )

Definition at line 1899 of file xmlparse.cc.

1899 {
1900
1901 /* V1 is used to string-ize the version number. However, it would
1902 string-ize the actual version macro *names* unless we get them
1903 substituted before being passed to V1. CPP is defined to expand
1904 a macro, then rescan for more expansions. Thus, we use V2 to expand
1905 the version macros, then CPP will expand the resulting V1() macro
1906 with the correct numerals. */
1907 /* ### I'm assuming cpp is portable in this respect... */
1908
1909#define V1(a,b,c) XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c)
1910#define V2(a,b,c) XML_L("expat_")V1(a,b,c)
1911
1913
1914#undef V1
1915#undef V2
1916}
#define XML_MAJOR_VERSION
#define XML_MINOR_VERSION
#define XML_MICRO_VERSION
#define V2(a, b, c)

◆ XML_ExpatVersionInfo()

XML_Expat_Version XMLCALL XML_ExpatVersionInfo ( void  )

Definition at line 1919 of file xmlparse.cc.

1920{
1921 XML_Expat_Version version;
1922
1923 version.major = XML_MAJOR_VERSION;
1924 version.minor = XML_MINOR_VERSION;
1925 version.micro = XML_MICRO_VERSION;
1926
1927 return version;
1928}

◆ XML_ExternalEntityParserCreate()

XML_Parser XMLCALL XML_ExternalEntityParserCreate ( XML_Parser  oldParser,
const XML_Char context,
const XML_Char encodingName 
)

Definition at line 939 of file xmlparse.cc.

942{
943 XML_Parser parser = oldParser;
944 DTD *newDtd = NULL;
945 DTD *oldDtd = _dtd;
946 XML_StartElementHandler oldStartElementHandler = startElementHandler;
947 XML_EndElementHandler oldEndElementHandler = endElementHandler;
948 XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
949 XML_ProcessingInstructionHandler oldProcessingInstructionHandler
951 XML_CommentHandler oldCommentHandler = commentHandler;
952 XML_StartCdataSectionHandler oldStartCdataSectionHandler
954 XML_EndCdataSectionHandler oldEndCdataSectionHandler
956 XML_DefaultHandler oldDefaultHandler = defaultHandler;
957 XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
959 XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
960 XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
962 XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
964 XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
965 XML_ExternalEntityRefHandler oldExternalEntityRefHandler
967 XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
968 XML_UnknownEncodingHandler oldUnknownEncodingHandler
970 XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
971 XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
972 XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
973 XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
974 ELEMENT_TYPE * oldDeclElementType = declElementType;
975
976 void *oldUserData = userData;
977 void *oldHandlerArg = handlerArg;
978 XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
979 XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
980#ifdef XML_DTD
981 enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
982 int oldInEntityValue = prologState.inEntityValue;
983#endif
984 XML_Bool oldns_triplets = ns_triplets;
985
986#ifdef XML_DTD
987 if (!context)
988 newDtd = oldDtd;
989#endif /* XML_DTD */
990
991 /* Note that the magical uses of the pre-processor to make field
992 access look more like C++ require that `parser' be overwritten
993 here. This makes this function more painful to follow than it
994 would be otherwise.
995 */
996 if (ns) {
997 XML_Char tmp[2];
998 *tmp = namespaceSeparator;
999 parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
1000 }
1001 else {
1002 parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
1003 }
1004
1005 if (!parser)
1006 return NULL;
1007
1008 startElementHandler = oldStartElementHandler;
1009 endElementHandler = oldEndElementHandler;
1010 characterDataHandler = oldCharacterDataHandler;
1011 processingInstructionHandler = oldProcessingInstructionHandler;
1012 commentHandler = oldCommentHandler;
1013 startCdataSectionHandler = oldStartCdataSectionHandler;
1014 endCdataSectionHandler = oldEndCdataSectionHandler;
1015 defaultHandler = oldDefaultHandler;
1016 unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
1017 notationDeclHandler = oldNotationDeclHandler;
1018 startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
1019 endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
1020 notStandaloneHandler = oldNotStandaloneHandler;
1021 externalEntityRefHandler = oldExternalEntityRefHandler;
1022 skippedEntityHandler = oldSkippedEntityHandler;
1023 unknownEncodingHandler = oldUnknownEncodingHandler;
1024 elementDeclHandler = oldElementDeclHandler;
1025 attlistDeclHandler = oldAttlistDeclHandler;
1026 entityDeclHandler = oldEntityDeclHandler;
1027 xmlDeclHandler = oldXmlDeclHandler;
1028 declElementType = oldDeclElementType;
1029 userData = oldUserData;
1030 if (oldUserData == oldHandlerArg)
1032 else
1033 handlerArg = parser;
1034 if (oldExternalEntityRefHandlerArg != oldParser)
1035 externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
1036 defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
1037 ns_triplets = oldns_triplets;
1038 parentParser = oldParser;
1039#ifdef XML_DTD
1040 paramEntityParsing = oldParamEntityParsing;
1041 prologState.inEntityValue = oldInEntityValue;
1042 if (context) {
1043#endif /* XML_DTD */
1044 if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
1045 || !setContext(parser, context)) {
1046 XML_ParserFree(parser);
1047 return NULL;
1048 }
1049 processor = externalEntityInitProcessor;
1050#ifdef XML_DTD
1051 }
1052 else {
1053 /* The DTD instance referenced by _dtd is shared between the document's
1054 root parser and external PE parsers, therefore one does not need to
1055 call setContext. In addition, one also *must* not call setContext,
1056 because this would overwrite existing prefix->binding pointers in
1057 _dtd with ones that get destroyed with the external PE parser.
1058 This would leave those prefixes with dangling pointers.
1059 */
1060 isParamEntity = XML_TRUE;
1061 XmlPrologStateInitExternalEntity(&prologState);
1062 processor = externalParEntInitProcessor;
1063 }
1064#endif /* XML_DTD */
1065 return parser;
1066}
char XML_Char
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)
void(XMLCALL * XML_EndCdataSectionHandler)(void *userData)
int(XMLCALL * XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info)
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)
void(XMLCALL * XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri)
unsigned char XML_Bool
Definition: include/expat.h:28
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_ParamEntityParsing
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_TRUE
Definition: include/expat.h:29
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)
Definition: xmlparse.cc:260
const XML_Memory_Handling_Suite m_mem
Definition: xmlparse.cc:458
#define externalEntityRefHandlerArg
Definition: xmlparse.cc:578
#define defaultExpandInternalEntities
Definition: xmlparse.cc:608
#define endCdataSectionHandler
Definition: xmlparse.cc:565
#define processingInstructionHandler
Definition: xmlparse.cc:560
#define skippedEntityHandler
Definition: xmlparse.cc:582
#define elementDeclHandler
Definition: xmlparse.cc:584
#define declElementType
Definition: xmlparse.cc:628
#define notationDeclHandler
Definition: xmlparse.cc:571
#define unknownEncodingHandler
Definition: xmlparse.cc:583
#define commentHandler
Definition: xmlparse.cc:562
#define userData
Definition: xmlparse.cc:555
#define xmlDeclHandler
Definition: xmlparse.cc:587
#define startCdataSectionHandler
Definition: xmlparse.cc:563
#define externalEntityRefHandler
Definition: xmlparse.cc:576
#define endElementHandler
Definition: xmlparse.cc:558
#define ns_triplets
Definition: xmlparse.cc:598
#define namespaceSeparator
Definition: xmlparse.cc:647
#define startNamespaceDeclHandler
Definition: xmlparse.cc:572
#define startElementHandler
Definition: xmlparse.cc:557
#define parentParser
Definition: xmlparse.cc:648
#define handlerArg
Definition: xmlparse.cc:556
#define entityDeclHandler
Definition: xmlparse.cc:586
#define notStandaloneHandler
Definition: xmlparse.cc:575
#define attlistDeclHandler
Definition: xmlparse.cc:585
#define ns
Definition: xmlparse.cc:597
#define _dtd
Definition: xmlparse.cc:619
#define endNamespaceDeclHandler
Definition: xmlparse.cc:574
#define unparsedEntityDeclHandler
Definition: xmlparse.cc:569
#define processor
Definition: xmlparse.cc:600
#define characterDataHandler
Definition: xmlparse.cc:559
#define prologState
Definition: xmlparse.cc:599
void XMLCALL XML_ParserFree(XML_Parser parser)
Definition: xmlparse.cc:1082

◆ XML_FreeContentModel()

void XMLCALL XML_FreeContentModel ( XML_Parser  parser,
XML_Content model 
)

Definition at line 1810 of file xmlparse.cc.

1811{
1812 FREE(model);
1813}
#define FREE(p)
Definition: xmlparse.cc:553

◆ XML_GetBase()

const XML_Char *XMLCALL XML_GetBase ( XML_Parser  parser)

Definition at line 1196 of file xmlparse.cc.

1197{
1198 return curBase;
1199}
#define curBase
Definition: xmlparse.cc:620

◆ XML_GetBuffer()

void *XMLCALL XML_GetBuffer ( XML_Parser  parser,
int  len 
)

Definition at line 1601 of file xmlparse.cc.

1602{
1603 switch (ps_parsing) {
1604 case XML_SUSPENDED:
1606 return NULL;
1607 case XML_FINISHED:
1609 return NULL;
1610 default: ;
1611 }
1612
1613 if (len > bufferLim - bufferEnd) {
1614 /* FIXME avoid integer overflow */
1615 int neededSize = len + (int)(bufferEnd - bufferPtr);
1616#ifdef XML_CONTEXT_BYTES
1617 int keep = (int)(bufferPtr - buffer);
1618
1619 if (keep > XML_CONTEXT_BYTES)
1620 keep = XML_CONTEXT_BYTES;
1621 neededSize += keep;
1622#endif /* defined XML_CONTEXT_BYTES */
1623 if (neededSize <= bufferLim - buffer) {
1624#ifdef XML_CONTEXT_BYTES
1625 if (keep < bufferPtr - buffer) {
1626 int offset = (int)(bufferPtr - buffer) - keep;
1627 memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
1628 bufferEnd -= offset;
1629 bufferPtr -= offset;
1630 }
1631#else
1632 memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
1634 bufferPtr = buffer;
1635#endif /* not defined XML_CONTEXT_BYTES */
1636 }
1637 else {
1638 char *newBuf;
1639 int bufferSize = (int)(bufferLim - bufferPtr);
1640 if (bufferSize == 0)
1641 bufferSize = INIT_BUFFER_SIZE;
1642 do {
1643 bufferSize *= 2;
1644 } while (bufferSize < neededSize);
1645 newBuf = (char *)MALLOC(bufferSize);
1646 if (newBuf == 0) {
1648 return NULL;
1649 }
1650 bufferLim = newBuf + bufferSize;
1651#ifdef XML_CONTEXT_BYTES
1652 if (bufferPtr) {
1653 int keep = (int)(bufferPtr - buffer);
1654 if (keep > XML_CONTEXT_BYTES)
1655 keep = XML_CONTEXT_BYTES;
1656 memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
1657 FREE(buffer);
1658 buffer = newBuf;
1659 bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
1660 bufferPtr = buffer + keep;
1661 }
1662 else {
1663 bufferEnd = newBuf + (bufferEnd - bufferPtr);
1664 bufferPtr = buffer = newBuf;
1665 }
1666#else
1667 if (bufferPtr) {
1668 memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
1669 FREE(buffer);
1670 }
1671 bufferEnd = newBuf + (bufferEnd - bufferPtr);
1672 bufferPtr = buffer = newBuf;
1673#endif /* not defined XML_CONTEXT_BYTES */
1674 }
1675 }
1676 return bufferEnd;
1677}
#define XML_CONTEXT_BYTES
Definition: amigaconfig.h:24
@ XML_SUSPENDED
@ XML_FINISHED
@ XML_ERROR_SUSPENDED
Definition: include/expat.h:90
@ XML_ERROR_NO_MEMORY
Definition: include/expat.h:56
@ XML_ERROR_FINISHED
Definition: include/expat.h:93
#define INIT_BUFFER_SIZE
Definition: xmlparse.cc:138
#define bufferEnd
Definition: xmlparse.cc:613
#define bufferLim
Definition: xmlparse.cc:616
#define ps_parsing
Definition: xmlparse.cc:649
#define buffer
Definition: xmlparse.cc:611
#define MALLOC(s)
Definition: xmlparse.cc:551
#define errorCode
Definition: xmlparse.cc:601
#define bufferPtr
Definition: xmlparse.cc:612

Referenced by XML_Parse().

◆ XML_GetCurrentByteCount()

int XMLCALL XML_GetCurrentByteCount ( XML_Parser  parser)

Definition at line 1769 of file xmlparse.cc.

1770{
1771 if (eventEndPtr && eventPtr)
1772 return (int)(eventEndPtr - eventPtr);
1773 return 0;
1774}

◆ XML_GetCurrentByteIndex()

XML_Index XMLCALL XML_GetCurrentByteIndex ( XML_Parser  parser)

Definition at line 1761 of file xmlparse.cc.

1762{
1763 if (eventPtr)
1765 return -1;
1766}
#define parseEndPtr
Definition: xmlparse.cc:615
#define parseEndByteIndex
Definition: xmlparse.cc:614

◆ XML_GetCurrentColumnNumber()

XML_Size XMLCALL XML_GetCurrentColumnNumber ( XML_Parser  parser)

Definition at line 1800 of file xmlparse.cc.

1801{
1802 if (eventPtr && eventPtr >= positionPtr) {
1805 }
1806 return position.columnNumber;
1807}
XML_Size columnNumber
Definition: xmltok.h:113
#define positionPtr
Definition: xmlparse.cc:604
#define XmlUpdatePosition(enc, ptr, end, pos)
Definition: xmltok.h:247

Referenced by xData_parseEndOfXML().

◆ XML_GetCurrentLineNumber()

XML_Size XMLCALL XML_GetCurrentLineNumber ( XML_Parser  parser)

Definition at line 1790 of file xmlparse.cc.

1791{
1792 if (eventPtr && eventPtr >= positionPtr) {
1795 }
1796 return position.lineNumber + 1;
1797}
XML_Size lineNumber
Definition: xmltok.h:112

Referenced by xData_parseEndOfXML().

◆ XML_GetErrorCode()

enum XML_Error XMLCALL XML_GetErrorCode ( XML_Parser  parser)

Definition at line 1755 of file xmlparse.cc.

1756{
1757 return errorCode;
1758}

Referenced by xData_parseEndOfXML().

◆ XML_GetFeatureList()

const XML_Feature *XMLCALL XML_GetFeatureList ( void  )

Definition at line 1931 of file xmlparse.cc.

1932{
1933 static const XML_Feature features[] = {
1934 {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"),
1935 sizeof(XML_Char)},
1936 {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
1937 sizeof(XML_LChar)},
1938#ifdef XML_UNICODE
1939 {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0},
1940#endif
1941#ifdef XML_UNICODE_WCHAR_T
1942 {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0},
1943#endif
1944#ifdef XML_DTD
1945 {XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
1946#endif
1947#ifdef XML_CONTEXT_BYTES
1948 {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
1950#endif
1951#ifdef XML_MIN_SIZE
1952 {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0},
1953#endif
1954#ifdef XML_NS
1955 {XML_FEATURE_NS, XML_L("XML_NS"), 0},
1956#endif
1957#ifdef XML_LARGE_SIZE
1958 {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
1959#endif
1960 {XML_FEATURE_END, NULL, 0}
1961 };
1962
1963 return features;
1964}
@ XML_FEATURE_DTD
@ XML_FEATURE_SIZEOF_XML_LCHAR
@ XML_FEATURE_NS
@ XML_FEATURE_UNICODE
@ XML_FEATURE_SIZEOF_XML_CHAR
@ XML_FEATURE_MIN_SIZE
@ XML_FEATURE_END
@ XML_FEATURE_UNICODE_WCHAR_T
@ XML_FEATURE_CONTEXT_BYTES
@ XML_FEATURE_LARGE_SIZE
#define XML_Char
Definition: xData.h:57

◆ XML_GetIdAttributeIndex()

int XMLCALL XML_GetIdAttributeIndex ( XML_Parser  parser)

Definition at line 1208 of file xmlparse.cc.

1209{
1210 return idAttIndex;
1211}
#define idAttIndex
Definition: xmlparse.cc:639

◆ XML_GetInputContext()

const char *XMLCALL XML_GetInputContext ( XML_Parser  parser,
int *  offset,
int *  size 
)

Definition at line 1777 of file xmlparse.cc.

1778{
1779#ifdef XML_CONTEXT_BYTES
1780 if (eventPtr && buffer) {
1781 *offset = (int)(eventPtr - buffer);
1782 *size = (int)(bufferEnd - buffer);
1783 return buffer;
1784 }
1785#endif /* defined XML_CONTEXT_BYTES */
1786 return (char *) 0;
1787}

◆ XML_GetParsingStatus()

void XMLCALL XML_GetParsingStatus ( XML_Parser  parser,
XML_ParsingStatus status 
)

Definition at line 1748 of file xmlparse.cc.

1749{
1750 assert(status != NULL);
1751 *status = parser->m_parsingStatus;
1752}
XML_ParsingStatus m_parsingStatus
Definition: xmlparse.cc:543

◆ XML_GetSpecifiedAttributeCount()

int XMLCALL XML_GetSpecifiedAttributeCount ( XML_Parser  parser)

Definition at line 1202 of file xmlparse.cc.

1203{
1204 return nSpecifiedAtts;
1205}
#define nSpecifiedAtts
Definition: xmlparse.cc:638

◆ XML_MemFree()

void XMLCALL XML_MemFree ( XML_Parser  parser,
void *  ptr 
)

Definition at line 1828 of file xmlparse.cc.

1829{
1830 FREE(ptr);
1831}

◆ XML_MemMalloc()

void *XMLCALL XML_MemMalloc ( XML_Parser  parser,
size_t  size 
)

Definition at line 1816 of file xmlparse.cc.

1817{
1818 return MALLOC(size);
1819}

◆ XML_MemRealloc()

void *XMLCALL XML_MemRealloc ( XML_Parser  parser,
void *  ptr,
size_t  size 
)

Definition at line 1822 of file xmlparse.cc.

1823{
1824 return REALLOC(ptr, size);
1825}
#define REALLOC(p, s)
Definition: xmlparse.cc:552

◆ XML_Parse()

enum XML_Status XMLCALL XML_Parse ( XML_Parser  parser,
const char *  s,
int  len,
int  isFinal 
)

Definition at line 1430 of file xmlparse.cc.

1431{
1432 switch (ps_parsing) {
1433 case XML_SUSPENDED:
1435 return XML_STATUS_ERROR;
1436 case XML_FINISHED:
1438 return XML_STATUS_ERROR;
1439 default:
1441 }
1442
1443 if (len == 0) {
1444 ps_finalBuffer = (XML_Bool)isFinal;
1445 if (!isFinal)
1446 return XML_STATUS_OK;
1449
1450 /* If data are left over from last buffer, and we now know that these
1451 data are the final chunk of input, then we have to check them again
1452 to detect errors based on that fact.
1453 */
1455
1456 if (errorCode == XML_ERROR_NONE) {
1457 switch (ps_parsing) {
1458 case XML_SUSPENDED:
1461 return XML_STATUS_SUSPENDED;
1462 case XML_INITIALIZED:
1463 case XML_PARSING:
1465 /* fall through */
1466 default:
1467 return XML_STATUS_OK;
1468 }
1469 }
1471 processor = errorProcessor;
1472 return XML_STATUS_ERROR;
1473 }
1474#ifndef XML_CONTEXT_BYTES
1475 else if (bufferPtr == bufferEnd) {
1476 const char *end;
1477 int nLeftOver;
1478 enum XML_Error result;
1479 parseEndByteIndex += len;
1480 positionPtr = s;
1481 ps_finalBuffer = (XML_Bool)isFinal;
1482
1483 errorCode = processor(parser, s, parseEndPtr = s + len, &end);
1484
1485 if (errorCode != XML_ERROR_NONE) {
1487 processor = errorProcessor;
1488 return XML_STATUS_ERROR;
1489 }
1490 else {
1491 switch (ps_parsing) {
1492 case XML_SUSPENDED:
1493 result = XML_STATUS_SUSPENDED;
1494 break;
1495 case XML_INITIALIZED:
1496 case XML_PARSING:
1497 result = XML_STATUS_OK;
1498 if (isFinal) {
1500 return result;
1501 }
1502 }
1503 }
1504
1506 nLeftOver = s + len - end;
1507 if (nLeftOver) {
1508 if (buffer == NULL || nLeftOver > bufferLim - buffer) {
1509 /* FIXME avoid integer overflow */
1510 char *temp;
1511 temp = (buffer == NULL
1512 ? (char *)MALLOC(len * 2)
1513 : (char *)REALLOC(buffer, len * 2));
1514 if (temp == NULL) {
1516 return XML_STATUS_ERROR;
1517 }
1518 buffer = temp;
1519 if (!buffer) {
1521 eventPtr = eventEndPtr = NULL;
1522 processor = errorProcessor;
1523 return XML_STATUS_ERROR;
1524 }
1525 bufferLim = buffer + len * 2;
1526 }
1527 memcpy(buffer, end, nLeftOver);
1528 }
1529 bufferPtr = buffer;
1530 bufferEnd = buffer + nLeftOver;
1535 return result;
1536 }
1537#endif /* not defined XML_CONTEXT_BYTES */
1538 else {
1539 void *buff = XML_GetBuffer(parser, len);
1540 if (buff == NULL)
1541 return XML_STATUS_ERROR;
1542 else {
1543 memcpy(buff, s, len);
1544 return XML_ParseBuffer(parser, len, isFinal);
1545 }
1546 }
1547}
@ XML_PARSING
@ XML_INITIALIZED
#define XML_STATUS_ERROR
Definition: include/expat.h:47
XML_Error
Definition: include/expat.h:54
@ XML_ERROR_NONE
Definition: include/expat.h:55
#define XML_STATUS_SUSPENDED
#define XML_STATUS_OK
Definition: include/expat.h:49
#define ps_finalBuffer
Definition: xmlparse.cc:650
void *XMLCALL XML_GetBuffer(XML_Parser parser, int len)
Definition: xmlparse.cc:1601
enum XML_Status XMLCALL XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
Definition: xmlparse.cc:1550

Referenced by xData_parse(), and xData_parseEndOfXML().

◆ XML_ParseBuffer()

enum XML_Status XMLCALL XML_ParseBuffer ( XML_Parser  parser,
int  len,
int  isFinal 
)

Definition at line 1550 of file xmlparse.cc.

1551{
1552 const char *start;
1553 enum XML_Status result = XML_STATUS_OK;
1554
1555 switch (ps_parsing) {
1556 case XML_SUSPENDED:
1558 return XML_STATUS_ERROR;
1559 case XML_FINISHED:
1561 return XML_STATUS_ERROR;
1562 default:
1564 }
1565
1566 start = bufferPtr;
1567 positionPtr = start;
1568 bufferEnd += len;
1570 parseEndByteIndex += len;
1571 ps_finalBuffer = (XML_Bool)isFinal;
1572
1573 errorCode = processor(parser, start, parseEndPtr, &bufferPtr);
1574
1575 if (errorCode != XML_ERROR_NONE) {
1577 processor = errorProcessor;
1578 return XML_STATUS_ERROR;
1579 }
1580 else {
1581 switch (ps_parsing) {
1582 case XML_SUSPENDED:
1583 result = XML_STATUS_SUSPENDED;
1584 break;
1585 case XML_INITIALIZED:
1586 case XML_PARSING:
1587 if (isFinal) {
1589 return result;
1590 }
1591 default: ; /* should not happen */
1592 }
1593 }
1594
1597 return result;
1598}
XML_Status
Definition: include/expat.h:45

Referenced by XML_Parse().

◆ XML_ParserCreate()

XML_Parser XMLCALL XML_ParserCreate ( const XML_Char encodingName)

Definition at line 658 of file xmlparse.cc.

659{
660 return XML_ParserCreate_MM(encodingName, NULL, NULL);
661}
XML_Parser XMLCALL XML_ParserCreate_MM(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep)
Definition: xmlparse.cc:681

Referenced by xData_parseInitialize().

◆ XML_ParserCreate_MM()

XML_Parser XMLCALL XML_ParserCreate_MM ( const XML_Char encodingName,
const XML_Memory_Handling_Suite memsuite,
const XML_Char nameSep 
)

Definition at line 681 of file xmlparse.cc.

684{
685 XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
686 if (parser != NULL && ns) {
687 /* implicit context only set for root parser, since child
688 parsers (i.e. external entity parsers) will inherit it
689 */
690 if (!setContext(parser, implicitContext)) {
691 XML_ParserFree(parser);
692 return NULL;
693 }
694 }
695 return parser;
696}

Referenced by XML_ParserCreate(), and XML_ParserCreateNS().

◆ XML_ParserCreateNS()

XML_Parser XMLCALL XML_ParserCreateNS ( const XML_Char encodingName,
XML_Char  nsSep 
)

Definition at line 664 of file xmlparse.cc.

665{
666 XML_Char tmp[2];
667 *tmp = nsSep;
668 return XML_ParserCreate_MM(encodingName, NULL, tmp);
669}

◆ XML_ParserFree()

void XMLCALL XML_ParserFree ( XML_Parser  parser)

Definition at line 1082 of file xmlparse.cc.

1083{
1084 TAG *tagList;
1085 OPEN_INTERNAL_ENTITY *entityList;
1086 if (parser == NULL)
1087 return;
1088 /* free tagStack and freeTagList */
1089 tagList = tagStack;
1090 for (;;) {
1091 TAG *p;
1092 if (tagList == NULL) {
1093 if (freeTagList == NULL)
1094 break;
1095 tagList = freeTagList;
1096 freeTagList = NULL;
1097 }
1098 p = tagList;
1099 tagList = tagList->parent;
1100 FREE(p->buf);
1101 destroyBindings(p->bindings, parser);
1102 FREE(p);
1103 }
1104 /* free openInternalEntities and freeInternalEntities */
1105 entityList = openInternalEntities;
1106 for (;;) {
1107 OPEN_INTERNAL_ENTITY *openEntity;
1108 if (entityList == NULL) {
1109 if (freeInternalEntities == NULL)
1110 break;
1111 entityList = freeInternalEntities;
1112 freeInternalEntities = NULL;
1113 }
1114 openEntity = entityList;
1115 entityList = entityList->next;
1116 FREE(openEntity);
1117 }
1118
1119 destroyBindings(freeBindingList, parser);
1120 destroyBindings(inheritedBindings, parser);
1121 poolDestroy(&tempPool);
1122 poolDestroy(&temp2Pool);
1123#ifdef XML_DTD
1124 /* external parameter entity parsers share the DTD structure
1125 parser->m_dtd with the root parser, so we must not destroy it
1126 */
1127 if (!isParamEntity && _dtd)
1128#else
1129 if (_dtd)
1130#endif /* XML_DTD */
1131 dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
1132 FREE((void *)atts);
1134 FREE(buffer);
1135 FREE(dataBuf);
1136 FREE(nsAtts);
1140 FREE(parser);
1141}
struct open_internal_entity * next
Definition: xmlparse.cc:292
Definition: xmlparse.cc:179
struct tag * parent
Definition: xmlparse.cc:180
BINDING * bindings
Definition: xmlparse.cc:186
char * buf
Definition: xmlparse.cc:184
#define tagStack
Definition: xmlparse.cc:635
#define dataBuf
Definition: xmlparse.cc:617
#define groupConnector
Definition: xmlparse.cc:645
#define freeBindingList
Definition: xmlparse.cc:633
#define temp2Pool
Definition: xmlparse.cc:644
#define inheritedBindings
Definition: xmlparse.cc:634
#define tempPool
Definition: xmlparse.cc:643
#define nsAtts
Definition: xmlparse.cc:640
#define unknownEncodingRelease
Definition: xmlparse.cc:595
#define unknownEncodingMem
Definition: xmlparse.cc:591
#define atts
Definition: xmlparse.cc:636
#define unknownEncodingData
Definition: xmlparse.cc:592
#define freeInternalEntities
Definition: xmlparse.cc:607
#define freeTagList
Definition: xmlparse.cc:632

Referenced by xData_parseEndOfXML(), XML_ExternalEntityParserCreate(), and XML_ParserCreate_MM().

◆ XML_ParserReset()

XML_Bool XMLCALL XML_ParserReset ( XML_Parser  parser,
const XML_Char encodingName 
)

Definition at line 884 of file xmlparse.cc.

885{
886 TAG *tStk;
887 OPEN_INTERNAL_ENTITY *openEntityList;
888 if (parentParser)
889 return XML_FALSE;
890 /* move tagStack to freeTagList */
891 tStk = tagStack;
892 while (tStk) {
893 TAG *tag = tStk;
894 tStk = tStk->parent;
896 moveToFreeBindingList(parser, tag->bindings);
897 tag->bindings = NULL;
899 }
900 /* move openInternalEntities to freeInternalEntities */
901 openEntityList = openInternalEntities;
902 while (openEntityList) {
903 OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
904 openEntityList = openEntity->next;
905 openEntity->next = freeInternalEntities;
906 freeInternalEntities = openEntity;
907 }
908 moveToFreeBindingList(parser, inheritedBindings);
912 poolClear(&tempPool);
913 poolClear(&temp2Pool);
914 parserInit(parser, encodingName);
915 dtdReset(_dtd, &parser->m_mem);
916 return setContext(parser, implicitContext);
917}
#define XML_FALSE
Definition: include/expat.h:30

◆ XML_ResumeParser()

enum XML_Status XMLCALL XML_ResumeParser ( XML_Parser  parser)

Definition at line 1710 of file xmlparse.cc.

1711{
1712 enum XML_Status result = XML_STATUS_OK;
1713
1714 if (ps_parsing != XML_SUSPENDED) {
1716 return XML_STATUS_ERROR;
1717 }
1719
1721
1722 if (errorCode != XML_ERROR_NONE) {
1724 processor = errorProcessor;
1725 return XML_STATUS_ERROR;
1726 }
1727 else {
1728 switch (ps_parsing) {
1729 case XML_SUSPENDED:
1730 result = XML_STATUS_SUSPENDED;
1731 break;
1732 case XML_INITIALIZED:
1733 case XML_PARSING:
1734 if (ps_finalBuffer) {
1736 return result;
1737 }
1738 default: ;
1739 }
1740 }
1741
1744 return result;
1745}
@ XML_ERROR_NOT_SUSPENDED
Definition: include/expat.h:91

◆ XML_SetAttlistDeclHandler()

void XMLCALL XML_SetAttlistDeclHandler ( XML_Parser  parser,
XML_AttlistDeclHandler  attdecl 
)

Definition at line 1395 of file xmlparse.cc.

1397{
1398 attlistDeclHandler = attdecl;
1399}

◆ XML_SetBase()

enum XML_Status XMLCALL XML_SetBase ( XML_Parser  parser,
const XML_Char p 
)

Definition at line 1182 of file xmlparse.cc.

1183{
1184 if (p) {
1185 p = poolCopyString(&_dtd->pool, p);
1186 if (!p)
1187 return XML_STATUS_ERROR;
1188 curBase = p;
1189 }
1190 else
1191 curBase = NULL;
1192 return XML_STATUS_OK;
1193}

◆ XML_SetCdataSectionHandler()

void XMLCALL XML_SetCdataSectionHandler ( XML_Parser  parser,
XML_StartCdataSectionHandler  start,
XML_EndCdataSectionHandler  end 
)

Definition at line 1256 of file xmlparse.cc.

1259{
1262}

◆ XML_SetCharacterDataHandler()

void XMLCALL XML_SetCharacterDataHandler ( XML_Parser  parser,
XML_CharacterDataHandler  handler 
)

Definition at line 1235 of file xmlparse.cc.

1237{
1238 characterDataHandler = handler;
1239}

Referenced by xData_parseInitialize().

◆ XML_SetCommentHandler()

void XMLCALL XML_SetCommentHandler ( XML_Parser  parser,
XML_CommentHandler  handler 
)

Definition at line 1249 of file xmlparse.cc.

1251{
1252 commentHandler = handler;
1253}

◆ XML_SetDefaultHandler()

void XMLCALL XML_SetDefaultHandler ( XML_Parser  parser,
XML_DefaultHandler  handler 
)

Definition at line 1277 of file xmlparse.cc.

1279{
1280 defaultHandler = handler;
1282}

◆ XML_SetDefaultHandlerExpand()

void XMLCALL XML_SetDefaultHandlerExpand ( XML_Parser  parser,
XML_DefaultHandler  handler 
)

Definition at line 1285 of file xmlparse.cc.

1287{
1288 defaultHandler = handler;
1290}

◆ XML_SetDoctypeDeclHandler()

void XMLCALL XML_SetDoctypeDeclHandler ( XML_Parser  parser,
XML_StartDoctypeDeclHandler  start,
XML_EndDoctypeDeclHandler  end 
)

Definition at line 1293 of file xmlparse.cc.

1296{
1299}
#define endDoctypeDeclHandler
Definition: xmlparse.cc:568
#define startDoctypeDeclHandler
Definition: xmlparse.cc:567

◆ XML_SetElementDeclHandler()

void XMLCALL XML_SetElementDeclHandler ( XML_Parser  parser,
XML_ElementDeclHandler  eldecl 
)

Definition at line 1388 of file xmlparse.cc.

1390{
1391 elementDeclHandler = eldecl;
1392}

◆ XML_SetElementHandler()

void XMLCALL XML_SetElementHandler ( XML_Parser  parser,
XML_StartElementHandler  start,
XML_EndElementHandler  end 
)

Definition at line 1214 of file xmlparse.cc.

1217{
1218 startElementHandler = start;
1219 endElementHandler = end;
1220}

Referenced by xData_parseInitialize().

◆ XML_SetEncoding()

enum XML_Status XMLCALL XML_SetEncoding ( XML_Parser  parser,
const XML_Char encodingName 
)

Definition at line 920 of file xmlparse.cc.

921{
922 /* Block after XML_Parse()/XML_ParseBuffer() has been called.
923 XXX There's no way for the caller to determine which of the
924 XXX possible error cases caused the XML_STATUS_ERROR return.
925 */
927 return XML_STATUS_ERROR;
928 if (encodingName == NULL)
930 else {
931 protocolEncodingName = poolCopyString(&tempPool, encodingName);
933 return XML_STATUS_ERROR;
934 }
935 return XML_STATUS_OK;
936}
#define protocolEncodingName
Definition: xmlparse.cc:596

◆ XML_SetEndCdataSectionHandler()

void XMLCALL XML_SetEndCdataSectionHandler ( XML_Parser  parser,
XML_EndCdataSectionHandler  end 
)

Definition at line 1271 of file xmlparse.cc.

1272 {
1274}

◆ XML_SetEndDoctypeDeclHandler()

void XMLCALL XML_SetEndDoctypeDeclHandler ( XML_Parser  parser,
XML_EndDoctypeDeclHandler  end 
)

Definition at line 1308 of file xmlparse.cc.

1309 {
1311}

◆ XML_SetEndElementHandler()

void XMLCALL XML_SetEndElementHandler ( XML_Parser  parser,
XML_EndElementHandler  end 
)

Definition at line 1229 of file xmlparse.cc.

1230 {
1231 endElementHandler = end;
1232}

◆ XML_SetEndNamespaceDeclHandler()

void XMLCALL XML_SetEndNamespaceDeclHandler ( XML_Parser  parser,
XML_EndNamespaceDeclHandler  end 
)

Definition at line 1343 of file xmlparse.cc.

1344 {
1346}

◆ XML_SetEntityDeclHandler()

void XMLCALL XML_SetEntityDeclHandler ( XML_Parser  parser,
XML_EntityDeclHandler  handler 
)

Definition at line 1402 of file xmlparse.cc.

1404{
1405 entityDeclHandler = handler;
1406}

◆ XML_SetExternalEntityRefHandler()

void XMLCALL XML_SetExternalEntityRefHandler ( XML_Parser  parser,
XML_ExternalEntityRefHandler  handler 
)

Definition at line 1356 of file xmlparse.cc.

1358{
1359 externalEntityRefHandler = handler;
1360}

◆ XML_SetExternalEntityRefHandlerArg()

void XMLCALL XML_SetExternalEntityRefHandlerArg ( XML_Parser  parser,
void *  arg 
)

Definition at line 1363 of file xmlparse.cc.

1364{
1365 if (arg)
1367 else
1369}
struct XML_ParserStruct * XML_Parser
Definition: include/expat.h:25

◆ XML_SetNamespaceDeclHandler()

void XMLCALL XML_SetNamespaceDeclHandler ( XML_Parser  parser,
XML_StartNamespaceDeclHandler  start,
XML_EndNamespaceDeclHandler  end 
)

Definition at line 1328 of file xmlparse.cc.

1331{
1334}

◆ XML_SetNotationDeclHandler()

void XMLCALL XML_SetNotationDeclHandler ( XML_Parser  parser,
XML_NotationDeclHandler  handler 
)

Definition at line 1321 of file xmlparse.cc.

1323{
1324 notationDeclHandler = handler;
1325}

◆ XML_SetNotStandaloneHandler()

void XMLCALL XML_SetNotStandaloneHandler ( XML_Parser  parser,
XML_NotStandaloneHandler  handler 
)

Definition at line 1349 of file xmlparse.cc.

1351{
1352 notStandaloneHandler = handler;
1353}

◆ XML_SetParamEntityParsing()

int XMLCALL XML_SetParamEntityParsing ( XML_Parser  parser,
enum XML_ParamEntityParsing  peParsing 
)

Definition at line 1415 of file xmlparse.cc.

1417{
1418 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1420 return 0;
1421#ifdef XML_DTD
1422 paramEntityParsing = peParsing;
1423 return 1;
1424#else
1425 return peParsing == XML_PARAM_ENTITY_PARSING_NEVER;
1426#endif
1427}
@ XML_PARAM_ENTITY_PARSING_NEVER

◆ XML_SetProcessingInstructionHandler()

void XMLCALL XML_SetProcessingInstructionHandler ( XML_Parser  parser,
XML_ProcessingInstructionHandler  handler 
)

Definition at line 1242 of file xmlparse.cc.

1244{
1246}

◆ XML_SetReturnNSTriplet()

void XMLCALL XML_SetReturnNSTriplet ( XML_Parser  parser,
int  do_nst 
)

Definition at line 1164 of file xmlparse.cc.

1165{
1166 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1168 return;
1169 ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
1170}

◆ XML_SetSkippedEntityHandler()

void XMLCALL XML_SetSkippedEntityHandler ( XML_Parser  parser,
XML_SkippedEntityHandler  handler 
)

Definition at line 1372 of file xmlparse.cc.

1374{
1375 skippedEntityHandler = handler;
1376}

◆ XML_SetStartCdataSectionHandler()

void XMLCALL XML_SetStartCdataSectionHandler ( XML_Parser  parser,
XML_StartCdataSectionHandler  start 
)

Definition at line 1265 of file xmlparse.cc.

1266 {
1268}

◆ XML_SetStartDoctypeDeclHandler()

void XMLCALL XML_SetStartDoctypeDeclHandler ( XML_Parser  parser,
XML_StartDoctypeDeclHandler  start 
)

Definition at line 1302 of file xmlparse.cc.

1303 {
1305}

◆ XML_SetStartElementHandler()

void XMLCALL XML_SetStartElementHandler ( XML_Parser  parser,
XML_StartElementHandler  start 
)

Definition at line 1223 of file xmlparse.cc.

1224 {
1225 startElementHandler = start;
1226}

◆ XML_SetStartNamespaceDeclHandler()

void XMLCALL XML_SetStartNamespaceDeclHandler ( XML_Parser  parser,
XML_StartNamespaceDeclHandler  start 
)

Definition at line 1337 of file xmlparse.cc.

1338 {
1340}

◆ XML_SetUnknownEncodingHandler()

void XMLCALL XML_SetUnknownEncodingHandler ( XML_Parser  parser,
XML_UnknownEncodingHandler  handler,
void *  data 
)

Definition at line 1379 of file xmlparse.cc.

1382{
1383 unknownEncodingHandler = handler;
1385}
#define unknownEncodingHandlerData
Definition: xmlparse.cc:593

◆ XML_SetUnparsedEntityDeclHandler()

void XMLCALL XML_SetUnparsedEntityDeclHandler ( XML_Parser  parser,
XML_UnparsedEntityDeclHandler  handler 
)

Definition at line 1314 of file xmlparse.cc.

1316{
1317 unparsedEntityDeclHandler = handler;
1318}

◆ XML_SetUserData()

void XMLCALL XML_SetUserData ( XML_Parser  parser,
void *  p 
)

Definition at line 1173 of file xmlparse.cc.

1174{
1175 if (handlerArg == userData)
1176 handlerArg = userData = p;
1177 else
1178 userData = p;
1179}

Referenced by xData_parseInitialize().

◆ XML_SetXmlDeclHandler()

void XMLCALL XML_SetXmlDeclHandler ( XML_Parser  parser,
XML_XmlDeclHandler  handler 
)

Definition at line 1409 of file xmlparse.cc.

1410 {
1411 xmlDeclHandler = handler;
1412}

◆ XML_StopParser()

enum XML_Status XMLCALL XML_StopParser ( XML_Parser  parser,
XML_Bool  resumable 
)

Definition at line 1680 of file xmlparse.cc.

1681{
1682 switch (ps_parsing) {
1683 case XML_SUSPENDED:
1684 if (resumable) {
1686 return XML_STATUS_ERROR;
1687 }
1689 break;
1690 case XML_FINISHED:
1692 return XML_STATUS_ERROR;
1693 default:
1694 if (resumable) {
1695#ifdef XML_DTD
1696 if (isParamEntity) {
1698 return XML_STATUS_ERROR;
1699 }
1700#endif
1702 }
1703 else
1705 }
1706 return XML_STATUS_OK;
1707}
@ XML_ERROR_SUSPEND_PE
Definition: include/expat.h:94

◆ XML_UseForeignDTD()

enum XML_Error XMLCALL XML_UseForeignDTD ( XML_Parser  parser,
XML_Bool  useDTD 
)

Definition at line 1150 of file xmlparse.cc.

1151{
1152#ifdef XML_DTD
1153 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1156 useForeignDTD = useDTD;
1157 return XML_ERROR_NONE;
1158#else
1160#endif
1161}
@ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
Definition: include/expat.h:81
@ XML_ERROR_FEATURE_REQUIRES_XML_DTD
Definition: include/expat.h:80

◆ XML_UseParserAsHandlerArg()

void XMLCALL XML_UseParserAsHandlerArg ( XML_Parser  parser)

Definition at line 1144 of file xmlparse.cc.

1145{
1146 handlerArg = parser;
1147}