Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions
expat.h File Reference
#include <stdlib.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XML_cp
struct  XML_Memory_Handling_Suite
struct  XML_Encoding
struct  XML_Expat_Version
struct  XML_Feature

Defines

#define XMLCALL
#define XMLIMPORT
#define XMLPARSEAPI(type)   XMLIMPORT type XMLCALL
#define XML_TRUE   ((XML_Bool) 1)
#define XML_FALSE   ((XML_Bool) 0)
#define XML_STATUS_ERROR   XML_STATUS_ERROR
#define XML_STATUS_OK   XML_STATUS_OK
#define XML_GetUserData(parser)   (*(void **)(parser))
#define XML_GetErrorLineNumber   XML_GetCurrentLineNumber
#define XML_GetErrorColumnNumber   XML_GetCurrentColumnNumber
#define XML_GetErrorByteIndex   XML_GetCurrentByteIndex
#define XML_MAJOR_VERSION   1
#define XML_MINOR_VERSION   95
#define XML_MICRO_VERSION   7

Typedefs

typedef struct XML_ParserStructXML_Parser
typedef unsigned char XML_Bool
typedef struct XML_cp
typedef const XML_Charname
typedef const XML_Char
XML_Content * 
model
typedef const XML_Charelname
typedef const XML_Char const
XML_Char
attname
typedef const XML_Char const
XML_Char const XML_Char
att_type
typedef const XML_Char const
XML_Char const XML_Char const
XML_Char
dflt
typedef const XML_Char const
XML_Char const XML_Char const
XML_Char int 
isrequired
typedef const XML_Charversion
typedef const XML_Char const
XML_Char
encoding
typedef const XML_Char const
XML_Char int 
standalone
typedef const XML_Char const
XML_Char ** 
atts
typedef const XML_Chars
typedef const XML_Char int len
typedef const XML_Chartarget
typedef const XML_Char const
XML_Char
data
typedef const XML_ChardoctypeName
typedef const XML_Char const
XML_Char
sysid
typedef const XML_Char const
XML_Char const XML_Char
pubid
typedef const XML_Char const
XML_Char const XML_Char int 
has_internal_subset
typedef void(XMLCALLXML_EndDoctypeDeclHandler )(void *userData)
typedef const XML_CharentityName
typedef const XML_Char int is_parameter_entity
typedef const XML_Char int
const XML_Char
value
typedef const XML_Char int
const XML_Char int 
value_length
typedef const XML_Char int
const XML_Char int const
XML_Char
base
typedef const XML_Char int
const XML_Char int const
XML_Char const XML_Char
systemId
typedef const XML_Char int
const XML_Char int const
XML_Char const XML_Char const
XML_Char
publicId
typedef const XML_Char int
const XML_Char int const
XML_Char const XML_Char const
XML_Char const XML_Char
notationName
typedef const XML_Charprefix
typedef const XML_Char const
XML_Char
uri
typedef const XML_Charcontext
typedef const XML_Char
XML_Encoding
info

Enumerations

enum  XML_Status { XML_STATUS_ERROR = 0, XML_STATUS_ERROR = 0, XML_STATUS_OK }
enum  XML_Error {
  XML_ERROR_NONE, XML_ERROR_NO_MEMORY, XML_ERROR_SYNTAX, XML_ERROR_NO_ELEMENTS,
  XML_ERROR_INVALID_TOKEN, XML_ERROR_UNCLOSED_TOKEN, XML_ERROR_PARTIAL_CHAR, XML_ERROR_TAG_MISMATCH,
  XML_ERROR_DUPLICATE_ATTRIBUTE, XML_ERROR_JUNK_AFTER_DOC_ELEMENT, XML_ERROR_PARAM_ENTITY_REF, XML_ERROR_UNDEFINED_ENTITY,
  XML_ERROR_RECURSIVE_ENTITY_REF, XML_ERROR_ASYNC_ENTITY, XML_ERROR_BAD_CHAR_REF, XML_ERROR_BINARY_ENTITY_REF,
  XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, XML_ERROR_MISPLACED_XML_PI, XML_ERROR_UNKNOWN_ENCODING, XML_ERROR_INCORRECT_ENCODING,
  XML_ERROR_UNCLOSED_CDATA_SECTION, XML_ERROR_EXTERNAL_ENTITY_HANDLING, XML_ERROR_NOT_STANDALONE, XML_ERROR_UNEXPECTED_STATE,
  XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, XML_ERROR_UNBOUND_PREFIX,
  XML_ERROR_SUSPENDED, XML_ERROR_RESERVED_PREFIX_XML, XML_ERROR_RESERVED_PREFIX_XMLNS, XML_ERROR_RESERVED_NAMESPACE_URI
}
enum  XML_Content_Type {
  XML_CTYPE_EMPTY = 1, XML_CTYPE_ANY, XML_CTYPE_MIXED, XML_CTYPE_NAME,
  XML_CTYPE_CHOICE, XML_CTYPE_SEQ
}
enum  XML_Content_Quant { XML_CQUANT_NONE, XML_CQUANT_OPT, XML_CQUANT_REP, XML_CQUANT_PLUS }
enum  XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }
enum  XML_FeatureEnum {
  XML_FEATURE_END = 0, XML_FEATURE_UNICODE, XML_FEATURE_UNICODE_WCHAR_T, XML_FEATURE_DTD,
  XML_FEATURE_CONTEXT_BYTES, XML_FEATURE_MIN_SIZE, XML_FEATURE_SIZEOF_XML_CHAR, XML_FEATURE_SIZEOF_XML_LCHAR
}

Functions

typedef void (XMLCALL *XML_ElementDeclHandler)(void *userData
 XML_SetElementDeclHandler (XML_Parser parser, XML_ElementDeclHandler eldecl)
 XML_SetAttlistDeclHandler (XML_Parser parser, XML_AttlistDeclHandler attdecl)
 XML_SetXmlDeclHandler (XML_Parser parser, XML_XmlDeclHandler xmldecl)
 XML_ParserCreate (const XML_Char *encoding)
 XML_ParserCreateNS (const XML_Char *encoding, XML_Char namespaceSeparator)
 XML_ParserCreate_MM (const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator)
 XML_ParserReset (XML_Parser parser, const XML_Char *encoding)
 XML_SetEntityDeclHandler (XML_Parser parser, XML_EntityDeclHandler handler)
typedef int (XMLCALL *XML_NotStandaloneHandler)(void *userData)
 XML_SetElementHandler (XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end)
 XML_SetStartElementHandler (XML_Parser, XML_StartElementHandler)
 XML_SetEndElementHandler (XML_Parser, XML_EndElementHandler)
 XML_SetCharacterDataHandler (XML_Parser parser, XML_CharacterDataHandler handler)
 XML_SetProcessingInstructionHandler (XML_Parser parser, XML_ProcessingInstructionHandler handler)
 XML_SetCommentHandler (XML_Parser parser, XML_CommentHandler handler)
 XML_SetCdataSectionHandler (XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end)
 XML_SetStartCdataSectionHandler (XML_Parser parser, XML_StartCdataSectionHandler start)
 XML_SetEndCdataSectionHandler (XML_Parser parser, XML_EndCdataSectionHandler end)
 XML_SetDefaultHandler (XML_Parser parser, XML_DefaultHandler handler)
 XML_SetDefaultHandlerExpand (XML_Parser parser, XML_DefaultHandler handler)
 XML_SetDoctypeDeclHandler (XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end)
 XML_SetStartDoctypeDeclHandler (XML_Parser parser, XML_StartDoctypeDeclHandler start)
 XML_SetEndDoctypeDeclHandler (XML_Parser parser, XML_EndDoctypeDeclHandler end)
 XML_SetUnparsedEntityDeclHandler (XML_Parser parser, XML_UnparsedEntityDeclHandler handler)
 XML_SetNotationDeclHandler (XML_Parser parser, XML_NotationDeclHandler handler)
 XML_SetNamespaceDeclHandler (XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end)
 XML_SetStartNamespaceDeclHandler (XML_Parser parser, XML_StartNamespaceDeclHandler start)
 XML_SetEndNamespaceDeclHandler (XML_Parser parser, XML_EndNamespaceDeclHandler end)
 XML_SetNotStandaloneHandler (XML_Parser parser, XML_NotStandaloneHandler handler)
 XML_SetExternalEntityRefHandler (XML_Parser parser, XML_ExternalEntityRefHandler handler)
 XML_SetExternalEntityRefHandlerArg (XML_Parser, void *arg)
 XML_SetSkippedEntityHandler (XML_Parser parser, XML_SkippedEntityHandler handler)
 XML_SetUnknownEncodingHandler (XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData)
 XML_DefaultCurrent (XML_Parser parser)
 XML_SetReturnNSTriplet (XML_Parser parser, int do_nst)
 XML_SetUserData (XML_Parser parser, void *userData)
 XML_SetEncoding (XML_Parser parser, const XML_Char *encoding)
 XML_UseParserAsHandlerArg (XML_Parser parser)
 XML_UseForeignDTD (XML_Parser parser, XML_Bool useDTD)
 XML_SetBase (XML_Parser parser, const XML_Char *base)
 XML_GetBase (XML_Parser parser)
 XML_GetSpecifiedAttributeCount (XML_Parser parser)
 XML_GetIdAttributeIndex (XML_Parser parser)
 XML_Parse (XML_Parser parser, const char *s, int len, int isFinal)
 XML_GetBuffer (XML_Parser parser, int len)
 XML_ParseBuffer (XML_Parser parser, int len, int isFinal)
 MOZ_XML_StopParser (XML_Parser parser, XML_Bool resumable)
 MOZ_XML_ResumeParser (XML_Parser parser)
 XML_ExternalEntityParserCreate (XML_Parser parser, const XML_Char *context, const XML_Char *encoding)
 XML_SetParamEntityParsing (XML_Parser parser, enum XML_ParamEntityParsing parsing)
 XML_GetErrorCode (XML_Parser parser)
 XML_GetCurrentByteCount (XML_Parser parser)
 XML_GetInputContext (XML_Parser parser, int *offset, int *size)
 XML_FreeContentModel (XML_Parser parser, XML_Content *model)
 XML_MemMalloc (XML_Parser parser, size_t size)
 XML_MemRealloc (XML_Parser parser, void *ptr, size_t size)
 XML_MemFree (XML_Parser parser, void *ptr)
 XML_ParserFree (XML_Parser parser)
 XML_ErrorString (enum XML_Error code)
 XML_ExpatVersion (void)
 XML_ExpatVersionInfo (void)
 XML_GetFeatureList (void)
 MOZ_XML_GetMismatchedTag (XML_Parser parser)

Class Documentation

struct XML_cp

Definition at line 215 of file expat.h.

struct XML_Expat_Version

Definition at line 975 of file expat.h.

Collaboration diagram for XML_Expat_Version:
Class Members
int major
int micro
int minor
struct XML_Feature

Definition at line 1000 of file expat.h.


Define Documentation

#define XML_FALSE   ((XML_Bool) 0)

Definition at line 118 of file expat.h.

Definition at line 947 of file expat.h.

Definition at line 946 of file expat.h.

Definition at line 945 of file expat.h.

#define XML_GetUserData (   parser)    (*(void **)(parser))

Definition at line 749 of file expat.h.

Definition at line 1015 of file expat.h.

Definition at line 1017 of file expat.h.

Definition at line 1016 of file expat.h.

Definition at line 135 of file expat.h.

#define XML_TRUE   ((XML_Bool) 1)

Definition at line 117 of file expat.h.

Definition at line 61 of file expat.h.

Definition at line 79 of file expat.h.

Definition at line 83 of file expat.h.


Typedef Documentation

Definition at line 246 of file expat.h.

Definition at line 246 of file expat.h.

Definition at line 331 of file expat.h.

Definition at line 409 of file expat.h.

Definition at line 512 of file expat.h.

XPTPool char ** data

Definition at line 346 of file expat.h.

Definition at line 246 of file expat.h.

Definition at line 378 of file expat.h.

typedef const XML_Char* elname

Definition at line 246 of file expat.h.

Definition at line 265 of file expat.h.

Definition at line 409 of file expat.h.

Definition at line 378 of file expat.h.

Definition at line 608 of file expat.h.

Definition at line 409 of file expat.h.

Definition at line 246 of file expat.h.

typedef const XML_Char int len

Definition at line 340 of file expat.h.

typedef const XML_Char XML_Content* model

Definition at line 229 of file expat.h.

typedef const XML_Char* name

Definition at line 229 of file expat.h.

Definition at line 409 of file expat.h.

typedef const XML_Char * prefix

Definition at line 458 of file expat.h.

Definition at line 378 of file expat.h.

Definition at line 409 of file expat.h.

typedef const XML_Char * s

Definition at line 340 of file expat.h.

Definition at line 265 of file expat.h.

Definition at line 378 of file expat.h.

Definition at line 409 of file expat.h.

LDAPMessage const char * target

Definition at line 346 of file expat.h.

Definition at line 458 of file expat.h.

Definition at line 409 of file expat.h.

Definition at line 409 of file expat.h.

Definition at line 265 of file expat.h.

typedef unsigned char XML_Bool

Definition at line 116 of file expat.h.

typedef struct XML_cp

Definition at line 213 of file expat.h.

Definition at line 387 of file expat.h.

typedef struct XML_ParserStruct* XML_Parser

Definition at line 94 of file expat.h.


Enumeration Type Documentation

Enumerator:
XML_CQUANT_NONE 
XML_CQUANT_OPT 
XML_CQUANT_REP 
XML_CQUANT_PLUS 

Definition at line 188 of file expat.h.

Enumerator:
XML_CTYPE_EMPTY 
XML_CTYPE_ANY 
XML_CTYPE_MIXED 
XML_CTYPE_NAME 
XML_CTYPE_CHOICE 
XML_CTYPE_SEQ 

Definition at line 179 of file expat.h.

enum XML_Error
Enumerator:
XML_ERROR_NONE 
XML_ERROR_NO_MEMORY 
XML_ERROR_SYNTAX 
XML_ERROR_NO_ELEMENTS 
XML_ERROR_INVALID_TOKEN 
XML_ERROR_UNCLOSED_TOKEN 
XML_ERROR_PARTIAL_CHAR 
XML_ERROR_TAG_MISMATCH 
XML_ERROR_DUPLICATE_ATTRIBUTE 
XML_ERROR_JUNK_AFTER_DOC_ELEMENT 
XML_ERROR_PARAM_ENTITY_REF 
XML_ERROR_UNDEFINED_ENTITY 
XML_ERROR_RECURSIVE_ENTITY_REF 
XML_ERROR_ASYNC_ENTITY 
XML_ERROR_BAD_CHAR_REF 
XML_ERROR_BINARY_ENTITY_REF 
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF 
XML_ERROR_MISPLACED_XML_PI 
XML_ERROR_UNKNOWN_ENCODING 
XML_ERROR_INCORRECT_ENCODING 
XML_ERROR_UNCLOSED_CDATA_SECTION 
XML_ERROR_EXTERNAL_ENTITY_HANDLING 
XML_ERROR_NOT_STANDALONE 
XML_ERROR_UNEXPECTED_STATE 
XML_ERROR_ENTITY_DECLARED_IN_PE 
XML_ERROR_FEATURE_REQUIRES_XML_DTD 
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING 
XML_ERROR_UNBOUND_PREFIX 
XML_ERROR_SUSPENDED 
XML_ERROR_RESERVED_PREFIX_XML 
XML_ERROR_RESERVED_PREFIX_XMLNS 
XML_ERROR_RESERVED_NAMESPACE_URI 

Definition at line 140 of file expat.h.

Enumerator:
XML_FEATURE_END 
XML_FEATURE_UNICODE 
XML_FEATURE_UNICODE_WCHAR_T 
XML_FEATURE_DTD 
XML_FEATURE_CONTEXT_BYTES 
XML_FEATURE_MIN_SIZE 
XML_FEATURE_SIZEOF_XML_CHAR 
XML_FEATURE_SIZEOF_XML_LCHAR 

Definition at line 988 of file expat.h.

Enumerator:
XML_PARAM_ENTITY_PARSING_NEVER 
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE 
XML_PARAM_ENTITY_PARSING_ALWAYS 

Definition at line 864 of file expat.h.

enum XML_Status
Enumerator:
XML_STATUS_ERROR 
XML_STATUS_ERROR 
XML_STATUS_OK 

Definition at line 133 of file expat.h.

                {
  XML_STATUS_ERROR = 0,
#define XML_STATUS_ERROR XML_STATUS_ERROR
  XML_STATUS_OK = 1
#define XML_STATUS_OK XML_STATUS_OK
};

Function Documentation

typedef int ( XMLCALL XML_NotStandaloneHandler)

Definition at line 1883 of file xmlparse.c.

{
  return mismatch;
}

Here is the caller graph for this function:

MOZ_XML_ResumeParser ( XML_Parser  parser) [abstract]

Definition at line 1669 of file xmlparse.c.

MOZ_XML_StopParser ( XML_Parser  parser,
XML_Bool  resumable 
) [abstract]

Definition at line 1662 of file xmlparse.c.

Here is the caller graph for this function:

typedef void ( XMLCALL XML_ElementDeclHandler)
XML_ErrorString ( enum XML_Error  code)

Here is the caller graph for this function:

XML_ExternalEntityParserCreate ( XML_Parser  parser,
const XML_Char context,
const XML_Char encoding 
)

Definition at line 965 of file xmlparse.c.

{
  XML_Parser parser = oldParser;
  DTD *newDtd = NULL;
  DTD *oldDtd = _dtd;
  XML_StartElementHandler oldStartElementHandler = startElementHandler;
  XML_EndElementHandler oldEndElementHandler = endElementHandler;
  XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
  XML_ProcessingInstructionHandler oldProcessingInstructionHandler
      = processingInstructionHandler;
  XML_CommentHandler oldCommentHandler = commentHandler;
  XML_StartCdataSectionHandler oldStartCdataSectionHandler
      = startCdataSectionHandler;
  XML_EndCdataSectionHandler oldEndCdataSectionHandler
      = endCdataSectionHandler;
  XML_DefaultHandler oldDefaultHandler = defaultHandler;
  XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
      = unparsedEntityDeclHandler;
  XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
  XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
      = startNamespaceDeclHandler;
  XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
      = endNamespaceDeclHandler;
  XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
  XML_ExternalEntityRefHandler oldExternalEntityRefHandler
      = externalEntityRefHandler;
  XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
  XML_UnknownEncodingHandler oldUnknownEncodingHandler
      = unknownEncodingHandler;
  XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
  XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
  XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
  XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
  ELEMENT_TYPE * oldDeclElementType = declElementType;

  void *oldUserData = userData;
  void *oldHandlerArg = handlerArg;
  XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
  XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
#ifdef XML_DTD
  enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
  int oldInEntityValue = prologState.inEntityValue;
#endif
  XML_Bool oldns_triplets = ns_triplets;

#ifdef XML_DTD
  if (!context)
    newDtd = oldDtd;
#endif /* XML_DTD */

  /* Note that the magical uses of the pre-processor to make field
     access look more like C++ require that `parser' be overwritten
     here.  This makes this function more painful to follow than it
     would be otherwise.
  */
  if (ns) {
    XML_Char tmp[2];
    *tmp = namespaceSeparator;
    parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
  }
  else {
    parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
  }

  if (!parser)
    return NULL;

  startElementHandler = oldStartElementHandler;
  endElementHandler = oldEndElementHandler;
  characterDataHandler = oldCharacterDataHandler;
  processingInstructionHandler = oldProcessingInstructionHandler;
  commentHandler = oldCommentHandler;
  startCdataSectionHandler = oldStartCdataSectionHandler;
  endCdataSectionHandler = oldEndCdataSectionHandler;
  defaultHandler = oldDefaultHandler;
  unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
  notationDeclHandler = oldNotationDeclHandler;
  startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
  endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
  notStandaloneHandler = oldNotStandaloneHandler;
  externalEntityRefHandler = oldExternalEntityRefHandler;
  skippedEntityHandler = oldSkippedEntityHandler;
  unknownEncodingHandler = oldUnknownEncodingHandler;
  elementDeclHandler = oldElementDeclHandler;
  attlistDeclHandler = oldAttlistDeclHandler;
  entityDeclHandler = oldEntityDeclHandler;
  xmlDeclHandler = oldXmlDeclHandler;
  declElementType = oldDeclElementType;
  userData = oldUserData;
  if (oldUserData == oldHandlerArg)
    handlerArg = userData;
  else
    handlerArg = parser;
  if (oldExternalEntityRefHandlerArg != oldParser)
    externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
  defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
  ns_triplets = oldns_triplets;
  parentParser = oldParser;
#ifdef XML_DTD
  paramEntityParsing = oldParamEntityParsing;
  prologState.inEntityValue = oldInEntityValue;
  if (context) {
#endif /* XML_DTD */
    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
      || !setContext(parser, context)) {
      XML_ParserFree(parser);
      return NULL;
    }
    processor = externalEntityInitProcessor;
#ifdef XML_DTD
  }
  else {
    /* The DTD instance referenced by _dtd is shared between the document's
       root parser and external PE parsers, therefore one does not need to
       call setContext. In addition, one also *must* not call setContext,
       because this would overwrite existing prefix->binding pointers in
       _dtd with ones that get destroyed with the external PE parser.
       This would leave those prefixes with dangling pointers.
    */
    isParamEntity = XML_TRUE;
    XmlPrologStateInitExternalEntity(&prologState);
    processor = externalParEntInitProcessor;
  }
#endif /* XML_DTD */
  return parser;
}

Here is the call graph for this function:

XML_FreeContentModel ( XML_Parser  parser,
XML_Content *  model 
)
XML_GetBase ( XML_Parser  parser)

Definition at line 1205 of file xmlparse.c.

{
  return curBase;
}
XML_GetBuffer ( XML_Parser  parser,
int  len 
)

Definition at line 1592 of file xmlparse.c.

{
  if (len > bufferLim - bufferEnd) {
    /* FIXME avoid integer overflow */
    int neededSize = len + (bufferEnd - bufferPtr);
#ifdef XML_CONTEXT_BYTES
    int keep = bufferPtr - buffer;

    if (keep > XML_CONTEXT_BYTES)
      keep = XML_CONTEXT_BYTES;
    neededSize += keep;
#endif  /* defined XML_CONTEXT_BYTES */
    if (neededSize  <= bufferLim - buffer) {
#ifdef XML_CONTEXT_BYTES
      if (keep < bufferPtr - buffer) {
        int offset = (bufferPtr - buffer) - keep;
        memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
        bufferEnd -= offset;
        bufferPtr -= offset;
      }
#else
      memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
      bufferEnd = buffer + (bufferEnd - bufferPtr);
      bufferPtr = buffer;
#endif  /* not defined XML_CONTEXT_BYTES */
    }
    else {
      char *newBuf;
      int bufferSize = bufferLim - bufferPtr;
      if (bufferSize == 0)
        bufferSize = INIT_BUFFER_SIZE;
      do {
        bufferSize *= 2;
      } while (bufferSize < neededSize);
      newBuf = (char *)MALLOC(bufferSize);
      if (newBuf == 0) {
        errorCode = XML_ERROR_NO_MEMORY;
        return NULL;
      }
      bufferLim = newBuf + bufferSize;
#ifdef XML_CONTEXT_BYTES
      if (bufferPtr) {
        int keep = bufferPtr - buffer;
        if (keep > XML_CONTEXT_BYTES)
          keep = XML_CONTEXT_BYTES;
        memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
        FREE(buffer);
        buffer = newBuf;
        bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
        bufferPtr = buffer + keep;
      }
      else {
        bufferEnd = newBuf + (bufferEnd - bufferPtr);
        bufferPtr = buffer = newBuf;
      }
#else
      if (bufferPtr) {
        memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
        FREE(buffer);
      }
      bufferEnd = newBuf + (bufferEnd - bufferPtr);
      bufferPtr = buffer = newBuf;
#endif  /* not defined XML_CONTEXT_BYTES */
    }
  }
  return bufferEnd;
}

Here is the call graph for this function:

XML_GetErrorCode ( XML_Parser  parser) [abstract]

Definition at line 1677 of file xmlparse.c.

{
  return errorCode;
}

Definition at line 1217 of file xmlparse.c.

{
  return idAttIndex;
}
XML_GetInputContext ( XML_Parser  parser,
int offset,
int size 
)

Definition at line 1211 of file xmlparse.c.

{
  return nSpecifiedAtts;
}
XML_MemFree ( XML_Parser  parser,
void ptr 
)
XML_MemMalloc ( XML_Parser  parser,
size_t  size 
)
XML_MemRealloc ( XML_Parser  parser,
void ptr,
size_t  size 
)
XML_Parse ( XML_Parser  parser,
const char *  s,
int  len,
int  isFinal 
) [abstract]

Definition at line 1460 of file xmlparse.c.

{
/* BEGIN MOZILLA CHANGE (Blocking parser) */
  if (blocked) {
    /* First unblock parser */
    return XML_STATUS_ERROR;
  }
/* END MOZILLA CHANGE */

  if (len == 0) {
    if (!isFinal)
      return XML_STATUS_OK;
    positionPtr = bufferPtr;
    errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0);
    if (errorCode == XML_ERROR_NONE)
      return XML_STATUS_OK;
/* BEGIN MOZILLA CHANGE (Blocking parser) */
    if (errorCode == XML_ERROR_SUSPENDED) {
      parseEndByteIndex -= parseEndPtr - eventPtr; /* Remove what we haven't read. */
      parseEndPtr = bufferPtr = eventPtr;
      bufferEnd = (char*)bufferPtr; /* We'll pass in the same data again later. */
      XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
      return XML_STATUS_ERROR;
    }
/* END MOZILLA CHANGE */
    eventEndPtr = eventPtr;
    processor = errorProcessor;
    return XML_STATUS_ERROR;
  }
#ifndef XML_CONTEXT_BYTES
  else if (bufferPtr == bufferEnd) {
    const char *end;
    int nLeftOver;
    parseEndByteIndex += len;
    positionPtr = s;
    if (isFinal) {
      errorCode = processor(parser, s, parseEndPtr = s + len, 0);
      if (errorCode == XML_ERROR_NONE)
        return XML_STATUS_OK;
      eventEndPtr = eventPtr;
      processor = errorProcessor;
      return XML_STATUS_ERROR;
    }
    errorCode = processor(parser, s, parseEndPtr = s + len, &end);
    if (errorCode != XML_ERROR_NONE) {
/* BEGIN MOZILLA CHANGE (Blocking parser) */
      if (blocked) {
        parseEndByteIndex -= parseEndPtr - eventPtr; /* Remove what we haven't read. */
        parseEndPtr = eventPtr;
        XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
        eventEndPtr = eventPtr;
        return XML_STATUS_ERROR;
      }
/* END MOZILLA CHANGE */
      eventEndPtr = eventPtr;
      processor = errorProcessor;
      return XML_STATUS_ERROR;
    }
    XmlUpdatePosition(encoding, positionPtr, end, &position);
    positionPtr = end;
    nLeftOver = s + len - end;
    if (nLeftOver) {
      if (buffer == NULL || nLeftOver > bufferLim - buffer) {
        /* FIXME avoid integer overflow */
        char *temp;
        temp = (buffer == NULL
                ? (char *)MALLOC(len * 2)
                : (char *)REALLOC(buffer, len * 2));
        if (temp == NULL) {
          errorCode = XML_ERROR_NO_MEMORY;
          return XML_STATUS_ERROR;
        }
        buffer = temp;
        if (!buffer) {
          errorCode = XML_ERROR_NO_MEMORY;
          eventPtr = eventEndPtr = NULL;
          processor = errorProcessor;
          return XML_STATUS_ERROR;
        }
        bufferLim = buffer + len * 2;
      }
      memcpy(buffer, end, nLeftOver);
      bufferPtr = buffer;
      bufferEnd = buffer + nLeftOver;
    }
    return XML_STATUS_OK;
  }
#endif  /* not defined XML_CONTEXT_BYTES */
  else {
    void *buff = XML_GetBuffer(parser, len);
    if (buff == NULL)
      return XML_STATUS_ERROR;
    else {
      memcpy(buff, s, len);
      return XML_ParseBuffer(parser, len, isFinal);
    }
  }
}

Here is the call graph for this function:

XML_ParseBuffer ( XML_Parser  parser,
int  len,
int  isFinal 
) [abstract]

Definition at line 1560 of file xmlparse.c.

{
  const char *start = bufferPtr;
  positionPtr = start;
  bufferEnd += len;
  parseEndByteIndex += len;
  errorCode = processor(parser, start, parseEndPtr = bufferEnd,
                        isFinal ? (const char **)NULL : &bufferPtr);
  if (errorCode == XML_ERROR_NONE) {
    if (!isFinal) {
      XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
      positionPtr = bufferPtr;
    }
    return XML_STATUS_OK;
  }
/* BEGIN MOZILLA CHANGE (Blocking parser) */
  else if (errorCode == XML_ERROR_SUSPENDED) {
    parseEndByteIndex -= parseEndPtr - eventPtr; /* Remove what we haven't read. */
    parseEndPtr = bufferPtr = eventPtr;
    bufferEnd = (char*)bufferPtr; /* We'll pass in the same data again later. */
    XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
    return XML_STATUS_ERROR;
  }
/* END MOZILLA CHANGE */
  else {
    eventEndPtr = eventPtr;
    processor = errorProcessor;
    return XML_STATUS_ERROR;
  }
}
XML_ParserCreate ( const XML_Char encoding)

Here is the caller graph for this function:

XML_ParserCreate_MM ( const XML_Char encoding,
const XML_Memory_Handling_Suite memsuite,
const XML_Char namespaceSeparator 
)

Definition at line 707 of file xmlparse.c.

{
  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
  if (parser != NULL && ns) {
    /* implicit context only set for root parser, since child
       parsers (i.e. external entity parsers) will inherit it
    */
    if (!setContext(parser, implicitContext)) {
      XML_ParserFree(parser);
      return NULL;
    }
  }
  return parser;
}

Here is the call graph for this function:

XML_ParserCreateNS ( const XML_Char encoding,
XML_Char  namespaceSeparator 
)

Definition at line 1108 of file xmlparse.c.

{
  for (;;) {
    TAG *p;
    if (tagStack == NULL) {
      if (freeTagList == NULL)
        break;
      tagStack = freeTagList;
      freeTagList = NULL;
    }
    p = tagStack;
    tagStack = tagStack->parent;
    FREE(p->buf);
    destroyBindings(p->bindings, parser);
    FREE(p);
  }
  destroyBindings(freeBindingList, parser);
  destroyBindings(inheritedBindings, parser);
  poolDestroy(&tempPool);
  poolDestroy(&temp2Pool);
#ifdef XML_DTD
  /* external parameter entity parsers share the DTD structure
     parser->m_dtd with the root parser, so we must not destroy it
  */
  if (!isParamEntity && _dtd)
#else
  if (_dtd)
#endif /* XML_DTD */
    dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
  FREE((void *)atts);
  FREE(groupConnector);
  FREE(buffer);
  FREE(dataBuf);
  FREE(nsAtts);
  FREE(unknownEncodingMem);
  if (unknownEncodingRelease)
    unknownEncodingRelease(unknownEncodingData);
  FREE(parser);
}

Here is the call graph for this function:

XML_ParserReset ( XML_Parser  parser,
const XML_Char encoding 
)
XML_SetAttlistDeclHandler ( XML_Parser  parser,
XML_AttlistDeclHandler  attdecl 
)
XML_SetBase ( XML_Parser  parser,
const XML_Char base 
) [abstract]

Definition at line 1191 of file xmlparse.c.

{
  if (p) {
    p = poolCopyString(&_dtd->pool, p);
    if (!p)
      return XML_STATUS_ERROR;
    curBase = p;
  }
  else
    curBase = NULL;
  return XML_STATUS_OK;
}

Here is the call graph for this function:

XML_SetCdataSectionHandler ( XML_Parser  parser,
XML_StartCdataSectionHandler  start,
XML_EndCdataSectionHandler  end 
)
XML_SetCharacterDataHandler ( XML_Parser  parser,
XML_CharacterDataHandler  handler 
)

Definition at line 1248 of file xmlparse.c.

XML_SetCommentHandler ( XML_Parser  parser,
XML_CommentHandler  handler 
)

Definition at line 1262 of file xmlparse.c.

XML_SetDefaultHandler ( XML_Parser  parser,
XML_DefaultHandler  handler 
)

Here is the caller graph for this function:

XML_SetDefaultHandlerExpand ( XML_Parser  parser,
XML_DefaultHandler  handler 
)
XML_SetDoctypeDeclHandler ( XML_Parser  parser,
XML_StartDoctypeDeclHandler  start,
XML_EndDoctypeDeclHandler  end 
)

Definition at line 1310 of file xmlparse.c.

XML_SetElementDeclHandler ( XML_Parser  parser,
XML_ElementDeclHandler  eldecl 
)
XML_SetElementHandler ( XML_Parser  parser,
XML_StartElementHandler  start,
XML_EndElementHandler  end 
)

Definition at line 1223 of file xmlparse.c.

XML_SetEncoding ( XML_Parser  parser,
const XML_Char encoding 
)
XML_SetEndCdataSectionHandler ( XML_Parser  parser,
XML_EndCdataSectionHandler  end 
)
XML_SetEndElementHandler ( XML_Parser  ,
XML_EndElementHandler   
)
XML_SetEndNamespaceDeclHandler ( XML_Parser  parser,
XML_EndNamespaceDeclHandler  end 
)
XML_SetEntityDeclHandler ( XML_Parser  parser,
XML_EntityDeclHandler  handler 
)
XML_SetExternalEntityRefHandler ( XML_Parser  parser,
XML_ExternalEntityRefHandler  handler 
)

Definition at line 1382 of file xmlparse.c.

Definition at line 1389 of file xmlparse.c.

XML_SetNamespaceDeclHandler ( XML_Parser  parser,
XML_StartNamespaceDeclHandler  start,
XML_EndNamespaceDeclHandler  end 
)
XML_SetNotationDeclHandler ( XML_Parser  parser,
XML_NotationDeclHandler  handler 
)

Definition at line 1342 of file xmlparse.c.

XML_SetNotStandaloneHandler ( XML_Parser  parser,
XML_NotStandaloneHandler  handler 
)

Definition at line 1445 of file xmlparse.c.

{
  /* block after XML_Parse()/XML_ParseBuffer() has been called */
  if (parsing)
    return 0;
#ifdef XML_DTD
  paramEntityParsing = peParsing;
  return 1;
#else
  return peParsing == XML_PARAM_ENTITY_PARSING_NEVER;
#endif
}
XML_SetProcessingInstructionHandler ( XML_Parser  parser,
XML_ProcessingInstructionHandler  handler 
)

Definition at line 1255 of file xmlparse.c.

XML_SetReturnNSTriplet ( XML_Parser  parser,
int  do_nst 
)

Definition at line 1173 of file xmlparse.c.

{
  /* block after XML_Parse()/XML_ParseBuffer() has been called */
  if (parsing)
    return;
  ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
}
XML_SetSkippedEntityHandler ( XML_Parser  parser,
XML_SkippedEntityHandler  handler 
)
XML_SetStartCdataSectionHandler ( XML_Parser  parser,
XML_StartCdataSectionHandler  start 
)
XML_SetStartDoctypeDeclHandler ( XML_Parser  parser,
XML_StartDoctypeDeclHandler  start 
)
XML_SetStartElementHandler ( XML_Parser  ,
XML_StartElementHandler   
)
XML_SetStartNamespaceDeclHandler ( XML_Parser  parser,
XML_StartNamespaceDeclHandler  start 
)
XML_SetUnknownEncodingHandler ( XML_Parser  parser,
XML_UnknownEncodingHandler  handler,
void encodingHandlerData 
)
XML_SetUnparsedEntityDeclHandler ( XML_Parser  parser,
XML_UnparsedEntityDeclHandler  handler 
)

Definition at line 1335 of file xmlparse.c.

XML_SetUserData ( XML_Parser  parser,
void userData 
)

Definition at line 1182 of file xmlparse.c.

{
  if (handlerArg == userData)
    handlerArg = userData = p;
  else
    userData = p;
}
XML_SetXmlDeclHandler ( XML_Parser  parser,
XML_XmlDeclHandler  xmldecl 
)

Definition at line 1439 of file xmlparse.c.

XML_UseForeignDTD ( XML_Parser  parser,
XML_Bool  useDTD 
)

Definition at line 1149 of file xmlparse.c.

{
  handlerArg = parser;
}