Eneboo - Documentación para desarrolladores
|
#include "libxml.h"
#include <string.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 "elfgcchack.h"
#define bottom_parserInternals |
#define CHECK_BUFFER | ( | in | ) |
#define IN_LIBXML |
#define LINE_LEN 80 |
#define XML_DIR_SEP '/' |
void __xmlErrEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlParserErrors | xmlerr, | ||
const char * | msg, | ||
const xmlChar * | str1, | ||
const xmlChar * | str2 | ||
) |
__xmlErrEncoding: : an XML parser context : the error number : the error message : an string info : an string info
Handle an encoding error
int xmlCharEncFirstLineInt | ( | xmlCharEncodingHandler * | handler, |
xmlBufferPtr | out, | ||
xmlBufferPtr | in, | ||
int | len | ||
) |
xmlCharEncFirstLineInt: : char enconding transformation data structure : an xmlBuffer for the output. : an xmlBuffer for the input : number of bytes to convert for the first line, or -1
Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.
Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or
void xmlCheckVersion | ( | int | version | ) |
xmlCheckVersion:
check the compiled lib version against the include one. This can warn or immediately kill the application
void xmlClearNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlClearNodeInfoSeq: : a node info sequence pointer
-- Clear (release memory and reinitialize) node info sequence
void xmlClearParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlClearParserCtxt: : an XML parser context
Clear (release owned resources) and reinitialize a parser context
xmlCopyChar: : Ignored, compatibility : pointer to an array of xmlChar : the char value
append the char value in the array
Returns the number of xmlChar written
xmlCopyCharMultiByte: : pointer to an array of xmlChar : the char value
append the char value in the array
Returns the number of xmlChar written
int xmlCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
int * | len | ||
) |
xmlCurrentChar: : the XML parser context : 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
void xmlErrMemory | ( | xmlParserCtxtPtr | ctxt, |
const char * | extra | ||
) |
xmlErrMemory: : an XML parser context : extra informations
Handle a redefinition of attribute error
void xmlFreeInputStream | ( | xmlParserInputPtr | input | ) |
xmlFreeInputStream: : an xmlParserInputPtr
Free up an input stream.
void xmlFreeParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlFreeParserCtxt: : an XML parser context
Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.
void xmlInitNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlInitNodeInfoSeq: : a node info sequence pointer
-- Initialize (set to initial state) node info sequence
int xmlInitParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlInitParserCtxt: : an XML parser context
Initialize a parser context
Returns 0 in case of success and -1 in case of error
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
xmlKeepBlanksDefault: : 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.
xmlLineNumbersDefault: : 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.
xmlParserInputPtr xmlNewEntityInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlEntityPtr | entity | ||
) |
xmlNewEntityInputStream: : an XML parser context : an Entity pointer
Create a new input stream based on an xmlEntityPtr
Returns the new input stream or NULL
xmlParserInputPtr xmlNewInputFromFile | ( | xmlParserCtxtPtr | ctxt, |
const char * | filename | ||
) |
xmlNewInputFromFile: : an XML parser context : 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
xmlParserInputPtr xmlNewInputStream | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNewInputStream: : an XML parser context
Create a new input stream structure Returns the new input stream or NULL
xmlParserInputPtr xmlNewIOInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputBufferPtr | input, | ||
xmlCharEncoding | enc | ||
) |
xmlNewIOInputStream: : an XML parser context : an I/O Input : the charset encoding if known
Create a new input stream structure encapsulating the into a stream suitable for the parser.
Returns the new input stream or NULL
xmlParserCtxtPtr xmlNewParserCtxt | ( | void | ) |
xmlNewParserCtxt:
Allocate and initialize a new parser context.
Returns the xmlParserCtxtPtr or NULL
xmlParserInputPtr xmlNewStringInputStream | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | buffer | ||
) |
xmlNewStringInputStream: : an XML parser context : an memory buffer
Create a new input stream based on a memory buffer. Returns the new input stream
void xmlNextChar | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNextChar: : the XML parser context
Skip to the next char input char.
void xmlParserAddNodeInfo | ( | xmlParserCtxtPtr | ctxt, |
const xmlParserNodeInfoPtr | info | ||
) |
xmlParserAddNodeInfo: : an XML parser context : a node info sequence pointer
Insert node info record into the sorted sequence
const xmlParserNodeInfo* xmlParserFindNodeInfo | ( | const xmlParserCtxtPtr | ctx, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfo: : an XML parser context : an XML node within the tree
Find the parser node info struct for a given node
Returns an xmlParserNodeInfo block pointer or NULL
unsigned long xmlParserFindNodeInfoIndex | ( | const xmlParserNodeInfoSeqPtr | seq, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfoIndex: : a node info sequence pointer : 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
int xmlParserInputGrow | ( | xmlParserInputPtr | in, |
int | len | ||
) |
xmlParserInputGrow: : an XML parser input : 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 number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity
int xmlParserInputRead | ( | xmlParserInputPtr | in, |
int | len | ||
) |
xmlParserInputRead: : an XML parser input : an indicative size for the lookahead
This function refresh the input for the parser. It doesn't try to preserve pointers to the input buffer, and discard already read data
Returns the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity
void xmlParserInputShrink | ( | xmlParserInputPtr | in | ) |
xmlParserInputShrink: : an XML parser input
This function removes used input for the parser.
xmlPedanticParserDefault: : 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.
int xmlStringCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | ||
int * | len | ||
) |
xmlStringCurrentChar: : the XML parser context : pointer to the beginning of the char : 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
xmlSubstituteEntitiesDefault: : 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.
int xmlSwitchEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncoding | enc | ||
) |
xmlSwitchEncoding: : the parser context : 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
int xmlSwitchInputEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | input, | ||
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchInputEncoding: : the parser context : the input stream : the encoding handler
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
int xmlSwitchToEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchToEncoding: : the parser context : the encoding handler
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise