|
ReactOS 0.4.16-dev-2232-gc2aaa52
|
#include "libxml.h"#include <string.h>#include <ctype.h>#include <stdlib.h>#include <libxml/xmlmemory.h>#include <libxml/tree.h>#include <libxml/parser.h>#include <libxml/parserInternals.h>#include <libxml/entities.h>#include <libxml/xmlerror.h>#include <libxml/encoding.h>#include <libxml/xmlIO.h>#include <libxml/uri.h>#include <libxml/dict.h>#include <libxml/xmlsave.h>#include <libxml/chvalid.h>#include "private/buf.h"#include "private/enc.h"#include "private/error.h"#include "private/io.h"#include "private/parser.h"
Go to the source code of this file.
Macros | |
| #define | IN_LIBXML |
| #define | XML_DIR_SEP '/' |
| #define | CUR(ctxt) ctxt->input->cur |
| #define | END(ctxt) ctxt->input->end |
| #define | XML_MAX_AMPLIFICATION_DEFAULT 5 |
| #define | LINE_LEN 80 |
Definition at line 39 of file parserInternals.c.
Definition at line 40 of file parserInternals.c.
| #define IN_LIBXML |
Definition at line 10 of file parserInternals.c.
| #define LINE_LEN 80 |
Definition at line 451 of file parserInternals.c.
| #define XML_DIR_SEP '/' |
Definition at line 16 of file parserInternals.c.
| #define XML_MAX_AMPLIFICATION_DEFAULT 5 |
Definition at line 52 of file parserInternals.c.
| void __xmlErrEncoding | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserErrors | xmlerr, | ||
| const char * | msg, | ||
| const xmlChar * | str1, | ||
| const xmlChar * | str2 | ||
| ) |
__xmlErrEncoding: @ctxt: an XML parser context @xmlerr: the error number @msg: the error message @str1: an string info @str2: an string info
Handle an encoding error
Definition at line 134 of file parserInternals.c.
Referenced by xmlCurrentChar(), xmlNextChar(), xmlSetDeclaredEncoding(), and xmlSwitchEncoding().
|
static |
xmlErrInternal: @ctxt: an XML parser context @msg: the error message @str: error information
Handle an internal error
Definition at line 161 of file parserInternals.c.
|
static |
xmlErrEncodingInt: @ctxt: an XML parser context @error: the error number @msg: the error message @val: an integer value
n encoding error
Definition at line 411 of file parserInternals.c.
xmlCheckVersion:
check the compiled lib version against the include one. This can warn or immediately kill the application
Definition at line 66 of file parserInternals.c.
| void xmlClearNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlClearNodeInfoSeq: @seq: a node info sequence pointer
DEPRECATED: Don't use.
– Clear (release memory and reinitialize) node info sequence
Definition at line 2210 of file parserInternals.c.
Referenced by xmlClearParserCtxt().
| void xmlClearParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlClearParserCtxt: @ctxt: an XML parser context
Clear (release owned resources) and reinitialize a parser context
Definition at line 2145 of file parserInternals.c.
xmlCopyChar: @len: Ignored, compatibility @out: pointer to an array of xmlChar @val: the char value
append the char value in the array
Returns the number of xmlChar written
Definition at line 1057 of file parserInternals.c.
Referenced by xmlParseAttValueComplex().
xmlCopyCharMultiByte: @out: pointer to an array of xmlChar @val: the char value
append the char value in the array
Returns the number of xmlChar written
Definition at line 1014 of file parserInternals.c.
Referenced by xmlCopyChar(), and xsltNumberFormatDecimal().
xmlCurrentChar: @ctxt: the XML parser context @len: pointer to the length of the char read
DEPRECATED: Internal function, do not use.
The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence "#xD#xA" or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)
Returns the current char value and its length
Definition at line 833 of file parserInternals.c.
|
static |
Definition at line 1074 of file parserInternals.c.
Referenced by xmlSwitchEncoding().
| void xmlDetectEncoding | ( | xmlParserCtxtPtr | ctxt | ) |
xmlDetectEncoding: @ctxt: the parser context
Handle optional BOM, detect and switch to encoding.
Assumes that there are at least four bytes in the input buffer.
Definition at line 1309 of file parserInternals.c.
Referenced by xmlLoadEntityContent(), xmlParseDocument(), xmlParseExternalEntityPrivate(), xmlParseExternalSubset(), xmlParseExtParsedEnt(), and xmlParsePEReference().
xmlErrMemory: @ctxt: an XML parser context @extra: extra information
Handle a redefinition of attribute error
Definition at line 102 of file parserInternals.c.
Referenced by inputPush(), nameNsPush(), namePush(), nodePush(), spacePush(), xmlAddDefAttrs(), xmlAddSpecialAttr(), xmlAttrNormalizeSpace2(), xmlCreateURLParserCtxt(), xmlCtxtGrowAttrs(), xmlDetectSAX2(), xmlInitSAXParserCtxt(), xmlLoadEntityContent(), xmlNewInputStream(), xmlNewSAXParserCtxt(), xmlNewStringInputStream(), xmlParseAttValueComplex(), xmlParseCDSect(), xmlParseComment(), xmlParseCommentComplex(), xmlParseConditionalSections(), xmlParseElementChildrenContentDeclPriv(), xmlParseEncName(), xmlParseEntityDecl(), xmlParseEntityValue(), xmlParseExternalSubset(), xmlParseName(), xmlParseNCName(), xmlParseNmtoken(), xmlParsePI(), xmlParsePubidLiteral(), xmlParserAddNodeInfo(), xmlParserGrow(), xmlParserNsGrow(), xmlParserNsPush(), xmlParseStartTag2(), xmlParseStringName(), xmlParseSystemLiteral(), xmlParseVersionNum(), xmlSAX2TextNode(), xmlSplitQName(), and xmlStringDecodeEntitiesInt().
| void xmlFatalErr | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserErrors | error, | ||
| const char * | info | ||
| ) |
xmlFatalErr: @ctxt: an XML parser context @error: the error number @info: extra information string
Handle a fatal parser error, i.e. violating Well-Formedness constraints
Definition at line 189 of file parserInternals.c.
Referenced by xmlCtxtResetPush(), xmlLoadEntityContent(), xmlParseAttValueComplex(), xmlParseAttValueInternal(), xmlParseBalancedChunkMemoryInternal(), xmlParseCDSect(), xmlParseCharDataComplex(), xmlParseCharDataInternal(), xmlParseCharRef(), xmlParseCommentComplex(), xmlParseConditionalSections(), xmlParseDocTypeDecl(), xmlParseDocument(), xmlParseElementChildrenContentDeclPriv(), xmlParseElementDecl(), xmlParseElementMixedContentDecl(), xmlParseEncName(), xmlParseEncodingDecl(), xmlParseEndTag2(), xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseEntityValue(), xmlParseEnumerationType(), xmlParseExternalEntityPrivate(), xmlParseExternalID(), xmlParseExternalSubset(), xmlParseExtParsedEnt(), xmlParseInNodeContext(), xmlParseInternalSubset(), xmlParseName(), xmlParseNameComplex(), xmlParseNCName(), xmlParseNCNameComplex(), xmlParseNmtoken(), xmlParseNotationDecl(), xmlParseNotationType(), xmlParsePEReference(), xmlParsePI(), xmlParsePITarget(), xmlParsePubidLiteral(), xmlParseReference(), xmlParserGrow(), xmlParserHandlePEReference(), xmlParseSDDecl(), xmlParseStartTag2(), xmlParseStringCharRef(), xmlParseStringEntityRef(), xmlParseStringName(), xmlParseStringPEReference(), xmlParseSystemLiteral(), xmlParseTextDecl(), xmlParseVersionInfo(), xmlParseXMLDecl(), xmlPopInput(), xmlPushInput(), and xmlStringDecodeEntitiesInt().
| void xmlFreeInputStream | ( | xmlParserInputPtr | input | ) |
xmlFreeInputStream: @input: an xmlParserInputPtr
Free up an input stream.
Definition at line 1519 of file parserInternals.c.
Referenced by xmlCtxtReset(), xmlFreeParserCtxt(), xmlHaltParser(), xmlInitSAXParserCtxt(), xmlLoadEntityContent(), xmlParsePEReference(), xmlPopInput(), xmlPushInput(), and xmlSAX2ExternalSubset().
| void xmlFreeParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlFreeParserCtxt: @ctxt: an XML parser context
Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.
Definition at line 2009 of file parserInternals.c.
Referenced by doparse(), internal_parseBuffer(), internal_parseStream(), xmlCreateDocParserCtxt(), xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlDoRead(), xmlNewSAXParserCtxt(), xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParseInNodeContext(), xmlReadFd(), xmlReadIO(), xslt_doc_default_loader(), and xsltDocDefaultLoaderFunc().
xmlGetActualEncoding: @ctxt: the parser context
Returns the actual used to parse the document. This can differ from the declared encoding.
Definition at line 1490 of file parserInternals.c.
Referenced by xmlSAX2EndDocument().
| void xmlHaltParser | ( | xmlParserCtxtPtr | ctxt | ) |
xmlHaltParser: @ctxt: an XML parser context
Blocks further parser processing don't override error for internal use
Definition at line 461 of file parserInternals.c.
Referenced by nodePush(), xmlCtxtResetPush(), xmlParseConditionalSections(), xmlParseElementStart(), xmlParseEntityDecl(), xmlParseExternalSubset(), xmlParseInternalSubset(), xmlParsePEReference(), xmlParseReference(), xmlParserEntityCheck(), xmlParserGrow(), xmlStopParser(), xmlStringDecodeEntitiesInt(), and xmlSwitchInputEncoding().
| void xmlInitNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlInitNodeInfoSeq: @seq: a node info sequence pointer
DEPRECATED: Don't use.
– Initialize (set to initial state) node info sequence
Definition at line 2191 of file parserInternals.c.
Referenced by xmlClearNodeInfoSeq(), xmlCtxtReset(), and xmlInitSAXParserCtxt().
| int xmlInitParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlInitParserCtxt: @ctxt: an XML parser context
DEPRECATED: Internal function which will be made private in a future version.
Initialize a parser context
Returns 0 in case of success and -1 in case of error
Definition at line 1995 of file parserInternals.c.
|
static |
xmlInitSAXParserCtxt: @ctxt: XML parser context @sax: SAX handlert @userData: user data
Initialize a SAX parser context
Returns 0 in case of success and -1 in case of error
Definition at line 1787 of file parserInternals.c.
Referenced by xmlInitParserCtxt(), and xmlNewSAXParserCtxt().
xmlIsLetter: : an unicode character (int)
Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic
Returns 0 if not, non-zero otherwise
Definition at line 440 of file parserInternals.c.
xmlKeepBlanksDefault: @val: int 0 or 1
DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
Set and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated.
Returns the last value for 0 for no substitution, 1 for substitution.
Definition at line 2426 of file parserInternals.c.
xmlLineNumbersDefault: @val: int 0 or 1
DEPRECATED: The modern options API always enables line numbers.
Set and return the previous value for enabling line numbers in elements contents. This may break on old application and is turned off by default.
Returns the last value for 0 for no substitution, 1 for substitution.
Definition at line 2368 of file parserInternals.c.
| xmlParserInputPtr xmlNewEntityInputStream | ( | xmlParserCtxtPtr | ctxt, |
| xmlEntityPtr | entity | ||
| ) |
xmlNewEntityInputStream: @ctxt: an XML parser context @entity: an Entity pointer
DEPRECATED: Internal function, do not use.
Create a new input stream based on an xmlEntityPtr
Returns the new input stream or NULL
Definition at line 1615 of file parserInternals.c.
Referenced by xmlParsePEReference().
xmlNewInputFromFile: @ctxt: an XML parser context @filename: the filename to use as entity
Create a new input stream based on a file or an URL.
Returns the new input stream or NULL in case of error
Definition at line 1720 of file parserInternals.c.
| xmlParserInputPtr xmlNewInputStream | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNewInputStream: @ctxt: an XML parser context
Create a new input stream structure.
Returns the new input stream or NULL
Definition at line 1541 of file parserInternals.c.
Referenced by xmlCreateDocParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCtxtResetPush(), xmlNewEntityInputStream(), xmlNewInputFromFile(), xmlNewIOInputStream(), and xmlNewStringInputStream().
| xmlParserInputPtr xmlNewIOInputStream | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserInputBufferPtr | input, | ||
| xmlCharEncoding | enc | ||
| ) |
xmlNewIOInputStream: @ctxt: an XML parser context @input: an I/O Input @enc: the charset encoding if known
Create a new input stream structure encapsulating the @input into a stream suitable for the parser.
Returns the new input stream or NULL
Definition at line 1581 of file parserInternals.c.
Referenced by import_loader_onDataAvailable(), xmlCreateIOParserCtxt(), xmlCtxtReadDoc(), xmlCtxtReadFd(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlReadFd(), and xmlReadIO().
| xmlParserCtxtPtr xmlNewParserCtxt | ( | void | ) |
xmlNewParserCtxt:
Allocate and initialize a new parser context.
Returns the xmlParserCtxtPtr or NULL
Definition at line 2097 of file parserInternals.c.
Referenced by xmlCreateDocParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlReadFd(), xmlReadIO(), xslt_doc_default_loader(), and xsltDocDefaultLoaderFunc().
xmlNewSAXParserCtxt: @sax: SAX handler @userData: user data
Allocate and initialize a new SAX parser context. If userData is NULL, the parser context will be passed as user data.
Returns the xmlParserCtxtPtr or NULL if memory allocation failed.
Definition at line 2114 of file parserInternals.c.
Referenced by xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), and xmlNewParserCtxt().
xmlNewStringInputStream: @ctxt: an XML parser context @buffer: an memory buffer
Create a new input stream based on a memory buffer. Returns the new input stream
Definition at line 1682 of file parserInternals.c.
Referenced by external_entity_loader().
| void xmlNextChar | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNextChar: @ctxt: the XML parser context
DEPRECATED: Internal function, do not use.
Skip to the next char input char.
Definition at line 709 of file parserInternals.c.
| void xmlParserAddNodeInfo | ( | xmlParserCtxtPtr | ctxt, |
| const xmlParserNodeInfoPtr | info | ||
| ) |
xmlParserAddNodeInfo: @ctxt: an XML parser context @info: a node info sequence pointer
DEPRECATED: Don't use.
Insert node info record into the sorted sequence
Definition at line 2273 of file parserInternals.c.
Referenced by xmlParseElementStart().
| const xmlParserNodeInfo * xmlParserFindNodeInfo | ( | const xmlParserCtxtPtr | ctx, |
| const xmlNodePtr | node | ||
| ) |
xmlParserFindNodeInfo: @ctx: an XML parser context @node: an XML node within the tree
DEPRECATED: Don't use.
Find the parser node info struct for a given node
Returns an xmlParserNodeInfo block pointer or NULL
Definition at line 2166 of file parserInternals.c.
Referenced by xmlParseElementEnd().
| unsigned long xmlParserFindNodeInfoIndex | ( | const xmlParserNodeInfoSeqPtr | seq, |
| const xmlNodePtr | node | ||
| ) |
xmlParserFindNodeInfoIndex: @seq: a node info sequence pointer @node: an XML node pointer
DEPRECATED: Don't use.
xmlParserFindNodeInfoIndex : Find the index that the info record for the given node is or should be at in a sorted sequence
Returns a long indicating the position of the record
Definition at line 2232 of file parserInternals.c.
Referenced by xmlParserAddNodeInfo(), and xmlParserFindNodeInfo().
| int xmlParserGrow | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParserGrow: @ctxt: an XML parser context
Grow the input buffer.
Returns the number of bytes read or -1 in case of error.
Definition at line 511 of file parserInternals.c.
Referenced by xmlCurrentChar(), xmlDetectEncoding(), xmlNextChar(), xmlPopInput(), and xmlSkipBlankChars().
xmlParserInputGrow: @in: an XML parser input @len: an indicative size for the lookahead
DEPRECATED: Don't use.
This function increase the input for the parser. It tries to preserve pointers to the input buffer, and keep already read data
Returns the amount of char read, or -1 in case of error, 0 indicate the end of this entity
Definition at line 567 of file parserInternals.c.
xmlParserInputRead: @in: an XML parser input @len: an indicative size for the lookahead
DEPRECATED: This function was internal and is deprecated.
Returns -1 as this is an error to use it.
Definition at line 498 of file parserInternals.c.
| void xmlParserInputShrink | ( | xmlParserInputPtr | in | ) |
xmlParserInputShrink: @in: an XML parser input
DEPRECATED: Don't use.
This function removes used input for the parser.
Definition at line 650 of file parserInternals.c.
| void xmlParserShrink | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParserShrink: @ctxt: an XML parser context
Shrink the input buffer.
Definition at line 607 of file parserInternals.c.
xmlPedanticParserDefault: @val: int 0 or 1
DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
Set and return the previous value for enabling pedantic warnings.
Returns the last value for 0 for no substitution, 1 for substitution.
Definition at line 2348 of file parserInternals.c.
xmlSetDeclaredEncoding: @ctxt: the parser context @encoding: declared encoding
Set the encoding from a declaration in the document.
If no encoding was set yet, switch the encoding. Otherwise, only warn about encoding mismatches.
Takes ownership of 'encoding'.
Definition at line 1414 of file parserInternals.c.
Referenced by xmlParseEncodingDecl().
xmlStringCurrentChar: @ctxt: the XML parser context @cur: pointer to the beginning of the char @len: pointer to the length of the char read
DEPRECATED: Internal function, do not use.
The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.
Returns the current char value and its length
Definition at line 990 of file parserInternals.c.
xmlSubstituteEntitiesDefault: @val: int 0 or 1
DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
Set and return the previous value for default entity support. Initially the parser always keep entity references instead of substituting entity values in the output. This function has to be used to change the default parser behavior SAX::substituteEntities() has to be used for changing that on a file by file basis.
Returns the last value for 0 for no substitution, 1 for substitution.
Definition at line 2392 of file parserInternals.c.
| int xmlSwitchEncoding | ( | xmlParserCtxtPtr | ctxt, |
| xmlCharEncoding | enc | ||
| ) |
xmlSwitchEncoding: @ctxt: the parser context @enc: the encoding value (number)
Use encoding specified by enum to decode input data.
This function can be used to enforce the encoding of chunks passed to xmlParseChunk.
Returns 0 in case of success, -1 otherwise
Definition at line 1146 of file parserInternals.c.
Referenced by doparse(), internal_parseBuffer(), xmlDetectEncoding(), and xmlNewIOInputStream().
| int xmlSwitchInputEncoding | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserInputPtr | input, | ||
| xmlCharEncodingHandlerPtr | handler | ||
| ) |
xmlSwitchInputEncoding: @ctxt: the parser context @input: the input stream @handler: the encoding handler
DEPRECATED: Internal function, don't use.
Use encoding handler to decode input data.
Returns 0 in case of success, -1 otherwise
Definition at line 1206 of file parserInternals.c.
Referenced by xmlSwitchEncoding(), and xmlSwitchToEncoding().
| int xmlSwitchToEncoding | ( | xmlParserCtxtPtr | ctxt, |
| xmlCharEncodingHandlerPtr | handler | ||
| ) |
xmlSwitchToEncoding: @ctxt: the parser context @handler: the encoding handler
Use encoding handler to decode input data.
This function can be used to enforce the encoding of chunks passed to xmlParseChunk.
Returns 0 in case of success, -1 otherwise
Definition at line 1293 of file parserInternals.c.
Referenced by xmlCtxtResetPush(), xmlDoRead(), xmlParseInNodeContext(), and xmlSetDeclaredEncoding().