Geant4 10.7.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 <limits.h>
#include <time.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 attInfo   (parser->m_attInfo)
 
#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 hash_secret_salt   (parser->m_hash_secret_salt)
 
#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)
 
int XMLCALL XML_SetHashSalt (XML_Parser parser, unsigned long hash_salt)
 
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 636 of file xmlparse.cc.

◆ attInfo

#define attInfo   (parser->m_attInfo)

Definition at line 660 of file xmlparse.cc.

◆ attlistDeclHandler

#define attlistDeclHandler   (parser->m_attlistDeclHandler)

Definition at line 602 of file xmlparse.cc.

◆ atts

#define atts   (parser->m_atts)

Definition at line 653 of file xmlparse.cc.

◆ attsSize

#define attsSize   (parser->m_attsSize)

Definition at line 654 of file xmlparse.cc.

◆ buffer

#define buffer   (parser->m_buffer)

Definition at line 628 of file xmlparse.cc.

◆ bufferEnd

#define bufferEnd   (parser->m_bufferEnd)

Definition at line 630 of file xmlparse.cc.

◆ bufferLim

#define bufferLim   (parser->m_bufferLim)

Definition at line 633 of file xmlparse.cc.

◆ bufferPtr

#define bufferPtr   (parser->m_bufferPtr)

Definition at line 629 of file xmlparse.cc.

◆ CHAR_HASH

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

Definition at line 119 of file xmlparse.cc.

◆ characterDataHandler

#define characterDataHandler   (parser->m_characterDataHandler)

Definition at line 576 of file xmlparse.cc.

◆ commentHandler

#define commentHandler   (parser->m_commentHandler)

Definition at line 579 of file xmlparse.cc.

◆ CONTEXT_SEP

#define CONTEXT_SEP   XML_T(ASCII_FF)

Definition at line 5496 of file xmlparse.cc.

◆ curBase

#define curBase   (parser->m_curBase)

Definition at line 637 of file xmlparse.cc.

◆ dataBuf

#define dataBuf   (parser->m_dataBuf)

Definition at line 634 of file xmlparse.cc.

◆ dataBufEnd

#define dataBufEnd   (parser->m_dataBufEnd)

Definition at line 635 of file xmlparse.cc.

◆ declAttributeId

#define declAttributeId   (parser->m_declAttributeId)

Definition at line 646 of file xmlparse.cc.

◆ declAttributeIsCdata

#define declAttributeIsCdata   (parser->m_declAttributeIsCdata)

Definition at line 647 of file xmlparse.cc.

◆ declAttributeIsId

#define declAttributeIsId   (parser->m_declAttributeIsId)

Definition at line 648 of file xmlparse.cc.

◆ declAttributeType

#define declAttributeType   (parser->m_declAttributeType)

Definition at line 642 of file xmlparse.cc.

◆ declElementType

#define declElementType   (parser->m_declElementType)

Definition at line 645 of file xmlparse.cc.

◆ declEntity

#define declEntity   (parser->m_declEntity)

Definition at line 638 of file xmlparse.cc.

◆ declNotationName

#define declNotationName   (parser->m_declNotationName)

Definition at line 643 of file xmlparse.cc.

◆ declNotationPublicId

#define declNotationPublicId   (parser->m_declNotationPublicId)

Definition at line 644 of file xmlparse.cc.

◆ defaultExpandInternalEntities

#define defaultExpandInternalEntities    (parser->m_defaultExpandInternalEntities)

Definition at line 625 of file xmlparse.cc.

◆ defaultHandler

#define defaultHandler   (parser->m_defaultHandler)

Definition at line 583 of file xmlparse.cc.

◆ doctypeName

#define doctypeName   (parser->m_doctypeName)

Definition at line 639 of file xmlparse.cc.

◆ doctypePubid

#define doctypePubid   (parser->m_doctypePubid)

Definition at line 641 of file xmlparse.cc.

◆ doctypeSysid

#define doctypeSysid   (parser->m_doctypeSysid)

Definition at line 640 of file xmlparse.cc.

◆ elementDeclHandler

#define elementDeclHandler   (parser->m_elementDeclHandler)

Definition at line 601 of file xmlparse.cc.

◆ encoding

#define encoding   (parser->m_encoding)

Definition at line 605 of file xmlparse.cc.

◆ endCdataSectionHandler

#define endCdataSectionHandler   (parser->m_endCdataSectionHandler)

Definition at line 582 of file xmlparse.cc.

◆ endDoctypeDeclHandler

#define endDoctypeDeclHandler   (parser->m_endDoctypeDeclHandler)

Definition at line 585 of file xmlparse.cc.

◆ endElementHandler

#define endElementHandler   (parser->m_endElementHandler)

Definition at line 575 of file xmlparse.cc.

◆ endNamespaceDeclHandler

#define endNamespaceDeclHandler   (parser->m_endNamespaceDeclHandler)

Definition at line 591 of file xmlparse.cc.

◆ entityDeclHandler

#define entityDeclHandler   (parser->m_entityDeclHandler)

Definition at line 603 of file xmlparse.cc.

◆ errorCode

#define errorCode   (parser->m_errorCode)

Definition at line 618 of file xmlparse.cc.

◆ eventEndPtr

#define eventEndPtr   (parser->m_eventEndPtr)

Definition at line 620 of file xmlparse.cc.

◆ eventPtr

#define eventPtr   (parser->m_eventPtr)

Definition at line 619 of file xmlparse.cc.

◆ EXPAND_SPARE

#define EXPAND_SPARE   24

Definition at line 148 of file xmlparse.cc.

◆ externalEntityRefHandler

#define externalEntityRefHandler    (parser->m_externalEntityRefHandler)

Definition at line 593 of file xmlparse.cc.

◆ externalEntityRefHandlerArg

#define externalEntityRefHandlerArg    (parser->m_externalEntityRefHandlerArg)

Definition at line 595 of file xmlparse.cc.

◆ FREE

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

Definition at line 570 of file xmlparse.cc.

◆ freeBindingList

#define freeBindingList   (parser->m_freeBindingList)

Definition at line 650 of file xmlparse.cc.

◆ freeInternalEntities

#define freeInternalEntities   (parser->m_freeInternalEntities)

Definition at line 624 of file xmlparse.cc.

◆ freeTagList

#define freeTagList   (parser->m_freeTagList)

Definition at line 649 of file xmlparse.cc.

◆ groupConnector

#define groupConnector   (parser->m_groupConnector)

Definition at line 663 of file xmlparse.cc.

◆ groupSize

#define groupSize   (parser->m_groupSize)

Definition at line 664 of file xmlparse.cc.

◆ handlerArg

#define handlerArg   (parser->m_handlerArg)

Definition at line 573 of file xmlparse.cc.

◆ hash_secret_salt

#define hash_secret_salt   (parser->m_hash_secret_salt)

Definition at line 674 of file xmlparse.cc.

◆ idAttIndex

#define idAttIndex   (parser->m_idAttIndex)

Definition at line 656 of file xmlparse.cc.

◆ inheritedBindings

#define inheritedBindings   (parser->m_inheritedBindings)

Definition at line 651 of file xmlparse.cc.

◆ INIT_ATTS_SIZE

#define INIT_ATTS_SIZE   16

Definition at line 143 of file xmlparse.cc.

◆ INIT_ATTS_VERSION

#define INIT_ATTS_VERSION   0xFFFFFFFF

Definition at line 144 of file xmlparse.cc.

◆ INIT_BLOCK_SIZE

#define INIT_BLOCK_SIZE   1024

Definition at line 145 of file xmlparse.cc.

◆ INIT_BUFFER_SIZE

#define INIT_BUFFER_SIZE   1024

Definition at line 146 of file xmlparse.cc.

◆ INIT_DATA_BUF_SIZE

#define INIT_DATA_BUF_SIZE   1024

Definition at line 142 of file xmlparse.cc.

◆ INIT_POWER

#define INIT_POWER   6

Definition at line 5955 of file xmlparse.cc.

◆ INIT_SCAFFOLD_ELEMENTS

#define INIT_SCAFFOLD_ELEMENTS   32

Definition at line 221 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 141 of file xmlparse.cc.

◆ initEncoding

#define initEncoding   (parser->m_initEncoding)

Definition at line 606 of file xmlparse.cc.

◆ internalEncoding

#define internalEncoding   (parser->m_internalEncoding)

Definition at line 607 of file xmlparse.cc.

◆ internalEntityRefHandler

#define internalEntityRefHandler    (parser->m_internalEntityRefHandler)

Definition at line 597 of file xmlparse.cc.

◆ MALLOC

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

Definition at line 568 of file xmlparse.cc.

◆ MUST_CONVERT

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

Definition at line 49 of file xmlparse.cc.

◆ namespaceSeparator

#define namespaceSeparator   (parser->m_namespaceSeparator)

Definition at line 665 of file xmlparse.cc.

◆ notationDeclHandler

#define notationDeclHandler   (parser->m_notationDeclHandler)

Definition at line 588 of file xmlparse.cc.

◆ notStandaloneHandler

#define notStandaloneHandler   (parser->m_notStandaloneHandler)

Definition at line 592 of file xmlparse.cc.

◆ ns

#define ns   (parser->m_ns)

Definition at line 614 of file xmlparse.cc.

◆ ns_triplets

#define ns_triplets   (parser->m_ns_triplets)

Definition at line 615 of file xmlparse.cc.

◆ nsAtts

#define nsAtts   (parser->m_nsAtts)

Definition at line 657 of file xmlparse.cc.

◆ nsAttsPower

#define nsAttsPower   (parser->m_nsAttsPower)

Definition at line 659 of file xmlparse.cc.

◆ nsAttsVersion

#define nsAttsVersion   (parser->m_nsAttsVersion)

Definition at line 658 of file xmlparse.cc.

◆ nSpecifiedAtts

#define nSpecifiedAtts   (parser->m_nSpecifiedAtts)

Definition at line 655 of file xmlparse.cc.

◆ openInternalEntities

#define openInternalEntities   (parser->m_openInternalEntities)

Definition at line 623 of file xmlparse.cc.

◆ parentParser

#define parentParser   (parser->m_parentParser)

Definition at line 666 of file xmlparse.cc.

◆ parseEndByteIndex

#define parseEndByteIndex   (parser->m_parseEndByteIndex)

Definition at line 631 of file xmlparse.cc.

◆ parseEndPtr

#define parseEndPtr   (parser->m_parseEndPtr)

Definition at line 632 of file xmlparse.cc.

◆ poolAppendChar

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

Definition at line 460 of file xmlparse.cc.

◆ poolChop

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

Definition at line 456 of file xmlparse.cc.

◆ poolDiscard

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

Definition at line 458 of file xmlparse.cc.

◆ poolEnd

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

Definition at line 454 of file xmlparse.cc.

◆ poolFinish

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

Definition at line 459 of file xmlparse.cc.

◆ poolLastChar

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

Definition at line 457 of file xmlparse.cc.

◆ poolLength

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

Definition at line 455 of file xmlparse.cc.

◆ poolStart

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

Definition at line 453 of file xmlparse.cc.

◆ position

#define position   (parser->m_position)

Definition at line 622 of file xmlparse.cc.

◆ positionPtr

#define positionPtr   (parser->m_positionPtr)

Definition at line 621 of file xmlparse.cc.

◆ PROBE_STEP

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

Definition at line 133 of file xmlparse.cc.

◆ processingInstructionHandler

#define processingInstructionHandler    (parser->m_processingInstructionHandler)

Definition at line 577 of file xmlparse.cc.

◆ processor

#define processor   (parser->m_processor)

Definition at line 617 of file xmlparse.cc.

◆ prologState

#define prologState   (parser->m_prologState)

Definition at line 616 of file xmlparse.cc.

◆ protocolEncodingName

#define protocolEncodingName   (parser->m_protocolEncodingName)

Definition at line 613 of file xmlparse.cc.

◆ ps_finalBuffer

#define ps_finalBuffer   (parser->m_parsingStatus.finalBuffer)

Definition at line 668 of file xmlparse.cc.

◆ ps_parsing

#define ps_parsing   (parser->m_parsingStatus.parsing)

Definition at line 667 of file xmlparse.cc.

◆ REALLOC

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

Definition at line 569 of file xmlparse.cc.

◆ ROUND_UP

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

Definition at line 82 of file xmlparse.cc.

◆ SECOND_HASH

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

Definition at line 131 of file xmlparse.cc.

◆ skippedEntityHandler

#define skippedEntityHandler   (parser->m_skippedEntityHandler)

Definition at line 599 of file xmlparse.cc.

◆ startCdataSectionHandler

#define startCdataSectionHandler    (parser->m_startCdataSectionHandler)

Definition at line 580 of file xmlparse.cc.

◆ startDoctypeDeclHandler

#define startDoctypeDeclHandler   (parser->m_startDoctypeDeclHandler)

Definition at line 584 of file xmlparse.cc.

◆ startElementHandler

#define startElementHandler   (parser->m_startElementHandler)

Definition at line 574 of file xmlparse.cc.

◆ startNamespaceDeclHandler

#define startNamespaceDeclHandler    (parser->m_startNamespaceDeclHandler)

Definition at line 589 of file xmlparse.cc.

◆ tagLevel

#define tagLevel   (parser->m_tagLevel)

Definition at line 627 of file xmlparse.cc.

◆ tagStack

#define tagStack   (parser->m_tagStack)

Definition at line 652 of file xmlparse.cc.

◆ temp2Pool

#define temp2Pool   (parser->m_temp2Pool)

Definition at line 662 of file xmlparse.cc.

◆ tempPool

#define tempPool   (parser->m_tempPool)

Definition at line 661 of file xmlparse.cc.

◆ unknownEncodingData

#define unknownEncodingData   (parser->m_unknownEncodingData)

Definition at line 609 of file xmlparse.cc.

◆ unknownEncodingHandler

#define unknownEncodingHandler   (parser->m_unknownEncodingHandler)

Definition at line 600 of file xmlparse.cc.

◆ unknownEncodingHandlerData

#define unknownEncodingHandlerData    (parser->m_unknownEncodingHandlerData)

Definition at line 610 of file xmlparse.cc.

◆ unknownEncodingMem

#define unknownEncodingMem   (parser->m_unknownEncodingMem)

Definition at line 608 of file xmlparse.cc.

◆ unknownEncodingRelease

#define unknownEncodingRelease   (parser->m_unknownEncodingRelease)

Definition at line 612 of file xmlparse.cc.

◆ unparsedEntityDeclHandler

#define unparsedEntityDeclHandler    (parser->m_unparsedEntityDeclHandler)

Definition at line 586 of file xmlparse.cc.

◆ userData

#define userData   (parser->m_userData)

Definition at line 572 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 17 of file xmlparse.cc.

◆ XML_ENCODE_MAX

#define XML_ENCODE_MAX   XML_UTF8_ENCODE_MAX

Definition at line 44 of file xmlparse.cc.

◆ XML_L

#define XML_L (   x)    x

Definition at line 77 of file xmlparse.cc.

◆ XML_T

#define XML_T (   x)    x

Definition at line 76 of file xmlparse.cc.

◆ XmlConvert

#define XmlConvert   XmlUtf8Convert

Definition at line 45 of file xmlparse.cc.

◆ xmlDeclHandler

#define xmlDeclHandler   (parser->m_xmlDeclHandler)

Definition at line 604 of file xmlparse.cc.

◆ XmlEncode

#define XmlEncode   XmlUtf8Encode

Definition at line 48 of file xmlparse.cc.

◆ XmlGetInternalEncoding

#define XmlGetInternalEncoding   XmlGetUtf8InternalEncoding

Definition at line 46 of file xmlparse.cc.

◆ XmlGetInternalEncodingNS [1/2]

#define XmlGetInternalEncodingNS   XmlGetUtf8InternalEncodingNS

Definition at line 59 of file xmlparse.cc.

◆ XmlGetInternalEncodingNS [2/2]

#define XmlGetInternalEncodingNS   XmlGetInternalEncoding

Definition at line 59 of file xmlparse.cc.

◆ XmlInitEncodingNS

#define XmlInitEncodingNS   XmlInitEncoding

Definition at line 56 of file xmlparse.cc.

◆ XmlInitUnknownEncodingNS

#define XmlInitUnknownEncodingNS   XmlInitUnknownEncoding

Definition at line 57 of file xmlparse.cc.

◆ XmlParseXmlDeclNS

#define XmlParseXmlDeclNS   XmlParseXmlDecl

Definition at line 60 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 50 of file xmlparse.cc.

◆ KEY

typedef const XML_Char* KEY

Definition at line 97 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 1920 of file xmlparse.cc.

1921{
1922 if (defaultHandler) {
1924 reportDefault(parser,
1926 openInternalEntities->internalEventPtr,
1927 openInternalEntities->internalEventEndPtr);
1928 else
1929 reportDefault(parser, encoding, eventPtr, eventEndPtr);
1930 }
1931}
#define eventPtr
Definition: xmlparse.cc:619
#define internalEncoding
Definition: xmlparse.cc:607
#define openInternalEntities
Definition: xmlparse.cc:623
#define defaultHandler
Definition: xmlparse.cc:583
#define eventEndPtr
Definition: xmlparse.cc:620

◆ XML_ErrorString()

const XML_LChar *XMLCALL XML_ErrorString ( enum XML_Error  code)

Definition at line 1934 of file xmlparse.cc.

1935{
1936 static const XML_LChar* const message[] = {
1937 0,
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")
1978 };
1979 if (code > 0 && code < sizeof(message)/sizeof(message[0]))
1980 return message[code];
1981 return NULL;
1982}
char XML_LChar
Definition: inftrees.h:24
#define XML_L(x)
Definition: xmlparse.cc:77

◆ XML_ExpatVersion()

const XML_LChar *XMLCALL XML_ExpatVersion ( void  )

Definition at line 1985 of file xmlparse.cc.

1985 {
1986
1987 /* V1 is used to string-ize the version number. However, it would
1988 string-ize the actual version macro *names* unless we get them
1989 substituted before being passed to V1. CPP is defined to expand
1990 a macro, then rescan for more expansions. Thus, we use V2 to expand
1991 the version macros, then CPP will expand the resulting V1() macro
1992 with the correct numerals. */
1993 /* ### I'm assuming cpp is portable in this respect... */
1994
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)
1997
1999
2000#undef V1
2001#undef V2
2002}
#define XML_MAJOR_VERSION
Definition: expat.h:1039
#define XML_MINOR_VERSION
Definition: expat.h:1040
#define XML_MICRO_VERSION
Definition: expat.h:1041
#define V2(a, b, c)

◆ XML_ExpatVersionInfo()

XML_Expat_Version XMLCALL XML_ExpatVersionInfo ( void  )

Definition at line 2005 of file xmlparse.cc.

2006{
2007 XML_Expat_Version version;
2008
2009 version.major = XML_MAJOR_VERSION;
2010 version.minor = XML_MINOR_VERSION;
2011 version.micro = XML_MICRO_VERSION;
2012
2013 return version;
2014}

◆ XML_ExternalEntityParserCreate()

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

Definition at line 986 of file xmlparse.cc.

989{
990 XML_Parser parser = oldParser;
991 DTD *newDtd = NULL;
992 DTD *oldDtd = _dtd;
993 XML_StartElementHandler oldStartElementHandler = startElementHandler;
994 XML_EndElementHandler oldEndElementHandler = endElementHandler;
995 XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
996 XML_ProcessingInstructionHandler oldProcessingInstructionHandler
998 XML_CommentHandler oldCommentHandler = commentHandler;
999 XML_StartCdataSectionHandler oldStartCdataSectionHandler
1001 XML_EndCdataSectionHandler oldEndCdataSectionHandler
1003 XML_DefaultHandler oldDefaultHandler = defaultHandler;
1004 XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
1006 XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
1007 XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
1009 XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
1011 XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
1012 XML_ExternalEntityRefHandler oldExternalEntityRefHandler
1014 XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
1015 XML_UnknownEncodingHandler oldUnknownEncodingHandler
1017 XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
1018 XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
1019 XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
1020 XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
1021 ELEMENT_TYPE * oldDeclElementType = declElementType;
1022
1023 void *oldUserData = userData;
1024 void *oldHandlerArg = handlerArg;
1025 XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
1026 XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
1027#ifdef XML_DTD
1028 enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
1029 int oldInEntityValue = prologState.inEntityValue;
1030#endif
1031 XML_Bool oldns_triplets = ns_triplets;
1032 /* Note that the new parser shares the same hash secret as the old
1033 parser, so that dtdCopy and copyEntityTable can lookup values
1034 from hash tables associated with either parser without us having
1035 to worry which hash secrets each table has.
1036 */
1037 unsigned long oldhash_secret_salt = hash_secret_salt;
1038
1039#ifdef XML_DTD
1040 if (!context)
1041 newDtd = oldDtd;
1042#endif /* XML_DTD */
1043
1044 /* Note that the magical uses of the pre-processor to make field
1045 access look more like C++ require that `parser' be overwritten
1046 here. This makes this function more painful to follow than it
1047 would be otherwise.
1048 */
1049 if (ns) {
1050 XML_Char tmp[2];
1051 *tmp = namespaceSeparator;
1052 parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
1053 }
1054 else {
1055 parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
1056 }
1057
1058 if (!parser)
1059 return NULL;
1060
1061 startElementHandler = oldStartElementHandler;
1062 endElementHandler = oldEndElementHandler;
1063 characterDataHandler = oldCharacterDataHandler;
1064 processingInstructionHandler = oldProcessingInstructionHandler;
1065 commentHandler = oldCommentHandler;
1066 startCdataSectionHandler = oldStartCdataSectionHandler;
1067 endCdataSectionHandler = oldEndCdataSectionHandler;
1068 defaultHandler = oldDefaultHandler;
1069 unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
1070 notationDeclHandler = oldNotationDeclHandler;
1071 startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
1072 endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
1073 notStandaloneHandler = oldNotStandaloneHandler;
1074 externalEntityRefHandler = oldExternalEntityRefHandler;
1075 skippedEntityHandler = oldSkippedEntityHandler;
1076 unknownEncodingHandler = oldUnknownEncodingHandler;
1077 elementDeclHandler = oldElementDeclHandler;
1078 attlistDeclHandler = oldAttlistDeclHandler;
1079 entityDeclHandler = oldEntityDeclHandler;
1080 xmlDeclHandler = oldXmlDeclHandler;
1081 declElementType = oldDeclElementType;
1082 userData = oldUserData;
1083 if (oldUserData == oldHandlerArg)
1085 else
1086 handlerArg = parser;
1087 if (oldExternalEntityRefHandlerArg != oldParser)
1088 externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
1089 defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
1090 ns_triplets = oldns_triplets;
1091 hash_secret_salt = oldhash_secret_salt;
1092 parentParser = oldParser;
1093#ifdef XML_DTD
1094 paramEntityParsing = oldParamEntityParsing;
1095 prologState.inEntityValue = oldInEntityValue;
1096 if (context) {
1097#endif /* XML_DTD */
1098 if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
1099 || !setContext(parser, context)) {
1100 XML_ParserFree(parser);
1101 return NULL;
1102 }
1103 processor = externalEntityInitProcessor;
1104#ifdef XML_DTD
1105 }
1106 else {
1107 /* The DTD instance referenced by _dtd is shared between the document's
1108 root parser and external PE parsers, therefore one does not need to
1109 call setContext. In addition, one also *must* not call setContext,
1110 because this would overwrite existing prefix->binding pointers in
1111 _dtd with ones that get destroyed with the external PE parser.
1112 This would leave those prefixes with dangling pointers.
1113 */
1114 isParamEntity = XML_TRUE;
1115 XmlPrologStateInitExternalEntity(&prologState);
1116 processor = externalParEntInitProcessor;
1117 }
1118#endif /* XML_DTD */
1119 return parser;
1120}
void(XMLCALL * XML_CommentHandler)(void *userData, const XML_Char *data)
Definition: expat.h:272
void(XMLCALL * XML_EndElementHandler)(void *userData, const XML_Char *name)
Definition: expat.h:256
void(XMLCALL * XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix)
Definition: expat.h:383
void(XMLCALL * XML_SkippedEntityHandler)(void *userData, const XML_Char *entityName, int is_parameter_entity)
Definition: expat.h:449
int(XMLCALL * XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
Definition: expat.h:432
void(XMLCALL * XML_EndCdataSectionHandler)(void *userData)
Definition: expat.h:276
int(XMLCALL * XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info)
Definition: expat.h:528
void(XMLCALL * XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts)
Definition: expat.h:252
void(XMLCALL * XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data)
Definition: expat.h:266
void(XMLCALL * XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri)
Definition: expat.h:378
unsigned char XML_Bool
Definition: expat.h:28
void(XMLCALL * XML_XmlDeclHandler)(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
Definition: expat.h:186
void(XMLCALL * XML_StartCdataSectionHandler)(void *userData)
Definition: expat.h:275
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)
Definition: expat.h:353
XML_ParamEntityParsing
Definition: expat.h:876
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)
Definition: expat.h:166
int(XMLCALL * XML_NotStandaloneHandler)(void *userData)
Definition: expat.h:396
#define XML_TRUE
Definition: expat.h:29
void(XMLCALL * XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len)
Definition: expat.h:261
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)
Definition: expat.h:329
void(XMLCALL * XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
Definition: expat.h:365
void(XMLCALL * XML_DefaultHandler)(void *userData, const XML_Char *s, int len)
Definition: expat.h:291
void(XMLCALL * XML_ElementDeclHandler)(void *userData, const XML_Char *name, XML_Content *model)
Definition: expat.h:150
char XML_Char
Definition: xmlparse.cc:268
const XML_Memory_Handling_Suite m_mem
Definition: xmlparse.cc:471
#define externalEntityRefHandlerArg
Definition: xmlparse.cc:595
#define defaultExpandInternalEntities
Definition: xmlparse.cc:625
#define endCdataSectionHandler
Definition: xmlparse.cc:582
#define processingInstructionHandler
Definition: xmlparse.cc:577
#define skippedEntityHandler
Definition: xmlparse.cc:599
#define elementDeclHandler
Definition: xmlparse.cc:601
#define declElementType
Definition: xmlparse.cc:645
#define notationDeclHandler
Definition: xmlparse.cc:588
#define unknownEncodingHandler
Definition: xmlparse.cc:600
#define commentHandler
Definition: xmlparse.cc:579
#define userData
Definition: xmlparse.cc:572
#define xmlDeclHandler
Definition: xmlparse.cc:604
#define startCdataSectionHandler
Definition: xmlparse.cc:580
#define externalEntityRefHandler
Definition: xmlparse.cc:593
#define endElementHandler
Definition: xmlparse.cc:575
#define ns_triplets
Definition: xmlparse.cc:615
#define namespaceSeparator
Definition: xmlparse.cc:665
#define startNamespaceDeclHandler
Definition: xmlparse.cc:589
#define startElementHandler
Definition: xmlparse.cc:574
#define parentParser
Definition: xmlparse.cc:666
#define handlerArg
Definition: xmlparse.cc:573
#define entityDeclHandler
Definition: xmlparse.cc:603
#define notStandaloneHandler
Definition: xmlparse.cc:592
#define attlistDeclHandler
Definition: xmlparse.cc:602
#define ns
Definition: xmlparse.cc:614
#define _dtd
Definition: xmlparse.cc:636
#define endNamespaceDeclHandler
Definition: xmlparse.cc:591
#define unparsedEntityDeclHandler
Definition: xmlparse.cc:586
#define hash_secret_salt
Definition: xmlparse.cc:674
#define processor
Definition: xmlparse.cc:617
#define characterDataHandler
Definition: xmlparse.cc:576
#define prologState
Definition: xmlparse.cc:616
void XMLCALL XML_ParserFree(XML_Parser parser)
Definition: xmlparse.cc:1136

◆ XML_FreeContentModel()

void XMLCALL XML_FreeContentModel ( XML_Parser  parser,
XML_Content model 
)

Definition at line 1896 of file xmlparse.cc.

1897{
1898 FREE(model);
1899}
#define FREE(p)
Definition: xmlparse.cc:570

◆ XML_GetBase()

const XML_Char *XMLCALL XML_GetBase ( XML_Parser  parser)

Definition at line 1253 of file xmlparse.cc.

1254{
1255 return curBase;
1256}
#define curBase
Definition: xmlparse.cc:637

◆ XML_GetBuffer()

void *XMLCALL XML_GetBuffer ( XML_Parser  parser,
int  len 
)

Definition at line 1685 of file xmlparse.cc.

1686{
1687 switch (ps_parsing) {
1688 case XML_SUSPENDED:
1690 return NULL;
1691 case XML_FINISHED:
1693 return NULL;
1694 default: ;
1695 }
1696
1697 if (len > bufferLim - bufferEnd) {
1698 /* FIXME avoid integer overflow */
1699 int neededSize = len + (int)(bufferEnd - bufferPtr);
1700#ifdef XML_CONTEXT_BYTES
1701 int keep = (int)(bufferPtr - buffer);
1702
1703 if (keep > XML_CONTEXT_BYTES)
1704 keep = XML_CONTEXT_BYTES;
1705 neededSize += keep;
1706#endif /* defined XML_CONTEXT_BYTES */
1707 if (neededSize <= bufferLim - buffer) {
1708#ifdef XML_CONTEXT_BYTES
1709 if (keep < bufferPtr - buffer) {
1710 int offset = (int)(bufferPtr - buffer) - keep;
1711 memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
1712 bufferEnd -= offset;
1713 bufferPtr -= offset;
1714 }
1715#else
1716 memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
1718 bufferPtr = buffer;
1719#endif /* not defined XML_CONTEXT_BYTES */
1720 }
1721 else {
1722 char *newBuf;
1723 int bufferSize = (int)(bufferLim - bufferPtr);
1724 if (bufferSize == 0)
1725 bufferSize = INIT_BUFFER_SIZE;
1726 do {
1727 bufferSize *= 2;
1728 } while (bufferSize < neededSize);
1729 newBuf = (char *)MALLOC(bufferSize);
1730 if (newBuf == 0) {
1732 return NULL;
1733 }
1734 bufferLim = newBuf + bufferSize;
1735#ifdef XML_CONTEXT_BYTES
1736 if (bufferPtr) {
1737 int keep = (int)(bufferPtr - buffer);
1738 if (keep > XML_CONTEXT_BYTES)
1739 keep = XML_CONTEXT_BYTES;
1740 memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
1741 FREE(buffer);
1742 buffer = newBuf;
1743 bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
1744 bufferPtr = buffer + keep;
1745 }
1746 else {
1747 bufferEnd = newBuf + (bufferEnd - bufferPtr);
1748 bufferPtr = buffer = newBuf;
1749 }
1750#else
1751 if (bufferPtr) {
1752 memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
1753 FREE(buffer);
1754 }
1755 bufferEnd = newBuf + (bufferEnd - bufferPtr);
1756 bufferPtr = buffer = newBuf;
1757#endif /* not defined XML_CONTEXT_BYTES */
1758 }
1759 eventPtr = eventEndPtr = NULL;
1760 positionPtr = NULL;
1761 }
1762 return bufferEnd;
1763}
#define XML_CONTEXT_BYTES
Definition: amigaconfig.h:24
@ XML_SUSPENDED
Definition: expat.h:839
@ XML_FINISHED
Definition: expat.h:838
@ XML_ERROR_SUSPENDED
Definition: expat.h:90
@ XML_ERROR_NO_MEMORY
Definition: expat.h:56
@ XML_ERROR_FINISHED
Definition: expat.h:93
#define INIT_BUFFER_SIZE
Definition: xmlparse.cc:146
#define bufferEnd
Definition: xmlparse.cc:630
#define bufferLim
Definition: xmlparse.cc:633
#define ps_parsing
Definition: xmlparse.cc:667
#define buffer
Definition: xmlparse.cc:628
#define MALLOC(s)
Definition: xmlparse.cc:568
#define errorCode
Definition: xmlparse.cc:618
#define positionPtr
Definition: xmlparse.cc:621
#define bufferPtr
Definition: xmlparse.cc:629

Referenced by XML_Parse().

◆ XML_GetCurrentByteCount()

int XMLCALL XML_GetCurrentByteCount ( XML_Parser  parser)

Definition at line 1855 of file xmlparse.cc.

1856{
1857 if (eventEndPtr && eventPtr)
1858 return (int)(eventEndPtr - eventPtr);
1859 return 0;
1860}

◆ XML_GetCurrentByteIndex()

XML_Index XMLCALL XML_GetCurrentByteIndex ( XML_Parser  parser)

Definition at line 1847 of file xmlparse.cc.

1848{
1849 if (eventPtr)
1851 return -1;
1852}
#define parseEndPtr
Definition: xmlparse.cc:632
#define parseEndByteIndex
Definition: xmlparse.cc:631

◆ XML_GetCurrentColumnNumber()

XML_Size XMLCALL XML_GetCurrentColumnNumber ( XML_Parser  parser)

Definition at line 1886 of file xmlparse.cc.

1887{
1888 if (eventPtr && eventPtr >= positionPtr) {
1891 }
1892 return position.columnNumber;
1893}
XML_Size columnNumber
Definition: xmltok.h:113
#define XmlUpdatePosition(enc, ptr, end, pos)
Definition: xmltok.h:247

◆ XML_GetCurrentLineNumber()

XML_Size XMLCALL XML_GetCurrentLineNumber ( XML_Parser  parser)

Definition at line 1876 of file xmlparse.cc.

1877{
1878 if (eventPtr && eventPtr >= positionPtr) {
1881 }
1882 return position.lineNumber + 1;
1883}
XML_Size lineNumber
Definition: xmltok.h:112

◆ XML_GetErrorCode()

enum XML_Error XMLCALL XML_GetErrorCode ( XML_Parser  parser)

Definition at line 1841 of file xmlparse.cc.

1842{
1843 return errorCode;
1844}

◆ XML_GetFeatureList()

const XML_Feature *XMLCALL XML_GetFeatureList ( void  )

Definition at line 2017 of file xmlparse.cc.

2018{
2019 static const XML_Feature features[] = {
2020 {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)"),
2021 sizeof(XML_Char)},
2022 {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
2023 sizeof(XML_LChar)},
2024#ifdef XML_UNICODE
2025 {XML_FEATURE_UNICODE, XML_L("XML_UNICODE"), 0},
2026#endif
2027#ifdef XML_UNICODE_WCHAR_T
2028 {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T"), 0},
2029#endif
2030#ifdef XML_DTD
2031 {XML_FEATURE_DTD, XML_L("XML_DTD"), 0},
2032#endif
2033#ifdef XML_CONTEXT_BYTES
2034 {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"),
2036#endif
2037#ifdef XML_MIN_SIZE
2038 {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE"), 0},
2039#endif
2040#ifdef XML_NS
2041 {XML_FEATURE_NS, XML_L("XML_NS"), 0},
2042#endif
2043#ifdef XML_LARGE_SIZE
2044 {XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
2045#endif
2046#ifdef XML_ATTR_INFO
2047 {XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
2048#endif
2049 {XML_FEATURE_END, NULL, 0}
2050 };
2051
2052 return features;
2053}
@ XML_FEATURE_DTD
Definition: expat.h:1013
@ XML_FEATURE_SIZEOF_XML_LCHAR
Definition: expat.h:1017
@ XML_FEATURE_NS
Definition: expat.h:1018
@ XML_FEATURE_UNICODE
Definition: expat.h:1011
@ XML_FEATURE_SIZEOF_XML_CHAR
Definition: expat.h:1016
@ XML_FEATURE_MIN_SIZE
Definition: expat.h:1015
@ XML_FEATURE_END
Definition: expat.h:1010
@ XML_FEATURE_UNICODE_WCHAR_T
Definition: expat.h:1012
@ XML_FEATURE_CONTEXT_BYTES
Definition: expat.h:1014
@ XML_FEATURE_LARGE_SIZE
Definition: expat.h:1019
@ XML_FEATURE_ATTR_INFO
Definition: expat.h:1020
#define XML_Char

◆ XML_GetIdAttributeIndex()

int XMLCALL XML_GetIdAttributeIndex ( XML_Parser  parser)

Definition at line 1265 of file xmlparse.cc.

1266{
1267 return idAttIndex;
1268}
#define idAttIndex
Definition: xmlparse.cc:656

◆ XML_GetInputContext()

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

Definition at line 1863 of file xmlparse.cc.

1864{
1865#ifdef XML_CONTEXT_BYTES
1866 if (eventPtr && buffer) {
1867 *offset = (int)(eventPtr - buffer);
1868 *size = (int)(bufferEnd - buffer);
1869 return buffer;
1870 }
1871#endif /* defined XML_CONTEXT_BYTES */
1872 return (char *) 0;
1873}

◆ XML_GetParsingStatus()

void XMLCALL XML_GetParsingStatus ( XML_Parser  parser,
XML_ParsingStatus status 
)

Definition at line 1834 of file xmlparse.cc.

1835{
1836 assert(status != NULL);
1837 *status = parser->m_parsingStatus;
1838}
XML_ParsingStatus m_parsingStatus
Definition: xmlparse.cc:559

◆ XML_GetSpecifiedAttributeCount()

int XMLCALL XML_GetSpecifiedAttributeCount ( XML_Parser  parser)

Definition at line 1259 of file xmlparse.cc.

1260{
1261 return nSpecifiedAtts;
1262}
#define nSpecifiedAtts
Definition: xmlparse.cc:655

◆ XML_MemFree()

void XMLCALL XML_MemFree ( XML_Parser  parser,
void *  ptr 
)

Definition at line 1914 of file xmlparse.cc.

1915{
1916 FREE(ptr);
1917}

◆ XML_MemMalloc()

void *XMLCALL XML_MemMalloc ( XML_Parser  parser,
size_t  size 
)

Definition at line 1902 of file xmlparse.cc.

1903{
1904 return MALLOC(size);
1905}

◆ XML_MemRealloc()

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

Definition at line 1908 of file xmlparse.cc.

1909{
1910 return REALLOC(ptr, size);
1911}
#define REALLOC(p, s)
Definition: xmlparse.cc:569

◆ XML_Parse()

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

Definition at line 1506 of file xmlparse.cc.

1507{
1508 switch (ps_parsing) {
1509 case XML_SUSPENDED:
1511 return XML_STATUS_ERROR;
1512 case XML_FINISHED:
1514 return XML_STATUS_ERROR;
1515 case XML_INITIALIZED:
1516 if (parentParser == NULL && !startParsing(parser)) {
1518 return XML_STATUS_ERROR;
1519 }
1520 default:
1522 }
1523
1524 if (len == 0) {
1525 ps_finalBuffer = (XML_Bool)isFinal;
1526 if (!isFinal)
1527 return XML_STATUS_OK;
1530
1531 /* If data are left over from last buffer, and we now know that these
1532 data are the final chunk of input, then we have to check them again
1533 to detect errors based on that fact.
1534 */
1536
1537 if (errorCode == XML_ERROR_NONE) {
1538 switch (ps_parsing) {
1539 case XML_SUSPENDED:
1542 return XML_STATUS_SUSPENDED;
1543 case XML_INITIALIZED:
1544 case XML_PARSING:
1546 /* fall through */
1547 default:
1548 return XML_STATUS_OK;
1549 }
1550 }
1552 processor = errorProcessor;
1553 return XML_STATUS_ERROR;
1554 }
1555#ifndef XML_CONTEXT_BYTES
1556 else if (bufferPtr == bufferEnd) {
1557 const char *end;
1558 int nLeftOver;
1559 enum XML_Error result;
1560 parseEndByteIndex += len;
1561 positionPtr = s;
1562 ps_finalBuffer = (XML_Bool)isFinal;
1563
1564 errorCode = processor(parser, s, parseEndPtr = s + len, &end);
1565
1566 if (errorCode != XML_ERROR_NONE) {
1568 processor = errorProcessor;
1569 return XML_STATUS_ERROR;
1570 }
1571 else {
1572 switch (ps_parsing) {
1573 case XML_SUSPENDED:
1574 result = XML_STATUS_SUSPENDED;
1575 break;
1576 case XML_INITIALIZED:
1577 case XML_PARSING:
1578 if (isFinal) {
1580 return XML_STATUS_OK;
1581 }
1582 /* fall through */
1583 default:
1584 result = XML_STATUS_OK;
1585 }
1586 }
1587
1589 nLeftOver = s + len - end;
1590 if (nLeftOver) {
1591 if (buffer == NULL || nLeftOver > bufferLim - buffer) {
1592 /* FIXME avoid integer overflow */
1593 char *temp;
1594 temp = (buffer == NULL
1595 ? (char *)MALLOC(len * 2)
1596 : (char *)REALLOC(buffer, len * 2));
1597 if (temp == NULL) {
1599 eventPtr = eventEndPtr = NULL;
1600 processor = errorProcessor;
1601 return XML_STATUS_ERROR;
1602 }
1603 buffer = temp;
1604 bufferLim = buffer + len * 2;
1605 }
1606 memcpy(buffer, end, nLeftOver);
1607 }
1608 bufferPtr = buffer;
1609 bufferEnd = buffer + nLeftOver;
1614 return result;
1615 }
1616#endif /* not defined XML_CONTEXT_BYTES */
1617 else {
1618 void *buff = XML_GetBuffer(parser, len);
1619 if (buff == NULL)
1620 return XML_STATUS_ERROR;
1621 else {
1622 memcpy(buff, s, len);
1623 return XML_ParseBuffer(parser, len, isFinal);
1624 }
1625 }
1626}
@ XML_PARSING
Definition: expat.h:837
@ XML_INITIALIZED
Definition: expat.h:836
#define XML_STATUS_ERROR
Definition: expat.h:47
XML_Error
Definition: expat.h:54
@ XML_ERROR_NONE
Definition: expat.h:55
#define XML_STATUS_SUSPENDED
#define XML_STATUS_OK
Definition: expat.h:49
#define ps_finalBuffer
Definition: xmlparse.cc:668
void *XMLCALL XML_GetBuffer(XML_Parser parser, int len)
Definition: xmlparse.cc:1685
enum XML_Status XMLCALL XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
Definition: xmlparse.cc:1629

◆ XML_ParseBuffer()

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

Definition at line 1629 of file xmlparse.cc.

1630{
1631 const char *start;
1632 enum XML_Status result = XML_STATUS_OK;
1633
1634 switch (ps_parsing) {
1635 case XML_SUSPENDED:
1637 return XML_STATUS_ERROR;
1638 case XML_FINISHED:
1640 return XML_STATUS_ERROR;
1641 case XML_INITIALIZED:
1642 if (parentParser == NULL && !startParsing(parser)) {
1644 return XML_STATUS_ERROR;
1645 }
1646 default:
1648 }
1649
1650 start = bufferPtr;
1651 positionPtr = start;
1652 bufferEnd += len;
1654 parseEndByteIndex += len;
1655 ps_finalBuffer = (XML_Bool)isFinal;
1656
1657 errorCode = processor(parser, start, parseEndPtr, &bufferPtr);
1658
1659 if (errorCode != XML_ERROR_NONE) {
1661 processor = errorProcessor;
1662 return XML_STATUS_ERROR;
1663 }
1664 else {
1665 switch (ps_parsing) {
1666 case XML_SUSPENDED:
1667 result = XML_STATUS_SUSPENDED;
1668 break;
1669 case XML_INITIALIZED:
1670 case XML_PARSING:
1671 if (isFinal) {
1673 return result;
1674 }
1675 default: ; /* should not happen */
1676 }
1677 }
1678
1681 return result;
1682}
XML_Status
Definition: expat.h:45

Referenced by XML_Parse().

◆ XML_ParserCreate()

XML_Parser XMLCALL XML_ParserCreate ( const XML_Char encodingName)

Definition at line 677 of file xmlparse.cc.

678{
679 return XML_ParserCreate_MM(encodingName, NULL, NULL);
680}
XML_Parser XMLCALL XML_ParserCreate_MM(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep)
Definition: xmlparse.cc:723

◆ 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 723 of file xmlparse.cc.

726{
727 return parserCreate(encodingName, memsuite, nameSep, NULL);
728}

Referenced by XML_ParserCreate(), and XML_ParserCreateNS().

◆ XML_ParserCreateNS()

XML_Parser XMLCALL XML_ParserCreateNS ( const XML_Char encodingName,
XML_Char  nsSep 
)

Definition at line 683 of file xmlparse.cc.

684{
685 XML_Char tmp[2];
686 *tmp = nsSep;
687 return XML_ParserCreate_MM(encodingName, NULL, tmp);
688}

◆ XML_ParserFree()

void XMLCALL XML_ParserFree ( XML_Parser  parser)

Definition at line 1136 of file xmlparse.cc.

1137{
1138 TAG *tagList;
1139 OPEN_INTERNAL_ENTITY *entityList;
1140 if (parser == NULL)
1141 return;
1142 /* free tagStack and freeTagList */
1143 tagList = tagStack;
1144 for (;;) {
1145 TAG *p;
1146 if (tagList == NULL) {
1147 if (freeTagList == NULL)
1148 break;
1149 tagList = freeTagList;
1150 freeTagList = NULL;
1151 }
1152 p = tagList;
1153 tagList = tagList->parent;
1154 FREE(p->buf);
1155 destroyBindings(p->bindings, parser);
1156 FREE(p);
1157 }
1158 /* free openInternalEntities and freeInternalEntities */
1159 entityList = openInternalEntities;
1160 for (;;) {
1161 OPEN_INTERNAL_ENTITY *openEntity;
1162 if (entityList == NULL) {
1163 if (freeInternalEntities == NULL)
1164 break;
1165 entityList = freeInternalEntities;
1166 freeInternalEntities = NULL;
1167 }
1168 openEntity = entityList;
1169 entityList = entityList->next;
1170 FREE(openEntity);
1171 }
1172
1173 destroyBindings(freeBindingList, parser);
1174 destroyBindings(inheritedBindings, parser);
1175 poolDestroy(&tempPool);
1176 poolDestroy(&temp2Pool);
1177#ifdef XML_DTD
1178 /* external parameter entity parsers share the DTD structure
1179 parser->m_dtd with the root parser, so we must not destroy it
1180 */
1181 if (!isParamEntity && _dtd)
1182#else
1183 if (_dtd)
1184#endif /* XML_DTD */
1185 dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
1186 FREE((void *)atts);
1187#ifdef XML_ATTR_INFO
1188 FREE((void *)attInfo);
1189#endif
1191 FREE(buffer);
1192 FREE(dataBuf);
1193 FREE(nsAtts);
1197 FREE(parser);
1198}
struct open_internal_entity * next
Definition: xmlparse.cc:300
Definition: xmlparse.cc:187
struct tag * parent
Definition: xmlparse.cc:188
BINDING * bindings
Definition: xmlparse.cc:194
char * buf
Definition: xmlparse.cc:192
#define tagStack
Definition: xmlparse.cc:652
#define dataBuf
Definition: xmlparse.cc:634
#define groupConnector
Definition: xmlparse.cc:663
#define freeBindingList
Definition: xmlparse.cc:650
#define temp2Pool
Definition: xmlparse.cc:662
#define inheritedBindings
Definition: xmlparse.cc:651
#define tempPool
Definition: xmlparse.cc:661
#define nsAtts
Definition: xmlparse.cc:657
#define unknownEncodingRelease
Definition: xmlparse.cc:612
#define unknownEncodingMem
Definition: xmlparse.cc:608
#define atts
Definition: xmlparse.cc:653
#define unknownEncodingData
Definition: xmlparse.cc:609
#define freeInternalEntities
Definition: xmlparse.cc:624
#define freeTagList
Definition: xmlparse.cc:649
#define attInfo
Definition: xmlparse.cc:660

Referenced by XML_ExternalEntityParserCreate().

◆ XML_ParserReset()

XML_Bool XMLCALL XML_ParserReset ( XML_Parser  parser,
const XML_Char encodingName 
)

Definition at line 931 of file xmlparse.cc.

932{
933 TAG *tStk;
934 OPEN_INTERNAL_ENTITY *openEntityList;
935 if (parentParser)
936 return XML_FALSE;
937 /* move tagStack to freeTagList */
938 tStk = tagStack;
939 while (tStk) {
940 TAG *tag = tStk;
941 tStk = tStk->parent;
943 moveToFreeBindingList(parser, tag->bindings);
944 tag->bindings = NULL;
946 }
947 /* move openInternalEntities to freeInternalEntities */
948 openEntityList = openInternalEntities;
949 while (openEntityList) {
950 OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
951 openEntityList = openEntity->next;
952 openEntity->next = freeInternalEntities;
953 freeInternalEntities = openEntity;
954 }
955 moveToFreeBindingList(parser, inheritedBindings);
959 poolClear(&tempPool);
960 poolClear(&temp2Pool);
961 parserInit(parser, encodingName);
962 dtdReset(_dtd, &parser->m_mem);
963 return XML_TRUE;
964}
#define XML_FALSE
Definition: expat.h:30

◆ XML_ResumeParser()

enum XML_Status XMLCALL XML_ResumeParser ( XML_Parser  parser)

Definition at line 1796 of file xmlparse.cc.

1797{
1798 enum XML_Status result = XML_STATUS_OK;
1799
1800 if (ps_parsing != XML_SUSPENDED) {
1802 return XML_STATUS_ERROR;
1803 }
1805
1807
1808 if (errorCode != XML_ERROR_NONE) {
1810 processor = errorProcessor;
1811 return XML_STATUS_ERROR;
1812 }
1813 else {
1814 switch (ps_parsing) {
1815 case XML_SUSPENDED:
1816 result = XML_STATUS_SUSPENDED;
1817 break;
1818 case XML_INITIALIZED:
1819 case XML_PARSING:
1820 if (ps_finalBuffer) {
1822 return result;
1823 }
1824 default: ;
1825 }
1826 }
1827
1830 return result;
1831}
@ XML_ERROR_NOT_SUSPENDED
Definition: expat.h:91

◆ XML_SetAttlistDeclHandler()

void XMLCALL XML_SetAttlistDeclHandler ( XML_Parser  parser,
XML_AttlistDeclHandler  attdecl 
)

Definition at line 1460 of file xmlparse.cc.

1462{
1463 attlistDeclHandler = attdecl;
1464}

◆ XML_SetBase()

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

Definition at line 1239 of file xmlparse.cc.

1240{
1241 if (p) {
1242 p = poolCopyString(&_dtd->pool, p);
1243 if (!p)
1244 return XML_STATUS_ERROR;
1245 curBase = p;
1246 }
1247 else
1248 curBase = NULL;
1249 return XML_STATUS_OK;
1250}

◆ XML_SetCdataSectionHandler()

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

Definition at line 1321 of file xmlparse.cc.

1324{
1327}

◆ XML_SetCharacterDataHandler()

void XMLCALL XML_SetCharacterDataHandler ( XML_Parser  parser,
XML_CharacterDataHandler  handler 
)

Definition at line 1300 of file xmlparse.cc.

1302{
1303 characterDataHandler = handler;
1304}

◆ XML_SetCommentHandler()

void XMLCALL XML_SetCommentHandler ( XML_Parser  parser,
XML_CommentHandler  handler 
)

Definition at line 1314 of file xmlparse.cc.

1316{
1317 commentHandler = handler;
1318}

◆ XML_SetDefaultHandler()

void XMLCALL XML_SetDefaultHandler ( XML_Parser  parser,
XML_DefaultHandler  handler 
)

Definition at line 1342 of file xmlparse.cc.

1344{
1345 defaultHandler = handler;
1347}

◆ XML_SetDefaultHandlerExpand()

void XMLCALL XML_SetDefaultHandlerExpand ( XML_Parser  parser,
XML_DefaultHandler  handler 
)

Definition at line 1350 of file xmlparse.cc.

1352{
1353 defaultHandler = handler;
1355}

◆ XML_SetDoctypeDeclHandler()

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

Definition at line 1358 of file xmlparse.cc.

1361{
1364}
#define endDoctypeDeclHandler
Definition: xmlparse.cc:585
#define startDoctypeDeclHandler
Definition: xmlparse.cc:584

◆ XML_SetElementDeclHandler()

void XMLCALL XML_SetElementDeclHandler ( XML_Parser  parser,
XML_ElementDeclHandler  eldecl 
)

Definition at line 1453 of file xmlparse.cc.

1455{
1456 elementDeclHandler = eldecl;
1457}

◆ XML_SetElementHandler()

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

Definition at line 1279 of file xmlparse.cc.

1282{
1283 startElementHandler = start;
1284 endElementHandler = end;
1285}

◆ XML_SetEncoding()

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

Definition at line 967 of file xmlparse.cc.

968{
969 /* Block after XML_Parse()/XML_ParseBuffer() has been called.
970 XXX There's no way for the caller to determine which of the
971 XXX possible error cases caused the XML_STATUS_ERROR return.
972 */
974 return XML_STATUS_ERROR;
975 if (encodingName == NULL)
977 else {
978 protocolEncodingName = poolCopyString(&tempPool, encodingName);
980 return XML_STATUS_ERROR;
981 }
982 return XML_STATUS_OK;
983}
#define protocolEncodingName
Definition: xmlparse.cc:613

◆ XML_SetEndCdataSectionHandler()

void XMLCALL XML_SetEndCdataSectionHandler ( XML_Parser  parser,
XML_EndCdataSectionHandler  end 
)

Definition at line 1336 of file xmlparse.cc.

1337 {
1339}

◆ XML_SetEndDoctypeDeclHandler()

void XMLCALL XML_SetEndDoctypeDeclHandler ( XML_Parser  parser,
XML_EndDoctypeDeclHandler  end 
)

Definition at line 1373 of file xmlparse.cc.

1374 {
1376}

◆ XML_SetEndElementHandler()

void XMLCALL XML_SetEndElementHandler ( XML_Parser  parser,
XML_EndElementHandler  end 
)

Definition at line 1294 of file xmlparse.cc.

1295 {
1296 endElementHandler = end;
1297}

◆ XML_SetEndNamespaceDeclHandler()

void XMLCALL XML_SetEndNamespaceDeclHandler ( XML_Parser  parser,
XML_EndNamespaceDeclHandler  end 
)

Definition at line 1408 of file xmlparse.cc.

1409 {
1411}

◆ XML_SetEntityDeclHandler()

void XMLCALL XML_SetEntityDeclHandler ( XML_Parser  parser,
XML_EntityDeclHandler  handler 
)

Definition at line 1467 of file xmlparse.cc.

1469{
1470 entityDeclHandler = handler;
1471}

◆ XML_SetExternalEntityRefHandler()

void XMLCALL XML_SetExternalEntityRefHandler ( XML_Parser  parser,
XML_ExternalEntityRefHandler  handler 
)

Definition at line 1421 of file xmlparse.cc.

1423{
1424 externalEntityRefHandler = handler;
1425}

◆ XML_SetExternalEntityRefHandlerArg()

void XMLCALL XML_SetExternalEntityRefHandlerArg ( XML_Parser  parser,
void *  arg 
)

Definition at line 1428 of file xmlparse.cc.

1429{
1430 if (arg)
1432 else
1434}
struct XML_ParserStruct * XML_Parser
Definition: expat.h:25

◆ XML_SetHashSalt()

int XMLCALL XML_SetHashSalt ( XML_Parser  parser,
unsigned long  hash_salt 
)

Definition at line 1495 of file xmlparse.cc.

1497{
1498 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1500 return 0;
1501 hash_secret_salt = hash_salt;
1502 return 1;
1503}

◆ XML_SetNamespaceDeclHandler()

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

Definition at line 1393 of file xmlparse.cc.

1396{
1399}

◆ XML_SetNotationDeclHandler()

void XMLCALL XML_SetNotationDeclHandler ( XML_Parser  parser,
XML_NotationDeclHandler  handler 
)

Definition at line 1386 of file xmlparse.cc.

1388{
1389 notationDeclHandler = handler;
1390}

◆ XML_SetNotStandaloneHandler()

void XMLCALL XML_SetNotStandaloneHandler ( XML_Parser  parser,
XML_NotStandaloneHandler  handler 
)

Definition at line 1414 of file xmlparse.cc.

1416{
1417 notStandaloneHandler = handler;
1418}

◆ XML_SetParamEntityParsing()

int XMLCALL XML_SetParamEntityParsing ( XML_Parser  parser,
enum XML_ParamEntityParsing  peParsing 
)

Definition at line 1480 of file xmlparse.cc.

1482{
1483 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1485 return 0;
1486#ifdef XML_DTD
1487 paramEntityParsing = peParsing;
1488 return 1;
1489#else
1490 return peParsing == XML_PARAM_ENTITY_PARSING_NEVER;
1491#endif
1492}
@ XML_PARAM_ENTITY_PARSING_NEVER
Definition: expat.h:877

◆ XML_SetProcessingInstructionHandler()

void XMLCALL XML_SetProcessingInstructionHandler ( XML_Parser  parser,
XML_ProcessingInstructionHandler  handler 
)

Definition at line 1307 of file xmlparse.cc.

1309{
1311}

◆ XML_SetReturnNSTriplet()

void XMLCALL XML_SetReturnNSTriplet ( XML_Parser  parser,
int  do_nst 
)

Definition at line 1221 of file xmlparse.cc.

1222{
1223 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1225 return;
1226 ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
1227}

◆ XML_SetSkippedEntityHandler()

void XMLCALL XML_SetSkippedEntityHandler ( XML_Parser  parser,
XML_SkippedEntityHandler  handler 
)

Definition at line 1437 of file xmlparse.cc.

1439{
1440 skippedEntityHandler = handler;
1441}

◆ XML_SetStartCdataSectionHandler()

void XMLCALL XML_SetStartCdataSectionHandler ( XML_Parser  parser,
XML_StartCdataSectionHandler  start 
)

Definition at line 1330 of file xmlparse.cc.

1331 {
1333}

◆ XML_SetStartDoctypeDeclHandler()

void XMLCALL XML_SetStartDoctypeDeclHandler ( XML_Parser  parser,
XML_StartDoctypeDeclHandler  start 
)

Definition at line 1367 of file xmlparse.cc.

1368 {
1370}

◆ XML_SetStartElementHandler()

void XMLCALL XML_SetStartElementHandler ( XML_Parser  parser,
XML_StartElementHandler  start 
)

Definition at line 1288 of file xmlparse.cc.

1289 {
1290 startElementHandler = start;
1291}

◆ XML_SetStartNamespaceDeclHandler()

void XMLCALL XML_SetStartNamespaceDeclHandler ( XML_Parser  parser,
XML_StartNamespaceDeclHandler  start 
)

Definition at line 1402 of file xmlparse.cc.

1403 {
1405}

◆ XML_SetUnknownEncodingHandler()

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

Definition at line 1444 of file xmlparse.cc.

1447{
1448 unknownEncodingHandler = handler;
1450}
#define unknownEncodingHandlerData
Definition: xmlparse.cc:610

◆ XML_SetUnparsedEntityDeclHandler()

void XMLCALL XML_SetUnparsedEntityDeclHandler ( XML_Parser  parser,
XML_UnparsedEntityDeclHandler  handler 
)

Definition at line 1379 of file xmlparse.cc.

1381{
1382 unparsedEntityDeclHandler = handler;
1383}

◆ XML_SetUserData()

void XMLCALL XML_SetUserData ( XML_Parser  parser,
void *  p 
)

Definition at line 1230 of file xmlparse.cc.

1231{
1232 if (handlerArg == userData)
1233 handlerArg = userData = p;
1234 else
1235 userData = p;
1236}

◆ XML_SetXmlDeclHandler()

void XMLCALL XML_SetXmlDeclHandler ( XML_Parser  parser,
XML_XmlDeclHandler  handler 
)

Definition at line 1474 of file xmlparse.cc.

1475 {
1476 xmlDeclHandler = handler;
1477}

◆ XML_StopParser()

enum XML_Status XMLCALL XML_StopParser ( XML_Parser  parser,
XML_Bool  resumable 
)

Definition at line 1766 of file xmlparse.cc.

1767{
1768 switch (ps_parsing) {
1769 case XML_SUSPENDED:
1770 if (resumable) {
1772 return XML_STATUS_ERROR;
1773 }
1775 break;
1776 case XML_FINISHED:
1778 return XML_STATUS_ERROR;
1779 default:
1780 if (resumable) {
1781#ifdef XML_DTD
1782 if (isParamEntity) {
1784 return XML_STATUS_ERROR;
1785 }
1786#endif
1788 }
1789 else
1791 }
1792 return XML_STATUS_OK;
1793}
@ XML_ERROR_SUSPEND_PE
Definition: expat.h:94

◆ XML_UseForeignDTD()

enum XML_Error XMLCALL XML_UseForeignDTD ( XML_Parser  parser,
XML_Bool  useDTD 
)

Definition at line 1207 of file xmlparse.cc.

1208{
1209#ifdef XML_DTD
1210 /* block after XML_Parse()/XML_ParseBuffer() has been called */
1213 useForeignDTD = useDTD;
1214 return XML_ERROR_NONE;
1215#else
1217#endif
1218}
@ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
Definition: expat.h:81
@ XML_ERROR_FEATURE_REQUIRES_XML_DTD
Definition: expat.h:80

◆ XML_UseParserAsHandlerArg()

void XMLCALL XML_UseParserAsHandlerArg ( XML_Parser  parser)

Definition at line 1201 of file xmlparse.cc.

1202{
1203 handlerArg = parser;
1204}