feat(agent): scrape linked pages to ground answers in real content

Adds `_fetch_page_content()`, which downloads a URL with a
browser-like User-Agent and uses BeautifulSoup with the lxml
parser to strip scripts, navigation, and other non-content
markup, returning up to 3000 characters of readable text.

The response validator now also compares generated replies
against this scraped text, flagging named entities and claims
that do not appear in the retrieved page content.

Dependencies: adds beautifulsoup4==4.12.3 and pins lxml==5.3.0
for parser compatibility.
This commit is contained in:
2026-10-26 16:48:29 -03:00
parent 9eed02645b
commit 723ca1506b
231 changed files with 20508 additions and 5330 deletions
@@ -21,11 +21,6 @@
extern "C" {
#endif
/*
* Backward compatibility
*/
#define UTF8ToHtml htmlUTF8ToHtml
/*
* Most of the back-end structures from XML and HTML are shared.
*/
@@ -47,22 +42,31 @@ typedef struct _htmlElemDesc htmlElemDesc;
typedef htmlElemDesc *htmlElemDescPtr;
struct _htmlElemDesc {
const char *name; /* The tag name */
char startTag; /* unused */
char startTag; /* Whether the start tag can be implied */
char endTag; /* Whether the end tag can be implied */
char saveEndTag; /* Whether the end tag should be saved */
char empty; /* Is this an empty element ? */
char depr; /* unused */
char dtd; /* unused */
char depr; /* Is this a deprecated element ? */
char dtd; /* 1: only in Loose DTD, 2: only Frameset one */
char isinline; /* is this a block 0 or inline 1 element */
const char *desc; /* the description */
const char** subelts XML_DEPRECATED_MEMBER;
const char* defaultsubelt XML_DEPRECATED_MEMBER;
const char** attrs_opt XML_DEPRECATED_MEMBER;
const char** attrs_depr XML_DEPRECATED_MEMBER;
const char** attrs_req XML_DEPRECATED_MEMBER;
int dataMode;
/* NRK Jan.2003
* New fields encapsulating HTML structure
*
* Bugs:
* This is a very limited representation. It fails to tell us when
* an element *requires* subelements (we only have whether they're
* allowed or not), and it doesn't tell us where CDATA and PCDATA
* are allowed. Some element relationships are not fully represented:
* these are flagged with the word MODIFIER
*/
const char** subelts; /* allowed sub-elements of this element */
const char* defaultsubelt; /* subelement for suggested auto-repair
if necessary or NULL */
const char** attrs_opt; /* Optional Attributes */
const char** attrs_depr; /* Additional deprecated attributes */
const char** attrs_req; /* Required attributes */
};
/*
@@ -76,12 +80,22 @@ struct _htmlEntityDesc {
const char *desc; /* the description */
};
/** DOC_DISABLE */
#ifdef LIBXML_SAX1_ENABLED
#define XML_GLOBALS_HTML \
XML_OP(htmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED)
#else
#define XML_GLOBALS_HTML
#endif
XML_DEPRECATED
XMLPUBVAR const xmlSAXHandlerV1 htmlDefaultSAXHandler;
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_HTML
#undef XML_OP
#endif /* LIBXML_SAX1_ENABLED */
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define htmlDefaultSAXHandler XML_GLOBAL_MACRO(htmlDefaultSAXHandler)
#endif
/** DOC_ENABLE */
/*
* There is only few public functions.
@@ -96,11 +110,9 @@ XMLPUBFUN const htmlEntityDesc *
XMLPUBFUN const htmlEntityDesc *
htmlEntityValueLookup(unsigned int value);
XML_DEPRECATED
XMLPUBFUN int
htmlIsAutoClosed(htmlDocPtr doc,
htmlNodePtr elem);
XML_DEPRECATED
XMLPUBFUN int
htmlAutoCloseTag(htmlDocPtr doc,
const xmlChar *name,
@@ -150,7 +162,7 @@ XMLPUBFUN htmlDocPtr
htmlParseFile (const char *filename,
const char *encoding);
XMLPUBFUN int
htmlUTF8ToHtml (unsigned char *out,
UTF8ToHtml (unsigned char *out,
int *outlen,
const unsigned char *in,
int *inlen);
@@ -161,7 +173,6 @@ XMLPUBFUN int
int *inlen, int quoteChar);
XMLPUBFUN int
htmlIsScriptAttribute(const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN int
htmlHandleOmittedElem(int val);
@@ -196,26 +207,20 @@ XMLPUBFUN void
* to the xmlReadDoc() and similar calls.
*/
typedef enum {
HTML_PARSE_RECOVER = 1<<0, /* No effect */
HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */
HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
HTML_PARSE_PEDANTIC = 1<<7, /* No effect */
HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
HTML_PARSE_NONET = 1<<11,/* No effect */
HTML_PARSE_NONET = 1<<11,/* Forbid network access */
HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */
HTML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
HTML_PARSE_IGNORE_ENC=1<<21,/* ignore internal document encoding hint */
HTML_PARSE_BIG_LINES= 1<<22,/* Store big lines numbers in text PSVI field */
HTML_PARSE_HTML5 = 1<<26 /* HTML5 support */
HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
} htmlParserOption;
XMLPUBFUN void
htmlCtxtReset (htmlParserCtxtPtr ctxt);
XMLPUBFUN int
htmlCtxtSetOptions (htmlParserCtxtPtr ctxt,
int options);
XMLPUBFUN int
htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
int options);
@@ -246,9 +251,6 @@ XMLPUBFUN htmlDocPtr
const char *URL,
const char *encoding,
int options);
XMLPUBFUN htmlDocPtr
htmlCtxtParseDocument (htmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XMLPUBFUN htmlDocPtr
htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
const xmlChar *cur,
@@ -282,7 +284,7 @@ XMLPUBFUN htmlDocPtr
const char *encoding,
int options);
/* deprecated content model
/* NRK/Jan2003: further knowledge of HTML structure
*/
typedef enum {
HTML_NA = 0 , /* something we don't check at all */
@@ -295,14 +297,10 @@ typedef enum {
/* Using htmlElemDesc rather than name here, to emphasise the fact
that otherwise there's a lookup overhead
*/
XML_DEPRECATED
XMLPUBFUN htmlStatus htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
XML_DEPRECATED
XMLPUBFUN int htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
XML_DEPRECATED
XMLPUBFUN htmlStatus htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
XML_DEPRECATED
XMLPUBFUN htmlStatus htmlNodeStatus(htmlNodePtr, int) ;
XMLPUBFUN htmlStatus htmlNodeStatus(const htmlNodePtr, int) ;
/**
* htmlDefaultSubelement:
* @elt: HTML element
@@ -335,5 +333,11 @@ XMLPUBFUN htmlStatus htmlNodeStatus(htmlNodePtr, int) ;
}
#endif
#else /* LIBXML_HTML_ENABLED */
/** DOC_DISABLE */
#define XML_GLOBALS_HTML
/** DOC_ENABLE */
#endif /* LIBXML_HTML_ENABLED */
#endif /* __HTML_PARSER_H__ */
@@ -133,7 +133,6 @@ XMLPUBFUN void
#endif /* LIBXML_OUTPUT_ENABLED */
XML_DEPRECATED
XMLPUBFUN int
htmlIsBooleanAttr (const xmlChar *name);
@@ -8,11 +8,195 @@
* Author: Daniel Veillard
*/
#ifndef __XML_SAX_H__
#define __XML_SAX_H__
#ifdef __GNUC__
#warning "libxml/SAX.h is deprecated"
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#ifdef LIBXML_LEGACY_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
XML_DEPRECATED
XMLPUBFUN const xmlChar *
getPublicId (void *ctx);
XML_DEPRECATED
XMLPUBFUN const xmlChar *
getSystemId (void *ctx);
XML_DEPRECATED
XMLPUBFUN void
setDocumentLocator (void *ctx,
xmlSAXLocatorPtr loc);
XML_DEPRECATED
XMLPUBFUN int
getLineNumber (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
getColumnNumber (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
isStandalone (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
hasInternalSubset (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
hasExternalSubset (void *ctx);
XML_DEPRECATED
XMLPUBFUN void
internalSubset (void *ctx,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID);
XML_DEPRECATED
XMLPUBFUN void
externalSubset (void *ctx,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID);
XML_DEPRECATED
XMLPUBFUN xmlEntityPtr
getEntity (void *ctx,
const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN xmlEntityPtr
getParameterEntity (void *ctx,
const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN xmlParserInputPtr
resolveEntity (void *ctx,
const xmlChar *publicId,
const xmlChar *systemId);
XML_DEPRECATED
XMLPUBFUN void
entityDecl (void *ctx,
const xmlChar *name,
int type,
const xmlChar *publicId,
const xmlChar *systemId,
xmlChar *content);
XML_DEPRECATED
XMLPUBFUN void
attributeDecl (void *ctx,
const xmlChar *elem,
const xmlChar *fullname,
int type,
int def,
const xmlChar *defaultValue,
xmlEnumerationPtr tree);
XML_DEPRECATED
XMLPUBFUN void
elementDecl (void *ctx,
const xmlChar *name,
int type,
xmlElementContentPtr content);
XML_DEPRECATED
XMLPUBFUN void
notationDecl (void *ctx,
const xmlChar *name,
const xmlChar *publicId,
const xmlChar *systemId);
XML_DEPRECATED
XMLPUBFUN void
unparsedEntityDecl (void *ctx,
const xmlChar *name,
const xmlChar *publicId,
const xmlChar *systemId,
const xmlChar *notationName);
XML_DEPRECATED
XMLPUBFUN void
startDocument (void *ctx);
XML_DEPRECATED
XMLPUBFUN void
endDocument (void *ctx);
XML_DEPRECATED
XMLPUBFUN void
attribute (void *ctx,
const xmlChar *fullname,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN void
startElement (void *ctx,
const xmlChar *fullname,
const xmlChar **atts);
XML_DEPRECATED
XMLPUBFUN void
endElement (void *ctx,
const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN void
reference (void *ctx,
const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN void
characters (void *ctx,
const xmlChar *ch,
int len);
XML_DEPRECATED
XMLPUBFUN void
ignorableWhitespace (void *ctx,
const xmlChar *ch,
int len);
XML_DEPRECATED
XMLPUBFUN void
processingInstruction (void *ctx,
const xmlChar *target,
const xmlChar *data);
XML_DEPRECATED
XMLPUBFUN void
globalNamespace (void *ctx,
const xmlChar *href,
const xmlChar *prefix);
XML_DEPRECATED
XMLPUBFUN void
setNamespace (void *ctx,
const xmlChar *name);
XML_DEPRECATED
XMLPUBFUN xmlNsPtr
getNamespace (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
checkNamespace (void *ctx,
xmlChar *nameSpace);
XML_DEPRECATED
XMLPUBFUN void
namespaceDecl (void *ctx,
const xmlChar *href,
const xmlChar *prefix);
XML_DEPRECATED
XMLPUBFUN void
comment (void *ctx,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN void
cdataBlock (void *ctx,
const xmlChar *value,
int len);
#ifdef LIBXML_SAX1_ENABLED
XML_DEPRECATED
XMLPUBFUN void
initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
int warning);
#ifdef LIBXML_HTML_ENABLED
XML_DEPRECATED
XMLPUBFUN void
inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
#endif
#endif /* LIBXML_SAX1_ENABLED */
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_LEGACY_ENABLED */
#endif /* __XML_SAX_H__ */
@@ -95,15 +95,16 @@ XMLPUBFUN void
xmlSAX2StartDocument (void *ctx);
XMLPUBFUN void
xmlSAX2EndDocument (void *ctx);
XML_DEPRECATED
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN void
xmlSAX2StartElement (void *ctx,
const xmlChar *fullname,
const xmlChar **atts);
XML_DEPRECATED
XMLPUBFUN void
xmlSAX2EndElement (void *ctx,
const xmlChar *name);
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
XMLPUBFUN void
xmlSAX2StartElementNs (void *ctx,
const xmlChar *localname,
@@ -39,7 +39,18 @@ extern "C" {
* a) default attributes (if any) are added to all nodes
* b) all character and parsed entity references are resolved
* In order to achieve this in libxml2 the document MUST be loaded with
* following options: XML_PARSE_DTDATTR | XML_PARSE_NOENT
* following global settings:
*
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* xmlSubstituteEntitiesDefault(1);
*
* or corresponding parser context setting:
* xmlParserCtxtPtr ctxt;
*
* ...
* ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* ctxt->replaceEntities = 1;
* ...
*/
/*
@@ -161,7 +161,6 @@ XMLPUBFUN xmlChar *
*/
XMLPUBFUN int
xmlCatalogSetDebug (int level);
XML_DEPRECATED
XMLPUBFUN xmlCatalogPrefer
xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
XMLPUBFUN void
@@ -71,6 +71,144 @@ XMLPUBFUN int
xmlDebugCheckDocument (FILE * output,
xmlDocPtr doc);
/****************************************************************
* *
* XML shell helpers *
* *
****************************************************************/
XMLPUBFUN void
xmlLsOneNode (FILE *output, xmlNodePtr node);
XMLPUBFUN int
xmlLsCountNode (xmlNodePtr node);
XMLPUBFUN const char *
xmlBoolToText (int boolval);
/****************************************************************
* *
* The XML shell related structures and functions *
* *
****************************************************************/
#ifdef LIBXML_XPATH_ENABLED
/**
* xmlShellReadlineFunc:
* @prompt: a string prompt
*
* This is a generic signature for the XML shell input function.
*
* Returns a string which will be freed by the Shell.
*/
typedef char * (* xmlShellReadlineFunc)(char *prompt);
/**
* xmlShellCtxt:
*
* A debugging shell context.
* TODO: add the defined function tables.
*/
typedef struct _xmlShellCtxt xmlShellCtxt;
typedef xmlShellCtxt *xmlShellCtxtPtr;
struct _xmlShellCtxt {
char *filename;
xmlDocPtr doc;
xmlNodePtr node;
xmlXPathContextPtr pctxt;
int loaded;
FILE *output;
xmlShellReadlineFunc input;
};
/**
* xmlShellCmd:
* @ctxt: a shell context
* @arg: a string argument
* @node: a first node
* @node2: a second node
*
* This is a generic signature for the XML shell functions.
*
* Returns an int, negative returns indicating errors.
*/
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN void
xmlShellPrintXPathError (int errorType,
const char *arg);
XMLPUBFUN void
xmlShellPrintXPathResult(xmlXPathObjectPtr list);
XMLPUBFUN int
xmlShellList (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellBase (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellDir (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellLoad (xmlShellCtxtPtr ctxt,
char *filename,
xmlNodePtr node,
xmlNodePtr node2);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void
xmlShellPrintNode (xmlNodePtr node);
XMLPUBFUN int
xmlShellCat (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellWrite (xmlShellCtxtPtr ctxt,
char *filename,
xmlNodePtr node,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellSave (xmlShellCtxtPtr ctxt,
char *filename,
xmlNodePtr node,
xmlNodePtr node2);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN int
xmlShellValidate (xmlShellCtxtPtr ctxt,
char *dtd,
xmlNodePtr node,
xmlNodePtr node2);
#endif /* LIBXML_VALID_ENABLED */
XMLPUBFUN int
xmlShellDu (xmlShellCtxtPtr ctxt,
char *arg,
xmlNodePtr tree,
xmlNodePtr node2);
XMLPUBFUN int
xmlShellPwd (xmlShellCtxtPtr ctxt,
char *buffer,
xmlNodePtr node,
xmlNodePtr node2);
/*
* The Shell interface.
*/
XMLPUBFUN void
xmlShell (xmlDocPtr doc,
char *filename,
xmlShellReadlineFunc input,
FILE *output);
#endif /* LIBXML_XPATH_ENABLED */
#ifdef __cplusplus
}
#endif
@@ -23,30 +23,44 @@
#define __XML_CHAR_ENCODING_H__
#include <libxml/xmlversion.h>
#include <libxml/xmlerror.h>
#ifdef LIBXML_ICONV_ENABLED
#include <iconv.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Backward compatibility
*/
#define UTF8Toisolat1 xmlUTF8ToIsolat1
#define isolat1ToUTF8 xmlIsolat1ToUTF8
typedef enum {
XML_ENC_ERR_SUCCESS = 0,
XML_ENC_ERR_INTERNAL = -1,
XML_ENC_ERR_SPACE = -1,
XML_ENC_ERR_INPUT = -2,
XML_ENC_ERR_SPACE = -3,
XML_ENC_ERR_MEMORY = -4
XML_ENC_ERR_PARTIAL = -3,
XML_ENC_ERR_INTERNAL = -4,
XML_ENC_ERR_MEMORY = -5
} xmlCharEncError;
/*
* xmlCharEncoding:
*
* Predefined values for some standard encodings.
* Libxml does not do beforehand translation on UTF8 and ISOLatinX.
* It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
*
* Anything else would have to be translated to UTF8 before being
* given to the parser itself. The BOM for UTF16 and the encoding
* declaration are looked at and a converter is looked for at that
* point. If not found the parser stops here as asked by the XML REC. A
* converter can be registered by the user using xmlRegisterCharEncodingHandler
* but the current form doesn't allow stateful transcoding (a serious
* problem agreed !). If iconv has been found it will be used
* automatically and allow stateful transcoding, the simplest is then
* to be sure to enable iconv and to provide iconv libs for the encoding
* support needed.
*
* Note that the generic "UTF-16" is not a predefined value. Instead, only
* the specific UTF-16LE and UTF-16BE are present.
*/
typedef enum {
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
@@ -72,23 +86,9 @@ typedef enum {
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22,/* pure ASCII */
/* Available since 2.14.0 */
XML_CHAR_ENCODING_UTF16= 23,/* UTF-16 native */
XML_CHAR_ENCODING_HTML= 24,/* HTML (output only) */
XML_CHAR_ENCODING_8859_10= 25,/* ISO-8859-10 */
XML_CHAR_ENCODING_8859_11= 26,/* ISO-8859-11 */
XML_CHAR_ENCODING_8859_13= 27,/* ISO-8859-13 */
XML_CHAR_ENCODING_8859_14= 28,/* ISO-8859-14 */
XML_CHAR_ENCODING_8859_15= 29,/* ISO-8859-15 */
XML_CHAR_ENCODING_8859_16= 30 /* ISO-8859-16 */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
} xmlCharEncoding;
typedef enum {
XML_ENC_INPUT = (1 << 0),
XML_ENC_OUTPUT = (1 << 1)
} xmlCharEncFlags;
/**
* xmlCharEncodingInputFunc:
* @out: a pointer to an array of bytes to store the UTF-8 result
@@ -96,15 +96,17 @@ typedef enum {
* @in: a pointer to an array of chars in the original encoding
* @inlen: the length of @in
*
* Convert characters to UTF-8.
* Take a block of chars in the original encoding and try to convert
* it to an UTF-8 block of chars out.
*
* On success, the value of @inlen after return is the number of
* bytes consumed and @outlen is the number of bytes produced.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* Returns the number of bytes written, -1 if lack of space, or -2
* if the transcoding failed.
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of octets consumed.
*/
typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
/**
@@ -114,92 +116,41 @@ typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
* @in: a pointer to an array of UTF-8 chars
* @inlen: the length of @in
*
* Convert characters from UTF-8.
* Take a block of UTF-8 chars in and try to convert it to another
* encoding.
* Note: a first call designed to produce heading info is called with
* in = NULL. If stateful this should also initialize the encoder state.
*
* On success, the value of @inlen after return is the number of
* bytes consumed and @outlen is the number of bytes produced.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* Returns the number of bytes written, -1 if lack of space, or -2
* if the transcoding failed.
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of octets produced.
*/
typedef int (*xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
/**
* xmlCharEncConvFunc:
* @vctxt: conversion context
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of input bytes
* @inlen: the length of @in
* @flush: end of input
*
* Convert between character encodings.
*
* The value of @inlen after return is the number of bytes consumed
* and @outlen is the number of bytes produced.
*
* If the converter can consume partial multi-byte sequences, the
* @flush flag can be used to detect truncated sequences at EOF.
* Otherwise, the flag can be ignored.
*
* Returns an XML_ENC_ERR code.
*/
typedef xmlCharEncError
(*xmlCharEncConvFunc)(void *vctxt, unsigned char *out, int *outlen,
const unsigned char *in, int *inlen, int flush);
/**
* xmlCharEncConvCtxtDtor:
* @vctxt: conversion context
*
* Free a conversion context.
*/
typedef void
(*xmlCharEncConvCtxtDtor)(void *vctxt);
/*
* Block defining the handlers for non UTF-8 encodings.
*
* This structure will be made private.
* If iconv is supported, there are two extra fields.
*/
typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
struct _xmlCharEncodingHandler {
char *name XML_DEPRECATED_MEMBER;
union {
xmlCharEncConvFunc func;
xmlCharEncodingInputFunc legacyFunc;
} input XML_DEPRECATED_MEMBER;
union {
xmlCharEncConvFunc func;
xmlCharEncodingOutputFunc legacyFunc;
} output XML_DEPRECATED_MEMBER;
void *inputCtxt XML_DEPRECATED_MEMBER;
void *outputCtxt XML_DEPRECATED_MEMBER;
xmlCharEncConvCtxtDtor ctxtDtor XML_DEPRECATED_MEMBER;
int flags XML_DEPRECATED_MEMBER;
char *name;
xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output;
#ifdef LIBXML_ICONV_ENABLED
iconv_t iconv_in;
iconv_t iconv_out;
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
struct _uconv_t *uconv_in;
struct _uconv_t *uconv_out;
#endif /* LIBXML_ICU_ENABLED */
};
/**
* xmlCharEncConvImpl:
* @vctxt: user data
* @name: encoding name
* @flags: bit mask of flags
* @out: pointer to resulting handler
*
* If this function returns XML_ERR_OK, it must fill the @out
* pointer with an encoding handler. The handler can be obtained
* from xmlCharEncNewCustomHandler.
*
* @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
*
* Returns an xmlParserErrors code.
*/
typedef xmlParserErrors
(*xmlCharEncConvImpl)(void *vctxt, const char *name, xmlCharEncFlags flags,
xmlCharEncodingHandler **out);
/*
* Interfaces for encoding handlers.
*/
@@ -211,19 +162,6 @@ XMLPUBFUN void
xmlCleanupCharEncodingHandlers (void);
XMLPUBFUN void
xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
XMLPUBFUN xmlParserErrors
xmlLookupCharEncodingHandler (xmlCharEncoding enc,
xmlCharEncodingHandlerPtr *out);
XMLPUBFUN xmlParserErrors
xmlOpenCharEncodingHandler (const char *name,
int output,
xmlCharEncodingHandlerPtr *out);
XMLPUBFUN xmlParserErrors
xmlCreateCharEncodingHandler (const char *name,
xmlCharEncFlags flags,
xmlCharEncConvImpl impl,
void *implCtxt,
xmlCharEncodingHandlerPtr *out);
XMLPUBFUN xmlCharEncodingHandlerPtr
xmlGetCharEncodingHandler (xmlCharEncoding enc);
XMLPUBFUN xmlCharEncodingHandlerPtr
@@ -232,14 +170,6 @@ XMLPUBFUN xmlCharEncodingHandlerPtr
xmlNewCharEncodingHandler (const char *name,
xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output);
XMLPUBFUN xmlParserErrors
xmlCharEncNewCustomHandler (const char *name,
xmlCharEncConvFunc input,
xmlCharEncConvFunc output,
xmlCharEncConvCtxtDtor ctxtDtor,
void *inputCtxt,
void *outputCtxt,
xmlCharEncodingHandler **out);
/*
* Interfaces for encoding names and aliases.
@@ -265,9 +195,7 @@ XMLPUBFUN xmlCharEncoding
xmlDetectCharEncoding (const unsigned char *in,
int len);
/** DOC_DISABLE */
struct _xmlBuffer;
/** DOC_ENABLE */
XMLPUBFUN int
xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
struct _xmlBuffer *out,
@@ -290,13 +218,13 @@ XMLPUBFUN int
*/
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int
xmlUTF8ToIsolat1 (unsigned char *out,
UTF8Toisolat1 (unsigned char *out,
int *outlen,
const unsigned char *in,
int *inlen);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int
xmlIsolat1ToUTF8 (unsigned char *out,
isolat1ToUTF8 (unsigned char *out,
int *outlen,
const unsigned char *in,
int *inlen);
@@ -11,12 +11,10 @@
#ifndef __XML_ENTITIES_H__
#define __XML_ENTITIES_H__
/** DOC_DISABLE */
#include <libxml/xmlversion.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS
/** DOC_ENABLE */
#ifdef __cplusplus
extern "C" {
@@ -59,7 +57,7 @@ struct _xmlEntity {
struct _xmlEntity *nexte; /* unused */
const xmlChar *URI; /* the full URI as computed */
int owner; /* unused */
int owner; /* does the entity own the childrens */
int flags; /* various flags */
unsigned long expandedSize; /* expanded size */
};
@@ -76,6 +74,12 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
* External functions:
*/
#ifdef LIBXML_LEGACY_ENABLED
XML_DEPRECATED
XMLPUBFUN void
xmlInitializePredefinedEntities (void);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlEntityPtr
xmlNewEntity (xmlDocPtr doc,
const xmlChar *name,
@@ -85,15 +89,6 @@ XMLPUBFUN xmlEntityPtr
const xmlChar *content);
XMLPUBFUN void
xmlFreeEntity (xmlEntityPtr entity);
XMLPUBFUN int
xmlAddEntity (xmlDocPtr doc,
int extSubset,
const xmlChar *name,
int type,
const xmlChar *ExternalID,
const xmlChar *SystemID,
const xmlChar *content,
xmlEntityPtr *out);
XMLPUBFUN xmlEntityPtr
xmlAddDocEntity (xmlDocPtr doc,
const xmlChar *name,
@@ -119,6 +114,12 @@ XMLPUBFUN xmlEntityPtr
XMLPUBFUN xmlEntityPtr
xmlGetParameterEntity (xmlDocPtr doc,
const xmlChar *name);
#ifdef LIBXML_LEGACY_ENABLED
XML_DEPRECATED
XMLPUBFUN const xmlChar *
xmlEncodeEntities (xmlDocPtr doc,
const xmlChar *input);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlChar *
xmlEncodeEntitiesReentrant(xmlDocPtr doc,
const xmlChar *input);
@@ -127,8 +128,10 @@ XMLPUBFUN xmlChar *
const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr
xmlCreateEntitiesTable (void);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEntitiesTablePtr
xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
@@ -139,6 +142,11 @@ XMLPUBFUN void
xmlDumpEntityDecl (xmlBufferPtr buf,
xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_LEGACY_ENABLED
XMLPUBFUN void
xmlCleanupPredefinedEntities(void);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef __cplusplus
}
@@ -22,4 +22,20 @@
#include <libxml/xmlsave.h>
#include <libxml/threads.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;
XML_DEPRECATED XMLPUBFUN void
xmlInitializeGlobalState(xmlGlobalStatePtr gs);
XML_DEPRECATED XMLPUBFUN
xmlGlobalStatePtr xmlGetGlobalState(void);
#ifdef __cplusplus
}
#endif
#endif /* __XML_GLOBALS_H */
@@ -109,10 +109,6 @@ XMLPUBFUN void
/*
* Add a new entry to the hash table.
*/
XMLPUBFUN int
xmlHashAdd (xmlHashTablePtr hash,
const xmlChar *name,
void *userdata);
XMLPUBFUN int
xmlHashAddEntry (xmlHashTablePtr hash,
const xmlChar *name,
@@ -122,11 +118,6 @@ XMLPUBFUN int
const xmlChar *name,
void *userdata,
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashAdd2 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
void *userdata);
XMLPUBFUN int
xmlHashAddEntry2 (xmlHashTablePtr hash,
const xmlChar *name,
@@ -138,12 +129,6 @@ XMLPUBFUN int
const xmlChar *name2,
void *userdata,
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashAdd3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
void *userdata);
XMLPUBFUN int
xmlHashAddEntry3 (xmlHashTablePtr hash,
const xmlChar *name,
@@ -214,10 +199,6 @@ XMLPUBFUN void *
/*
* Helpers.
*/
XMLPUBFUN xmlHashTablePtr
xmlHashCopySafe (xmlHashTablePtr hash,
xmlHashCopier copy,
xmlHashDeallocator dealloc);
XMLPUBFUN xmlHashTablePtr
xmlHashCopy (xmlHashTablePtr hash,
xmlHashCopier copy);
@@ -119,10 +119,10 @@ XMLPUBFUN void
xmlListMerge (xmlListPtr l1,
xmlListPtr l2);
XMLPUBFUN xmlListPtr
xmlListDup (xmlListPtr old);
xmlListDup (const xmlListPtr old);
XMLPUBFUN int
xmlListCopy (xmlListPtr cur,
xmlListPtr old);
const xmlListPtr old);
/* Link operators */
XMLPUBFUN void *
xmlLinkGetData (xmlLinkPtr lk);
@@ -1,5 +1,8 @@
/*
* Summary: Removed legacy symbols for an outdated FTP client
* Summary: minimal FTP implementation
* Description: minimal FTP implementation allowing to fetch resources
* like external subset. This module is DEPRECATED, do not
* use any of its functions.
*
* Copy: See Copyright for the status of this software.
*
@@ -9,8 +12,175 @@
#ifndef __NANO_FTP_H__
#define __NANO_FTP_H__
#ifdef __GNUC__
#warning "libxml/nanoftp.h is deprecated"
#include <libxml/xmlversion.h>
#if defined(LIBXML_FTP_ENABLED)
/* Needed for portability to Windows 64 bits */
#if defined(_WIN32)
#include <winsock2.h>
#else
/**
* SOCKET:
*
* macro used to provide portability of code to windows sockets
*/
#define SOCKET int
/**
* INVALID_SOCKET:
*
* macro used to provide portability of code to windows sockets
* the value to be used when the socket is not valid
*/
#undef INVALID_SOCKET
#define INVALID_SOCKET (-1)
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* ftpListCallback:
* @userData: user provided data for the callback
* @filename: the file name (including "->" when links are shown)
* @attrib: the attribute string
* @owner: the owner string
* @group: the group string
* @size: the file size
* @links: the link count
* @year: the year
* @month: the month
* @day: the day
* @hour: the hour
* @minute: the minute
*
* A callback for the xmlNanoFTPList command.
* Note that only one of year and day:minute are specified.
*/
typedef void (*ftpListCallback) (void *userData,
const char *filename, const char *attrib,
const char *owner, const char *group,
unsigned long size, int links, int year,
const char *month, int day, int hour,
int minute);
/**
* ftpDataCallback:
* @userData: the user provided context
* @data: the data received
* @len: its size in bytes
*
* A callback for the xmlNanoFTPGet command.
*/
typedef void (*ftpDataCallback) (void *userData,
const char *data,
int len);
/*
* Init
*/
XML_DEPRECATED
XMLPUBFUN void
xmlNanoFTPInit (void);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoFTPCleanup (void);
/*
* Creating/freeing contexts.
*/
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoFTPNewCtxt (const char *URL);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoFTPFreeCtxt (void * ctx);
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoFTPConnectTo (const char *server,
int port);
/*
* Opening/closing session connections.
*/
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoFTPOpen (const char *URL);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPConnect (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPClose (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPQuit (void *ctx);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoFTPScanProxy (const char *URL);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoFTPProxy (const char *host,
int port,
const char *user,
const char *passwd,
int type);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPUpdateURL (void *ctx,
const char *URL);
/*
* Rather internal commands.
*/
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPGetResponse (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPCheckResponse (void *ctx);
/*
* CD/DIR/GET handlers.
*/
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPCwd (void *ctx,
const char *directory);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPDele (void *ctx,
const char *file);
XML_DEPRECATED
XMLPUBFUN SOCKET
xmlNanoFTPGetConnection (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPCloseConnection(void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPList (void *ctx,
ftpListCallback callback,
void *userData,
const char *filename);
XML_DEPRECATED
XMLPUBFUN SOCKET
xmlNanoFTPGetSocket (void *ctx,
const char *filename);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPGet (void *ctx,
ftpDataCallback callback,
void *userData,
const char *filename);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoFTPRead (void *ctx,
void *dest,
int len);
#ifdef __cplusplus
}
#endif
#endif /* defined(LIBXML_FTP_ENABLED) || defined(LIBXML_LEGACY_ENABLED) */
#endif /* __NANO_FTP_H__ */
@@ -18,21 +18,16 @@
#ifdef __cplusplus
extern "C" {
#endif
XML_DEPRECATED
XMLPUBFUN void
xmlNanoHTTPInit (void);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoHTTPCleanup (void);
XML_DEPRECATED
XMLPUBFUN void
xmlNanoHTTPScanProxy (const char *URL);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoHTTPFetch (const char *URL,
const char *filename,
char **contentType);
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoHTTPMethod (const char *URL,
const char *method,
@@ -40,7 +35,6 @@ XMLPUBFUN void *
char **contentType,
const char *headers,
int ilen);
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoHTTPMethodRedir (const char *URL,
const char *method,
@@ -49,45 +43,34 @@ XMLPUBFUN void *
char **redir,
const char *headers,
int ilen);
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoHTTPOpen (const char *URL,
char **contentType);
XML_DEPRECATED
XMLPUBFUN void *
xmlNanoHTTPOpenRedir (const char *URL,
char **contentType,
char **redir);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoHTTPReturnCode (void *ctx);
XML_DEPRECATED
XMLPUBFUN const char *
xmlNanoHTTPAuthHeader (void *ctx);
XML_DEPRECATED
XMLPUBFUN const char *
xmlNanoHTTPRedir (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoHTTPContentLength( void * ctx );
XML_DEPRECATED
XMLPUBFUN const char *
xmlNanoHTTPEncoding (void *ctx);
XML_DEPRECATED
XMLPUBFUN const char *
xmlNanoHTTPMimeType (void *ctx);
XML_DEPRECATED
XMLPUBFUN int
xmlNanoHTTPRead (void *ctx,
void *dest,
int len);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN int
xmlNanoHTTPSave (void *ctxt,
const char *filename);
#endif /* LIBXML_OUTPUT_ENABLED */
XML_DEPRECATED
XMLPUBFUN void
xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus
@@ -10,7 +10,6 @@
#ifndef __XML_PARSER_H__
#define __XML_PARSER_H__
/** DOC_DISABLE */
#include <libxml/xmlversion.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
@@ -27,7 +26,6 @@
/* for compatibility */
#include <libxml/SAX2.h>
#include <libxml/threads.h>
/** DOC_ENABLE */
#ifdef __cplusplus
extern "C" {
@@ -40,30 +38,6 @@ extern "C" {
*/
#define XML_DEFAULT_VERSION "1.0"
typedef enum {
XML_STATUS_NOT_WELL_FORMED = (1 << 0),
XML_STATUS_NOT_NS_WELL_FORMED = (1 << 1),
XML_STATUS_DTD_VALIDATION_FAILED = (1 << 2),
XML_STATUS_CATASTROPHIC_ERROR = (1 << 3)
} xmlParserStatus;
typedef enum {
XML_RESOURCE_UNKNOWN = 0,
XML_RESOURCE_MAIN_DOCUMENT,
XML_RESOURCE_DTD,
XML_RESOURCE_GENERAL_ENTITY,
XML_RESOURCE_PARAMETER_ENTITY,
XML_RESOURCE_XINCLUDE,
XML_RESOURCE_XINCLUDE_TEXT
} xmlResourceType;
typedef enum {
XML_INPUT_BUF_STATIC = (1 << 1),
XML_INPUT_BUF_ZERO_TERMINATED = (1 << 2),
XML_INPUT_UNZIP = (1 << 3),
XML_INPUT_NETWORK = (1 << 4)
} xmlParserInputFlags;
/**
* xmlParserInput:
*
@@ -85,39 +59,24 @@ typedef void (* xmlParserInputDeallocate)(xmlChar *str);
struct _xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf;
/* The file analyzed, if any */
const char *filename;
/* unused */
const char *directory XML_DEPRECATED_MEMBER;
/* Base of the array to parse */
const xmlChar *base;
/* Current char being parsed */
const xmlChar *cur;
/* end of the array to parse */
const xmlChar *end;
/* unused */
int length XML_DEPRECATED_MEMBER;
/* Current line */
int line;
/* Current column */
int col;
/* How many xmlChars already consumed */
unsigned long consumed;
/* function to deallocate the base */
xmlParserInputDeallocate free XML_DEPRECATED_MEMBER;
/* unused */
const xmlChar *encoding XML_DEPRECATED_MEMBER;
/* the version string for entity */
const xmlChar *version XML_DEPRECATED_MEMBER;
/* Flags */
int flags XML_DEPRECATED_MEMBER;
/* an unique identifier for the entity */
int id XML_DEPRECATED_MEMBER;
/* unused */
unsigned long parentConsumed XML_DEPRECATED_MEMBER;
/* entity, if any */
xmlEntityPtr entity XML_DEPRECATED_MEMBER;
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
const char *directory; /* the directory/base of the file */
const xmlChar *base; /* Base of the array to parse */
const xmlChar *cur; /* Current char being parsed */
const xmlChar *end; /* end of the array to parse */
int length; /* length if known */
int line; /* Current line */
int col; /* Current column */
unsigned long consumed; /* How many xmlChars already consumed */
xmlParserInputDeallocate free; /* function to deallocate the base */
const xmlChar *encoding; /* unused */
const xmlChar *version; /* the version string for entity */
int flags; /* Flags */
int id; /* an unique identifier for the entity */
unsigned long parentConsumed; /* consumed bytes from parents */
xmlEntityPtr entity; /* entity, if any */
};
/**
@@ -175,14 +134,30 @@ typedef enum {
XML_PARSER_XML_DECL /* before XML decl (but after BOM) */
} xmlParserInputState;
/** DOC_DISABLE */
/*
* Internal bits in the 'loadsubset' context member
/**
* XML_DETECT_IDS:
*
* Bit in the loadsubset context field to tell to do ID/REFs lookups.
* Use it to initialize xmlLoadExtDtdDefaultValue.
*/
#define XML_DETECT_IDS 2
/**
* XML_COMPLETE_ATTRS:
*
* Bit in the loadsubset context field to tell to do complete the
* elements attributes lists with the ones defaulted from the DTDs.
* Use it to initialize xmlLoadExtDtdDefaultValue.
*/
#define XML_COMPLETE_ATTRS 4
/**
* XML_SKIP_IDS:
*
* Bit in the loadsubset context field to tell to not do ID/REFs registration.
* Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
*/
#define XML_SKIP_IDS 8
/** DOC_ENABLE */
/**
* xmlParserMode:
@@ -202,29 +177,6 @@ typedef struct _xmlStartTag xmlStartTag;
typedef struct _xmlParserNsData xmlParserNsData;
typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
/**
* xmlResourceLoader:
* @ctxt: parser context
* @url: URL to load
* @publicId: publid ID from DTD (optional)
* @type: resource type
* @flags: flags
* @out: result pointer
*
* Callback for custom resource loaders.
*
* @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.
*
* On success, @out should be set to a new parser input object and
* XML_ERR_OK should be returned.
*
* Returns an xmlParserErrors code.
*/
typedef xmlParserErrors
(*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId,
xmlResourceType type, xmlParserInputFlags flags,
xmlParserInputPtr *out);
/**
* xmlParserCtxt:
*
@@ -238,251 +190,143 @@ typedef xmlParserErrors
* to a state based parser for progressive parsing shouldn't be too hard.
*/
struct _xmlParserCtxt {
/* The SAX handler */
struct _xmlSAXHandler *sax;
/* For SAX interface only, used by DOM build */
void *userData;
/* the document being built */
xmlDocPtr myDoc;
/* is the document well formed */
int wellFormed;
/* shall we replace entities ? */
int replaceEntities XML_DEPRECATED_MEMBER;
/* the XML version string */
const xmlChar *version;
/* the declared encoding, if any */
const xmlChar *encoding;
/* standalone document */
int standalone;
/* an HTML(1) document
* 3 is HTML after <head>
* 10 is HTML after <body>
*/
int html;
struct _xmlSAXHandler *sax; /* The SAX handler */
void *userData; /* For SAX interface only, used by DOM build */
xmlDocPtr myDoc; /* the document being built */
int wellFormed; /* is the document well formed */
int replaceEntities; /* shall we replace entities ? */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* the declared encoding, if any */
int standalone; /* standalone document */
int html; /* an HTML(1) document
* 3 is HTML after <head>
* 10 is HTML after <body>
*/
/* Input stream stack */
/* Current input stream */
xmlParserInputPtr input;
/* Number of current input streams */
int inputNr;
/* Max number of input streams */
int inputMax XML_DEPRECATED_MEMBER;
/* stack of inputs */
xmlParserInputPtr *inputTab;
xmlParserInputPtr input; /* Current input stream */
int inputNr; /* Number of current input streams */
int inputMax; /* Max number of input streams */
xmlParserInputPtr *inputTab; /* stack of inputs */
/* Node analysis stack only used for DOM building */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
/* Current parsed Node */
xmlNodePtr node;
/* Depth of the parsing stack */
int nodeNr XML_DEPRECATED_MEMBER;
/* Max depth of the parsing stack */
int nodeMax XML_DEPRECATED_MEMBER;
/* array of nodes */
xmlNodePtr *nodeTab XML_DEPRECATED_MEMBER;
int record_info; /* Whether node info should be kept */
xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
/* Whether node info should be kept */
int record_info;
/* info about each node parsed */
xmlParserNodeInfoSeq node_seq XML_DEPRECATED_MEMBER;
int errNo; /* error code */
/* error code */
int errNo;
int hasExternalSubset; /* reference and external subset */
int hasPErefs; /* the internal subset has PE refs */
int external; /* are we parsing an external entity */
/* reference and external subset */
int hasExternalSubset XML_DEPRECATED_MEMBER;
/* the internal subset has PE refs */
int hasPErefs XML_DEPRECATED_MEMBER;
/* unused */
int external XML_DEPRECATED_MEMBER;
int valid; /* is the document valid */
int validate; /* shall we try to validate ? */
xmlValidCtxt vctxt; /* The validity context */
/* is the document valid */
int valid;
/* shall we try to validate ? */
int validate XML_DEPRECATED_MEMBER;
/* The validity context */
xmlValidCtxt vctxt;
xmlParserInputState instate; /* current type of input */
int token; /* next char look-ahead */
/* push parser state */
xmlParserInputState instate XML_DEPRECATED_MEMBER;
/* unused */
int token XML_DEPRECATED_MEMBER;
/* unused internally, still used downstream */
char *directory;
char *directory; /* the data directory */
/* Node name stack */
const xmlChar *name; /* Current parsed Node */
int nameNr; /* Depth of the parsing stack */
int nameMax; /* Max depth of the parsing stack */
const xmlChar * *nameTab; /* array of nodes */
/* Current parsed Node */
const xmlChar *name XML_DEPRECATED_MEMBER;
/* Depth of the parsing stack */
int nameNr XML_DEPRECATED_MEMBER;
/* Max depth of the parsing stack */
int nameMax XML_DEPRECATED_MEMBER;
/* array of nodes */
const xmlChar **nameTab XML_DEPRECATED_MEMBER;
/* unused */
long nbChars XML_DEPRECATED_MEMBER;
/* used by progressive parsing lookup */
long checkIndex XML_DEPRECATED_MEMBER;
/* ugly but ... */
int keepBlanks XML_DEPRECATED_MEMBER;
/* SAX callbacks are disabled */
int disableSAX;
/* Parsing is in int 1/ext 2 subset */
int inSubset;
/* name of subset */
const xmlChar *intSubName;
/* URI of external subset */
xmlChar *extSubURI;
/* SYSTEM ID of external subset */
xmlChar *extSubSystem;
long nbChars; /* unused */
long checkIndex; /* used by progressive parsing lookup */
int keepBlanks; /* ugly but ... */
int disableSAX; /* SAX callbacks are disabled */
int inSubset; /* Parsing is in int 1/ext 2 subset */
const xmlChar * intSubName; /* name of subset */
xmlChar * extSubURI; /* URI of external subset */
xmlChar * extSubSystem; /* SYSTEM ID of external subset */
/* xml:space values */
int * space; /* Should the parser preserve spaces */
int spaceNr; /* Depth of the parsing stack */
int spaceMax; /* Max depth of the parsing stack */
int * spaceTab; /* array of space infos */
/* Should the parser preserve spaces */
int *space XML_DEPRECATED_MEMBER;
/* Depth of the parsing stack */
int spaceNr XML_DEPRECATED_MEMBER;
/* Max depth of the parsing stack */
int spaceMax XML_DEPRECATED_MEMBER;
/* array of space infos */
int *spaceTab XML_DEPRECATED_MEMBER;
int depth; /* to prevent entity substitution loops */
xmlParserInputPtr entity; /* used to check entities boundaries */
int charset; /* unused */
int nodelen; /* Those two fields are there to */
int nodemem; /* Speed up large node parsing */
int pedantic; /* signal pedantic warnings */
void *_private; /* For user data, libxml won't touch it */
/* to prevent entity substitution loops */
int depth XML_DEPRECATED_MEMBER;
/* unused */
xmlParserInputPtr entity XML_DEPRECATED_MEMBER;
/* unused */
int charset XML_DEPRECATED_MEMBER;
/* Those two fields are there to */
int nodelen XML_DEPRECATED_MEMBER;
/* Speed up large node parsing */
int nodemem XML_DEPRECATED_MEMBER;
/* signal pedantic warnings */
int pedantic XML_DEPRECATED_MEMBER;
/* For user data, libxml won't touch it */
void *_private;
/* should the external subset be loaded */
int loadsubset;
/* set line number in element content */
int linenumbers XML_DEPRECATED_MEMBER;
/* document's own catalog */
void *catalogs XML_DEPRECATED_MEMBER;
/* run in recovery mode */
int recovery XML_DEPRECATED_MEMBER;
/* unused */
int progressive XML_DEPRECATED_MEMBER;
/* dictionary for the parser */
xmlDictPtr dict;
/* array for the attributes callbacks */
const xmlChar **atts XML_DEPRECATED_MEMBER;
/* the size of the array */
int maxatts XML_DEPRECATED_MEMBER;
/* unused */
int docdict XML_DEPRECATED_MEMBER;
int loadsubset; /* should the external subset be loaded */
int linenumbers; /* set line number in element content */
void *catalogs; /* document's own catalog */
int recovery; /* run in recovery mode */
int progressive; /* is this a progressive parsing */
xmlDictPtr dict; /* dictionary for the parser */
const xmlChar * *atts; /* array for the attributes callbacks */
int maxatts; /* the size of the array */
int docdict; /* use strings from dict to build tree */
/*
* pre-interned strings
*/
const xmlChar *str_xml XML_DEPRECATED_MEMBER;
const xmlChar *str_xmlns XML_DEPRECATED_MEMBER;
const xmlChar *str_xml_ns XML_DEPRECATED_MEMBER;
const xmlChar *str_xml;
const xmlChar *str_xmlns;
const xmlChar *str_xml_ns;
/*
* Everything below is used only by the new SAX mode
*/
/* operating in the new SAX mode */
int sax2 XML_DEPRECATED_MEMBER;
/* the number of inherited namespaces */
int nsNr XML_DEPRECATED_MEMBER;
/* the size of the arrays */
int nsMax XML_DEPRECATED_MEMBER;
/* the array of prefix/namespace name */
const xmlChar **nsTab XML_DEPRECATED_MEMBER;
/* which attribute were allocated */
unsigned *attallocs XML_DEPRECATED_MEMBER;
/* array of data for push */
xmlStartTag *pushTab XML_DEPRECATED_MEMBER;
/* defaulted attributes if any */
xmlHashTablePtr attsDefault XML_DEPRECATED_MEMBER;
/* non-CDATA attributes if any */
xmlHashTablePtr attsSpecial XML_DEPRECATED_MEMBER;
/* is the document XML Namespace okay */
int nsWellFormed;
/* Extra options */
int options;
int sax2; /* operating in the new SAX mode */
int nsNr; /* the number of inherited namespaces */
int nsMax; /* the size of the arrays */
const xmlChar * *nsTab; /* the array of prefix/namespace name */
unsigned *attallocs; /* which attribute were allocated */
xmlStartTag *pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
int nsWellFormed; /* is the document XML Namespace okay */
int options; /* Extra options */
/*
* Those fields are needed only for streaming parsing so far
*/
/* Use dictionary names for the tree */
int dictNames XML_DEPRECATED_MEMBER;
/* number of freed element nodes */
int freeElemsNr XML_DEPRECATED_MEMBER;
/* List of freed element nodes */
xmlNodePtr freeElems XML_DEPRECATED_MEMBER;
/* number of freed attributes nodes */
int freeAttrsNr XML_DEPRECATED_MEMBER;
/* List of freed attributes nodes */
xmlAttrPtr freeAttrs XML_DEPRECATED_MEMBER;
int dictNames; /* Use dictionary names for the tree */
int freeElemsNr; /* number of freed element nodes */
xmlNodePtr freeElems; /* List of freed element nodes */
int freeAttrsNr; /* number of freed attributes nodes */
xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
/*
* the complete error information for the last error.
*/
xmlError lastError XML_DEPRECATED_MEMBER;
/* the parser mode */
xmlParserMode parseMode XML_DEPRECATED_MEMBER;
/* unused */
unsigned long nbentities XML_DEPRECATED_MEMBER;
/* size of external entities */
unsigned long sizeentities XML_DEPRECATED_MEMBER;
xmlError lastError;
xmlParserMode parseMode; /* the parser mode */
unsigned long nbentities; /* unused */
unsigned long sizeentities; /* size of parsed entities */
/* for use by HTML non-recursive parser */
/* Current NodeInfo */
xmlParserNodeInfo *nodeInfo XML_DEPRECATED_MEMBER;
/* Depth of the parsing stack */
int nodeInfoNr XML_DEPRECATED_MEMBER;
/* Max depth of the parsing stack */
int nodeInfoMax XML_DEPRECATED_MEMBER;
/* array of nodeInfos */
xmlParserNodeInfo *nodeInfoTab XML_DEPRECATED_MEMBER;
xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */
int nodeInfoNr; /* Depth of the parsing stack */
int nodeInfoMax; /* Max depth of the parsing stack */
xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
/* we need to label inputs */
int input_id XML_DEPRECATED_MEMBER;
/* volume of entity copy */
unsigned long sizeentcopy XML_DEPRECATED_MEMBER;
int input_id; /* we need to label inputs */
unsigned long sizeentcopy; /* volume of entity copy */
/* quote state for push parser */
int endCheckState XML_DEPRECATED_MEMBER;
/* number of errors */
unsigned short nbErrors XML_DEPRECATED_MEMBER;
/* number of warnings */
unsigned short nbWarnings XML_DEPRECATED_MEMBER;
/* maximum amplification factor */
unsigned maxAmpl XML_DEPRECATED_MEMBER;
int endCheckState; /* quote state for push parser */
unsigned short nbErrors; /* number of errors */
unsigned short nbWarnings; /* number of warnings */
unsigned maxAmpl; /* maximum amplification factor */
/* namespace database */
xmlParserNsData *nsdb XML_DEPRECATED_MEMBER;
/* allocated size */
unsigned attrHashMax XML_DEPRECATED_MEMBER;
/* atttribute hash table */
xmlAttrHashBucket *attrHash XML_DEPRECATED_MEMBER;
xmlStructuredErrorFunc errorHandler XML_DEPRECATED_MEMBER;
void *errorCtxt XML_DEPRECATED_MEMBER;
xmlResourceLoader resourceLoader XML_DEPRECATED_MEMBER;
void *resourceCtxt XML_DEPRECATED_MEMBER;
xmlCharEncConvImpl convImpl XML_DEPRECATED_MEMBER;
void *convCtxt XML_DEPRECATED_MEMBER;
xmlParserNsData *nsdb; /* namespace database */
unsigned attrHashMax; /* allocated size */
xmlAttrHashBucket *attrHash; /* atttribute hash table */
};
/**
@@ -889,23 +733,18 @@ typedef void (*endElementNsSAX2Func) (void *ctx,
struct _xmlSAXHandler {
/*
* For DTD-related handlers, it's recommended to either use the
* original libxml2 handler or set them to NULL if DTDs can be
* ignored.
*/
internalSubsetSAXFunc internalSubset; /* DTD */
isStandaloneSAXFunc isStandalone; /* unused */
hasInternalSubsetSAXFunc hasInternalSubset; /* DTD */
hasExternalSubsetSAXFunc hasExternalSubset; /* DTD */
resolveEntitySAXFunc resolveEntity; /* DTD */
getEntitySAXFunc getEntity; /* DTD */
entityDeclSAXFunc entityDecl; /* DTD */
notationDeclSAXFunc notationDecl; /* DTD */
attributeDeclSAXFunc attributeDecl; /* DTD */
elementDeclSAXFunc elementDecl; /* DTD */
unparsedEntityDeclSAXFunc unparsedEntityDecl; /* DTD */
setDocumentLocatorSAXFunc setDocumentLocator; /* deprecated */
internalSubsetSAXFunc internalSubset;
isStandaloneSAXFunc isStandalone;
hasInternalSubsetSAXFunc hasInternalSubset;
hasExternalSubsetSAXFunc hasExternalSubset;
resolveEntitySAXFunc resolveEntity;
getEntitySAXFunc getEntity;
entityDeclSAXFunc entityDecl;
notationDeclSAXFunc notationDecl;
attributeDeclSAXFunc attributeDecl;
elementDeclSAXFunc elementDecl;
unparsedEntityDeclSAXFunc unparsedEntityDecl;
setDocumentLocatorSAXFunc setDocumentLocator;
startDocumentSAXFunc startDocument;
endDocumentSAXFunc endDocument;
/*
@@ -925,20 +764,15 @@ struct _xmlSAXHandler {
endElementSAXFunc endElement;
referenceSAXFunc reference;
charactersSAXFunc characters;
/*
* `ignorableWhitespace` should always be set to the same value
* as `characters`. Otherwise, the parser will try to detect
* whitespace which is unreliable.
*/
ignorableWhitespaceSAXFunc ignorableWhitespace;
processingInstructionSAXFunc processingInstruction;
commentSAXFunc comment;
warningSAXFunc warning;
errorSAXFunc error;
fatalErrorSAXFunc fatalError; /* unused, `error` gets all the errors */
getParameterEntitySAXFunc getParameterEntity; /* DTD */
fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
getParameterEntitySAXFunc getParameterEntity;
cdataBlockSAXFunc cdataBlock;
externalSubsetSAXFunc externalSubset; /* DTD */
externalSubsetSAXFunc externalSubset;
/*
* `initialized` should always be set to XML_SAX2_MAGIC to enable the
* modern SAX2 interface.
@@ -950,10 +784,6 @@ struct _xmlSAXHandler {
void *_private;
startElementNsSAX2Func startElementNs;
endElementNsSAX2Func endElementNs;
/*
* Takes precedence over `error` or `warning`, but modern code
* should use xmlCtxtSetErrorHandler.
*/
xmlStructuredErrorFunc serror;
};
@@ -1013,53 +843,70 @@ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
*/
XMLPUBVAR const char *const xmlParserVersion;
#ifdef LIBXML_THREAD_ENABLED
/* backward compatibility */
XMLPUBFUN const char *const *__xmlParserVersion(void);
#endif
/** DOC_DISABLE */
XML_DEPRECATED
XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator;
#ifdef LIBXML_SAX1_ENABLED
XML_DEPRECATED
XMLPUBVAR const xmlSAXHandlerV1 xmlDefaultSAXHandler;
#endif
XML_DEPRECATED
XMLPUBFUN int *__xmlDoValidityCheckingDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlGetWarningsDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlKeepBlanksDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlLineNumbersDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlLoadExtDtdDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlPedanticParserDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN int *__xmlSubstituteEntitiesDefaultValue(void);
#define XML_GLOBALS_PARSER_CORE \
XML_OP(oldXMLWDcompatibility, int, XML_DEPRECATED) \
XML_OP(xmlDefaultSAXLocator, xmlSAXLocator, XML_DEPRECATED) \
XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlParserDebugEntities, int, XML_DEPRECATED) \
XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED)
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int *__xmlIndentTreeOutput(void);
XMLPUBFUN const char **__xmlTreeIndentString(void);
XMLPUBFUN int *__xmlSaveNoEmptyTags(void);
#define XML_GLOBALS_PARSER_OUTPUT \
XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \
XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \
XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR)
#else
#define XML_GLOBALS_PARSER_OUTPUT
#endif
#ifndef XML_GLOBALS_NO_REDEFINITION
#ifdef LIBXML_SAX1_ENABLED
#define XML_GLOBALS_PARSER_SAX1 \
XML_OP(xmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED)
#else
#define XML_GLOBALS_PARSER_SAX1
#endif
#define XML_GLOBALS_PARSER \
XML_GLOBALS_PARSER_CORE \
XML_GLOBALS_PARSER_OUTPUT \
XML_GLOBALS_PARSER_SAX1
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_PARSER
#undef XML_OP
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define oldXMLWDcompatibility XML_GLOBAL_MACRO(oldXMLWDcompatibility)
#define xmlDefaultSAXHandler XML_GLOBAL_MACRO(xmlDefaultSAXHandler)
#define xmlDefaultSAXLocator XML_GLOBAL_MACRO(xmlDefaultSAXLocator)
#define xmlDoValidityCheckingDefaultValue \
(*__xmlDoValidityCheckingDefaultValue())
XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
#define xmlGetWarningsDefaultValue \
(*__xmlGetWarningsDefaultValue())
#define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
#define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
#define xmlLineNumbersDefaultValue \
(*__xmlLineNumbersDefaultValue())
#define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
#define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
#define xmlParserDebugEntities XML_GLOBAL_MACRO(xmlParserDebugEntities)
#define xmlPedanticParserDefaultValue \
(*__xmlPedanticParserDefaultValue())
XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
#define xmlSubstituteEntitiesDefaultValue \
(*__xmlSubstituteEntitiesDefaultValue())
XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
#ifdef LIBXML_OUTPUT_ENABLED
#define xmlIndentTreeOutput (*__xmlIndentTreeOutput())
#define xmlTreeIndentString (*__xmlTreeIndentString())
#define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
#define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
#define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
#define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
#endif
#endif
/** DOC_ENABLE */
@@ -1085,6 +932,7 @@ XML_DEPRECATED
XMLPUBFUN int
xmlParserInputRead (xmlParserInputPtr in,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlParserInputGrow (xmlParserInputPtr in,
int len);
@@ -1101,40 +949,32 @@ XMLPUBFUN xmlDocPtr
xmlParseMemory (const char *buffer,
int size);
#endif /* LIBXML_SAX1_ENABLED */
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlSubstituteEntitiesDefault(int val);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefSubstituteEntitiesDefaultValue(int v);
XMLPUBFUN int
xmlKeepBlanksDefault (int val);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefKeepBlanksDefaultValue(int v);
XMLPUBFUN void
xmlStopParser (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlPedanticParserDefault(int val);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefPedanticParserDefaultValue(int v);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlLineNumbersDefault (int val);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefLineNumbersDefaultValue(int v);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefDoValidityCheckingDefaultValue(int v);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefGetWarningsDefaultValue(int v);
XML_DEPRECATED
XMLPUBFUN int
XML_DEPRECATED XMLPUBFUN int
xmlThrDefLoadExtDtdDefaultValue(int v);
XML_DEPRECATED XMLPUBFUN int
xmlThrDefParserDebugEntities(int v);
#ifdef LIBXML_SAX1_ENABLED
/*
@@ -1157,7 +997,6 @@ XMLPUBFUN xmlDocPtr
*/
XMLPUBFUN int
xmlParseDocument (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN int
xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
@@ -1211,18 +1050,6 @@ XMLPUBFUN xmlDocPtr
#endif /* LIBXML_SAX1_ENABLED */
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN xmlDtdPtr
xmlCtxtParseDtd (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input,
const xmlChar *ExternalID,
const xmlChar *SystemID);
XMLPUBFUN int
xmlCtxtValidateDocument (xmlParserCtxtPtr ctxt,
xmlDocPtr doc);
XMLPUBFUN int
xmlCtxtValidateDtd (xmlParserCtxtPtr ctxt,
xmlDocPtr doc,
xmlDtdPtr dtd);
XML_DEPRECATED
XMLPUBFUN xmlDtdPtr
xmlSAXParseDTD (xmlSAXHandlerPtr sax,
@@ -1300,6 +1127,26 @@ XMLPUBFUN void
XMLPUBFUN xmlParserCtxtPtr
xmlCreateDocParserCtxt (const xmlChar *cur);
#ifdef LIBXML_LEGACY_ENABLED
/*
* Reading/setting optional parsing features.
*/
XML_DEPRECATED
XMLPUBFUN int
xmlGetFeaturesList (int *len,
const char **result);
XML_DEPRECATED
XMLPUBFUN int
xmlGetFeature (xmlParserCtxtPtr ctxt,
const char *name,
void *result);
XML_DEPRECATED
XMLPUBFUN int
xmlSetFeature (xmlParserCtxtPtr ctxt,
const char *name,
void *value);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef LIBXML_PUSH_ENABLED
/*
* Interfaces for the Push mode.
@@ -1337,24 +1184,19 @@ XMLPUBFUN xmlParserInputPtr
/*
* Node infos.
*/
XML_DEPRECATED
XMLPUBFUN const xmlParserNodeInfo*
xmlParserFindNodeInfo (xmlParserCtxtPtr ctxt,
xmlNodePtr node);
XML_DEPRECATED
xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
const xmlNodePtr node);
XMLPUBFUN void
xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
XML_DEPRECATED
XMLPUBFUN void
xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
XML_DEPRECATED
XMLPUBFUN unsigned long
xmlParserFindNodeInfoIndex(xmlParserNodeInfoSeqPtr seq,
xmlNodePtr node);
XML_DEPRECATED
xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
const xmlNodePtr node);
XMLPUBFUN void
xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
xmlParserNodeInfoPtr info);
const xmlParserNodeInfoPtr info);
/*
* External entities handling actually implemented in xmlIO.
@@ -1369,7 +1211,9 @@ XMLPUBFUN xmlParserInputPtr
const char *ID,
xmlParserCtxtPtr ctxt);
XML_DEPRECATED
/*
* Index lookup, actually implemented in the encoding module
*/
XMLPUBFUN long
xmlByteConsumed (xmlParserCtxtPtr ctxt);
@@ -1407,13 +1251,7 @@ typedef enum {
XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
XML_PARSE_BIG_LINES = 1<<22,/* Store big lines numbers in text PSVI field */
/* since 2.13.0 */
XML_PARSE_NO_XXE = 1<<23,/* disable loading of external content */
/* since 2.14.0 */
XML_PARSE_UNZIP = 1<<24,/* allow compressed content */
XML_PARSE_NO_SYS_CATALOG = 1<<25,/* disable global system catalog */
XML_PARSE_CATALOG_PI = 1<<26 /* allow catalog PIs */
XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */
} xmlParserOption;
XMLPUBFUN void
@@ -1424,64 +1262,9 @@ XMLPUBFUN int
int size,
const char *filename,
const char *encoding);
XMLPUBFUN int
xmlCtxtGetOptions (xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlCtxtSetOptions (xmlParserCtxtPtr ctxt,
int options);
XMLPUBFUN int
xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
int options);
XMLPUBFUN void *
xmlCtxtGetPrivate (xmlParserCtxtPtr ctxt);
XMLPUBFUN void
xmlCtxtSetPrivate (xmlParserCtxtPtr ctxt,
void *priv);
XMLPUBFUN void *
xmlCtxtGetCatalogs (xmlParserCtxtPtr ctxt);
XMLPUBFUN void
xmlCtxtSetCatalogs (xmlParserCtxtPtr ctxt,
void *catalogs);
XMLPUBFUN xmlDictPtr
xmlCtxtGetDict (xmlParserCtxtPtr ctxt);
XMLPUBFUN void
xmlCtxtSetDict (xmlParserCtxtPtr ctxt,
xmlDictPtr);
XMLPUBFUN xmlSAXHandler *
xmlCtxtGetSaxHandler (xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlCtxtSetSaxHandler (xmlParserCtxtPtr ctxt,
const xmlSAXHandler *sax);
XMLPUBFUN xmlDocPtr
xmlCtxtGetDocument (xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlCtxtIsHtml (xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlCtxtIsStopped (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_VALID_ENABLED
XMLPUBFUN xmlValidCtxtPtr
xmlCtxtGetValidCtxt (xmlParserCtxtPtr ctxt);
#endif
XMLPUBFUN const xmlChar *
xmlCtxtGetVersion (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar *
xmlCtxtGetDeclaredEncoding(xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlCtxtGetStandalone (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlParserStatus
xmlCtxtGetStatus (xmlParserCtxtPtr ctxt);
XMLPUBFUN void
xmlCtxtSetErrorHandler (xmlParserCtxtPtr ctxt,
xmlStructuredErrorFunc handler,
void *data);
XMLPUBFUN void
xmlCtxtSetResourceLoader(xmlParserCtxtPtr ctxt,
xmlResourceLoader loader,
void *vctxt);
XMLPUBFUN void
xmlCtxtSetCharEncConvImpl(xmlParserCtxtPtr ctxt,
xmlCharEncConvImpl impl,
void *vctxt);
XMLPUBFUN void
xmlCtxtSetMaxAmplification(xmlParserCtxtPtr ctxt,
unsigned maxAmpl);
@@ -1512,14 +1295,6 @@ XMLPUBFUN xmlDocPtr
const char *URL,
const char *encoding,
int options);
XMLPUBFUN xmlDocPtr
xmlCtxtParseDocument (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XMLPUBFUN xmlNodePtr
xmlCtxtParseContent (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input,
xmlNodePtr node,
int hasTextDecl);
XMLPUBFUN xmlDocPtr
xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
const xmlChar *cur,
@@ -1553,29 +1328,6 @@ XMLPUBFUN xmlDocPtr
const char *encoding,
int options);
/**
* New input API
*/
XMLPUBFUN xmlParserErrors
xmlNewInputFromUrl(const char *url, xmlParserInputFlags flags,
xmlParserInputPtr *out);
XMLPUBFUN xmlParserInputPtr
xmlNewInputFromMemory(const char *url, const void *mem, size_t size,
xmlParserInputFlags flags);
XMLPUBFUN xmlParserInputPtr
xmlNewInputFromString(const char *url, const char *str,
xmlParserInputFlags flags);
XMLPUBFUN xmlParserInputPtr
xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags);
XMLPUBFUN xmlParserInputPtr
xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead,
xmlInputCloseCallback ioClose, void *ioCtxt,
xmlParserInputFlags flags);
XMLPUBFUN xmlParserErrors
xmlInputSetEncodingHandler(xmlParserInputPtr input,
xmlCharEncodingHandlerPtr handler);
/*
* Library wide options
*/
@@ -1616,11 +1368,10 @@ typedef enum {
XML_WITH_MODULES = 27,
XML_WITH_DEBUG = 28,
XML_WITH_DEBUG_MEM = 29,
XML_WITH_DEBUG_RUN = 30, /* unused */
XML_WITH_DEBUG_RUN = 30,
XML_WITH_ZLIB = 31,
XML_WITH_ICU = 32,
XML_WITH_LZMA = 33,
XML_WITH_RELAXNG = 34, /* since 2.14.0 */
XML_WITH_NONE = 99999 /* just to be sure of allocation size */
} xmlFeature;
@@ -22,12 +22,14 @@
extern "C" {
#endif
/*
* Backward compatibility
/**
* xmlParserMaxDepth:
*
* arbitrary depth limit for the XML documents that we allow to
* process. This is not a limitation of the parser but a safety
* boundary feature, use XML_PARSE_HUGE option to override it.
*/
#define inputPush xmlCtxtPushInput
#define inputPop xmlCtxtPopInput
#define xmlParserMaxDepth 256
XMLPUBVAR unsigned int xmlParserMaxDepth;
/**
* XML_MAX_TEXT_LENGTH:
@@ -66,7 +68,7 @@ extern "C" {
* use XML_PARSE_HUGE option to override it.
* Introduced in 2.9.0
*/
#define XML_MAX_DICTIONARY_LIMIT 100000000
#define XML_MAX_DICTIONARY_LIMIT 10000000
/**
* XML_MAX_LOOKUP_LIMIT:
@@ -86,6 +88,14 @@ extern "C" {
*/
#define XML_MAX_NAMELEN 100
/**
* INPUT_CHUNK:
*
* The parser tries to always have that amount of input ready.
* One of the point is providing context when reporting errors.
*/
#define INPUT_CHUNK 250
/************************************************************************
* *
* UNICODE version of the macros. *
@@ -245,8 +255,8 @@ extern "C" {
* Macro to check [a-zA-Z]
*
*/
#define IS_ASCII_LETTER(c) ((0x61 <= ((c) | 0x20)) && \
(((c) | 0x20) <= 0x7a))
#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
((0x61 <= (c)) && ((c) <= 0x7a)))
/**
* IS_ASCII_DIGIT:
@@ -281,10 +291,11 @@ extern "C" {
*/
XMLPUBVAR const xmlChar xmlStringText[];
XMLPUBVAR const xmlChar xmlStringTextNoenc[];
XML_DEPRECATED
XMLPUBVAR const xmlChar xmlStringComment[];
XML_DEPRECATED
/*
* Function to finish the work of the macros where needed.
*/
XMLPUBFUN int xmlIsLetter (int c);
/**
@@ -298,19 +309,13 @@ XMLPUBFUN xmlParserCtxtPtr
XMLPUBFUN xmlParserCtxtPtr
xmlCreateMemoryParserCtxt(const char *buffer,
int size);
XML_DEPRECATED
XMLPUBFUN xmlParserCtxtPtr
xmlCreateEntityParserCtxt(const xmlChar *URL,
const xmlChar *ID,
const xmlChar *base);
XMLPUBFUN void
xmlCtxtErrMemory (xmlParserCtxtPtr ctxt);
XMLPUBFUN int
xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
xmlCharEncoding enc);
XMLPUBFUN int
xmlSwitchEncodingName (xmlParserCtxtPtr ctxt,
const char *encoding);
XMLPUBFUN int
xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
xmlCharEncodingHandlerPtr handler);
@@ -330,16 +335,9 @@ XML_DEPRECATED
XMLPUBFUN xmlParserInputPtr
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
XMLPUBFUN int
xmlCtxtPushInput (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XMLPUBFUN xmlParserInputPtr
xmlCtxtPopInput (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN int
xmlPushInput (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XML_DEPRECATED
XMLPUBFUN xmlChar
xmlPopInput (xmlParserCtxtPtr ctxt);
XMLPUBFUN void
@@ -505,7 +503,6 @@ XMLPUBFUN void
XML_DEPRECATED
XMLPUBFUN void
xmlParseMisc (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void
xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
const xmlChar *ExternalID,
@@ -553,6 +550,23 @@ XMLPUBFUN xmlChar *
xmlChar end2,
xmlChar end3);
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
XML_DEPRECATED
XMLPUBFUN int nodePush (xmlParserCtxtPtr ctxt,
xmlNodePtr value);
XML_DEPRECATED
XMLPUBFUN xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int inputPush (xmlParserCtxtPtr ctxt,
xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN const xmlChar * namePop (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN int namePush (xmlParserCtxtPtr ctxt,
const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
@@ -573,10 +587,8 @@ XMLPUBFUN int xmlCheckLanguageID (const xmlChar *lang);
XML_DEPRECATED
XMLPUBFUN int xmlCurrentChar (xmlParserCtxtPtr ctxt,
int *len);
XML_DEPRECATED
XMLPUBFUN int xmlCopyCharMultiByte (xmlChar *out,
int val);
XML_DEPRECATED
XMLPUBFUN int xmlCopyChar (int len,
xmlChar *out,
int val);
@@ -585,6 +597,66 @@ XMLPUBFUN void xmlNextChar (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void xmlParserInputShrink (xmlParserInputPtr in);
/*
* Specific function to keep track of entities references
* and used by the XSLT debugger.
*/
#ifdef LIBXML_LEGACY_ENABLED
/**
* xmlEntityReferenceFunc:
* @ent: the entity
* @firstNode: the fist node in the chunk
* @lastNode: the last nod in the chunk
*
* Callback function used when one needs to be able to track back the
* provenance of a chunk of nodes inherited from an entity replacement.
*/
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
xmlNodePtr firstNode,
xmlNodePtr lastNode);
XML_DEPRECATED
XMLPUBFUN void xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlParseQuotedString (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void
xmlParseNamespace (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlScanName (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void xmlParserHandleReference(xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
xmlChar **prefix);
/**
* Entities
*/
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlDecodeEntities (xmlParserCtxtPtr ctxt,
int len,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3);
XML_DEPRECATED
XMLPUBFUN void
xmlHandleEntity (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef __cplusplus
}
#endif
@@ -14,9 +14,8 @@
#include <libxml/xmlerror.h>
#include <libxml/xmlstring.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#ifdef LIBXML_RELAXNG_ENABLED
#ifdef LIBXML_SCHEMAS_ENABLED
#ifdef __cplusplus
extern "C" {
@@ -156,10 +155,6 @@ XMLPUBFUN void
xmlRelaxNGParserCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void *ctx);
XMLPUBFUN void
xmlRelaxNGSetResourceLoader (xmlRelaxNGParserCtxtPtr ctxt,
xmlResourceLoader loader,
void *vctxt);
XMLPUBFUN xmlRelaxNGPtr
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void
@@ -219,6 +214,6 @@ XMLPUBFUN int
}
#endif
#endif /* LIBXML_RELAXNG_ENABLED */
#endif /* LIBXML_SCHEMAS_ENABLED */
#endif /* __XML_RELAX_NG__ */
@@ -61,6 +61,12 @@ XMLPUBFUN void
XMLPUBFUN void
xmlUnlockLibrary(void);
XML_DEPRECATED
XMLPUBFUN int
xmlGetThreadId (void);
XML_DEPRECATED
XMLPUBFUN int
xmlIsMainThread (void);
XML_DEPRECATED
XMLPUBFUN void
xmlCleanupThreads(void);
@@ -32,12 +32,6 @@
extern "C" {
#endif
/*
* Backward compatibility
*/
#define xmlBufferAllocScheme XML_BUFFER_ALLOC_EXACT
#define xmlDefaultBufferSize 4096
/*
* Some of the basic types pointer to structures:
*/
@@ -65,6 +59,13 @@ typedef xmlSAXHandler *xmlSAXHandlerPtr;
typedef struct _xmlEntity xmlEntity;
typedef xmlEntity *xmlEntityPtr;
/**
* BASE_BUFFER_SIZE:
*
* default buffer size 4000.
*/
#define BASE_BUFFER_SIZE 4096
/**
* LIBXML_NAMESPACE_DICT:
*
@@ -99,16 +100,11 @@ typedef enum {
typedef struct _xmlBuffer xmlBuffer;
typedef xmlBuffer *xmlBufferPtr;
struct _xmlBuffer {
/* The buffer content UTF8 */
xmlChar *content XML_DEPRECATED_MEMBER;
/* The buffer size used */
unsigned int use XML_DEPRECATED_MEMBER;
/* The buffer size */
unsigned int size XML_DEPRECATED_MEMBER;
/* The realloc method */
xmlBufferAllocationScheme alloc XML_DEPRECATED_MEMBER;
/* in IO mode we may have a different base */
xmlChar *contentIO XML_DEPRECATED_MEMBER;
xmlChar *content; /* The buffer content UTF8 */
unsigned int use; /* The buffer size used */
unsigned int size; /* The buffer size */
xmlBufferAllocationScheme alloc; /* The realloc method */
xmlChar *contentIO; /* in IO mode we may have a different base */
};
/**
@@ -177,13 +173,13 @@ typedef enum {
XML_TEXT_NODE= 3,
XML_CDATA_SECTION_NODE= 4,
XML_ENTITY_REF_NODE= 5,
XML_ENTITY_NODE= 6, /* unused */
XML_ENTITY_NODE= 6,
XML_PI_NODE= 7,
XML_COMMENT_NODE= 8,
XML_DOCUMENT_NODE= 9,
XML_DOCUMENT_TYPE_NODE= 10, /* unused */
XML_DOCUMENT_TYPE_NODE= 10,
XML_DOCUMENT_FRAG_NODE= 11,
XML_NOTATION_NODE= 12, /* unused */
XML_NOTATION_NODE= 12,
XML_HTML_DOCUMENT_NODE= 13,
XML_DTD_NODE= 14,
XML_ELEMENT_DECL= 15,
@@ -453,7 +449,6 @@ struct _xmlAttr {
xmlNs *ns; /* pointer to the associated namespace */
xmlAttributeType atype; /* the attribute type if validating */
void *psvi; /* for type/PSVI information */
struct _xmlID *id; /* the ID struct */
};
/**
@@ -678,16 +673,24 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
*/
/** DOC_DISABLE */
XML_DEPRECATED
XMLPUBFUN xmlRegisterNodeFunc *__xmlRegisterNodeDefaultValue(void);
XML_DEPRECATED
XMLPUBFUN xmlDeregisterNodeFunc *__xmlDeregisterNodeDefaultValue(void);
#define XML_GLOBALS_TREE \
XML_OP(xmlBufferAllocScheme, xmlBufferAllocationScheme, XML_DEPRECATED) \
XML_OP(xmlDefaultBufferSize, int, XML_DEPRECATED) \
XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \
XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \
XML_DEPRECATED)
#ifndef XML_GLOBALS_NO_REDEFINITION
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_TREE
#undef XML_OP
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define xmlBufferAllocScheme XML_GLOBAL_MACRO(xmlBufferAllocScheme)
#define xmlDefaultBufferSize XML_GLOBAL_MACRO(xmlDefaultBufferSize)
#define xmlRegisterNodeDefaultValue \
(*__xmlRegisterNodeDefaultValue())
XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue)
#define xmlDeregisterNodeDefaultValue \
(*__xmlDeregisterNodeDefaultValue())
XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue)
#endif
/** DOC_ENABLE */
@@ -698,6 +701,7 @@ XMLPUBFUN int
xmlValidateNCName (const xmlChar *value,
int space);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int
xmlValidateQName (const xmlChar *value,
int space);
@@ -707,6 +711,7 @@ XMLPUBFUN int
XMLPUBFUN int
xmlValidateNMToken (const xmlChar *value,
int space);
#endif
XMLPUBFUN xmlChar *
xmlBuildQName (const xmlChar *ncname,
@@ -724,10 +729,8 @@ XMLPUBFUN const xmlChar *
* Handling Buffers, the old ones see @xmlBuf for the new ones.
*/
XML_DEPRECATED
XMLPUBFUN void
xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
XML_DEPRECATED
XMLPUBFUN xmlBufferAllocationScheme
xmlGetBufferAllocationScheme(void);
@@ -738,7 +741,6 @@ XMLPUBFUN xmlBufferPtr
XMLPUBFUN xmlBufferPtr
xmlBufferCreateStatic (void *mem,
size_t size);
XML_DEPRECATED
XMLPUBFUN int
xmlBufferResize (xmlBufferPtr buf,
unsigned int size);
@@ -761,11 +763,9 @@ XMLPUBFUN int
XMLPUBFUN int
xmlBufferCCat (xmlBufferPtr buf,
const char *str);
XML_DEPRECATED
XMLPUBFUN int
xmlBufferShrink (xmlBufferPtr buf,
unsigned int len);
XML_DEPRECATED
XMLPUBFUN int
xmlBufferGrow (xmlBufferPtr buf,
unsigned int len);
@@ -798,6 +798,13 @@ XMLPUBFUN xmlDtdPtr
xmlGetIntSubset (const xmlDoc *doc);
XMLPUBFUN void
xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED
XML_DEPRECATED
XMLPUBFUN xmlNsPtr
xmlNewGlobalNs (xmlDocPtr doc,
const xmlChar *href,
const xmlChar *prefix);
#endif /* LIBXML_LEGACY_ENABLED */
XMLPUBFUN xmlNsPtr
xmlNewNs (xmlNodePtr node,
const xmlChar *href,
@@ -814,10 +821,13 @@ XMLPUBFUN xmlAttrPtr
xmlNewDocProp (xmlDocPtr doc,
const xmlChar *name,
const xmlChar *value);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlAttrPtr
xmlNewProp (xmlNodePtr node,
const xmlChar *name,
const xmlChar *value);
#endif
XMLPUBFUN xmlAttrPtr
xmlNewNsProp (xmlNodePtr node,
xmlNsPtr ns,
@@ -838,11 +848,15 @@ XMLPUBFUN xmlAttrPtr
XMLPUBFUN xmlAttrPtr
xmlCopyPropList (xmlNodePtr target,
xmlAttrPtr cur);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlDtdPtr
xmlCopyDtd (xmlDtdPtr dtd);
#endif /* LIBXML_TREE_ENABLED */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlDocPtr
xmlCopyDoc (xmlDocPtr doc,
int recursive);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Creating new nodes.
*/
@@ -862,11 +876,13 @@ XMLPUBFUN xmlNodePtr
XMLPUBFUN xmlNodePtr
xmlNewNodeEatName (xmlNsPtr ns,
xmlChar *name);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNodePtr
xmlNewChild (xmlNodePtr parent,
xmlNsPtr ns,
const xmlChar *name,
const xmlChar *content);
#endif
XMLPUBFUN xmlNodePtr
xmlNewDocText (const xmlDoc *doc,
const xmlChar *content);
@@ -913,6 +929,7 @@ XMLPUBFUN xmlNodePtr
xmlNodePtr node);
XMLPUBFUN xmlNodePtr
xmlCopyNodeList (xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNodePtr
xmlNewTextChild (xmlNodePtr parent,
xmlNsPtr ns,
@@ -925,14 +942,17 @@ XMLPUBFUN xmlNodePtr
const xmlChar *content);
XMLPUBFUN xmlNodePtr
xmlNewDocFragment (xmlDocPtr doc);
#endif /* LIBXML_TREE_ENABLED */
/*
* Navigating.
*/
XMLPUBFUN long
xmlGetLineNo (const xmlNode *node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
XMLPUBFUN xmlChar *
xmlGetNodePath (const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
XMLPUBFUN xmlNodePtr
xmlDocGetRootElement (const xmlDoc *doc);
XMLPUBFUN xmlNodePtr
@@ -945,24 +965,33 @@ XMLPUBFUN int
/*
* Changing the structure.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
XMLPUBFUN xmlNodePtr
xmlDocSetRootElement (xmlDocPtr doc,
xmlNodePtr root);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void
xmlNodeSetName (xmlNodePtr cur,
const xmlChar *name);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlNodePtr
xmlAddChild (xmlNodePtr parent,
xmlNodePtr cur);
XMLPUBFUN xmlNodePtr
xmlAddChildList (xmlNodePtr parent,
xmlNodePtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
XMLPUBFUN xmlNodePtr
xmlReplaceNode (xmlNodePtr old,
xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN xmlNodePtr
xmlAddPrevSibling (xmlNodePtr cur,
xmlNodePtr elem);
#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
XMLPUBFUN xmlNodePtr
xmlAddSibling (xmlNodePtr cur,
xmlNodePtr elem);
@@ -982,10 +1011,10 @@ XMLPUBFUN void
xmlFreeNodeList (xmlNodePtr cur);
XMLPUBFUN void
xmlFreeNode (xmlNodePtr cur);
XMLPUBFUN int
XMLPUBFUN void
xmlSetTreeDoc (xmlNodePtr tree,
xmlDocPtr doc);
XMLPUBFUN int
XMLPUBFUN void
xmlSetListDoc (xmlNodePtr list,
xmlDocPtr doc);
/*
@@ -999,13 +1028,12 @@ XMLPUBFUN xmlNsPtr
xmlSearchNsByHref (xmlDocPtr doc,
xmlNodePtr node,
const xmlChar *href);
XMLPUBFUN int
xmlGetNsListSafe (const xmlDoc *doc,
const xmlNode *node,
xmlNsPtr **out);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNsPtr *
xmlGetNsList (const xmlDoc *doc,
const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
XMLPUBFUN void
xmlSetNs (xmlNodePtr node,
@@ -1018,6 +1046,8 @@ XMLPUBFUN xmlNsPtr
/*
* Changing the content.
*/
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
XMLPUBFUN xmlAttrPtr
xmlSetProp (xmlNodePtr node,
const xmlChar *name,
@@ -1027,11 +1057,8 @@ XMLPUBFUN xmlAttrPtr
xmlNsPtr ns,
const xmlChar *name,
const xmlChar *value);
XMLPUBFUN int
xmlNodeGetAttrValue (const xmlNode *node,
const xmlChar *name,
const xmlChar *nsUri,
xmlChar **out);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
XMLPUBFUN xmlChar *
xmlGetNoNsProp (const xmlNode *node,
const xmlChar *name);
@@ -1060,21 +1087,25 @@ XMLPUBFUN xmlChar *
xmlNodeListGetString (xmlDocPtr doc,
const xmlNode *list,
int inLine);
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlChar *
xmlNodeListGetRawString (const xmlDoc *doc,
const xmlNode *list,
int inLine);
XMLPUBFUN int
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlNodeSetContent (xmlNodePtr cur,
const xmlChar *content);
XMLPUBFUN int
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void
xmlNodeSetContentLen (xmlNodePtr cur,
const xmlChar *content,
int len);
XMLPUBFUN int
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlNodeAddContent (xmlNodePtr cur,
const xmlChar *content);
XMLPUBFUN int
XMLPUBFUN void
xmlNodeAddContentLen (xmlNodePtr cur,
const xmlChar *content,
int len);
@@ -1092,28 +1123,29 @@ XMLPUBFUN xmlChar *
xmlNodeGetLang (const xmlNode *cur);
XMLPUBFUN int
xmlNodeGetSpacePreserve (const xmlNode *cur);
XMLPUBFUN int
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void
xmlNodeSetLang (xmlNodePtr cur,
const xmlChar *lang);
XMLPUBFUN int
XMLPUBFUN void
xmlNodeSetSpacePreserve (xmlNodePtr cur,
int val);
XMLPUBFUN int
xmlNodeGetBaseSafe (const xmlDoc *doc,
const xmlNode *cur,
xmlChar **baseOut);
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlChar *
xmlNodeGetBase (const xmlDoc *doc,
const xmlNode *cur);
XMLPUBFUN int
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN void
xmlNodeSetBase (xmlNodePtr cur,
const xmlChar *uri);
#endif
/*
* Removing content.
*/
XMLPUBFUN int
xmlRemoveProp (xmlAttrPtr cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int
xmlUnsetNsProp (xmlNodePtr node,
xmlNsPtr ns,
@@ -1121,6 +1153,7 @@ XMLPUBFUN int
XMLPUBFUN int
xmlUnsetProp (xmlNodePtr node,
const xmlChar *name);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
/*
* Internal, don't use.
@@ -1142,12 +1175,14 @@ XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
const xmlChar *string);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_TREE_ENABLED
/*
* Namespace handling.
*/
XMLPUBFUN int
xmlReconciliateNs (xmlDocPtr doc,
xmlNodePtr tree);
#endif
#ifdef LIBXML_OUTPUT_ENABLED
/*
@@ -1248,10 +1283,8 @@ XMLPUBFUN int
XMLPUBFUN void
xmlSetDocCompressMode (xmlDocPtr doc,
int mode);
XML_DEPRECATED
XMLPUBFUN int
xmlGetCompressMode (void);
XML_DEPRECATED
XMLPUBFUN void
xmlSetCompressMode (int mode);
@@ -1288,6 +1321,7 @@ XMLPUBFUN int
int deep,
int options);
#ifdef LIBXML_TREE_ENABLED
/*
* 5 interfaces from DOM ElementTraversal, but different in entities
* traversal.
@@ -1302,20 +1336,22 @@ XMLPUBFUN xmlNodePtr
xmlLastElementChild (xmlNodePtr parent);
XMLPUBFUN xmlNodePtr
xmlPreviousElementSibling (xmlNodePtr node);
#endif
XML_DEPRECATED
XMLPUBFUN xmlRegisterNodeFunc
xmlRegisterNodeDefault (xmlRegisterNodeFunc func);
XML_DEPRECATED
XMLPUBFUN xmlDeregisterNodeFunc
xmlDeregisterNodeDefault (xmlDeregisterNodeFunc func);
XML_DEPRECATED
XMLPUBFUN xmlRegisterNodeFunc
xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
XML_DEPRECATED
XMLPUBFUN xmlDeregisterNodeFunc
xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
XML_DEPRECATED XMLPUBFUN xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme (xmlBufferAllocationScheme v);
XML_DEPRECATED XMLPUBFUN int
xmlThrDefDefaultBufferSize (int v);
#ifdef __cplusplus
}
#endif
@@ -52,25 +52,14 @@ struct _xmlURI {
*/
XMLPUBFUN xmlURIPtr
xmlCreateURI (void);
XMLPUBFUN int
xmlBuildURISafe (const xmlChar *URI,
const xmlChar *base,
xmlChar **out);
XMLPUBFUN xmlChar *
xmlBuildURI (const xmlChar *URI,
const xmlChar *base);
XMLPUBFUN int
xmlBuildRelativeURISafe (const xmlChar *URI,
const xmlChar *base,
xmlChar **out);
XMLPUBFUN xmlChar *
xmlBuildRelativeURI (const xmlChar *URI,
const xmlChar *base);
XMLPUBFUN xmlURIPtr
xmlParseURI (const char *str);
XMLPUBFUN int
xmlParseURISafe (const char *str,
xmlURIPtr *uri);
XMLPUBFUN xmlURIPtr
xmlParseURIRaw (const char *str,
int raw);
@@ -11,7 +11,6 @@
#ifndef __XML_VALID_H__
#define __XML_VALID_H__
/** DOC_DISABLE */
#include <libxml/xmlversion.h>
#include <libxml/xmlerror.h>
#define XML_TREE_INTERNALS
@@ -20,7 +19,6 @@
#include <libxml/list.h>
#include <libxml/xmlautomata.h>
#include <libxml/xmlregexp.h>
/** DOC_ENABLE */
#ifdef __cplusplus
extern "C" {
@@ -145,18 +143,16 @@ XMLPUBFUN xmlNotationPtr
const xmlChar *name,
const xmlChar *PublicID,
const xmlChar *SystemID);
XML_DEPRECATED
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNotationTablePtr
xmlCopyNotationTable (xmlNotationTablePtr table);
XML_DEPRECATED
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlFreeNotationTable (xmlNotationTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN void
xmlDumpNotationDecl (xmlBufferPtr buf,
xmlNotationPtr nota);
/* XML_DEPRECATED, still used in lxml */
XMLPUBFUN void
xmlDumpNotationTable (xmlBufferPtr buf,
xmlNotationTablePtr table);
@@ -164,43 +160,37 @@ XMLPUBFUN void
/* Element Content */
/* the non Doc version are being deprecated */
XML_DEPRECATED
XMLPUBFUN xmlElementContentPtr
xmlNewElementContent (const xmlChar *name,
xmlElementContentType type);
XML_DEPRECATED
XMLPUBFUN xmlElementContentPtr
xmlCopyElementContent (xmlElementContentPtr content);
XML_DEPRECATED
XMLPUBFUN void
xmlFreeElementContent (xmlElementContentPtr cur);
/* the new versions with doc argument */
XML_DEPRECATED
XMLPUBFUN xmlElementContentPtr
xmlNewDocElementContent (xmlDocPtr doc,
const xmlChar *name,
xmlElementContentType type);
XML_DEPRECATED
XMLPUBFUN xmlElementContentPtr
xmlCopyDocElementContent(xmlDocPtr doc,
xmlElementContentPtr content);
XML_DEPRECATED
XMLPUBFUN void
xmlFreeDocElementContent(xmlDocPtr doc,
xmlElementContentPtr cur);
XML_DEPRECATED
XMLPUBFUN void
xmlSnprintfElementContent(char *buf,
int size,
xmlElementContentPtr content,
int englob);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
/* DEPRECATED */
XMLPUBFUN void
xmlSprintfElementContent(char *buf,
xmlElementContentPtr content,
int englob);
#endif /* LIBXML_OUTPUT_ENABLED */
/* DEPRECATED */
/* Element */
XMLPUBFUN xmlElementPtr
@@ -209,33 +199,30 @@ XMLPUBFUN xmlElementPtr
const xmlChar *name,
xmlElementTypeVal type,
xmlElementContentPtr content);
XML_DEPRECATED
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlElementTablePtr
xmlCopyElementTable (xmlElementTablePtr table);
XML_DEPRECATED
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlFreeElementTable (xmlElementTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN void
xmlDumpElementTable (xmlBufferPtr buf,
xmlElementTablePtr table);
XML_DEPRECATED
XMLPUBFUN void
xmlDumpElementDecl (xmlBufferPtr buf,
xmlElementPtr elem);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */
XML_DEPRECATED
XMLPUBFUN xmlEnumerationPtr
xmlCreateEnumeration (const xmlChar *name);
/* XML_DEPRECATED, needed for custom attributeDecl SAX handler */
XMLPUBFUN void
xmlFreeEnumeration (xmlEnumerationPtr cur);
XML_DEPRECATED
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlEnumerationPtr
xmlCopyEnumeration (xmlEnumerationPtr cur);
#endif /* LIBXML_TREE_ENABLED */
/* Attribute */
XMLPUBFUN xmlAttributePtr
@@ -248,27 +235,22 @@ XMLPUBFUN xmlAttributePtr
xmlAttributeDefault def,
const xmlChar *defaultValue,
xmlEnumerationPtr tree);
XML_DEPRECATED
#ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlAttributeTablePtr
xmlCopyAttributeTable (xmlAttributeTablePtr table);
XML_DEPRECATED
#endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void
xmlFreeAttributeTable (xmlAttributeTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN void
xmlDumpAttributeTable (xmlBufferPtr buf,
xmlAttributeTablePtr table);
XML_DEPRECATED
XMLPUBFUN void
xmlDumpAttributeDecl (xmlBufferPtr buf,
xmlAttributePtr attr);
#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */
XMLPUBFUN int
xmlAddIDSafe (xmlAttrPtr attr,
const xmlChar *value);
XMLPUBFUN xmlIDPtr
xmlAddID (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
@@ -321,38 +303,31 @@ XMLPUBFUN xmlValidCtxtPtr
XMLPUBFUN void
xmlFreeValidCtxt(xmlValidCtxtPtr);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateRoot (xmlValidCtxtPtr ctxt,
xmlDocPtr doc);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlElementPtr elem);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlValidNormalizeAttributeValue(xmlDocPtr doc,
xmlNodePtr elem,
const xmlChar *name,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN xmlChar *
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem,
const xmlChar *name,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlAttributePtr attr);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateAttributeValue(xmlAttributeType type,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
@@ -361,7 +336,6 @@ XMLPUBFUN int
xmlValidateDtd (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlDtdPtr dtd);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
xmlDocPtr doc);
@@ -372,19 +346,16 @@ XMLPUBFUN int
xmlValidateElement (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateOneElement (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem,
xmlAttrPtr attr,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
@@ -392,16 +363,17 @@ XMLPUBFUN int
const xmlChar *prefix,
xmlNsPtr ns,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN int
xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
xmlDocPtr doc);
XML_DEPRECATED
#endif /* LIBXML_VALID_ENABLED */
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN int
xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
const xmlChar *notationName);
#endif /* LIBXML_VALID_ENABLED */
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
XMLPUBFUN int
xmlIsMixedElement (xmlDocPtr doc,
@@ -452,23 +424,19 @@ XMLPUBFUN int
/*
* Validation based on the regexp support
*/
XML_DEPRECATED
XMLPUBFUN int
xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
xmlElementPtr elem);
XML_DEPRECATED
XMLPUBFUN int
xmlValidatePushElement (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
xmlNodePtr elem,
const xmlChar *qname);
XML_DEPRECATED
XMLPUBFUN int
xmlValidatePushCData (xmlValidCtxtPtr ctxt,
const xmlChar *data,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlValidatePopElement (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
@@ -14,9 +14,7 @@
#define __XML_XINCLUDE_H__
#include <libxml/xmlversion.h>
#include <libxml/xmlerror.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#ifdef LIBXML_XINCLUDE_ENABLED
@@ -117,16 +115,6 @@ XMLPUBFUN xmlXIncludeCtxtPtr
XMLPUBFUN int
xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
int flags);
XMLPUBFUN void
xmlXIncludeSetErrorHandler(xmlXIncludeCtxtPtr ctxt,
xmlStructuredErrorFunc handler,
void *data);
XMLPUBFUN void
xmlXIncludeSetResourceLoader(xmlXIncludeCtxtPtr ctxt,
xmlResourceLoader loader,
void *data);
XMLPUBFUN int
xmlXIncludeGetLastError (xmlXIncludeCtxtPtr ctxt);
XMLPUBFUN void
xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
XMLPUBFUN int
@@ -160,20 +160,16 @@ struct _xlinkHandler {
* detection callbacks.
*/
XML_DEPRECATED
XMLPUBFUN xlinkNodeDetectFunc
xlinkGetDefaultDetect (void);
XML_DEPRECATED
XMLPUBFUN void
xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
/*
* Routines to set/get the default handlers.
*/
XML_DEPRECATED
XMLPUBFUN xlinkHandlerPtr
xlinkGetDefaultHandler (void);
XML_DEPRECATED
XMLPUBFUN void
xlinkSetDefaultHandler (xlinkHandlerPtr handler);
@@ -10,14 +10,12 @@
#ifndef __XML_IO_H__
#define __XML_IO_H__
/** DOC_DISABLE */
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/encoding.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS
/** DOC_ENABLE */
#ifdef __cplusplus
extern "C" {
@@ -176,18 +174,21 @@ struct _xmlOutputBuffer {
#endif /* LIBXML_OUTPUT_ENABLED */
/** DOC_DISABLE */
XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc *
__xmlParserInputBufferCreateFilenameValue(void);
XML_DEPRECATED
XMLPUBFUN xmlOutputBufferCreateFilenameFunc *
__xmlOutputBufferCreateFilenameValue(void);
#define XML_GLOBALS_IO \
XML_OP(xmlParserInputBufferCreateFilenameValue, \
xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
XML_OP(xmlOutputBufferCreateFilenameValue, \
xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
#ifndef XML_GLOBALS_NO_REDEFINITION
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_IO
#undef XML_OP
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define xmlParserInputBufferCreateFilenameValue \
(*__xmlParserInputBufferCreateFilenameValue())
XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
#define xmlOutputBufferCreateFilenameValue \
(*__xmlOutputBufferCreateFilenameValue())
XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
#endif
/** DOC_ENABLE */
@@ -208,7 +209,6 @@ XMLPUBFUN xmlParserInputBufferPtr
XMLPUBFUN xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename (const char *URI,
xmlCharEncoding enc);
XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferPtr
xmlParserInputBufferCreateFile (FILE *file,
xmlCharEncoding enc);
@@ -226,15 +226,12 @@ XMLPUBFUN xmlParserInputBufferPtr
xmlInputCloseCallback ioclose,
void *ioctx,
xmlCharEncoding enc);
XML_DEPRECATED
XMLPUBFUN int
xmlParserInputBufferRead (xmlParserInputBufferPtr in,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlParserInputBufferPush (xmlParserInputBufferPtr in,
int len,
@@ -250,7 +247,7 @@ XMLPUBFUN int
xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc);
XMLPUBFUN xmlParserInputBufferPtr
xmlParserInputBufferPtr
__xmlParserInputBufferCreateFilename(const char *URI,
xmlCharEncoding enc);
@@ -319,21 +316,19 @@ XMLPUBFUN int
xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc);
XMLPUBFUN xmlOutputBufferPtr
xmlOutputBufferPtr
__xmlOutputBufferCreateFilename(const char *URI,
xmlCharEncodingHandlerPtr encoder,
int compression);
#ifdef LIBXML_HTTP_ENABLED
/* This function only exists if HTTP support built into the library */
XML_DEPRECATED
XMLPUBFUN void
xmlRegisterHTTPPostCallbacks (void );
#endif /* LIBXML_HTTP_ENABLED */
#endif /* LIBXML_OUTPUT_ENABLED */
XML_DEPRECATED
XMLPUBFUN xmlParserInputPtr
xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
xmlParserInputPtr ret);
@@ -346,28 +341,26 @@ XMLPUBFUN xmlParserInputPtr
const char *ID,
xmlParserCtxtPtr ctxt);
XML_DEPRECATED
/*
* xmlNormalizeWindowsPath is obsolete, don't use it.
* Check xmlCanonicPath in uri.h for a better alternative.
*/
XMLPUBFUN xmlChar *
xmlNormalizeWindowsPath (const xmlChar *path);
XML_DEPRECATED
XMLPUBFUN int
xmlCheckFilename (const char *path);
/**
* Default 'file://' protocol callbacks
*/
XML_DEPRECATED
XMLPUBFUN int
xmlFileMatch (const char *filename);
XML_DEPRECATED
XMLPUBFUN void *
xmlFileOpen (const char *filename);
XML_DEPRECATED
XMLPUBFUN int
xmlFileRead (void * context,
char * buffer,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlFileClose (void * context);
@@ -375,39 +368,48 @@ XMLPUBFUN int
* Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_ENABLED
XML_DEPRECATED
XMLPUBFUN int
xmlIOHTTPMatch (const char *filename);
XML_DEPRECATED
XMLPUBFUN void *
xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN void *
xmlIOHTTPOpenW (const char * post_uri,
int compression );
#endif /* LIBXML_OUTPUT_ENABLED */
XML_DEPRECATED
XMLPUBFUN int
xmlIOHTTPRead (void * context,
char * buffer,
int len);
XML_DEPRECATED
XMLPUBFUN int
xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */
/**
* Default 'ftp://' protocol callbacks
*/
#if defined(LIBXML_FTP_ENABLED)
XMLPUBFUN int
xmlIOFTPMatch (const char *filename);
XMLPUBFUN void *
xmlIOFTPOpen (const char *filename);
XMLPUBFUN int
xmlIOFTPRead (void * context,
char * buffer,
int len);
XMLPUBFUN int
xmlIOFTPClose (void * context);
#endif /* defined(LIBXML_FTP_ENABLED) */
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
xmlParserInputBufferCreateFilenameDefault(
xmlParserInputBufferCreateFilenameFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
xmlOutputBufferCreateFilenameDefault(
xmlOutputBufferCreateFilenameFunc func);
XML_DEPRECATED
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
xmlThrDefOutputBufferCreateFilenameDefault(
xmlOutputBufferCreateFilenameFunc func);
XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
xmlThrDefParserInputBufferCreateFilenameDefault(
xmlParserInputBufferCreateFilenameFunc func);
@@ -13,6 +13,7 @@
#include <libxml/xmlversion.h>
#ifdef LIBXML_REGEXP_ENABLED
#ifdef LIBXML_AUTOMATA_ENABLED
#include <libxml/xmlstring.h>
@@ -39,31 +40,24 @@ typedef xmlAutomataState *xmlAutomataStatePtr;
/*
* Building API
*/
XML_DEPRECATED
XMLPUBFUN xmlAutomataPtr
xmlNewAutomata (void);
XML_DEPRECATED
XMLPUBFUN void
xmlFreeAutomata (xmlAutomataPtr am);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataGetInitState (xmlAutomataPtr am);
XML_DEPRECATED
XMLPUBFUN int
xmlAutomataSetFinalState (xmlAutomataPtr am,
xmlAutomataStatePtr state);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewState (xmlAutomataPtr am);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewTransition (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar *token,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewTransition2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -71,7 +65,6 @@ XMLPUBFUN xmlAutomataStatePtr
const xmlChar *token,
const xmlChar *token2,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewNegTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -80,7 +73,6 @@ XMLPUBFUN xmlAutomataStatePtr
const xmlChar *token2,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewCountTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -89,7 +81,6 @@ XMLPUBFUN xmlAutomataStatePtr
int min,
int max,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -99,7 +90,6 @@ XMLPUBFUN xmlAutomataStatePtr
int min,
int max,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewOnceTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -108,7 +98,6 @@ XMLPUBFUN xmlAutomataStatePtr
int min,
int max,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
@@ -118,39 +107,32 @@ XMLPUBFUN xmlAutomataStatePtr
int min,
int max,
void *data);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewAllTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int lax);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewEpsilon (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewCountedTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter);
XML_DEPRECATED
XMLPUBFUN xmlAutomataStatePtr
xmlAutomataNewCounterTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter);
XML_DEPRECATED
XMLPUBFUN int
xmlAutomataNewCounter (xmlAutomataPtr am,
int min,
int max);
XML_DEPRECATED
XMLPUBFUN struct _xmlRegexp *
xmlAutomataCompile (xmlAutomataPtr am);
XML_DEPRECATED
XMLPUBFUN int
xmlAutomataIsDeterminist (xmlAutomataPtr am);
@@ -158,6 +140,7 @@ XMLPUBFUN int
}
#endif
#endif /* LIBXML_AUTOMATA_ENABLED */
#endif /* LIBXML_REGEXP_ENABLED */
#endif /* __XML_AUTOMATA_H__ */
@@ -16,12 +16,6 @@
extern "C" {
#endif
/*
* Backward compatibility
*/
#define initGenericErrorDefaultFunc(h) \
xmlSetGenericErrorFunc(NULL, (h) ? *((xmlGenericErrorFunc *) (h)) : NULL)
/**
* xmlErrorLevel:
*
@@ -217,11 +211,6 @@ typedef enum {
XML_ERR_USER_STOP, /* 111 */
XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */
XML_WAR_ENCODING_MISMATCH, /* 113 */
XML_ERR_RESOURCE_LIMIT, /* 114 */
XML_ERR_ARGUMENT, /* 115 */
XML_ERR_SYSTEM, /* 116 */
XML_ERR_REDECL_PREDEF_ENTITY, /* 117 */
XML_ERR_INT_SUBSET_NOT_FINISHED, /* 118 */
XML_NS_ERR_XML_NAMESPACE = 200,
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
XML_NS_ERR_QNAME, /* 202 */
@@ -484,7 +473,6 @@ typedef enum {
XML_IO_EADDRINUSE, /* 1554 */
XML_IO_EALREADY, /* 1555 */
XML_IO_EAFNOSUPPORT, /* 1556 */
XML_IO_UNSUPPORTED_PROTOCOL, /* 1557 */
XML_XINCLUDE_RECURSION=1600,
XML_XINCLUDE_PARSE_VALUE, /* 1601 */
XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
@@ -871,20 +859,23 @@ typedef void (*xmlGenericErrorFunc) (void *ctx,
typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
/** DOC_DISABLE */
XML_DEPRECATED
XMLPUBFUN const xmlError *__xmlLastError(void);
#define XML_GLOBALS_ERROR \
XML_OP(xmlLastError, xmlError, XML_DEPRECATED) \
XML_OP(xmlGenericError, xmlGenericErrorFunc, XML_NO_ATTR) \
XML_OP(xmlGenericErrorContext, void *, XML_NO_ATTR) \
XML_OP(xmlStructuredError, xmlStructuredErrorFunc, XML_NO_ATTR) \
XML_OP(xmlStructuredErrorContext, void *, XML_NO_ATTR)
XMLPUBFUN xmlGenericErrorFunc *__xmlGenericError(void);
XMLPUBFUN void **__xmlGenericErrorContext(void);
XMLPUBFUN xmlStructuredErrorFunc *__xmlStructuredError(void);
XMLPUBFUN void **__xmlStructuredErrorContext(void);
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_ERROR
#undef XML_OP
#ifndef XML_GLOBALS_NO_REDEFINITION
#define xmlLastError (*__xmlLastError())
#define xmlGenericError (*__xmlGenericError())
#define xmlGenericErrorContext (*__xmlGenericErrorContext())
#define xmlStructuredError (*__xmlStructuredError())
#define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define xmlLastError XML_GLOBAL_MACRO(xmlLastError)
#define xmlGenericError XML_GLOBAL_MACRO(xmlGenericError)
#define xmlGenericErrorContext XML_GLOBAL_MACRO(xmlGenericErrorContext)
#define xmlStructuredError XML_GLOBAL_MACRO(xmlStructuredError)
#define xmlStructuredErrorContext XML_GLOBAL_MACRO(xmlStructuredErrorContext)
#endif
/** DOC_ENABLE */
@@ -895,15 +886,16 @@ XMLPUBFUN void **__xmlStructuredErrorContext(void);
XMLPUBFUN void
xmlSetGenericErrorFunc (void *ctx,
xmlGenericErrorFunc handler);
XML_DEPRECATED
XMLPUBFUN void
xmlThrDefSetGenericErrorFunc(void *ctx,
xmlGenericErrorFunc handler);
XML_DEPRECATED
XMLPUBFUN void
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
XMLPUBFUN void
xmlSetStructuredErrorFunc (void *ctx,
xmlStructuredErrorFunc handler);
XML_DEPRECATED
XMLPUBFUN void
xmlThrDefSetStructuredErrorFunc(void *ctx,
xmlStructuredErrorFunc handler);
@@ -927,17 +919,11 @@ XMLPUBFUN void
xmlParserValidityWarning (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/** DOC_DISABLE */
struct _xmlParserInput;
/** DOC_ENABLE */
XMLPUBFUN void
xmlParserPrintFileInfo (struct _xmlParserInput *input);
XMLPUBFUN void
xmlParserPrintFileContext (struct _xmlParserInput *input);
XMLPUBFUN void
xmlFormatError (const xmlError *err,
xmlGenericErrorFunc channel,
void *data);
/*
* Extended error information routines
@@ -9,11 +9,6 @@
#define __XML_EXPORTS_H__
/** DOC_DISABLE */
/*
* Symbol visibility
*/
#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef LIBXML_STATIC
#define XMLPUBLIC
@@ -25,71 +20,30 @@
#else /* not Windows */
#define XMLPUBLIC
#endif /* platform switch */
/** DOC_ENABLE */
/*
* XMLPUBFUN:
*
* Macro which declares an exportable function
*/
#define XMLPUBFUN XMLPUBLIC
/**
* XMLPUBVAR:
*
* Macro which declares an exportable variable
*/
#define XMLPUBVAR XMLPUBLIC extern
/** DOC_DISABLE */
/* Compatibility */
#define XMLCALL
#define XMLCDECL
#ifndef LIBXML_DLL_IMPORT
#define LIBXML_DLL_IMPORT XMLPUBVAR
#endif
/*
* Attributes
*/
#if !defined(__clang__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
#define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
#else
#define LIBXML_ATTR_ALLOC_SIZE(x)
#endif
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 303
#define LIBXML_ATTR_FORMAT(fmt,args) \
__attribute__((__format__(__printf__,fmt,args)))
#else
#define LIBXML_ATTR_FORMAT(fmt,args)
#endif
#ifndef XML_DEPRECATED
#if defined(IN_LIBXML)
#define XML_DEPRECATED
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
#define XML_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER) && _MSC_VER >= 1400
/* Available since Visual Studio 2005 */
#define XML_DEPRECATED __declspec(deprecated)
#else
#define XML_DEPRECATED
#endif
#endif
#ifndef XML_DEPRECATED_MEMBER
#if defined(IN_LIBXML)
#define XML_DEPRECATED_MEMBER
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
#define XML_DEPRECATED_MEMBER __attribute__((deprecated))
#else
#define XML_DEPRECATED_MEMBER
#endif
#endif
/*
* Originally declared in xmlversion.h which is generated
*/
#ifdef __cplusplus
extern "C" {
#endif
XMLPUBFUN void xmlCheckVersion(int version);
#ifdef __cplusplus
}
#if !defined(LIBXML_DLL_IMPORT)
#define LIBXML_DLL_IMPORT XMLPUBVAR
#endif
/** DOC_ENABLE */
#endif /* __XML_EXPORTS_H__ */
@@ -69,25 +69,27 @@ typedef char *(*xmlStrdupFunc)(const char *str);
* - xmlMemStrdup
* - xmlFree
*/
#ifdef LIBXML_THREAD_ALLOC_ENABLED
/** DOC_DISABLE */
XMLPUBFUN xmlMallocFunc *__xmlMalloc(void);
XMLPUBFUN xmlMallocFunc *__xmlMallocAtomic(void);
XMLPUBFUN xmlReallocFunc *__xmlRealloc(void);
XMLPUBFUN xmlFreeFunc *__xmlFree(void);
XMLPUBFUN xmlStrdupFunc *__xmlMemStrdup(void);
#ifndef XML_GLOBALS_NO_REDEFINITION
#define xmlMalloc (*__xmlMalloc())
#define xmlMallocAtomic (*__xmlMallocAtomic())
#define xmlRealloc (*__xmlRealloc())
#define xmlFree (*__xmlFree())
#define xmlMemStrdup (*__xmlMemStrdup())
#endif
/** DOC_ENABLE */
#ifdef LIBXML_THREAD_ALLOC_ENABLED
#define XML_GLOBALS_ALLOC \
XML_OP(xmlMalloc, xmlMallocFunc, XML_NO_ATTR) \
XML_OP(xmlMallocAtomic, xmlMallocFunc, XML_NO_ATTR) \
XML_OP(xmlRealloc, xmlReallocFunc, XML_NO_ATTR) \
XML_OP(xmlFree, xmlFreeFunc, XML_NO_ATTR) \
XML_OP(xmlMemStrdup, xmlStrdupFunc, XML_NO_ATTR)
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_ALLOC
#undef XML_OP
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define xmlMalloc XML_GLOBAL_MACRO(xmlMalloc)
#define xmlMallocAtomic XML_GLOBAL_MACRO(xmlMallocAtomic)
#define xmlRealloc XML_GLOBAL_MACRO(xmlRealloc)
#define xmlFree XML_GLOBAL_MACRO(xmlFree)
#define xmlMemStrdup XML_GLOBAL_MACRO(xmlMemStrdup)
#endif
#else
#define XML_GLOBALS_ALLOC
/** DOC_ENABLE */
XMLPUBVAR xmlMallocFunc xmlMalloc;
XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
XMLPUBVAR xmlReallocFunc xmlRealloc;
@@ -110,14 +112,12 @@ XMLPUBFUN int
xmlMallocFunc *mallocFunc,
xmlReallocFunc *reallocFunc,
xmlStrdupFunc *strdupFunc);
XML_DEPRECATED
XMLPUBFUN int
xmlGcMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlMallocFunc mallocAtomicFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc);
XML_DEPRECATED
XMLPUBFUN int
xmlGcMemGet (xmlFreeFunc *freeFunc,
xmlMallocFunc *mallocFunc,
@@ -147,16 +147,12 @@ XMLPUBFUN int
xmlMemUsed (void);
XMLPUBFUN int
xmlMemBlocks (void);
XML_DEPRECATED
XMLPUBFUN void
xmlMemDisplay (FILE *fp);
XML_DEPRECATED
XMLPUBFUN void
xmlMemDisplayLast(FILE *fp, long nbBytes);
XML_DEPRECATED
XMLPUBFUN void
xmlMemShow (FILE *fp, int nr);
XML_DEPRECATED
XMLPUBFUN void
xmlMemoryDump (void);
XMLPUBFUN void *
@@ -167,19 +163,60 @@ XMLPUBFUN void
xmlMemFree (void *ptr);
XMLPUBFUN char *
xmlMemoryStrdup (const char *str);
XML_DEPRECATED
XMLPUBFUN void *
xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XML_DEPRECATED
XMLPUBFUN void *
xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
XML_DEPRECATED
XMLPUBFUN void *
xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
XML_DEPRECATED
XMLPUBFUN char *
xmlMemStrdupLoc (const char *str, const char *file, int line);
/** DOC_DISABLE */
#ifdef DEBUG_MEMORY_LOCATION
/**
* xmlMalloc:
* @size: number of bytes to allocate
*
* Wrapper for the malloc() function used in the XML library.
*
* Returns the pointer to the allocated area or NULL in case of error.
*/
#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__)
/**
* xmlMallocAtomic:
* @size: number of bytes to allocate
*
* Wrapper for the malloc() function used in the XML library for allocation
* of block not containing pointers to other areas.
*
* Returns the pointer to the allocated area or NULL in case of error.
*/
#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__)
/**
* xmlRealloc:
* @ptr: pointer to the existing allocated area
* @size: number of bytes to allocate
*
* Wrapper for the realloc() function used in the XML library.
*
* Returns the pointer to the allocated area or NULL in case of error.
*/
#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__)
/**
* xmlMemStrdup:
* @str: pointer to the existing string
*
* Wrapper for the strdup() function, xmlStrdup() is usually preferred.
*
* Returns the pointer to the allocated area or NULL in case of error.
*/
#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__)
#endif /* DEBUG_MEMORY_LOCATION */
/** DOC_ENABLE */
#ifdef __cplusplus
}
#endif /* __cplusplus */
@@ -37,19 +37,15 @@ typedef enum {
XML_MODULE_LOCAL= 2 /* local binding */
} xmlModuleOption;
XML_DEPRECATED
XMLPUBFUN xmlModulePtr xmlModuleOpen (const char *filename,
int options);
XML_DEPRECATED
XMLPUBFUN int xmlModuleSymbol (xmlModulePtr module,
const char* name,
void **result);
XML_DEPRECATED
XMLPUBFUN int xmlModuleClose (xmlModulePtr module);
XML_DEPRECATED
XMLPUBFUN int xmlModuleFree (xmlModulePtr module);
#ifdef __cplusplus
@@ -14,12 +14,11 @@
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlIO.h>
#ifdef LIBXML_RELAXNG_ENABLED
#include <libxml/relaxng.h>
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>
#include <libxml/xmlschemas.h>
#endif
/* for compatibility */
#include <libxml/parser.h>
#ifdef __cplusplus
@@ -128,8 +127,6 @@ XMLPUBFUN int
XMLPUBFUN void
xmlTextReaderSetMaxAmplification(xmlTextReaderPtr reader,
unsigned maxAmpl);
XMLPUBFUN const xmlError *
xmlTextReaderGetLastError(xmlTextReaderPtr reader);
/*
* Iterators
@@ -289,7 +286,7 @@ XMLPUBFUN int
xmlTextReaderNextSibling (xmlTextReaderPtr reader);
XMLPUBFUN int
xmlTextReaderIsValid (xmlTextReaderPtr reader);
#ifdef LIBXML_RELAXNG_ENABLED
#ifdef LIBXML_SCHEMAS_ENABLED
XMLPUBFUN int
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
const char *rng);
@@ -301,8 +298,6 @@ XMLPUBFUN int
XMLPUBFUN int
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
xmlRelaxNGPtr schema);
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
XMLPUBFUN int
xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
const char *xsd);
@@ -429,11 +424,6 @@ XMLPUBFUN void
xmlTextReaderErrorFunc *f,
void **arg);
XMLPUBFUN void
xmlTextReaderSetResourceLoader(xmlTextReaderPtr reader,
xmlResourceLoader loader,
void *data);
#endif /* LIBXML_READER_ENABLED */
#ifdef __cplusplus
@@ -47,7 +47,6 @@ XMLPUBFUN void xmlRegFreeRegexp(xmlRegexpPtr regexp);
XMLPUBFUN int
xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar *value);
XML_DEPRECATED
XMLPUBFUN void
xmlRegexpPrint (FILE *output,
xmlRegexpPtr regexp);
@@ -71,34 +70,28 @@ typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
/*
* The progressive API
*/
XML_DEPRECATED
XMLPUBFUN xmlRegExecCtxtPtr
xmlRegNewExecCtxt (xmlRegexpPtr comp,
xmlRegExecCallbacks callback,
void *data);
XML_DEPRECATED
XMLPUBFUN void
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
const xmlChar *value,
void *data);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
const xmlChar *value,
const xmlChar *value2,
void *data);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
int *nbval,
int *nbneg,
xmlChar **values,
int *terminal);
XML_DEPRECATED
XMLPUBFUN int
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
const xmlChar **string,
@@ -106,7 +99,113 @@ XMLPUBFUN int
int *nbneg,
xmlChar **values,
int *terminal);
#ifdef LIBXML_EXPR_ENABLED
/*
* Formal regular expression handling
* Its goal is to do some formal work on content models
*/
/* expressions are used within a context */
typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
XMLPUBFUN void
xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
XMLPUBFUN xmlExpCtxtPtr
xmlExpNewCtxt (int maxNodes,
xmlDictPtr dict);
XMLPUBFUN int
xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
XMLPUBFUN int
xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/* Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
typedef xmlExpNode *xmlExpNodePtr;
typedef enum {
XML_EXP_EMPTY = 0,
XML_EXP_FORBID = 1,
XML_EXP_ATOM = 2,
XML_EXP_SEQ = 3,
XML_EXP_OR = 4,
XML_EXP_COUNT = 5
} xmlExpNodeType;
/*
* 2 core expressions shared by all for the empty language set
* and for the set with just the empty token
*/
XMLPUBVAR xmlExpNodePtr forbiddenExp;
XMLPUBVAR xmlExpNodePtr emptyExp;
/*
* Expressions are reference counted internally
*/
XMLPUBFUN void
xmlExpFree (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr);
XMLPUBFUN void
xmlExpRef (xmlExpNodePtr expr);
/*
* constructors can be either manual or from a string
*/
XMLPUBFUN xmlExpNodePtr
xmlExpParse (xmlExpCtxtPtr ctxt,
const char *expr);
XMLPUBFUN xmlExpNodePtr
xmlExpNewAtom (xmlExpCtxtPtr ctxt,
const xmlChar *name,
int len);
XMLPUBFUN xmlExpNodePtr
xmlExpNewOr (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr
xmlExpNewSeq (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr
xmlExpNewRange (xmlExpCtxtPtr ctxt,
xmlExpNodePtr subset,
int min,
int max);
/*
* The really interesting APIs
*/
XMLPUBFUN int
xmlExpIsNillable(xmlExpNodePtr expr);
XMLPUBFUN int
xmlExpMaxToken (xmlExpNodePtr expr);
XMLPUBFUN int
xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar**langList,
int len);
XMLPUBFUN int
xmlExpGetStart (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar**tokList,
int len);
XMLPUBFUN xmlExpNodePtr
xmlExpStringDerive(xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar *str,
int len);
XMLPUBFUN xmlExpNodePtr
xmlExpExpDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
xmlExpNodePtr sub);
XMLPUBFUN int
xmlExpSubsume (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
xmlExpNodePtr sub);
XMLPUBFUN void
xmlExpDump (xmlBufferPtr buf,
xmlExpNodePtr expr);
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
#endif
@@ -34,11 +34,7 @@ typedef enum {
XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
XML_SAVE_WSNONSIG = 1<<7, /* format with non-significant whitespace */
/* Available since 2.14.0 */
XML_SAVE_EMPTY = 1<<8, /* force empty tags, overriding global */
XML_SAVE_NO_INDENT = 1<<9, /* disable indenting */
XML_SAVE_INDENT = 1<<10 /* force indenting, overriding global */
XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
} xmlSaveOption;
@@ -77,27 +73,17 @@ XMLPUBFUN int
xmlSaveFlush (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int
xmlSaveClose (xmlSaveCtxtPtr ctxt);
XMLPUBFUN xmlParserErrors
xmlSaveFinish (xmlSaveCtxtPtr ctxt);
XMLPUBFUN int
xmlSaveSetIndentString (xmlSaveCtxtPtr ctxt,
const char *indent);
XML_DEPRECATED
XMLPUBFUN int
xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
xmlCharEncodingOutputFunc escape);
XML_DEPRECATED
XMLPUBFUN int
xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
xmlCharEncodingOutputFunc escape);
XML_DEPRECATED
XMLPUBFUN int
xmlThrDefIndentTreeOutput(int v);
XML_DEPRECATED
XMLPUBFUN const char *
xmlThrDefTreeIndentString(const char * v);
XML_DEPRECATED
XMLPUBFUN int
xmlThrDefSaveNoEmptyTags(int v);
@@ -18,7 +18,6 @@
#include <stdio.h>
#include <libxml/encoding.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
@@ -157,26 +156,22 @@ XMLPUBFUN void
xmlStructuredErrorFunc serror,
void *ctx);
XMLPUBFUN int
xmlSchemaGetParserErrors (xmlSchemaParserCtxtPtr ctxt,
xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void **ctx);
XMLPUBFUN void
xmlSchemaSetResourceLoader (xmlSchemaParserCtxtPtr ctxt,
xmlResourceLoader loader,
void *data);
XMLPUBFUN int
xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
XMLPUBFUN xmlSchemaPtr
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void
xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_DEBUG_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void
xmlSchemaDump (FILE *output,
xmlSchemaPtr schema);
#endif /* LIBXML_DEBUG_ENABLED */
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
@@ -217,7 +212,7 @@ XMLPUBFUN int
xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
xmlParserInputBufferPtr input,
xmlCharEncoding enc,
const xmlSAXHandler *sax,
xmlSAXHandlerPtr sax,
void *user_data);
XMLPUBFUN int
xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
@@ -2,14 +2,201 @@
* Summary: Unicode character APIs
* Description: API for the Unicode character APIs
*
* Deprecated, don't use.
* This file is automatically generated from the
* UCS description files of the Unicode Character Database
* http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html
* using the genUnicode.py Python script.
*
* Generation date: Mon Mar 27 11:09:52 2006
* Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt
* Author: Daniel Veillard
*/
#ifndef __XML_UNICODE_H__
#define __XML_UNICODE_H__
#ifdef __GNUC__
#warning "libxml/xmlunicode.h is deprecated"
#include <libxml/xmlversion.h>
#ifdef LIBXML_UNICODE_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
XMLPUBFUN int xmlUCSIsAegeanNumbers (int code);
XMLPUBFUN int xmlUCSIsAlphabeticPresentationForms (int code);
XMLPUBFUN int xmlUCSIsArabic (int code);
XMLPUBFUN int xmlUCSIsArabicPresentationFormsA (int code);
XMLPUBFUN int xmlUCSIsArabicPresentationFormsB (int code);
XMLPUBFUN int xmlUCSIsArmenian (int code);
XMLPUBFUN int xmlUCSIsArrows (int code);
XMLPUBFUN int xmlUCSIsBasicLatin (int code);
XMLPUBFUN int xmlUCSIsBengali (int code);
XMLPUBFUN int xmlUCSIsBlockElements (int code);
XMLPUBFUN int xmlUCSIsBopomofo (int code);
XMLPUBFUN int xmlUCSIsBopomofoExtended (int code);
XMLPUBFUN int xmlUCSIsBoxDrawing (int code);
XMLPUBFUN int xmlUCSIsBraillePatterns (int code);
XMLPUBFUN int xmlUCSIsBuhid (int code);
XMLPUBFUN int xmlUCSIsByzantineMusicalSymbols (int code);
XMLPUBFUN int xmlUCSIsCJKCompatibility (int code);
XMLPUBFUN int xmlUCSIsCJKCompatibilityForms (int code);
XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographs (int code);
XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographsSupplement (int code);
XMLPUBFUN int xmlUCSIsCJKRadicalsSupplement (int code);
XMLPUBFUN int xmlUCSIsCJKSymbolsandPunctuation (int code);
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographs (int code);
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionA (int code);
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionB (int code);
XMLPUBFUN int xmlUCSIsCherokee (int code);
XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarks (int code);
XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarksforSymbols (int code);
XMLPUBFUN int xmlUCSIsCombiningHalfMarks (int code);
XMLPUBFUN int xmlUCSIsCombiningMarksforSymbols (int code);
XMLPUBFUN int xmlUCSIsControlPictures (int code);
XMLPUBFUN int xmlUCSIsCurrencySymbols (int code);
XMLPUBFUN int xmlUCSIsCypriotSyllabary (int code);
XMLPUBFUN int xmlUCSIsCyrillic (int code);
XMLPUBFUN int xmlUCSIsCyrillicSupplement (int code);
XMLPUBFUN int xmlUCSIsDeseret (int code);
XMLPUBFUN int xmlUCSIsDevanagari (int code);
XMLPUBFUN int xmlUCSIsDingbats (int code);
XMLPUBFUN int xmlUCSIsEnclosedAlphanumerics (int code);
XMLPUBFUN int xmlUCSIsEnclosedCJKLettersandMonths (int code);
XMLPUBFUN int xmlUCSIsEthiopic (int code);
XMLPUBFUN int xmlUCSIsGeneralPunctuation (int code);
XMLPUBFUN int xmlUCSIsGeometricShapes (int code);
XMLPUBFUN int xmlUCSIsGeorgian (int code);
XMLPUBFUN int xmlUCSIsGothic (int code);
XMLPUBFUN int xmlUCSIsGreek (int code);
XMLPUBFUN int xmlUCSIsGreekExtended (int code);
XMLPUBFUN int xmlUCSIsGreekandCoptic (int code);
XMLPUBFUN int xmlUCSIsGujarati (int code);
XMLPUBFUN int xmlUCSIsGurmukhi (int code);
XMLPUBFUN int xmlUCSIsHalfwidthandFullwidthForms (int code);
XMLPUBFUN int xmlUCSIsHangulCompatibilityJamo (int code);
XMLPUBFUN int xmlUCSIsHangulJamo (int code);
XMLPUBFUN int xmlUCSIsHangulSyllables (int code);
XMLPUBFUN int xmlUCSIsHanunoo (int code);
XMLPUBFUN int xmlUCSIsHebrew (int code);
XMLPUBFUN int xmlUCSIsHighPrivateUseSurrogates (int code);
XMLPUBFUN int xmlUCSIsHighSurrogates (int code);
XMLPUBFUN int xmlUCSIsHiragana (int code);
XMLPUBFUN int xmlUCSIsIPAExtensions (int code);
XMLPUBFUN int xmlUCSIsIdeographicDescriptionCharacters (int code);
XMLPUBFUN int xmlUCSIsKanbun (int code);
XMLPUBFUN int xmlUCSIsKangxiRadicals (int code);
XMLPUBFUN int xmlUCSIsKannada (int code);
XMLPUBFUN int xmlUCSIsKatakana (int code);
XMLPUBFUN int xmlUCSIsKatakanaPhoneticExtensions (int code);
XMLPUBFUN int xmlUCSIsKhmer (int code);
XMLPUBFUN int xmlUCSIsKhmerSymbols (int code);
XMLPUBFUN int xmlUCSIsLao (int code);
XMLPUBFUN int xmlUCSIsLatin1Supplement (int code);
XMLPUBFUN int xmlUCSIsLatinExtendedA (int code);
XMLPUBFUN int xmlUCSIsLatinExtendedB (int code);
XMLPUBFUN int xmlUCSIsLatinExtendedAdditional (int code);
XMLPUBFUN int xmlUCSIsLetterlikeSymbols (int code);
XMLPUBFUN int xmlUCSIsLimbu (int code);
XMLPUBFUN int xmlUCSIsLinearBIdeograms (int code);
XMLPUBFUN int xmlUCSIsLinearBSyllabary (int code);
XMLPUBFUN int xmlUCSIsLowSurrogates (int code);
XMLPUBFUN int xmlUCSIsMalayalam (int code);
XMLPUBFUN int xmlUCSIsMathematicalAlphanumericSymbols (int code);
XMLPUBFUN int xmlUCSIsMathematicalOperators (int code);
XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsA (int code);
XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsB (int code);
XMLPUBFUN int xmlUCSIsMiscellaneousSymbols (int code);
XMLPUBFUN int xmlUCSIsMiscellaneousSymbolsandArrows (int code);
XMLPUBFUN int xmlUCSIsMiscellaneousTechnical (int code);
XMLPUBFUN int xmlUCSIsMongolian (int code);
XMLPUBFUN int xmlUCSIsMusicalSymbols (int code);
XMLPUBFUN int xmlUCSIsMyanmar (int code);
XMLPUBFUN int xmlUCSIsNumberForms (int code);
XMLPUBFUN int xmlUCSIsOgham (int code);
XMLPUBFUN int xmlUCSIsOldItalic (int code);
XMLPUBFUN int xmlUCSIsOpticalCharacterRecognition (int code);
XMLPUBFUN int xmlUCSIsOriya (int code);
XMLPUBFUN int xmlUCSIsOsmanya (int code);
XMLPUBFUN int xmlUCSIsPhoneticExtensions (int code);
XMLPUBFUN int xmlUCSIsPrivateUse (int code);
XMLPUBFUN int xmlUCSIsPrivateUseArea (int code);
XMLPUBFUN int xmlUCSIsRunic (int code);
XMLPUBFUN int xmlUCSIsShavian (int code);
XMLPUBFUN int xmlUCSIsSinhala (int code);
XMLPUBFUN int xmlUCSIsSmallFormVariants (int code);
XMLPUBFUN int xmlUCSIsSpacingModifierLetters (int code);
XMLPUBFUN int xmlUCSIsSpecials (int code);
XMLPUBFUN int xmlUCSIsSuperscriptsandSubscripts (int code);
XMLPUBFUN int xmlUCSIsSupplementalArrowsA (int code);
XMLPUBFUN int xmlUCSIsSupplementalArrowsB (int code);
XMLPUBFUN int xmlUCSIsSupplementalMathematicalOperators (int code);
XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaA (int code);
XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaB (int code);
XMLPUBFUN int xmlUCSIsSyriac (int code);
XMLPUBFUN int xmlUCSIsTagalog (int code);
XMLPUBFUN int xmlUCSIsTagbanwa (int code);
XMLPUBFUN int xmlUCSIsTags (int code);
XMLPUBFUN int xmlUCSIsTaiLe (int code);
XMLPUBFUN int xmlUCSIsTaiXuanJingSymbols (int code);
XMLPUBFUN int xmlUCSIsTamil (int code);
XMLPUBFUN int xmlUCSIsTelugu (int code);
XMLPUBFUN int xmlUCSIsThaana (int code);
XMLPUBFUN int xmlUCSIsThai (int code);
XMLPUBFUN int xmlUCSIsTibetan (int code);
XMLPUBFUN int xmlUCSIsUgaritic (int code);
XMLPUBFUN int xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code);
XMLPUBFUN int xmlUCSIsVariationSelectors (int code);
XMLPUBFUN int xmlUCSIsVariationSelectorsSupplement (int code);
XMLPUBFUN int xmlUCSIsYiRadicals (int code);
XMLPUBFUN int xmlUCSIsYiSyllables (int code);
XMLPUBFUN int xmlUCSIsYijingHexagramSymbols (int code);
XMLPUBFUN int xmlUCSIsBlock (int code, const char *block);
XMLPUBFUN int xmlUCSIsCatC (int code);
XMLPUBFUN int xmlUCSIsCatCc (int code);
XMLPUBFUN int xmlUCSIsCatCf (int code);
XMLPUBFUN int xmlUCSIsCatCo (int code);
XMLPUBFUN int xmlUCSIsCatCs (int code);
XMLPUBFUN int xmlUCSIsCatL (int code);
XMLPUBFUN int xmlUCSIsCatLl (int code);
XMLPUBFUN int xmlUCSIsCatLm (int code);
XMLPUBFUN int xmlUCSIsCatLo (int code);
XMLPUBFUN int xmlUCSIsCatLt (int code);
XMLPUBFUN int xmlUCSIsCatLu (int code);
XMLPUBFUN int xmlUCSIsCatM (int code);
XMLPUBFUN int xmlUCSIsCatMc (int code);
XMLPUBFUN int xmlUCSIsCatMe (int code);
XMLPUBFUN int xmlUCSIsCatMn (int code);
XMLPUBFUN int xmlUCSIsCatN (int code);
XMLPUBFUN int xmlUCSIsCatNd (int code);
XMLPUBFUN int xmlUCSIsCatNl (int code);
XMLPUBFUN int xmlUCSIsCatNo (int code);
XMLPUBFUN int xmlUCSIsCatP (int code);
XMLPUBFUN int xmlUCSIsCatPc (int code);
XMLPUBFUN int xmlUCSIsCatPd (int code);
XMLPUBFUN int xmlUCSIsCatPe (int code);
XMLPUBFUN int xmlUCSIsCatPf (int code);
XMLPUBFUN int xmlUCSIsCatPi (int code);
XMLPUBFUN int xmlUCSIsCatPo (int code);
XMLPUBFUN int xmlUCSIsCatPs (int code);
XMLPUBFUN int xmlUCSIsCatS (int code);
XMLPUBFUN int xmlUCSIsCatSc (int code);
XMLPUBFUN int xmlUCSIsCatSk (int code);
XMLPUBFUN int xmlUCSIsCatSm (int code);
XMLPUBFUN int xmlUCSIsCatSo (int code);
XMLPUBFUN int xmlUCSIsCatZ (int code);
XMLPUBFUN int xmlUCSIsCatZl (int code);
XMLPUBFUN int xmlUCSIsCatZp (int code);
XMLPUBFUN int xmlUCSIsCatZs (int code);
XMLPUBFUN int xmlUCSIsCat (int code, const char *cat);
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_UNICODE_ENABLED */
#endif /* __XML_UNICODE_H__ */
@@ -10,26 +10,40 @@
#ifndef __XML_VERSION_H__
#define __XML_VERSION_H__
#include <libxml/xmlexports.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* use those to be sure nothing nasty will happen if
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */
/**
* LIBXML_DOTTED_VERSION:
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.14.6"
#define LIBXML_DOTTED_VERSION "2.12.9"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 21406
#define LIBXML_VERSION 21209
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "21406"
#define LIBXML_VERSION_STRING "21209"
/**
* LIBXML_VERSION_EXTRA:
@@ -44,7 +58,32 @@
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(21406);
#define LIBXML_TEST_VERSION xmlCheckVersion(21209);
#ifndef VMS
#if 0
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO
#else
/**
* WITHOUT_TRIO:
*
* defined if the trio support should not be configured in
*/
#define WITHOUT_TRIO
#endif
#else /* VMS */
/**
* WITH_TRIO:
*
* defined if the trio support need to be configured in
*/
#define WITH_TRIO 1
#endif /* VMS */
/**
* LIBXML_THREAD_ENABLED:
@@ -67,9 +106,11 @@
/**
* LIBXML_TREE_ENABLED:
*
* Always enabled since 2.14.0
* Whether the DOM like tree manipulation API support is configured in
*/
#if 1
#define LIBXML_TREE_ENABLED
#endif
/**
* LIBXML_OUTPUT_ENABLED:
@@ -125,12 +166,21 @@
#define LIBXML_SAX1_ENABLED
#endif
/**
* LIBXML_FTP_ENABLED:
*
* Whether the FTP support is configured in
*/
#if 0
#define LIBXML_FTP_ENABLED
#endif
/**
* LIBXML_HTTP_ENABLED:
*
* Whether the HTTP support is configured in
*/
#if 0
#if 1
#define LIBXML_HTTP_ENABLED
#endif
@@ -155,9 +205,11 @@
/**
* LIBXML_LEGACY_ENABLED:
*
* Removed in 2.14
* Whether the deprecated APIs are compiled in for compatibility
*/
#undef LIBXML_LEGACY_ENABLED
#if 0
#define LIBXML_LEGACY_ENABLED
#endif
/**
* LIBXML_C14N_ENABLED:
@@ -195,6 +247,15 @@
#define LIBXML_XPTR_ENABLED
#endif
/**
* LIBXML_XPTR_LOCS_ENABLED:
*
* Whether support for XPointer locations is configured in
*/
#if 0
#define LIBXML_XPTR_LOCS_ENABLED
#endif
/**
* LIBXML_XINCLUDE_ENABLED:
*
@@ -240,12 +301,32 @@
#define LIBXML_DEBUG_ENABLED
#endif
/**
* DEBUG_MEMORY_LOCATION:
*
* Whether the memory debugging is configured in
*/
#if 0
#define DEBUG_MEMORY_LOCATION
#endif
/**
* LIBXML_DEBUG_RUNTIME:
*
* Removed
*/
#if 0
#define LIBXML_DEBUG_RUNTIME
#endif
/**
* LIBXML_UNICODE_ENABLED:
*
* Removed in 2.14
* Whether the Unicode related interfaces are compiled in
*/
#undef LIBXML_UNICODE_ENABLED
#if 1
#define LIBXML_UNICODE_ENABLED
#endif
/**
* LIBXML_REGEXP_ENABLED:
@@ -266,12 +347,14 @@
#endif
/**
* LIBXML_RELAXNG_ENABLED:
* LIBXML_EXPR_ENABLED:
*
* Whether the RelaxNG validation interfaces are compiled in
* Whether the formal expressions interfaces are compiled in
*
* This code is unused and disabled unconditionally for now.
*/
#if 1
#define LIBXML_RELAXNG_ENABLED
#if 0
#define LIBXML_EXPR_ENABLED
#endif
/**
@@ -325,8 +408,104 @@
#define LIBXML_LZMA_ENABLED
#endif
#include <libxml/xmlexports.h>
#ifdef __GNUC__
/** DOC_DISABLE */
#ifndef ATTRIBUTE_UNUSED
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
# define ATTRIBUTE_UNUSED __attribute__((unused))
# else
# define ATTRIBUTE_UNUSED
# endif
#endif
#ifndef LIBXML_ATTR_ALLOC_SIZE
# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else
# define LIBXML_ATTR_ALLOC_SIZE(x)
# endif
#else
# define LIBXML_ATTR_ALLOC_SIZE(x)
#endif
#ifndef LIBXML_ATTR_FORMAT
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
# else
# define LIBXML_ATTR_FORMAT(fmt,args)
# endif
#else
# define LIBXML_ATTR_FORMAT(fmt,args)
#endif
#ifndef XML_DEPRECATED
# if defined (IN_LIBXML) || (__GNUC__ * 100 + __GNUC_MINOR__ < 301)
# define XML_DEPRECATED
/* Available since at least GCC 3.1 */
# else
# define XML_DEPRECATED __attribute__((deprecated))
# endif
#endif
#if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
#if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 800)
#define XML_IGNORE_FPTR_CAST_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#else
#define XML_IGNORE_FPTR_CAST_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"")
#endif
#define XML_POP_WARNINGS \
_Pragma("GCC diagnostic pop")
#else
#define XML_IGNORE_FPTR_CAST_WARNINGS
#define XML_POP_WARNINGS
#endif
#else /* ! __GNUC__ */
#define ATTRIBUTE_UNUSED
#define LIBXML_ATTR_ALLOC_SIZE(x)
#define LIBXML_ATTR_FORMAT(fmt,args)
#ifndef XML_DEPRECATED
# if defined (IN_LIBXML) || !defined (_MSC_VER)
# define XML_DEPRECATED
/* Available since Visual Studio 2005 */
# elif defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_DEPRECATED __declspec(deprecated)
# endif
#endif
#if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
#else
# define XML_IGNORE_FPTR_CAST_WARNINGS
#endif
#ifndef XML_POP_WARNINGS
# if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_POP_WARNINGS __pragma(warning(pop))
# else
# define XML_POP_WARNINGS
# endif
#endif
#endif /* __GNUC__ */
#define XML_NO_ATTR
#ifdef LIBXML_THREAD_ENABLED
#define XML_DECLARE_GLOBAL(name, type, attrs) \
attrs XMLPUBFUN type *__##name(void);
#define XML_GLOBAL_MACRO(name) (*__##name())
#else
#define XML_DECLARE_GLOBAL(name, type, attrs) \
attrs XMLPUBVAR type name;
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
@@ -478,7 +478,6 @@ extern "C" {
* misc
*/
XMLPUBFUN int xmlTextWriterFlush(xmlTextWriterPtr writer);
XMLPUBFUN int xmlTextWriterClose(xmlTextWriterPtr writer);
#ifdef __cplusplus
}
@@ -26,10 +26,15 @@
#include <libxml/xmlerror.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
#endif /* LIBXML_XPATH_ENABLED */
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
#ifdef __cplusplus
extern "C" {
#endif
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
#ifdef LIBXML_XPATH_ENABLED
typedef struct _xmlXPathContext xmlXPathContext;
typedef xmlXPathContext *xmlXPathContextPtr;
@@ -99,15 +104,22 @@ typedef enum {
XPATH_BOOLEAN = 2,
XPATH_NUMBER = 3,
XPATH_STRING = 4,
#ifdef LIBXML_XPTR_LOCS_ENABLED
XPATH_POINT = 5,
XPATH_RANGE = 6,
XPATH_LOCATIONSET = 7,
#endif
XPATH_USERS = 8,
XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
} xmlXPathObjectType;
#ifndef LIBXML_XPTR_LOCS_ENABLED
/** DOC_DISABLE */
#define XPATH_POINT 5
#define XPATH_RANGE 6
#define XPATH_LOCATIONSET 7
/** DOC_ENABLE */
#endif
typedef struct _xmlXPathObject xmlXPathObject;
typedef xmlXPathObject *xmlXPathObjectPtr;
@@ -401,11 +413,8 @@ struct _xmlXPathParserContext {
* Objects and Nodesets handling
*/
XML_DEPRECATED
XMLPUBVAR double xmlXPathNAN;
XML_DEPRECATED
XMLPUBVAR double xmlXPathPINF;
XML_DEPRECATED
XMLPUBVAR double xmlXPathNINF;
/* These macros may later turn into functions */
@@ -506,10 +515,6 @@ XMLPUBFUN xmlXPathContextPtr
xmlXPathNewContext (xmlDocPtr doc);
XMLPUBFUN void
xmlXPathFreeContext (xmlXPathContextPtr ctxt);
XMLPUBFUN void
xmlXPathSetErrorHandler(xmlXPathContextPtr ctxt,
xmlStructuredErrorFunc handler,
void *context);
XMLPUBFUN int
xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
int active,
@@ -552,7 +557,8 @@ XMLPUBFUN int
xmlXPathContextPtr ctxt);
XMLPUBFUN void
xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
#endif /* LIBXML_XPATH_ENABLED */
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XML_DEPRECATED
XMLPUBFUN void
xmlXPathInit (void);
@@ -565,5 +571,5 @@ XMLPUBFUN int
}
#endif
#endif /* LIBXML_XPATH_ENABLED */
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/
#endif /* ! __XML_XPATH_H__ */
@@ -22,12 +22,6 @@
extern "C" {
#endif
/*
* Backward compatibility
*/
#define valuePush xmlXPathValuePush
#define valuePop xmlXPathValuePop
/************************************************************************
* *
* Helpers *
@@ -484,10 +478,11 @@ XMLPUBFUN xmlXPathParserContextPtr
XMLPUBFUN void
xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
/* TODO: remap to xmlXPathValuePop and Push. */
XMLPUBFUN xmlXPathObjectPtr
xmlXPathValuePop (xmlXPathParserContextPtr ctxt);
valuePop (xmlXPathParserContextPtr ctxt);
XMLPUBFUN int
xmlXPathValuePush (xmlXPathParserContextPtr ctxt,
valuePush (xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr value);
XMLPUBFUN xmlXPathObjectPtr
@@ -521,7 +516,6 @@ XMLPUBFUN void
XMLPUBFUN void
xmlXPathRoot (xmlXPathParserContextPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void
xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlChar *
@@ -28,10 +28,88 @@
extern "C" {
#endif
#if defined(LIBXML_XPTR_LOCS_ENABLED)
/*
* A Location Set
*/
typedef struct _xmlLocationSet xmlLocationSet;
typedef xmlLocationSet *xmlLocationSetPtr;
struct _xmlLocationSet {
int locNr; /* number of locations in the set */
int locMax; /* size of the array as allocated */
xmlXPathObjectPtr *locTab;/* array of locations */
};
/*
* Handling of location sets.
*/
XML_DEPRECATED
XMLPUBFUN xmlLocationSetPtr
xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
XML_DEPRECATED
XMLPUBFUN xmlLocationSetPtr
xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
xmlLocationSetPtr val2);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRange (xmlNodePtr start,
int startindex,
xmlNodePtr end,
int endindex);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
xmlXPathObjectPtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRangeNodePoint (xmlNodePtr start,
xmlXPathObjectPtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
xmlNodePtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRangeNodes (xmlNodePtr start,
xmlNodePtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewLocationSetNodes (xmlNodePtr start,
xmlNodePtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewRangeNodeObject (xmlNodePtr start,
xmlXPathObjectPtr end);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrNewCollapsedRange (xmlNodePtr start);
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
xmlXPathObjectPtr val);
XML_DEPRECATED
XMLPUBFUN xmlXPathObjectPtr
xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
xmlXPathObjectPtr val);
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
int val);
#endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
/*
* Functions.
*/
XML_DEPRECATED
XMLPUBFUN xmlXPathContextPtr
xmlXPtrNewContext (xmlDocPtr doc,
xmlNodePtr here,
@@ -40,6 +118,18 @@ XMLPUBFUN xmlXPathObjectPtr
xmlXPtrEval (const xmlChar *str,
xmlXPathContextPtr ctx);
#if defined(LIBXML_XPTR_LOCS_ENABLED)
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XML_DEPRECATED
XMLPUBFUN xmlNodePtr
xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
XML_DEPRECATED
XMLPUBFUN void
xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
#endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
#ifdef __cplusplus
}
#endif