ReactOS 0.4.16-dev-338-g34e76ad
|
#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/valid.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/SAX.h>
#include <libxml/globals.h>
#include <libxml/chvalid.h>
#include "buf.h"
#include "enc.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 | VALID_CTXT(ctxt) (CUR(ctxt) <= END(ctxt)) |
#define | LINE_LEN 80 |
#define | CHECK_BUFFER(in) |
Definition at line 254 of file parserInternals.c.
Definition at line 42 of file parserInternals.c.
Definition at line 43 of file parserInternals.c.
#define IN_LIBXML |
Definition at line 10 of file parserInternals.c.
#define LINE_LEN 80 |
Definition at line 229 of file parserInternals.c.
Definition at line 44 of file parserInternals.c.
#define XML_DIR_SEP '/' |
Definition at line 16 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 129 of file parserInternals.c.
Referenced by xmlCurrentChar(), xmlNextChar(), xmlStringCurrentChar(), and xmlSwitchEncoding().
|
static |
xmlErrInternal: @ctxt: an XML parser context @msg: the error message @str: error information
Handle an internal error
Definition at line 156 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 184 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 61 of file parserInternals.c.
void xmlClearNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlClearNodeInfoSeq: @seq: a node info sequence pointer
– Clear (release memory and reinitialize) node info sequence
Definition at line 1805 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 1746 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 852 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 809 of file parserInternals.c.
Referenced by xmlCopyChar(), and xsltNumberFormatDecimal().
int xmlCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
int * | len | ||
) |
xmlCurrentChar: @ctxt: the XML parser context @len: pointer to the length of the char read
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 542 of file parserInternals.c.
void xmlErrMemory | ( | xmlParserCtxtPtr | ctxt, |
const char * | extra | ||
) |
xmlErrMemory: @ctxt: an XML parser context @extra: extra information
Handle a redefinition of attribute error
Definition at line 97 of file parserInternals.c.
Referenced by inputPush(), nameNsPush(), namePush(), nodePush(), nsPush(), spacePush(), xmlAddDefAttrs(), xmlAddSpecialAttr(), xmlAttrNormalizeSpace2(), xmlCharStrndup(), xmlCreateIOParserCtxt(), xmlCreateURLParserCtxt(), xmlCtxtGrowAttrs(), xmlDetectSAX2(), xmlEscapeFormatString(), xmlInitParserCtxt(), xmlNewInputStream(), xmlNewParserCtxt(), xmlNewStringInputStream(), xmlParseAttValueComplex(), xmlParseCDSect(), xmlParseComment(), xmlParseCommentComplex(), xmlParseConditionalSections(), xmlParseElementChildrenContentDeclPriv(), xmlParseEncName(), xmlParseEntityDecl(), xmlParseEntityValue(), xmlParseExternalSubset(), xmlParseName(), xmlParseNCName(), xmlParseNmtoken(), xmlParsePI(), xmlParsePubidLiteral(), xmlParserAddNodeInfo(), xmlParseStartTag2(), xmlParseStringName(), xmlParseSystemLiteral(), xmlParseVersionNum(), xmlSAX2AttributeNs(), xmlSAX2TextNode(), xmlSplitQName(), xmlStringLenDecodeEntities(), xmlStrncat(), xmlStrncatNew(), and xmlStrndup().
void xmlFreeInputStream | ( | xmlParserInputPtr | input | ) |
xmlFreeInputStream: @input: an xmlParserInputPtr
Free up an input stream.
Definition at line 1192 of file parserInternals.c.
Referenced by xmlCtxtReset(), xmlFreeParserCtxt(), xmlHaltParser(), xmlInitParserCtxt(), 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 1629 of file parserInternals.c.
Referenced by main(), parseAndPrintFile(), testSAX(), xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlDoRead(), xmlNewParserCtxt(), xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParseInNodeContext(), xmlReadFd(), xmlReadIO(), and xsltDocDefaultLoaderFunc().
void xmlInitNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlInitNodeInfoSeq: @seq: a node info sequence pointer
– Initialize (set to initial state) node info sequence
Definition at line 1788 of file parserInternals.c.
Referenced by xmlClearNodeInfoSeq(), xmlCtxtReset(), and xmlInitParserCtxt().
int xmlInitParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlInitParserCtxt: @ctxt: an XML parser context
Initialize a parser context
Returns 0 in case of success and -1 in case of error
Definition at line 1444 of file parserInternals.c.
Referenced by xmlNewParserCtxt().
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 213 of file parserInternals.c.
xmlKeepBlanksDefault: @val: int 0 or 1
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 2010 of file parserInternals.c.
Referenced by main().
xmlLineNumbersDefault: @val: int 0 or 1
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 1956 of file parserInternals.c.
Referenced by main().
xmlParserInputPtr xmlNewEntityInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlEntityPtr | entity | ||
) |
xmlNewEntityInputStream: @ctxt: an XML parser context @entity: an Entity pointer
Create a new input stream based on an xmlEntityPtr
Returns the new input stream or NULL
Definition at line 1283 of file parserInternals.c.
Referenced by xmlLoadEntityContent(), and xmlParsePEReference().
xmlParserInputPtr xmlNewInputFromFile | ( | xmlParserCtxtPtr | ctxt, |
const char * | filename | ||
) |
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 1379 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 1215 of file parserInternals.c.
Referenced by 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 1251 of file parserInternals.c.
Referenced by testSAX(), xmlCreateIOParserCtxt(), 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 1715 of file parserInternals.c.
Referenced by main(), parseAndPrintFile(), testSAX(), xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlReadFd(), xmlReadIO(), and xsltDocDefaultLoaderFunc().
xmlParserInputPtr xmlNewStringInputStream | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | buffer | ||
) |
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 1346 of file parserInternals.c.
void xmlNextChar | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNextChar: @ctxt: the XML parser context
Skip to the next char input char.
Definition at line 380 of file parserInternals.c.
void xmlParserAddNodeInfo | ( | xmlParserCtxtPtr | ctxt, |
const xmlParserNodeInfoPtr | info | ||
) |
xmlParserAddNodeInfo: @ctxt: an XML parser context @info: a node info sequence pointer
Insert node info record into the sorted sequence
Definition at line 1865 of file parserInternals.c.
Referenced by xmlParseElementEnd(), xmlParseElementStart(), and xmlSAX2EndElementNs().
const xmlParserNodeInfo * xmlParserFindNodeInfo | ( | const xmlParserCtxtPtr | ctx, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfo: @ctx: an XML parser context @node: an XML node within the tree
Find the parser node info struct for a given node
Returns an xmlParserNodeInfo block pointer or NULL
Definition at line 1765 of file parserInternals.c.
unsigned long xmlParserFindNodeInfoIndex | ( | const xmlParserNodeInfoSeqPtr | seq, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfoIndex: @seq: a node info sequence pointer @node: an XML node pointer
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 1826 of file parserInternals.c.
Referenced by xmlParserAddNodeInfo(), and xmlParserFindNodeInfo().
int xmlParserInputGrow | ( | xmlParserInputPtr | in, |
int | len | ||
) |
xmlParserInputGrow: @in: an XML parser input @len: an indicative size for the lookahead
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 284 of file parserInternals.c.
Referenced by xmlCurrentChar(), xmlGROW(), xmlNextChar(), xmlPopInput(), xmlSHRINK(), and xmlSkipBlankChars().
int xmlParserInputRead | ( | xmlParserInputPtr in | ATTRIBUTE_UNUSED, |
int len | ATTRIBUTE_UNUSED | ||
) |
xmlParserInputRead: @in: an XML parser input @len: an indicative size for the lookahead
This function was internal and is deprecated.
Returns -1 as this is an error to use it.
Definition at line 268 of file parserInternals.c.
void xmlParserInputShrink | ( | xmlParserInputPtr | in | ) |
xmlParserInputShrink: @in: an XML parser input
This function removes used input for the parser.
Definition at line 327 of file parserInternals.c.
Referenced by xmlSHRINK().
xmlPedanticParserDefault: @val: int 0 or 1
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 1938 of file parserInternals.c.
Referenced by main().
int xmlStringCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | ||
int * | len | ||
) |
xmlStringCurrentChar: @ctxt: the XML parser context @cur: pointer to the beginning of the char @len: pointer to the length of the char read
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 700 of file parserInternals.c.
Referenced by xsltNumberFormatTokenize(), xsltScanLiteral(), and xsltScanNCName().
xmlSubstituteEntitiesDefault: @val: int 0 or 1
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 1978 of file parserInternals.c.
Referenced by main().
int xmlSwitchEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncoding | enc | ||
) |
xmlSwitchEncoding: @ctxt: the parser context @enc: the encoding value (number)
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
Definition at line 882 of file parserInternals.c.
Referenced by xmlCtxtResetPush(), xmlNewIOInputStream(), xmlParseDocument(), xmlParseExternalEntityPrivate(), xmlParseExternalSubset(), xmlParseExtParsedEnt(), xmlParsePEReference(), and xmlSAX2ExternalSubset().
int xmlSwitchInputEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | input, | ||
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchInputEncoding: @ctxt: the parser context @input: the input stream @handler: the encoding handler
DEPRECATED: Use xmlSwitchToEncoding
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
Definition at line 1156 of file parserInternals.c.
|
static |
xmlSwitchInputEncodingInt: @ctxt: the parser context @input: the input stream @handler: the encoding handler @len: the number of bytes to convert for the first line or -1
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
Definition at line 1014 of file parserInternals.c.
Referenced by xmlSwitchEncoding(), xmlSwitchInputEncoding(), and xmlSwitchToEncoding().
int xmlSwitchToEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchToEncoding: @ctxt: the parser context @handler: the encoding handler
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
Definition at line 1172 of file parserInternals.c.
Referenced by xmlCtxtResetPush(), xmlDoRead(), xmlParseEncodingDecl(), and xmlParseInNodeContext().