1
0
mirror of https://github.com/GNOME/libxml2.git synced 2025-05-09 05:11:41 +08:00

doc: Convert documentation to Doxygen

Automated conversion based on a few regexes.
This commit is contained in:
Nick Wellnhofer 2025-04-28 15:11:24 +02:00
parent 69879da88f
commit e549622bc5
90 changed files with 9748 additions and 12416 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,12 +35,11 @@
************************************************************************/
/**
* htmlGetMetaEncoding:
* @doc: the document
* @param doc the document
*
* Encoding definition lookup in the Meta tags
*
* Returns the current encoding as flagged in the HTML source
* @returns the current encoding as flagged in the HTML source
*/
const xmlChar *
htmlGetMetaEncoding(htmlDocPtr doc) {
@ -146,15 +145,14 @@ found_content:
}
/**
* htmlSetMetaEncoding:
* @doc: the document
* @encoding: the encoding string
* @param doc the document
* @param encoding the encoding string
*
* Sets the current encoding in the Meta tags
* NOTE: this will not change the document content encoding, just
* the META flag associated.
*
* Returns 0 in case of success and -1 in case of error
* @returns 0 in case of success and -1 in case of error
*/
int
htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
@ -305,14 +303,13 @@ static const char* const htmlBooleanAttrs[] = {
/**
* htmlIsBooleanAttr:
* @name: the name of the attribute to check
* @param name the name of the attribute to check
*
* DEPRECATED: Internal function, don't use.
* @deprecated Internal function, don't use.
*
* Determine if a given attribute is a boolean attribute.
*
* returns: false if the attribute is not boolean, true otherwise.
* @returns false if the attribute is not boolean, true otherwise.
*/
int
htmlIsBooleanAttr(const xmlChar *name)
@ -346,15 +343,14 @@ htmlFindOutputEncoder(const char *encoding, xmlCharEncodingHandler **out) {
}
/**
* htmlBufNodeDumpFormat:
* @buf: the xmlBufPtr output
* @doc: the document
* @cur: the current node
* @format: should formatting spaces been added
* @param buf the xmlBufPtr output
* @param doc the document
* @param cur the current node
* @param format should formatting spaces been added
*
* Dump an HTML node, recursive behaviour,children are printed too.
*
* Returns the number of byte written or -1 in case of error
* @returns the number of byte written or -1 in case of error
*/
static size_t
htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur,
@ -391,15 +387,14 @@ htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur,
}
/**
* htmlNodeDump:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
* @param buf the HTML buffer output
* @param doc the document
* @param cur the current node
*
* Dump an HTML node, recursive behaviour,children are printed too,
* and formatting returns are added.
*
* Returns the number of byte written or -1 in case of error
* @returns the number of byte written or -1 in case of error
*/
int
htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
@ -425,18 +420,17 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
}
/**
* htmlNodeDumpFileFormat:
* @out: the FILE pointer
* @doc: the document
* @cur: the current node
* @encoding: the document encoding
* @format: should formatting spaces been added
* @param out the FILE pointer
* @param doc the document
* @param cur the current node
* @param encoding the document encoding
* @param format should formatting spaces been added
*
* Dump an HTML node, recursive behaviour,children are printed too.
*
* TODO: if encoding == NULL try to save in the doc encoding
*
* returns: the number of byte written or -1 in case of failure.
* @returns the number of byte written or -1 in case of failure.
*/
int
htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
@ -463,10 +457,9 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
}
/**
* htmlNodeDumpFile:
* @out: the FILE pointer
* @doc: the document
* @cur: the current node
* @param out the FILE pointer
* @param doc the document
* @param cur the current node
*
* Dump an HTML node, recursive behaviour,children are printed too,
* and formatting returns are added.
@ -477,11 +470,10 @@ htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) {
}
/**
* htmlDocDumpMemoryFormat:
* @cur: the document
* @mem: OUT: the memory pointer
* @size: OUT: the memory length
* @format: should formatting spaces been added
* @param cur the document
* @param mem OUT: the memory pointer
* @param size OUT: the memory length
* @param format should formatting spaces been added
*
* Dump an HTML document in memory and return the xmlChar * and it's size.
* It's up to the caller to free the memory.
@ -526,10 +518,9 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
}
/**
* htmlDocDumpMemory:
* @cur: the document
* @mem: OUT: the memory pointer
* @size: OUT: the memory length
* @param cur the document
* @param mem OUT: the memory pointer
* @param size OUT: the memory length
*
* Dump an HTML document in memory and return the xmlChar * and it's size.
* It's up to the caller to free the memory.
@ -547,10 +538,9 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
************************************************************************/
/**
* htmlDtdDumpOutput:
* @buf: the HTML buffer output
* @doc: the document
* @encoding: the encoding string
* @param buf the HTML buffer output
* @param doc the document
* @param encoding the encoding string
*
* TODO: check whether encoding is needed
*
@ -581,10 +571,9 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
}
/**
* htmlAttrDumpOutput:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the attribute pointer
* @param buf the HTML buffer output
* @param doc the document
* @param cur the attribute pointer
*
* Dump an HTML attribute
*/
@ -651,12 +640,11 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
}
/**
* htmlNodeDumpFormatOutput:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
* @encoding: the encoding string (unused)
* @format: should formatting spaces been added
* @param buf the HTML buffer output
* @param doc the document
* @param cur the current node
* @param encoding the encoding string (unused)
* @param format should formatting spaces been added
*
* Dump an HTML node, recursive behaviour,children are printed too.
*/
@ -886,11 +874,10 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
}
/**
* htmlNodeDumpOutput:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
* @encoding: the encoding string (unused)
* @param buf the HTML buffer output
* @param doc the document
* @param cur the current node
* @param encoding the encoding string (unused)
*
* Dump an HTML node, recursive behaviour,children are printed too,
* and formatting returns/spaces are added.
@ -902,11 +889,10 @@ htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
}
/**
* htmlDocContentDumpFormatOutput:
* @buf: the HTML buffer output
* @cur: the document
* @encoding: the encoding string (unused)
* @format: should formatting spaces been added
* @param buf the HTML buffer output
* @param cur the document
* @param encoding the encoding string (unused)
* @param format should formatting spaces been added
*
* Dump an HTML document.
*/
@ -925,10 +911,9 @@ htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
}
/**
* htmlDocContentDumpOutput:
* @buf: the HTML buffer output
* @cur: the document
* @encoding: the encoding string (unused)
* @param buf the HTML buffer output
* @param cur the document
* @param encoding the encoding string (unused)
*
* Dump an HTML document. Formatting return/spaces are added.
*/
@ -945,13 +930,12 @@ htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
************************************************************************/
/**
* htmlDocDump:
* @f: the FILE*
* @cur: the document
* @param f the FILE*
* @param cur the document
*
* Dump an HTML document to an open FILE.
*
* returns: the number of byte written or -1 in case of failure.
* @returns the number of byte written or -1 in case of failure.
*/
int
htmlDocDump(FILE *f, xmlDocPtr cur) {
@ -979,13 +963,12 @@ htmlDocDump(FILE *f, xmlDocPtr cur) {
}
/**
* htmlSaveFile:
* @filename: the filename (or URL)
* @cur: the document
* @param filename the filename (or URL)
* @param cur the document
*
* Dump an HTML document to a file. If @filename is "-" the stdout file is
* Dump an HTML document to a file. If `filename` is "-" the stdout file is
* used.
* returns: the number of byte written or -1 in case of failure.
* @returns the number of byte written or -1 in case of failure.
*/
int
htmlSaveFile(const char *filename, xmlDocPtr cur) {
@ -1013,15 +996,14 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) {
}
/**
* htmlSaveFileFormat:
* @filename: the filename
* @cur: the document
* @format: should formatting spaces been added
* @encoding: the document encoding
* @param filename the filename
* @param cur the document
* @param format should formatting spaces been added
* @param encoding the document encoding
*
* Dump an HTML document to a file using a given encoding.
*
* returns: the number of byte written or -1 in case of failure.
* @returns the number of byte written or -1 in case of failure.
*/
int
htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
@ -1056,15 +1038,14 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
}
/**
* htmlSaveFileEnc:
* @filename: the filename
* @cur: the document
* @encoding: the document encoding
* @param filename the filename
* @param cur the document
* @param encoding the document encoding
*
* Dump an HTML document to a file using a given encoding
* and formatting returns/spaces are added.
*
* returns: the number of byte written or -1 in case of failure.
* @returns the number of byte written or -1 in case of failure.
*/
int
htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {

376
SAX2.c
View File

@ -31,9 +31,8 @@
#include "private/tree.h"
/*
* xmlSAX2ErrMemory:
* @ctxt: an XML validation parser context
* @msg: a string to accompany the error message
* @param ctxt an XML validation parser context
* @param msg a string to accompany the error message
*/
static void
xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
@ -41,12 +40,11 @@ xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
}
/**
* xmlValidError:
* @ctxt: an XML validation parser context
* @error: the error number
* @msg: the error message
* @str1: extra data
* @str2: extra data
* @param ctxt an XML validation parser context
* @param error the error number
* @param msg the error message
* @param str1 extra data
* @param str2 extra data
*
* Handle a validation error
*/
@ -61,12 +59,11 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
}
/**
* xmlFatalErrMsg:
* @ctxt: an XML parser context
* @error: the error number
* @msg: the error message
* @str1: an error string
* @str2: an error string
* @param ctxt an XML parser context
* @param error the error number
* @param msg the error message
* @param str1 an error string
* @param str2 an error string
*
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
*/
@ -79,11 +76,10 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
}
/**
* xmlWarnMsg:
* @ctxt: an XML parser context
* @error: the error number
* @msg: the error message
* @str1: an error string
* @param ctxt an XML parser context
* @param error the error number
* @param msg the error message
* @param str1 an error string
*
* Handle a parser warning
*/
@ -96,12 +92,11 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
}
/**
* xmlNsWarnMsg:
* @ctxt: an XML parser context
* @error: the error number
* @msg: the error message
* @str1: an error string
* @str2: an error string
* @param ctxt an XML parser context
* @param error the error number
* @param msg the error message
* @param str1 an error string
* @param str2 an error string
*
* Handle a namespace warning
*/
@ -114,12 +109,11 @@ xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
}
/**
* xmlSAX2GetPublicId:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
*
* Returns a xmlChar *
* @returns a xmlChar *
*/
const xmlChar *
xmlSAX2GetPublicId(void *ctx ATTRIBUTE_UNUSED)
@ -129,13 +123,12 @@ xmlSAX2GetPublicId(void *ctx ATTRIBUTE_UNUSED)
}
/**
* xmlSAX2GetSystemId:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Provides the system ID, basically URL or filename e.g.
* http://www.sgmlsource.com/dtds/memo.dtd
*
* Returns a xmlChar *
* @returns a xmlChar *
*/
const xmlChar *
xmlSAX2GetSystemId(void *ctx)
@ -146,12 +139,11 @@ xmlSAX2GetSystemId(void *ctx)
}
/**
* xmlSAX2GetLineNumber:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Provide the line number of the current parsing point.
*
* Returns an int
* @returns an int
*/
int
xmlSAX2GetLineNumber(void *ctx)
@ -162,12 +154,11 @@ xmlSAX2GetLineNumber(void *ctx)
}
/**
* xmlSAX2GetColumnNumber:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Provide the column number of the current parsing point.
*
* Returns an int
* @returns an int
*/
int
xmlSAX2GetColumnNumber(void *ctx)
@ -178,12 +169,11 @@ xmlSAX2GetColumnNumber(void *ctx)
}
/**
* xmlSAX2IsStandalone:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Is this document tagged standalone ?
*
* Returns 1 if true
* @returns 1 if true
*/
int
xmlSAX2IsStandalone(void *ctx)
@ -194,12 +184,11 @@ xmlSAX2IsStandalone(void *ctx)
}
/**
* xmlSAX2HasInternalSubset:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Does this document has an internal subset
*
* Returns 1 if true
* @returns 1 if true
*/
int
xmlSAX2HasInternalSubset(void *ctx)
@ -210,12 +199,11 @@ xmlSAX2HasInternalSubset(void *ctx)
}
/**
* xmlSAX2HasExternalSubset:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Does this document has an external subset
*
* Returns 1 if true
* @returns 1 if true
*/
int
xmlSAX2HasExternalSubset(void *ctx)
@ -226,11 +214,10 @@ xmlSAX2HasExternalSubset(void *ctx)
}
/**
* xmlSAX2InternalSubset:
* @ctx: the user data (XML parser context)
* @name: the root element name
* @ExternalID: the external ID
* @SystemID: the SYSTEM ID (e.g. filename or URL)
* @param ctx the user data (XML parser context)
* @param name the root element name
* @param ExternalID the external ID
* @param SystemID the SYSTEM ID (e.g. filename or URL)
*
* Callback on internal subset declaration.
*/
@ -259,11 +246,10 @@ xmlSAX2InternalSubset(void *ctx, const xmlChar *name,
}
/**
* xmlSAX2ExternalSubset:
* @ctx: the user data (XML parser context)
* @name: the root element name
* @ExternalID: the external ID
* @SystemID: the SYSTEM ID (e.g. filename or URL)
* @param ctx the user data (XML parser context)
* @param name the root element name
* @param ExternalID the external ID
* @param SystemID the SYSTEM ID (e.g. filename or URL)
*
* Callback on external subset declaration.
*/
@ -383,15 +369,14 @@ error:
}
/**
* xmlSAX2ResolveEntity:
* @ctx: the user data (XML parser context)
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctx the user data (XML parser context)
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* This is only used to load DTDs. The preferred way to install
* custom resolvers is xmlCtxtSetResourceLoader.
*
* Returns a parser input.
* @returns a parser input.
*/
xmlParserInputPtr
xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId,
@ -446,13 +431,12 @@ xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId,
}
/**
* xmlSAX2GetEntity:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get an entity by name
*
* Returns the xmlEntityPtr if found.
* @returns the xmlEntityPtr if found.
*/
xmlEntityPtr
xmlSAX2GetEntity(void *ctx, const xmlChar *name)
@ -492,13 +476,12 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
}
/**
* xmlSAX2GetParameterEntity:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get a parameter entity by name
*
* Returns the xmlEntityPtr if found.
* @returns the xmlEntityPtr if found.
*/
xmlEntityPtr
xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
@ -514,13 +497,12 @@ xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
/**
* xmlSAX2EntityDecl:
* @ctx: the user data (XML parser context)
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
* @param ctx the user data (XML parser context)
* @param name the entity name
* @param type the entity type
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param content the entity value (without processing).
*
* An entity definition has been parsed
*/
@ -608,14 +590,13 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type,
}
/**
* xmlSAX2AttributeDecl:
* @ctx: the user data (XML parser context)
* @elem: the name of the element
* @fullname: the attribute name
* @type: the attribute type
* @def: the type of default value
* @defaultValue: the attribute default value
* @tree: the tree of enumerated value set
* @param ctx the user data (XML parser context)
* @param elem the name of the element
* @param fullname the attribute name
* @param type the attribute type
* @param def the type of default value
* @param defaultValue the attribute default value
* @param tree the tree of enumerated value set
*
* An attribute definition has been parsed
*/
@ -678,11 +659,10 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
}
/**
* xmlSAX2ElementDecl:
* @ctx: the user data (XML parser context)
* @name: the element name
* @type: the element type
* @content: the element value tree
* @param ctx the user data (XML parser context)
* @param name the element name
* @param type the element type
* @param content the element value tree
*
* An element definition has been parsed
*/
@ -722,11 +702,10 @@ xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type,
}
/**
* xmlSAX2NotationDecl:
* @ctx: the user data (XML parser context)
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctx the user data (XML parser context)
* @param name The name of the notation
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
@ -770,12 +749,11 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name,
}
/**
* xmlSAX2UnparsedEntityDecl:
* @ctx: the user data (XML parser context)
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
* @param ctx the user data (XML parser context)
* @param name The name of the entity
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param notationName the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
@ -789,9 +767,8 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name,
}
/**
* xmlSAX2SetDocumentLocator:
* @ctx: the user data (XML parser context)
* @loc: A SAX Locator
* @param ctx the user data (XML parser context)
* @param loc A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
@ -802,8 +779,7 @@ xmlSAX2SetDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRI
}
/**
* xmlSAX2StartDocument:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* called when the document start being processed.
*/
@ -853,8 +829,7 @@ xmlSAX2StartDocument(void *ctx)
}
/**
* xmlSAX2EndDocument:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* called when the document end has been detected.
*/
@ -921,12 +896,11 @@ xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
#if defined(LIBXML_SAX1_ENABLED)
/**
* xmlNsErrMsg:
* @ctxt: an XML parser context
* @error: the error number
* @msg: the error message
* @str1: an error string
* @str2: an error string
* @param ctxt an XML parser context
* @param error the error number
* @param msg the error message
* @param str1 an error string
* @param str2 an error string
*
* Handle a namespace error
*/
@ -939,11 +913,10 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
}
/**
* xmlSAX1Attribute:
* @ctxt: the parser context
* @fullname: the attribute name, including namespace prefix
* @value: the attribute value
* @prefix: the namespace prefix
* @param ctxt the parser context
* @param fullname the attribute name, including namespace prefix
* @param value the attribute value
* @param prefix the namespace prefix
*
* Handle an attribute that has been read by the parser.
*
@ -1231,7 +1204,6 @@ error:
}
/*
* xmlCheckDefaultedAttributes:
*
* Check defaulted attributes from the DTD
*
@ -1388,10 +1360,9 @@ process_external_subset:
}
/**
* xmlSAX1StartElement:
* @ctx: the user data (XML parser context)
* @fullname: The element name, including namespace prefix
* @atts: An array of name/value attributes pairs, NULL terminated
* @param ctx the user data (XML parser context)
* @param fullname The element name, including namespace prefix
* @param atts An array of name/value attributes pairs, NULL terminated
*
* called when an opening tag has been processed.
*
@ -1622,10 +1593,9 @@ xmlSAX2HtmlAttribute(xmlParserCtxtPtr ctxt, const xmlChar *fullname,
}
/**
* xmlSAX2StartHtmlElement:
* @ctxt: parser context
* @fullname: The element name, including namespace prefix
* @atts: An array of name/value attributes pairs, NULL terminated
* @param ctxt parser context
* @param fullname The element name, including namespace prefix
* @param atts An array of name/value attributes pairs, NULL terminated
*
* Called when an opening tag has been processed.
*/
@ -1678,12 +1648,11 @@ xmlSAX2StartHtmlElement(xmlParserCtxtPtr ctxt, const xmlChar *fullname,
#endif /* LIBXML_HTML_ENABLED */
/**
* xmlSAX2StartElement:
* @ctx: the user data (XML parser context)
* @fullname: The element name, including namespace prefix
* @atts: An array of name/value attributes pairs, NULL terminated
* @param ctx the user data (XML parser context)
* @param fullname The element name, including namespace prefix
* @param atts An array of name/value attributes pairs, NULL terminated
*
* DEPRECATED: Don't call this function directly.
* @deprecated Don't call this function directly.
*
* Called when an opening tag has been processed.
*
@ -1714,11 +1683,10 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
}
/**
* xmlSAX2EndElement:
* @ctx: the user data (XML parser context)
* @name: The element name
* @param ctx the user data (XML parser context)
* @param name The element name
*
* DEPRECATED: Don't call this function directly.
* @deprecated Don't call this function directly.
*
* called when the end of an element has been detected.
*
@ -1750,14 +1718,13 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
}
/*
* xmlSAX2TextNode:
* @ctxt: the parser context
* @str: the input string
* @len: the string length
* @param ctxt the parser context
* @param str the input string
* @param len the string length
*
* Callback for a text node
*
* Returns the newly allocated string or NULL if not needed or error
* @returns the newly allocated string or NULL if not needed or error
*/
static xmlNodePtr
xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
@ -1837,14 +1804,13 @@ skip:
#ifdef LIBXML_VALID_ENABLED
/*
* xmlSAX2DecodeAttrEntities:
* @ctxt: the parser context
* @str: the input string
* @len: the string length
* @param ctxt the parser context
* @param str the input string
* @param len the string length
*
* Remove the entities from an attribute value
*
* Returns the newly allocated string or NULL if not needed or error
* @returns the newly allocated string or NULL if not needed or error
*/
static xmlChar *
xmlSAX2DecodeAttrEntities(xmlParserCtxtPtr ctxt, const xmlChar *str,
@ -1867,19 +1833,18 @@ decode:
#endif /* LIBXML_VALID_ENABLED */
/**
* xmlSAX2AttributeNs:
* @ctxt: the parser context
* @localname: the local name of the attribute
* @prefix: the attribute namespace prefix if available
* @value: start of the attribute value
* @valueend: end of the attribute value
* @param ctxt the parser context
* @param localname the local name of the attribute
* @param prefix the attribute namespace prefix if available
* @param value start of the attribute value
* @param valueend end of the attribute value
*
* Handle an attribute that has been read by the parser.
* The default handling is to convert the attribute into an
* DOM subtree and past it in a new xmlAttr element added to
* the element.
*
* Returns the new attribute or NULL in case of error.
* @returns the new attribute or NULL in case of error.
*/
static xmlAttrPtr
xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
@ -2100,16 +2065,15 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
}
/**
* xmlSAX2StartElementNs:
* @ctx: the user data (XML parser context)
* @localname: the local name of the element
* @prefix: the element namespace prefix if available
* @URI: the element namespace name if available
* @nb_namespaces: number of namespace definitions on that node
* @namespaces: pointer to the array of prefix/URI pairs namespace definitions
* @nb_attributes: the number of attributes on that node
* @nb_defaulted: the number of defaulted attributes.
* @attributes: pointer to the array of (localname/prefix/URI/value/end)
* @param ctx the user data (XML parser context)
* @param localname the local name of the element
* @param prefix the element namespace prefix if available
* @param URI the element namespace name if available
* @param nb_namespaces number of namespace definitions on that node
* @param namespaces pointer to the array of prefix/URI pairs namespace definitions
* @param nb_attributes the number of attributes on that node
* @param nb_defaulted the number of defaulted attributes.
* @param attributes pointer to the array of (localname/prefix/URI/value/end)
* attribute values.
*
* SAX2 callback when an element start has been detected by the parser.
@ -2376,11 +2340,10 @@ have_attr:
}
/**
* xmlSAX2EndElementNs:
* @ctx: the user data (XML parser context)
* @localname: the local name of the element
* @prefix: the element namespace prefix if available
* @URI: the element namespace name if available
* @param ctx the user data (XML parser context)
* @param localname the local name of the element
* @param prefix the element namespace prefix if available
* @param URI the element namespace name if available
*
* SAX2 callback when an element end has been detected by the parser.
* It provides the namespace information for the element.
@ -2410,9 +2373,8 @@ xmlSAX2EndElementNs(void *ctx,
}
/**
* xmlSAX2Reference:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* called when an entity xmlSAX2Reference is detected.
*/
@ -2433,11 +2395,10 @@ xmlSAX2Reference(void *ctx, const xmlChar *name)
}
/**
* xmlSAX2Text:
* @ctxt: the parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
* @type: text or cdata
* @param ctxt the parser context
* @param ch a xmlChar string
* @param len the number of xmlChar
* @param type text or cdata
*
* Append characters.
*/
@ -2575,10 +2536,9 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
}
/**
* xmlSAX2Characters:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctx the user data (XML parser context)
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some chars from the parser.
*/
@ -2589,10 +2549,9 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
}
/**
* xmlSAX2IgnorableWhitespace:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctx the user data (XML parser context)
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some ignorable whitespaces from the parser.
* UNUSED: by default the DOM building will use xmlSAX2Characters
@ -2603,10 +2562,9 @@ xmlSAX2IgnorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBU
}
/**
* xmlSAX2ProcessingInstruction:
* @ctx: the user data (XML parser context)
* @target: the target name
* @data: the PI data's
* @param ctx the user data (XML parser context)
* @param target the target name
* @param data the PI data's
*
* A processing instruction has been parsed.
*/
@ -2629,9 +2587,8 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
}
/**
* xmlSAX2Comment:
* @ctx: the user data (XML parser context)
* @value: the xmlSAX2Comment content
* @param ctx the user data (XML parser context)
* @param value the xmlSAX2Comment content
*
* A xmlSAX2Comment has been parsed.
*/
@ -2653,10 +2610,9 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
}
/**
* xmlSAX2CDataBlock:
* @ctx: the user data (XML parser context)
* @value: The pcdata content
* @len: the block length
* @param ctx the user data (XML parser context)
* @param value The pcdata content
* @param len the block length
*
* called when a pcdata block has been parsed
*/
@ -2668,14 +2624,13 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
#ifdef LIBXML_SAX1_ENABLED
/**
* xmlSAXDefaultVersion:
* @version: the version, must be 2
* @param version the version, must be 2
*
* DEPRECATED: Use parser option XML_PARSE_SAX1.
* @deprecated Use parser option XML_PARSE_SAX1.
*
* Has no effect.
*
* Returns 2 in case of success and -1 in case of error.
* @returns 2 in case of success and -1 in case of error.
*/
int
xmlSAXDefaultVersion(int version)
@ -2687,13 +2642,12 @@ xmlSAXDefaultVersion(int version)
#endif /* LIBXML_SAX1_ENABLED */
/**
* xmlSAXVersion:
* @hdlr: the SAX handler
* @version: the version, 1 or 2
* @param hdlr the SAX handler
* @param version the version, 1 or 2
*
* Initialize the default XML SAX handler according to the version
*
* Returns 0 in case of success and -1 in case of error.
* @returns 0 in case of success and -1 in case of error.
*/
int
xmlSAXVersion(xmlSAXHandler *hdlr, int version)
@ -2747,9 +2701,8 @@ xmlSAXVersion(xmlSAXHandler *hdlr, int version)
}
/**
* xmlSAX2InitDefaultSAXHandler:
* @hdlr: the SAX handler
* @warning: flag if non-zero sets the handler warning procedure
* @param hdlr the SAX handler
* @param warning flag if non-zero sets the handler warning procedure
*
* Initialize the default XML SAX2 handler
*/
@ -2765,9 +2718,8 @@ xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning)
}
/**
* xmlDefaultSAXHandlerInit:
*
* DEPRECATED: This function is a no-op. Call xmlInitParser to
* @deprecated This function is a no-op. Call xmlInitParser to
* initialize the library.
*
* Initialize the default SAX2 handler
@ -2780,8 +2732,7 @@ xmlDefaultSAXHandlerInit(void)
#ifdef LIBXML_HTML_ENABLED
/**
* xmlSAX2InitHtmlDefaultSAXHandler:
* @hdlr: the SAX handler
* @param hdlr the SAX handler
*
* Initialize the default HTML SAX2 handler
*/
@ -2823,9 +2774,8 @@ xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr)
}
/**
* htmlDefaultSAXHandlerInit:
*
* DEPRECATED: This function is a no-op. Call xmlInitParser to
* @deprecated This function is a no-op. Call xmlInitParser to
* initialize the library.
*/
void

277
buf.c
View File

@ -37,7 +37,6 @@
#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
/**
* xmlBuf:
*
* A buffer structure. The base of the structure is somehow compatible
* with struct _xmlBuffer to limit risks on application which accessed
@ -87,8 +86,7 @@ struct _xmlBuf {
#endif /* WITH_BUFFER_COMPAT */
/**
* xmlBufMemoryError:
* @buf: the buffer
* @param buf the buffer
*
* Handle an out of memory condition
* To be improved...
@ -101,8 +99,7 @@ xmlBufMemoryError(xmlBufPtr buf)
}
/**
* xmlBufOverflowError:
* @buf: the buffer
* @param buf the buffer
*
* Handle a buffer overflow error
* To be improved...
@ -115,11 +112,10 @@ xmlBufOverflowError(xmlBufPtr buf)
}
/**
* xmlBufCreate:
* @size: initial size of buffer
* @param size initial size of buffer
*
* routine to create an XML buffer.
* returns the new structure.
* @returns the new structure.
*/
xmlBufPtr
xmlBufCreate(size_t size) {
@ -150,19 +146,18 @@ xmlBufCreate(size_t size) {
}
/**
* xmlBufCreateMem:
* @mem: a memory area
* @size: size of the buffer excluding terminator
* @isStatic: whether the memory area is static
* @param mem a memory area
* @param size size of the buffer excluding terminator
* @param isStatic whether the memory area is static
*
* Create a buffer initialized with memory.
*
* If @isStatic is set, uses the memory area directly as backing store.
* If `isStatic` is set, uses the memory area directly as backing store.
* The memory must be zero-terminated and not be modified for the
* lifetime of the buffer. A static buffer can't be grown, modified or
* detached, but it can be shrunk.
*
* Returns a new buffer.
* @returns a new buffer.
*/
xmlBufPtr
xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) {
@ -204,14 +199,13 @@ xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) {
}
/**
* xmlBufDetach:
* @buf: the buffer
* @param buf the buffer
*
* Remove the string contained in a buffer and give it back to the
* caller. The buffer is reset to an empty content.
* This doesn't work with immutable buffers as they can't be reset.
*
* Returns the previous string contained by the buffer.
* @returns the previous string contained by the buffer.
*/
xmlChar *
xmlBufDetach(xmlBufPtr buf) {
@ -237,8 +231,7 @@ xmlBufDetach(xmlBufPtr buf) {
}
/**
* xmlBufFree:
* @buf: the buffer to free
* @param buf the buffer to free
*
* Frees an XML buffer. It frees both the content and the structure which
* encapsulate it.
@ -254,8 +247,7 @@ xmlBufFree(xmlBufPtr buf) {
}
/**
* xmlBufEmpty:
* @buf: the buffer
* @param buf the buffer
*
* empty a buffer.
*/
@ -276,18 +268,17 @@ xmlBufEmpty(xmlBufPtr buf) {
}
/**
* xmlBufShrink:
* @buf: the buffer to dump
* @len: the number of xmlChar to remove
* @param buf the buffer to dump
* @param len the number of xmlChar to remove
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Remove the beginning of an XML buffer.
* NOTE that this routine behaviour differs from xmlBufferShrink()
* as it will return 0 on error instead of -1 due to size_t being
* used as the return type.
*
* Returns the number of byte removed or 0 in case of failure
* @returns the number of byte removed or 0 in case of failure
*/
size_t
xmlBufShrink(xmlBufPtr buf, size_t len) {
@ -309,13 +300,12 @@ xmlBufShrink(xmlBufPtr buf, size_t len) {
}
/**
* xmlBufGrowInternal:
* @buf: the buffer
* @len: the minimum free size to allocate
* @param buf the buffer
* @param len the minimum free size to allocate
*
* Grow the available space of an XML buffer, @len is the target value
* Grow the available space of an XML buffer, `len` is the target value
*
* Returns 0 on success, -1 in case of error
* @returns 0 on success, -1 in case of error
*/
static int
xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
@ -376,14 +366,13 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
}
/**
* xmlBufGrow:
* @buf: the buffer
* @len: the minimum free size to allocate
* @param buf the buffer
* @param len the minimum free size to allocate
*
* Grow the available space of an XML buffer, @len is the target value
* Grow the available space of an XML buffer, `len` is the target value
* This is been kept compatible with xmlBufferGrow() as much as possible
*
* Returns 0 on succes, -1 in case of error
* @returns 0 on succes, -1 in case of error
*/
int
xmlBufGrow(xmlBufPtr buf, size_t len) {
@ -402,12 +391,11 @@ xmlBufGrow(xmlBufPtr buf, size_t len) {
}
/**
* xmlBufContent:
* @buf: the buffer
* @param buf the buffer
*
* Function to extract the content of a buffer
*
* Returns the internal content
* @returns the internal content
*/
xmlChar *
@ -420,12 +408,11 @@ xmlBufContent(const xmlBuf *buf)
}
/**
* xmlBufEnd:
* @buf: the buffer
* @param buf the buffer
*
* Function to extract the end of the content of a buffer
*
* Returns the end of the internal content or NULL in case of error
* @returns the end of the internal content or NULL in case of error
*/
xmlChar *
@ -439,15 +426,14 @@ xmlBufEnd(xmlBufPtr buf)
}
/**
* xmlBufAddLen:
* @buf: the buffer
* @len: the size which were added at the end
* @param buf the buffer
* @param len the size which were added at the end
*
* Sometime data may be added at the end of the buffer without
* using the xmlBuf APIs that is used to expand the used space
* and set the zero terminating at the end of the buffer
*
* Returns -1 in case of error and 0 otherwise
* @returns -1 in case of error and 0 otherwise
*/
int
xmlBufAddLen(xmlBufPtr buf, size_t len) {
@ -463,12 +449,11 @@ xmlBufAddLen(xmlBufPtr buf, size_t len) {
}
/**
* xmlBufUse:
* @buf: the buffer
* @param buf the buffer
*
* Function to get the length of a buffer
*
* Returns the length of data in the internal content
* @returns the length of data in the internal content
*/
size_t
@ -482,15 +467,14 @@ xmlBufUse(const xmlBufPtr buf)
}
/**
* xmlBufAvail:
* @buf: the buffer
* @param buf the buffer
*
* Function to find how much free space is allocated but not
* used in the buffer. It reserves one byte for the NUL
* terminator character that is usually needed, so there is
* no need to subtract 1 from the result anymore.
*
* Returns the amount, or 0 if none or if an error occurred.
* @returns the amount, or 0 if none or if an error occurred.
*/
size_t
@ -504,12 +488,11 @@ xmlBufAvail(const xmlBufPtr buf)
}
/**
* xmlBufIsEmpty:
* @buf: the buffer
* @param buf the buffer
*
* Tell if a buffer is empty
*
* Returns 0 if no, 1 if yes and -1 in case of error
* @returns 0 if no, 1 if yes and -1 in case of error
*/
int
xmlBufIsEmpty(const xmlBufPtr buf)
@ -522,15 +505,14 @@ xmlBufIsEmpty(const xmlBufPtr buf)
}
/**
* xmlBufAdd:
* @buf: the buffer to dump
* @str: the #xmlChar string
* @len: the number of #xmlChar to add
* @param buf the buffer to dump
* @param str the \#xmlChar string
* @param len the number of \#xmlChar to add
*
* Add a string range to an XML buffer. if len == -1, the length of
* str is recomputed.
*
* Returns 0 if successful, -1 in case of error.
* @returns 0 if successful, -1 in case of error.
*/
int
xmlBufAdd(xmlBufPtr buf, const xmlChar *str, size_t len) {
@ -556,13 +538,12 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *str, size_t len) {
}
/**
* xmlBufCat:
* @buf: the buffer to add to
* @str: the #xmlChar string (optional)
* @param buf the buffer to add to
* @param str the \#xmlChar string (optional)
*
* Append a zero terminated string to an XML buffer.
*
* Returns 0 successful, a positive error code number otherwise
* @returns 0 successful, a positive error code number otherwise
* and -1 in case of internal or API error.
*/
int
@ -573,15 +554,14 @@ xmlBufCat(xmlBufPtr buf, const xmlChar *str) {
}
/**
* xmlBufFromBuffer:
* @buffer: incoming old buffer to convert to a new one
* @param buffer incoming old buffer to convert to a new one
*
* Helper routine to switch from the old buffer structures in use
* in various APIs. It creates a wrapper xmlBufPtr which will be
* used for internal processing until the xmlBufBackToBuffer() is
* issued.
*
* Returns a new xmlBufPtr unless the call failed and NULL is returned
* @returns a new xmlBufPtr unless the call failed and NULL is returned
*/
xmlBufPtr
xmlBufFromBuffer(xmlBufferPtr buffer) {
@ -620,17 +600,16 @@ xmlBufFromBuffer(xmlBufferPtr buffer) {
}
/**
* xmlBufBackToBuffer:
* @buf: new buffer wrapping the old one
* @ret: old buffer
* @param buf new buffer wrapping the old one
* @param ret old buffer
*
* Function to be called once internal processing had been done to
* update back the buffer provided by the user. This can lead to
* a failure in case the size accumulated in the xmlBuf is larger
* than what an xmlBuffer can support on 64 bits (INT_MAX)
* The xmlBufPtr @buf wrapper is deallocated by this call in any case.
* The xmlBufPtr `buf` wrapper is deallocated by this call in any case.
*
* Returns 0 on success, -1 on error.
* @returns 0 on success, -1 on error.
*/
int
xmlBufBackToBuffer(xmlBufPtr buf, xmlBufferPtr ret) {
@ -662,13 +641,12 @@ xmlBufBackToBuffer(xmlBufPtr buf, xmlBufferPtr ret) {
}
/**
* xmlBufResetInput:
* @buf: an xmlBufPtr
* @input: an xmlParserInputPtr
* @param buf an xmlBufPtr
* @param input an xmlParserInputPtr
*
* Update the input to use the current set of pointers from the buffer.
*
* Returns -1 in case of error, 0 otherwise
* @returns -1 in case of error, 0 otherwise
*/
int
xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input) {
@ -676,15 +654,14 @@ xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input) {
}
/**
* xmlBufUpdateInput:
* @buf: an xmlBufPtr
* @input: an xmlParserInputPtr
* @pos: the cur value relative to the beginning of the buffer
* @param buf an xmlBufPtr
* @param input an xmlParserInputPtr
* @param pos the cur value relative to the beginning of the buffer
*
* Update the input to use the base and cur relative to the buffer
* after a possible reallocation of its content
*
* Returns -1 in case of error, 0 otherwise
* @returns -1 in case of error, 0 otherwise
*/
int
xmlBufUpdateInput(xmlBufPtr buf, xmlParserInputPtr input, size_t pos) {
@ -704,10 +681,9 @@ xmlBufUpdateInput(xmlBufPtr buf, xmlParserInputPtr input, size_t pos) {
************************************************************************/
/**
* xmlSetBufferAllocationScheme:
* @scheme: allocation method to use
* @param scheme allocation method to use
*
* DEPRECATED: Use xmlBufferSetAllocationScheme.
* @deprecated Use xmlBufferSetAllocationScheme.
*
* Set the buffer allocation method. Types are
* XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
@ -719,9 +695,8 @@ xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme ATTRIBUTE_UNUSED)
}
/**
* xmlGetBufferAllocationScheme:
*
* DEPRECATED: Use xmlBufferSetAllocationScheme.
* @deprecated Use xmlBufferSetAllocationScheme.
*
* Types are
* XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
@ -731,7 +706,7 @@ xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme ATTRIBUTE_UNUSED)
* in normal usage, and doubleit on large strings to avoid
* pathological performance.
*
* Returns the current allocation scheme
* @returns the current allocation scheme
*/
xmlBufferAllocationScheme
xmlGetBufferAllocationScheme(void) {
@ -739,10 +714,9 @@ xmlGetBufferAllocationScheme(void) {
}
/**
* xmlBufferCreate:
*
* routine to create an XML buffer.
* returns the new structure.
* @returns the new structure.
*/
xmlBufferPtr
xmlBufferCreate(void) {
@ -767,11 +741,10 @@ xmlBufferCreate(void) {
}
/**
* xmlBufferCreateSize:
* @size: initial size of buffer
* @param size initial size of buffer
*
* routine to create an XML buffer.
* returns the new structure.
* @returns the new structure.
*/
xmlBufferPtr
xmlBufferCreateSize(size_t size) {
@ -805,14 +778,13 @@ xmlBufferCreateSize(size_t size) {
}
/**
* xmlBufferDetach:
* @buf: the buffer
* @param buf the buffer
*
* Remove the string contained in a buffer and gie it back to the
* caller. The buffer is reset to an empty content.
* This doesn't work with immutable buffers as they can't be reset.
*
* Returns the previous string contained by the buffer.
* @returns the previous string contained by the buffer.
*/
xmlChar *
xmlBufferDetach(xmlBufferPtr buf) {
@ -838,11 +810,10 @@ xmlBufferDetach(xmlBufferPtr buf) {
}
/**
* xmlBufferCreateStatic:
* @mem: the memory area
* @size: the size in byte
* @param mem the memory area
* @param size the size in byte
*
* Returns an XML buffer initialized with bytes.
* @returns an XML buffer initialized with bytes.
*/
xmlBufferPtr
xmlBufferCreateStatic(void *mem, size_t size) {
@ -853,9 +824,8 @@ xmlBufferCreateStatic(void *mem, size_t size) {
}
/**
* xmlBufferSetAllocationScheme:
* @buf: the buffer to tune
* @scheme: allocation scheme to use
* @param buf the buffer to tune
* @param scheme allocation scheme to use
*
* Sets the allocation scheme for this buffer.
*
@ -868,8 +838,7 @@ xmlBufferSetAllocationScheme(xmlBufferPtr buf ATTRIBUTE_UNUSED,
}
/**
* xmlBufferFree:
* @buf: the buffer to free
* @param buf the buffer to free
*
* Frees an XML buffer. It frees both the content and the structure which
* encapsulate it.
@ -888,8 +857,7 @@ xmlBufferFree(xmlBufferPtr buf) {
}
/**
* xmlBufferEmpty:
* @buf: the buffer
* @param buf the buffer
*
* empty a buffer.
*/
@ -912,15 +880,14 @@ xmlBufferEmpty(xmlBufferPtr buf) {
}
/**
* xmlBufferShrink:
* @buf: the buffer to dump
* @len: the number of xmlChar to remove
* @param buf the buffer to dump
* @param len the number of xmlChar to remove
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Remove the beginning of an XML buffer.
*
* Returns the number of #xmlChar removed, or -1 in case of failure.
* @returns the number of \#xmlChar removed, or -1 in case of failure.
*/
int
xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
@ -944,15 +911,14 @@ xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
}
/**
* xmlBufferGrow:
* @buf: the buffer
* @len: the minimum free size to allocate
* @param buf the buffer
* @param len the minimum free size to allocate
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Grow the available space of an XML buffer.
*
* Returns the new available space or -1 in case of error
* @returns the new available space or -1 in case of error
*/
int
xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
@ -1001,12 +967,11 @@ xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
}
/**
* xmlBufferDump:
* @file: the file output
* @buf: the buffer to dump
* @param file the file output
* @param buf the buffer to dump
*
* Dumps an XML buffer to a FILE *.
* Returns the number of #xmlChar written
* @returns the number of \#xmlChar written
*/
int
xmlBufferDump(FILE *file, xmlBufferPtr buf) {
@ -1023,12 +988,11 @@ xmlBufferDump(FILE *file, xmlBufferPtr buf) {
}
/**
* xmlBufferContent:
* @buf: the buffer
* @param buf the buffer
*
* Function to extract the content of a buffer
*
* Returns the internal content
* @returns the internal content
*/
const xmlChar *
@ -1041,12 +1005,11 @@ xmlBufferContent(const xmlBuffer *buf)
}
/**
* xmlBufferLength:
* @buf: the buffer
* @param buf the buffer
*
* Function to get the length of a buffer
*
* Returns the length of data in the internal content
* @returns the length of data in the internal content
*/
int
@ -1059,15 +1022,14 @@ xmlBufferLength(const xmlBuffer *buf)
}
/**
* xmlBufferResize:
* @buf: the buffer to resize
* @size: the desired size
* @param buf the buffer to resize
* @param size the desired size
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
* Resize a buffer to accommodate minimum size of @size.
* Resize a buffer to accommodate minimum size of `size`.
*
* Returns 0 in case of problems, 1 otherwise
* @returns 0 in case of problems, 1 otherwise
*/
int
xmlBufferResize(xmlBufferPtr buf, unsigned int size)
@ -1084,15 +1046,14 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
}
/**
* xmlBufferAdd:
* @buf: the buffer to dump
* @str: the #xmlChar string
* @len: the number of #xmlChar to add
* @param buf the buffer to dump
* @param str the \#xmlChar string
* @param len the number of \#xmlChar to add
*
* Add a string range to an XML buffer. if len == -1, the length of
* str is recomputed.
*
* Returns a xmlParserErrors code.
* @returns a xmlParserErrors code.
*/
int
xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
@ -1116,15 +1077,14 @@ xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
}
/**
* xmlBufferAddHead:
* @buf: the buffer
* @str: the #xmlChar string
* @len: the number of #xmlChar to add
* @param buf the buffer
* @param str the \#xmlChar string
* @param len the number of \#xmlChar to add
*
* Add a string range to the beginning of an XML buffer.
* if len == -1, the length of @str is recomputed.
* if len == -1, the length of `str` is recomputed.
*
* Returns a xmlParserErrors code.
* @returns a xmlParserErrors code.
*/
int
xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
@ -1172,13 +1132,12 @@ xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
}
/**
* xmlBufferCat:
* @buf: the buffer to add to
* @str: the #xmlChar string
* @param buf the buffer to add to
* @param str the \#xmlChar string
*
* Append a zero terminated string to an XML buffer.
*
* Returns 0 successful, a positive error code number otherwise
* @returns 0 successful, a positive error code number otherwise
* and -1 in case of internal or API error.
*/
int
@ -1187,13 +1146,12 @@ xmlBufferCat(xmlBufferPtr buf, const xmlChar *str) {
}
/**
* xmlBufferCCat:
* @buf: the buffer to dump
* @str: the C char string
* @param buf the buffer to dump
* @param str the C char string
*
* Append a zero terminated C string to an XML buffer.
*
* Returns 0 successful, a positive error code number otherwise
* @returns 0 successful, a positive error code number otherwise
* and -1 in case of internal or API error.
*/
int
@ -1202,9 +1160,8 @@ xmlBufferCCat(xmlBufferPtr buf, const char *str) {
}
/**
* xmlBufferWriteCHAR:
* @buf: the XML buffer
* @string: the string to add
* @param buf the XML buffer
* @param string the string to add
*
* routine which manages and grows an output buffer. This one adds
* xmlChars at the end of the buffer.
@ -1215,9 +1172,8 @@ xmlBufferWriteCHAR(xmlBufferPtr buf, const xmlChar *string) {
}
/**
* xmlBufferWriteChar:
* @buf: the XML buffer output
* @string: the string to add
* @param buf the XML buffer output
* @param string the string to add
*
* routine which manage and grows an output buffer. This one add
* C chars at the end of the array.
@ -1229,12 +1185,11 @@ xmlBufferWriteChar(xmlBufferPtr buf, const char *string) {
/**
* xmlBufferWriteQuotedString:
* @buf: the XML buffer output
* @string: the string to add
* @param buf the XML buffer output
* @param string the string to add
*
* routine which manage and grows an output buffer. This one writes
* a quoted or double quoted #xmlChar string, checking first if it holds
* a quoted or double quoted \#xmlChar string, checking first if it holds
* quote or double-quotes internally
*/
void

235
c14n.c
View File

@ -129,8 +129,7 @@ static xmlChar *xmlC11NNormalizeString(const xmlChar * input,
************************************************************************/
/**
* xmlC14NErrMemory:
* @ctxt: a C14N evaluation context
* @param ctxt a C14N evaluation context
*
* Handle a redefinition of memory error
*/
@ -164,8 +163,7 @@ xmlC14NErrFull(xmlC14NCtxPtr ctxt, xmlNodePtr node, int code, const char *str1,
}
/**
* xmlC14NErrParam:
* @ctxt: a C14N evaluation context
* @param ctxt a C14N evaluation context
*
* Handle a param error
*/
@ -177,10 +175,9 @@ xmlC14NErrParam(xmlC14NCtxPtr ctxt)
}
/**
* xmlC14NErrInvalidNode:
* @ctxt: a C14N evaluation context
* @node_type: node type
* @extra: extra information
* @param ctxt a C14N evaluation context
* @param node_type node type
* @param extra extra information
*
* Handle an invalid node error
*/
@ -193,10 +190,9 @@ xmlC14NErrInvalidNode(xmlC14NCtxPtr ctxt, const char *node_type,
}
/**
* xmlC14NErrUnknownNode:
* @ctxt: a C14N evaluation context
* @node_type: node type
* @extra: extra information
* @param ctxt a C14N evaluation context
* @param node_type node type
* @param extra extra information
*
* Handle an unknown node error
*/
@ -208,9 +204,8 @@ xmlC14NErrUnknownNode(xmlC14NCtxPtr ctxt, int node_type, const char *extra)
}
/**
* xmlC14NErrRelativeNamespace:
* @ctxt: a C14N evaluation context
* @ns_uri: namespace URI
* @param ctxt a C14N evaluation context
* @param ns_uri namespace URI
*
* Handle a relative namespace error
*/
@ -224,11 +219,10 @@ xmlC14NErrRelativeNamespace(xmlC14NCtxPtr ctxt, const char *ns_uri)
/**
* xmlC14NErr:
* @ctxt: a C14N evaluation context
* @node: the context node
* @error: the error code
* @msg: the message
* @param ctxt a C14N evaluation context
* @param node the context node
* @param error the error code
* @param msg the message
*
* Handle an error
*/
@ -385,13 +379,12 @@ xmlC14NStrEqual(const xmlChar *str1, const xmlChar *str2) {
}
/**
* xmlC14NVisibleNsStackFind:
* @cur: the visible stack
* @ns: the namespace to check
* @param cur the visible stack
* @param ns the namespace to check
*
* Checks whether the given namespace was already rendered or not
*
* Returns 1 if we already wrote this namespace or 0 otherwise
* @returns 1 if we already wrote this namespace or 0 otherwise
*/
static int
xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns)
@ -468,13 +461,12 @@ xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NC
/**
* xmlC14NIsXmlNs:
* @ns: the namespace to check
* @param ns the namespace to check
*
* Checks whether the given namespace is a default "xml:" namespace
* with href="http://www.w3.org/XML/1998/namespace"
*
* Returns 1 if the node is default or 0 otherwise
* @returns 1 if the node is default or 0 otherwise
*/
/* todo: make it a define? */
@ -488,13 +480,12 @@ xmlC14NIsXmlNs(xmlNsPtr ns)
/**
* xmlC14NNsCompare:
* @data1: the pointer to first namespace
* @data2: the pointer to second namespace
* @param data1 the pointer to first namespace
* @param data2 the pointer to second namespace
*
* Compares the namespaces by names (prefixes).
*
* Returns -1 if ns1 < ns2, 0 if ns1 == ns2 or 1 if ns1 > ns2.
* @returns -1 if ns1 < ns2, 0 if ns1 == ns2 or 1 if ns1 > ns2.
*/
static int
xmlC14NNsCompare(const void *data1, const void *data2)
@ -513,13 +504,12 @@ xmlC14NNsCompare(const void *data1, const void *data2)
/**
* xmlC14NPrintNamespaces:
* @ns: the pointer to namespace
* @ctx: the C14N context
* @param ns the pointer to namespace
* @param ctx the C14N context
*
* Prints the given namespace to the output buffer from C14N context.
*
* Returns 1 on success or 0 on fail.
* @returns 1 on success or 0 on fail.
*/
static int
xmlC14NPrintNamespaces(const xmlNs *ns, xmlC14NCtxPtr ctx)
@ -551,10 +541,9 @@ xmlC14NPrintNamespacesWalker(const void *ns, void *ctx) {
}
/**
* xmlC14NProcessNamespacesAxis:
* @ctx: the C14N context
* @cur: the current node
* @visible: the visibility of node
* @param ctx the C14N context
* @param cur the current node
* @param visible the visibility of node
*
* Prints out canonical namespace axis of the current node to the
* buffer from C14N context as follows
@ -588,7 +577,7 @@ xmlC14NPrintNamespacesWalker(const void *ns, void *ctx) {
* the document subset). This search and copying are omitted from the
* Exclusive XML Canonicalization method.
*
* Returns 0 on success or -1 on fail.
* @returns 0 on success or -1 on fail.
*/
static int
xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
@ -670,10 +659,9 @@ error:
/**
* xmlExcC14NProcessNamespacesAxis:
* @ctx: the C14N context
* @cur: the current node
* @visible: the visibility of node
* @param ctx the C14N context
* @param cur the current node
* @param visible the visibility of node
*
* Prints out exclusive canonical namespace axis of the current node to the
* buffer from C14N context as follows
@ -698,7 +686,7 @@ error:
* 3. After the recursion returns, pop thestate stack.
*
*
* Returns 0 on success or -1 on fail.
* @returns 0 on success or -1 on fail.
*/
static int
xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
@ -858,13 +846,12 @@ error:
/**
* xmlC14NIsXmlAttr:
* @attr: the attr to check
* @param attr the attr to check
*
* Checks whether the given attribute is a default "xml:" namespace
* with href="http://www.w3.org/XML/1998/namespace"
*
* Returns 1 if the node is default or 0 otherwise
* @returns 1 if the node is default or 0 otherwise
*/
/* todo: make it a define? */
@ -877,13 +864,12 @@ xmlC14NIsXmlAttr(xmlAttrPtr attr)
/**
* xmlC14NAttrsCompare:
* @data1: the pointer tls o first attr
* @data2: the pointer to second attr
* @param data1 the pointer tls o first attr
* @param data2 the pointer to second attr
*
* Prints the given attribute to the output buffer from C14N context.
*
* Returns -1 if attr1 < attr2, 0 if attr1 == attr2 or 1 if attr1 > attr2.
* @returns -1 if attr1 < attr2, 0 if attr1 == attr2 or 1 if attr1 > attr2.
*/
static int
xmlC14NAttrsCompare(const void *data1, const void *data2)
@ -928,16 +914,15 @@ xmlC14NAttrsCompare(const void *data1, const void *data2)
/**
* xmlC14NPrintAttrs:
* @data: the pointer to attr
* @user: the C14N context
* @param data the pointer to attr
* @param user the C14N context
*
* Prints out canonical attribute urrent node to the
* buffer from C14N context as follows
*
* Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n)
*
* Returns 1 on success or 0 on fail.
* @returns 1 on success or 0 on fail.
*/
static int
xmlC14NPrintAttrs(const void *data, void *user)
@ -979,11 +964,10 @@ xmlC14NPrintAttrs(const void *data, void *user)
}
/**
* xmlC14NFindHiddenParentAttr:
*
* Finds an attribute in a hidden parent node.
*
* Returns a pointer to the attribute node (if found) or NULL otherwise.
* @returns a pointer to the attribute node (if found) or NULL otherwise.
*/
static xmlAttrPtr
xmlC14NFindHiddenParentAttr(xmlC14NCtxPtr ctx, xmlNodePtr cur, const xmlChar * name, const xmlChar * ns)
@ -1002,11 +986,10 @@ xmlC14NFindHiddenParentAttr(xmlC14NCtxPtr ctx, xmlNodePtr cur, const xmlChar * n
}
/**
* xmlC14NFixupBaseAttr:
*
* Fixes up the xml:base attribute
*
* Returns the newly created attribute or NULL
* @returns the newly created attribute or NULL
*/
static xmlAttrPtr
xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr)
@ -1108,10 +1091,9 @@ xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr)
}
/**
* xmlC14NProcessAttrsAxis:
* @ctx: the C14N context
* @cur: the current node
* @parent_visible: the visibility of the parent node
* @param ctx the C14N context
* @param cur the current node
* @param parent_visible the visibility of the parent node
*
* Prints out canonical attribute axis of the current node to the
* buffer from C14N context as follows
@ -1137,7 +1119,7 @@ xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr)
* the document subset). This search and copying are omitted from the
* Exclusive XML Canonicalization method.
*
* Returns 0 on success or -1 on fail.
* @returns 0 on success or -1 on fail.
*/
static int
xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible)
@ -1359,13 +1341,12 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible)
}
/**
* xmlC14NCheckForRelativeNamespaces:
* @ctx: the C14N context
* @cur: the current element node
* @param ctx the C14N context
* @param cur the current element node
*
* Checks that current element node has no relative namespaces defined
*
* Returns 0 if the node has no relative namespaces or -1 otherwise.
* @returns 0 if the node has no relative namespaces or -1 otherwise.
*/
static int
xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur)
@ -1405,10 +1386,9 @@ xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur)
}
/**
* xmlC14NProcessElementNode:
* @ctx: the pointer to C14N context object
* @cur: the node to process
* @visible: this node is visible
* @param ctx the pointer to C14N context object
* @param cur the node to process
* @param visible this node is visible
*
* Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n)
*
@ -1424,7 +1404,7 @@ xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur)
* open angle bracket, a forward slash (/), the element QName, and a close
* angle bracket.
*
* Returns non-negative value on success or negative value on fail
* @returns non-negative value on success or negative value on fail
*/
static int
xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
@ -1517,13 +1497,12 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
}
/**
* xmlC14NProcessNode:
* @ctx: the pointer to C14N context object
* @cur: the node to process
* @param ctx the pointer to C14N context object
* @param cur the node to process
*
* Processes the given node
*
* Returns non-negative value on success or negative value on fail
* @returns non-negative value on success or negative value on fail
*/
static int
xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur)
@ -1705,13 +1684,12 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur)
}
/**
* xmlC14NProcessNodeList:
* @ctx: the pointer to C14N context object
* @cur: the node to start from
* @param ctx the pointer to C14N context object
* @param cur the node to start from
*
* Processes all nodes in the row starting from cur.
*
* Returns non-negative value on success or negative value on fail
* @returns non-negative value on success or negative value on fail
*/
static int
xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur)
@ -1731,8 +1709,7 @@ xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur)
/**
* xmlC14NFreeCtx:
* @ctx: the pointer to C14N context object
* @param ctx the pointer to C14N context object
*
* Cleanups the C14N context object.
*/
@ -1752,25 +1729,24 @@ xmlC14NFreeCtx(xmlC14NCtxPtr ctx)
}
/**
* xmlC14NNewCtx:
* @doc: the XML document for canonization
* @is_visible_callback:the function to use to determine is node visible
* @param doc the XML document for canonization
* @param is_visible_callback the function to use to determine is node visible
* or not
* @user_data: the first parameter for @is_visible_callback function
* @param user_data the first parameter for `is_visible_callback` function
* (in most cases, it is nodes set)
* @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* @param mode the c14n mode (see `xmlC14NMode`)
* @param inclusive_ns_prefixes the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no
* inclusive namespaces (only for `
* canonicalization)
* @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this
* @param with_comments include comments in the result (!=0) or not (==0)
* @param buf the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires
* UTF-8 output
*
* Creates new C14N context object to store C14N parameters.
*
* Returns pointer to newly created object (success) or NULL (fail)
* @returns pointer to newly created object (success) or NULL (fail)
*/
static xmlC14NCtxPtr
xmlC14NNewCtx(xmlDocPtr doc,
@ -1835,19 +1811,18 @@ xmlC14NNewCtx(xmlDocPtr doc,
}
/**
* xmlC14NExecute:
* @doc: the XML document for canonization
* @is_visible_callback:the function to use to determine is node visible
* @param doc the XML document for canonization
* @param is_visible_callback the function to use to determine is node visible
* or not
* @user_data: the first parameter for @is_visible_callback function
* @param user_data the first parameter for `is_visible_callback` function
* (in most cases, it is nodes set)
* @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* @param mode the c14n mode (see `xmlC14NMode`)
* @param inclusive_ns_prefixes the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this
* @param with_comments include comments in the result (!=0) or not (==0)
* @param buf the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires
* UTF-8 output
*
@ -1855,7 +1830,7 @@ xmlC14NNewCtx(xmlDocPtr doc,
* For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
* "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
*
* Returns non-negative value on success or a negative value on fail
* @returns non-negative value on success or a negative value on fail
*/
int
xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback,
@ -1938,17 +1913,16 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback,
}
/**
* xmlC14NDocSaveTo:
* @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image
* @param doc the XML document for canonization
* @param nodes the nodes set to be included in the canonized image
* or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* @param mode the c14n mode (see `xmlC14NMode`)
* @param inclusive_ns_prefixes the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this
* @param with_comments include comments in the result (!=0) or not (==0)
* @param buf the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires
* UTF-8 output
*
@ -1956,7 +1930,7 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback,
* For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
* "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
*
* Returns non-negative value on success or a negative value on fail
* @returns non-negative value on success or a negative value on fail
*/
int
xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes,
@ -1973,17 +1947,16 @@ xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes,
/**
* xmlC14NDocDumpMemory:
* @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image
* @param doc the XML document for canonization
* @param nodes the nodes set to be included in the canonized image
* or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* @param mode the c14n mode (see `xmlC14NMode`)
* @param inclusive_ns_prefixes the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0)
* @doc_txt_ptr: the memory pointer for allocated canonical XML text;
* @param with_comments include comments in the result (!=0) or not (==0)
* @param doc_txt_ptr the memory pointer for allocated canonical XML text;
* the caller of this functions is responsible for calling
* xmlFree() to free allocated memory
*
@ -1991,7 +1964,7 @@ xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes,
* For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
* "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
*
* Returns the number of bytes written on success or a negative value on fail
* @returns the number of bytes written on success or a negative value on fail
*/
int
xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
@ -2041,18 +2014,17 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
}
/**
* xmlC14NDocSave:
* @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image
* @param doc the XML document for canonization
* @param nodes the nodes set to be included in the canonized image
* or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* @param mode the c14n mode (see `xmlC14NMode`)
* @param inclusive_ns_prefixes the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0)
* @filename: the filename to store canonical XML image
* @compression: the compression level (zlib required):
* @param with_comments include comments in the result (!=0) or not (==0)
* @param filename the filename to store canonical XML image
* @param compression the compression level (zlib required):
* -1 - libxml default,
* 0 - uncompressed,
* >0 - compression level
@ -2061,7 +2033,7 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
* For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
* "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)
*
* Returns the number of bytes written success or a negative value on fail
* @returns the number of bytes written success or a negative value on fail
*/
int
xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes,
@ -2107,15 +2079,14 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes,
}
/**
* xmlC11NNormalizeString:
* @input: the input string
* @mode: the normalization mode (attribute, comment, PI or text)
* @param input the input string
* @param mode the normalization mode (attribute, comment, PI or text)
*
* Converts a string to a canonical (normalized) format. The code is stolen
* from xmlEncodeEntitiesReentrant(). Added normalization of `\x09`, `\x0a`,
* `\x0A` and the @mode parameter.
* `\x0A` and the `mode` parameter.
*
* Returns a normalized string (caller is responsible for calling xmlFree())
* @returns a normalized string (caller is responsible for calling xmlFree())
* or NULL if an error occurs
*/
static xmlChar *

464
catalog.c

File diff suppressed because it is too large Load Diff

View File

@ -156,14 +156,13 @@ const xmlChRangeGroup xmlIsIdeographicGroup =
/**
* xmlCharInRange:
* @val: character to be validated
* @rptr: pointer to range to be used to validate
* @param val character to be validated
* @param rptr pointer to range to be used to validate
*
* Does a binary search of the range table to determine if char
* is valid
*
* Returns: true if character valid, false otherwise
* @returns true if character valid, false otherwise
*/
int
xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
@ -215,13 +214,12 @@ xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
/**
* xmlIsBaseChar:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsBaseChar(unsigned int ch) {
@ -230,13 +228,12 @@ xmlIsBaseChar(unsigned int ch) {
/**
* xmlIsBlank:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsBlank_ch or xmlIsBlankQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsBlank(unsigned int ch) {
@ -245,13 +242,12 @@ xmlIsBlank(unsigned int ch) {
/**
* xmlIsChar:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsChar_ch or xmlIsCharQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsChar(unsigned int ch) {
@ -260,13 +256,12 @@ xmlIsChar(unsigned int ch) {
/**
* xmlIsCombining:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsCombiningQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsCombining(unsigned int ch) {
@ -275,13 +270,12 @@ xmlIsCombining(unsigned int ch) {
/**
* xmlIsDigit:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsDigit_ch or xmlIsDigitQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsDigit(unsigned int ch) {
@ -290,13 +284,12 @@ xmlIsDigit(unsigned int ch) {
/**
* xmlIsExtender:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsExtender_ch or xmlIsExtenderQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsExtender(unsigned int ch) {
@ -305,13 +298,12 @@ xmlIsExtender(unsigned int ch) {
/**
* xmlIsIdeographic:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsIdeographicQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsIdeographic(unsigned int ch) {
@ -320,13 +312,12 @@ xmlIsIdeographic(unsigned int ch) {
/**
* xmlIsPubidChar:
* @ch: character to validate
* @param ch character to validate
*
* This function is DEPRECATED.
* Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
*
* Returns true if argument valid, false otherwise
* @returns true if argument valid, false otherwise
*/
int
xmlIsPubidChar(unsigned int ch) {

View File

@ -70,13 +70,12 @@ xmlCtxtDumpCleanCtxt(xmlDebugCtxtPtr ctxt ATTRIBUTE_UNUSED)
}
/**
* xmlNsCheckScope:
* @node: the node
* @ns: the namespace node
* @param node the node
* @param ns the namespace node
*
* Check that a given namespace is in scope on a node.
*
* Returns 1 if in scope, -1 in case of argument error,
* @returns 1 if in scope, -1 in case of argument error,
* -2 if the namespace is not in scope, and -3 if not on
* an ancestor node.
*/
@ -139,10 +138,9 @@ xmlCtxtDumpSpaces(xmlDebugCtxtPtr ctxt)
}
/**
* xmlDebugErr:
* @ctxt: a debug context
* @error: the error code
* @msg: the error message
* @param ctxt a debug context
* @param error the error code
* @param msg the error message
*
* Handle a debug error.
*/
@ -168,10 +166,9 @@ xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra
}
/**
* xmlCtxtNsCheckScope:
* @ctxt: the debugging context
* @node: the node
* @ns: the namespace node
* @param ctxt the debugging context
* @param node the node
* @param ns the namespace node
*
* Report if a given namespace is is not in scope.
*/
@ -202,9 +199,8 @@ xmlCtxtNsCheckScope(xmlDebugCtxtPtr ctxt, xmlNodePtr node, xmlNsPtr ns)
}
/**
* xmlCtxtCheckString:
* @ctxt: the debug context
* @str: the string
* @param ctxt the debug context
* @param str the string
*
* Do debugging on the string, currently it just checks the UTF-8 content
*/
@ -221,9 +217,8 @@ xmlCtxtCheckString(xmlDebugCtxtPtr ctxt, const xmlChar * str)
}
/**
* xmlCtxtCheckName:
* @ctxt: the debug context
* @name: the name
* @param ctxt the debug context
* @param name the name
*
* Do debugging on the name, for example the dictionary status and
* conformance to the Name production.
@ -784,9 +779,8 @@ xmlCtxtDumpEntity(xmlDebugCtxtPtr ctxt, xmlEntityPtr ent)
}
/**
* xmlCtxtDumpAttr:
* @ctxt: the debug context
* @attr: the attribute
* @param ctxt the debug context
* @param attr the attribute
*
* Dumps debug information for the attribute
*/
@ -821,9 +815,8 @@ xmlCtxtDumpAttr(xmlDebugCtxtPtr ctxt, xmlAttrPtr attr)
}
/**
* xmlCtxtDumpAttrList:
* @ctxt: the debug context
* @attr: the attribute list
* @param ctxt the debug context
* @param attr the attribute list
*
* Dumps debug information for the attribute list
*/
@ -837,9 +830,8 @@ xmlCtxtDumpAttrList(xmlDebugCtxtPtr ctxt, xmlAttrPtr attr)
}
/**
* xmlCtxtDumpOneNode:
* @ctxt: the debug context
* @node: the node
* @param ctxt the debug context
* @param node the node
*
* Dumps debug information for the element node, it is not recursive/
*/
@ -1019,9 +1011,8 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
}
/**
* xmlCtxtDumpNode:
* @ctxt: the debug context
* @node: the node
* @param ctxt the debug context
* @param node the node
*
* Dumps debug information for the element node, it is recursive
*/
@ -1045,9 +1036,8 @@ xmlCtxtDumpNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
}
/**
* xmlCtxtDumpNodeList:
* @ctxt: the debug context
* @node: the node list
* @param ctxt the debug context
* @param node the node list
*
* Dumps debug information for the list of element node, it is recursive
*/
@ -1130,9 +1120,8 @@ xmlCtxtDumpDocHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
}
/**
* xmlCtxtDumpDocumentHead:
* @ctxt: the debug context
* @doc: the document
* @param ctxt the debug context
* @param doc the document
*
* Dumps debug information concerning the document, not recursive
*/
@ -1170,9 +1159,8 @@ xmlCtxtDumpDocumentHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
}
/**
* xmlCtxtDumpDocument:
* @ctxt: the debug context
* @doc: the document
* @param ctxt the debug context
* @param doc the document
*
* Dumps debug information for the document, it's recursive
*/
@ -1241,9 +1229,8 @@ xmlCtxtDumpEntityCallback(void *payload, void *data,
}
/**
* xmlCtxtDumpEntities:
* @ctxt: the debug context
* @doc: the document
* @param ctxt the debug context
* @param doc the document
*
* Dumps debug information for all the entities in use by the document
*/
@ -1273,9 +1260,8 @@ xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
}
/**
* xmlCtxtDumpDTD:
* @ctxt: the debug context
* @dtd: the DTD
* @param ctxt the debug context
* @param dtd the DTD
*
* Dumps debug information for the DTD
*/
@ -1304,9 +1290,8 @@ xmlCtxtDumpDTD(xmlDebugCtxtPtr ctxt, xmlDtdPtr dtd)
************************************************************************/
/**
* xmlDebugDumpString:
* @output: the FILE * for the output
* @str: the string
* @param output the FILE * for the output
* @param str the string
*
* Dumps information about the string, shorten it if necessary
*/
@ -1334,10 +1319,9 @@ xmlDebugDumpString(FILE * output, const xmlChar * str)
}
/**
* xmlDebugDumpAttr:
* @output: the FILE * for the output
* @attr: the attribute
* @depth: the indentation level.
* @param output the FILE * for the output
* @param attr the attribute
* @param depth the indentation level.
*
* Dumps debug information for the attribute
*/
@ -1355,9 +1339,8 @@ xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) {
/**
* xmlDebugDumpEntities:
* @output: the FILE * for the output
* @doc: the document
* @param output the FILE * for the output
* @param doc the document
*
* Dumps debug information for all the entities in use by the document
*/
@ -1374,10 +1357,9 @@ xmlDebugDumpEntities(FILE * output, xmlDocPtr doc)
}
/**
* xmlDebugDumpAttrList:
* @output: the FILE * for the output
* @attr: the attribute list
* @depth: the indentation level.
* @param output the FILE * for the output
* @param attr the attribute list
* @param depth the indentation level.
*
* Dumps debug information for the attribute list
*/
@ -1395,10 +1377,9 @@ xmlDebugDumpAttrList(FILE * output, xmlAttrPtr attr, int depth)
}
/**
* xmlDebugDumpOneNode:
* @output: the FILE * for the output
* @node: the node
* @depth: the indentation level.
* @param output the FILE * for the output
* @param node the node
* @param depth the indentation level.
*
* Dumps debug information for the element node, it is not recursive
*/
@ -1416,10 +1397,9 @@ xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth)
}
/**
* xmlDebugDumpNode:
* @output: the FILE * for the output
* @node: the node
* @depth: the indentation level.
* @param output the FILE * for the output
* @param node the node
* @param depth the indentation level.
*
* Dumps debug information for the element node, it is recursive
*/
@ -1438,10 +1418,9 @@ xmlDebugDumpNode(FILE * output, xmlNodePtr node, int depth)
}
/**
* xmlDebugDumpNodeList:
* @output: the FILE * for the output
* @node: the node list
* @depth: the indentation level.
* @param output the FILE * for the output
* @param node the node list
* @param depth the indentation level.
*
* Dumps debug information for the list of element node, it is recursive
*/
@ -1460,9 +1439,8 @@ xmlDebugDumpNodeList(FILE * output, xmlNodePtr node, int depth)
}
/**
* xmlDebugDumpDocumentHead:
* @output: the FILE * for the output
* @doc: the document
* @param output the FILE * for the output
* @param doc the document
*
* Dumps debug information concerning the document, not recursive
*/
@ -1481,9 +1459,8 @@ xmlDebugDumpDocumentHead(FILE * output, xmlDocPtr doc)
}
/**
* xmlDebugDumpDocument:
* @output: the FILE * for the output
* @doc: the document
* @param output the FILE * for the output
* @param doc the document
*
* Dumps debug information for the document, it's recursive
*/
@ -1502,9 +1479,8 @@ xmlDebugDumpDocument(FILE * output, xmlDocPtr doc)
}
/**
* xmlDebugDumpDTD:
* @output: the FILE * for the output
* @dtd: the DTD
* @param output the FILE * for the output
* @param dtd the DTD
*
* Dumps debug information for the DTD
*/
@ -1529,14 +1505,13 @@ xmlDebugDumpDTD(FILE * output, xmlDtdPtr dtd)
************************************************************************/
/**
* xmlDebugCheckDocument:
* @output: the FILE * for the output
* @doc: the document
* @param output the FILE * for the output
* @param doc the document
*
* Check the document for potential content problems, and output
* the errors to @output
* the errors to `output`
*
* Returns the number of errors found
* @returns the number of errors found
*/
int
xmlDebugCheckDocument(FILE * output, xmlDocPtr doc)

173
dict.c
View File

@ -81,11 +81,10 @@ struct _xmlDict {
static xmlMutex xmlDictMutex;
/**
* xmlInitializeDict:
*
* DEPRECATED: Alias for xmlInitParser.
* @deprecated Alias for xmlInitParser.
*
* Returns 0.
* @returns 0.
*/
int
xmlInitializeDict(void) {
@ -94,7 +93,6 @@ xmlInitializeDict(void) {
}
/**
* xmlInitDictInternal:
*
* Initialize mutex.
*/
@ -104,9 +102,8 @@ xmlInitDictInternal(void) {
}
/**
* xmlDictCleanup:
*
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
* @deprecated This function is a no-op. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
@ -116,7 +113,6 @@ xmlDictCleanup(void) {
}
/**
* xmlCleanupDictInternal:
*
* Free the dictionary mutex.
*/
@ -126,14 +122,13 @@ xmlCleanupDictInternal(void) {
}
/*
* xmlDictAddString:
* @dict: the dictionary
* @name: the name of the userdata
* @len: the length of the name
* @param dict the dictionary
* @param name the name of the userdata
* @param len the length of the name
*
* Add the string to the array[s]
*
* Returns the pointer of the local string, or NULL in case of error.
* @returns the pointer of the local string, or NULL in case of error.
*/
static const xmlChar *
xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
@ -192,16 +187,15 @@ found_pool:
}
/*
* xmlDictAddQString:
* @dict: the dictionary
* @prefix: the prefix of the userdata
* @plen: the prefix length
* @name: the name of the userdata
* @len: the length of the name
* @param dict the dictionary
* @param prefix the prefix of the userdata
* @param plen the prefix length
* @param name the name of the userdata
* @param len the length of the name
*
* Add the QName to the array[s]
*
* Returns the pointer of the local string, or NULL in case of error.
* @returns the pointer of the local string, or NULL in case of error.
*/
static const xmlChar *
xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen,
@ -255,11 +249,10 @@ found_pool:
}
/**
* xmlDictCreate:
*
* Create a new dictionary
*
* Returns the newly created dictionary, or NULL if an error occurred.
* @returns the newly created dictionary, or NULL if an error occurred.
*/
xmlDictPtr
xmlDictCreate(void) {
@ -286,15 +279,14 @@ xmlDictCreate(void) {
}
/**
* xmlDictCreateSub:
* @sub: an existing dictionary
* @param sub an existing dictionary
*
* Create a new dictionary, inheriting strings from the read-only
* dictionary @sub. On lookup, strings are first searched in the
* new dictionary, then in @sub, and if not found are created in the
* dictionary `sub`. On lookup, strings are first searched in the
* new dictionary, then in `sub`, and if not found are created in the
* new dictionary.
*
* Returns the newly created dictionary, or NULL if an error occurred.
* @returns the newly created dictionary, or NULL if an error occurred.
*/
xmlDictPtr
xmlDictCreateSub(xmlDictPtr sub) {
@ -309,12 +301,11 @@ xmlDictCreateSub(xmlDictPtr sub) {
}
/**
* xmlDictReference:
* @dict: the dictionary
* @param dict the dictionary
*
* Increment the reference counter of a dictionary
*
* Returns 0 in case of success and -1 in case of error
* @returns 0 in case of success and -1 in case of error
*/
int
xmlDictReference(xmlDictPtr dict) {
@ -326,11 +317,10 @@ xmlDictReference(xmlDictPtr dict) {
}
/**
* xmlDictFree:
* @dict: the dictionary
* @param dict the dictionary
*
* Free the hash @dict and its contents. The userdata is
* deallocated with @f if provided.
* Free the hash `dict` and its contents. The userdata is
* deallocated with `f` if provided.
*/
void
xmlDictFree(xmlDictPtr dict) {
@ -366,13 +356,12 @@ xmlDictFree(xmlDictPtr dict) {
}
/**
* xmlDictOwns:
* @dict: the dictionary
* @str: the string
* @param dict the dictionary
* @param str the string
*
* check if a string is owned by the dictionary
*
* Returns 1 if true, 0 if false and -1 in case of error
* @returns 1 if true, 0 if false and -1 in case of error
* -1 in case of error
*/
int
@ -393,12 +382,11 @@ xmlDictOwns(xmlDictPtr dict, const xmlChar *str) {
}
/**
* xmlDictSize:
* @dict: the dictionary
* @param dict the dictionary
*
* Query the number of elements installed in the hash @dict.
* Query the number of elements installed in the hash `dict`.
*
* Returns the number of elements in the dictionary or
* @returns the number of elements in the dictionary or
* -1 in case of error
*/
int
@ -411,14 +399,13 @@ xmlDictSize(xmlDictPtr dict) {
}
/**
* xmlDictSetLimit:
* @dict: the dictionary
* @limit: the limit in bytes
* @param dict the dictionary
* @param limit the limit in bytes
*
* Set a size limit for the dictionary
* Added in 2.9.0
*
* Returns the previous limit of the dictionary or 0
* @returns the previous limit of the dictionary or 0
*/
size_t
xmlDictSetLimit(xmlDictPtr dict, size_t limit) {
@ -432,13 +419,12 @@ xmlDictSetLimit(xmlDictPtr dict, size_t limit) {
}
/**
* xmlDictGetUsage:
* @dict: the dictionary
* @param dict the dictionary
*
* Get how much memory is used by a dictionary for strings
* Added in 2.9.0
*
* Returns the amount of strings allocated
* @returns the amount of strings allocated
*/
size_t
xmlDictGetUsage(xmlDictPtr dict) {
@ -512,13 +498,12 @@ xmlDictHashQName(unsigned seed, const xmlChar *prefix, const xmlChar *name,
}
/**
* xmlDictComputeHash:
* @dict: dictionary
* @string: C string
* @param dict dictionary
* @param string C string
*
* Compute the hash value of a C string.
*
* Returns the hash value.
* @returns the hash value.
*/
unsigned
xmlDictComputeHash(const xmlDict *dict, const xmlChar *string) {
@ -529,13 +514,12 @@ xmlDictComputeHash(const xmlDict *dict, const xmlChar *string) {
#define HASH_ROL31(x,n) ((x) << (n) | ((x) & 0x7FFFFFFF) >> (31 - (n)))
/**
* xmlDictCombineHash:
* @v1: first hash value
* @v2: second hash value
* @param v1 first hash value
* @param v2 second hash value
*
* Combine two hash values.
*
* Returns the combined hash value.
* @returns the combined hash value.
*/
ATTRIBUTE_NO_SANITIZE_INTEGER
unsigned
@ -551,16 +535,15 @@ xmlDictCombineHash(unsigned v1, unsigned v2) {
}
/**
* xmlDictFindEntry:
* @dict: dict
* @prefix: optional QName prefix
* @name: string
* @len: length of string
* @hashValue: valid hash value of string
* @pfound: result of search
* @param dict dict
* @param prefix optional QName prefix
* @param name string
* @param len length of string
* @param hashValue valid hash value of string
* @param pfound result of search
*
* Try to find a matching hash table entry. If an entry was found, set
* @found to 1 and return the entry. Otherwise, set @found to 0 and return
* `found` to 1 and return the entry. Otherwise, set `found` to 0 and return
* the location where a new entry should be inserted.
*/
ATTRIBUTE_NO_SANITIZE_INTEGER
@ -618,13 +601,12 @@ xmlDictFindEntry(const xmlDict *dict, const xmlChar *prefix,
}
/**
* xmlDictGrow:
* @dict: dictionary
* @size: new size of the dictionary
* @param dict dictionary
* @param size new size of the dictionary
*
* Resize the dictionary hash table.
*
* Returns 0 in case of success, -1 if a memory allocation failed.
* @returns 0 in case of success, -1 if a memory allocation failed.
*/
static int
xmlDictGrow(xmlDictPtr dict, unsigned size) {
@ -685,12 +667,11 @@ done:
}
/**
* xmlDictLookupInternal:
* @dict: dict
* @prefix: optional QName prefix
* @name: string
* @maybeLen: length of string or -1 if unknown
* @update: whether the string should be added
* @param dict dict
* @param prefix optional QName prefix
* @param name string
* @param maybeLen length of string or -1 if unknown
* @param update whether the string should be added
*
* Internal lookup and update function.
*/
@ -835,14 +816,13 @@ xmlDictLookupInternal(xmlDictPtr dict, const xmlChar *prefix,
}
/**
* xmlDictLookup:
* @dict: dictionary
* @name: string key
* @len: length of the key, if -1 it is recomputed
* @param dict dictionary
* @param name string key
* @param len length of the key, if -1 it is recomputed
*
* Lookup a string and add it to the dictionary if it wasn't found.
*
* Returns the interned copy of the string or NULL if a memory allocation
* @returns the interned copy of the string or NULL if a memory allocation
* failed.
*/
const xmlChar *
@ -856,15 +836,14 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
}
/**
* xmlDictLookupHashed:
* @dict: dictionary
* @name: string key
* @len: length of the key, if -1 it is recomputed
* @param dict dictionary
* @param name string key
* @param len length of the key, if -1 it is recomputed
*
* Lookup a dictionary entry and add the string to the dictionary if
* it wasn't found.
*
* Returns the dictionary entry.
* @returns the dictionary entry.
*/
xmlHashedString
xmlDictLookupHashed(xmlDictPtr dict, const xmlChar *name, int len) {
@ -884,14 +863,13 @@ xmlDictLookupHashed(xmlDictPtr dict, const xmlChar *name, int len) {
}
/**
* xmlDictExists:
* @dict: the dictionary
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
* @param dict the dictionary
* @param name the name of the userdata
* @param len the length of the name, if -1 it is recomputed
*
* Check if a string exists in the dictionary.
*
* Returns the internal copy of the name or NULL if not found.
* @returns the internal copy of the name or NULL if not found.
*/
const xmlChar *
xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
@ -904,15 +882,14 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
}
/**
* xmlDictQLookup:
* @dict: the dictionary
* @prefix: the prefix
* @name: the name
* @param dict the dictionary
* @param prefix the prefix
* @param name the name
*
* Lookup the QName `prefix:name` and add it to the dictionary if
* it wasn't found.
*
* Returns the interned copy of the string or NULL if a memory allocation
* @returns the interned copy of the string or NULL if a memory allocation
* failed.
*/
const xmlChar *
@ -948,7 +925,6 @@ static xmlMutex xmlRngMutex;
static unsigned globalRngState[2];
/*
* xmlInitRandom:
*
* Initialize the PRNG.
*/
@ -1016,7 +992,6 @@ xmlInitRandom(void) {
}
/*
* xmlCleanupRandom:
*
* Clean up PRNG globals.
*/
@ -1040,11 +1015,10 @@ xoroshiro64ss(unsigned *s) {
}
/*
* xmlGlobalRandom:
*
* Generate a pseudo-random value using the global PRNG.
*
* Returns a random value.
* @returns a random value.
*/
unsigned
xmlGlobalRandom(void) {
@ -1058,11 +1032,10 @@ xmlGlobalRandom(void) {
}
/*
* xmlRandom:
*
* Generate a pseudo-random value using the thread-local PRNG.
*
* Returns a random value.
* @returns a random value.
*/
unsigned
xmlRandom(void) {

View File

@ -9,7 +9,7 @@
* [UNICODE] The Unicode Consortium, "The Unicode Standard --
* Worldwide Character Encoding -- Version 1.0", Addison-
* Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
* described in Unicode Technical Report #4.
* described in Unicode Technical Report \#4.
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
* Information Interchange, ANSI X3.4-1986.
*
@ -256,15 +256,14 @@ xmlCharEncUconv(const char *name, xmlCharEncFlags flags,
************************************************************************/
/**
* xmlDetectCharEncoding:
* @in: a pointer to the first bytes of the XML entity, must be at least
* @param in a pointer to the first bytes of the XML entity, must be at least
* 2 bytes long (at least 4 if encoding is UTF4 variant).
* @len: pointer to the length of the buffer
* @param len pointer to the length of the buffer
*
* Guess the encoding of the entity using the first bytes of the entity content
* according to the non-normative appendix F of the XML-1.0 recommendation.
*
* Returns one of the XML_CHAR_ENCODING_... values.
* @returns one of the XML_CHAR_ENCODING_... values.
*/
xmlCharEncoding
xmlDetectCharEncoding(const unsigned char* in, int len)
@ -316,9 +315,8 @@ xmlDetectCharEncoding(const unsigned char* in, int len)
}
/**
* xmlCleanupEncodingAliases:
*
* DEPRECATED: This function modifies global state and is not
* @deprecated This function modifies global state and is not
* thread-safe. See xmlCtxtSetCharEncConvImpl for an alternative.
*
* Unregisters all aliases
@ -343,14 +341,13 @@ xmlCleanupEncodingAliases(void) {
}
/**
* xmlGetEncodingAlias:
* @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
* @param alias the alias name as parsed, in UTF-8 format (ASCII actually)
*
* DEPRECATED: This function is not thread-safe.
* @deprecated This function is not thread-safe.
*
* Lookup an encoding name for the given alias.
*
* Returns NULL if not found, otherwise the original name
* @returns NULL if not found, otherwise the original name
*/
const char *
xmlGetEncodingAlias(const char *alias) {
@ -381,17 +378,16 @@ xmlGetEncodingAlias(const char *alias) {
}
/**
* xmlAddEncodingAlias:
* @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
* @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
* @param name the encoding name as parsed, in UTF-8 format (ASCII actually)
* @param alias the alias name as parsed, in UTF-8 format (ASCII actually)
*
* DEPRECATED: This function modifies global state and is not
* @deprecated This function modifies global state and is not
* thread-safe. See xmlCtxtSetCharEncConvImpl for an alternative.
*
* Registers an alias @alias for an encoding named @name. Existing alias
* Registers an alias `alias` for an encoding named `name`. Existing alias
* will be overwritten.
*
* Returns 0 in case of success, -1 in case of error
* @returns 0 in case of success, -1 in case of error
*/
int
xmlAddEncodingAlias(const char *name, const char *alias) {
@ -457,15 +453,14 @@ xmlAddEncodingAlias(const char *name, const char *alias) {
}
/**
* xmlDelEncodingAlias:
* @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
* @param alias the alias name as parsed, in UTF-8 format (ASCII actually)
*
* DEPRECATED: This function modifies global state and is not
* @deprecated This function modifies global state and is not
* thread-safe. See xmlCtxtSetCharEncConvImpl for an alternative.
*
* Unregisters an encoding alias @alias
* Unregisters an encoding alias `alias`
*
* Returns 0 in case of success, -1 in case of error
* @returns 0 in case of success, -1 in case of error
*/
int
xmlDelEncodingAlias(const char *alias) {
@ -518,14 +513,13 @@ xmlParseCharEncodingInternal(const char *name)
}
/**
* xmlParseCharEncoding:
* @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
* @param name the encoding name as parsed, in UTF-8 format (ASCII actually)
*
* Compare the string to the encoding schemes already known. Note
* that the comparison is case insensitive accordingly to the section
* [XML] 4.3.3 Character Encoding in Entities.
*
* Returns one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE
* @returns one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE
* if not recognized.
*/
xmlCharEncoding
@ -541,14 +535,13 @@ xmlParseCharEncoding(const char *name)
}
/**
* xmlGetCharEncodingName:
* @enc: the encoding
* @param enc the encoding
*
* The "canonical" name for XML encoding.
* C.f. http://www.w3.org/TR/REC-xml#charencoding
* C.f. http://www.w3.org/TR/REC-xml\#charencoding
* Section 4.3.3 Character Encoding in Entities
*
* Returns the canonical name for the given encoding
* @returns the canonical name for the given encoding
*/
const char*
xmlGetCharEncodingName(xmlCharEncoding enc) {
@ -578,17 +571,16 @@ xmlGetCharEncodingName(xmlCharEncoding enc) {
************************************************************************/
/**
* xmlNewCharEncodingHandler:
* @name: the encoding name, in UTF-8 format (ASCII actually)
* @input: the xmlCharEncodingInputFunc to read that encoding
* @output: the xmlCharEncodingOutputFunc to write that encoding
* @param name the encoding name, in UTF-8 format (ASCII actually)
* @param input the xmlCharEncodingInputFunc to read that encoding
* @param output the xmlCharEncodingOutputFunc to write that encoding
*
* DEPRECATED: This function modifies global state and is not
* @deprecated This function modifies global state and is not
* thread-safe. See xmlCtxtSetCharEncConvImpl for an alternative.
*
* Create and registers an xmlCharEncodingHandler.
*
* Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
* @returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
*/
xmlCharEncodingHandlerPtr
xmlNewCharEncodingHandler(const char *name,
@ -644,18 +636,17 @@ xmlNewCharEncodingHandler(const char *name,
}
/**
* xmlCharEncNewCustomHandler:
* @name: the encoding name
* @input: input callback which converts to UTF-8
* @output: output callback which converts from UTF-8
* @ctxtDtor: context destructor
* @inputCtxt: context for input callback
* @outputCtxt: context for output callback
* @out: pointer to resulting handler
* @param name the encoding name
* @param input input callback which converts to UTF-8
* @param output output callback which converts from UTF-8
* @param ctxtDtor context destructor
* @param inputCtxt context for input callback
* @param outputCtxt context for output callback
* @param out pointer to resulting handler
*
* Create a custom xmlCharEncodingHandler.
*
* Returns an xmlParserErrors code.
* @returns an xmlParserErrors code.
*/
xmlParserErrors
xmlCharEncNewCustomHandler(const char *name,
@ -702,9 +693,8 @@ error:
}
/**
* xmlInitCharEncodingHandlers:
*
* DEPRECATED: Alias for xmlInitParser.
* @deprecated Alias for xmlInitParser.
*/
void
xmlInitCharEncodingHandlers(void) {
@ -712,7 +702,6 @@ xmlInitCharEncodingHandlers(void) {
}
/**
* xmlInitEncodingInternal:
*
* Initialize the char encoding support.
*/
@ -726,9 +715,8 @@ xmlInitEncodingInternal(void) {
}
/**
* xmlCleanupCharEncodingHandlers:
*
* DEPRECATED: This function will be made private. Call xmlCleanupParser
* @deprecated This function will be made private. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
@ -759,10 +747,9 @@ xmlCleanupCharEncodingHandlers(void) {
}
/**
* xmlRegisterCharEncodingHandler:
* @handler: the xmlCharEncodingHandlerPtr handler block
* @param handler the xmlCharEncodingHandlerPtr handler block
*
* DEPRECATED: This function modifies global state and is not
* @deprecated This function modifies global state and is not
* thread-safe. See xmlCtxtSetCharEncConvImpl for an alternative.
*
* Register the char encoding handler.
@ -793,17 +780,16 @@ free_handler:
}
/**
* xmlFindExtraHandler:
* @norig: name of the char encoding
* @name: potentially aliased name of the encoding
* @flags: bit mask of flags
* @impl: a conversion implementation (optional)
* @implCtxt: user data for conversion implementation (optional)
* @out: pointer to resulting handler
* @param norig name of the char encoding
* @param name potentially aliased name of the encoding
* @param flags bit mask of flags
* @param impl a conversion implementation (optional)
* @param implCtxt user data for conversion implementation (optional)
* @param out pointer to resulting handler
*
* Search the non-default handlers for an exact match.
*
* Returns an xmlParserErrors error code.
* @returns an xmlParserErrors error code.
*/
static xmlParserErrors
xmlFindExtraHandler(const char *norig, const char *name, xmlCharEncFlags flags,
@ -864,9 +850,8 @@ xmlFindExtraHandler(const char *norig, const char *name, xmlCharEncFlags flags,
}
/**
* xmlLookupCharEncodingHandler:
* @enc: an xmlCharEncoding value.
* @out: pointer to result
* @param enc an xmlCharEncoding value.
* @param out pointer to result
*
* Find or create a handler matching the encoding. The following
* converters are looked up in order:
@ -883,7 +868,7 @@ xmlFindExtraHandler(const char *norig, const char *name, xmlCharEncFlags flags,
*
* Available since 2.13.0.
*
* Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* @returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* xmlParserErrors error code.
*/
xmlParserErrors
@ -923,13 +908,12 @@ xmlLookupCharEncodingHandler(xmlCharEncoding enc,
}
/**
* xmlGetCharEncodingHandler:
* @enc: an xmlCharEncoding value.
* @param enc an xmlCharEncoding value.
*
* DEPRECATED: Use xmlLookupCharEncodingHandler which has better error
* @deprecated Use xmlLookupCharEncodingHandler which has better error
* reporting.
*
* Returns the handler or NULL if no handler was found or an error
* @returns the handler or NULL if no handler was found or an error
* occurred.
*/
xmlCharEncodingHandlerPtr
@ -941,12 +925,11 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) {
}
/**
* xmlCreateCharEncodingHandler:
* @name: a string describing the char encoding.
* @flags: bit mask of flags
* @impl: a conversion implementation (optional)
* @implCtxt: user data for conversion implementation (optional)
* @out: pointer to result
* @param name a string describing the char encoding.
* @param flags bit mask of flags
* @param impl a conversion implementation (optional)
* @param implCtxt user data for conversion implementation (optional)
* @param out pointer to result
*
* Find or create a handler matching the encoding. The following
* converters are looked up in order:
@ -962,11 +945,11 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) {
* If the encoding is UTF-8, a NULL handler and no error code will
* be returned.
*
* @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
* `flags` can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
*
* Available since 2.14.0.
*
* Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* @returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* xmlParserErrors error code.
*/
xmlParserErrors
@ -1008,10 +991,9 @@ xmlCreateCharEncodingHandler(const char *name, xmlCharEncFlags flags,
}
/**
* xmlOpenCharEncodingHandler:
* @name: a string describing the char encoding.
* @output: boolean, use handler for output
* @out: pointer to result
* @param name a string describing the char encoding.
* @param output boolean, use handler for output
* @param out pointer to result
*
* Find or create a handler matching the encoding. The following
* converters are looked up in order:
@ -1028,7 +1010,7 @@ xmlCreateCharEncodingHandler(const char *name, xmlCharEncFlags flags,
*
* Available since 2.13.0.
*
* Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* @returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
* xmlParserErrors error code.
*/
xmlParserErrors
@ -1040,16 +1022,15 @@ xmlOpenCharEncodingHandler(const char *name, int output,
}
/**
* xmlFindCharEncodingHandler:
* @name: a string describing the char encoding.
* @param name a string describing the char encoding.
*
* DEPRECATED: Use xmlOpenCharEncodingHandler which has better error
* @deprecated Use xmlOpenCharEncodingHandler which has better error
* reporting.
*
* If the encoding is UTF-8, this will return a no-op handler that
* shouldn't be used.
*
* Returns the handler or NULL if no handler was found or an error
* @returns the handler or NULL if no handler was found or an error
* occurred.
*/
xmlCharEncodingHandlerPtr
@ -1086,19 +1067,18 @@ typedef struct {
} xmlIconvCtxt;
/**
* xmlIconvConvert:
* @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
* @param vctxt conversion context
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of input bytes
* @param inlen the length of `in`
* @param flush end of input
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* as the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*
* Returns an XML_ENC_ERR code.
* @returns an XML_ENC_ERR code.
*/
static xmlCharEncError
xmlIconvConvert(void *vctxt, unsigned char *out, int *outlen,
@ -1320,19 +1300,18 @@ struct _uconv_t {
};
/**
* xmlUconvConvert:
* @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
* @param vctxt conversion context
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of input bytes
* @param inlen the length of `in`
* @param flush end of input
*
* Returns an XML_ENC_ERR code.
* @returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* as the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*/
static xmlCharEncError
xmlUconvConvert(void *vctxt, unsigned char *out, int *outlen,
@ -1515,8 +1494,7 @@ error:
************************************************************************/
/**
* xmlEncConvertError:
* @code: XML_ENC_ERR code
* @param code XML_ENC_ERR code
*
* Convert XML_ENC_ERR to libxml2 error codes.
*/
@ -1543,19 +1521,18 @@ xmlEncConvertError(xmlCharEncError code) {
}
/**
* xmlEncInputChunk:
* @handler: encoding handler
* @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
* @param handler encoding handler
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of input bytes
* @param inlen the length of `in`
* @param flush end of input
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* as the return value is 0, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*
* Returns an XML_ENC_ERR code.
* @returns an XML_ENC_ERR code.
*/
xmlCharEncError
xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
@ -1600,18 +1577,17 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
}
/**
* xmlEncOutputChunk:
* @handler: encoding handler
* @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
* @param handler encoding handler
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of input bytes
* @param inlen the length of `in`
*
* Returns an XML_ENC_ERR code.
* @returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* as the return value is 0, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*/
static xmlCharEncError
xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
@ -1647,14 +1623,13 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
}
/**
* xmlCharEncFirstLine:
* @handler: char encoding transformation data structure
* @out: an xmlBuffer for the output.
* @in: an xmlBuffer for the input
* @param handler char encoding transformation data structure
* @param out an xmlBuffer for the output.
* @param in an xmlBuffer for the input
*
* DEPERECATED: Don't use.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
@ -1663,17 +1638,16 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
}
/**
* xmlCharEncInput:
* @input: a parser input buffer
* @sizeOut: pointer to output size
* @flush: end of input
* @param input a parser input buffer
* @param sizeOut pointer to output size
* @param flush end of input
*
* @sizeOut should be set to the maximum output size (or SIZE_MAX).
* `sizeOut` should be set to the maximum output size (or SIZE_MAX).
* After return, it is set to the number of bytes written.
*
* Generic front-end for the encoding handler on parser input
*
* Returns an XML_ENC_ERR code.
* @returns an XML_ENC_ERR code.
*/
xmlCharEncError
xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush)
@ -1767,14 +1741,13 @@ xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush)
}
/**
* xmlCharEncInFunc:
* @handler: char encoding transformation data structure
* @out: an xmlBuffer for the output.
* @in: an xmlBuffer for the input
* @param handler char encoding transformation data structure
* @param out an xmlBuffer for the output.
* @param in an xmlBuffer for the input
*
* Generic front-end for the encoding handler input function
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
@ -1810,18 +1783,17 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCharEncOutput:
* @output: a parser output buffer
* @init: is this an initialization call without data
* @param output a parser output buffer
* @param init is this an initialization call without data
*
* Generic front-end for the encoding handler on parser output
* a first call with @init == 1 has to be made first to initiate the
* a first call with `init` == 1 has to be made first to initiate the
* output in case of non-stateless encoding needing to initiate their
* state or the output (like the BOM in UTF16).
* In case of UTF8 sequence conversion errors for the given encoder,
* the content will be automatically remapped to a CharRef sequence.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncOutput(xmlOutputBufferPtr output, int init)
@ -1933,19 +1905,18 @@ error:
#endif
/**
* xmlCharEncOutFunc:
* @handler: char encoding transformation data structure
* @out: an xmlBuffer for the output.
* @in: an xmlBuffer for the input
* @param handler char encoding transformation data structure
* @param out an xmlBuffer for the output.
* @param in an xmlBuffer for the input
*
* Generic front-end for the encoding handler output function
* a first call with @in == NULL has to be made firs to initiate the
* a first call with `in` == NULL has to be made firs to initiate the
* output in case of non-stateless encoding needing to initiate their
* state or the output (like the BOM in UTF16).
* In case of UTF8 sequence conversion errors for the given encoder,
* the content will be automatically remapped to a CharRef sequence.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
@ -2033,13 +2004,12 @@ retry:
}
/**
* xmlCharEncCloseFunc:
* @handler: char encoding transformation data structure
* @param handler char encoding transformation data structure
*
* Releases an xmlCharEncodingHandler. Must be called after
* a handler is no longer in use.
*
* Returns 0.
* @returns 0.
*/
int
xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
@ -2059,10 +2029,9 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
}
/**
* xmlByteConsumed:
* @ctxt: an XML parser context
* @param ctxt an XML parser context
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* This function provides the current index of the parser relative
* to the start of the current entity. This function is computed in
@ -2071,7 +2040,7 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
* of constant cost if the input is UTF-8 but can be costly if run
* on non-UTF-8 input.
*
* Returns the index in bytes from the beginning of the entity or -1
* @returns the index in bytes from the beginning of the entity or -1
* in case the index could not be computed.
*/
long
@ -2214,20 +2183,19 @@ done:
}
/**
* xmlIsolat1ToUTF8:
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of ISO Latin 1 chars
* @inlen: the length of @in
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of ISO Latin 1 chars
* @param inlen the length of `in`
*
* Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8
* block of chars out.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*/
int
xmlIsolat1ToUTF8(unsigned char* out, int *outlen,
@ -2320,20 +2288,19 @@ done:
}
/**
* xmlUTF8ToIsolat1:
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of UTF-8 chars
* @inlen: the length of @in
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of UTF-8 chars
* @param inlen the length of `in`
*
* Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1
* block of chars out.
*
* Returns the number of bytes written or an XML_ENC_ERR code.
* @returns the number of bytes written or an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* The value of `inlen` after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
* The value of `outlen` after return is the number of octets produced.
*/
int
xmlUTF8ToIsolat1(unsigned char* out, int *outlen,

View File

@ -74,8 +74,7 @@ static xmlEntity xmlEntityApos = {
};
/*
* xmlFreeEntity:
* @entity: an entity
* @param entity an entity
*
* Frees the entity.
*/
@ -111,7 +110,6 @@ xmlFreeEntity(xmlEntityPtr entity)
}
/*
* xmlCreateEntity:
*
* internal routine doing the entity node structures allocations
*/
@ -169,21 +167,20 @@ error:
}
/**
* xmlAddEntity:
* @doc: the document
* @extSubset: add to the external or internal subset
* @name: the entity name
* @type: the entity type XML_xxx_yyy_ENTITY
* @ExternalID: the entity external ID if available
* @SystemID: the entity system ID if available
* @content: the entity content
* @out: pointer to resulting entity (optional)
* @param doc the document
* @param extSubset add to the external or internal subset
* @param name the entity name
* @param type the entity type XML_xxx_yyy_ENTITY
* @param ExternalID the entity external ID if available
* @param SystemID the entity system ID if available
* @param content the entity content
* @param out pointer to resulting entity (optional)
*
* Register a new entity for this document.
*
* Available since 2.13.0.
*
* Returns an xmlParserErrors error code.
* @returns an xmlParserErrors error code.
*/
int
xmlAddEntity(xmlDocPtr doc, int extSubset, const xmlChar *name, int type,
@ -300,12 +297,11 @@ xmlAddEntity(xmlDocPtr doc, int extSubset, const xmlChar *name, int type,
}
/**
* xmlGetPredefinedEntity:
* @name: the entity name
* @param name the entity name
*
* Check whether this name is an predefined entity.
*
* Returns NULL if not, otherwise the entity
* @returns NULL if not, otherwise the entity
*/
xmlEntityPtr
xmlGetPredefinedEntity(const xmlChar *name) {
@ -336,17 +332,16 @@ xmlGetPredefinedEntity(const xmlChar *name) {
}
/**
* xmlAddDtdEntity:
* @doc: the document
* @name: the entity name
* @type: the entity type XML_xxx_yyy_ENTITY
* @ExternalID: the entity external ID if available
* @SystemID: the entity system ID if available
* @content: the entity content
* @param doc the document
* @param name the entity name
* @param type the entity type XML_xxx_yyy_ENTITY
* @param ExternalID the entity external ID if available
* @param SystemID the entity system ID if available
* @param content the entity content
*
* Register a new entity for this document DTD external subset.
*
* Returns a pointer to the entity or NULL in case of error
* @returns a pointer to the entity or NULL in case of error
*/
xmlEntityPtr
xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type,
@ -359,17 +354,16 @@ xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type,
}
/**
* xmlAddDocEntity:
* @doc: the document
* @name: the entity name
* @type: the entity type XML_xxx_yyy_ENTITY
* @ExternalID: the entity external ID if available
* @SystemID: the entity system ID if available
* @content: the entity content
* @param doc the document
* @param name the entity name
* @param type the entity type XML_xxx_yyy_ENTITY
* @param ExternalID the entity external ID if available
* @param SystemID the entity system ID if available
* @param content the entity content
*
* Register a new entity for this document.
*
* Returns a pointer to the entity or NULL in case of error
* @returns a pointer to the entity or NULL in case of error
*/
xmlEntityPtr
xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
@ -382,13 +376,12 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
}
/**
* xmlNewEntity:
* @doc: the document
* @name: the entity name
* @type: the entity type XML_xxx_yyy_ENTITY
* @ExternalID: the entity external ID if available
* @SystemID: the entity system ID if available
* @content: the entity content
* @param doc the document
* @param name the entity name
* @param type the entity type XML_xxx_yyy_ENTITY
* @param ExternalID the entity external ID if available
* @param SystemID the entity system ID if available
* @param content the entity content
*
* Create a new entity, this differs from xmlAddDocEntity() that if
* the document is NULL or has no internal subset defined, then an
@ -396,7 +389,7 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
* of the caller to link it to the document later or free it when not needed
* anymore.
*
* Returns a pointer to the entity or NULL in case of error
* @returns a pointer to the entity or NULL in case of error
*/
xmlEntityPtr
xmlNewEntity(xmlDocPtr doc, const xmlChar *name, int type,
@ -411,14 +404,13 @@ xmlNewEntity(xmlDocPtr doc, const xmlChar *name, int type,
}
/**
* xmlGetEntityFromTable:
* @table: an entity table
* @name: the entity name
* @param table an entity table
* @param name the entity name
*
* Do an entity lookup in the table.
* returns the corresponding parameter entity, if found.
* @returns the corresponding parameter entity, if found.
*
* Returns A pointer to the entity structure or NULL if not found.
* @returns A pointer to the entity structure or NULL if not found.
*/
static xmlEntityPtr
xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
@ -426,14 +418,13 @@ xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
}
/**
* xmlGetParameterEntity:
* @doc: the document referencing the entity
* @name: the entity name
* @param doc the document referencing the entity
* @param name the entity name
*
* Do an entity lookup in the internal and external subsets and
* returns the corresponding parameter entity, if found.
* @returns the corresponding parameter entity, if found.
*
* Returns A pointer to the entity structure or NULL if not found.
* @returns A pointer to the entity structure or NULL if not found.
*/
xmlEntityPtr
xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) {
@ -456,15 +447,14 @@ xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) {
}
/**
* xmlGetDtdEntity:
* @doc: the document referencing the entity
* @name: the entity name
* @param doc the document referencing the entity
* @param name the entity name
*
* Do an entity lookup in the DTD entity hash table and
* returns the corresponding entity, if found.
* @returns the corresponding entity, if found.
* Note: the first argument is the document node, not the DTD node.
*
* Returns A pointer to the entity structure or NULL if not found.
* @returns A pointer to the entity structure or NULL if not found.
*/
xmlEntityPtr
xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) {
@ -480,15 +470,14 @@ xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) {
}
/**
* xmlGetDocEntity:
* @doc: the document referencing the entity
* @name: the entity name
* @param doc the document referencing the entity
* @param name the entity name
*
* Do an entity lookup in the document entity hash table and
* returns the corresponding entity, otherwise a lookup is done
* @returns the corresponding entity, otherwise a lookup is done
* in the predefined entities too.
*
* Returns A pointer to the entity structure or NULL if not found.
* @returns A pointer to the entity structure or NULL if not found.
*/
xmlEntityPtr
xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
@ -516,15 +505,14 @@ xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
}
/*
* xmlSerializeHexCharRef:
* @buf: a char buffer
* @val: a codepoint
* @param buf a char buffer
* @param val a codepoint
*
* Serializes a hex char ref like &#xA0;
* Serializes a hex char ref like &\#xA0;
*
* Writes at most 9 bytes. Does not include a terminating zero byte.
*
* Returns the number of bytes written.
* @returns the number of bytes written.
*/
int
xmlSerializeHexCharRef(char *buf, int val) {
@ -564,15 +552,14 @@ xmlSerializeHexCharRef(char *buf, int val) {
}
/*
* xmlSerializeDecCharRef:
* @buf: a char buffer
* @val: a codepoint
* @param buf a char buffer
* @param val a codepoint
*
* Serializes a decimal char ref like &#38;
* Serializes a decimal char ref like &\#38;
*
* Writes at most 10 bytes. Does not include a terminating zero byte.
*
* Returns the number of bytes written.
* @returns the number of bytes written.
*/
int
xmlSerializeDecCharRef(char *buf, int val) {
@ -614,9 +601,8 @@ static const char xmlEscapeSafe[128] = {
};
/*
* xmlEscapeText:
* @text: input text
* @flags: XML_ESCAPE flags
* @param text input text
* @param flags XML_ESCAPE flags
*
* Escapes certain characters with char refs.
*
@ -626,7 +612,7 @@ static const char xmlEscapeSafe[128] = {
* XML_ESCAPE_QUOT: escape double quotes.
* XML_ESCAPE_ALLOW_INVALID: allow invalid characters.
*
* Returns an escaped string or NULL if a memory allocation failed.
* @returns an escaped string or NULL if a memory allocation failed.
*/
xmlChar *
xmlEscapeText(const xmlChar *text, int flags) {
@ -783,17 +769,16 @@ xmlEscapeText(const xmlChar *text, int flags) {
}
/**
* xmlEncodeEntitiesInternal:
* @doc: the document containing the string
* @input: A string to convert to XML.
* @flags: XML_ESCAPE flags
* @param doc the document containing the string
* @param input A string to convert to XML.
* @param flags XML_ESCAPE flags
*
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts.
* Contrary to xmlEncodeEntities, this routine is reentrant, and result
* must be deallocated.
*
* Returns A newly allocated string with the substitution done.
* @returns A newly allocated string with the substitution done.
*/
xmlChar *
xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input,
@ -810,9 +795,8 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input,
}
/**
* xmlEncodeEntitiesReentrant:
* @doc: the document containing the string
* @input: A string to convert to XML.
* @param doc the document containing the string
* @param input A string to convert to XML.
*
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts.
@ -823,7 +807,7 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input,
* non-ASCII codepoints are escaped. There is some special handling for
* HTML documents.
*
* Returns A newly allocated string with the substitution done.
* @returns A newly allocated string with the substitution done.
*/
xmlChar *
xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
@ -831,16 +815,15 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
}
/**
* xmlEncodeSpecialChars:
* @doc: unused
* @input: A string to convert to XML.
* @param doc unused
* @param input A string to convert to XML.
*
* Do a global encoding of a string, replacing the predefined entities
* this routine is reentrant, and result must be deallocated.
*
* This escapes `<`, `>`, `&`, `"` and `\r` chars.
*
* Returns A newly allocated string with the substitution done.
* @returns A newly allocated string with the substitution done.
*/
xmlChar *
xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED,
@ -852,12 +835,11 @@ xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED,
}
/**
* xmlCreateEntitiesTable:
*
* create and initialize an empty entities hash table.
* This really doesn't make sense and should be deprecated
*
* Returns the xmlEntitiesTablePtr just created or NULL in case of error.
* @returns the xmlEntitiesTablePtr just created or NULL in case of error.
*/
xmlEntitiesTablePtr
xmlCreateEntitiesTable(void) {
@ -865,9 +847,8 @@ xmlCreateEntitiesTable(void) {
}
/**
* xmlFreeEntityWrapper:
* @entity: An entity
* @name: its name
* @param entity An entity
* @param name its name
*
* Deallocate the memory used by an entities in the hash table.
*/
@ -878,8 +859,7 @@ xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
}
/**
* xmlFreeEntitiesTable:
* @table: An entity table
* @param table An entity table
*
* Deallocate the memory used by an entities hash table.
*/
@ -889,13 +869,12 @@ xmlFreeEntitiesTable(xmlEntitiesTablePtr table) {
}
/**
* xmlCopyEntity:
* @payload: An entity
* @name: unused
* @param payload An entity
* @param name unused
*
* Build a copy of an entity
*
* Returns the new xmlEntitiesPtr or NULL in case of error.
* @returns the new xmlEntitiesPtr or NULL in case of error.
*/
static void *
xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
@ -947,12 +926,11 @@ error:
}
/**
* xmlCopyEntitiesTable:
* @table: An entity table
* @param table An entity table
*
* Build a copy of an entity table.
*
* Returns the new xmlEntitiesTablePtr or NULL in case of error.
* @returns the new xmlEntitiesTablePtr or NULL in case of error.
*/
xmlEntitiesTablePtr
xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
@ -962,9 +940,8 @@ xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpEntityDecl:
* @buf: An XML buffer.
* @ent: An entity table
* @param buf An XML buffer.
* @param ent An entity table
*
* This will dump the content of the entity table as an XML DTD definition
*/
@ -982,10 +959,9 @@ xmlDumpEntityDecl(xmlBufferPtr buf, xmlEntityPtr ent) {
}
/**
* xmlDumpEntityDeclScan:
* @ent: an entity table
* @save: a save context
* @name: unused
* @param ent an entity table
* @param save a save context
* @param name unused
*
* When using the hash table scan function, arguments need to be reversed
*/
@ -996,9 +972,8 @@ xmlDumpEntityDeclScan(void *ent, void *save,
}
/**
* xmlDumpEntitiesTable:
* @buf: An XML buffer.
* @table: An entity table
* @param buf An XML buffer.
* @param table An entity table
*
* This will dump the content of the entity table as an XML DTD definition
*/

183
error.c
View File

@ -21,11 +21,10 @@
#include "private/string.h"
/**
* xmlIsCatastrophicError:
* @level: error level
* @code: error code
* @param level error level
* @param code error code
*
* Returns true if an error is catastrophic.
* @returns true if an error is catastrophic.
*/
int
xmlIsCatastrophicError(int level, int code) {
@ -215,9 +214,8 @@ xmlVUpdateError(xmlError *err,
************************************************************************/
/**
* xmlGenericErrorDefaultFunc:
* @ctx: an error context
* @msg: the message to display/transmit
* @param ctx an error context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Default handler for out of context error messages.
@ -235,11 +233,10 @@ xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
}
/**
* xmlSetGenericErrorFunc:
* @ctx: the new error handling context
* @handler: the new handler function
* @param ctx the new error handling context
* @param handler the new handler function
*
* DEPRECATED: See xmlSetStructuredErrorFunc for alternatives.
* @deprecated See xmlSetStructuredErrorFunc for alternatives.
*
* Set the global "generic" handler and context for error messages.
* The generic error handler will only receive fragments of error
@ -265,11 +262,10 @@ xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
}
/**
* xmlSetStructuredErrorFunc:
* @ctx: the new error handling context
* @handler: the new handler function
* @param ctx the new error handling context
* @param handler the new handler function
*
* DEPRECATED: Use a per-context error handler.
* @deprecated Use a per-context error handler.
*
* It's recommended to use the per-context error handlers instead:
*
@ -307,10 +303,9 @@ xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
************************************************************************/
/**
* xmlParserPrintFileInfo:
* @input: an xmlParserInputPtr input
* @param input an xmlParserInputPtr input
*
* DEPRECATED: Use xmlFormatError.
* @deprecated Use xmlFormatError.
*
* Displays the associated file and line information for the current input
*/
@ -329,10 +324,9 @@ xmlParserPrintFileInfo(xmlParserInputPtr input) {
}
/**
* xmlParserPrintFileContextInternal:
* @input: an xmlParserInputPtr input
* @channel: output callback
* @data: user data for output callback
* @param input an xmlParserInputPtr input
* @param channel output callback
* @param data user data for output callback
*
* Displays current context within the input content for error tracking
*/
@ -402,10 +396,9 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
}
/**
* xmlParserPrintFileContext:
* @input: an xmlParserInputPtr input
* @param input an xmlParserInputPtr input
*
* DEPRECATED: Use xmlFormatError.
* @deprecated Use xmlFormatError.
*
* Displays current context within the input content for error tracking
*/
@ -416,10 +409,9 @@ xmlParserPrintFileContext(xmlParserInputPtr input) {
}
/**
* xmlFormatError:
* @err: the error
* @channel: callback
* @data: user data for callback
* @param err the error
* @param channel callback
* @param data user data for callback
*
* Report a formatted error to a printf-like callback.
*
@ -634,12 +626,11 @@ xmlFormatError(const xmlError *err, xmlGenericErrorFunc channel, void *data)
}
/**
* xmlRaiseMemoryError:
* @schannel: the structured callback channel
* @channel: the old callback channel
* @data: the callback data
* @domain: the domain for the error
* @error: optional error struct to be filled
* @param schannel the structured callback channel
* @param channel the old callback channel
* @param data the callback data
* @param domain the domain for the error
* @param error optional error struct to be filled
*
* Update the global and optional error structure, then forward the
* error to an error handler.
@ -675,30 +666,29 @@ xmlRaiseMemoryError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel
}
/**
* xmlVRaiseError:
* @schannel: the structured callback channel
* @channel: the old callback channel
* @data: the callback data
* @ctx: the parser context or NULL
* @node: the current node or NULL
* @domain: the domain for the error
* @code: the code for the error
* @level: the xmlErrorLevel for the error
* @file: the file source of the error (or NULL)
* @line: the line of the error or 0 if N/A
* @str1: extra string info
* @str2: extra string info
* @str3: extra string info
* @int1: extra int info
* @col: column number of the error or 0 if N/A
* @msg: the message to display/transmit
* @ap: extra parameters for the message display
* @param schannel the structured callback channel
* @param channel the old callback channel
* @param data the callback data
* @param ctx the parser context or NULL
* @param node the current node or NULL
* @param domain the domain for the error
* @param code the code for the error
* @param level the xmlErrorLevel for the error
* @param file the file source of the error (or NULL)
* @param line the line of the error or 0 if N/A
* @param str1 extra string info
* @param str2 extra string info
* @param str3 extra string info
* @param int1 extra int info
* @param col column number of the error or 0 if N/A
* @param msg the message to display/transmit
* @param ap extra parameters for the message display
*
* Update the appropriate global or contextual error structure,
* then forward the error message down the parser or generic
* error callback handler
*
* Returns 0 on success, -1 if a memory allocation failed.
* @returns 0 on success, -1 if a memory allocation failed.
*/
int
xmlVRaiseError(xmlStructuredErrorFunc schannel,
@ -760,30 +750,29 @@ xmlVRaiseError(xmlStructuredErrorFunc schannel,
}
/**
* xmlRaiseError:
* @schannel: the structured callback channel
* @channel: the old callback channel
* @data: the callback data
* @ctx: the parser context or NULL
* @node: the node or NULL
* @domain: the domain for the error
* @code: the code for the error
* @level: the xmlErrorLevel for the error
* @file: the file source of the error (or NULL)
* @line: the line of the error or 0 if N/A
* @str1: extra string info
* @str2: extra string info
* @str3: extra string info
* @int1: extra int info
* @col: column number of the error or 0 if N/A
* @msg: the message to display/transmit
* @param schannel the structured callback channel
* @param channel the old callback channel
* @param data the callback data
* @param ctx the parser context or NULL
* @param node the node or NULL
* @param domain the domain for the error
* @param code the code for the error
* @param level the xmlErrorLevel for the error
* @param file the file source of the error (or NULL)
* @param line the line of the error or 0 if N/A
* @param str1 extra string info
* @param str2 extra string info
* @param str3 extra string info
* @param int1 extra int info
* @param col column number of the error or 0 if N/A
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Update the appropriate global or contextual error structure,
* then forward the error message down the parser or generic
* error callback handler
*
* Returns 0 on success, -1 if a memory allocation failed.
* @returns 0 on success, -1 if a memory allocation failed.
*/
int
xmlRaiseError(xmlStructuredErrorFunc schannel,
@ -842,9 +831,8 @@ xmlVFormatLegacyError(void *ctx, const char *level,
}
/**
* xmlParserError:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format an error messages, gives file, line, position and
@ -861,9 +849,8 @@ xmlParserError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
}
/**
* xmlParserWarning:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, gives file, line, position and
@ -880,9 +867,8 @@ xmlParserWarning(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
}
/**
* xmlParserValidityError:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format an validity error messages, gives file,
@ -899,9 +885,8 @@ xmlParserValidityError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
}
/**
* xmlParserValidityWarning:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a validity warning messages, gives file, line,
@ -925,12 +910,11 @@ xmlParserValidityWarning(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
************************************************************************/
/**
* xmlGetLastError:
*
* Get the last global error registered. This is per thread if compiled
* with thread support.
*
* Returns a pointer to the error
* @returns a pointer to the error
*/
const xmlError *
xmlGetLastError(void)
@ -943,8 +927,7 @@ xmlGetLastError(void)
}
/**
* xmlResetError:
* @err: pointer to the error.
* @param err pointer to the error.
*
* Cleanup the error.
*/
@ -970,7 +953,6 @@ xmlResetError(xmlErrorPtr err)
}
/**
* xmlResetLastError:
*
* Cleanup the last global error registered. For parsing error
* this does not change the well-formedness result.
@ -985,13 +967,12 @@ xmlResetLastError(void)
}
/**
* xmlCopyError:
* @from: a source error
* @to: a target error
* @param from a source error
* @param to a target error
*
* Save the original error to the new place.
*
* Returns 0 in case of success and -1 in case of error.
* @returns 0 in case of success and -1 in case of error.
*/
int
xmlCopyError(const xmlError *from, xmlErrorPtr to) {
@ -1012,10 +993,9 @@ xmlCopyError(const xmlError *from, xmlErrorPtr to) {
}
/**
* xmlErrString:
* @code: an xmlParserErrors code
* @param code an xmlParserErrors code
*
* Returns an error message for a code.
* @returns an error message for a code.
*/
const char *
xmlErrString(xmlParserErrors code) {
@ -1345,9 +1325,8 @@ xmlErrString(xmlParserErrors code) {
}
/**
* xmlVPrintErrorMessage:
* @fmt: printf format string
* @ap: arguments
* @param fmt printf format string
* @param ap arguments
*
* Prints to stderr.
*/
@ -1357,8 +1336,7 @@ xmlVPrintErrorMessage(const char *fmt, va_list ap) {
}
/**
* xmlPrintErrorMessage:
* @fmt: printf format string
* @param fmt printf format string
* @...: arguments
*
* Prints to stderr.
@ -1373,8 +1351,7 @@ xmlPrintErrorMessage(const char *fmt, ...) {
}
/**
* xmlAbort:
* @fmt: printf format string
* @param fmt printf format string
* @...: arguments
*
* Print message to stderr and abort.

View File

@ -43,7 +43,7 @@ static xmlMutex xmlThrDefMutex;
* thread-local storage:
*
* xmlError *__xmlLastError(void);
* #define xmlError (*__xmlLastError());
* \#define xmlError (*__xmlLastError());
*
* The code can operate in a multitude of ways depending on the environment.
* First we support POSIX and Windows threads. Then we support both
@ -190,61 +190,56 @@ static xmlGlobalState globalState;
*/
/**
* xmlFree:
* @mem: an already allocated block of memory
* @param mem an already allocated block of memory
*
* The variable holding the libxml free() implementation
*/
xmlFreeFunc xmlFree = free;
/**
* xmlMalloc:
* @size: the size requested in bytes
* @param size the size requested in bytes
*
* The variable holding the libxml malloc() implementation
*
* Returns a pointer to the newly allocated block or NULL in case of error
* @returns a pointer to the newly allocated block or NULL in case of error
*/
xmlMallocFunc xmlMalloc = malloc;
/**
* xmlMallocAtomic:
* @size: the size requested in bytes
* @param size the size requested in bytes
*
* The variable holding the libxml malloc() implementation for atomic
* data (i.e. blocks not containing pointers), useful when using a
* garbage collecting allocator.
*
* Returns a pointer to the newly allocated block or NULL in case of error
* @returns a pointer to the newly allocated block or NULL in case of error
*/
xmlMallocFunc xmlMallocAtomic = malloc;
/**
* xmlRealloc:
* @mem: an already allocated block of memory
* @size: the new size requested in bytes
* @param mem an already allocated block of memory
* @param size the new size requested in bytes
*
* The variable holding the libxml realloc() implementation
*
* Returns a pointer to the newly reallocated block or NULL in case of error
* @returns a pointer to the newly reallocated block or NULL in case of error
*/
xmlReallocFunc xmlRealloc = realloc;
/**
* xmlPosixStrdup
* @cur: the input char *
* @param cur the input char *
*
* a strdup implementation with a type signature matching POSIX
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
static char *
xmlPosixStrdup(const char *cur) {
return((char*) xmlCharStrdup(cur));
}
/**
* xmlMemStrdup:
* @str: a zero terminated string
* @param str a zero terminated string
*
* The variable holding the libxml strdup() implementation
*
* Returns the copy of the string or NULL in case of error
* @returns the copy of the string or NULL in case of error
*/
xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup;
@ -281,9 +276,8 @@ static int xmlSaveNoEmptyTagsThrDef = 0;
#ifdef LIBXML_SAX1_ENABLED
/**
* xmlDefaultSAXHandler:
*
* DEPRECATED: This handler is unused and will be removed from future
* @deprecated This handler is unused and will be removed from future
* versions.
*
* Default SAX version1 handler for XML, builds the DOM tree
@ -321,9 +315,8 @@ const xmlSAXHandlerV1 xmlDefaultSAXHandler = {
#endif /* LIBXML_SAX1_ENABLED */
/**
* xmlDefaultSAXLocator:
*
* DEPRECATED: Don't use
* @deprecated Don't use
*
* The default SAX Locator
* { getPublicId, getSystemId, getLineNumber, getColumnNumber}
@ -337,9 +330,8 @@ const xmlSAXLocator xmlDefaultSAXLocator = {
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_ENABLED)
/**
* htmlDefaultSAXHandler:
*
* DEPRECATED: This handler is unused and will be removed from future
* @deprecated This handler is unused and will be removed from future
* versions.
*
* Default old SAX v1 handler for HTML, builds the DOM tree
@ -386,16 +378,14 @@ xmlInitGlobalState(xmlGlobalStatePtr gs);
************************************************************************/
/**
* xmlInitGlobals:
*
* DEPRECATED: Alias for xmlInitParser.
* @deprecated Alias for xmlInitParser.
*/
void xmlInitGlobals(void) {
xmlInitParser();
}
/**
* xmlInitGlobalsInternal:
*
* Additional initialisation for multi-threading
*/
@ -415,9 +405,8 @@ void xmlInitGlobalsInternal(void) {
}
/**
* xmlCleanupGlobals:
*
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
* @deprecated This function is a no-op. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
@ -426,7 +415,6 @@ void xmlCleanupGlobals(void) {
}
/**
* xmlCleanupGlobalsInternal:
*
* Additional cleanup for multi-threading
*/
@ -513,13 +501,12 @@ xmlRegisterGlobalStateDtor(xmlGlobalState *gs) {
#ifndef USE_TLS
/**
* xmlNewGlobalState:
*
* xmlNewGlobalState() allocates a global state. This structure is used to
* hold all data for use by a thread when supporting backwards compatibility
* of libxml2 to pre-thread-safe behaviour.
*
* Returns the newly allocated xmlGlobalStatePtr or NULL in case of error
* @returns the newly allocated xmlGlobalStatePtr or NULL in case of error
*/
static xmlGlobalStatePtr
xmlNewGlobalState(int allowFailure)
@ -779,9 +766,8 @@ __xmlMemStrdup(void) {
#endif /* LIBXML_THREAD_ALLOC_ENABLED */
/**
* xmlGetLocalRngState:
*
* Returns the local RNG state.
* @returns the local RNG state.
*/
unsigned *
xmlGetLocalRngState(void) {
@ -789,7 +775,6 @@ xmlGetLocalRngState(void) {
}
/**
* xmlCheckThreadLocalStorage:
*
* Check whether thread-local storage could be allocated.
*
@ -798,7 +783,7 @@ xmlGetLocalRngState(void) {
* library functions to make sure that thread-local storage was
* allocated properly.
*
* Returns 0 on success or -1 if a memory allocation failed. A failed
* @returns 0 on success or -1 if a memory allocation failed. A failed
* allocation signals a typically fatal and irrecoverable out-of-memory
* situation. Don't call any library functions in this case.
*
@ -814,27 +799,26 @@ xmlCheckThreadLocalStorage(void) {
}
/**
* xmlGetLastErrorInternal:
*
* Returns a pointer to the global error struct.
* @returns a pointer to the global error struct.
*/
xmlError *
xmlGetLastErrorInternal(void) {
return(&xmlGetThreadLocalStorage(0)->lastError);
}
/** DOC_DISABLE */
/** @cond IGNORE */
/**
* DllMain:
* @hinstDLL: handle to DLL instance
* @fdwReason: Reason code for entry
* @lpvReserved: generic pointer (depends upon reason code)
* @param hinstDLL handle to DLL instance
* @param fdwReason Reason code for entry
* @param lpvReserved generic pointer (depends upon reason code)
*
* Entry point for Windows library. It is being used to free thread-specific
* storage.
*
* Returns TRUE always
* @returns TRUE always
*/
#ifdef USE_DLL_MAIN
#if defined(LIBXML_STATIC_FOR_DLL)
@ -1065,5 +1049,5 @@ xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
return(old);
}
/** DOC_ENABLE */
/** @endcond */

361
hash.c
View File

@ -148,13 +148,12 @@ xmlHashQNameValue(unsigned seed,
}
/**
* xmlHashCreate:
* @size: initial size of the hash table
* @param size initial size of the hash table
*
* Create a new hash table. Set size to zero if the number of entries
* can't be estimated.
*
* Returns the newly created object, or NULL if a memory allocation failed.
* @returns the newly created object, or NULL if a memory allocation failed.
*/
xmlHashTablePtr
xmlHashCreate(int size) {
@ -195,15 +194,14 @@ xmlHashCreate(int size) {
}
/**
* xmlHashCreateDict:
* @size: the size of the hash table
* @dict: a dictionary to use for the hash
* @param size the size of the hash table
* @param dict a dictionary to use for the hash
*
* Create a new hash table backed by a dictionary. This can reduce
* resource usage considerably if most keys passed to API functions
* originate from this dictionary.
*
* Returns the newly created object, or NULL if a memory allocation failed.
* @returns the newly created object, or NULL if a memory allocation failed.
*/
xmlHashTablePtr
xmlHashCreateDict(int size, xmlDictPtr dict) {
@ -218,12 +216,11 @@ xmlHashCreateDict(int size, xmlDictPtr dict) {
}
/**
* xmlHashFree:
* @hash: hash table
* @dealloc: deallocator function or NULL
* @param hash hash table
* @param dealloc deallocator function or NULL
*
* Free the hash and its contents. The payload is deallocated with
* @dealloc if provided.
* `dealloc` if provided.
*/
void
xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc) {
@ -259,9 +256,8 @@ xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc) {
}
/**
* xmlFastStrEqual:
* @s1: string
* @s2: string
* @param s1 string
* @param s2 string
*
* Compare two strings for equality, allowing NULL values.
*/
@ -275,16 +271,15 @@ xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
}
/**
* xmlHashFindEntry:
* @hash: hash table, non-NULL, size > 0
* @key: first string key, non-NULL
* @key2: second string key
* @key3: third string key
* @hashValue: valid hash value of keys
* @pfound: result of search
* @param hash hash table, non-NULL, size > 0
* @param key first string key, non-NULL
* @param key2 second string key
* @param key3 third string key
* @param hashValue valid hash value of keys
* @param pfound result of search
*
* Try to find a matching hash table entry. If an entry was found, set
* @found to 1 and return the entry. Otherwise, set @found to 0 and return
* `found` to 1 and return the entry. Otherwise, set `found` to 0 and return
* the location where a new entry should be inserted.
*/
ATTRIBUTE_NO_SANITIZE_INTEGER
@ -342,13 +337,12 @@ xmlHashFindEntry(const xmlHashTable *hash, const xmlChar *key,
}
/**
* xmlHashGrow:
* @hash: hash table
* @size: new size of the hash table
* @param hash hash table
* @param size new size of the hash table
*
* Resize the hash table.
*
* Returns 0 in case of success, -1 if a memory allocation failed.
* @returns 0 in case of success, -1 if a memory allocation failed.
*/
static int
xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
@ -409,14 +403,13 @@ done:
}
/**
* xmlHashUpdateInternal:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @payload: pointer to the payload
* @dealloc: deallocator function for replaced item or NULL
* @update: whether existing entries should be updated
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
* @param payload pointer to the payload
* @param dealloc deallocator function for replaced item or NULL
* @param update whether existing entries should be updated
*
* Internal function to add or update hash entries.
*/
@ -593,9 +586,8 @@ xmlHashUpdateInternal(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashDefaultDeallocator:
* @entry: hash table entry
* @key: the entry's string key
* @param entry hash table entry
* @param key the entry's string key
*
* Free a hash table entry with xmlFree.
*/
@ -605,10 +597,9 @@ xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
}
/**
* xmlHashAdd:
* @hash: hash table
* @key: string key
* @payload: pointer to the payload
* @param hash hash table
* @param key string key
* @param payload pointer to the payload
*
* Add a hash table entry. If an entry with this key already exists,
* payload will not be updated and 0 is returned. This return value
@ -617,7 +608,7 @@ xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
*
* Available since 2.13.0.
*
* Returns 1 on success, 0 if an entry exists and -1 in case of error.
* @returns 1 on success, 0 if an entry exists and -1 in case of error.
*/
int
xmlHashAdd(xmlHashTablePtr hash, const xmlChar *key, void *payload) {
@ -625,11 +616,10 @@ xmlHashAdd(xmlHashTablePtr hash, const xmlChar *key, void *payload) {
}
/**
* xmlHashAdd2:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @payload: pointer to the payload
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param payload pointer to the payload
*
* Add a hash table entry with two strings as key.
*
@ -637,7 +627,7 @@ xmlHashAdd(xmlHashTablePtr hash, const xmlChar *key, void *payload) {
*
* Available since 2.13.0.
*
* Returns 1 on success, 0 if an entry exists and -1 in case of error.
* @returns 1 on success, 0 if an entry exists and -1 in case of error.
*/
int
xmlHashAdd2(xmlHashTablePtr hash, const xmlChar *key,
@ -646,12 +636,11 @@ xmlHashAdd2(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashAdd3:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @payload: pointer to the payload
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
* @param payload pointer to the payload
*
* Add a hash table entry with three strings as key.
*
@ -659,7 +648,7 @@ xmlHashAdd2(xmlHashTablePtr hash, const xmlChar *key,
*
* Available since 2.13.0.
*
* Returns 1 on success, 0 if an entry exists and -1 in case of error.
* @returns 1 on success, 0 if an entry exists and -1 in case of error.
*/
int
xmlHashAdd3(xmlHashTablePtr hash, const xmlChar *key,
@ -669,10 +658,9 @@ xmlHashAdd3(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashAddEntry:
* @hash: hash table
* @key: string key
* @payload: pointer to the payload
* @param hash hash table
* @param key string key
* @param payload pointer to the payload
*
* Add a hash table entry. If an entry with this key already exists,
* payload will not be updated and -1 is returned. This return value
@ -682,7 +670,7 @@ xmlHashAdd3(xmlHashTablePtr hash, const xmlChar *key,
* NOTE: This function doesn't allow to distinguish malloc failures from
* existing entries. Use xmlHashAdd instead.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload) {
@ -697,17 +685,16 @@ xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload) {
}
/**
* xmlHashAddEntry2:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @payload: pointer to the payload
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param payload pointer to the payload
*
* Add a hash table entry with two strings as key.
*
* See xmlHashAddEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *key,
@ -723,18 +710,17 @@ xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashAddEntry3:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @payload: pointer to the payload
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
* @param payload pointer to the payload
*
* Add a hash table entry with three strings as key.
*
* See xmlHashAddEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashAddEntry3(xmlHashTablePtr hash, const xmlChar *key,
@ -751,16 +737,15 @@ xmlHashAddEntry3(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashUpdateEntry:
* @hash: hash table
* @key: string key
* @payload: pointer to the payload
* @dealloc: deallocator function for replaced item or NULL
* @param hash hash table
* @param key string key
* @param payload pointer to the payload
* @param dealloc deallocator function for replaced item or NULL
*
* Add a hash table entry. If an entry with this key already exists,
* the old payload will be freed and updated with the new value.
*
* Returns 0 in case of success, -1 if a memory allocation failed.
* @returns 0 in case of success, -1 if a memory allocation failed.
*/
int
xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key,
@ -775,18 +760,17 @@ xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashUpdateEntry2:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @payload: pointer to the payload
* @dealloc: deallocator function for replaced item or NULL
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param payload pointer to the payload
* @param dealloc deallocator function for replaced item or NULL
*
* Add a hash table entry with two strings as key.
*
* See xmlHashUpdateEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashUpdateEntry2(xmlHashTablePtr hash, const xmlChar *key,
@ -802,19 +786,18 @@ xmlHashUpdateEntry2(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashUpdateEntry3:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @payload: pointer to the payload
* @dealloc: deallocator function for replaced item or NULL
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
* @param payload pointer to the payload
* @param dealloc deallocator function for replaced item or NULL
*
* Add a hash table entry with three strings as key.
*
* See xmlHashUpdateEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashUpdateEntry3(xmlHashTablePtr hash, const xmlChar *key,
@ -830,13 +813,12 @@ xmlHashUpdateEntry3(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashLookup:
* @hash: hash table
* @key: string key
* @param hash hash table
* @param key string key
*
* Find the entry specified by @key.
* Find the entry specified by `key`.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
void *
xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key) {
@ -844,14 +826,13 @@ xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key) {
}
/**
* xmlHashLookup2:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @param hash hash table
* @param key first string key
* @param key2 second string key
*
* Find the payload specified by the (@key, @key2) tuple.
* Find the payload specified by the (`key`, `key2`) tuple.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
void *
xmlHashLookup2(xmlHashTablePtr hash, const xmlChar *key,
@ -860,14 +841,13 @@ xmlHashLookup2(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashQLookup:
* @hash: hash table
* @prefix: prefix of the string key
* @name: local name of the string key
* @param hash hash table
* @param prefix prefix of the string key
* @param name local name of the string key
*
* Find the payload specified by the QName `prefix:name` or @name.
* Find the payload specified by the QName `prefix:name` or `name`.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
void *
xmlHashQLookup(xmlHashTablePtr hash, const xmlChar *prefix,
@ -876,16 +856,15 @@ xmlHashQLookup(xmlHashTablePtr hash, const xmlChar *prefix,
}
/**
* xmlHashQLookup2:
* @hash: hash table
* @prefix: first prefix
* @name: first local name
* @prefix2: second prefix
* @name2: second local name
* @param hash hash table
* @param prefix first prefix
* @param name first local name
* @param prefix2 second prefix
* @param name2 second local name
*
* Find the payload specified by the QNames tuple.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
void *
xmlHashQLookup2(xmlHashTablePtr hash, const xmlChar *prefix,
@ -895,15 +874,14 @@ xmlHashQLookup2(xmlHashTablePtr hash, const xmlChar *prefix,
}
/**
* xmlHashLookup3:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
*
* Find the payload specified by the (@key, @key2, @key3) tuple.
* Find the payload specified by the (`key`, `key2`, `key3`) tuple.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
void *
xmlHashLookup3(xmlHashTablePtr hash, const xmlChar *key,
@ -922,18 +900,17 @@ xmlHashLookup3(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashQLookup3:
* @hash: hash table
* @prefix: first prefix
* @name: first local name
* @prefix2: second prefix
* @name2: second local name
* @prefix3: third prefix
* @name3: third local name
* @param hash hash table
* @param prefix first prefix
* @param name first local name
* @param prefix2 second prefix
* @param name2 second local name
* @param prefix3 third prefix
* @param name3 third local name
*
* Find the payload specified by the QNames tuple.
*
* Returns a pointer to the payload or NULL if no entry was found.
* @returns a pointer to the payload or NULL if no entry was found.
*/
ATTRIBUTE_NO_SANITIZE_INTEGER
void *
@ -990,12 +967,11 @@ stubHashScannerFull(void *payload, void *data, const xmlChar *key,
}
/**
* xmlHashScan:
* @hash: hash table
* @scan: scanner function for items in the hash
* @data: extra data passed to @scan
* @param hash hash table
* @param scan scanner function for items in the hash
* @param data extra data passed to `scan`
*
* Scan the hash @table and apply @scan to each value.
* Scan the hash `table` and apply `scan` to each value.
*/
void
xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data) {
@ -1006,12 +982,11 @@ xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data) {
}
/**
* xmlHashScanFull:
* @hash: hash table
* @scan: scanner function for items in the hash
* @data: extra data passed to @scan
* @param hash hash table
* @param scan scanner function for items in the hash
* @param data extra data passed to `scan`
*
* Scan the hash @table and apply @scan to each value.
* Scan the hash `table` and apply `scan` to each value.
*/
void
xmlHashScanFull(xmlHashTablePtr hash, xmlHashScannerFull scan, void *data) {
@ -1056,16 +1031,15 @@ xmlHashScanFull(xmlHashTablePtr hash, xmlHashScannerFull scan, void *data) {
}
/**
* xmlHashScan3:
* @hash: hash table
* @key: first string key or NULL
* @key2: second string key or NULL
* @key3: third string key or NULL
* @scan: scanner function for items in the hash
* @data: extra data passed to @scan
* @param hash hash table
* @param key first string key or NULL
* @param key2 second string key or NULL
* @param key3 third string key or NULL
* @param scan scanner function for items in the hash
* @param data extra data passed to `scan`
*
* Scan the hash @table and apply @scan to each value matching
* (@key, @key2, @key3) tuple. If one of the keys is null,
* Scan the hash `table` and apply `scan` to each value matching
* (`key`, `key2`, `key3`) tuple. If one of the keys is null,
* the comparison is considered to match.
*/
void
@ -1079,16 +1053,15 @@ xmlHashScan3(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashScanFull3:
* @hash: hash table
* @key: first string key or NULL
* @key2: second string key or NULL
* @key3: third string key or NULL
* @scan: scanner function for items in the hash
* @data: extra data passed to @scan
* @param hash hash table
* @param key first string key or NULL
* @param key2 second string key or NULL
* @param key3 third string key or NULL
* @param scan scanner function for items in the hash
* @param data extra data passed to `scan`
*
* Scan the hash @table and apply @scan to each value matching
* (@key, @key2, @key3) tuple. If one of the keys is null,
* Scan the hash `table` and apply `scan` to each value matching
* (`key`, `key2`, `key3`) tuple. If one of the keys is null,
* the comparison is considered to match.
*/
void
@ -1141,16 +1114,15 @@ xmlHashScanFull3(xmlHashTablePtr hash, const xmlChar *key,
}
/*
* xmlHashCopySafe:
* @hash: hash table
* @copyFunc: copier function for items in the hash
* @deallocFunc: deallocation function in case of errors
* @param hash hash table
* @param copyFunc copier function for items in the hash
* @param deallocFunc deallocation function in case of errors
*
* Copy the hash table using @copyFunc to copy payloads.
* Copy the hash table using `copyFunc` to copy payloads.
*
* Available since 2.13.0.
*
* Returns the new table or NULL if a memory allocation failed.
* @returns the new table or NULL if a memory allocation failed.
*/
xmlHashTablePtr
xmlHashCopySafe(xmlHashTablePtr hash, xmlHashCopier copyFunc,
@ -1194,15 +1166,14 @@ error:
}
/*
* xmlHashCopy:
* @hash: hash table
* @copy: copier function for items in the hash
* @param hash hash table
* @param copy copier function for items in the hash
*
* DEPRECATED: Leaks memory in error case.
* @deprecated Leaks memory in error case.
*
* Copy the hash table using @copy to copy payloads.
* Copy the hash table using `copy` to copy payloads.
*
* Returns the new table or NULL if a memory allocation failed.
* @returns the new table or NULL if a memory allocation failed.
*/
xmlHashTablePtr
xmlHashCopy(xmlHashTablePtr hash, xmlHashCopier copy) {
@ -1210,12 +1181,11 @@ xmlHashCopy(xmlHashTablePtr hash, xmlHashCopier copy) {
}
/**
* xmlHashSize:
* @hash: hash table
* @param hash hash table
*
* Query the number of elements in the hash table.
*
* Returns the number of elements in the hash table or
* @returns the number of elements in the hash table or
* -1 in case of error.
*/
int
@ -1226,15 +1196,14 @@ xmlHashSize(xmlHashTablePtr hash) {
}
/**
* xmlHashRemoveEntry:
* @hash: hash table
* @key: string key
* @dealloc: deallocator function for removed item or NULL
* @param hash hash table
* @param key string key
* @param dealloc deallocator function for removed item or NULL
*
* Find the entry specified by the @key and remove it from the hash table.
* Payload will be freed with @dealloc.
* Find the entry specified by the `key` and remove it from the hash table.
* Payload will be freed with `dealloc`.
*
* Returns 0 on success and -1 if no entry was found.
* @returns 0 on success and -1 if no entry was found.
*/
int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key,
xmlHashDeallocator dealloc) {
@ -1242,17 +1211,16 @@ int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashRemoveEntry2:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @dealloc: deallocator function for removed item or NULL
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param dealloc deallocator function for removed item or NULL
*
* Remove an entry with two strings as key.
*
* See xmlHashRemoveEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
int
xmlHashRemoveEntry2(xmlHashTablePtr hash, const xmlChar *key,
@ -1261,18 +1229,17 @@ xmlHashRemoveEntry2(xmlHashTablePtr hash, const xmlChar *key,
}
/**
* xmlHashRemoveEntry3:
* @hash: hash table
* @key: first string key
* @key2: second string key
* @key3: third string key
* @dealloc: deallocator function for removed item or NULL
* @param hash hash table
* @param key first string key
* @param key2 second string key
* @param key3 third string key
* @param dealloc deallocator function for removed item or NULL
*
* Remove an entry with three strings as key.
*
* See xmlHashRemoveEntry.
*
* Returns 0 on success and -1 in case of error.
* @returns 0 on success and -1 in case of error.
*/
ATTRIBUTE_NO_SANITIZE_INTEGER
int

View File

@ -1,13 +1,16 @@
/*
* Summary: interface for an HTML 4.0 non-verifying parser
* Description: this module implements an HTML 4.0 non-verifying parser
/**
* @file
*
* @brief interface for an HTML 4.0 non-verifying parser
*
* this module implements an HTML 4.0 non-verifying parser
* with API compatible with the XML parser ones. It should
* be able to parse "real world" HTML, even if severely
* broken from a specification point of view.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __HTML_PARSER_H__
@ -196,7 +199,6 @@ XMLPUBFUN void
* New set of simpler/more flexible APIs
*/
/**
* xmlParserOption:
*
* This is the set of XML parser options that can be passed down
* to the xmlReadDoc() and similar calls.
@ -310,29 +312,26 @@ XMLPUBFUN htmlStatus htmlElementStatusHere(const htmlElemDesc*, const htmlElemDe
XML_DEPRECATED
XMLPUBFUN htmlStatus htmlNodeStatus(htmlNodePtr, int) ;
/**
* htmlDefaultSubelement:
* @elt: HTML element
* @param elt HTML element
*
* Returns the default subelement for this element
* @returns the default subelement for this element
*/
#define htmlDefaultSubelement(elt) elt->defaultsubelt
/**
* htmlElementAllowedHereDesc:
* @parent: HTML parent element
* @elt: HTML element
* @param parent HTML parent element
* @param elt HTML element
*
* Checks whether an HTML element description may be a
* direct child of the specified element.
*
* Returns 1 if allowed; 0 otherwise.
* @returns 1 if allowed; 0 otherwise.
*/
#define htmlElementAllowedHereDesc(parent,elt) \
htmlElementAllowedHere((parent), (elt)->name)
/**
* htmlRequiredAttrs:
* @elt: HTML element
* @param elt HTML element
*
* Returns the attributes required for the specified element.
* @returns the attributes required for the specified element.
*/
#define htmlRequiredAttrs(elt) (elt)->attrs_req

View File

@ -1,11 +1,14 @@
/*
* Summary: specific APIs to process HTML tree, especially serialization
* Description: this module implements a few function needed to process
/**
* @file
*
* @brief specific APIs to process HTML tree, especially serialization
*
* this module implements a few function needed to process
* tree in an HTML specific way.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __HTML_TREE_H__

View File

@ -1,11 +1,14 @@
/*
* Summary: Old SAX version 1 handler, deprecated
* Description: DEPRECATED set of SAX version 1 interfaces used to
/**
* @file
*
* @brief Old SAX version 1 handler, deprecated
*
* @deprecated set of SAX version 1 interfaces used to
* build the DOM tree.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_SAX_H__

View File

@ -1,11 +1,14 @@
/*
* Summary: SAX2 parser interface used to build the DOM tree
* Description: those are the default SAX2 interfaces used by
/**
* @file
*
* @brief SAX2 parser interface used to build the DOM tree
*
* those are the default SAX2 interfaces used by
* the library when building DOM tree.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/

View File

@ -1,6 +1,9 @@
/*
* Summary: Provide Canonical XML and Exclusive XML Canonicalization
* Description: the c14n modules provides a
/**
* @file
*
* @brief Provide Canonical XML and Exclusive XML Canonicalization
*
* the c14n modules provides a
*
* "Canonical XML" implementation
* http://www.w3.org/TR/xml-c14n
@ -10,9 +13,9 @@
* "Exclusive XML Canonicalization" implementation
* http://www.w3.org/TR/xml-exc-c14n
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Aleksey Sanin
* @author Aleksey Sanin
*/
#ifndef __XML_C14N_H__
#define __XML_C14N_H__
@ -43,7 +46,6 @@ extern "C" {
*/
/*
* xmlC14NMode:
*
* Predefined values for C14N modes
*
@ -84,14 +86,13 @@ XMLPUBFUN int
* This is the core C14N function
*/
/**
* xmlC14NIsVisibleCallback:
* @user_data: user data
* @node: the current node
* @parent: the parent node
* @param user_data user data
* @param node the current node
* @param parent the parent node
*
* Signature for a C14N callback on visible nodes
*
* Returns 1 if the node should be included
* @returns 1 if the node should be included
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
xmlNodePtr node,

View File

@ -1,6 +1,9 @@
/**
* Summary: interfaces to the Catalog handling system
* Description: the catalog module implements the support for
* @file
* *
* @brief interfaces to the Catalog handling system
*
* the catalog module implements the support for
* XML Catalogs and SGML catalogs
*
* SGML Open Technical Resolution TR9401:1997.
@ -9,9 +12,9 @@
* XML Catalogs Working Draft 06 August 2001
* http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_CATALOG_H__

View File

@ -1,6 +1,9 @@
/*
* Summary: Unicode character range checking
* Description: this module exports interfaces for the character
/**
* @file
*
* @brief Unicode character range checking
*
* this module exports interfaces for the character
* range validation APIs
*
* This file is automatically generated from the cvs source
@ -55,8 +58,7 @@ XMLPUBFUN int
/**
* xmlIsBaseChar_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -67,8 +69,7 @@ XMLPUBFUN int
(0xf8 <= (c)))
/**
* xmlIsBaseCharQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -79,8 +80,7 @@ XMLPUBFUN int
XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
/**
* xmlIsBlank_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -89,8 +89,7 @@ XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
((c) == 0xd))
/**
* xmlIsBlankQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -99,8 +98,7 @@ XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
/**
* xmlIsChar_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -109,8 +107,7 @@ XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
(0x20 <= (c)))
/**
* xmlIsCharQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -123,8 +120,7 @@ XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
/**
* xmlIsCombiningQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -135,16 +131,14 @@ XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
/**
* xmlIsDigit_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
/**
* xmlIsDigitQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -155,16 +149,14 @@ XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
/**
* xmlIsExtender_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsExtender_ch(c) (((c) == 0xb7))
/**
* xmlIsExtenderQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -175,8 +167,7 @@ XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
/**
* xmlIsIdeographicQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
@ -190,16 +181,14 @@ XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
/**
* xmlIsPubidChar_ch:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/
#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
/**
* xmlIsPubidCharQ:
* @c: char to validate
* @param c char to validate
*
* Automatically generated by genChRanges.py
*/

View File

@ -1,11 +1,14 @@
/*
* Summary: Tree debugging APIs
* Description: Interfaces to a set of routines used for debugging the tree
/**
* @file
*
* @brief Tree debugging APIs
*
* Interfaces to a set of routines used for debugging the tree
* produced by the XML parser.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __DEBUG_XML__

View File

@ -1,11 +1,14 @@
/*
* Summary: string dictionary
* Description: dictionary of reusable strings, just used to avoid allocation
/**
* @file
*
* @brief string dictionary
*
* dictionary of reusable strings, just used to avoid allocation
* and freeing operations.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_DICT_H__

View File

@ -1,6 +1,9 @@
/*
* Summary: interface for the encoding conversion functions
* Description: interface for the encoding conversion functions needed for
/**
* @file
*
* @brief interface for the encoding conversion functions
*
* interface for the encoding conversion functions needed for
* XML basic encoding and iconv() support.
*
* Related specs are
@ -10,13 +13,13 @@
* [UNICODE] The Unicode Consortium, "The Unicode Standard --
* Worldwide Character Encoding -- Version 1.0", Addison-
* Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
* described in Unicode Technical Report #4.
* described in Unicode Technical Report \#4.
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
* Information Interchange, ANSI X3.4-1986.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_CHAR_ENCODING_H__
@ -44,7 +47,6 @@ typedef enum {
} xmlCharEncError;
/*
* xmlCharEncoding:
*
* Predefined values for some standard encodings.
*/
@ -90,68 +92,64 @@ typedef enum {
} xmlCharEncFlags;
/**
* xmlCharEncodingInputFunc:
* @out: a pointer to an array of bytes to store the UTF-8 result
* @outlen: the length of @out
* @in: a pointer to an array of chars in the original encoding
* @inlen: the length of @in
* @param out a pointer to an array of bytes to store the UTF-8 result
* @param outlen the length of `out`
* @param in a pointer to an array of chars in the original encoding
* @param inlen the length of `in`
*
* Convert characters to UTF-8.
*
* On success, the value of @inlen after return is the number of
* bytes consumed and @outlen is the number of bytes produced.
* 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 or an XML_ENC_ERR code.
*/
typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
/**
* xmlCharEncodingOutputFunc:
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of UTF-8 chars
* @inlen: the length of @in
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of UTF-8 chars
* @param inlen the length of `in`
*
* Convert characters from UTF-8.
*
* On success, the value of @inlen after return is the number of
* bytes consumed and @outlen is the number of bytes produced.
* 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 or an XML_ENC_ERR code.
*/
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
* @param vctxt conversion context
* @param out a pointer to an array of bytes to store the result
* @param outlen the length of `out`
* @param in a pointer to an array of input bytes
* @param inlen the length of `in`
* @param 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.
* 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.
* `flush` flag can be used to detect truncated sequences at EOF.
* Otherwise, the flag can be ignored.
*
* Returns an XML_ENC_ERR code.
* @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
* @param vctxt conversion context
*
* Free a conversion context.
*/
@ -182,19 +180,18 @@ struct _xmlCharEncodingHandler {
};
/**
* xmlCharEncConvImpl:
* @vctxt: user data
* @name: encoding name
* @flags: bit mask of flags
* @out: pointer to resulting handler
* @param vctxt user data
* @param name encoding name
* @param flags bit mask of flags
* @param out pointer to resulting handler
*
* If this function returns XML_ERR_OK, it must fill the @out
* 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.
* `flags` can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
*
* Returns an xmlParserErrors code.
* @returns an xmlParserErrors code.
*/
typedef xmlParserErrors
(*xmlCharEncConvImpl)(void *vctxt, const char *name, xmlCharEncFlags flags,
@ -271,9 +268,9 @@ XMLPUBFUN xmlCharEncoding
xmlDetectCharEncoding (const unsigned char *in,
int len);
/** DOC_DISABLE */
/** @cond IGNORE */
struct _xmlBuffer;
/** DOC_ENABLE */
/** @endcond */
XMLPUBFUN int
xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
struct _xmlBuffer *out,

View File

@ -1,11 +1,14 @@
/*
* Summary: interface for the XML entities handling
* Description: this module provides some of the entity API needed
/**
* @file
*
* @brief interface for the XML entities handling
*
* this module provides some of the entity API needed
* for the parser and applications.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_ENTITIES_H__

View File

@ -1,8 +1,11 @@
/*
* Summary: interface for all global variables of the library
* Description: Deprecated, don't use
/**
* @file
*
* @brief interface for all global variables of the library
*
* Deprecated, don't use
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*/
#ifndef __XML_GLOBALS_H

View File

@ -1,9 +1,12 @@
/*
* Summary: Chained hash tables
* Description: This module implements the hash table support used in
/**
* @file
*
* @brief Chained hash tables
*
* This module implements the hash table support used in
* various places in the library.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*/
#ifndef __XML_HASH_H__
@ -32,13 +35,13 @@ typedef xmlHashTable *xmlHashTablePtr;
*/
/**
* XML_CAST_FPTR:
* @fptr: pointer to a function
* @param fptr pointer to a function
*
* Macro to do a casting from an object pointer to a
* function pointer without encountering a warning from
* gcc
*
* #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
* \#define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
* This macro violated ISO C aliasing rules (gcc4 on s390 broke)
* so it is disabled now
*/
@ -49,39 +52,35 @@ typedef xmlHashTable *xmlHashTablePtr;
* function types:
*/
/**
* xmlHashDeallocator:
* @payload: the data in the hash
* @name: the name associated
* @param payload the data in the hash
* @param name the name associated
*
* Callback to free data from a hash.
*/
typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name);
/**
* xmlHashCopier:
* @payload: the data in the hash
* @name: the name associated
* @param payload the data in the hash
* @param name the name associated
*
* Callback to copy data from a hash.
*
* Returns a copy of the data or NULL in case of error.
* @returns a copy of the data or NULL in case of error.
*/
typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
/**
* xmlHashScanner:
* @payload: the data in the hash
* @data: extra scanner data
* @name: the name associated
* @param payload the data in the hash
* @param data extra scanner data
* @param name the name associated
*
* Callback when scanning data in a hash with the simple scanner.
*/
typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
/**
* xmlHashScannerFull:
* @payload: the data in the hash
* @data: extra scanner data
* @name: the name associated
* @name2: the second name associated
* @name3: the third name associated
* @param payload the data in the hash
* @param data extra scanner data
* @param name the name associated
* @param name2 the second name associated
* @param name3 the third name associated
*
* Callback when scanning data in a hash with the full scanner.
*/

View File

@ -1,11 +1,14 @@
/*
* Summary: lists interfaces
* Description: this module implement the list support used in
/**
* @file
*
* @brief lists interfaces
*
* this module implement the list support used in
* various place in the library.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Gary Pennington
* @author Gary Pennington
*/
#ifndef __XML_LINK_INCLUDE__
@ -24,30 +27,27 @@ typedef struct _xmlList xmlList;
typedef xmlList *xmlListPtr;
/**
* xmlListDeallocator:
* @lk: the data to deallocate
* @param lk the data to deallocate
*
* Callback function used to free data from a list.
*/
typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
/**
* xmlListDataCompare:
* @data0: the first data
* @data1: the second data
* @param data0 the first data
* @param data1 the second data
*
* Callback function used to compare 2 data.
*
* Returns 0 is equality, -1 or 1 otherwise depending on the ordering.
* @returns 0 is equality, -1 or 1 otherwise depending on the ordering.
*/
typedef int (*xmlListDataCompare) (const void *data0, const void *data1);
/**
* xmlListWalker:
* @data: the data found in the list
* @user: extra user provided data to the walker
* @param data the data found in the list
* @param user extra user provided data to the walker
*
* Callback function used when walking a list with xmlListWalk().
*
* Returns 0 to stop walking the list, 1 otherwise.
* @returns 0 to stop walking the list, 1 otherwise.
*/
typedef int (*xmlListWalker) (const void *data, void *user);

View File

@ -1,9 +1,12 @@
/*
* Summary: Removed legacy symbols for an outdated FTP client
/**
* @file
*
* @brief Removed legacy symbols for an outdated FTP client
*
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __NANO_FTP_H__

View File

@ -1,11 +1,14 @@
/*
* Summary: minimal HTTP implementation
* Description: minimal HTTP implementation allowing to fetch resources
/**
* @file
*
* @brief minimal HTTP implementation
*
* minimal HTTP implementation allowing to fetch resources
* like external subset.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __NANO_HTTP_H__

View File

@ -1,10 +1,13 @@
/*
* Summary: the core parser module
* Description: Interfaces, constants and types related to the XML parser
/**
* @file
*
* @brief the core parser module
*
* Interfaces, constants and types related to the XML parser
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_PARSER_H__
@ -63,7 +66,6 @@ typedef enum {
} xmlParserInputFlags;
/**
* xmlParserInput:
*
* An xmlParserInput is an input flow for the XML processor.
* Each entity parsed is associated an xmlParserInput (except the
@ -74,8 +76,7 @@ typedef enum {
*/
/**
* xmlParserInputDeallocate:
* @str: the string to deallocate
* @param str the string to deallocate
*
* Callback for freeing some parser input allocations.
*/
@ -119,7 +120,6 @@ struct _xmlParserInput {
};
/**
* xmlParserNodeInfo:
*
* The parser can be asked to collect Node information, i.e. at what
* place in the file they were detected.
@ -146,7 +146,6 @@ struct _xmlParserNodeInfoSeq {
};
/**
* xmlParserInputState:
*
* The parser is now working also as a state based parser.
* The recursive one use the state info for entities processing.
@ -173,17 +172,16 @@ typedef enum {
XML_PARSER_XML_DECL /* before XML decl (but after BOM) */
} xmlParserInputState;
/** DOC_DISABLE */
/** @cond IGNORE */
/*
* Internal bits in the 'loadsubset' context member
*/
#define XML_DETECT_IDS 2
#define XML_COMPLETE_ATTRS 4
#define XML_SKIP_IDS 8
/** DOC_ENABLE */
/** @endcond */
/**
* xmlParserMode:
*
* A parser can operate in various modes
*/
@ -201,22 +199,21 @@ 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
* @param ctxt parser context
* @param url URL to load
* @param publicId publid ID from DTD (optional)
* @param type resource type
* @param flags flags
* @param out result pointer
*
* Callback for custom resource loaders.
*
* @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.
* `flags` can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.
*
* On success, @out should be set to a new parser input object and
* On success, `out` should be set to a new parser input object and
* XML_ERR_OK should be returned.
*
* Returns an xmlParserErrors code.
* @returns an xmlParserErrors code.
*/
typedef xmlParserErrors
(*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId,
@ -224,7 +221,6 @@ typedef xmlParserErrors
xmlParserInputPtr *out);
/**
* xmlParserCtxt:
*
* The parser context.
* NOTE This doesn't completely define the parser state, the (current ?)
@ -484,7 +480,6 @@ struct _xmlParserCtxt {
};
/**
* xmlSAXLocator:
*
* A SAX Locator.
*/
@ -496,7 +491,6 @@ struct _xmlSAXLocator {
};
/**
* xmlSAXHandler:
*
* A SAX handler is bunch of callbacks called by the parser when processing
* of the input generate data or structure information.
@ -504,9 +498,9 @@ struct _xmlSAXLocator {
/**
* resolveEntitySAXFunc:
* @ctx: the user data (XML parser context)
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctx the user data (XML parser context)
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* Callback:
* The entity loader, to control the loading of external entities,
@ -515,17 +509,17 @@ struct _xmlSAXLocator {
* - or better use the xmlSetExternalEntityLoader() function to
* set up it's own entity resolution routine
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
const xmlChar *publicId,
const xmlChar *systemId);
/**
* internalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
* @name: the root element name
* @ExternalID: the external ID
* @SystemID: the SYSTEM ID (e.g. filename or URL)
* @param ctx the user data (XML parser context)
* @param name the root element name
* @param ExternalID the external ID
* @param SystemID the SYSTEM ID (e.g. filename or URL)
*
* Callback on internal subset declaration.
*/
@ -535,10 +529,10 @@ typedef void (*internalSubsetSAXFunc) (void *ctx,
const xmlChar *SystemID);
/**
* externalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
* @name: the root element name
* @ExternalID: the external ID
* @SystemID: the SYSTEM ID (e.g. filename or URL)
* @param ctx the user data (XML parser context)
* @param name the root element name
* @param ExternalID the external ID
* @param SystemID the SYSTEM ID (e.g. filename or URL)
*
* Callback on external subset declaration.
*/
@ -548,34 +542,34 @@ typedef void (*externalSubsetSAXFunc) (void *ctx,
const xmlChar *SystemID);
/**
* getEntitySAXFunc:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get an entity by name.
*
* Returns the xmlEntityPtr if found.
* @returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
const xmlChar *name);
/**
* getParameterEntitySAXFunc:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get a parameter entity by name.
*
* Returns the xmlEntityPtr if found.
* @returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
const xmlChar *name);
/**
* entityDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
* @param ctx the user data (XML parser context)
* @param name the entity name
* @param type the entity type
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param content the entity value (without processing).
*
* An entity definition has been parsed.
*/
@ -587,10 +581,10 @@ typedef void (*entityDeclSAXFunc) (void *ctx,
xmlChar *content);
/**
* notationDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctx the user data (XML parser context)
* @param name The name of the notation
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
@ -600,13 +594,13 @@ typedef void (*notationDeclSAXFunc)(void *ctx,
const xmlChar *systemId);
/**
* attributeDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @elem: the name of the element
* @fullname: the attribute name
* @type: the attribute type
* @def: the type of default value
* @defaultValue: the attribute default value
* @tree: the tree of enumerated value set
* @param ctx the user data (XML parser context)
* @param elem the name of the element
* @param fullname the attribute name
* @param type the attribute type
* @param def the type of default value
* @param defaultValue the attribute default value
* @param tree the tree of enumerated value set
*
* An attribute definition has been parsed.
*/
@ -619,10 +613,10 @@ typedef void (*attributeDeclSAXFunc)(void *ctx,
xmlEnumerationPtr tree);
/**
* elementDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @name: the element name
* @type: the element type
* @content: the element value tree
* @param ctx the user data (XML parser context)
* @param name the element name
* @param type the element type
* @param content the element value tree
*
* An element definition has been parsed.
*/
@ -632,11 +626,11 @@ typedef void (*elementDeclSAXFunc)(void *ctx,
xmlElementContentPtr content);
/**
* unparsedEntityDeclSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
* @param ctx the user data (XML parser context)
* @param name The name of the entity
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param notationName the name of the notation
*
* What to do when an unparsed entity declaration is parsed.
*/
@ -647,8 +641,8 @@ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
const xmlChar *notationName);
/**
* setDocumentLocatorSAXFunc:
* @ctx: the user data (XML parser context)
* @loc: A SAX Locator
* @param ctx the user data (XML parser context)
* @param loc A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator.
* Everything is available on the context, so this is useless in our case.
@ -657,23 +651,23 @@ typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
xmlSAXLocatorPtr loc);
/**
* startDocumentSAXFunc:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Called when the document start being processed.
*/
typedef void (*startDocumentSAXFunc) (void *ctx);
/**
* endDocumentSAXFunc:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Called when the document end has been detected.
*/
typedef void (*endDocumentSAXFunc) (void *ctx);
/**
* startElementSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The element name, including namespace prefix
* @atts: An array of name/value attributes pairs, NULL terminated
* @param ctx the user data (XML parser context)
* @param name The element name, including namespace prefix
* @param atts An array of name/value attributes pairs, NULL terminated
*
* Called when an opening tag has been processed.
*/
@ -682,8 +676,8 @@ typedef void (*startElementSAXFunc) (void *ctx,
const xmlChar **atts);
/**
* endElementSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The element name
* @param ctx the user data (XML parser context)
* @param name The element name
*
* Called when the end of an element has been detected.
*/
@ -691,9 +685,9 @@ typedef void (*endElementSAXFunc) (void *ctx,
const xmlChar *name);
/**
* attributeSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The attribute name, including namespace prefix
* @value: The attribute value
* @param ctx the user data (XML parser context)
* @param name The attribute name, including namespace prefix
* @param value The attribute value
*
* Handle an attribute that has been read by the parser.
* The default handling is to convert the attribute into an
@ -705,8 +699,8 @@ typedef void (*attributeSAXFunc) (void *ctx,
const xmlChar *value);
/**
* referenceSAXFunc:
* @ctx: the user data (XML parser context)
* @name: The entity name
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Called when an entity reference is detected.
*/
@ -714,9 +708,9 @@ typedef void (*referenceSAXFunc) (void *ctx,
const xmlChar *name);
/**
* charactersSAXFunc:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctx the user data (XML parser context)
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* Receiving some chars from the parser.
*/
@ -725,9 +719,9 @@ typedef void (*charactersSAXFunc) (void *ctx,
int len);
/**
* ignorableWhitespaceSAXFunc:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctx the user data (XML parser context)
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* Receiving some ignorable whitespaces from the parser.
* UNUSED: by default the DOM building will use characters.
@ -737,9 +731,9 @@ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
int len);
/**
* processingInstructionSAXFunc:
* @ctx: the user data (XML parser context)
* @target: the target name
* @data: the PI data's
* @param ctx the user data (XML parser context)
* @param target the target name
* @param data the PI data's
*
* A processing instruction has been parsed.
*/
@ -748,8 +742,8 @@ typedef void (*processingInstructionSAXFunc) (void *ctx,
const xmlChar *data);
/**
* commentSAXFunc:
* @ctx: the user data (XML parser context)
* @value: the comment content
* @param ctx the user data (XML parser context)
* @param value the comment content
*
* A comment has been parsed.
*/
@ -757,9 +751,9 @@ typedef void (*commentSAXFunc) (void *ctx,
const xmlChar *value);
/**
* cdataBlockSAXFunc:
* @ctx: the user data (XML parser context)
* @value: The pcdata content
* @len: the block length
* @param ctx the user data (XML parser context)
* @param value The pcdata content
* @param len the block length
*
* Called when a pcdata block has been parsed.
*/
@ -769,8 +763,8 @@ typedef void (*cdataBlockSAXFunc) (
int len);
/**
* warningSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, callback.
@ -779,8 +773,8 @@ typedef void (*warningSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* errorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format an error messages, callback.
@ -789,8 +783,8 @@ typedef void (*errorSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* fatalErrorSAXFunc:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @param ctx an XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format fatal error messages, callback.
@ -801,30 +795,30 @@ typedef void (*fatalErrorSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* isStandaloneSAXFunc:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Is this document tagged standalone?
*
* Returns 1 if true
* @returns 1 if true
*/
typedef int (*isStandaloneSAXFunc) (void *ctx);
/**
* hasInternalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Does this document has an internal subset.
*
* Returns 1 if true
* @returns 1 if true
*/
typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
/**
* hasExternalSubsetSAXFunc:
* @ctx: the user data (XML parser context)
* @param ctx the user data (XML parser context)
*
* Does this document has an external subset?
*
* Returns 1 if true
* @returns 1 if true
*/
typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
@ -842,16 +836,16 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
/**
* startElementNsSAX2Func:
* @ctx: the user data (XML parser context)
* @localname: the local name of the element
* @prefix: the element namespace prefix if available
* @URI: the element namespace name if available
* @nb_namespaces: number of namespace definitions on that node
* @namespaces: pointer to the array of prefix/URI pairs namespace definitions
* @nb_attributes: the number of attributes on that node
* @nb_defaulted: the number of defaulted attributes. The defaulted
* @param ctx the user data (XML parser context)
* @param localname the local name of the element
* @param prefix the element namespace prefix if available
* @param URI the element namespace name if available
* @param nb_namespaces number of namespace definitions on that node
* @param namespaces pointer to the array of prefix/URI pairs namespace definitions
* @param nb_attributes the number of attributes on that node
* @param nb_defaulted the number of defaulted attributes. The defaulted
* ones are at the end of the array
* @attributes: pointer to the array of (localname/prefix/URI/value/end)
* @param attributes pointer to the array of (localname/prefix/URI/value/end)
* attribute values.
*
* SAX2 callback when an element start has been detected by the parser.
@ -871,10 +865,10 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
/**
* endElementNsSAX2Func:
* @ctx: the user data (XML parser context)
* @localname: the local name of the element
* @prefix: the element namespace prefix if available
* @URI: the element namespace name if available
* @param ctx the user data (XML parser context)
* @param localname the local name of the element
* @param prefix the element namespace prefix if available
* @param URI the element namespace name if available
*
* SAX2 callback when an element end has been detected by the parser.
* It provides the namespace information for the element.
@ -993,14 +987,13 @@ struct _xmlSAXHandlerV1 {
/**
* xmlExternalEntityLoader:
* @URL: The System ID of the resource requested
* @ID: The Public ID of the resource requested
* @context: the XML parser context
* @param URL The System ID of the resource requested
* @param ID The Public ID of the resource requested
* @param context the XML parser context
*
* External entity loaders types.
*
* Returns the entity input parser.
* @returns the entity input parser.
*/
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
const char *ID,
@ -1012,7 +1005,7 @@ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
XMLPUBVAR const char *const xmlParserVersion;
/** DOC_DISABLE */
/** @cond IGNORE */
XML_DEPRECATED
XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator;
#ifdef LIBXML_SAX1_ENABLED
@ -1063,7 +1056,7 @@ XMLPUBFUN int *__xmlSaveNoEmptyTags(void);
#define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
#endif
#endif
/** DOC_ENABLE */
/** @endcond */
/*
* Init/Cleanup
@ -1378,7 +1371,6 @@ XMLPUBFUN long
* New set of simpler/more flexible APIs
*/
/**
* xmlParserOption:
*
* This is the set of XML parser options that can be passed down
* to the xmlReadDoc() and similar calls.
@ -1581,7 +1573,6 @@ xmlInputSetEncodingHandler(xmlParserInputPtr input,
* Library wide options
*/
/**
* xmlFeature:
*
* Used to examine the existence of features that can be enabled
* or disabled at compile-time.

View File

@ -1,12 +1,15 @@
/*
* Summary: internals routines and limits exported by the parser.
* Description: this module exports a number of internal parsing routines
/**
* @file
*
* @brief internals routines and limits exported by the parser.
*
* this module exports a number of internal parsing routines
* they are not really all intended for applications but
* can prove useful doing low level processing.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_PARSER_INTERNALS_H__
@ -93,30 +96,30 @@ extern "C" {
************************************************************************/
/**
* IS_BYTE_CHAR:
* @c: an byte value (int)
* @param c an byte value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
* [2] Char ::= \#x9 | \#xA | \#xD | [\#x20...]
* any byte character in the accepted range
*/
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
/**
* IS_CHAR:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
* | [#x10000-#x10FFFF]
* [2] Char ::= \#x9 | \#xA | \#xD | [\#x20-\#xD7FF] | [\#xE000-\#xFFFD]
* | [\#x10000-\#x10FFFF]
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
*/
#define IS_CHAR(c) xmlIsCharQ(c)
/**
* IS_CHAR_CH:
* @c: an xmlChar (usually an unsigned char)
* @param c an xmlChar (usually an unsigned char)
*
* Behaves like IS_CHAR on single-byte value
*/
@ -124,17 +127,17 @@ extern "C" {
/**
* IS_BLANK:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [3] S ::= (#x20 | #x9 | #xD | #xA)+
* [3] S ::= (\#x20 | \#x9 | \#xD | \#xA)+
*/
#define IS_BLANK(c) xmlIsBlankQ(c)
/**
* IS_BLANK_CH:
* @c: an xmlChar value (normally unsigned char)
* @param c an xmlChar value (normally unsigned char)
*
* Behaviour same as IS_BLANK
*/
@ -142,7 +145,7 @@ extern "C" {
/**
* IS_BASECHAR:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
@ -152,7 +155,7 @@ extern "C" {
/**
* IS_DIGIT:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
@ -162,7 +165,7 @@ extern "C" {
/**
* IS_DIGIT_CH:
* @c: an xmlChar value (usually an unsigned char)
* @param c an xmlChar value (usually an unsigned char)
*
* Behaves like IS_DIGIT but with a single byte argument
*/
@ -170,7 +173,7 @@ extern "C" {
/**
* IS_COMBINING:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
@ -180,7 +183,7 @@ extern "C" {
/**
* IS_COMBINING_CH:
* @c: an xmlChar (usually an unsigned char)
* @param c an xmlChar (usually an unsigned char)
*
* Always false (all combining chars > 0xff)
*/
@ -188,20 +191,20 @@ extern "C" {
/**
* IS_EXTENDER:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
* #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
* [#x309D-#x309E] | [#x30FC-#x30FE]
* [89] Extender ::= \#x00B7 | \#x02D0 | \#x02D1 | \#x0387 | \#x0640 |
* \#x0E46 | \#x0EC6 | \#x3005 | [\#x3031-\#x3035] |
* [\#x309D-\#x309E] | [\#x30FC-\#x30FE]
*/
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
/**
* IS_EXTENDER_CH:
* @c: an xmlChar value (usually an unsigned char)
* @param c an xmlChar value (usually an unsigned char)
*
* Behaves like IS_EXTENDER but with a single-byte argument
*/
@ -209,18 +212,18 @@ extern "C" {
/**
* IS_IDEOGRAPHIC:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
* [86] Ideographic ::= [\#x4E00-\#x9FA5] | \#x3007 | [\#x3021-\#x3029]
*/
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
/**
* IS_LETTER:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
@ -231,7 +234,7 @@ extern "C" {
/**
* IS_LETTER_CH:
* @c: an xmlChar value (normally unsigned char)
* @param c an xmlChar value (normally unsigned char)
*
* Macro behaves like IS_LETTER, but only check base chars
*
@ -240,7 +243,7 @@ extern "C" {
/**
* IS_ASCII_LETTER:
* @c: an xmlChar value
* @param c an xmlChar value
*
* Macro to check [a-zA-Z]
*
@ -250,7 +253,7 @@ extern "C" {
/**
* IS_ASCII_DIGIT:
* @c: an xmlChar value
* @param c an xmlChar value
*
* Macro to check [0-9]
*
@ -259,18 +262,18 @@ extern "C" {
/**
* IS_PUBIDCHAR:
* @c: an UNICODE value (int)
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
* [13] PubidChar ::= \#x20 | \#xD | \#xA | [a-zA-Z0-9] | [-'()+,./:=?;!*\#@$_%]
*/
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
/**
* IS_PUBIDCHAR_CH:
* @c: an xmlChar value (normally unsigned char)
* @param c an xmlChar value (normally unsigned char)
*
* Same as IS_PUBIDCHAR but for single-byte value
*/

View File

@ -1,11 +1,14 @@
/*
* Summary: pattern expression handling
* Description: allows to compile and test pattern expressions for nodes
/**
* @file
*
* @brief pattern expression handling
*
* allows to compile and test pattern expressions for nodes
* either in a tree or based on a parser state.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_PATTERN_H__
@ -22,7 +25,6 @@ extern "C" {
#endif
/**
* xmlPattern:
*
* A compiled (XPath based) pattern to select nodes
*/
@ -30,7 +32,6 @@ typedef struct _xmlPattern xmlPattern;
typedef xmlPattern *xmlPatternPtr;
/**
* xmlPatternFlags:
*
* This is the set of options affecting the behaviour of pattern
* matching with this module

View File

@ -1,10 +1,13 @@
/*
* Summary: implementation of the Relax-NG validation
* Description: implementation of the Relax-NG validation
/**
* @file
*
* @brief implementation of the Relax-NG validation
*
* implementation of the Relax-NG validation
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_RELAX_NG__
@ -27,9 +30,8 @@ typedef xmlRelaxNG *xmlRelaxNGPtr;
/**
* xmlRelaxNGValidityErrorFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of an error callback from a Relax-NG validation
@ -39,9 +41,8 @@ typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlRelaxNGValidityWarningFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of a warning callback from a Relax-NG validation
@ -60,7 +61,6 @@ typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
/*
* xmlRelaxNGValidErr:
*
* List of possible Relax NG validation errors
*/
@ -108,7 +108,6 @@ typedef enum {
} xmlRelaxNGValidErr;
/*
* xmlRelaxNGParserFlags:
*
* List of possible Relax NG Parser flags
*/

View File

@ -1,13 +1,16 @@
/*
* Summary: internal interfaces for XML Schemas
* Description: internal interfaces for the XML Schemas handling
/**
* @file
*
* @brief internal interfaces for XML Schemas
*
* internal interfaces for the XML Schemas handling
* and schema validity checking
* The Schemas development is a Work In Progress.
* Some of those interfaces are not guaranteed to be API or ABI stable !
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
@ -240,7 +243,6 @@ struct _xmlSchemaAnnot {
#define XML_SCHEMAS_ATTR_FIXED 1 << 9
/**
* xmlSchemaAttribute:
* An attribute definition.
*/
@ -270,7 +272,6 @@ struct _xmlSchemaAttribute {
};
/**
* xmlSchemaAttributeLink:
* Used to build a list of attribute uses on complexType definitions.
* WARNING: Deprecated; not used.
*/
@ -289,7 +290,6 @@ struct _xmlSchemaAttributeLink {
#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
/**
* xmlSchemaCharValueLink:
* Used to build a list of namespaces on wildcards.
*/
typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
@ -379,7 +379,6 @@ struct _xmlSchemaAttributeGroup {
};
/**
* xmlSchemaTypeLink:
* Used to build a list of types (e.g. member types of
* simpleType with variety "union").
*/
@ -391,7 +390,6 @@ struct _xmlSchemaTypeLink {
};
/**
* xmlSchemaFacetLink:
* Used to build a list of facets.
*/
typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
@ -636,7 +634,6 @@ struct _xmlSchemaType {
};
/*
* xmlSchemaElement:
* An element definition.
*
* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of

View File

@ -1,10 +1,13 @@
/*
* Summary: XML Schematron implementation
* Description: interface to the XML Schematron validity checking.
/**
* @file
*
* @brief XML Schematron implementation
*
* interface to the XML Schematron validity checking.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
@ -39,9 +42,8 @@ typedef struct _xmlSchematron xmlSchematron;
typedef xmlSchematron *xmlSchematronPtr;
/**
* xmlSchematronValidityErrorFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of an error callback from a Schematron validation
@ -49,9 +51,8 @@ typedef xmlSchematron *xmlSchematronPtr;
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
/**
* xmlSchematronValidityWarningFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of a warning callback from a Schematron validation

View File

@ -1,11 +1,14 @@
/**
* Summary: interfaces for thread handling
* Description: set of generic threading related routines
* @file
* *
* @brief interfaces for thread handling
*
* set of generic threading related routines
* should work with pthreads, Windows native or TLS threads
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_THREADS_H__
@ -64,14 +67,14 @@ XML_DEPRECATED
XMLPUBFUN void
xmlCleanupThreads(void);
/** DOC_DISABLE */
/** @cond IGNORE */
#if defined(LIBXML_THREAD_ENABLED) && defined(_WIN32) && \
defined(LIBXML_STATIC_FOR_DLL)
int
xmlDllMain(void *hinstDLL, unsigned long fdwReason,
void *lpvReserved);
#endif
/** DOC_ENABLE */
/** @endcond */
#ifdef __cplusplus
}

View File

@ -1,12 +1,15 @@
/*
* Summary: interfaces for tree manipulation
* Description: this module describes the structures found in an tree resulting
/**
* @file
*
* @brief interfaces for tree manipulation
*
* this module describes the structures found in an tree resulting
* from an XML or HTML parsing, as well as the API provided for
* various processing on that tree
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef XML_TREE_INTERNALS
@ -69,13 +72,12 @@ typedef xmlEntity *xmlEntityPtr;
* LIBXML_NAMESPACE_DICT:
*
* Defines experimental behaviour:
* 1) xmlNs gets an additional field @context (a xmlDoc)
* 1) xmlNs gets an additional field `context` (a xmlDoc)
* 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc.
*/
/* #define LIBXML_NAMESPACE_DICT */
/**
* xmlBufferAllocationScheme:
*
* A buffer allocation scheme can be defined to either match exactly the
* need or double it's allocated size each time it is found too small.
@ -91,7 +93,6 @@ typedef enum {
} xmlBufferAllocationScheme;
/**
* xmlBuffer:
*
* A buffer structure, this old construct is limited to 2GB and
* is being deprecated, use API with xmlBuf instead
@ -112,7 +113,6 @@ struct _xmlBuffer {
};
/**
* xmlBuf:
*
* A buffer structure, new one, the actual structure internals are not public
*/
@ -120,7 +120,6 @@ struct _xmlBuffer {
typedef struct _xmlBuf xmlBuf;
/**
* xmlBufPtr:
*
* A pointer to a buffer structure, the actual structure internals are not
* public
@ -195,13 +194,12 @@ typedef enum {
/* XML_DOCB_DOCUMENT_NODE= 21 */ /* removed */
} xmlElementType;
/** DOC_DISABLE */
/** @cond IGNORE */
/* For backward compatibility */
#define XML_DOCB_DOCUMENT_NODE 21
/** DOC_ENABLE */
/** @endcond */
/**
* xmlNotation:
*
* A DTD Notation definition.
*/
@ -215,7 +213,6 @@ struct _xmlNotation {
};
/**
* xmlAttributeType:
*
* A DTD Attribute type definition.
*/
@ -234,7 +231,6 @@ typedef enum {
} xmlAttributeType;
/**
* xmlAttributeDefault:
*
* A DTD Attribute default definition.
*/
@ -247,7 +243,6 @@ typedef enum {
} xmlAttributeDefault;
/**
* xmlEnumeration:
*
* List structure used when there is an enumeration in DTDs.
*/
@ -260,7 +255,6 @@ struct _xmlEnumeration {
};
/**
* xmlAttribute:
*
* An Attribute declaration in a DTD.
*/
@ -288,7 +282,6 @@ struct _xmlAttribute {
};
/**
* xmlElementContentType:
*
* Possible definitions of element content types.
*/
@ -300,7 +293,6 @@ typedef enum {
} xmlElementContentType;
/**
* xmlElementContentOccur:
*
* Possible definitions of element content occurrences.
*/
@ -312,7 +304,6 @@ typedef enum {
} xmlElementContentOccur;
/**
* xmlElementContent:
*
* An XML Element content as stored after parsing an element definition
* in a DTD.
@ -331,7 +322,6 @@ struct _xmlElementContent {
};
/**
* xmlElementTypeVal:
*
* The different possibilities for an element content type.
*/
@ -345,7 +335,6 @@ typedef enum {
} xmlElementTypeVal;
/**
* xmlElement:
*
* An XML Element declaration from a DTD.
*/
@ -384,7 +373,6 @@ struct _xmlElement {
typedef xmlElementType xmlNsType;
/**
* xmlNs:
*
* An XML namespace.
* Note that prefix == NULL is valid, it defines the default namespace
@ -405,7 +393,6 @@ struct _xmlNs {
};
/**
* xmlDtd:
*
* An XML DTD, as defined by <!DOCTYPE ... There is actually one for
* the internal subset and for the external subset.
@ -434,7 +421,6 @@ struct _xmlDtd {
};
/**
* xmlAttr:
*
* An attribute on an XML node.
*/
@ -457,7 +443,6 @@ struct _xmlAttr {
};
/**
* xmlID:
*
* An XML ID instance.
*/
@ -474,7 +459,6 @@ struct _xmlID {
};
/**
* xmlRef:
*
* An XML IDREF instance.
*/
@ -490,7 +474,6 @@ struct _xmlRef {
};
/**
* xmlNode:
*
* A node in an XML tree.
*/
@ -552,7 +535,6 @@ typedef enum {
} xmlDocProperties;
/**
* xmlDoc:
*
* An XML document.
*/
@ -599,15 +581,14 @@ typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
/**
* xmlDOMWrapAcquireNsFunction:
* @ctxt: a DOM wrapper context
* @node: the context node (element or attribute)
* @nsName: the requested namespace name
* @nsPrefix: the requested namespace prefix
* @param ctxt a DOM wrapper context
* @param node the context node (element or attribute)
* @param nsName the requested namespace name
* @param nsPrefix the requested namespace prefix
*
* A function called to acquire namespaces (xmlNs) from the wrapper.
*
* Returns an xmlNsPtr or NULL in case of an error.
* @returns an xmlNsPtr or NULL in case of an error.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
xmlNodePtr node,
@ -615,7 +596,6 @@ typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
const xmlChar *nsPrefix);
/**
* xmlDOMWrapCtxt:
*
* Context for DOM wrapper-operations.
*/
@ -638,23 +618,20 @@ struct _xmlDOMWrapCtxt {
};
/**
* xmlRegisterNodeFunc:
* @node: the current node
* @param node the current node
*
* Signature for the registration callback of a created node
*/
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
/**
* xmlDeregisterNodeFunc:
* @node: the current node
* @param node the current node
*
* Signature for the deregistration callback of a discarded node
*/
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
/**
* xmlChildrenNode:
*
* Macro for compatibility naming layer with libxml1. Maps
* to "children."
@ -664,7 +641,6 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
#endif
/**
* xmlRootNode:
*
* Macro for compatibility naming layer with libxml1. Maps
* to "children".
@ -677,7 +653,7 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
* Variables.
*/
/** DOC_DISABLE */
/** @cond IGNORE */
XML_DEPRECATED
XMLPUBFUN xmlRegisterNodeFunc *__xmlRegisterNodeDefaultValue(void);
XML_DEPRECATED
@ -689,7 +665,7 @@ XMLPUBFUN xmlDeregisterNodeFunc *__xmlDeregisterNodeDefaultValue(void);
#define xmlDeregisterNodeDefaultValue \
(*__xmlDeregisterNodeDefaultValue())
#endif
/** DOC_ENABLE */
/** @endcond */
/*
* Some helper functions
@ -721,7 +697,7 @@ XMLPUBFUN const xmlChar *
int *len);
/*
* Handling Buffers, the old ones see @xmlBuf for the new ones.
* Handling Buffers, the old ones see `xmlBuf` for the new ones.
*/
XML_DEPRECATED

View File

@ -1,11 +1,14 @@
/**
* Summary: library of generic URI related routines
* Description: library of generic URI related routines
* @file
* *
* @brief library of generic URI related routines
*
* library of generic URI related routines
* Implements RFC 2396
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_URI_H__
@ -20,14 +23,13 @@ extern "C" {
#endif
/**
* xmlURI:
*
* A parsed URI reference. This is a struct containing the various fields
* as described in RFC 2396 but separated for further processing.
*
* Note: query is a deprecated field which is incorrectly unescaped.
* query_raw takes precedence over query if the former is set.
* See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
* See: http://mail.gnome.org/archives/xml/2007-April/thread.html\#00127
*/
typedef struct _xmlURI xmlURI;
typedef xmlURI *xmlURIPtr;

View File

@ -1,10 +1,13 @@
/*
* Summary: The DTD validation
* Description: API for the DTD handling and the validity checking
/**
* @file
*
* @brief The DTD validation
*
* API for the DTD handling and the validity checking
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
@ -31,11 +34,10 @@ typedef struct _xmlValidState xmlValidState;
typedef xmlValidState *xmlValidStatePtr;
/**
* xmlValidityErrorFunc:
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
* @param ctx usually an xmlValidCtxtPtr to a validity error context,
* but comes from ctxt->userData (which normally contains such
* a pointer); ctxt->userData can be changed by the user.
* @msg: the string to format *printf like vararg
* @param msg the string to format *printf like vararg
* @...: remaining arguments to the format
*
* Callback called when a validity error is found. This is a message
@ -46,11 +48,10 @@ typedef void (*xmlValidityErrorFunc) (void *ctx,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlValidityWarningFunc:
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
* @param ctx usually an xmlValidCtxtPtr to a validity error context,
* but comes from ctxt->userData (which normally contains such
* a pointer); ctxt->userData can be changed by the user.
* @msg: the string to format *printf like vararg
* @param msg the string to format *printf like vararg
* @...: remaining arguments to the format
*
* Callback called when a validity warning is found. This is a message
@ -61,7 +62,6 @@ typedef void (*xmlValidityWarningFunc) (void *ctx,
...) LIBXML_ATTR_FORMAT(2,3);
/*
* xmlValidCtxt:
* An xmlValidCtxt is used for error reporting when validating.
*/
typedef struct _xmlValidCtxt xmlValidCtxt;

View File

@ -1,13 +1,16 @@
/*
* Summary: implementation of XInclude
* Description: API to handle XInclude processing,
/**
* @file
*
* @brief implementation of XInclude
*
* API to handle XInclude processing,
* implements the
* World Wide Web Consortium Last Call Working Draft 10 November 2003
* http://www.w3.org/TR/2003/WD-xinclude-20031110
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XINCLUDE_H__

View File

@ -1,10 +1,13 @@
/*
* Summary: unfinished XLink detection module
* Description: unfinished XLink detection module
/**
* @file
*
* @brief unfinished XLink detection module
*
* unfinished XLink detection module
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XLINK_H__
@ -54,9 +57,8 @@ typedef enum {
} xlinkActuate;
/**
* xlinkNodeDetectFunc:
* @ctx: user data pointer
* @node: the node to check
* @param ctx user data pointer
* @param node the node to check
*
* This is the prototype for the link detection routine.
* It calls the default link detection callbacks upon link detection.
@ -69,12 +71,11 @@ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
*/
/**
* xlinkSimpleLinkFunk:
* @ctx: user data pointer
* @node: the node carrying the link
* @href: the target of the link
* @role: the role string
* @title: the link title
* @param ctx user data pointer
* @param node the node carrying the link
* @param href the target of the link
* @param role the role string
* @param title the link title
*
* This is the prototype for a simple link detection callback.
*/
@ -86,20 +87,19 @@ typedef void
const xlinkTitle title);
/**
* xlinkExtendedLinkFunk:
* @ctx: user data pointer
* @node: the node carrying the link
* @nbLocators: the number of locators detected on the link
* @hrefs: pointer to the array of locator hrefs
* @roles: pointer to the array of locator roles
* @nbArcs: the number of arcs detected on the link
* @from: pointer to the array of source roles found on the arcs
* @to: pointer to the array of target roles found on the arcs
* @show: array of values for the show attributes found on the arcs
* @actuate: array of values for the actuate attributes found on the arcs
* @nbTitles: the number of titles detected on the link
* @titles: array of titles detected on the link
* @langs: array of xml:lang values for the titles
* @param ctx user data pointer
* @param node the node carrying the link
* @param nbLocators the number of locators detected on the link
* @param hrefs pointer to the array of locator hrefs
* @param roles pointer to the array of locator roles
* @param nbArcs the number of arcs detected on the link
* @param from pointer to the array of source roles found on the arcs
* @param to pointer to the array of target roles found on the arcs
* @param show array of values for the show attributes found on the arcs
* @param actuate array of values for the actuate attributes found on the arcs
* @param nbTitles the number of titles detected on the link
* @param titles array of titles detected on the link
* @param langs array of xml:lang values for the titles
*
* This is the prototype for a extended link detection callback.
*/
@ -119,15 +119,14 @@ typedef void
const xmlChar **langs);
/**
* xlinkExtendedLinkSetFunk:
* @ctx: user data pointer
* @node: the node carrying the link
* @nbLocators: the number of locators detected on the link
* @hrefs: pointer to the array of locator hrefs
* @roles: pointer to the array of locator roles
* @nbTitles: the number of titles detected on the link
* @titles: array of titles detected on the link
* @langs: array of xml:lang values for the titles
* @param ctx user data pointer
* @param node the node carrying the link
* @param nbLocators the number of locators detected on the link
* @param hrefs pointer to the array of locator hrefs
* @param roles pointer to the array of locator roles
* @param nbTitles the number of titles detected on the link
* @param titles array of titles detected on the link
* @param langs array of xml:lang values for the titles
*
* This is the prototype for a extended link set detection callback.
*/

View File

@ -1,10 +1,13 @@
/*
* Summary: interface for the I/O interfaces used by the parser
* Description: interface for the I/O interfaces used by the parser
/**
* @file
*
* @brief interface for the I/O interfaces used by the parser
*
* interface for the I/O interfaces used by the parser
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_IO_H__
@ -27,42 +30,38 @@ extern "C" {
*/
/**
* xmlInputMatchCallback:
* @filename: the filename or URI
* @param filename the filename or URI
*
* Callback used in the I/O Input API to detect if the current handler
* can provide input functionality for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
* @returns 1 if yes and 0 if another Input module should be used
*/
typedef int (*xmlInputMatchCallback) (char const *filename);
/**
* xmlInputOpenCallback:
* @filename: the filename or URI
* @param filename the filename or URI
*
* Callback used in the I/O Input API to open the resource
*
* Returns an Input context or NULL in case or error
* @returns an Input context or NULL in case or error
*/
typedef void * (*xmlInputOpenCallback) (char const *filename);
/**
* xmlInputReadCallback:
* @context: an Input context
* @buffer: the buffer to store data read
* @len: the length of the buffer in bytes
* @param context an Input context
* @param buffer the buffer to store data read
* @param len the length of the buffer in bytes
*
* Callback used in the I/O Input API to read the resource
*
* Returns the number of bytes read or -1 in case of error
* @returns the number of bytes read or -1 in case of error
*/
typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
/**
* xmlInputCloseCallback:
* @context: an Input context
* @param context an Input context
*
* Callback used in the I/O Input API to close the resource
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
typedef int (*xmlInputCloseCallback) (void * context);
@ -73,71 +72,65 @@ typedef int (*xmlInputCloseCallback) (void * context);
*/
/**
* xmlOutputMatchCallback:
* @filename: the filename or URI
* @param filename the filename or URI
*
* Callback used in the I/O Output API to detect if the current handler
* can provide output functionality for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
* @returns 1 if yes and 0 if another Output module should be used
*/
typedef int (*xmlOutputMatchCallback) (char const *filename);
/**
* xmlOutputOpenCallback:
* @filename: the filename or URI
* @param filename the filename or URI
*
* Callback used in the I/O Output API to open the resource
*
* Returns an Output context or NULL in case or error
* @returns an Output context or NULL in case or error
*/
typedef void * (*xmlOutputOpenCallback) (char const *filename);
/**
* xmlOutputWriteCallback:
* @context: an Output context
* @buffer: the buffer of data to write
* @len: the length of the buffer in bytes
* @param context an Output context
* @param buffer the buffer of data to write
* @param len the length of the buffer in bytes
*
* Callback used in the I/O Output API to write to the resource
*
* Returns the number of bytes written or -1 in case of error
* @returns the number of bytes written or -1 in case of error
*/
typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
int len);
/**
* xmlOutputCloseCallback:
* @context: an Output context
* @param context an Output context
*
* Callback used in the I/O Output API to close the resource
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
typedef int (*xmlOutputCloseCallback) (void * context);
#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferCreateFilenameFunc:
* @URI: the URI to read from
* @enc: the requested source encoding
* @param URI the URI to read from
* @param enc the requested source encoding
*
* Signature for the function doing the lookup for a suitable input method
* corresponding to an URI.
*
* Returns the new xmlParserInputBufferPtr in case of success or NULL if no
* @returns the new xmlParserInputBufferPtr in case of success or NULL if no
* method was found.
*/
typedef xmlParserInputBufferPtr
(*xmlParserInputBufferCreateFilenameFunc)(const char *URI, xmlCharEncoding enc);
/**
* xmlOutputBufferCreateFilenameFunc:
* @URI: the URI to write to
* @encoder: the requested target encoding
* @compression: compression level
* @param URI the URI to write to
* @param encoder the requested target encoding
* @param compression compression level
*
* Signature for the function doing the lookup for a suitable output method
* corresponding to an URI.
*
* Returns the new xmlOutputBufferPtr in case of success or NULL if no
* @returns the new xmlOutputBufferPtr in case of success or NULL if no
* method was found.
*/
typedef xmlOutputBufferPtr
@ -174,7 +167,7 @@ struct _xmlOutputBuffer {
};
#endif /* LIBXML_OUTPUT_ENABLED */
/** DOC_DISABLE */
/** @cond IGNORE */
XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc *
__xmlParserInputBufferCreateFilenameValue(void);
@ -188,7 +181,7 @@ __xmlOutputBufferCreateFilenameValue(void);
#define xmlOutputBufferCreateFilenameValue \
(*__xmlOutputBufferCreateFilenameValue())
#endif
/** DOC_ENABLE */
/** @endcond */
/*
* Interfaces for input
@ -364,7 +357,7 @@ XMLPUBFUN int
* Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_STUBS_ENABLED
/** DOC_DISABLE */
/** @cond IGNORE */
XML_DEPRECATED
XMLPUBFUN int
xmlIOHTTPMatch (const char *filename);
@ -388,7 +381,7 @@ XMLPUBFUN int
XML_DEPRECATED
XMLPUBFUN int
xmlIOHTTPClose (void * context);
/** DOC_ENABLE */
/** @endcond */
#endif /* LIBXML_HTTP_STUBS_ENABLED */
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc

View File

@ -1,10 +1,13 @@
/*
* Summary: API to build regexp automata
* Description: the API to build regexp automata
/**
* @file
*
* @brief API to build regexp automata
*
* the API to build regexp automata
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_AUTOMATA_H__
@ -21,7 +24,6 @@ extern "C" {
#endif
/**
* xmlAutomataPtr:
*
* A libxml automata description, It can be compiled into a regexp
*/
@ -29,7 +31,6 @@ typedef struct _xmlAutomata xmlAutomata;
typedef xmlAutomata *xmlAutomataPtr;
/**
* xmlAutomataStatePtr:
*
* A state int the automata description,
*/

View File

@ -1,10 +1,13 @@
/*
* Summary: error handling
* Description: the API used to report errors
/**
* @file
*
* @brief error handling
*
* the API used to report errors
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_ERROR_H__
@ -22,7 +25,6 @@ extern "C" {
#define initGenericErrorDefaultFunc(h) xmlSetGenericErrorFunc(NULL, *(h))
/**
* xmlErrorLevel:
*
* Indicates the level of an error
*/
@ -34,7 +36,6 @@ typedef enum {
} xmlErrorLevel;
/**
* xmlErrorDomain:
*
* Indicates where an error may have come from
*/
@ -73,7 +74,6 @@ typedef enum {
} xmlErrorDomain;
/**
* xmlError:
*
* An XML Error instance.
*/
@ -97,7 +97,6 @@ struct _xmlError {
};
/**
* xmlParserError:
*
* This is an error that the XML (or HTML) parser can generate
*/
@ -848,9 +847,8 @@ typedef enum {
} xmlParserErrors;
/**
* xmlGenericErrorFunc:
* @ctx: a parsing context
* @msg: the message
* @param ctx a parsing context
* @param msg the message
* @...: the extra arguments of the varargs to format the message
*
* Signature of the function to use when there is an error and
@ -860,16 +858,15 @@ typedef void (*xmlGenericErrorFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlStructuredErrorFunc:
* @userData: user provided data for the error callback
* @error: the error being raised.
* @param userData user provided data for the error callback
* @param error the error being raised.
*
* Signature of the function to use when there is an error and
* the module handles the new error reporting mechanism.
*/
typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
/** DOC_DISABLE */
/** @cond IGNORE */
XML_DEPRECATED
XMLPUBFUN const xmlError *__xmlLastError(void);
@ -885,7 +882,7 @@ XMLPUBFUN void **__xmlStructuredErrorContext(void);
#define xmlStructuredError (*__xmlStructuredError())
#define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
#endif
/** DOC_ENABLE */
/** @endcond */
/*
* Use the following function to reset the two global variables
@ -926,9 +923,9 @@ XMLPUBFUN void
xmlParserValidityWarning (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/** DOC_DISABLE */
/** @cond IGNORE */
struct _xmlParserInput;
/** DOC_ENABLE */
/** @endcond */
XMLPUBFUN void
xmlParserPrintFileInfo (struct _xmlParserInput *input);
XMLPUBFUN void

View File

@ -1,8 +1,11 @@
/*
* Summary: macros for marking symbols as exportable/importable.
* Description: macros for marking symbols as exportable/importable.
/**
* @file
*
* @brief macros for marking symbols as exportable/importable.
*
* macros for marking symbols as exportable/importable.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*/
#ifndef __XML_EXPORTS_H__

View File

@ -1,11 +1,14 @@
/*
* Summary: interface for the memory allocator
* Description: provides interfaces for the memory allocator,
/**
* @file
*
* @brief interface for the memory allocator
*
* provides interfaces for the memory allocator,
* including debugging capabilities.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
@ -23,40 +26,36 @@ extern "C" {
* The XML memory wrapper support 4 basic overloadable functions.
*/
/**
* xmlFreeFunc:
* @mem: an already allocated block of memory
* @param mem an already allocated block of memory
*
* Signature for a free() implementation.
*/
typedef void (*xmlFreeFunc)(void *mem);
/**
* xmlMallocFunc:
* @size: the size requested in bytes
* @param size the size requested in bytes
*
* Signature for a malloc() implementation.
*
* Returns a pointer to the newly allocated block or NULL in case of error.
* @returns a pointer to the newly allocated block or NULL in case of error.
*/
typedef void *(*xmlMallocFunc)(size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
/**
* xmlReallocFunc:
* @mem: an already allocated block of memory
* @size: the new size requested in bytes
* @param mem an already allocated block of memory
* @param size the new size requested in bytes
*
* Signature for a realloc() implementation.
*
* Returns a pointer to the newly reallocated block or NULL in case of error.
* @returns a pointer to the newly reallocated block or NULL in case of error.
*/
typedef void *(*xmlReallocFunc)(void *mem, size_t size);
/**
* xmlStrdupFunc:
* @str: a zero terminated string
* @param str a zero terminated string
*
* Signature for an strdup() implementation.
*
* Returns the copy of the string or NULL in case of error.
* @returns the copy of the string or NULL in case of error.
*/
typedef char *(*xmlStrdupFunc)(const char *str);
@ -71,7 +70,7 @@ typedef char *(*xmlStrdupFunc)(const char *str);
*/
#ifdef LIBXML_THREAD_ALLOC_ENABLED
/** DOC_DISABLE */
/** @cond IGNORE */
XMLPUBFUN xmlMallocFunc *__xmlMalloc(void);
XMLPUBFUN xmlMallocFunc *__xmlMallocAtomic(void);
XMLPUBFUN xmlReallocFunc *__xmlRealloc(void);
@ -85,7 +84,7 @@ XMLPUBFUN xmlStrdupFunc *__xmlMemStrdup(void);
#define xmlFree (*__xmlFree())
#define xmlMemStrdup (*__xmlMemStrdup())
#endif
/** DOC_ENABLE */
/** @endcond */
#else
XMLPUBVAR xmlMallocFunc xmlMalloc;

View File

@ -1,11 +1,14 @@
/*
* Summary: dynamic module loading
* Description: basic API for dynamic module loading, used by
/**
* @file
*
* @brief dynamic module loading
*
* basic API for dynamic module loading, used by
* libexslt added in 2.6.17
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Joel W. Reed
* @author Joel W. Reed
*/
#ifndef __XML_MODULE_H__
@ -20,7 +23,6 @@ extern "C" {
#endif
/**
* xmlModulePtr:
*
* A handle to a dynamically loaded module
*/
@ -28,7 +30,6 @@ typedef struct _xmlModule xmlModule;
typedef xmlModule *xmlModulePtr;
/**
* xmlModuleOption:
*
* enumeration of options that can be passed down to xmlModuleOpen()
*/

View File

@ -1,10 +1,13 @@
/*
* Summary: the XMLReader implementation
* Description: API of the XML streaming API based on C# interfaces.
/**
* @file
*
* @brief the XMLReader implementation
*
* API of the XML streaming API based on C\# interfaces.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XMLREADER_H__
@ -27,7 +30,6 @@ extern "C" {
#endif
/**
* xmlParserSeverities:
*
* How severe an error callback is when the per-reader error callback API
* is used.
@ -42,7 +44,6 @@ typedef enum {
#ifdef LIBXML_READER_ENABLED
/**
* xmlTextReaderMode:
*
* Internal state values for the reader.
*/
@ -56,7 +57,6 @@ typedef enum {
} xmlTextReaderMode;
/**
* xmlParserProperties:
*
* Some common options to use with xmlTextReaderSetParserProp, but it
* is better to use xmlParserOption and the xmlReaderNewxxx and
@ -70,7 +70,6 @@ typedef enum {
} xmlParserProperties;
/**
* xmlReaderTypes:
*
* Predefined constants for the different types of nodes.
*/
@ -96,14 +95,12 @@ typedef enum {
} xmlReaderTypes;
/**
* xmlTextReader:
*
* Structure for an xmlReader context.
*/
typedef struct _xmlTextReader xmlTextReader;
/**
* xmlTextReaderPtr:
*
* Pointer to an xmlReader context.
*/
@ -400,11 +397,10 @@ XMLPUBFUN int
typedef void * xmlTextReaderLocatorPtr;
/**
* xmlTextReaderErrorFunc:
* @arg: the user argument
* @msg: the message
* @severity: the severity of the error
* @locator: a locator indicating where the error occurred
* @param arg the user argument
* @param msg the message
* @param severity the severity of the error
* @param locator a locator indicating where the error occurred
*
* Signature of an error callback from a reader parser
*/

View File

@ -1,11 +1,14 @@
/*
* Summary: regular expressions handling
* Description: basic API for libxml regular expressions handling used
/**
* @file
*
* @brief regular expressions handling
*
* basic API for libxml regular expressions handling used
* for XML Schemas and validation.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_REGEXP_H__
@ -22,7 +25,6 @@ extern "C" {
#endif
/**
* xmlRegexpPtr:
*
* A libxml regular expression, they can actually be far more complex
* thank the POSIX regex expressions.
@ -31,7 +33,6 @@ typedef struct _xmlRegexp xmlRegexp;
typedef xmlRegexp *xmlRegexpPtr;
/**
* xmlRegExecCtxtPtr:
*
* A libxml progressive regular expression evaluation context
*/
@ -55,11 +56,10 @@ XMLPUBFUN int
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:
* @exec: the regular expression context
* @token: the current token string
* @transdata: transition data
* @inputdata: input data
* @param exec the regular expression context
* @param token the current token string
* @param transdata transition data
* @param inputdata input data
*
* Callback function when doing a transition in the automata
*/

View File

@ -1,10 +1,13 @@
/*
* Summary: the XML document serializer
* Description: API to save document or subtree of document
/**
* @file
*
* @brief the XML document serializer
*
* API to save document or subtree of document
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XMLSAVE_H__
@ -21,7 +24,6 @@ extern "C" {
#endif
/**
* xmlSaveOption:
*
* This is the set of XML save options that can be passed down
* to the xmlSaveToFd() and similar calls.

View File

@ -1,11 +1,14 @@
/*
* Summary: incomplete XML Schemas structure implementation
* Description: interface to the XML Schemas handling and schema validity
/**
* @file
*
* @brief incomplete XML Schemas structure implementation
*
* interface to the XML Schemas handling and schema validity
* checking, it is incomplete right now.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
@ -64,7 +67,6 @@ typedef enum {
* options below.
*/
/**
* xmlSchemaValidOption:
*
* This is the set of XML Schema validation options.
*/
@ -89,9 +91,8 @@ typedef struct _xmlSchema xmlSchema;
typedef xmlSchema *xmlSchemaPtr;
/**
* xmlSchemaValidityErrorFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of an error callback from an XSD validation
@ -100,9 +101,8 @@ typedef void (*xmlSchemaValidityErrorFunc)
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* xmlSchemaValidityWarningFunc:
* @ctx: the validation context
* @msg: the message
* @param ctx the validation context
* @param msg the message
* @...: extra arguments
*
* Signature of a warning callback from an XSD validation
@ -120,16 +120,15 @@ typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
/**
* xmlSchemaValidityLocatorFunc:
* @ctx: user provided context
* @file: returned file information
* @line: returned line information
* @param ctx user provided context
* @param file returned file information
* @param line returned line information
*
* A schemas validation locator, a callback called by the validator.
* This is used when file or node information are not available
* to find out what file and line number are affected
*
* Returns: 0 in case of success and -1 in case of error
* @returns 0 in case of success and -1 in case of error
*/
typedef int (*xmlSchemaValidityLocatorFunc) (void *ctx,

View File

@ -1,11 +1,14 @@
/*
* Summary: implementation of XML Schema Datatypes
* Description: module providing the XML Schema Datatypes implementation
/**
* @file
*
* @brief implementation of XML Schema Datatypes
*
* module providing the XML Schema Datatypes implementation
* both definition and validity checking
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/

View File

@ -1,11 +1,14 @@
/*
* Summary: set of routines to process strings
* Description: type and interfaces needed for the internal string handling
/**
* @file
*
* @brief set of routines to process strings
*
* type and interfaces needed for the internal string handling
* of the library, especially UTF8 processing.
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_STRING_H__
@ -19,7 +22,6 @@ extern "C" {
#endif
/**
* xmlChar:
*
* This is a basic byte in an UTF-8 encoded string.
* It's unsigned allowing to pinpoint case where char * are assigned

View File

@ -1,6 +1,9 @@
/*
* Summary: Unicode character APIs
* Description: API for the Unicode character APIs
/**
* @file
*
* @brief Unicode character APIs
*
* API for the Unicode character APIs
*
* Deprecated, don't use.
*/

View File

@ -1,10 +1,13 @@
/*
* Summary: text writing API for XML
* Description: text writing API for XML
/**
* @file
*
* @brief text writing API for XML
*
* text writing API for XML
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Alfred Mickautsch
* @author Alfred Mickautsch
*/
#ifndef __XML_XMLWRITER_H__
@ -268,7 +271,6 @@ extern "C" {
const xmlChar * content);
/**
* xmlTextWriterWriteProcessingInstruction:
*
* This macro maps to xmlTextWriterWritePI
*/
@ -330,7 +332,6 @@ extern "C" {
const xmlChar * subset);
/**
* xmlTextWriterWriteDocType:
*
* this macro maps to xmlTextWriterWriteDTD
*/

View File

@ -1,6 +1,9 @@
/*
* Summary: XML Path Language implementation
* Description: API for the XML Path Language implementation
/**
* @file
*
* @brief XML Path Language implementation
*
* API for the XML Path Language implementation
*
* XML Path Language implementation
* XPath is a language for addressing parts of an XML document,
@ -11,9 +14,9 @@
* W3C Recommendation 16 November 1999
* http://www.w3.org/TR/1999/REC-xpath-19991116
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XPATH_H__
@ -103,11 +106,11 @@ typedef enum {
XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
} xmlXPathObjectType;
/** DOC_DISABLE */
/** @cond IGNORE */
#define XPATH_POINT 5
#define XPATH_RANGE 6
#define XPATH_LOCATIONSET 7
/** DOC_ENABLE */
/** @endcond */
typedef struct _xmlXPathObject xmlXPathObject;
typedef xmlXPathObject *xmlXPathObjectPtr;
@ -124,14 +127,13 @@ struct _xmlXPathObject {
};
/**
* xmlXPathConvertFunc:
* @obj: an XPath object
* @type: the number of the target type
* @param obj an XPath object
* @param type the number of the target type
*
* A conversion function is associated to a type and used to cast
* the new type to primitive values.
*
* Returns -1 in case of error, 0 otherwise
* @returns -1 in case of error, 0 otherwise
*/
typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type);
@ -158,9 +160,8 @@ struct _xmlXPathVariable {
};
/**
* xmlXPathEvalFunc:
* @ctxt: an XPath parser context
* @nargs: the number of arguments passed to the function
* @param ctxt an XPath parser context
* @param nargs the number of arguments passed to the function
*
* An XPath evaluation function, the parameters are on the XPath context stack.
*/
@ -180,15 +181,14 @@ struct _xmlXPathFunct {
};
/**
* xmlXPathAxisFunc:
* @ctxt: the XPath interpreter context
* @cur: the previous node being explored on that axis
* @param ctxt the XPath interpreter context
* @param cur the previous node being explored on that axis
*
* An axis traversal function. To traverse an axis, the engine calls
* the first time with cur == NULL and repeat until the function returns
* NULL indicating the end of the axis traversal.
*
* Returns the next node in that axis or NULL if at the end of the axis.
* @returns the next node in that axis or NULL if at the end of the axis.
*/
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
@ -206,9 +206,8 @@ struct _xmlXPathAxis {
};
/**
* xmlXPathFunction:
* @ctxt: the XPath interprestation context
* @nargs: the number of arguments
* @param ctxt the XPath interprestation context
* @param nargs the number of arguments
*
* An XPath function.
* The arguments (if any) are popped out from the context stack
@ -222,37 +221,34 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
*/
/**
* xmlXPathVariableLookupFunc:
* @ctxt: an XPath context
* @name: name of the variable
* @ns_uri: the namespace name hosting this variable
* @param ctxt an XPath context
* @param name name of the variable
* @param ns_uri the namespace name hosting this variable
*
* Prototype for callbacks used to plug variable lookup in the XPath
* engine.
*
* Returns the XPath object value or NULL if not found.
* @returns the XPath object value or NULL if not found.
*/
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
/**
* xmlXPathFuncLookupFunc:
* @ctxt: an XPath context
* @name: name of the function
* @ns_uri: the namespace name hosting this function
* @param ctxt an XPath context
* @param name name of the function
* @param ns_uri the namespace name hosting this function
*
* Prototype for callbacks used to plug function lookup in the XPath
* engine.
*
* Returns the XPath function or NULL if not found.
* @returns the XPath function or NULL if not found.
*/
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
/**
* xmlXPathFlags:
* Flags for XPath engine compilation and runtime
*/
/**
@ -269,7 +265,6 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
#define XML_XPATH_NOVAR (1<<1)
/**
* xmlXPathContext:
*
* Expression evaluation occurs with respect to a context.
* he context consists of:
@ -367,7 +362,6 @@ typedef struct _xmlXPathCompExpr xmlXPathCompExpr;
typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
/**
* xmlXPathParserContext:
*
* An XPath parser context. It contains pure parsing information,
* an xmlXPathContext, and the stack of objects.
@ -410,23 +404,21 @@ XMLPUBVAR double xmlXPathNINF;
/* These macros may later turn into functions */
/**
* xmlXPathNodeSetGetLength:
* @ns: a node-set
* @param ns a node-set
*
* Implement a functionality similar to the DOM NodeList.length.
*
* Returns the number of nodes in the node-set.
* @returns the number of nodes in the node-set.
*/
#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
/**
* xmlXPathNodeSetItem:
* @ns: a node-set
* @index: index of a node in the set
* @param ns a node-set
* @param index index of a node in the set
*
* Implements a functionality similar to the DOM NodeList.item().
*
* Returns the xmlNodePtr at the given @index in @ns or NULL if
* @index is out of range (0 to length-1)
* @returns the xmlNodePtr at the given `index` in `ns` or NULL if
* `index` is out of range (0 to length-1)
*/
#define xmlXPathNodeSetItem(ns, index) \
((((ns) != NULL) && \
@ -434,12 +426,11 @@ XMLPUBVAR double xmlXPathNINF;
(ns)->nodeTab[(index)] \
: NULL)
/**
* xmlXPathNodeSetIsEmpty:
* @ns: a node-set
* @param ns a node-set
*
* Checks whether @ns is empty or not.
* Checks whether `ns` is empty or not.
*
* Returns %TRUE if @ns is an empty node-set.
* @returns %TRUE if `ns` is an empty node-set.
*/
#define xmlXPathNodeSetIsEmpty(ns) \
(((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))

View File

@ -1,12 +1,15 @@
/*
* Summary: internal interfaces for XML Path Language implementation
* Description: internal interfaces for XML Path Language implementation
/**
* @file
*
* @brief internal interfaces for XML Path Language implementation
*
* internal interfaces for XML Path Language implementation
* used to build new modules on top of XPath like XPointer and
* XSLT
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XPATH_INTERNALS_H__
@ -36,12 +39,11 @@ extern "C" {
/*
* Many of these macros may later turn into functions. They
* shouldn't be used in #ifdef's preprocessor instructions.
* shouldn't be used in \#ifdef's preprocessor instructions.
*/
/**
* xmlXPathSetError:
* @ctxt: an XPath parser context
* @err: an xmlXPathError code
* @param ctxt an XPath parser context
* @param err an xmlXPathError code
*
* Raises an error.
*/
@ -50,8 +52,7 @@ extern "C" {
if ((ctxt) != NULL) (ctxt)->error = (err); }
/**
* xmlXPathSetArityError:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Raises an XPATH_INVALID_ARITY error.
*/
@ -59,8 +60,7 @@ extern "C" {
xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
/**
* xmlXPathSetTypeError:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Raises an XPATH_INVALID_TYPE error.
*/
@ -68,42 +68,38 @@ extern "C" {
xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
/**
* xmlXPathGetError:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Get the error code of an XPath context.
*
* Returns the context error.
* @returns the context error.
*/
#define xmlXPathGetError(ctxt) ((ctxt)->error)
/**
* xmlXPathCheckError:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Check if an XPath error was raised.
*
* Returns true if an error has been raised, false otherwise.
* @returns true if an error has been raised, false otherwise.
*/
#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
/**
* xmlXPathGetDocument:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Get the document of an XPath context.
*
* Returns the context document.
* @returns the context document.
*/
#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
/**
* xmlXPathGetContextNode:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Get the context node of an XPath context.
*
* Returns the context node.
* @returns the context node.
*/
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
@ -119,54 +115,48 @@ XMLPUBFUN void *
xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/**
* xmlXPathReturnBoolean:
* @ctxt: an XPath parser context
* @val: a boolean
* @param ctxt an XPath parser context
* @param val a boolean
*
* Pushes the boolean @val on the context stack.
* Pushes the boolean `val` on the context stack.
*/
#define xmlXPathReturnBoolean(ctxt, val) \
valuePush((ctxt), xmlXPathNewBoolean(val))
/**
* xmlXPathReturnTrue:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Pushes true on the context stack.
*/
#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
/**
* xmlXPathReturnFalse:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Pushes false on the context stack.
*/
#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
/**
* xmlXPathReturnNumber:
* @ctxt: an XPath parser context
* @val: a double
* @param ctxt an XPath parser context
* @param val a double
*
* Pushes the double @val on the context stack.
* Pushes the double `val` on the context stack.
*/
#define xmlXPathReturnNumber(ctxt, val) \
valuePush((ctxt), xmlXPathNewFloat(val))
/**
* xmlXPathReturnString:
* @ctxt: an XPath parser context
* @str: a string
* @param ctxt an XPath parser context
* @param str a string
*
* Pushes the string @str on the context stack.
* Pushes the string `str` on the context stack.
*/
#define xmlXPathReturnString(ctxt, str) \
valuePush((ctxt), xmlXPathWrapString(str))
/**
* xmlXPathReturnEmptyString:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Pushes an empty string on the stack.
*/
@ -174,18 +164,16 @@ XMLPUBFUN void *
valuePush((ctxt), xmlXPathNewCString(""))
/**
* xmlXPathReturnNodeSet:
* @ctxt: an XPath parser context
* @ns: a node-set
* @param ctxt an XPath parser context
* @param ns a node-set
*
* Pushes the node-set @ns on the context stack.
* Pushes the node-set `ns` on the context stack.
*/
#define xmlXPathReturnNodeSet(ctxt, ns) \
valuePush((ctxt), xmlXPathWrapNodeSet(ns))
/**
* xmlXPathReturnEmptyNodeSet:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Pushes an empty node-set on the context stack.
*/
@ -193,9 +181,8 @@ XMLPUBFUN void *
valuePush((ctxt), xmlXPathNewNodeSet(NULL))
/**
* xmlXPathReturnExternal:
* @ctxt: an XPath parser context
* @val: user data
* @param ctxt an XPath parser context
* @param val user data
*
* Pushes user data on the context stack.
*/
@ -203,13 +190,12 @@ XMLPUBFUN void *
valuePush((ctxt), xmlXPathWrapExternal(val))
/**
* xmlXPathStackIsNodeSet:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Check if the current value on the XPath stack is a node set or
* an XSLT value tree.
*
* Returns true if the current object on the stack is a node-set.
* @returns true if the current object on the stack is a node-set.
*/
#define xmlXPathStackIsNodeSet(ctxt) \
(((ctxt)->value != NULL) \
@ -217,21 +203,19 @@ XMLPUBFUN void *
|| ((ctxt)->value->type == XPATH_XSLT_TREE)))
/**
* xmlXPathStackIsExternal:
* @ctxt: an XPath parser context
* @param ctxt an XPath parser context
*
* Checks if the current value on the XPath stack is an external
* object.
*
* Returns true if the current object on the stack is an external
* @returns true if the current object on the stack is an external
* object.
*/
#define xmlXPathStackIsExternal(ctxt) \
((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
/**
* xmlXPathEmptyNodeSet:
* @ns: a node-set
* @param ns a node-set
*
* Empties a node-set.
*/
@ -256,7 +240,7 @@ XMLPUBFUN void *
/**
* XP_ERROR:
* @X: the error code
* @param X the error code
*
* Macro to raise an XPath error and return.
*/
@ -265,7 +249,7 @@ XMLPUBFUN void *
/**
* XP_ERROR0:
* @X: the error code
* @param X the error code
*
* Macro to raise an XPath error and return 0.
*/
@ -274,7 +258,7 @@ XMLPUBFUN void *
/**
* CHECK_TYPE:
* @typeval: the XPath type
* @param typeval the XPath type
*
* Macro to check that the value on top of the XPath stack is of a given
* type.
@ -285,7 +269,7 @@ XMLPUBFUN void *
/**
* CHECK_TYPE0:
* @typeval: the XPath type
* @param typeval the XPath type
*
* Macro to check that the value on top of the XPath stack is of a given
* type. Return(0) in case of failure
@ -296,7 +280,7 @@ XMLPUBFUN void *
/**
* CHECK_ARITY:
* @x: the number of expected args
* @param x the number of expected args
*
* Macro to check that the number of args passed to an XPath function matches.
*/

View File

@ -1,6 +1,9 @@
/*
* Summary: API to handle XML Pointers
* Description: API to handle XML Pointers
/**
* @file
*
* @brief API to handle XML Pointers
*
* API to handle XML Pointers
* Base implementation was made accordingly to
* W3C Candidate Recommendation 7 June 2000
* http://www.w3.org/TR/2000/CR-xptr-20000607
@ -9,9 +12,9 @@
* W3C Proposed Recommendation 13 November 2002
* http://www.w3.org/TR/2002/PR-xptr-element-20021113/
*
* Copy: See Copyright for the status of this software.
* @copyright See Copyright for the status of this software.
*
* Author: Daniel Veillard
* @author Daniel Veillard
*/
#ifndef __XML_XPTR_H__

190
list.c
View File

@ -49,11 +49,10 @@ struct _xmlList
************************************************************************/
/**
* xmlLinkDeallocator:
* @l: a list
* @lk: a link
* @param l a list
* @param lk a link
*
* Unlink and deallocate @lk from list @l
* Unlink and deallocate `lk` from list `l`
*/
static void
xmlLinkDeallocator(xmlListPtr l, xmlLinkPtr lk)
@ -66,13 +65,12 @@ xmlLinkDeallocator(xmlListPtr l, xmlLinkPtr lk)
}
/**
* xmlLinkCompare:
* @data0: first data
* @data1: second data
* @param data0 first data
* @param data1 second data
*
* Compares two arbitrary data
*
* Returns -1, 0 or 1 depending on whether data1 is greater equal or smaller
* @returns -1, 0 or 1 depending on whether data1 is greater equal or smaller
* than data0
*/
static int
@ -86,13 +84,12 @@ xmlLinkCompare(const void *data0, const void *data1)
}
/**
* xmlListLowerSearch:
* @l: a list
* @data: a data
* @param l a list
* @param data a data
*
* Search data in the ordered list walking from the beginning
*
* Returns the link containing the data or NULL
* @returns the link containing the data or NULL
*/
static xmlLinkPtr
xmlListLowerSearch(xmlListPtr l, void *data)
@ -106,13 +103,12 @@ xmlListLowerSearch(xmlListPtr l, void *data)
}
/**
* xmlListHigherSearch:
* @l: a list
* @data: a data
* @param l a list
* @param data a data
*
* Search data in the ordered list walking backward from the end
*
* Returns the link containing the data or NULL
* @returns the link containing the data or NULL
*/
static xmlLinkPtr
xmlListHigherSearch(xmlListPtr l, void *data)
@ -126,13 +122,12 @@ xmlListHigherSearch(xmlListPtr l, void *data)
}
/**
* xmlListSearch:
* @l: a list
* @data: a data
* @param l a list
* @param data a data
*
* Search data in the list
*
* Returns the link containing the data or NULL
* @returns the link containing the data or NULL
*/
static xmlLinkPtr
xmlListLinkSearch(xmlListPtr l, void *data)
@ -151,13 +146,12 @@ xmlListLinkSearch(xmlListPtr l, void *data)
}
/**
* xmlListLinkReverseSearch:
* @l: a list
* @data: a data
* @param l a list
* @param data a data
*
* Search data in the list processing backward
*
* Returns the link containing the data or NULL
* @returns the link containing the data or NULL
*/
static xmlLinkPtr
xmlListLinkReverseSearch(xmlListPtr l, void *data)
@ -176,13 +170,12 @@ xmlListLinkReverseSearch(xmlListPtr l, void *data)
}
/**
* xmlListCreate:
* @deallocator: an optional deallocator function
* @compare: an optional comparison function
* @param deallocator an optional deallocator function
* @param compare an optional comparison function
*
* Create a new list
*
* Returns the new list or NULL in case of error
* @returns the new list or NULL in case of error
*/
xmlListPtr
xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
@ -216,13 +209,12 @@ xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
}
/**
* xmlListSearch:
* @l: a list
* @data: a search value
* @param l a list
* @param data a search value
*
* Search the list for an existing value of @data
* Search the list for an existing value of `data`
*
* Returns the value associated to @data or NULL in case of error
* @returns the value associated to `data` or NULL in case of error
*/
void *
xmlListSearch(xmlListPtr l, void *data)
@ -237,13 +229,12 @@ xmlListSearch(xmlListPtr l, void *data)
}
/**
* xmlListReverseSearch:
* @l: a list
* @data: a search value
* @param l a list
* @param data a search value
*
* Search the list in reverse order for an existing value of @data
* Search the list in reverse order for an existing value of `data`
*
* Returns the value associated to @data or NULL in case of error
* @returns the value associated to `data` or NULL in case of error
*/
void *
xmlListReverseSearch(xmlListPtr l, void *data)
@ -258,13 +249,12 @@ xmlListReverseSearch(xmlListPtr l, void *data)
}
/**
* xmlListInsert:
* @l: a list
* @data: the data
* @param l a list
* @param data the data
*
* Insert data in the ordered list at the beginning for this value
*
* Returns 0 in case of success, 1 in case of failure
* @returns 0 in case of success, 1 in case of failure
*/
int
xmlListInsert(xmlListPtr l, void *data)
@ -288,13 +278,12 @@ xmlListInsert(xmlListPtr l, void *data)
}
/**
* xmlListAppend:
* @l: a list
* @data: the data
* @param l a list
* @param data the data
*
* Insert data in the ordered list at the end for this value
*
* Returns 0 in case of success, 1 in case of failure
* @returns 0 in case of success, 1 in case of failure
*/
int xmlListAppend(xmlListPtr l, void *data)
{
@ -316,8 +305,7 @@ int xmlListAppend(xmlListPtr l, void *data)
}
/**
* xmlListDelete:
* @l: a list
* @param l a list
*
* Deletes the list and its associated data
*/
@ -332,13 +320,12 @@ void xmlListDelete(xmlListPtr l)
}
/**
* xmlListRemoveFirst:
* @l: a list
* @data: list data
* @param l a list
* @param data list data
*
* Remove the first instance associated to data in the list
*
* Returns 1 if a deallocation occurred, or 0 if not found
* @returns 1 if a deallocation occurred, or 0 if not found
*/
int
xmlListRemoveFirst(xmlListPtr l, void *data)
@ -357,13 +344,12 @@ xmlListRemoveFirst(xmlListPtr l, void *data)
}
/**
* xmlListRemoveLast:
* @l: a list
* @data: list data
* @param l a list
* @param data list data
*
* Remove the last instance associated to data in the list
*
* Returns 1 if a deallocation occurred, or 0 if not found
* @returns 1 if a deallocation occurred, or 0 if not found
*/
int
xmlListRemoveLast(xmlListPtr l, void *data)
@ -382,13 +368,12 @@ xmlListRemoveLast(xmlListPtr l, void *data)
}
/**
* xmlListRemoveAll:
* @l: a list
* @data: list data
* @param l a list
* @param data list data
*
* Remove the all instance associated to data in the list
*
* Returns the number of deallocation, or 0 if not found
* @returns the number of deallocation, or 0 if not found
*/
int
xmlListRemoveAll(xmlListPtr l, void *data)
@ -404,8 +389,7 @@ xmlListRemoveAll(xmlListPtr l, void *data)
}
/**
* xmlListClear:
* @l: a list
* @param l a list
*
* Remove the all data in the list
*/
@ -426,12 +410,11 @@ xmlListClear(xmlListPtr l)
}
/**
* xmlListEmpty:
* @l: a list
* @param l a list
*
* Is the list empty ?
*
* Returns 1 if the list is empty, 0 if not empty and -1 in case of error
* @returns 1 if the list is empty, 0 if not empty and -1 in case of error
*/
int
xmlListEmpty(xmlListPtr l)
@ -442,12 +425,11 @@ xmlListEmpty(xmlListPtr l)
}
/**
* xmlListFront:
* @l: a list
* @param l a list
*
* Get the first element in the list
*
* Returns the first element in the list, or NULL
* @returns the first element in the list, or NULL
*/
xmlLinkPtr
xmlListFront(xmlListPtr l)
@ -458,12 +440,11 @@ xmlListFront(xmlListPtr l)
}
/**
* xmlListEnd:
* @l: a list
* @param l a list
*
* Get the last element in the list
*
* Returns the last element in the list, or NULL
* @returns the last element in the list, or NULL
*/
xmlLinkPtr
xmlListEnd(xmlListPtr l)
@ -474,12 +455,11 @@ xmlListEnd(xmlListPtr l)
}
/**
* xmlListSize:
* @l: a list
* @param l a list
*
* Get the number of elements in the list
*
* Returns the number of elements in the list or -1 in case of error
* @returns the number of elements in the list or -1 in case of error
*/
int
xmlListSize(xmlListPtr l)
@ -495,8 +475,7 @@ xmlListSize(xmlListPtr l)
}
/**
* xmlListPopFront:
* @l: a list
* @param l a list
*
* Removes the first element in the list
*/
@ -508,8 +487,7 @@ xmlListPopFront(xmlListPtr l)
}
/**
* xmlListPopBack:
* @l: a list
* @param l a list
*
* Removes the last element in the list
*/
@ -521,13 +499,12 @@ xmlListPopBack(xmlListPtr l)
}
/**
* xmlListPushFront:
* @l: a list
* @data: new data
* @param l a list
* @param data new data
*
* add the new data at the beginning of the list
*
* Returns 1 if successful, 0 otherwise
* @returns 1 if successful, 0 otherwise
*/
int
xmlListPushFront(xmlListPtr l, void *data)
@ -550,13 +527,12 @@ xmlListPushFront(xmlListPtr l, void *data)
}
/**
* xmlListPushBack:
* @l: a list
* @data: new data
* @param l a list
* @param data new data
*
* add the new data at the end of the list
*
* Returns 1 if successful, 0 otherwise
* @returns 1 if successful, 0 otherwise
*/
int
xmlListPushBack(xmlListPtr l, void *data)
@ -579,12 +555,11 @@ xmlListPushBack(xmlListPtr l, void *data)
}
/**
* xmlLinkGetData:
* @lk: a link
* @param lk a link
*
* See Returns.
*
* Returns a pointer to the data referenced from this link
* @returns a pointer to the data referenced from this link
*/
void *
xmlLinkGetData(xmlLinkPtr lk)
@ -595,8 +570,7 @@ xmlLinkGetData(xmlLinkPtr lk)
}
/**
* xmlListReverse:
* @l: a list
* @param l a list
*
* Reverse the order of the elements in the list
*/
@ -620,8 +594,7 @@ xmlListReverse(xmlListPtr l)
}
/**
* xmlListSort:
* @l: a list
* @param l a list
*
* Sort all the elements in the list
*/
@ -650,10 +623,9 @@ xmlListSort(xmlListPtr l)
}
/**
* xmlListWalk:
* @l: a list
* @walker: a processing function
* @user: a user parameter passed to the walker function
* @param l a list
* @param walker a processing function
* @param user a user parameter passed to the walker function
*
* Walk all the element of the first from first to last and
* apply the walker function to it
@ -671,10 +643,9 @@ xmlListWalk(xmlListPtr l, xmlListWalker walker, void *user) {
}
/**
* xmlListReverseWalk:
* @l: a list
* @walker: a processing function
* @user: a user parameter passed to the walker function
* @param l a list
* @param walker a processing function
* @param user a user parameter passed to the walker function
*
* Walk all the element of the list in reverse order and
* apply the walker function to it
@ -692,9 +663,8 @@ xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, void *user) {
}
/**
* xmlListMerge:
* @l1: the original list
* @l2: the new list
* @param l1 the original list
* @param l2 the new list
*
* include all the elements of the second list in the first one and
* clear the second list
@ -707,12 +677,11 @@ xmlListMerge(xmlListPtr l1, xmlListPtr l2)
}
/**
* xmlListDup:
* @old: the list
* @param old the list
*
* Duplicate the list
*
* Returns a new copy of the list or NULL in case of error
* @returns a new copy of the list or NULL in case of error
*/
xmlListPtr
xmlListDup(xmlListPtr old)
@ -736,13 +705,12 @@ xmlListDup(xmlListPtr old)
}
/**
* xmlListCopy:
* @cur: the new list
* @old: the old list
* @param cur the new list
* @param old the old list
*
* Move all the element from the old list in the new list
*
* Returns 0 in case of success 1 in case of error
* @returns 0 in case of success 1 in case of error
*/
int
xmlListCopy(xmlListPtr cur, xmlListPtr old)

View File

@ -15,42 +15,38 @@
#include <libxml/xmlIO.h>
/**
* xmlNanoHTTPInit:
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*/
void
xmlNanoHTTPInit(void) {
}
/**
* xmlNanoHTTPCleanup:
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*/
void
xmlNanoHTTPCleanup(void) {
}
/**
* xmlNanoHTTPScanProxy:
* @URL: The proxy URL used to initialize the proxy context
* @param URL The proxy URL used to initialize the proxy context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*/
void
xmlNanoHTTPScanProxy(const char *URL ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPOpen:
* @URL: The URL to load
* @contentType: if available the Content-Type information will be
* @param URL The URL to load
* @param contentType if available the Content-Type information will be
* returned at that location
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void*
xmlNanoHTTPOpen(const char *URL ATTRIBUTE_UNUSED, char **contentType) {
@ -59,15 +55,14 @@ xmlNanoHTTPOpen(const char *URL ATTRIBUTE_UNUSED, char **contentType) {
}
/**
* xmlNanoHTTPOpenRedir:
* @URL: The URL to load
* @contentType: if available the Content-Type information will be
* @param URL The URL to load
* @param contentType if available the Content-Type information will be
* returned at that location
* @redir: if available the redirected URL will be returned
* @param redir if available the redirected URL will be returned
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void*
xmlNanoHTTPOpenRedir(const char *URL ATTRIBUTE_UNUSED, char **contentType,
@ -78,14 +73,13 @@ xmlNanoHTTPOpenRedir(const char *URL ATTRIBUTE_UNUSED, char **contentType,
}
/**
* xmlNanoHTTPRead:
* @ctx: the HTTP context
* @dest: a buffer
* @len: the buffer length
* @param ctx the HTTP context
* @param dest a buffer
* @param len the buffer length
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlNanoHTTPRead(void *ctx ATTRIBUTE_UNUSED, void *dest ATTRIBUTE_UNUSED,
@ -94,28 +88,26 @@ xmlNanoHTTPRead(void *ctx ATTRIBUTE_UNUSED, void *dest ATTRIBUTE_UNUSED,
}
/**
* xmlNanoHTTPClose:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*/
void
xmlNanoHTTPClose(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPMethodRedir:
* @URL: The URL to load
* @method: the HTTP method to use
* @input: the input string if any
* @contentType: the Content-Type information IN and OUT
* @redir: the redirected URL OUT
* @headers: the extra headers
* @ilen: input length
* @param URL The URL to load
* @param method the HTTP method to use
* @param input the input string if any
* @param contentType the Content-Type information IN and OUT
* @param redir the redirected URL OUT
* @param headers the extra headers
* @param ilen input length
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void*
xmlNanoHTTPMethodRedir(const char *URL ATTRIBUTE_UNUSED,
@ -130,17 +122,16 @@ xmlNanoHTTPMethodRedir(const char *URL ATTRIBUTE_UNUSED,
}
/**
* xmlNanoHTTPMethod:
* @URL: The URL to load
* @method: the HTTP method to use
* @input: the input string if any
* @contentType: the Content-Type information IN and OUT
* @headers: the extra headers
* @ilen: input length
* @param URL The URL to load
* @param method the HTTP method to use
* @param input the input string if any
* @param contentType the Content-Type information IN and OUT
* @param headers the extra headers
* @param ilen input length
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void*
xmlNanoHTTPMethod(const char *URL ATTRIBUTE_UNUSED,
@ -153,15 +144,14 @@ xmlNanoHTTPMethod(const char *URL ATTRIBUTE_UNUSED,
}
/**
* xmlNanoHTTPFetch:
* @URL: The URL to load
* @filename: the filename where the content should be saved
* @contentType: if available the Content-Type information will be
* @param URL The URL to load
* @param filename the filename where the content should be saved
* @param contentType if available the Content-Type information will be
* returned at that location
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlNanoHTTPFetch(const char *URL ATTRIBUTE_UNUSED,
@ -172,13 +162,12 @@ xmlNanoHTTPFetch(const char *URL ATTRIBUTE_UNUSED,
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlNanoHTTPSave:
* @ctxt: the HTTP context
* @filename: the filename where the content should be saved
* @param ctxt the HTTP context
* @param filename the filename where the content should be saved
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlNanoHTTPSave(void *ctxt ATTRIBUTE_UNUSED,
@ -188,12 +177,11 @@ xmlNanoHTTPSave(void *ctxt ATTRIBUTE_UNUSED,
#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlNanoHTTPReturnCode:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlNanoHTTPReturnCode(void *ctx ATTRIBUTE_UNUSED) {
@ -201,12 +189,11 @@ xmlNanoHTTPReturnCode(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPAuthHeader:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
const char *
xmlNanoHTTPAuthHeader(void *ctx ATTRIBUTE_UNUSED) {
@ -214,12 +201,11 @@ xmlNanoHTTPAuthHeader(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPContentLength:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlNanoHTTPContentLength(void *ctx ATTRIBUTE_UNUSED) {
@ -227,12 +213,11 @@ xmlNanoHTTPContentLength(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPRedir:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
const char *
xmlNanoHTTPRedir(void *ctx ATTRIBUTE_UNUSED) {
@ -240,12 +225,11 @@ xmlNanoHTTPRedir(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPEncoding:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
const char *
xmlNanoHTTPEncoding(void *ctx ATTRIBUTE_UNUSED) {
@ -253,12 +237,11 @@ xmlNanoHTTPEncoding(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlNanoHTTPMimeType:
* @ctx: the HTTP context
* @param ctx the HTTP context
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
const char *
xmlNanoHTTPMimeType(void *ctx ATTRIBUTE_UNUSED) {
@ -266,12 +249,11 @@ xmlNanoHTTPMimeType(void *ctx ATTRIBUTE_UNUSED) {
}
/**
* xmlIOHTTPMatch:
* @filename: the URI for matching
* @param filename the URI for matching
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns 0.
* @returns 0.
*/
int
xmlIOHTTPMatch(const char *filename ATTRIBUTE_UNUSED) {
@ -279,12 +261,11 @@ xmlIOHTTPMatch(const char *filename ATTRIBUTE_UNUSED) {
}
/**
* xmlIOHTTPOpen:
* @filename: the URI for matching
* @param filename the URI for matching
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void *
xmlIOHTTPOpen(const char *filename ATTRIBUTE_UNUSED) {
@ -293,13 +274,12 @@ xmlIOHTTPOpen(const char *filename ATTRIBUTE_UNUSED) {
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlIOHTTPOpenW:
* @post_uri: The destination URI for the document
* @compression: The compression desired for the document.
* @param post_uri The destination URI for the document
* @param compression The compression desired for the document.
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns NULL.
* @returns NULL.
*/
void *
xmlIOHTTPOpenW(const char *post_uri ATTRIBUTE_UNUSED,
@ -310,14 +290,13 @@ xmlIOHTTPOpenW(const char *post_uri ATTRIBUTE_UNUSED,
#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlIOHTTPRead:
* @context: the I/O context
* @buffer: where to drop data
* @len: number of bytes to write
* @param context the I/O context
* @param buffer where to drop data
* @param len number of bytes to write
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*
* Returns -1.
* @returns -1.
*/
int
xmlIOHTTPRead(void *context ATTRIBUTE_UNUSED, char *buffer ATTRIBUTE_UNUSED,
@ -326,12 +305,11 @@ xmlIOHTTPRead(void *context ATTRIBUTE_UNUSED, char *buffer ATTRIBUTE_UNUSED,
}
/**
* xmlIOHTTPClose:
* @context: the I/O context
* @param context the I/O context
*
* DEPRECATED: Internal function, don't use.
* @deprecated Internal function, don't use.
*
* Returns 0
* @returns 0
*/
int
xmlIOHTTPClose (void *context ATTRIBUTE_UNUSED) {
@ -339,9 +317,8 @@ xmlIOHTTPClose (void *context ATTRIBUTE_UNUSED) {
}
/**
* xmlRegisterHTTPPostCallbacks:
*
* DEPRECATED: HTTP support was removed in 2.15.
* @deprecated HTTP support was removed in 2.15.
*/
void
xmlRegisterHTTPPostCallbacks(void) {

1572
parser.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

220
pattern.c
View File

@ -192,11 +192,10 @@ struct _xmlPatParserContext {
************************************************************************/
/**
* xmlNewPattern:
*
* Create a new XSLT Pattern
*
* Returns the newly allocated xmlPatternPtr or NULL in case of error
* @returns the newly allocated xmlPatternPtr or NULL in case of error
*/
static xmlPatternPtr
xmlNewPattern(void) {
@ -215,10 +214,9 @@ xmlNewPattern(void) {
}
/**
* xmlFreePattern:
* @comp: an XSLT comp
* @param comp an XSLT comp
*
* Free up the memory allocated by @comp
* Free up the memory allocated by `comp`
*/
void
xmlFreePattern(xmlPatternPtr comp) {
@ -256,10 +254,9 @@ xmlFreePatternInternal(xmlPatternPtr comp) {
}
/**
* xmlFreePatternList:
* @comp: an XSLT comp list
* @param comp an XSLT comp list
*
* Free up the memory allocated by all the elements of @comp
* Free up the memory allocated by all the elements of `comp`
*/
void
xmlFreePatternList(xmlPatternPtr comp) {
@ -274,15 +271,14 @@ xmlFreePatternList(xmlPatternPtr comp) {
}
/**
* xmlNewPatParserContext:
* @pattern: the pattern context
* @dict: the inherited dictionary or NULL
* @namespaces: the prefix definitions, array of [URI, prefix] terminated
* @param pattern the pattern context
* @param dict the inherited dictionary or NULL
* @param namespaces the prefix definitions, array of [URI, prefix] terminated
* with [NULL, NULL] or NULL if no namespace is used
*
* Create a new XML pattern parser context
*
* Returns the newly allocated xmlPatParserContextPtr or NULL in case of error
* @returns the newly allocated xmlPatParserContextPtr or NULL in case of error
*/
static xmlPatParserContextPtr
xmlNewPatParserContext(const xmlChar *pattern, xmlDictPtr dict,
@ -315,10 +311,9 @@ xmlNewPatParserContext(const xmlChar *pattern, xmlDictPtr dict,
}
/**
* xmlFreePatParserContext:
* @ctxt: an XSLT parser context
* @param ctxt an XSLT parser context
*
* Free up the memory allocated by @ctxt
* Free up the memory allocated by `ctxt`
*/
static void
xmlFreePatParserContext(xmlPatParserContextPtr ctxt) {
@ -347,16 +342,15 @@ xmlPatternGrow(xmlPatternPtr comp) {
}
/**
* xmlPatternAdd:
* @ctxt: the pattern parser context
* @comp: the compiled match expression
* @op: an op
* @value: the first value
* @value2: the second value
* @param ctxt the pattern parser context
* @param comp the compiled match expression
* @param op an op
* @param value the first value
* @param value2 the second value
*
* Add a step to an XSLT Compiled Match
*
* Returns -1 in case of failure, 0 otherwise.
* @returns -1 in case of failure, 0 otherwise.
*/
static int
xmlPatternAdd(xmlPatParserContextPtr ctxt, xmlPatternPtr comp,
@ -376,12 +370,11 @@ xmlPatternAdd(xmlPatParserContextPtr ctxt, xmlPatternPtr comp,
}
/**
* xmlReversePattern:
* @comp: the compiled match expression
* @param comp the compiled match expression
*
* reverse all the stack of expressions
*
* returns 0 in case of success and -1 in case of error.
* @returns 0 in case of success and -1 in case of error.
*/
static int
xmlReversePattern(xmlPatternPtr comp) {
@ -459,13 +452,12 @@ xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) {
}
/**
* xmlPatMatch:
* @comp: the precompiled pattern
* @node: a node
* @param comp the precompiled pattern
* @param node a node
*
* Test whether the node matches the pattern
*
* Returns 1 if it matches, 0 if it doesn't and -1 in case of failure
* @returns 1 if it matches, 0 if it doesn't and -1 in case of failure
*/
static int
xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) {
@ -684,8 +676,7 @@ rollback:
if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
/**
* xmlPatScanName:
* @ctxt: the XPath Parser context
* @param ctxt the XPath Parser context
*
* [4] NameChar ::= Letter | Digit | '.' | '-' | '_' |
* CombiningChar | Extender
@ -694,7 +685,7 @@ rollback:
*
* [6] Names ::= Name (S Name)*
*
* Returns the Name parsed or NULL
* @returns the Name parsed or NULL
*/
static xmlChar *
@ -727,12 +718,11 @@ xmlPatScanName(xmlPatParserContextPtr ctxt) {
}
/**
* xmlPatScanNCName:
* @ctxt: the XPath Parser context
* @param ctxt the XPath Parser context
*
* Parses a non qualified name
*
* Returns the Name parsed or NULL
* @returns the Name parsed or NULL
*/
static xmlChar *
@ -767,8 +757,7 @@ xmlPatScanNCName(xmlPatParserContextPtr ctxt) {
}
/**
* xmlCompileAttributeTest:
* @ctxt: the compilation context
* @param ctxt the compilation context
*
* Compile an attribute test.
*/
@ -858,8 +847,7 @@ error:
}
/**
* xmlCompileStepPattern:
* @ctxt: the compilation context
* @param ctxt the compilation context
*
* Compile the Step Pattern and generates a precompiled
* form suitable for fast matching.
@ -1081,8 +1069,7 @@ error:
}
/**
* xmlCompilePathPattern:
* @ctxt: the compilation context
* @param ctxt the compilation context
*
* Compile the Path Pattern and generates a precompiled
* form suitable for fast matching.
@ -1180,8 +1167,7 @@ error:
}
/**
* xmlCompileIDCXPathPath:
* @ctxt: the compilation context
* @param ctxt the compilation context
*
* Compile the Path Pattern and generates a precompiled
* form suitable for fast matching.
@ -1286,12 +1272,11 @@ error_unfinished:
************************************************************************/
/**
* xmlNewStreamComp:
* @size: the number of expected steps
* @param size the number of expected steps
*
* build a new compiled pattern for streaming
*
* Returns the new structure or NULL in case of error.
* @returns the new structure or NULL in case of error.
*/
static xmlStreamCompPtr
xmlNewStreamComp(int size) {
@ -1320,8 +1305,7 @@ xmlNewStreamComp(int size) {
}
/**
* xmlFreeStreamComp:
* @comp: the compiled pattern for streaming
* @param comp the compiled pattern for streaming
*
* Free the compiled pattern for streaming
*/
@ -1337,16 +1321,15 @@ xmlFreeStreamComp(xmlStreamCompPtr comp) {
}
/**
* xmlStreamCompAddStep:
* @comp: the compiled pattern for streaming
* @name: the first string, the name, or NULL for *
* @ns: the second step, the namespace name
* @nodeType: the node type
* @flags: the flags for that step
* @param comp the compiled pattern for streaming
* @param name the first string, the name, or NULL for *
* @param ns the second step, the namespace name
* @param nodeType the node type
* @param flags the flags for that step
*
* Add a new step to the compiled pattern
*
* Returns -1 in case of error or the step index if successful
* @returns -1 in case of error or the step index if successful
*/
static int
xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name,
@ -1382,12 +1365,11 @@ xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name,
}
/**
* xmlStreamCompile:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Tries to stream compile a pattern
*
* Returns -1 in case of failure and 0 in case of success.
* @returns -1 in case of failure and 0 in case of success.
*/
static int
xmlStreamCompile(xmlPatternPtr comp) {
@ -1561,12 +1543,11 @@ error:
}
/**
* xmlNewStreamCtxt:
* @stream: the copmiled stream
* @param stream the copmiled stream
*
* build a new stream context
*
* Returns the new structure or NULL in case of error.
* @returns the new structure or NULL in case of error.
*/
static xmlStreamCtxtPtr
xmlNewStreamCtxt(xmlStreamCompPtr stream) {
@ -1589,8 +1570,7 @@ xmlNewStreamCtxt(xmlStreamCompPtr stream) {
}
/**
* xmlFreeStreamCtxt:
* @stream: the stream context
* @param stream the stream context
*
* Free the stream context
*/
@ -1608,14 +1588,13 @@ xmlFreeStreamCtxt(xmlStreamCtxtPtr stream) {
}
/**
* xmlStreamCtxtAddState:
* @comp: the stream context
* @idx: the step index for that streaming state
* @level: the level
* @param comp the stream context
* @param idx the step index for that streaming state
* @param level the level
*
* Add a new state to the stream context
*
* Returns -1 in case of error or the state index if successful
* @returns -1 in case of error or the state index if successful
*/
static int
xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) {
@ -1653,19 +1632,18 @@ xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) {
}
/**
* xmlStreamPushInternal:
* @stream: the stream context
* @name: the current name
* @ns: the namespace name
* @nodeType: the type of the node
* @param stream the stream context
* @param name the current name
* @param ns the namespace name
* @param nodeType the type of the node
*
* Push new data onto the stream. NOTE: if the call xmlPatterncompile()
* indicated a dictionary, then strings for name and ns will be expected
* to come from the dictionary.
* Both @name and @ns being NULL means the / i.e. the root of the document.
* Both `name` and `ns` being NULL means the / i.e. the root of the document.
* This can also act as a reset.
*
* Returns: -1 in case of error, 1 if the current state in the stream is a
* @returns -1 in case of error, 1 if the current state in the stream is a
* match and 0 otherwise.
*/
static int
@ -1977,19 +1955,18 @@ stream_next:
}
/**
* xmlStreamPush:
* @stream: the stream context
* @name: the current name
* @ns: the namespace name
* @param stream the stream context
* @param name the current name
* @param ns the namespace name
*
* Push new data onto the stream. NOTE: if the call xmlPatterncompile()
* indicated a dictionary, then strings for name and ns will be expected
* to come from the dictionary.
* Both @name and @ns being NULL means the / i.e. the root of the document.
* Both `name` and `ns` being NULL means the / i.e. the root of the document.
* This can also act as a reset.
* Otherwise the function will act as if it has been given an element-node.
*
* Returns: -1 in case of error, 1 if the current state in the stream is a
* @returns -1 in case of error, 1 if the current state in the stream is a
* match and 0 otherwise.
*/
int
@ -1999,22 +1976,21 @@ xmlStreamPush(xmlStreamCtxtPtr stream,
}
/**
* xmlStreamPushNode:
* @stream: the stream context
* @name: the current name
* @ns: the namespace name
* @nodeType: the type of the node being pushed
* @param stream the stream context
* @param name the current name
* @param ns the namespace name
* @param nodeType the type of the node being pushed
*
* Push new data onto the stream. NOTE: if the call xmlPatterncompile()
* indicated a dictionary, then strings for name and ns will be expected
* to come from the dictionary.
* Both @name and @ns being NULL means the / i.e. the root of the document.
* Both `name` and `ns` being NULL means the / i.e. the root of the document.
* This can also act as a reset.
* Different from xmlStreamPush() this function can be fed with nodes of type:
* element-, attribute-, text-, cdata-section-, comment- and
* processing-instruction-node.
*
* Returns: -1 in case of error, 1 if the current state in the stream is a
* @returns -1 in case of error, 1 if the current state in the stream is a
* match and 0 otherwise.
*/
int
@ -2049,12 +2025,11 @@ xmlStreamPushAttr(xmlStreamCtxtPtr stream,
}
/**
* xmlStreamPop:
* @stream: the stream context
* @param stream the stream context
*
* push one level from the stream.
*
* Returns: -1 in case of error, 0 otherwise.
* @returns -1 in case of error, 0 otherwise.
*/
int
xmlStreamPop(xmlStreamCtxtPtr stream) {
@ -2093,15 +2068,14 @@ xmlStreamPop(xmlStreamCtxtPtr stream) {
}
/**
* xmlStreamWantsAnyNode:
* @streamCtxt: the stream context
* @param streamCtxt the stream context
*
* Query if the streaming pattern additionally needs to be fed with
* text-, cdata-section-, comment- and processing-instruction-nodes.
* If the result is 0 then only element-nodes and attribute-nodes
* need to be pushed.
*
* Returns: 1 in case of need of nodes of the above described types,
* @returns 1 in case of need of nodes of the above described types,
* 0 otherwise. -1 on API errors.
*/
int
@ -2124,18 +2098,17 @@ xmlStreamWantsAnyNode(xmlStreamCtxtPtr streamCtxt)
************************************************************************/
/**
* xmlPatternCompileSafe:
* @pattern: the pattern to compile
* @dict: an optional dictionary for interned strings
* @flags: compilation flags, see xmlPatternFlags
* @namespaces: the prefix definitions, array of [URI, prefix] or NULL
* @patternOut: output pattern
* @param pattern the pattern to compile
* @param dict an optional dictionary for interned strings
* @param flags compilation flags, see xmlPatternFlags
* @param namespaces the prefix definitions, array of [URI, prefix] or NULL
* @param patternOut output pattern
*
* Compile a pattern.
*
* Available since 2.13.0.
*
* Returns 0 on success, 1 on error, -1 if a memory allocation failed.
* @returns 0 on success, 1 on error, -1 if a memory allocation failed.
*/
int
xmlPatternCompileSafe(const xmlChar *pattern, xmlDict *dict, int flags,
@ -2254,15 +2227,14 @@ error:
}
/**
* xmlPatterncompile:
* @pattern: the pattern to compile
* @dict: an optional dictionary for interned strings
* @flags: compilation flags, see xmlPatternFlags
* @namespaces: the prefix definitions, array of [URI, prefix] or NULL
* @param pattern the pattern to compile
* @param dict an optional dictionary for interned strings
* @param flags compilation flags, see xmlPatternFlags
* @param namespaces the prefix definitions, array of [URI, prefix] or NULL
*
* Compile a pattern.
*
* Returns the compiled form of the pattern or NULL in case of error
* @returns the compiled form of the pattern or NULL in case of error
*/
xmlPatternPtr
xmlPatterncompile(const xmlChar *pattern, xmlDict *dict, int flags,
@ -2273,13 +2245,12 @@ xmlPatterncompile(const xmlChar *pattern, xmlDict *dict, int flags,
}
/**
* xmlPatternMatch:
* @comp: the precompiled pattern
* @node: a node
* @param comp the precompiled pattern
* @param node a node
*
* Test whether the node matches the pattern
*
* Returns 1 if it matches, 0 if it doesn't and -1 in case of failure
* @returns 1 if it matches, 0 if it doesn't and -1 in case of failure
*/
int
xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node)
@ -2299,13 +2270,12 @@ xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node)
}
/**
* xmlPatternGetStreamCtxt:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Get a streaming context for that pattern
* Use xmlFreeStreamCtxt to free the context.
*
* Returns a pointer to the context or NULL in case of failure
* @returns a pointer to the context or NULL in case of failure
*/
xmlStreamCtxtPtr
xmlPatternGetStreamCtxt(xmlPatternPtr comp)
@ -2337,13 +2307,12 @@ failed:
}
/**
* xmlPatternStreamable:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Check if the pattern is streamable i.e. xmlPatternGetStreamCtxt()
* should work.
*
* Returns 1 if streamable, 0 if not and -1 in case of error.
* @returns 1 if streamable, 0 if not and -1 in case of error.
*/
int
xmlPatternStreamable(xmlPatternPtr comp) {
@ -2358,12 +2327,11 @@ xmlPatternStreamable(xmlPatternPtr comp) {
}
/**
* xmlPatternMaxDepth:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Check the maximum depth reachable by a pattern
*
* Returns -2 if no limit (using //), otherwise the depth,
* @returns -2 if no limit (using //), otherwise the depth,
* and -1 in case of error
*/
int
@ -2385,13 +2353,12 @@ xmlPatternMaxDepth(xmlPatternPtr comp) {
}
/**
* xmlPatternMinDepth:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Check the minimum depth reachable by a pattern, 0 mean the / or . are
* part of the set.
*
* Returns -1 in case of error otherwise the depth,
* @returns -1 in case of error otherwise the depth,
*
*/
int
@ -2412,12 +2379,11 @@ xmlPatternMinDepth(xmlPatternPtr comp) {
}
/**
* xmlPatternFromRoot:
* @comp: the precompiled pattern
* @param comp the precompiled pattern
*
* Check if the pattern must be looked at from the root.
*
* Returns 1 if true, 0 if false and -1 in case of error
* @returns 1 if true, 0 if false and -1 in case of error
*/
int
xmlPatternFromRoot(xmlPatternPtr comp) {

1098
relaxng.c

File diff suppressed because it is too large Load Diff

403
runtest.c
View File

@ -608,11 +608,11 @@ static int quiet = 0;
/**
* isStandaloneDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
* @returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
@ -626,11 +626,11 @@ isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
* @returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
@ -644,11 +644,11 @@ hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
/**
* hasExternalSubsetDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
* @returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
@ -662,7 +662,7 @@ hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
/**
* internalSubsetDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an internal subset
*/
@ -688,7 +688,7 @@ internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
/**
* externalSubsetDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an external subset
*/
@ -712,9 +712,9 @@ externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
/**
* resolveEntityDebug:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctxt An XML parser context
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
@ -722,7 +722,7 @@ externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
@ -752,12 +752,12 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm
/**
* getEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx, const xmlChar *name)
@ -774,12 +774,12 @@ getEntityDebug(void *ctx, const xmlChar *name)
/**
* getParameterEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
* @returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx, const xmlChar *name)
@ -797,12 +797,12 @@ getParameterEntityDebug(void *ctx, const xmlChar *name)
/**
* entityDeclDebug:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
* @param ctxt An XML parser context
* @param name the entity name
* @param type the entity type
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param content the entity value (without processing).
*
* An entity definition has been parsed
*/
@ -840,9 +840,9 @@ entityDeclDebug(void *ctx, const xmlChar *name, int type,
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
* @param ctxt An XML parser context
* @param name the attribute name
* @param type the attribute type
*
* An attribute definition has been parsed
*/
@ -865,10 +865,10 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,
/**
* elementDeclDebug:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
* @param ctxt An XML parser context
* @param name the element name
* @param type the element type
* @param content the element value (without processing).
*
* An element definition has been parsed
*/
@ -885,10 +885,10 @@ elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
/**
* notationDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctxt An XML parser context
* @param name The name of the notation
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
@ -905,11 +905,11 @@ notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
/**
* unparsedEntityDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
* @param ctxt An XML parser context
* @param name The name of the entity
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param notationName the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
@ -936,8 +936,8 @@ const xmlChar *nullstr = BAD_CAST "(null)";
/**
* setDocumentLocatorDebug:
* @ctxt: An XML parser context
* @loc: A SAX Locator
* @param ctxt An XML parser context
* @param loc A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
@ -953,7 +953,7 @@ setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBU
/**
* startDocumentDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* called when the document start being processed.
*/
@ -968,7 +968,7 @@ startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
/**
* endDocumentDebug:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* called when the document end has been detected.
*/
@ -983,8 +983,8 @@ endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
/**
* startElementDebug:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when an opening tag has been processed.
*/
@ -1009,8 +1009,8 @@ startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when the end of an element has been detected.
*/
@ -1025,9 +1025,9 @@ endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
/**
* charactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
@ -1050,8 +1050,8 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
/**
* referenceDebug:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* called when an entity reference is detected.
*/
@ -1066,10 +1066,10 @@ referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
/**
* ignorableWhitespaceDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @start: the first char in the string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param start the first char in the string
* @param len the number of xmlChar
*
* receiving some ignorable whitespaces from the parser.
* Question: how much at a time ???
@ -1091,10 +1091,10 @@ ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
/**
* processingInstructionDebug:
* @ctxt: An XML parser context
* @target: the target name
* @data: the PI data's
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param target the target name
* @param data the PI data's
* @param len the number of xmlChar
*
* A processing instruction has been parsed.
*/
@ -1115,9 +1115,9 @@ processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
/**
* cdataBlockDebug:
* @ctx: the user data (XML parser context)
* @value: The pcdata content
* @len: the block length
* @param ctx the user data (XML parser context)
* @param value The pcdata content
* @param len the block length
*
* called when a pcdata block has been parsed
*/
@ -1133,8 +1133,8 @@ cdataBlockDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value, int len)
/**
* commentDebug:
* @ctxt: An XML parser context
* @value: the comment content
* @param ctxt An XML parser context
* @param value the comment content
*
* A comment has been parsed.
*/
@ -1149,8 +1149,8 @@ commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
/**
* warningDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, gives file, line, position and
@ -1172,8 +1172,8 @@ warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
/**
* errorDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a error messages, gives file, line, position and
@ -1195,8 +1195,8 @@ errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
/**
* fatalErrorDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a fatalError messages, gives file, line, position and
@ -1258,8 +1258,8 @@ static xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
*/
/**
* startElementNsDebug:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when an opening tag has been processed.
*/
@ -1315,8 +1315,8 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED,
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when the end of an element has been detected.
*/
@ -1379,9 +1379,8 @@ static xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct;
#ifdef LIBXML_HTML_ENABLED
/**
* htmlstartElementDebug:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when an opening tag has been processed.
*/
@ -1414,10 +1413,9 @@ htmlstartElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xml
}
/**
* htmlcharactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
@ -1435,10 +1433,9 @@ htmlcharactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
}
/**
* htmlcdataDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some cdata chars from the parser.
* Question: how much at a time ???
@ -1502,13 +1499,13 @@ hashFreeEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
/**
* saxParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the SAX API and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
saxParseTest(const char *filename, const char *result,
@ -1743,14 +1740,13 @@ static xmlSAXHandler tokenizeHtmlSAXHandler = {
};
/**
* htmlTokenizerTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the SAX API and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
htmlTokenizerTest(const char *filename, const char *result,
@ -1839,15 +1835,15 @@ htmlTokenizerTest(const char *filename, const char *result,
************************************************************************/
/**
* oldParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file using the old xmlParseFile API, then serialize back
* reparse the result and serialize again, then check for deviation
* in serialization.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
oldParseTest(const char *filename, const char *result,
@ -1910,14 +1906,14 @@ oldParseTest(const char *filename, const char *result,
#ifdef LIBXML_PUSH_ENABLED
/**
* pushParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file using the Push API, then serialize back
* to check for content.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
pushParseTest(const char *filename, const char *result,
@ -2097,14 +2093,14 @@ endElementNsBnd(void *ctx, const xmlChar *localname, const xmlChar *prefix,
/**
* pushBoundaryTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Test whether the push parser detects boundaries between syntactical
* elements correctly.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
pushBoundaryTest(const char *filename, const char *result,
@ -2412,15 +2408,15 @@ testParseContent(xmlParserCtxtPtr ctxt, xmlDocPtr doc, const char *filename) {
/**
* memParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file using the old xmlReadMemory API, then serialize back
* reparse the result and serialize again, then check for deviation
* in serialization.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
memParseTest(const char *filename, const char *result,
@ -2467,15 +2463,15 @@ memParseTest(const char *filename, const char *result,
/**
* noentParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file with entity resolution, then serialize back
* reparse the result and serialize again, then check for deviation
* in serialization.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
noentParseTest(const char *filename, const char *result,
@ -2526,13 +2522,13 @@ noentParseTest(const char *filename, const char *result,
/**
* errParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the xmlReadFile API and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
errParseTest(const char *filename, const char *result, const char *err,
@ -2615,13 +2611,13 @@ errParseTest(const char *filename, const char *result, const char *err,
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_HTML_ENABLED)
/**
* fdParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the xmlReadFd API and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
fdParseTest(const char *filename, const char *result, const char *err,
@ -2802,13 +2798,13 @@ streamProcessTest(const char *filename, const char *result, const char *err,
/**
* streamParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the reader API and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
streamParseTest(const char *filename, const char *result, const char *err,
@ -2826,13 +2822,13 @@ streamParseTest(const char *filename, const char *result, const char *err,
/**
* walkerParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the walker, i.e. a reader built from a atree.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
walkerParseTest(const char *filename, const char *result, const char *err,
@ -2855,13 +2851,13 @@ walkerParseTest(const char *filename, const char *result, const char *err,
/**
* streamMemParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file using the reader API from memory and check for errors.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
streamMemParseTest(const char *filename, const char *result, const char *err,
@ -2938,13 +2934,13 @@ testXPath(const char *str, int xptr, int expr) {
/**
* xpathExprTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing XPath standalone expressions and evaluate them
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
xpathCommonTest(const char *filename, const char *result,
@ -3006,13 +3002,13 @@ xpathCommonTest(const char *filename, const char *result,
/**
* xpathExprTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing XPath standalone expressions and evaluate them
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
xpathExprTest(const char *filename, const char *result,
@ -3023,14 +3019,14 @@ xpathExprTest(const char *filename, const char *result,
/**
* xpathDocTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing XPath expressions and evaluate them against
* a set of corresponding documents.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
xpathDocTest(const char *filename,
@ -3075,14 +3071,14 @@ xpathDocTest(const char *filename,
#ifdef LIBXML_XPTR_ENABLED
/**
* xptrDocTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing XPath expressions and evaluate them against
* a set of corresponding documents.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
xptrDocTest(const char *filename,
@ -3127,15 +3123,14 @@ xptrDocTest(const char *filename,
#ifdef LIBXML_VALID_ENABLED
/**
* xmlidDocTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing xml:id and check for errors and verify
* that XPath queries will work on them as expected.
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
xmlidDocTest(const char *filename,
@ -3238,13 +3233,13 @@ handleURI(const char *str, const char *base, FILE *o) {
/**
* uriCommonTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing URI and check for errors
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
uriCommonTest(const char *filename,
@ -3326,13 +3321,13 @@ uriCommonTest(const char *filename,
/**
* uriParseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing URI and check for errors
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
uriParseTest(const char *filename,
@ -3344,14 +3339,14 @@ uriParseTest(const char *filename,
/**
* uriBaseTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing URI, compose them against a fixed base and
* check for errors
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
uriBaseTest(const char *filename,
@ -3400,11 +3395,11 @@ static int urip_rlen;
/**
* uripMatch:
* @URI: an URI to test
* @param URI an URI to test
*
* Check for an urip: query
*
* Returns 1 if yes and 0 if another Input module should be used
* @returns 1 if yes and 0 if another Input module should be used
*/
static int
uripMatch(const char * URI) {
@ -3421,12 +3416,12 @@ uripMatch(const char * URI) {
/**
* uripOpen:
* @URI: an URI to test
* @param URI an URI to test
*
* Return a pointer to the urip: query handler, in this example simply
* @returns a pointer to the urip: query handler, in this example simply
* the urip_current pointer...
*
* Returns an Input context or NULL in case or error
* @returns an Input context or NULL in case or error
*/
static void *
uripOpen(const char * URI) {
@ -3445,11 +3440,11 @@ uripOpen(const char * URI) {
/**
* uripClose:
* @context: the read context
* @param context the read context
*
* Close the urip: query handler
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
uripClose(void * context) {
@ -3461,13 +3456,13 @@ uripClose(void * context) {
/**
* uripRead:
* @context: the read context
* @buffer: where to store data
* @len: number of bytes to read
* @param context the read context
* @param buffer where to store data
* @param len number of bytes to read
*
* Implement an urip: query read.
*
* Returns the number of bytes read or -1 in case of error
* @returns the number of bytes read or -1 in case of error
*/
static int
uripRead(void * context, char * buffer, int len) {
@ -3495,14 +3490,14 @@ urip_checkURL(const char *URL) {
/**
* uriPathTest:
* @filename: ignored
* @result: ignored
* @err: ignored
* @param filename ignored
* @param result ignored
* @param err ignored
*
* Run a set of tests to check how Path and URI are handled before
* being passed to the I/O layer
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
uriPathTest(const char *filename ATTRIBUTE_UNUSED,
@ -3610,14 +3605,14 @@ done:
}
/**
* schemasTest:
* @filename: the schemas file
* @result: the file with expected result
* @err: the file with error messages
* @param filename the schemas file
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a file containing URI, compose them against a fixed base and
* check for errors
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
schemasTest(const char *filename,
@ -3743,13 +3738,13 @@ rngOneTest(const char *sch,
}
/**
* rngTest:
* @filename: the schemas file
* @result: the file with expected result
* @err: the file with error messages
* @param filename the schemas file
* @param result the file with expected result
* @param err the file with error messages
*
* Parse an RNG schemas and then apply it to the related .xml
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
rngTest(const char *filename,
@ -3835,13 +3830,13 @@ rngTest(const char *filename,
#ifdef LIBXML_READER_ENABLED
/**
* rngStreamTest:
* @filename: the schemas file
* @result: the file with expected result
* @err: the file with error messages
* @param filename the schemas file
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a set of files with streaming, applying an RNG schemas
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
rngStreamTest(const char *filename,
@ -3974,11 +3969,11 @@ schematronOneTest(const char *sch, const char *filename, int options,
/**
* schematronTest:
* @filename: the schemas file
* @result: the file with expected result
* @err: the file with error messages
* @param filename the schemas file
* @param result the file with expected result
* @param err the file with error messages
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
schematronTest(const char *filename,
@ -4126,13 +4121,13 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader,
/**
* patternTest:
* @filename: the schemas file
* @result: the file with expected result
* @err: the file with error messages
* @param filename the schemas file
* @param result the file with expected result
* @param err the file with error messages
*
* Parse a set of files with streaming, applying an RNG schemas
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
patternTest(const char *filename,

View File

@ -155,7 +155,6 @@ struct _xmlSchematron {
};
/**
* xmlSchematronValidCtxt:
*
* A Schematrons validation context
*/
@ -225,8 +224,7 @@ struct _xmlSchematronParserCtxt {
************************************************************************/
/**
* xmlSchematronPErrMemory:
* @ctxt: parser context
* @param ctxt parser context
*
* Handle an out of memory condition
*/
@ -239,13 +237,12 @@ xmlSchematronPErrMemory(xmlSchematronParserCtxtPtr ctxt)
}
/**
* xmlSchematronPErr:
* @ctxt: the parsing context
* @node: the context node
* @error: the error code
* @msg: the error message
* @str1: extra data
* @str2: extra data
* @param ctxt the parsing context
* @param node the context node
* @param error the error code
* @param msg the error message
* @param str1 extra data
* @param str2 extra data
*
* Handle a parser error
*/
@ -279,8 +276,7 @@ xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error,
}
/**
* xmlSchematronVTypeErrMemory:
* @ctxt: validation context
* @param ctxt validation context
*
* Handle an out of memory condition
*/
@ -295,11 +291,10 @@ xmlSchematronVErrMemory(xmlSchematronValidCtxtPtr ctxt)
}
/**
* xmlSchematronVErr:
* @ctxt: validation context
* @error: the error code
* @msg: the error message
* @str1: extra data
* @param ctxt validation context
* @param error the error code
* @param msg the error message
* @param str1 extra data
*
* Handle a validation error
*/
@ -339,17 +334,16 @@ xmlSchematronVErr(xmlSchematronValidCtxtPtr ctxt, int error,
************************************************************************/
/**
* xmlSchematronAddTest:
* @ctxt: the schema parsing context
* @type: the type of test
* @rule: the parent rule
* @node: the node hosting the test
* @test: the associated test
* @report: the associated report string
* @param ctxt the schema parsing context
* @param type the type of test
* @param rule the parent rule
* @param node the node hosting the test
* @param test the associated test
* @param report the associated report string
*
* Add a test to a schematron
*
* Returns the new pointer or NULL in case of error
* @returns the new pointer or NULL in case of error
*/
static xmlSchematronTestPtr
xmlSchematronAddTest(xmlSchematronParserCtxtPtr ctxt,
@ -401,8 +395,7 @@ xmlSchematronAddTest(xmlSchematronParserCtxtPtr ctxt,
}
/**
* xmlSchematronFreeTests:
* @tests: a list of tests
* @param tests a list of tests
*
* Free a list of tests.
*/
@ -424,8 +417,7 @@ xmlSchematronFreeTests(xmlSchematronTestPtr tests) {
}
/**
* xmlSchematronFreeLets:
* @lets: a list of let variables
* @param lets a list of let variables
*
* Free a list of let variables.
*/
@ -445,17 +437,16 @@ xmlSchematronFreeLets(xmlSchematronLetPtr lets) {
}
/**
* xmlSchematronAddRule:
* @ctxt: the schema parsing context
* @schema: a schema structure
* @pat: a pattern
* @node: the node hosting the rule
* @context: the associated context string
* @report: the associated report string
* @param ctxt the schema parsing context
* @param schema a schema structure
* @param pat a pattern
* @param node the node hosting the rule
* @param context the associated context string
* @param report the associated report string
*
* Add a rule to a schematron
*
* Returns the new pointer or NULL in case of error
* @returns the new pointer or NULL in case of error
*/
static xmlSchematronRulePtr
xmlSchematronAddRule(xmlSchematronParserCtxtPtr ctxt, xmlSchematronPtr schema,
@ -516,8 +507,7 @@ xmlSchematronAddRule(xmlSchematronParserCtxtPtr ctxt, xmlSchematronPtr schema,
}
/**
* xmlSchematronFreeRules:
* @rules: a list of rules
* @param rules a list of rules
*
* Free a list of rules.
*/
@ -543,15 +533,14 @@ xmlSchematronFreeRules(xmlSchematronRulePtr rules) {
}
/**
* xmlSchematronAddPattern:
* @ctxt: the schema parsing context
* @schema: a schema structure
* @node: the node hosting the pattern
* @name: the name of the pattern
* @param ctxt the schema parsing context
* @param schema a schema structure
* @param node the node hosting the pattern
* @param name the name of the pattern
*
* Add a pattern to a schematron
*
* Returns the new pointer or NULL in case of error
* @returns the new pointer or NULL in case of error
*/
static xmlSchematronPatternPtr
xmlSchematronAddPattern(xmlSchematronParserCtxtPtr ctxt,
@ -583,8 +572,7 @@ xmlSchematronAddPattern(xmlSchematronParserCtxtPtr ctxt,
}
/**
* xmlSchematronFreePatterns:
* @patterns: a list of patterns
* @param patterns a list of patterns
*
* Free a list of patterns.
*/
@ -602,12 +590,11 @@ xmlSchematronFreePatterns(xmlSchematronPatternPtr patterns) {
}
/**
* xmlSchematronNewSchematron:
* @ctxt: a schema validation context
* @param ctxt a schema validation context
*
* Allocate a new Schematron structure.
*
* Returns the newly allocated structure or NULL in case or error
* @returns the newly allocated structure or NULL in case or error
*/
static xmlSchematronPtr
xmlSchematronNewSchematron(xmlSchematronParserCtxtPtr ctxt)
@ -627,8 +614,7 @@ xmlSchematronNewSchematron(xmlSchematronParserCtxtPtr ctxt)
}
/**
* xmlSchematronFree:
* @schema: a schema structure
* @param schema a schema structure
*
* Deallocate a Schematron structure.
*/
@ -651,13 +637,12 @@ xmlSchematronFree(xmlSchematronPtr schema)
}
/**
* xmlSchematronNewParserCtxt:
* @URL: the location of the schema
* @param URL the location of the schema
*
* Create an XML Schematrons parse context for that file/resource expected
* to contain an XML Schematrons file.
*
* Returns the parser context or NULL in case of error
* @returns the parser context or NULL in case of error
*/
xmlSchematronParserCtxtPtr
xmlSchematronNewParserCtxt(const char *URL)
@ -690,14 +675,13 @@ xmlSchematronNewParserCtxt(const char *URL)
}
/**
* xmlSchematronNewMemParserCtxt:
* @buffer: a pointer to a char array containing the schemas
* @size: the size of the array
* @param buffer a pointer to a char array containing the schemas
* @param size the size of the array
*
* Create an XML Schematrons parse context for that memory buffer expected
* to contain an XML Schematrons file.
*
* Returns the parser context or NULL in case of error
* @returns the parser context or NULL in case of error
*/
xmlSchematronParserCtxtPtr
xmlSchematronNewMemParserCtxt(const char *buffer, int size)
@ -728,13 +712,12 @@ xmlSchematronNewMemParserCtxt(const char *buffer, int size)
}
/**
* xmlSchematronNewDocParserCtxt:
* @doc: a preparsed document tree
* @param doc a preparsed document tree
*
* Create an XML Schematrons parse context for that document.
* NB. The document may be modified during the parsing process.
*
* Returns the parser context or NULL in case of error
* @returns the parser context or NULL in case of error
*/
xmlSchematronParserCtxtPtr
xmlSchematronNewDocParserCtxt(xmlDocPtr doc)
@ -767,8 +750,7 @@ xmlSchematronNewDocParserCtxt(xmlDocPtr doc)
}
/**
* xmlSchematronFreeParserCtxt:
* @ctxt: the schema parser context
* @param ctxt the schema parser context
*
* Free the resources associated to the schema parser context
*/
@ -790,10 +772,9 @@ xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt)
#if 0
/**
* xmlSchematronPushInclude:
* @ctxt: the schema parser context
* @doc: the included document
* @cur: the current include node
* @param ctxt the schema parser context
* @param doc the included document
* @param cur the current include node
*
* Add an included document
*/
@ -829,12 +810,11 @@ xmlSchematronPushInclude(xmlSchematronParserCtxtPtr ctxt,
}
/**
* xmlSchematronPopInclude:
* @ctxt: the schema parser context
* @param ctxt the schema parser context
*
* Pop an include level. The included document is being freed
*
* Returns the node immediately following the include or NULL if the
* @returns the node immediately following the include or NULL if the
* include list was empty.
*/
static xmlNodePtr
@ -858,10 +838,9 @@ xmlSchematronPopInclude(xmlSchematronParserCtxtPtr ctxt)
#endif
/**
* xmlSchematronAddNamespace:
* @ctxt: the schema parser context
* @prefix: the namespace prefix
* @ns: the namespace name
* @param ctxt the schema parser context
* @param prefix the namespace prefix
* @param ns the namespace name
*
* Add a namespace definition in the context
*/
@ -902,9 +881,8 @@ xmlSchematronAddNamespace(xmlSchematronParserCtxtPtr ctxt,
}
/**
* xmlSchematronParseTestReportMsg:
* @ctxt: the schema parser context
* @con: the assert or report node
* @param ctxt the schema parser context
* @param con the assert or report node
*
* Format the message content of the assert or report test
*/
@ -952,10 +930,9 @@ xmlSchematronParseTestReportMsg(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr con)
}
/**
* xmlSchematronParseRule:
* @ctxt: a schema validation context
* @pattern: a pattern
* @rule: the rule node
* @param ctxt a schema validation context
* @param pattern a pattern
* @param rule the rule node
*
* parse a rule element
*/
@ -1121,9 +1098,8 @@ xmlSchematronParseRule(xmlSchematronParserCtxtPtr ctxt,
}
/**
* xmlSchematronParsePattern:
* @ctxt: a schema validation context
* @pat: the pattern node
* @param ctxt a schema validation context
* @param pat the pattern node
*
* parse a pattern element
*/
@ -1170,13 +1146,12 @@ xmlSchematronParsePattern(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr pat)
#if 0
/**
* xmlSchematronLoadInclude:
* @ctxt: a schema validation context
* @cur: the include element
* @param ctxt a schema validation context
* @param cur the include element
*
* Load the include document, Push the current pointer
*
* Returns the updated node pointer
* @returns the updated node pointer
*/
static xmlNodePtr
xmlSchematronLoadInclude(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr cur)
@ -1236,13 +1211,12 @@ done:
#endif
/**
* xmlSchematronParse:
* @ctxt: a schema validation context
* @param ctxt a schema validation context
*
* parse a schema definition resource and build an internal
* XML Schema structure which can be used to validate instances.
*
* Returns the internal XML Schematron structure built from the resource or
* @returns the internal XML Schematron structure built from the resource or
* NULL in case of error
*/
xmlSchematronPtr
@ -1435,10 +1409,9 @@ xmlSchematronGetNode(xmlSchematronValidCtxtPtr ctxt,
}
/**
* xmlSchematronReportOutput:
* @ctxt: the validation context
* @cur: the current node tested
* @msg: the message output
* @param ctxt the validation context
* @param cur the current node tested
* @param msg the message output
*
* Output part of the report to whatever channel the user selected
*/
@ -1451,14 +1424,13 @@ xmlSchematronReportOutput(xmlSchematronValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
}
/**
* xmlSchematronFormatReport:
* @ctxt: the validation context
* @test: the test node
* @cur: the current node tested
* @param ctxt the validation context
* @param test the test node
* @param cur the current node tested
*
* Build the string being reported to the user.
*
* Returns a report string or NULL in case of error. The string needs
* @returns a report string or NULL in case of error. The string needs
* to be deallocated by the caller
*/
static xmlChar *
@ -1580,12 +1552,11 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
}
/**
* xmlSchematronReportSuccess:
* @ctxt: the validation context
* @test: the compiled test
* @cur: the current node tested
* @pattern: a pattern
* @success: boolean value for the result
* @param ctxt the validation context
* @param test the compiled test
* @param cur the current node tested
* @param pattern a pattern
* @param success boolean value for the result
*
* called from the validation engine when an assert or report test have
* been done.
@ -1671,9 +1642,8 @@ xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr ctxt,
}
/**
* xmlSchematronReportPattern:
* @ctxt: the validation context
* @pattern: the current pattern
* @param ctxt the validation context
* @param pattern the current pattern
*
* called from the validation engine when starting to check a pattern
*/
@ -1704,10 +1674,9 @@ xmlSchematronReportPattern(xmlSchematronValidCtxtPtr ctxt,
************************************************************************/
/**
* xmlSchematronSetValidStructuredErrors:
* @ctxt: a Schematron validation context
* @serror: the structured error function
* @ctx: the functions context
* @param ctxt a Schematron validation context
* @param serror the structured error function
* @param ctx the functions context
*
* Set the structured error callback
*/
@ -1724,13 +1693,12 @@ xmlSchematronSetValidStructuredErrors(xmlSchematronValidCtxtPtr ctxt,
}
/**
* xmlSchematronNewValidCtxt:
* @schema: a precompiled XML Schematrons
* @options: a set of xmlSchematronValidOptions
* @param schema a precompiled XML Schematrons
* @param options a set of xmlSchematronValidOptions
*
* Create an XML Schematrons validation context based on the given schema.
*
* Returns the validation context or NULL in case of error
* @returns the validation context or NULL in case of error
*/
xmlSchematronValidCtxtPtr
xmlSchematronNewValidCtxt(xmlSchematronPtr schema, int options)
@ -1767,8 +1735,7 @@ xmlSchematronNewValidCtxt(xmlSchematronPtr schema, int options)
}
/**
* xmlSchematronFreeValidCtxt:
* @ctxt: the schema validation context
* @param ctxt the schema validation context
*
* Free the resources associated to the schema validation context
*/
@ -1820,16 +1787,15 @@ xmlSchematronNextNode(xmlNodePtr cur) {
}
/**
* xmlSchematronRunTest:
* @ctxt: the schema validation context
* @test: the current test
* @instance: the document instance tree
* @cur: the current node in the instance
* @pattern: a pattern
* @param ctxt the schema validation context
* @param test the current test
* @param instance the document instance tree
* @param cur the current node in the instance
* @param pattern a pattern
*
* Validate a rule against a tree instance at a given position
*
* Returns 1 in case of success, 0 if error and -1 in case of internal error
* @returns 1 in case of success, 0 if error and -1 in case of internal error
*/
static int
xmlSchematronRunTest(xmlSchematronValidCtxtPtr ctxt,
@ -1883,16 +1849,15 @@ xmlSchematronRunTest(xmlSchematronValidCtxtPtr ctxt,
}
/**
* xmlSchematronRegisterVariables:
* @vctxt: the schema validation context
* @ctxt: an XPath context
* @let: the list of let variables
* @instance: the document instance tree
* @cur: the current node
* @param vctxt the schema validation context
* @param ctxt an XPath context
* @param let the list of let variables
* @param instance the document instance tree
* @param cur the current node
*
* Registers a list of let variables to the current context of @cur
* Registers a list of let variables to the current context of `cur`
*
* Returns -1 in case of errors, otherwise 0
* @returns -1 in case of errors, otherwise 0
*/
static int
xmlSchematronRegisterVariables(xmlSchematronValidCtxtPtr vctxt,
@ -1923,14 +1888,13 @@ xmlSchematronRegisterVariables(xmlSchematronValidCtxtPtr vctxt,
}
/**
* xmlSchematronUnregisterVariables:
* @vctxt: the schema validation context
* @ctxt: an XPath context
* @let: the list of let variables
* @param vctxt the schema validation context
* @param ctxt an XPath context
* @param let the list of let variables
*
* Unregisters a list of let variables from the context
*
* Returns -1 in case of errors, otherwise 0
* @returns -1 in case of errors, otherwise 0
*/
static int
xmlSchematronUnregisterVariables(xmlSchematronValidCtxtPtr vctxt,
@ -1949,13 +1913,12 @@ xmlSchematronUnregisterVariables(xmlSchematronValidCtxtPtr vctxt,
}
/**
* xmlSchematronValidateDoc:
* @ctxt: the schema validation context
* @instance: the document instance tree
* @param ctxt the schema validation context
* @param instance the document instance tree
*
* Validate a tree instance against the schematron
*
* Returns 0 in case of success, -1 in case of internal error
* @returns 0 in case of success, -1 in case of internal error
* and an error count otherwise.
*/
int

208
shell.c
View File

@ -62,12 +62,11 @@ struct _xmllintShellCtxt {
};
/**
* xmllintLsCountNode:
* @node: the node to count
* @param node the node to count
*
* Count the children of @node.
* Count the children of `node`.
*
* Returns the number of children of @node.
* @returns the number of children of `node`.
*/
static int
xmllintLsCountNode(xmlNodePtr node) {
@ -117,11 +116,10 @@ xmllintLsCountNode(xmlNodePtr node) {
}
/**
* xmllintLsOneNode:
* @output: the FILE * for the output
* @node: the node to dump
* @param output the FILE * for the output
* @param node the node to dump
*
* Dump to @output the type and name of @node.
* Dump to `output` the type and name of `node`.
*/
static void
xmllintLsOneNode(FILE *output, xmlNodePtr node) {
@ -252,16 +250,15 @@ xmllintLsOneNode(FILE *output, xmlNodePtr node) {
}
/**
* xmllintShellList:
* @ctxt: the shell context
* @arg: unused
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "ls"
* Does an Unix like listing of the given node (like a directory)
*
* Returns 0
* @returns 0
*/
static int
xmllintShellList(xmllintShellCtxtPtr ctxt,
@ -295,16 +292,15 @@ xmllintShellList(xmllintShellCtxtPtr ctxt,
}
/**
* xmllintShellBase:
* @ctxt: the shell context
* @arg: unused
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "base"
* dumps the current XML base of the node
*
* Returns 0
* @returns 0
*/
static int
xmllintShellBase(xmllintShellCtxtPtr ctxt,
@ -331,16 +327,15 @@ xmllintShellBase(xmllintShellCtxtPtr ctxt,
}
/**
* xmllintShellSetBase:
* @ctxt: the shell context
* @arg: the new base
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg the new base
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "setbase"
* change the current XML base of the node
*
* Returns 0
* @returns 0
*/
static int
xmllintShellSetBase(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
@ -353,17 +348,16 @@ xmllintShellSetBase(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
#ifdef LIBXML_XPATH_ENABLED
/**
* xmllintShellRegisterNamespace:
* @ctxt: the shell context
* @arg: a string in prefix=nsuri format
* @node: unused
* @node2: unused
* @param ctxt the shell context
* @param arg a string in prefix=nsuri format
* @param node unused
* @param node2 unused
*
* Implements the XML shell function "setns"
* register/unregister a prefix=namespace pair
* on the XPath context
*
* Returns 0 on success and a negative value otherwise.
* @returns 0 on success and a negative value otherwise.
*/
static int
xmllintShellRegisterNamespace(xmllintShellCtxtPtr ctxt, char *arg,
@ -410,16 +404,15 @@ xmllintShellRegisterNamespace(xmllintShellCtxtPtr ctxt, char *arg,
return(0);
}
/**
* xmllintShellRegisterRootNamespaces:
* @ctxt: the shell context
* @arg: unused
* @root: the root element
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param root the root element
* @param node2 unused
*
* Implements the XML shell function "setrootns"
* which registers all namespaces declarations found on the root element.
*
* Returns 0 on success and a negative value otherwise.
* @returns 0 on success and a negative value otherwise.
*/
static int
xmllintShellRegisterRootNamespaces(xmllintShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
@ -443,16 +436,15 @@ xmllintShellRegisterRootNamespaces(xmllintShellCtxtPtr ctxt, char *arg ATTRIBUTE
#endif
/**
* xmllintShellGrep:
* @ctxt: the shell context
* @arg: the string or regular expression to find
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg the string or regular expression to find
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "grep"
* dumps information about the node (namespace, attributes, content).
*
* Returns 0
* @returns 0
*/
static int
xmllintShellGrep(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
@ -519,16 +511,15 @@ xmllintShellGrep(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
}
/**
* xmllintShellDir:
* @ctxt: the shell context
* @arg: unused
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "dir"
* dumps information about the node (namespace, attributes, content).
*
* Returns 0
* @returns 0
*/
static int
xmllintShellDir(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
@ -555,16 +546,15 @@ xmllintShellDir(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
}
/**
* xmllintShellSetContent:
* @ctxt: the shell context
* @value: the content as a string
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param value the content as a string
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "dir"
* dumps information about the node (namespace, attributes, content).
*
* Returns 0
* @returns 0
*/
static int
xmllintShellSetContent(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
@ -613,16 +603,15 @@ xmllintShellPrintf(void *ctx, const char *msg, ...) {
#ifdef LIBXML_RELAXNG_ENABLED
/**
* xmllintShellRNGValidate:
* @sctxt: the shell context
* @schemas: the path to the Relax-NG schemas
* @node: a node
* @node2: unused
* @param sctxt the shell context
* @param schemas the path to the Relax-NG schemas
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "relaxng"
* validating the instance against a Relax-NG schemas
*
* Returns 0
* @returns 0
*/
static int
xmllintShellRNGValidate(xmllintShellCtxtPtr sctxt, char *schemas,
@ -663,16 +652,15 @@ xmllintShellRNGValidate(xmllintShellCtxtPtr sctxt, char *schemas,
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmllintShellCat:
* @ctxt: the shell context
* @arg: unused
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "cat"
* dumps the serialization node content (XML or HTML).
*
* Returns 0
* @returns 0
*/
static int
xmllintShellCat(xmllintShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
@ -708,16 +696,15 @@ xmllintShellCat(xmllintShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmllintShellLoad:
* @ctxt: the shell context
* @filename: the file name
* @node: unused
* @node2: unused
* @param ctxt the shell context
* @param filename the file name
* @param node unused
* @param node2 unused
*
* Implements the XML shell function "load"
* loads a new document specified by the filename
*
* Returns 0 or -1 if loading failed
* @returns 0 or -1 if loading failed
*/
static int
xmllintShellLoad(xmllintShellCtxtPtr ctxt, char *filename,
@ -763,17 +750,16 @@ xmllintShellLoad(xmllintShellCtxtPtr ctxt, char *filename,
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmllintShellWrite:
* @ctxt: the shell context
* @filename: the file name
* @node: a node in the tree
* @node2: unused
* @param ctxt the shell context
* @param filename the file name
* @param node a node in the tree
* @param node2 unused
*
* Implements the XML shell function "write"
* Write the current node to the filename, it saves the serialization
* of the subtree under the @node specified
* of the subtree under the `node` specified
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
xmllintShellWrite(xmllintShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
@ -824,16 +810,15 @@ xmllintShellWrite(xmllintShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
}
/**
* xmllintShellSave:
* @ctxt: the shell context
* @filename: the file name (optional)
* @node: unused
* @node2: unused
* @param ctxt the shell context
* @param filename the file name (optional)
* @param node unused
* @param node2 unused
*
* Implements the XML shell function "save"
* Write the current document to the filename, or it's original name
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
xmllintShellSave(xmllintShellCtxtPtr ctxt, char *filename,
@ -878,17 +863,16 @@ xmllintShellSave(xmllintShellCtxtPtr ctxt, char *filename,
#ifdef LIBXML_VALID_ENABLED
/**
* xmllintShellValidate:
* @ctxt: the shell context
* @dtd: the DTD URI (optional)
* @node: unused
* @node2: unused
* @param ctxt the shell context
* @param dtd the DTD URI (optional)
* @param node unused
* @param node2 unused
*
* Implements the XML shell function "validate"
* Validate the document, if a DTD path is provided, then the validation
* is done against the given DTD.
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
xmllintShellValidate(xmllintShellCtxtPtr ctxt, char *dtd,
@ -921,17 +905,16 @@ xmllintShellValidate(xmllintShellCtxtPtr ctxt, char *dtd,
#endif /* LIBXML_VALID_ENABLED */
/**
* xmllintShellDu:
* @ctxt: the shell context
* @arg: unused
* @tree: a node defining a subtree
* @node2: unused
* @param ctxt the shell context
* @param arg unused
* @param tree a node defining a subtree
* @param node2 unused
*
* Implements the XML shell function "du"
* show the structure of the subtree under node @tree
* If @tree is null, the command works on the current node.
* show the structure of the subtree under node `tree`
* If `tree` is null, the command works on the current node.
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
xmllintShellDu(xmllintShellCtxtPtr ctxt,
@ -1005,18 +988,17 @@ xmllintShellDu(xmllintShellCtxtPtr ctxt,
}
/**
* xmllintShellPwd:
* @ctxt: the shell context
* @buffer: the output buffer
* @node: a node
* @node2: unused
* @param ctxt the shell context
* @param buffer the output buffer
* @param node a node
* @param node2 unused
*
* Implements the XML shell function "pwd"
* Show the full path from the root to the node, if needed building
* thumblers when similar elements exists at a given ancestor level.
* The output is compatible with XPath commands.
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
xmllintShellPwd(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer,
@ -1047,12 +1029,11 @@ xmllintShellPwd(xmllintShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer,
}
/**
* xmllintShellReadline:
* @prompt: the prompt value
* @param prompt the prompt value
*
* Read a string
*
* Returns a pointer to it or NULL on EOF the caller is expected to
* @returns a pointer to it or NULL on EOF the caller is expected to
* free the returned string.
*/
static char *
@ -1093,10 +1074,9 @@ xmllintShellReadline(char *prompt) {
}
/**
* xmllintShell:
* @doc: the initial document
* @filename: the output buffer
* @output: the output FILE*, defaults to stdout if NULL
* @param doc the initial document
* @param filename the output buffer
* @param output the output FILE*, defaults to stdout if NULL
*
* Implements the XML shell
* This allow to load, validate, view, modify and save a document

View File

@ -90,11 +90,11 @@ static int instate = 0;
/**
* hugeMatch:
* @URI: an URI to test
* @param URI an URI to test
*
* Check for an huge: query
*
* Returns 1 if yes and 0 if another Input module should be used
* @returns 1 if yes and 0 if another Input module should be used
*/
static int
hugeMatch(const char * URI) {
@ -105,12 +105,12 @@ hugeMatch(const char * URI) {
/**
* hugeOpen:
* @URI: an URI to test
* @param URI an URI to test
*
* Return a pointer to the huge: query handler, in this example simply
* @returns a pointer to the huge: query handler, in this example simply
* the current pointer...
*
* Returns an Input context or NULL in case or error
* @returns an Input context or NULL in case or error
*/
static void *
hugeOpen(const char * URI) {
@ -133,11 +133,11 @@ found:
/**
* hugeClose:
* @context: the read context
* @param context the read context
*
* Close the huge: query handler
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
hugeClose(void * context) {
@ -165,13 +165,13 @@ size_t dotlen;
/**
* hugeRead:
* @context: the read context
* @buffer: where to store data
* @len: number of bytes to read
* @param context the read context
* @param buffer where to store data
* @param len number of bytes to read
*
* Implement an huge: query read.
*
* Returns the number of bytes read or -1 in case of error
* @returns the number of bytes read or -1 in case of error
*/
static int
hugeRead(void *context, char *buffer, int len)
@ -253,11 +253,11 @@ foo\
/**
* crazyMatch:
* @URI: an URI to test
* @param URI an URI to test
*
* Check for a crazy: query
*
* Returns 1 if yes and 0 if another Input module should be used
* @returns 1 if yes and 0 if another Input module should be used
*/
static int
crazyMatch(const char * URI) {
@ -268,12 +268,12 @@ crazyMatch(const char * URI) {
/**
* crazyOpen:
* @URI: an URI to test
* @param URI an URI to test
*
* Return a pointer to the crazy: query handler, in this example simply
* @returns a pointer to the crazy: query handler, in this example simply
* the current pointer...
*
* Returns an Input context or NULL in case or error
* @returns an Input context or NULL in case or error
*/
static void *
crazyOpen(const char * URI) {
@ -291,11 +291,11 @@ crazyOpen(const char * URI) {
/**
* crazyClose:
* @context: the read context
* @param context the read context
*
* Close the crazy: query handler
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
crazyClose(void * context) {
@ -306,13 +306,13 @@ crazyClose(void * context) {
/**
* crazyRead:
* @context: the read context
* @buffer: where to store data
* @len: number of bytes to read
* @param context the read context
* @param buffer where to store data
* @param len number of bytes to read
*
* Implement an crazy: query read.
*
* Returns the number of bytes read or -1 in case of error
* @returns the number of bytes read or -1 in case of error
*/
static int
crazyRead(void *context, char *buffer, int len)
@ -406,11 +406,11 @@ unsigned long callbacks = 0;
/**
* isStandaloneCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
* @returns 1 if true
*/
static int
isStandaloneCallback(void *ctx ATTRIBUTE_UNUSED)
@ -421,11 +421,11 @@ isStandaloneCallback(void *ctx ATTRIBUTE_UNUSED)
/**
* hasInternalSubsetCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
* @returns 1 if true
*/
static int
hasInternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED)
@ -436,11 +436,11 @@ hasInternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED)
/**
* hasExternalSubsetCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
* @returns 1 if true
*/
static int
hasExternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED)
@ -451,7 +451,7 @@ hasExternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED)
/**
* internalSubsetCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an internal subset
*/
@ -466,7 +466,7 @@ internalSubsetCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* externalSubsetCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* Does this document has an external subset
*/
@ -481,9 +481,9 @@ externalSubsetCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* resolveEntityCallback:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctxt An XML parser context
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
@ -491,7 +491,7 @@ externalSubsetCallback(void *ctx ATTRIBUTE_UNUSED,
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityCallback(void *ctx ATTRIBUTE_UNUSED,
@ -504,12 +504,12 @@ resolveEntityCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* getEntityCallback:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityCallback(void *ctx ATTRIBUTE_UNUSED,
@ -521,12 +521,12 @@ getEntityCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* getParameterEntityCallback:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
* @returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityCallback(void *ctx ATTRIBUTE_UNUSED,
@ -539,12 +539,12 @@ getParameterEntityCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* entityDeclCallback:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
* @param ctxt An XML parser context
* @param name the entity name
* @param type the entity type
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param content the entity value (without processing).
*
* An entity definition has been parsed
*/
@ -561,9 +561,9 @@ entityDeclCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* attributeDeclCallback:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
* @param ctxt An XML parser context
* @param name the attribute name
* @param type the attribute type
*
* An attribute definition has been parsed
*/
@ -580,10 +580,10 @@ attributeDeclCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* elementDeclCallback:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
* @param ctxt An XML parser context
* @param name the element name
* @param type the element type
* @param content the element value (without processing).
*
* An element definition has been parsed
*/
@ -598,10 +598,10 @@ elementDeclCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* notationDeclCallback:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @param ctxt An XML parser context
* @param name The name of the notation
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
@ -616,11 +616,11 @@ notationDeclCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* unparsedEntityDeclCallback:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
* @param ctxt An XML parser context
* @param name The name of the entity
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @param notationName the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
@ -636,8 +636,8 @@ unparsedEntityDeclCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* setDocumentLocatorCallback:
* @ctxt: An XML parser context
* @loc: A SAX Locator
* @param ctxt An XML parser context
* @param loc A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
@ -651,7 +651,7 @@ setDocumentLocatorCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* startDocumentCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* called when the document start being processed.
*/
@ -663,7 +663,7 @@ startDocumentCallback(void *ctx ATTRIBUTE_UNUSED)
/**
* endDocumentCallback:
* @ctxt: An XML parser context
* @param ctxt An XML parser context
*
* called when the document end has been detected.
*/
@ -676,8 +676,8 @@ endDocumentCallback(void *ctx ATTRIBUTE_UNUSED)
#if 0
/**
* startElementCallback:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when an opening tag has been processed.
*/
@ -692,8 +692,8 @@ startElementCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* endElementCallback:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when the end of an element has been detected.
*/
@ -708,9 +708,9 @@ endElementCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* charactersCallback:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param len the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
@ -725,8 +725,8 @@ charactersCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* referenceCallback:
* @ctxt: An XML parser context
* @name: The entity name
* @param ctxt An XML parser context
* @param name The entity name
*
* called when an entity reference is detected.
*/
@ -739,10 +739,10 @@ referenceCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* ignorableWhitespaceCallback:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @start: the first char in the string
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param ch a xmlChar string
* @param start the first char in the string
* @param len the number of xmlChar
*
* receiving some ignorable whitespaces from the parser.
* Question: how much at a time ???
@ -757,10 +757,10 @@ ignorableWhitespaceCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* processingInstructionCallback:
* @ctxt: An XML parser context
* @target: the target name
* @data: the PI data's
* @len: the number of xmlChar
* @param ctxt An XML parser context
* @param target the target name
* @param data the PI data's
* @param len the number of xmlChar
*
* A processing instruction has been parsed.
*/
@ -774,9 +774,9 @@ processingInstructionCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* cdataBlockCallback:
* @ctx: the user data (XML parser context)
* @value: The pcdata content
* @len: the block length
* @param ctx the user data (XML parser context)
* @param value The pcdata content
* @param len the block length
*
* called when a pcdata block has been parsed
*/
@ -790,8 +790,8 @@ cdataBlockCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* commentCallback:
* @ctxt: An XML parser context
* @value: the comment content
* @param ctxt An XML parser context
* @param value the comment content
*
* A comment has been parsed.
*/
@ -804,8 +804,8 @@ commentCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* warningCallback:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, gives file, line, position and
@ -820,8 +820,8 @@ warningCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* errorCallback:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a error messages, gives file, line, position and
@ -836,8 +836,8 @@ errorCallback(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
/**
* fatalErrorCallback:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @param ctxt An XML parser context
* @param msg the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a fatalError messages, gives file, line, position and
@ -856,8 +856,8 @@ fatalErrorCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* startElementNsCallback:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when an opening tag has been processed.
*/
@ -877,8 +877,8 @@ startElementNsCallback(void *ctx ATTRIBUTE_UNUSED,
/**
* endElementCallback:
* @ctxt: An XML parser context
* @name: The element name
* @param ctxt An XML parser context
* @param name The element name
*
* called when the end of an element has been detected.
*/
@ -936,14 +936,14 @@ static xmlSAXHandlerPtr callbackSAX2Handler = &callbackSAX2HandlerStruct;
/**
* readerTest:
* @filename: the file to parse
* @max_size: size of the limit to test
* @options: parsing options
* @fail: should a failure be reported
* @param filename the file to parse
* @param max_size size of the limit to test
* @param options parsing options
* @param fail should a failure be reported
*
* Parse a memory generated file using SAX
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
saxTest(const char *filename, size_t limit, int options, int fail) {
@ -988,14 +988,14 @@ saxTest(const char *filename, size_t limit, int options, int fail) {
#ifdef LIBXML_READER_ENABLED
/**
* readerTest:
* @filename: the file to parse
* @max_size: size of the limit to test
* @options: parsing options
* @fail: should a failure be reported
* @param filename the file to parse
* @param max_size size of the limit to test
* @param options parsing options
* @param fail should a failure be reported
*
* Parse a memory generated file using the xmlReader
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
readerTest(const char *filename, size_t limit, int options, int fail) {

View File

@ -245,11 +245,11 @@ static int rlen;
/**
* hugeMatch:
* @URI: an URI to test
* @param URI an URI to test
*
* Check for a huge query
*
* Returns 1 if yes and 0 if another Input module should be used
* @returns 1 if yes and 0 if another Input module should be used
*/
static int
hugeMatch(const char * URI) {
@ -268,12 +268,12 @@ hugeMatch(const char * URI) {
/**
* hugeOpen:
* @URI: an URI to test
* @param URI an URI to test
*
* Return a pointer to the huge query handler, in this example simply
* @returns a pointer to the huge query handler, in this example simply
* the current pointer...
*
* Returns an Input context or NULL in case or error
* @returns an Input context or NULL in case or error
*/
static void *
hugeOpen(const char * URI) {
@ -297,11 +297,11 @@ hugeOpen(const char * URI) {
/**
* hugeClose:
* @context: the read context
* @param context the read context
*
* Close the huge query handler
*
* Returns 0 or -1 in case of error
* @returns 0 or -1 in case of error
*/
static int
hugeClose(void * context) {
@ -313,13 +313,13 @@ hugeClose(void * context) {
/**
* hugeRead:
* @context: the read context
* @buffer: where to store data
* @len: number of bytes to read
* @param context the read context
* @param buffer where to store data
* @param len number of bytes to read
*
* Implement an huge query read.
*
* Returns the number of bytes read or -1 in case of error
* @returns the number of bytes read or -1 in case of error
*/
static int
hugeRead(void *context, char *buffer, int len)
@ -467,14 +467,14 @@ static int checkTestFile(const char *filename) {
************************************************************************/
/**
* recursiveDetectTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file loading DTD and replacing entities check it fails for
* lol cases
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
recursiveDetectTest(const char *filename,
@ -515,14 +515,14 @@ recursiveDetectTest(const char *filename,
/**
* notRecursiveDetectTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a file loading DTD and replacing entities check it works for
* good cases
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
notRecursiveDetectTest(const char *filename,
@ -558,14 +558,14 @@ notRecursiveDetectTest(const char *filename,
/**
* notRecursiveHugeTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a memory generated file
* good cases
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
notRecursiveHugeTest(const char *filename ATTRIBUTE_UNUSED,
@ -660,14 +660,14 @@ notRecursiveHugeTest(const char *filename ATTRIBUTE_UNUSED,
/**
* notRecursiveHugeTest:
* @filename: the file to parse
* @result: the file with expected result
* @err: the file with error messages: unused
* @param filename the file to parse
* @param result the file with expected result
* @param err the file with error messages: unused
*
* Parse a memory generated file
* good cases
*
* Returns 0 in case of success, an error code otherwise
* @returns 0 in case of success, an error code otherwise
*/
static int
hugeDtdTest(const char *filename ATTRIBUTE_UNUSED,

View File

@ -48,8 +48,7 @@
static xmlRMutex xmlLibraryLock;
/**
* xmlInitMutex:
* @mutex: the mutex
* @param mutex the mutex
*
* Initialize a mutex.
*/
@ -66,12 +65,11 @@ xmlInitMutex(xmlMutexPtr mutex)
}
/**
* xmlNewMutex:
*
* xmlNewMutex() is used to allocate a libxml2 token struct for use in
* synchronizing access to data.
*
* Returns a new simple mutex pointer or NULL in case of error
* @returns a new simple mutex pointer or NULL in case of error
*/
xmlMutexPtr
xmlNewMutex(void)
@ -86,8 +84,7 @@ xmlNewMutex(void)
}
/**
* xmlCleanupMutex:
* @mutex: the simple mutex
* @param mutex the simple mutex
*
* Reclaim resources associated with a mutex.
*/
@ -104,8 +101,7 @@ xmlCleanupMutex(xmlMutexPtr mutex)
}
/**
* xmlFreeMutex:
* @tok: the simple mutex
* @param tok the simple mutex
*
* Free a mutex.
*/
@ -120,8 +116,7 @@ xmlFreeMutex(xmlMutexPtr tok)
}
/**
* xmlMutexLock:
* @tok: the simple mutex
* @param tok the simple mutex
*
* xmlMutexLock() is used to lock a libxml2 token.
*/
@ -143,8 +138,7 @@ xmlMutexLock(xmlMutexPtr tok)
}
/**
* xmlMutexUnlock:
* @tok: the simple mutex
* @param tok the simple mutex
*
* xmlMutexUnlock() is used to unlock a libxml2 token.
*/
@ -161,8 +155,7 @@ xmlMutexUnlock(xmlMutexPtr tok)
}
/**
* xmlInitRMutex:
* @tok: mutex
* @param tok mutex
*
* Initialize the mutex.
*/
@ -181,14 +174,13 @@ xmlInitRMutex(xmlRMutexPtr tok) {
}
/**
* xmlNewRMutex:
*
* xmlRNewMutex() is used to allocate a reentrant mutex for use in
* synchronizing access to data. token_r is a re-entrant lock and thus useful
* for synchronizing access to data structures that may be manipulated in a
* recursive fashion.
*
* Returns the new reentrant mutex pointer or NULL in case of error
* @returns the new reentrant mutex pointer or NULL in case of error
*/
xmlRMutexPtr
xmlNewRMutex(void)
@ -203,8 +195,7 @@ xmlNewRMutex(void)
}
/**
* xmlCleanupRMutex:
* @tok: mutex
* @param tok mutex
*
* Cleanup the mutex.
*/
@ -221,8 +212,7 @@ xmlCleanupRMutex(xmlRMutexPtr tok) {
}
/**
* xmlFreeRMutex:
* @tok: the reentrant mutex
* @param tok the reentrant mutex
*
* xmlRFreeMutex() is used to reclaim resources associated with a
* reentrant mutex.
@ -237,8 +227,7 @@ xmlFreeRMutex(xmlRMutexPtr tok)
}
/**
* xmlRMutexLock:
* @tok: the reentrant mutex
* @param tok the reentrant mutex
*
* xmlRMutexLock() is used to lock a libxml2 token_r.
*/
@ -270,8 +259,7 @@ xmlRMutexLock(xmlRMutexPtr tok)
}
/**
* xmlRMutexUnlock:
* @tok: the reentrant mutex
* @param tok the reentrant mutex
*
* xmlRMutexUnlock() is used to unlock a libxml2 token_r.
*/
@ -301,7 +289,6 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
************************************************************************/
/**
* xmlLockLibrary:
*
* xmlLockLibrary() is used to take out a re-entrant lock on the libxml2
* library.
@ -313,7 +300,6 @@ xmlLockLibrary(void)
}
/**
* xmlUnlockLibrary:
*
* xmlUnlockLibrary() is used to release a re-entrant lock on the libxml2
* library.
@ -325,9 +311,8 @@ xmlUnlockLibrary(void)
}
/**
* xmlInitThreads:
*
* DEPRECATED: Alias for xmlInitParser.
* @deprecated Alias for xmlInitParser.
*/
void
xmlInitThreads(void)
@ -336,9 +321,8 @@ xmlInitThreads(void)
}
/**
* xmlCleanupThreads:
*
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
* @deprecated This function is a no-op. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
@ -407,7 +391,6 @@ xmlInitParserWinWrapper(INIT_ONCE *initOnce ATTRIBUTE_UNUSED,
#endif
/**
* xmlInitParser:
*
* Initialization function for the XML parser.
*
@ -433,7 +416,6 @@ xmlInitParser(void) {
}
/**
* xmlCleanupParser:
*
* This function is named somewhat misleadingly. It does not clean up
* parser state but global memory allocated by the library itself.

1140
tree.c

File diff suppressed because it is too large Load Diff

291
uri.c
View File

@ -144,7 +144,7 @@ static void xmlCleanURI(xmlURIPtr uri);
((*(p) == '=')) || ((*(p) == '\'')))
/*
* gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
* gen-delims = ":" / "/" / "?" / "\#" / "[" / "]" / "@"
*/
#define ISA_GEN_DELIM(p) \
(((*(p) == ':')) || ((*(p) == '/')) || ((*(p) == '?')) || \
@ -214,15 +214,14 @@ xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
}
/**
* xmlParse3986Scheme:
* @uri: pointer to an URI structure
* @str: pointer to the string to analyze
* @param uri pointer to an URI structure
* @param str pointer to the string to analyze
*
* Parse an URI scheme
*
* ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
@ -254,9 +253,8 @@ xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
}
/**
* xmlParse3986Fragment:
* @uri: pointer to an URI structure
* @str: pointer to the string to analyze
* @param uri pointer to an URI structure
* @param str pointer to the string to analyze
*
* Parse the query part of an URI
*
@ -266,7 +264,7 @@ xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
* xpointer scheme selection, so we are allowing it here to not break
* for example all the DocBook processing chains.
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Fragment(xmlURIPtr uri, const char **str)
@ -293,15 +291,14 @@ xmlParse3986Fragment(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986Query:
* @uri: pointer to an URI structure
* @str: pointer to the string to analyze
* @param uri pointer to an URI structure
* @param str pointer to the string to analyze
*
* Parse the query part of an URI
*
* query = *uric
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Query(xmlURIPtr uri, const char **str)
@ -336,16 +333,15 @@ xmlParse3986Query(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986Port:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse a port part and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* port = *DIGIT
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Port(xmlURIPtr uri, const char **str)
@ -375,16 +371,15 @@ xmlParse3986Port(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986Userinfo:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an user information part and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
@ -412,8 +407,7 @@ xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986DecOctet:
* @str: the string to analyze
* @param str the string to analyze
*
* dec-octet = DIGIT ; 0-9
* / %x31-39 DIGIT ; 10-99
@ -423,7 +417,7 @@ xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
*
* Skip a dec-octet.
*
* Returns 0 if found and skipped, 1 otherwise
* @returns 0 if found and skipped, 1 otherwise
*/
static int
xmlParse3986DecOctet(const char **str) {
@ -449,19 +443,18 @@ xmlParse3986DecOctet(const char **str) {
return(0);
}
/**
* xmlParse3986Host:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an host part and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* host = IP-literal / IPv4address / reg-name
* IP-literal = "[" ( IPv6address / IPvFuture ) "]"
* IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
* reg-name = *( unreserved / pct-encoded / sub-delims )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Host(xmlURIPtr uri, const char **str)
@ -531,16 +524,15 @@ found:
}
/**
* xmlParse3986Authority:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an authority part and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* authority = [ userinfo "@" ] host [ ":" port ]
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Authority(xmlURIPtr uri, const char **str)
@ -571,21 +563,20 @@ xmlParse3986Authority(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986Segment:
* @uri: the URI
* @str: the string to analyze
* @forbid: an optional forbidden character
* @empty: allow an empty segment
* @param uri the URI
* @param str the string to analyze
* @param forbid an optional forbidden character
* @param empty allow an empty segment
*
* Parse a segment and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* segment = *pchar
* segment-nz = 1*pchar
* segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
* ; non-zero-length segment without any colon ":"
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986Segment(xmlURIPtr uri, const char **str, char forbid, int empty)
@ -615,16 +606,15 @@ xmlParse3986Segment(xmlURIPtr uri, const char **str, char forbid, int empty)
}
/**
* xmlParse3986PathAbEmpty:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an path absolute or empty and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* path-abempty = *( "/" segment )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str)
@ -657,16 +647,15 @@ xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986PathAbsolute:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an path absolute and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* path-absolute = "/" [ segment-nz *( "/" segment ) ]
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986PathAbsolute(xmlURIPtr uri, const char **str)
@ -705,16 +694,15 @@ xmlParse3986PathAbsolute(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986PathRootless:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an path without root and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* path-rootless = segment-nz *( "/" segment )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986PathRootless(xmlURIPtr uri, const char **str)
@ -749,16 +737,15 @@ xmlParse3986PathRootless(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986PathNoScheme:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an path which is not a scheme and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* path-noscheme = segment-nz-nc *( "/" segment )
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str)
@ -793,19 +780,18 @@ xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986HierPart:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an hierarchical part and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* hier-part = "//" authority path-abempty
* / path-absolute
* / path-rootless
* / path-empty
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986HierPart(xmlURIPtr uri, const char **str)
@ -846,20 +832,19 @@ xmlParse3986HierPart(xmlURIPtr uri, const char **str)
}
/**
* xmlParse3986RelativeRef:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an URI string and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* relative-ref = relative-part [ "?" query ] [ "#" fragment ]
* relative-ref = relative-part [ "?" query ] [ "\#" fragment ]
* relative-part = "//" authority path-abempty
* / path-absolute
* / path-noscheme
* / path-empty
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
@ -904,16 +889,15 @@ xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
/**
* xmlParse3986URI:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an URI string and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* scheme ":" hier-part [ "?" query ] [ "#" fragment ]
* scheme ":" hier-part [ "?" query ] [ "\#" fragment ]
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986URI(xmlURIPtr uri, const char *str) {
@ -945,16 +929,15 @@ xmlParse3986URI(xmlURIPtr uri, const char *str) {
}
/**
* xmlParse3986URIReference:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an URI reference string and fills in the appropriate fields
* of the @uri structure
* of the `uri` structure
*
* URI-reference = URI / relative-ref
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
static int
xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
@ -983,17 +966,16 @@ xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
}
/**
* xmlParseURISafe:
* @str: the URI string to analyze
* @uriOut: optional pointer to parsed URI
* @param str the URI string to analyze
* @param uriOut optional pointer to parsed URI
*
* Parse an URI based on RFC 3986
*
* URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
* URI-reference = [ absoluteURI | relativeURI ] [ "\#" fragment ]
*
* Available since 2.13.0.
*
* Returns 0 on success, an error code (typically 1) if the URI is invalid
* @returns 0 on success, an error code (typically 1) if the URI is invalid
* or -1 if a memory allocation failed.
*/
int
@ -1022,14 +1004,13 @@ xmlParseURISafe(const char *str, xmlURIPtr *uriOut) {
}
/**
* xmlParseURI:
* @str: the URI string to analyze
* @param str the URI string to analyze
*
* Parse an URI based on RFC 3986
*
* URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
* URI-reference = [ absoluteURI | relativeURI ] [ "\#" fragment ]
*
* Returns a newly built xmlURIPtr or NULL in case of error
* @returns a newly built xmlURIPtr or NULL in case of error
*/
xmlURIPtr
xmlParseURI(const char *str) {
@ -1039,16 +1020,15 @@ xmlParseURI(const char *str) {
}
/**
* xmlParseURIReference:
* @uri: pointer to an URI structure
* @str: the string to analyze
* @param uri pointer to an URI structure
* @param str the string to analyze
*
* Parse an URI reference string based on RFC 3986 and fills in the
* appropriate fields of the @uri structure
* appropriate fields of the `uri` structure
*
* URI-reference = URI / relative-ref
*
* Returns 0 or the error code
* @returns 0 or the error code
*/
int
xmlParseURIReference(xmlURIPtr uri, const char *str) {
@ -1056,15 +1036,14 @@ xmlParseURIReference(xmlURIPtr uri, const char *str) {
}
/**
* xmlParseURIRaw:
* @str: the URI string to analyze
* @raw: if 1 unescaping of URI pieces are disabled
* @param str the URI string to analyze
* @param raw if 1 unescaping of URI pieces are disabled
*
* Parse an URI but allows to keep intact the original fragments.
*
* URI-reference = URI / relative-ref
*
* Returns a newly built xmlURIPtr or NULL in case of error
* @returns a newly built xmlURIPtr or NULL in case of error
*/
xmlURIPtr
xmlParseURIRaw(const char *str, int raw) {
@ -1094,11 +1073,10 @@ xmlParseURIRaw(const char *str, int raw) {
************************************************************************/
/**
* xmlCreateURI:
*
* Simply creates an empty xmlURI
*
* Returns the new structure or NULL in case of error
* @returns the new structure or NULL in case of error
*/
xmlURIPtr
xmlCreateURI(void) {
@ -1113,7 +1091,6 @@ xmlCreateURI(void) {
}
/**
* xmlSaveUriRealloc:
*
* Function to handle properly a reallocation when saving an URI
* Also imposes some limit on the length of an URI string output
@ -1134,12 +1111,11 @@ xmlSaveUriRealloc(xmlChar *ret, int *max) {
}
/**
* xmlSaveUri:
* @uri: pointer to an xmlURI
* @param uri pointer to an xmlURI
*
* Save the URI as an escaped string
*
* Returns a new string (to be deallocated by caller)
* @returns a new string (to be deallocated by caller)
*/
xmlChar *
xmlSaveUri(xmlURIPtr uri) {
@ -1408,11 +1384,10 @@ mem_error:
}
/**
* xmlPrintURI:
* @stream: a FILE* for the output
* @uri: pointer to an xmlURI
* @param stream a FILE* for the output
* @param uri pointer to an xmlURI
*
* Prints the URI in the stream @stream.
* Prints the URI in the stream `stream`.
*/
void
xmlPrintURI(FILE *stream, xmlURIPtr uri) {
@ -1426,8 +1401,7 @@ xmlPrintURI(FILE *stream, xmlURIPtr uri) {
}
/**
* xmlCleanURI:
* @uri: pointer to an xmlURI
* @param uri pointer to an xmlURI
*
* Make sure the xmlURI struct is free of content
*/
@ -1456,8 +1430,7 @@ xmlCleanURI(xmlURIPtr uri) {
}
/**
* xmlFreeURI:
* @uri: pointer to an xmlURI
* @param uri pointer to an xmlURI
*
* Free up the xmlURI struct
*/
@ -1499,13 +1472,12 @@ xmlIsPathSeparator(int c, int isFile) {
}
/**
* xmlNormalizePath:
* @path: pointer to the path string
* @isFile: true for filesystem paths, false for URIs
* @param path pointer to the path string
* @param isFile true for filesystem paths, false for URIs
*
* Normalize a filesystem path or URI.
*
* Returns 0 or an error code
* @returns 0 or an error code
*/
static int
xmlNormalizePath(char *path, int isFile) {
@ -1598,15 +1570,14 @@ xmlNormalizePath(char *path, int isFile) {
}
/**
* xmlNormalizeURIPath:
* @path: pointer to the path string
* @param path pointer to the path string
*
* Applies the 5 normalization steps to a path string--that is, RFC 2396
* Section 5.2, steps 6.c through 6.g.
*
* Normalization occurs directly on the string, no new allocation is done
*
* Returns 0 or an error code
* @returns 0 or an error code
*/
int
xmlNormalizeURIPath(char *path) {
@ -1622,17 +1593,16 @@ static int is_hex(char c) {
}
/**
* xmlURIUnescapeString:
* @str: the string to unescape
* @len: the length in bytes to unescape (or <= 0 to indicate full string)
* @target: optional destination buffer
* @param str the string to unescape
* @param len the length in bytes to unescape (or <= 0 to indicate full string)
* @param target optional destination buffer
*
* Unescaping routine, but does not check that the string is an URI. The
* output is a direct unsigned char translation of %XX values (no encoding)
* Note that the length of the result can only be smaller or same size as
* the input string.
*
* Returns a copy of the string, but unescaped, will return NULL only in case
* @returns a copy of the string, but unescaped, will return NULL only in case
* of error
*/
char *
@ -1684,15 +1654,14 @@ xmlURIUnescapeString(const char *str, int len, char *target) {
}
/**
* xmlURIEscapeStr:
* @str: string to escape
* @list: exception list string of chars not to escape
* @param str string to escape
* @param list exception list string of chars not to escape
*
* This routine escapes a string to hex, ignoring unreserved characters
* a-z, A-Z, 0-9, "-._~", a few sub-delims "!*'()", the gen-delim "@"
* (why?) and the characters in the exception list.
*
* Returns a new escaped string or NULL in case of error.
* @returns a new escaped string or NULL in case of error.
*/
xmlChar *
xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
@ -1757,14 +1726,13 @@ xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
}
/**
* xmlURIEscape:
* @str: the string of the URI to escape
* @param str the string of the URI to escape
*
* Escaping routine, does not do validity checks !
* It will try to escape the chars needing this, but this is heuristic
* based it's impossible to be sure.
*
* Returns an copy of the string, but escaped
* @returns an copy of the string, but escaped
*
* 25 May 2001
* Uses xmlParseURI and xmlURIEscapeStr to try to escape correctly
@ -1913,14 +1881,13 @@ xmlIsAbsolutePath(const xmlChar *path) {
}
/**
* xmlResolvePath:
* @escRef: the filesystem path
* @base: the base value
* @out: pointer to result URI
* @param escRef the filesystem path
* @param base the base value
* @param out pointer to result URI
*
* Resolves a filesystem path from a base path.
*
* Returns 0 on success, -1 if a memory allocation failed or an error
* @returns 0 on success, -1 if a memory allocation failed or an error
* code if URI or base are invalid.
*/
static int
@ -2017,10 +1984,9 @@ err_memory:
}
/**
* xmlBuildURISafe:
* @URI: the URI instance found in the document
* @base: the base value
* @valPtr: pointer to result URI
* @param URI the URI instance found in the document
* @param base the base value
* @param valPtr pointer to result URI
*
* Computes he final URI of the reference done by checking that
* the given URI is valid, and building the final URI using the
@ -2031,7 +1997,7 @@ err_memory:
*
* Available since 2.13.0.
*
* Returns 0 on success, -1 if a memory allocation failed or an error
* @returns 0 on success, -1 if a memory allocation failed or an error
* code if URI or base are invalid.
*/
int
@ -2386,9 +2352,8 @@ done:
}
/**
* xmlBuildURI:
* @URI: the URI instance found in the document
* @base: the base value
* @param URI the URI instance found in the document
* @param base the base value
*
* Computes he final URI of the reference done by checking that
* the given URI is valid, and building the final URI using the
@ -2397,7 +2362,7 @@ done:
*
* 5.2. Resolving Relative References to Absolute Form
*
* Returns a new URI string (to be freed by the caller) or NULL in case
* @returns a new URI string (to be freed by the caller) or NULL in case
* of error.
*/
xmlChar *
@ -2532,10 +2497,9 @@ done:
}
/**
* xmlBuildRelativeURISafe:
* @URI: the URI reference under consideration
* @base: the base value
* @valPtr: pointer to result URI
* @param URI the URI reference under consideration
* @param base the base value
* @param valPtr pointer to result URI
*
* Expresses the URI of the reference in terms relative to the
* base. Some examples of this operation include:
@ -2554,7 +2518,7 @@ done:
*
* Available since 2.13.0.
*
* Returns 0 on success, -1 if a memory allocation failed or an error
* @returns 0 on success, -1 if a memory allocation failed or an error
* code if URI or base are invalid.
*/
int
@ -2775,13 +2739,12 @@ done:
}
/*
* xmlBuildRelativeURI:
* @URI: the URI reference under consideration
* @base: the base value
* @param URI the URI reference under consideration
* @param base the base value
*
* See xmlBuildRelativeURISafe.
*
* Returns a new URI string (to be freed by the caller) or NULL in case
* @returns a new URI string (to be freed by the caller) or NULL in case
* error.
*/
xmlChar *
@ -2794,8 +2757,7 @@ xmlBuildRelativeURI(const xmlChar * URI, const xmlChar * base)
}
/**
* xmlCanonicPath:
* @path: the resource locator in a filesystem notation
* @param path the resource locator in a filesystem notation
*
* Prepares a path.
*
@ -2810,7 +2772,7 @@ xmlBuildRelativeURI(const xmlChar * URI, const xmlChar * base)
* by the returned string. If there is insufficient memory available, or the
* argument is NULL, the function returns NULL.
*
* Returns the escaped path.
* @returns the escaped path.
*/
xmlChar *
xmlCanonicPath(const xmlChar *path)
@ -2838,12 +2800,11 @@ xmlCanonicPath(const xmlChar *path)
}
/**
* xmlPathToURI:
* @path: the resource locator in a filesystem notation
* @param path the resource locator in a filesystem notation
*
* Constructs an URI expressing the existing path
*
* Returns a new URI, or a duplicate of the path parameter if the
* @returns a new URI, or a duplicate of the path parameter if the
* construction fails. The caller is responsible for freeing the memory
* occupied by the returned string. If there is insufficient memory available,
* or the argument is NULL, the function returns NULL.

970
valid.c

File diff suppressed because it is too large Load Diff

View File

@ -131,8 +131,7 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree);
************************************************************************/
/**
* xmlXIncludeErrMemory:
* @ctxt: an XInclude context
* @param ctxt an XInclude context
*
* Handle an out of memory condition
*/
@ -148,12 +147,11 @@ xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt)
}
/**
* xmlXIncludeErr:
* @ctxt: the XInclude context
* @node: the context node
* @error: the error code
* @msg: the error message
* @extra: extra information
* @param ctxt the XInclude context
* @param node the context node
* @param error the error code
* @param msg the error message
* @param extra extra information
*
* Handle an XInclude error
*/
@ -204,14 +202,13 @@ xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
}
/**
* xmlXIncludeGetProp:
* @ctxt: the XInclude context
* @cur: the node
* @name: the attribute name
* @param ctxt the XInclude context
* @param cur the node
* @param name the attribute name
*
* Get an XInclude attribute
*
* Returns the value (to be freed) or NULL if not found
* @returns the value (to be freed) or NULL if not found
*/
static xmlChar *
xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur,
@ -235,8 +232,7 @@ xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur,
return(ret);
}
/**
* xmlXIncludeFreeRef:
* @ref: the XInclude reference
* @param ref the XInclude reference
*
* Free an XInclude reference
*/
@ -254,12 +250,11 @@ xmlXIncludeFreeRef(xmlXIncludeRefPtr ref) {
}
/**
* xmlXIncludeNewContext:
* @doc: an XML Document
* @param doc an XML Document
*
* Creates a new XInclude context
*
* Returns the new set
* @returns the new set
*/
xmlXIncludeCtxtPtr
xmlXIncludeNewContext(xmlDocPtr doc) {
@ -280,8 +275,7 @@ xmlXIncludeNewContext(xmlDocPtr doc) {
}
/**
* xmlXIncludeFreeContext:
* @ctxt: the XInclude context
* @param ctxt the XInclude context
*
* Free an XInclude context
*/
@ -319,9 +313,8 @@ xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) {
}
/**
* xmlXIncludeParseFile:
* @ctxt: the XInclude context
* @URL: the URL or file path
* @param ctxt the XInclude context
* @param URL the URL or file path
*
* parse a document for XInclude
*/
@ -396,9 +389,8 @@ error:
}
/**
* xmlXIncludeAddNode:
* @ctxt: the XInclude context
* @cur: the new node
* @param ctxt the XInclude context
* @param cur the new node
*
* Add a new node to process to an XInclude context
*/
@ -600,9 +592,8 @@ error:
}
/**
* xmlXIncludeRecurseDoc:
* @ctxt: the XInclude context
* @doc: the new document
* @param ctxt the XInclude context
* @param doc the new document
*
* The XInclude recursive nature is handled at this point.
*/
@ -703,15 +694,14 @@ done:
}
/**
* xmlXIncludeCopyNode:
* @ctxt: the XInclude context
* @elem: the element
* @copyChildren: copy children instead of node if true
* @targetBase: the xml:base of the target node
* @param ctxt the XInclude context
* @param elem the element
* @param copyChildren copy children instead of node if true
* @param targetBase the xml:base of the target node
*
* Make a copy of the node while expanding nested XIncludes.
*
* Returns a node list, not a single node.
* @returns a node list, not a single node.
*/
static xmlNodePtr
xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr elem,
@ -826,15 +816,14 @@ error:
#ifdef LIBXML_XPTR_ENABLED
/**
* xmlXIncludeCopyXPointer:
* @ctxt: the XInclude context
* @obj: the XPointer result from the evaluation.
* @targetBase: the xml:base of the target node
* @param ctxt the XInclude context
* @param obj the XPointer result from the evaluation.
* @param targetBase the xml:base of the target node
*
* Build a node list tree copy of the XPointer result.
* This will drop Attributes and Namespace declarations.
*
* Returns an xmlNodePtr list or NULL.
* @returns an xmlNodePtr list or NULL.
* the caller has to free the node tree.
*/
static xmlNodePtr
@ -925,10 +914,9 @@ struct _xmlXIncludeMergeData {
};
/**
* xmlXIncludeMergeOneEntity:
* @payload: the entity
* @vdata: the merge data
* @name: unused
* @param payload the entity
* @param vdata the merge data
* @param name unused
*
* Implements the merge of one entity
*/
@ -1006,14 +994,13 @@ error:
}
/**
* xmlXIncludeMergeEntities:
* @ctxt: an XInclude context
* @doc: the including doc
* @from: the included doc
* @param ctxt an XInclude context
* @param doc the including doc
* @param from the included doc
*
* Implements the entity merge
*
* Returns 0 if merge succeeded, -1 if some processing failed
* @returns 0 if merge succeeded, -1 if some processing failed
*/
static int
xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc,
@ -1069,13 +1056,12 @@ xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc,
}
/**
* xmlXIncludeLoadDoc:
* @ctxt: the XInclude context
* @ref: an XMLXincludeRefPtr
* @param ctxt the XInclude context
* @param ref an XMLXincludeRefPtr
*
* Load the document, and store the result in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
* @returns 0 in case of success, -1 in case of failure
*/
static int
xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
@ -1345,13 +1331,12 @@ error:
}
/**
* xmlXIncludeLoadTxt:
* @ctxt: the XInclude context
* @ref: an XMLXincludeRefPtr
* @param ctxt the XInclude context
* @param ref an XMLXincludeRefPtr
*
* Load the content, and store the result in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
* @returns 0 in case of success, -1 in case of failure
*/
static int
xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
@ -1543,15 +1528,14 @@ error:
}
/**
* xmlXIncludeLoadFallback:
* @ctxt: the XInclude context
* @fallback: the fallback node
* @ref: an XMLXincludeRefPtr
* @param ctxt the XInclude context
* @param fallback the fallback node
* @param ref an XMLXincludeRefPtr
*
* Load the content of the fallback node, and store the result
* in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
* @returns 0 in case of success, -1 in case of failure
*/
static int
xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback,
@ -1585,14 +1569,13 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback,
************************************************************************/
/**
* xmlXIncludeExpandNode:
* @ctxt: an XInclude context
* @node: an XInclude node
* @param ctxt an XInclude context
* @param node an XInclude node
*
* If the XInclude node wasn't processed yet, create a new RefPtr,
* add it to ctxt->incTab and load the included items.
*
* Returns the new or existing xmlXIncludeRefPtr, or NULL in case of error.
* @returns the new or existing xmlXIncludeRefPtr, or NULL in case of error.
*/
static xmlXIncludeRefPtr
xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
@ -1657,13 +1640,12 @@ xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
}
/**
* xmlXIncludeLoadNode:
* @ctxt: an XInclude context
* @ref: an xmlXIncludeRefPtr
* @param ctxt an XInclude context
* @param ref an xmlXIncludeRefPtr
*
* Find and load the infoset replacement for the given node.
*
* Returns 0 if substitution succeeded, -1 if some processing failed
* @returns 0 if substitution succeeded, -1 if some processing failed
*/
static int
xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
@ -1712,13 +1694,12 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
}
/**
* xmlXIncludeIncludeNode:
* @ctxt: an XInclude context
* @ref: an xmlXIncludeRefPtr
* @param ctxt an XInclude context
* @param ref an xmlXIncludeRefPtr
*
* Implement the infoset replacement for the given node
*
* Returns 0 if substitution succeeded, -1 if some processing failed
* @returns 0 if substitution succeeded, -1 if some processing failed
*/
static int
xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
@ -1828,13 +1809,12 @@ err_memory:
}
/**
* xmlXIncludeTestNode:
* @ctxt: the XInclude processing context
* @node: an XInclude node
* @param ctxt the XInclude processing context
* @param node an XInclude node
*
* test if the node is an XInclude node
*
* Returns 1 true, 0 otherwise
* @returns 1 true, 0 otherwise
*/
static int
xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
@ -1899,13 +1879,12 @@ xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
}
/**
* xmlXIncludeDoProcess:
* @ctxt: the XInclude processing context
* @tree: the top of the tree to process
* @param ctxt the XInclude processing context
* @param tree the top of the tree to process
*
* Implement the XInclude substitution on the XML document @doc
* Implement the XInclude substitution on the XML document `doc`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
static int
@ -1982,13 +1961,12 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
}
/**
* xmlXIncludeDoProcessRoot:
* @ctxt: the XInclude processing context
* @tree: the top of the tree to process
* @param ctxt the XInclude processing context
* @param tree the top of the tree to process
*
* Implement the XInclude substitution on the XML document @doc
* Implement the XInclude substitution on the XML document `doc`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
static int
@ -2002,12 +1980,11 @@ xmlXIncludeDoProcessRoot(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
}
/**
* xmlXIncludeGetLastError:
* @ctxt: an XInclude processing context
* @param ctxt an XInclude processing context
*
* Available since 2.13.0.
*
* Returns the last error code.
* @returns the last error code.
*/
int
xmlXIncludeGetLastError(xmlXIncludeCtxtPtr ctxt) {
@ -2017,10 +1994,9 @@ xmlXIncludeGetLastError(xmlXIncludeCtxtPtr ctxt) {
}
/**
* xmlXIncludeSetErrorHandler:
* @ctxt: an XInclude processing context
* @handler: error handler
* @data: user data which will be passed to the handler
* @param ctxt an XInclude processing context
* @param handler error handler
* @param data user data which will be passed to the handler
*
* Register a callback function that will be called on errors and
* warnings. If handler is NULL, the error handler will be deactivated.
@ -2037,10 +2013,9 @@ xmlXIncludeSetErrorHandler(xmlXIncludeCtxtPtr ctxt,
}
/**
* xmlXIncludeSetResourceLoader:
* @ctxt: an XInclude processing context
* @loader: resource loader
* @data: user data which will be passed to the loader
* @param ctxt an XInclude processing context
* @param loader resource loader
* @param data user data which will be passed to the loader
*
* Register a callback function that will be called to load included
* documents.
@ -2057,13 +2032,12 @@ xmlXIncludeSetResourceLoader(xmlXIncludeCtxtPtr ctxt,
}
/**
* xmlXIncludeSetFlags:
* @ctxt: an XInclude processing context
* @flags: a set of xmlParserOption used for parsing XML includes
* @param ctxt an XInclude processing context
* @param flags a set of xmlParserOption used for parsing XML includes
*
* Set the flags used for further processing of XML resources.
*
* Returns 0 in case of success and -1 in case of error.
* @returns 0 in case of success and -1 in case of error.
*/
int
xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) {
@ -2074,13 +2048,12 @@ xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) {
}
/**
* xmlXIncludeSetStreamingMode:
* @ctxt: an XInclude processing context
* @mode: whether streaming mode should be enabled
* @param ctxt an XInclude processing context
* @param mode whether streaming mode should be enabled
*
* In streaming mode, XPointer expressions aren't allowed.
*
* Returns 0 in case of success and -1 in case of error.
* @returns 0 in case of success and -1 in case of error.
*/
int
xmlXIncludeSetStreamingMode(xmlXIncludeCtxtPtr ctxt, int mode) {
@ -2091,15 +2064,14 @@ xmlXIncludeSetStreamingMode(xmlXIncludeCtxtPtr ctxt, int mode) {
}
/**
* xmlXIncludeProcessTreeFlagsData:
* @tree: an XML node
* @flags: a set of xmlParserOption used for parsing XML includes
* @data: application data that will be passed to the parser context
* @param tree an XML node
* @param flags a set of xmlParserOption used for parsing XML includes
* @param data application data that will be passed to the parser context
* in the _private field of the parser context(s)
*
* Implement the XInclude substitution on the XML node @tree
* Implement the XInclude substitution on the XML node `tree`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
@ -2126,15 +2098,14 @@ xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree, int flags, void *data) {
}
/**
* xmlXIncludeProcessFlagsData:
* @doc: an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
* @data: application data that will be passed to the parser context
* @param doc an XML document
* @param flags a set of xmlParserOption used for parsing XML includes
* @param data application data that will be passed to the parser context
* in the _private field of the parser context(s)
*
* Implement the XInclude substitution on the XML document @doc
* Implement the XInclude substitution on the XML document `doc`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
@ -2150,13 +2121,12 @@ xmlXIncludeProcessFlagsData(xmlDocPtr doc, int flags, void *data) {
}
/**
* xmlXIncludeProcessFlags:
* @doc: an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
* @param doc an XML document
* @param flags a set of xmlParserOption used for parsing XML includes
*
* Implement the XInclude substitution on the XML document @doc
* Implement the XInclude substitution on the XML document `doc`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
@ -2165,12 +2135,11 @@ xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) {
}
/**
* xmlXIncludeProcess:
* @doc: an XML document
* @param doc an XML document
*
* Implement the XInclude substitution on the XML document @doc
* Implement the XInclude substitution on the XML document `doc`
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
@ -2179,13 +2148,12 @@ xmlXIncludeProcess(xmlDocPtr doc) {
}
/**
* xmlXIncludeProcessTreeFlags:
* @tree: a node in an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
* @param tree a node in an XML document
* @param flags a set of xmlParserOption used for parsing XML includes
*
* Implement the XInclude substitution for the given subtree
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
@ -2209,12 +2177,11 @@ xmlXIncludeProcessTreeFlags(xmlNodePtr tree, int flags) {
}
/**
* xmlXIncludeProcessTree:
* @tree: a node in an XML document
* @param tree a node in an XML document
*
* Implement the XInclude substitution for the given subtree
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
@ -2223,14 +2190,13 @@ xmlXIncludeProcessTree(xmlNodePtr tree) {
}
/**
* xmlXIncludeProcessNode:
* @ctxt: an existing XInclude context
* @node: a node in an XML document
* @param ctxt an existing XInclude context
* @param node a node in an XML document
*
* Implement the XInclude substitution for the given subtree reusing
* the information and data coming from the given context.
*
* Returns 0 if no substitution were done, -1 if some processing failed
* @returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int

27
xlink.c
View File

@ -34,13 +34,12 @@ static xlinkHandlerPtr xlinkDefaultHandler = NULL;
static xlinkNodeDetectFunc xlinkDefaultDetect = NULL;
/**
* xlinkGetDefaultHandler:
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Get the default xlink handler.
*
* Returns the current xlinkHandlerPtr value.
* @returns the current xlinkHandlerPtr value.
*/
xlinkHandlerPtr
xlinkGetDefaultHandler(void) {
@ -49,10 +48,9 @@ xlinkGetDefaultHandler(void) {
/**
* xlinkSetDefaultHandler:
* @handler: the new value for the xlink handler block
* @param handler the new value for the xlink handler block
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Set the default xlink handlers
*/
@ -62,13 +60,12 @@ xlinkSetDefaultHandler(xlinkHandlerPtr handler) {
}
/**
* xlinkGetDefaultDetect:
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Get the default xlink detection routine
*
* Returns the current function or NULL;
* @returns the current function or NULL;
*/
xlinkNodeDetectFunc
xlinkGetDefaultDetect (void) {
@ -76,10 +73,9 @@ xlinkGetDefaultDetect (void) {
}
/**
* xlinkSetDefaultDetect:
* @func: pointer to the new detection routine.
* @param func pointer to the new detection routine.
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Set the default xlink detection routine
*/
@ -96,9 +92,8 @@ xlinkSetDefaultDetect (xlinkNodeDetectFunc func) {
/**
* xlinkIsLink:
* @doc: the document containing the node
* @node: the node pointer itself
* @param doc the document containing the node
* @param node the node pointer itself
*
* Check whether the given node carries the attributes needed
* to be a link element (or is one of the linking elements issued
@ -106,7 +101,7 @@ xlinkSetDefaultDetect (xlinkNodeDetectFunc func) {
* This routine don't try to do full checking of the link validity
* but tries to detect and return the appropriate link type.
*
* Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no
* @returns the xlinkType of the node (XLINK_TYPE_NONE if there is no
* link detected.
*/
xlinkType

494
xmlIO.c

File diff suppressed because it is too large Load Diff

View File

@ -59,12 +59,11 @@ static char *filename = NULL;
* *
************************************************************************/
/**
* xmlShellReadline:
* @prompt: the prompt value
* @param prompt the prompt value
*
* Read a string
*
* Returns a pointer to it or NULL on EOF the caller is expected to
* @returns a pointer to it or NULL on EOF the caller is expected to
* free the returned string.
*/
static char *

View File

@ -56,14 +56,13 @@ typedef struct memnod {
#define HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE))
/**
* xmlMallocLoc:
* @size: an int specifying the size in byte to allocate.
* @file: the file name or NULL
* @line: the line number
* @param size an int specifying the size in byte to allocate.
* @param file the file name or NULL
* @param line the line number
*
* DEPRECATED: don't use
* @deprecated don't use
*
* Returns a pointer to the allocated area or NULL in case of lack of memory.
* @returns a pointer to the allocated area or NULL in case of lack of memory.
*/
void *
xmlMallocLoc(size_t size, const char *file ATTRIBUTE_UNUSED,
@ -73,14 +72,13 @@ xmlMallocLoc(size_t size, const char *file ATTRIBUTE_UNUSED,
}
/**
* xmlMallocAtomicLoc:
* @size: an unsigned int specifying the size in byte to allocate.
* @file: the file name or NULL
* @line: the line number
* @param size an unsigned int specifying the size in byte to allocate.
* @param file the file name or NULL
* @param line the line number
*
* DEPRECATED: don't use
* @deprecated don't use
*
* Returns a pointer to the allocated area or NULL in case of lack of memory.
* @returns a pointer to the allocated area or NULL in case of lack of memory.
*/
void *
xmlMallocAtomicLoc(size_t size, const char *file ATTRIBUTE_UNUSED,
@ -90,12 +88,11 @@ xmlMallocAtomicLoc(size_t size, const char *file ATTRIBUTE_UNUSED,
}
/**
* xmlMemMalloc:
* @size: an int specifying the size in byte to allocate.
* @param size an int specifying the size in byte to allocate.
*
* a malloc() equivalent, with logging of the allocation info.
*
* Returns a pointer to the allocated area or NULL in case of lack of memory.
* @returns a pointer to the allocated area or NULL in case of lack of memory.
*/
void *
xmlMemMalloc(size_t size)
@ -122,15 +119,14 @@ xmlMemMalloc(size_t size)
}
/**
* xmlReallocLoc:
* @ptr: the initial memory block pointer
* @size: an int specifying the size in byte to allocate.
* @file: the file name or NULL
* @line: the line number
* @param ptr the initial memory block pointer
* @param size an int specifying the size in byte to allocate.
* @param file the file name or NULL
* @param line the line number
*
* DEPRECATED: don't use
* @deprecated don't use
*
* Returns a pointer to the allocated area or NULL in case of lack of memory.
* @returns a pointer to the allocated area or NULL in case of lack of memory.
*/
void *
xmlReallocLoc(void *ptr, size_t size, const char *file ATTRIBUTE_UNUSED,
@ -140,13 +136,12 @@ xmlReallocLoc(void *ptr, size_t size, const char *file ATTRIBUTE_UNUSED,
}
/**
* xmlMemRealloc:
* @ptr: the initial memory block pointer
* @size: an int specifying the size in byte to allocate.
* @param ptr the initial memory block pointer
* @param size an int specifying the size in byte to allocate.
*
* a realloc() equivalent, with logging of the allocation info.
*
* Returns a pointer to the allocated area or NULL in case of lack of memory.
* @returns a pointer to the allocated area or NULL in case of lack of memory.
*/
void *
xmlMemRealloc(void *ptr, size_t size) {
@ -187,8 +182,7 @@ xmlMemRealloc(void *ptr, size_t size) {
}
/**
* xmlMemFree:
* @ptr: the memory block pointer
* @param ptr the memory block pointer
*
* a free() equivalent, with error checking.
*/
@ -222,14 +216,13 @@ xmlMemFree(void *ptr)
}
/**
* xmlMemStrdupLoc:
* @str: the initial string pointer
* @file: the file name or NULL
* @line: the line number
* @param str the initial string pointer
* @param file the file name or NULL
* @param line the line number
*
* DEPRECATED: don't use
* @deprecated don't use
*
* Returns a pointer to the new string or NULL if allocation error occurred.
* @returns a pointer to the new string or NULL if allocation error occurred.
*/
char *
xmlMemStrdupLoc(const char *str, const char *file ATTRIBUTE_UNUSED,
@ -239,12 +232,11 @@ xmlMemStrdupLoc(const char *str, const char *file ATTRIBUTE_UNUSED,
}
/**
* xmlMemoryStrdup:
* @str: the initial string pointer
* @param str the initial string pointer
*
* a strdup() equivalent, with logging of the allocation info.
*
* Returns a pointer to the new string or NULL if allocation error occurred.
* @returns a pointer to the new string or NULL if allocation error occurred.
*/
char *
xmlMemoryStrdup(const char *str) {
@ -276,10 +268,9 @@ xmlMemoryStrdup(const char *str) {
}
/**
* xmlMemSize:
* @ptr: pointer to the memory allocation
* @param ptr pointer to the memory allocation
*
* Returns the size of a memory allocation.
* @returns the size of a memory allocation.
*/
size_t
@ -297,11 +288,10 @@ xmlMemSize(void *ptr) {
}
/**
* xmlMemUsed:
*
* Provides the amount of memory currently allocated
*
* Returns an int representing the amount of memory allocated.
* @returns an int representing the amount of memory allocated.
*/
int
@ -310,11 +300,10 @@ xmlMemUsed(void) {
}
/**
* xmlMemBlocks:
*
* Provides the number of memory areas currently allocated
*
* Returns an int representing the number of blocks
* @returns an int representing the number of blocks
*/
int
@ -328,11 +317,10 @@ xmlMemBlocks(void) {
}
/**
* xmlMemDisplayLast:
* @fp: a FILE descriptor
* @nbBytes: the amount of memory to dump
* @param fp a FILE descriptor
* @param nbBytes the amount of memory to dump
*
* DEPRECATED: This feature was removed.
* @deprecated This feature was removed.
*/
void
xmlMemDisplayLast(FILE *fp ATTRIBUTE_UNUSED, long nbBytes ATTRIBUTE_UNUSED)
@ -340,10 +328,9 @@ xmlMemDisplayLast(FILE *fp ATTRIBUTE_UNUSED, long nbBytes ATTRIBUTE_UNUSED)
}
/**
* xmlMemDisplay:
* @fp: a FILE descriptor
* @param fp a FILE descriptor
*
* DEPRECATED: This feature was removed.
* @deprecated This feature was removed.
*/
void
xmlMemDisplay(FILE *fp ATTRIBUTE_UNUSED)
@ -351,11 +338,10 @@ xmlMemDisplay(FILE *fp ATTRIBUTE_UNUSED)
}
/**
* xmlMemShow:
* @fp: a FILE descriptor
* @nr: number of entries to dump
* @param fp a FILE descriptor
* @param nr number of entries to dump
*
* DEPRECATED: This feature was removed.
* @deprecated This feature was removed.
*/
void
xmlMemShow(FILE *fp ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED)
@ -363,9 +349,8 @@ xmlMemShow(FILE *fp ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED)
}
/**
* xmlMemoryDump:
*
* DEPRECATED: This feature was removed.
* @deprecated This feature was removed.
*/
void
xmlMemoryDump(void)
@ -380,11 +365,10 @@ xmlMemoryDump(void)
****************************************************************/
/**
* xmlInitMemory:
*
* DEPRECATED: Alias for xmlInitParser.
* @deprecated Alias for xmlInitParser.
*
* Returns 0.
* @returns 0.
*/
int
xmlInitMemory(void) {
@ -393,7 +377,6 @@ xmlInitMemory(void) {
}
/**
* xmlInitMemoryInternal:
*
* Initialize the memory layer.
*/
@ -403,9 +386,8 @@ xmlInitMemoryInternal(void) {
}
/**
* xmlCleanupMemory:
*
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
* @deprecated This function is a no-op. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
@ -415,7 +397,6 @@ xmlCleanupMemory(void) {
}
/**
* xmlCleanupMemoryInternal:
*
* Free up all the memory allocated by the library for its own
* use. This should not be called by user level code.
@ -435,11 +416,10 @@ xmlCleanupMemoryInternal(void) {
}
/**
* xmlMemSetup:
* @freeFunc: the free() function to use
* @mallocFunc: the malloc() function to use
* @reallocFunc: the realloc() function to use
* @strdupFunc: the strdup() function to use
* @param freeFunc the free() function to use
* @param mallocFunc the malloc() function to use
* @param reallocFunc the realloc() function to use
* @param strdupFunc the strdup() function to use
*
* Override the default memory access functions with a new set
* This has to be called before any other libxml routines !
@ -447,7 +427,7 @@ xmlCleanupMemoryInternal(void) {
* Should this be blocked if there was already some allocations
* done ?
*
* Returns 0 on success
* @returns 0 on success
*/
int
xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
@ -469,15 +449,14 @@ xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
}
/**
* xmlMemGet:
* @freeFunc: place to save the free() function in use
* @mallocFunc: place to save the malloc() function in use
* @reallocFunc: place to save the realloc() function in use
* @strdupFunc: place to save the strdup() function in use
* @param freeFunc place to save the free() function in use
* @param mallocFunc place to save the malloc() function in use
* @param reallocFunc place to save the realloc() function in use
* @param strdupFunc place to save the strdup() function in use
*
* Provides the memory access functions set currently in use
*
* Returns 0 on success
* @returns 0 on success
*/
int
xmlMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc,
@ -490,14 +469,13 @@ xmlMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc,
}
/**
* xmlGcMemSetup:
* @freeFunc: the free() function to use
* @mallocFunc: the malloc() function to use
* @mallocAtomicFunc: the malloc() function to use for atomic allocations
* @reallocFunc: the realloc() function to use
* @strdupFunc: the strdup() function to use
* @param freeFunc the free() function to use
* @param mallocFunc the malloc() function to use
* @param mallocAtomicFunc the malloc() function to use for atomic allocations
* @param reallocFunc the realloc() function to use
* @param strdupFunc the strdup() function to use
*
* DEPRECATED: Use xmlMemSetup.
* @deprecated Use xmlMemSetup.
*
* Override the default memory access functions with a new set
* This has to be called before any other libxml routines !
@ -507,7 +485,7 @@ xmlMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc,
* Should this be blocked if there was already some allocations
* done ?
*
* Returns 0 on success
* @returns 0 on success
*/
int
xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
@ -532,20 +510,19 @@ xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
}
/**
* xmlGcMemGet:
* @freeFunc: place to save the free() function in use
* @mallocFunc: place to save the malloc() function in use
* @mallocAtomicFunc: place to save the atomic malloc() function in use
* @reallocFunc: place to save the realloc() function in use
* @strdupFunc: place to save the strdup() function in use
* @param freeFunc place to save the free() function in use
* @param mallocFunc place to save the malloc() function in use
* @param mallocAtomicFunc place to save the atomic malloc() function in use
* @param reallocFunc place to save the realloc() function in use
* @param strdupFunc place to save the strdup() function in use
*
* DEPRECATED: xmlMemGet.
* @deprecated xmlMemGet.
*
* Provides the memory access functions set currently in use
* The mallocAtomicFunc is specialized for atomic block
* allocations (i.e. of areas useful for garbage collected memory allocators
*
* Returns 0 on success
* @returns 0 on success
*/
int
xmlGcMemGet(xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc,

View File

@ -42,18 +42,17 @@ static int xmlModulePlatformSymbol(void *handle, const char *name, void **result
************************************************************************/
/**
* xmlModuleOpen:
* @name: the module name
* @options: a set of xmlModuleOption
* @param name the module name
* @param options a set of xmlModuleOption
*
* Opens a module/shared library given its name or path
* NOTE: that due to portability issues, behaviour can only be
* guaranteed with @name using ASCII. We cannot guarantee that
* guaranteed with `name` using ASCII. We cannot guarantee that
* an UTF-8 string would work, which is why name is a const char *
* and not a const xmlChar * .
* TODO: options are not yet implemented.
*
* Returns a handle for the module or NULL in case of error
* @returns a handle for the module or NULL in case of error
*/
xmlModulePtr
xmlModuleOpen(const char *name, int options ATTRIBUTE_UNUSED)
@ -78,18 +77,17 @@ xmlModuleOpen(const char *name, int options ATTRIBUTE_UNUSED)
}
/**
* xmlModuleSymbol:
* @module: the module
* @name: the name of the symbol
* @symbol: the resulting symbol address
* @param module the module
* @param name the name of the symbol
* @param symbol the resulting symbol address
*
* Lookup for a symbol address in the given module
* NOTE: that due to portability issues, behaviour can only be
* guaranteed with @name using ASCII. We cannot guarantee that
* guaranteed with `name` using ASCII. We cannot guarantee that
* an UTF-8 string would work, which is why name is a const char *
* and not a const xmlChar * .
*
* Returns 0 if the symbol was found, or -1 in case of error
* @returns 0 if the symbol was found, or -1 in case of error
*/
int
xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol)
@ -108,13 +106,12 @@ xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol)
}
/**
* xmlModuleClose:
* @module: the module handle
* @param module the module handle
*
* The close operations unload the associated module and free the
* data associated to the module.
*
* Returns 0 in case of success, -1 in case of argument error and -2
* @returns 0 in case of success, -1 in case of argument error and -2
* if the module could not be closed/unloaded.
*/
int
@ -135,14 +132,13 @@ xmlModuleClose(xmlModulePtr module)
}
/**
* xmlModuleFree:
* @module: the module handle
* @param module the module handle
*
* The free operations free the data associated to the module
* but does not unload the associated shared library which may still
* be in use.
*
* Returns 0 in case of success, -1 in case of argument error
* @returns 0 in case of success, -1 in case of argument error
*/
int
xmlModuleFree(xmlModulePtr module)
@ -164,10 +160,9 @@ xmlModuleFree(xmlModulePtr module)
#endif
/**
* xmlModulePlatformOpen:
* @name: path to the module
* @param name path to the module
*
* returns a handle on success, and zero on error.
* @returns a handle on success, and zero on error.
*/
static void *
@ -177,10 +172,9 @@ xmlModulePlatformOpen(const char *name)
}
/*
* xmlModulePlatformClose:
* @handle: handle to the module
* @param handle handle to the module
*
* returns 0 on success, and non-zero on error.
* @returns 0 on success, and non-zero on error.
*/
static int
@ -190,9 +184,8 @@ xmlModulePlatformClose(void *handle)
}
/*
* xmlModulePlatformSymbol:
* http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html
* returns 0 on success and the loaded symbol in result, and -1 on error.
* @returns 0 on success and the loaded symbol in result, and -1 on error.
*/
static int
@ -210,8 +203,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
#ifdef HAVE_SHLLOAD /* HAVE_SHLLOAD */
#include <dl.h>
/*
* xmlModulePlatformOpen:
* returns a handle on success, and zero on error.
* @returns a handle on success, and zero on error.
*/
static void *
@ -221,8 +213,7 @@ xmlModulePlatformOpen(const char *name)
}
/*
* xmlModulePlatformClose:
* returns 0 on success, and non-zero on error.
* @returns 0 on success, and non-zero on error.
*/
static int
@ -232,9 +223,8 @@ xmlModulePlatformClose(void *handle)
}
/*
* xmlModulePlatformSymbol:
* http://docs.hp.com/en/B2355-90683/shl_load.3X.html
* returns 0 on success and the loaded symbol in result, and -1 on error.
* @returns 0 on success and the loaded symbol in result, and -1 on error.
*/
static int
@ -256,8 +246,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
#include <windows.h>
/*
* xmlModulePlatformOpen:
* returns a handle on success, and zero on error.
* @returns a handle on success, and zero on error.
*/
static void *
@ -267,8 +256,7 @@ xmlModulePlatformOpen(const char *name)
}
/*
* xmlModulePlatformClose:
* returns 0 on success, and non-zero on error.
* @returns 0 on success, and non-zero on error.
*/
static int
@ -281,9 +269,8 @@ xmlModulePlatformClose(void *handle)
}
/*
* xmlModulePlatformSymbol:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getprocaddress.asp
* returns 0 on success and the loaded symbol in result, and -1 on error.
* @returns 0 on success and the loaded symbol in result, and -1 on error.
*/
static int

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

446
xmlsave.c
View File

@ -51,8 +51,7 @@ struct _xmlSaveCtxt {
* *
************************************************************************/
/**
* xmlSaveErrMemory:
* @out: an output buffer
* @param out an output buffer
*
* Handle an out of memory condition
*/
@ -65,11 +64,10 @@ xmlSaveErrMemory(xmlOutputBufferPtr out)
}
/**
* xmlSaveErr:
* @out: an output buffer
* @code: the error number
* @node: the location of the error.
* @extra: extra information
* @param out an output buffer
* @param code the error number
* @param node the location of the error.
* @param extra extra information
*
* Handle an out of memory condition
*/
@ -225,15 +223,14 @@ xmlSerializeText(xmlOutputBufferPtr buf, const xmlChar *string,
************************************************************************/
/**
* xmlSaveSetIndentString:
* @ctxt: save context
* @indent: indent string
* @param ctxt save context
* @param indent indent string
*
* Sets the indent string.
*
* Available since 2.14.0.
*
* Returns 0 on success, -1 if the string is NULL, empty or too long.
* @returns 0 on success, -1 if the string is NULL, empty or too long.
*/
int
xmlSaveSetIndentString(xmlSaveCtxtPtr ctxt, const char *indent) {
@ -256,9 +253,8 @@ xmlSaveSetIndentString(xmlSaveCtxtPtr ctxt, const char *indent) {
}
/**
* xmlSaveCtxtInit:
* @ctxt: the saving context
* @options: save options
* @param ctxt the saving context
* @param options save options
*
* Initialize a saving context
*/
@ -282,7 +278,6 @@ xmlSaveCtxtInit(xmlSaveCtxtPtr ctxt, int options)
}
/**
* xmlFreeSaveCtxt:
*
* Free a saving context, destroying the output in any remaining buffer
*/
@ -298,11 +293,10 @@ xmlFreeSaveCtxt(xmlSaveCtxtPtr ctxt)
}
/**
* xmlNewSaveCtxt:
*
* Create a new saving context
*
* Returns the new structure or NULL in case of error
* @returns the new structure or NULL in case of error
*/
static xmlSaveCtxtPtr
xmlNewSaveCtxt(const char *encoding, int options)
@ -349,9 +343,8 @@ xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
}
/**
* xmlSaveWriteAttrContent:
* @ctxt: save context
* @attr: the attribute pointer
* @param ctxt save context
* @param attr the attribute pointer
*
* Serialize the attribute in the buffer
*/
@ -381,9 +374,8 @@ xmlSaveWriteAttrContent(xmlSaveCtxt *ctxt, xmlAttrPtr attr)
}
/**
* xmlBufDumpNotationDecl:
* @buf: the XML buffer output
* @nota: A notation declaration
* @param buf the XML buffer output
* @param nota A notation declaration
*
* This will dump the content the notation declaration as an XML DTD definition
*/
@ -408,10 +400,9 @@ xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
}
/**
* xmlBufDumpNotationDeclScan:
* @nota: A notation declaration
* @buf: the XML buffer output
* @name: unused
* @param nota A notation declaration
* @param buf the XML buffer output
* @param name unused
*
* This is called with the hash scan function, and just reverses args
*/
@ -422,9 +413,8 @@ xmlBufDumpNotationDeclScan(void *nota, void *buf,
}
/**
* xmlBufDumpNotationTable:
* @buf: an xmlBufPtr output
* @table: A notation table
* @param buf an xmlBufPtr output
* @param table A notation table
*
* This will dump the content of the notation table as an XML DTD definition
*/
@ -434,9 +424,8 @@ xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
}
/**
* xmlBufDumpElementOccur:
* @buf: output buffer
* @cur: element table
* @param buf output buffer
* @param cur element table
*
* Dump the occurrence operator of an element.
*/
@ -458,9 +447,8 @@ xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
}
/**
* xmlBufDumpElementContent:
* @buf: output buffer
* @content: element table
* @param buf output buffer
* @param content element table
*
* This will dump the content of the element table as an XML DTD definition
*/
@ -531,9 +519,8 @@ xmlBufDumpElementContent(xmlOutputBufferPtr buf,
}
/**
* xmlBufDumpElementDecl:
* @buf: an xmlBufPtr output
* @elem: An element table
* @param buf an xmlBufPtr output
* @param elem An element table
*
* This will dump the content of the element declaration as an XML
* DTD definition
@ -568,9 +555,8 @@ xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
}
/**
* xmlBufDumpEnumeration:
* @buf: output buffer
* @cur: an enumeration
* @param buf output buffer
* @param cur an enumeration
*
* This will dump the content of the enumeration
*/
@ -587,9 +573,8 @@ xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
xmlOutputBufferWrite(buf, 1, ")");
}
/**
* xmlBufDumpAttributeDecl:
* @buf: output buffer
* @attr: An attribute declaration
* @param buf output buffer
* @param attr An attribute declaration
*
* This will dump the content of the attribute declaration as an XML
* DTD definition
@ -669,9 +654,8 @@ xmlBufDumpAttributeDecl(xmlOutputBufferPtr buf, xmlAttributePtr attr) {
}
/**
* xmlBufDumpEntityContent:
* @buf: output buffer
* @content: entity content.
* @param buf output buffer
* @param content entity content.
*
* This will dump the quoted string value, taking care of the special
* treatment required by %
@ -709,9 +693,8 @@ xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
}
/**
* xmlBufDumpEntityDecl:
* @buf: an xmlBufPtr output
* @ent: An entity table
* @param buf an xmlBufPtr output
* @param ent An entity table
*
* This will dump the content of the entity table as an XML DTD definition
*/
@ -852,9 +835,8 @@ xmlSaveWriteIndent(xmlSaveCtxtPtr ctxt, int extra)
}
/**
* xmlOutputBufferWriteWSNonSig:
* @ctxt: The save context
* @extra: Number of extra indents to apply to ctxt->level
* @param ctxt The save context
* @param extra Number of extra indents to apply to ctxt->level
*
* Write out formatting for non-significant whitespace output.
*/
@ -874,14 +856,13 @@ xmlOutputBufferWriteWSNonSig(xmlSaveCtxtPtr ctxt, int extra)
}
/**
* xmlNsDumpOutput:
* @buf: the XML buffer output
* @cur: a namespace
* @ctxt: the output save context. Optional.
* @param buf the XML buffer output
* @param cur a namespace
* @param ctxt the output save context. Optional.
*
* Dump a local Namespace definition.
* Should be called in the context of attributes dumps.
* If @ctxt is supplied, @buf should be its buffer.
* If `ctxt` is supplied, `buf` should be its buffer.
*/
static void
xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
@ -915,8 +896,8 @@ xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
/**
* xmlNsListDumpOutputCtxt
* @ctxt: the save context
* @cur: the first namespace
* @param ctxt the save context
* @param cur the first namespace
*
* Dump a list of local namespace definitions to a save context.
* Should be called in the context of attribute dumps.
@ -930,9 +911,8 @@ xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
}
/**
* xmlNsListDumpOutput:
* @buf: the XML buffer output
* @cur: the first namespace
* @param buf the XML buffer output
* @param cur the first namespace
*
* Dump a list of local Namespace definitions.
* Should be called in the context of attributes dumps.
@ -946,9 +926,8 @@ xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) {
}
/**
* xmlDtdDumpOutput:
* @ctxt: the save context
* @dtd: the pointer to the DTD
* @param ctxt the save context
* @param dtd the pointer to the DTD
*
* Dump the XML document DTD, if any.
*/
@ -1001,9 +980,8 @@ xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
}
/**
* xmlAttrDumpOutput:
* @ctxt: the save context
* @cur: the attribute pointer
* @param ctxt the save context
* @param cur the attribute pointer
*
* Dump an XML attribute
*/
@ -1042,9 +1020,8 @@ xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
#ifdef LIBXML_HTML_ENABLED
/**
* htmlNodeDumpOutputInternal:
* @ctxt: the save context
* @cur: the current node
* @param ctxt the save context
* @param cur the current node
*
* Dump an HTML node, recursive behaviour, children are printed too.
*/
@ -1094,9 +1071,8 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
#endif
/**
* xmlNodeDumpOutputInternal:
* @ctxt: the save context
* @cur: the current node
* @param ctxt the save context
* @param cur the current node
*
* Dump an XML node, recursive behaviour, children are printed too.
*/
@ -1358,10 +1334,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
}
/**
* xmlSaveDocInternal:
* @ctxt: the save context
* @cur: the document
* @encoding: character encoding (optional)
* @param ctxt the save context
* @param cur the document
* @param encoding character encoding (optional)
*
* Dump an XML document.
*/
@ -1496,11 +1471,11 @@ xmlSaveDocInternal(xmlSaveCtxtPtr ctxt, xmlDocPtr cur,
/**
* xhtmlIsEmpty:
* @node: the node
* @param node the node
*
* Check if a node is an empty xhtml node
*
* Returns 1 if the node is an empty node, 0 if not and -1 in case of error
* @returns 1 if the node is an empty node, 0 if not and -1 in case of error
*/
static int
xhtmlIsEmpty(xmlNodePtr node) {
@ -1563,8 +1538,8 @@ xhtmlIsEmpty(xmlNodePtr node) {
/**
* xhtmlAttrListDumpOutput:
* @ctxt: the save context
* @cur: the first attribute pointer
* @param ctxt the save context
* @param cur the first attribute pointer
*
* Dump a list of XML attributes
*/
@ -1632,8 +1607,8 @@ xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
/**
* xhtmlNodeDumpOutput:
* @ctxt: the save context
* @cur: the current node
* @param ctxt the save context
* @param cur the current node
*
* Dump an XHTML node, recursive behaviour, children are printed too.
*/
@ -1965,15 +1940,14 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
************************************************************************/
/**
* xmlSaveToFd:
* @fd: a file descriptor number
* @encoding: the encoding name to use or NULL
* @options: a set of xmlSaveOptions
* @param fd a file descriptor number
* @param encoding the encoding name to use or NULL
* @param options a set of xmlSaveOptions
*
* Create a document saving context serializing to a file descriptor
* with the encoding and the options given.
*
* Returns a new serialization context or NULL in case of error.
* @returns a new serialization context or NULL in case of error.
*/
xmlSaveCtxtPtr
xmlSaveToFd(int fd, const char *encoding, int options)
@ -1991,16 +1965,15 @@ xmlSaveToFd(int fd, const char *encoding, int options)
}
/**
* xmlSaveToFilename:
* @filename: a file name or an URL
* @encoding: the encoding name to use or NULL
* @options: a set of xmlSaveOptions
* @param filename a file name or an URL
* @param encoding the encoding name to use or NULL
* @param options a set of xmlSaveOptions
*
* Create a document saving context serializing to a filename or possibly
* to an URL (but this is less reliable) with the encoding and the options
* given.
*
* Returns a new serialization context or NULL in case of error.
* @returns a new serialization context or NULL in case of error.
*/
xmlSaveCtxtPtr
xmlSaveToFilename(const char *filename, const char *encoding, int options)
@ -2020,15 +1993,14 @@ xmlSaveToFilename(const char *filename, const char *encoding, int options)
}
/**
* xmlSaveToBuffer:
* @buffer: a buffer
* @encoding: the encoding name to use or NULL
* @options: a set of xmlSaveOptions
* @param buffer a buffer
* @param encoding the encoding name to use or NULL
* @param options a set of xmlSaveOptions
*
* Create a document saving context serializing to a buffer
* with the encoding and the options given
*
* Returns a new serialization context or NULL in case of error.
* @returns a new serialization context or NULL in case of error.
*/
xmlSaveCtxtPtr
@ -2047,17 +2019,16 @@ xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options)
}
/**
* xmlSaveToIO:
* @iowrite: an I/O write function
* @ioclose: an I/O close function
* @ioctx: an I/O handler
* @encoding: the encoding name to use or NULL
* @options: a set of xmlSaveOptions
* @param iowrite an I/O write function
* @param ioclose an I/O close function
* @param ioctx an I/O handler
* @param encoding the encoding name to use or NULL
* @param options a set of xmlSaveOptions
*
* Create a document saving context serializing to a file descriptor
* with the encoding and the options given
*
* Returns a new serialization context or NULL in case of error.
* @returns a new serialization context or NULL in case of error.
*/
xmlSaveCtxtPtr
xmlSaveToIO(xmlOutputWriteCallback iowrite,
@ -2077,15 +2048,14 @@ xmlSaveToIO(xmlOutputWriteCallback iowrite,
}
/**
* xmlSaveDoc:
* @ctxt: a document saving context
* @doc: a document
* @param ctxt a document saving context
* @param doc a document
*
* Save a full document to a saving context
* TODO: The function is not fully implemented yet as it does not return the
* byte count but 0 instead
*
* Returns the number of byte written or -1 in case of error
* @returns the number of byte written or -1 in case of error
*/
long
xmlSaveDoc(xmlSaveCtxtPtr ctxt, xmlDocPtr doc)
@ -2099,15 +2069,14 @@ xmlSaveDoc(xmlSaveCtxtPtr ctxt, xmlDocPtr doc)
}
/**
* xmlSaveTree:
* @ctxt: a document saving context
* @cur: the top node of the subtree to save
* @param ctxt a document saving context
* @param cur the top node of the subtree to save
*
* Save a subtree starting at the node parameter to a saving context
* TODO: The function is not fully implemented yet as it does not return the
* byte count but 0 instead
*
* Returns the number of byte written or -1 in case of error
* @returns the number of byte written or -1 in case of error
*/
long
xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur)
@ -2133,13 +2102,12 @@ xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur)
}
/**
* xmlSaveNotationDecl:
* @ctxt: save context
* @cur: notation
* @param ctxt save context
* @param cur notation
*
* Serialize a notation declaration.
*
* Return 0 on succes, -1 on error.
* @returns 0 on succes, -1 on error.
*/
int
xmlSaveNotationDecl(xmlSaveCtxtPtr ctxt, xmlNotationPtr cur) {
@ -2150,13 +2118,12 @@ xmlSaveNotationDecl(xmlSaveCtxtPtr ctxt, xmlNotationPtr cur) {
}
/**
* xmlSaveNotationTable:
* @ctxt: save context
* @cur: notation table
* @param ctxt save context
* @param cur notation table
*
* Serialize notation declarations of a document.
*
* Return 0 on succes, -1 on error.
* @returns 0 on succes, -1 on error.
*/
int
xmlSaveNotationTable(xmlSaveCtxtPtr ctxt, xmlNotationTablePtr cur) {
@ -2167,13 +2134,12 @@ xmlSaveNotationTable(xmlSaveCtxtPtr ctxt, xmlNotationTablePtr cur) {
}
/**
* xmlSaveFlush:
* @ctxt: a document saving context
* @param ctxt a document saving context
*
* Flush a document saving context, i.e. make sure that all bytes have
* been output.
*
* Returns the number of byte written or -1 in case of error.
* @returns the number of byte written or -1 in case of error.
*/
int
xmlSaveFlush(xmlSaveCtxtPtr ctxt)
@ -2184,13 +2150,12 @@ xmlSaveFlush(xmlSaveCtxtPtr ctxt)
}
/**
* xmlSaveClose:
* @ctxt: a document saving context
* @param ctxt a document saving context
*
* Close a document saving context, i.e. make sure that all bytes have
* been output and free the associated data.
*
* Returns the number of byte written or -1 in case of error.
* @returns the number of byte written or -1 in case of error.
*/
int
xmlSaveClose(xmlSaveCtxtPtr ctxt)
@ -2204,15 +2169,14 @@ xmlSaveClose(xmlSaveCtxtPtr ctxt)
}
/**
* xmlSaveFinish:
* @ctxt: a document saving context
* @param ctxt a document saving context
*
* Close a document saving context, i.e. make sure that all bytes have
* been output and free the associated data.
*
* Available since 2.13.0.
*
* Returns an xmlParserErrors code.
* @returns an xmlParserErrors code.
*/
xmlParserErrors
xmlSaveFinish(xmlSaveCtxtPtr ctxt)
@ -2234,15 +2198,14 @@ xmlSaveFinish(xmlSaveCtxtPtr ctxt)
}
/**
* xmlSaveSetEscape:
* @ctxt: a document saving context
* @escape: the escaping function
* @param ctxt a document saving context
* @param escape the escaping function
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Set a custom escaping function to be used for text in element content
*
* Returns 0 if successful or -1 in case of error.
* @returns 0 if successful or -1 in case of error.
*/
int
xmlSaveSetEscape(xmlSaveCtxtPtr ctxt, xmlCharEncodingOutputFunc escape)
@ -2253,15 +2216,14 @@ xmlSaveSetEscape(xmlSaveCtxtPtr ctxt, xmlCharEncodingOutputFunc escape)
}
/**
* xmlSaveSetAttrEscape:
* @ctxt: a document saving context
* @escape: the escaping function
* @param ctxt a document saving context
* @param escape the escaping function
*
* DEPRECATED: Don't use.
* @deprecated Don't use.
*
* Has no effect.
*
* Returns 0 if successful or -1 in case of error.
* @returns 0 if successful or -1 in case of error.
*/
int
xmlSaveSetAttrEscape(xmlSaveCtxtPtr ctxt,
@ -2278,10 +2240,9 @@ xmlSaveSetAttrEscape(xmlSaveCtxtPtr ctxt,
************************************************************************/
/**
* xmlBufAttrSerializeTxtContent:
* @buf: output buffer
* @doc: the document
* @string: the text content
* @param buf output buffer
* @param doc the document
* @param string the text content
*
* Serialize text attribute values to an xmlBufPtr
*/
@ -2297,11 +2258,10 @@ xmlBufAttrSerializeTxtContent(xmlOutputBufferPtr buf, xmlDocPtr doc,
}
/**
* xmlAttrSerializeTxtContent:
* @buf: the XML buffer output
* @doc: the document
* @attr: the attribute node
* @string: the text content
* @param buf the XML buffer output
* @param doc the document
* @param attr the attribute node
* @param string the text content
*
* Serialize text attribute values to an xml simple buffer
*/
@ -2323,20 +2283,19 @@ xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc,
}
/**
* xmlNodeDump:
* @buf: the XML buffer output
* @doc: the document
* @cur: the current node
* @level: the imbrication level for indenting
* @format: is formatting allowed
* @param buf the XML buffer output
* @param doc the document
* @param cur the current node
* @param level the imbrication level for indenting
* @param format is formatting allowed
*
* Dump an XML node, recursive behaviour,children are printed too.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called.
* Since this is using xmlBuffer structures it is limited to 2GB and somehow
* deprecated, use xmlNodeDumpOutput() instead.
*
* Returns the number of bytes written to the buffer or -1 in case of error
* @returns the number of bytes written to the buffer or -1 in case of error
*/
int
xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
@ -2363,19 +2322,18 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
}
/**
* xmlBufNodeDump:
* @buf: the XML buffer output
* @doc: the document
* @cur: the current node
* @level: the imbrication level for indenting
* @format: is formatting allowed
* @param buf the XML buffer output
* @param doc the document
* @param cur the current node
* @param level the imbrication level for indenting
* @param format is formatting allowed
*
* Dump an XML node, recursive behaviour,children are printed too.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*
* Returns the number of bytes written to the buffer, in case of error 0
* is returned or @buf stores the error
* @returns the number of bytes written to the buffer, in case of error 0
* is returned or `buf` stores the error
*/
size_t
@ -2418,10 +2376,9 @@ xmlBufNodeDump(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
}
/**
* xmlElemDump:
* @f: the FILE * for the output
* @doc: the document
* @cur: the current node
* @param f the FILE * for the output
* @param doc the document
* @param cur the current node
*
* Dump an XML/HTML node, recursive behaviour, children are printed too.
*/
@ -2455,16 +2412,15 @@ xmlElemDump(FILE * f, xmlDocPtr doc, xmlNodePtr cur)
************************************************************************/
/**
* xmlNodeDumpOutput:
* @buf: the XML buffer output
* @doc: the document
* @cur: the current node
* @level: the imbrication level for indenting
* @format: is formatting allowed
* @encoding: an optional encoding string
* @param buf the XML buffer output
* @param doc the document
* @param cur the current node
* @param level the imbrication level for indenting
* @param format is formatting allowed
* @param encoding an optional encoding string
*
* Dump an XML node, recursive behaviour, children are printed too.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*/
void
@ -2543,17 +2499,16 @@ xmlDocDumpInternal(xmlOutputBufferPtr buf, xmlDocPtr doc, const char *encoding,
}
/**
* xmlDocDumpFormatMemoryEnc:
* @out_doc: Document to generate XML text from
* @doc_txt_ptr: Memory pointer for allocated XML text
* @doc_txt_len: Length of the generated XML text
* @txt_encoding: Character encoding to use when generating XML text
* @format: should formatting spaces been added
* @param out_doc Document to generate XML text from
* @param doc_txt_ptr Memory pointer for allocated XML text
* @param doc_txt_len Length of the generated XML text
* @param txt_encoding Character encoding to use when generating XML text
* @param format should formatting spaces been added
*
* Dump the current DOM tree into memory using the character encoding specified
* by the caller. Note it is up to the caller of this function to free the
* allocated memory with xmlFree().
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*/
@ -2593,12 +2548,11 @@ xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
}
/**
* xmlDocDumpMemory:
* @cur: the document
* @mem: OUT: the memory pointer
* @size: OUT: the memory length
* @param cur the document
* @param mem OUT: the memory pointer
* @param size OUT: the memory length
*
* Dump an XML document in memory and return the #xmlChar * and it's size
* Dump an XML document in memory and return the \#xmlChar * and it's size
* in bytes. It's up to the caller to free the memory with xmlFree().
* The resulting byte array is zero terminated, though the last 0 is not
* included in the returned size.
@ -2609,16 +2563,15 @@ xmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
}
/**
* xmlDocDumpFormatMemory:
* @cur: the document
* @mem: OUT: the memory pointer
* @size: OUT: the memory length
* @format: should formatting spaces been added
* @param cur the document
* @param mem OUT: the memory pointer
* @param size OUT: the memory length
* @param format should formatting spaces been added
*
*
* Dump an XML document in memory and return the #xmlChar * and it's size.
* Dump an XML document in memory and return the \#xmlChar * and it's size.
* It's up to the caller to free the memory with xmlFree().
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*/
void
@ -2627,11 +2580,10 @@ xmlDocDumpFormatMemory(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
}
/**
* xmlDocDumpMemoryEnc:
* @out_doc: Document to generate XML text from
* @doc_txt_ptr: Memory pointer for allocated XML text
* @doc_txt_len: Length of the generated XML text
* @txt_encoding: Character encoding to use when generating XML text
* @param out_doc Document to generate XML text from
* @param doc_txt_ptr Memory pointer for allocated XML text
* @param doc_txt_len Length of the generated XML text
* @param txt_encoding Character encoding to use when generating XML text
*
* Dump the current DOM tree into memory using the character encoding specified
* by the caller. Note it is up to the caller of this function to free the
@ -2646,15 +2598,14 @@ xmlDocDumpMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
}
/**
* xmlDocFormatDump:
* @f: the FILE*
* @cur: the document
* @format: should formatting spaces been added
* @param f the FILE*
* @param cur the document
* @param format should formatting spaces been added
*
* Dump an XML document to an open FILE.
*
* returns: the number of bytes written or -1 in case of failure.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* @returns the number of bytes written or -1 in case of failure.
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*/
int
@ -2674,13 +2625,12 @@ xmlDocFormatDump(FILE *f, xmlDocPtr cur, int format) {
}
/**
* xmlDocDump:
* @f: the FILE*
* @cur: the document
* @param f the FILE*
* @param cur the document
*
* Dump an XML document to an open FILE.
*
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlDocDump(FILE *f, xmlDocPtr cur) {
@ -2688,16 +2638,15 @@ xmlDocDump(FILE *f, xmlDocPtr cur) {
}
/**
* xmlSaveFileTo:
* @buf: an output I/O buffer
* @cur: the document
* @encoding: the encoding if any assuming the I/O layer handles the transcoding
* @param buf an output I/O buffer
* @param cur the document
* @param encoding the encoding if any assuming the I/O layer handles the transcoding
*
* Dump an XML document to an I/O buffer.
* Warning ! This call xmlOutputBufferClose() on buf which is not available
* after this call.
*
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) {
@ -2705,17 +2654,16 @@ xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) {
}
/**
* xmlSaveFormatFileTo:
* @buf: an output I/O buffer
* @cur: the document
* @encoding: the encoding if any assuming the I/O layer handles the transcoding
* @format: should formatting spaces been added
* @param buf an output I/O buffer
* @param cur the document
* @param encoding the encoding if any assuming the I/O layer handles the transcoding
* @param format should formatting spaces been added
*
* Dump an XML document to an I/O buffer.
* Warning ! This call xmlOutputBufferClose() on buf which is not available
* after this call.
*
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur,
@ -2735,16 +2683,15 @@ xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur,
}
/**
* xmlSaveFormatFileEnc:
* @filename: the filename or URL to output
* @cur: the document being saved
* @encoding: the name of the encoding to use or NULL.
* @format: should formatting spaces be added.
* @param filename the filename or URL to output
* @param cur the document being saved
* @param encoding the name of the encoding to use or NULL.
* @param format should formatting spaces be added.
*
* Dump an XML document to a file or an URL.
*
* Returns the number of bytes written or -1 in case of error.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* @returns the number of bytes written or -1 in case of error.
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*/
int
@ -2771,14 +2718,13 @@ xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur,
/**
* xmlSaveFileEnc:
* @filename: the filename (or URL)
* @cur: the document
* @encoding: the name of an encoding (or NULL)
* @param filename the filename (or URL)
* @param cur the document
* @param encoding the name of an encoding (or NULL)
*
* Dump an XML document, converting it to the given encoding
*
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
@ -2786,18 +2732,17 @@ xmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
}
/**
* xmlSaveFormatFile:
* @filename: the filename (or URL)
* @cur: the document
* @format: should formatting spaces been added
* @param filename the filename (or URL)
* @param cur the document
* @param format should formatting spaces been added
*
* Dump an XML document to a file. Will use compression if
* compiled in and enabled. If @filename is "-" the stdout file is
* used. If @format is set then the document will be indented on output.
* Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
* compiled in and enabled. If `filename` is "-" the stdout file is
* used. If `format` is set then the document will be indented on output.
* Note that `format` = 1 provide node indenting only if xmlIndentTreeOutput = 1
* or xmlKeepBlanksDefault(0) was called
*
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlSaveFormatFile(const char *filename, xmlDocPtr cur, int format) {
@ -2805,14 +2750,13 @@ xmlSaveFormatFile(const char *filename, xmlDocPtr cur, int format) {
}
/**
* xmlSaveFile:
* @filename: the filename (or URL)
* @cur: the document
* @param filename the filename (or URL)
* @param cur the document
*
* Dump an XML document to a file. Will use compression if
* compiled in and enabled. If @filename is "-" the stdout file is
* compiled in and enabled. If `filename` is "-" the stdout file is
* used.
* returns: the number of bytes written or -1 in case of failure.
* @returns the number of bytes written or -1 in case of failure.
*/
int
xmlSaveFile(const char *filename, xmlDocPtr cur) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,13 +40,12 @@
************************************************************************/
/**
* xmlStrndup:
* @cur: the input xmlChar *
* @len: the len of @cur
* @param cur the input xmlChar *
* @param len the len of `cur`
*
* a strndup for array of xmlChar's
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrndup(const xmlChar *cur, int len) {
@ -63,14 +62,13 @@ xmlStrndup(const xmlChar *cur, int len) {
}
/**
* xmlStrdup:
* @cur: the input xmlChar *
* @param cur the input xmlChar *
*
* a strdup for array of xmlChar's. Since they are supposed to be
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
* a termination mark of '0'.
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrdup(const xmlChar *cur) {
@ -82,13 +80,12 @@ xmlStrdup(const xmlChar *cur) {
}
/**
* xmlCharStrndup:
* @cur: the input char *
* @len: the len of @cur
* @param cur the input char *
* @param len the len of `cur`
*
* a strndup for char's to xmlChar's
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
xmlChar *
@ -111,12 +108,11 @@ xmlCharStrndup(const char *cur, int len) {
}
/**
* xmlCharStrdup:
* @cur: the input char *
* @param cur the input char *
*
* a strdup for char's to xmlChar's
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
xmlChar *
@ -129,13 +125,12 @@ xmlCharStrdup(const char *cur) {
}
/**
* xmlStrcmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @param str1 the first xmlChar *
* @param str2 the second xmlChar *
*
* a strcmp for xmlChar's
*
* Returns the integer result of the comparison
* @returns the integer result of the comparison
*/
int
@ -155,14 +150,13 @@ xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
}
/**
* xmlStrEqual:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @param str1 the first xmlChar *
* @param str2 the second xmlChar *
*
* Check if both strings are equal of have same content.
* Should be a bit more readable and faster than xmlStrcmp()
*
* Returns 1 if they are equal, 0 if they are different
* @returns 1 if they are equal, 0 if they are different
*/
int
@ -181,14 +175,13 @@ xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
}
/**
* xmlStrQEqual:
* @pref: the prefix of the QName
* @name: the localname of the QName
* @str: the second xmlChar *
* @param pref the prefix of the QName
* @param name the localname of the QName
* @param str the second xmlChar *
*
* Check if a QName is Equal to a given string
*
* Returns 1 if they are equal, 0 if they are different
* @returns 1 if they are equal, 0 if they are different
*/
int
@ -208,14 +201,13 @@ xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
}
/**
* xmlStrncmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @len: the max comparison length
* @param str1 the first xmlChar *
* @param str2 the second xmlChar *
* @param len the max comparison length
*
* a strncmp for xmlChar's
*
* Returns the integer result of the comparison
* @returns the integer result of the comparison
*/
int
@ -271,13 +263,12 @@ static const xmlChar casemap[256] = {
};
/**
* xmlStrcasecmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @param str1 the first xmlChar *
* @param str2 the second xmlChar *
*
* a strcasecmp for xmlChar's
*
* Returns the integer result of the comparison
* @returns the integer result of the comparison
*/
int
@ -295,14 +286,13 @@ xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
}
/**
* xmlStrncasecmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @len: the max comparison length
* @param str1 the first xmlChar *
* @param str2 the second xmlChar *
* @param len the max comparison length
*
* a strncasecmp for xmlChar's
*
* Returns the integer result of the comparison
* @returns the integer result of the comparison
*/
int
@ -321,13 +311,12 @@ xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) {
}
/**
* xmlStrchr:
* @str: the xmlChar * array
* @val: the xmlChar to search
* @param str the xmlChar * array
* @param val the xmlChar to search
*
* a strchr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
* @returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
@ -341,13 +330,12 @@ xmlStrchr(const xmlChar *str, xmlChar val) {
}
/**
* xmlStrstr:
* @str: the xmlChar * array (haystack)
* @val: the xmlChar to search (needle)
* @param str the xmlChar * array (haystack)
* @param val the xmlChar to search (needle)
*
* a strstr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
* @returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
@ -369,13 +357,12 @@ xmlStrstr(const xmlChar *str, const xmlChar *val) {
}
/**
* xmlStrcasestr:
* @str: the xmlChar * array (haystack)
* @val: the xmlChar to search (needle)
* @param str the xmlChar * array (haystack)
* @param val the xmlChar to search (needle)
*
* a case-ignoring strstr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
* @returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
@ -396,14 +383,13 @@ xmlStrcasestr(const xmlChar *str, const xmlChar *val) {
}
/**
* xmlStrsub:
* @str: the xmlChar * array (haystack)
* @start: the index of the first char (zero based)
* @len: the length of the substring
* @param str the xmlChar * array (haystack)
* @param start the index of the first char (zero based)
* @param len the length of the substring
*
* Extract a substring of a given string
*
* Returns the xmlChar * for the first occurrence or NULL.
* @returns the xmlChar * for the first occurrence or NULL.
*/
xmlChar *
@ -423,12 +409,11 @@ xmlStrsub(const xmlChar *str, int start, int len) {
}
/**
* xmlStrlen:
* @str: the xmlChar * array
* @param str the xmlChar * array
*
* length of a xmlChar's string
*
* Returns the number of xmlChar contained in the ARRAY.
* @returns the number of xmlChar contained in the ARRAY.
*/
int
@ -438,16 +423,15 @@ xmlStrlen(const xmlChar *str) {
}
/**
* xmlStrncat:
* @cur: the original xmlChar * array
* @add: the xmlChar * array added
* @len: the length of @add
* @param cur the original xmlChar * array
* @param add the xmlChar * array added
* @param len the length of `add`
*
* a strncat for array of xmlChar's, it will extend @cur with the len
* first bytes of @add. Note that if @len < 0 then this is an API error
* a strncat for array of xmlChar's, it will extend `cur` with the len
* first bytes of `add`. Note that if `len` < 0 then this is an API error
* and NULL will be returned.
*
* Returns a new xmlChar *, the original @cur is reallocated and should
* @returns a new xmlChar *, the original `cur` is reallocated and should
* not be freed.
*/
@ -477,16 +461,15 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
}
/**
* xmlStrncatNew:
* @str1: first xmlChar string
* @str2: second xmlChar string
* @len: the len of @str2 or < 0
* @param str1 first xmlChar string
* @param str2 second xmlChar string
* @param len the len of `str2` or < 0
*
* same as xmlStrncat, but creates a new string. The original
* two strings are not freed. If @len is < 0 then the length
* two strings are not freed. If `len` is < 0 then the length
* will be calculated automatically.
*
* Returns a new xmlChar * or NULL
* @returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
@ -516,16 +499,15 @@ xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
}
/**
* xmlStrcat:
* @cur: the original xmlChar * array
* @add: the xmlChar * array added
* @param cur the original xmlChar * array
* @param add the xmlChar * array added
*
* a strcat for array of xmlChar's. Since they are supposed to be
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
* a termination mark of '0'.
*
* Returns a new xmlChar * containing the concatenated string. The original
* @cur is reallocated and should not be freed.
* @returns a new xmlChar * containing the concatenated string. The original
* `cur` is reallocated and should not be freed.
*/
xmlChar *
xmlStrcat(xmlChar *cur, const xmlChar *add) {
@ -540,15 +522,14 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) {
}
/**
* xmlStrPrintf:
* @buf: the result buffer.
* @len: the result buffer length.
* @msg: the message with printf formatting.
* @param buf the result buffer.
* @param len the result buffer length.
* @param msg the message with printf formatting.
* @...: extra parameters for the message.
*
* Formats @msg and places result into @buf.
* Formats `msg` and places result into `buf`.
*
* Returns the number of characters written to @buf or -1 if an error occurs.
* @returns the number of characters written to `buf` or -1 if an error occurs.
*/
int
xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) {
@ -568,15 +549,14 @@ xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) {
}
/**
* xmlStrVPrintf:
* @buf: the result buffer.
* @len: the result buffer length.
* @msg: the message with printf formatting.
* @ap: extra parameters for the message.
* @param buf the result buffer.
* @param len the result buffer length.
* @param msg the message with printf formatting.
* @param ap extra parameters for the message.
*
* Formats @msg and places result into @buf.
* Formats `msg` and places result into `buf`.
*
* Returns the number of characters written to @buf or -1 if an error occurs.
* @returns the number of characters written to `buf` or -1 if an error occurs.
*/
int
xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) {
@ -593,15 +573,14 @@ xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) {
}
/**
* xmlStrVASPrintf:
* @out: pointer to the resulting string
* @maxSize: maximum size of the output buffer
* @msg: printf format string
* @ap: arguments for format string
* @param out pointer to the resulting string
* @param maxSize maximum size of the output buffer
* @param msg printf format string
* @param ap arguments for format string
*
* Creates a newly allocated string according to format.
*
* Returns 0 on success, 1 if the result was truncated or on other
* @returns 0 on success, 1 if the result was truncated or on other
* errors, -1 if a memory allocation failed.
*/
int
@ -711,15 +690,14 @@ xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
}
/**
* xmlStrASPrintf:
* @out: pointer to the resulting string
* @maxSize: maximum size of the output buffer
* @msg: printf format string
* @param out pointer to the resulting string
* @param maxSize maximum size of the output buffer
* @param msg printf format string
* @...: arguments for format string
*
* See xmlStrVASPrintf.
*
* Returns 0 on success, 1 if the result was truncated or on other
* @returns 0 on success, 1 if the result was truncated or on other
* errors, -1 if a memory allocation failed.
*/
int
@ -751,12 +729,11 @@ xmlStrASPrintf(xmlChar **out, int maxSize, const char *msg, ...) {
/**
* xmlUTF8Size:
* @utf: pointer to the UTF8 character
* @param utf pointer to the UTF8 character
*
* calculates the internal size of a UTF8 character
*
* returns the numbers of bytes in the character, -1 on format error
* @returns the numbers of bytes in the character, -1 on format error
*/
int
xmlUTF8Size(const xmlChar *utf) {
@ -781,13 +758,12 @@ xmlUTF8Size(const xmlChar *utf) {
}
/**
* xmlUTF8Charcmp:
* @utf1: pointer to first UTF8 char
* @utf2: pointer to second UTF8 char
* @param utf1 pointer to first UTF8 char
* @param utf2 pointer to second UTF8 char
*
* compares the two UCS4 values
*
* returns result of the compare as with xmlStrncmp
* @returns result of the compare as with xmlStrncmp
*/
int
xmlUTF8Charcmp(const xmlChar *utf1, const xmlChar *utf2) {
@ -801,13 +777,12 @@ xmlUTF8Charcmp(const xmlChar *utf1, const xmlChar *utf2) {
}
/**
* xmlUTF8Strlen:
* @utf: a sequence of UTF-8 encoded bytes
* @param utf a sequence of UTF-8 encoded bytes
*
* compute the length of an UTF8 string, it doesn't do a full UTF8
* checking of the content of the string.
*
* Returns the number of characters in the string or -1 in case of error
* @returns the number of characters in the string or -1 in case of error
*/
int
xmlUTF8Strlen(const xmlChar *utf) {
@ -842,15 +817,14 @@ xmlUTF8Strlen(const xmlChar *utf) {
}
/**
* xmlGetUTF8Char:
* @utf: a sequence of UTF-8 encoded bytes
* @len: a pointer to the minimum number of bytes present in
* @param utf a sequence of UTF-8 encoded bytes
* @param len a pointer to the minimum number of bytes present in
* the sequence. This is used to assure the next character
* is completely contained within the sequence.
*
* Read the first UTF8 character from @utf
* Read the first UTF8 character from `utf`
*
* Returns the char value or -1 in case of error, and sets *len to
* @returns the char value or -1 in case of error, and sets *len to
* the actual number of bytes consumed (0 in case of error)
*/
int
@ -912,17 +886,16 @@ error:
}
/**
* xmlCheckUTF8:
* @utf: Pointer to putative UTF-8 encoded string.
* @param utf Pointer to putative UTF-8 encoded string.
*
* Checks @utf for being valid UTF-8. @utf is assumed to be
* Checks `utf` for being valid UTF-8. `utf` is assumed to be
* null-terminated. This function is not super-strict, as it will
* allow longer UTF-8 sequences than necessary. Note that Java is
* capable of producing these sequences if provoked. Also note, this
* routine checks for the 4-byte maximum size, but does not check for
* 0x10ffff maximum value.
*
* Return value: true if @utf is valid.
* @returns value: true if `utf` is valid.
**/
int
xmlCheckUTF8(const unsigned char *utf)
@ -967,14 +940,13 @@ xmlCheckUTF8(const unsigned char *utf)
}
/**
* xmlUTF8Strsize:
* @utf: a sequence of UTF-8 encoded bytes
* @len: the number of characters in the array
* @param utf a sequence of UTF-8 encoded bytes
* @param len the number of characters in the array
*
* storage size of an UTF8 string
* the behaviour is not guaranteed if the input string is not UTF-8
*
* Returns the storage size of
* @returns the storage size of
* the first 'len' characters of ARRAY
*/
@ -1006,13 +978,12 @@ xmlUTF8Strsize(const xmlChar *utf, int len) {
/**
* xmlUTF8Strndup:
* @utf: the input UTF8 *
* @len: the len of @utf (in chars)
* @param utf the input UTF8 *
* @param len the len of `utf` (in chars)
*
* a strndup for array of UTF8's
*
* Returns a new UTF8 * or NULL
* @returns a new UTF8 * or NULL
*/
xmlChar *
xmlUTF8Strndup(const xmlChar *utf, int len) {
@ -1031,14 +1002,13 @@ xmlUTF8Strndup(const xmlChar *utf, int len) {
}
/**
* xmlUTF8Strpos:
* @utf: the input UTF8 *
* @pos: the position of the desired UTF8 char (in chars)
* @param utf the input UTF8 *
* @param pos the position of the desired UTF8 char (in chars)
*
* a function to provide the equivalent of fetching a
* character from a string array
*
* Returns a pointer to the UTF8 character or NULL
* @returns a pointer to the UTF8 character or NULL
*/
const xmlChar *
xmlUTF8Strpos(const xmlChar *utf, int pos) {
@ -1065,13 +1035,12 @@ xmlUTF8Strpos(const xmlChar *utf, int pos) {
}
/**
* xmlUTF8Strloc:
* @utf: the input UTF8 *
* @utfchar: the UTF8 character to be found
* @param utf the input UTF8 *
* @param utfchar the UTF8 character to be found
*
* a function to provide the relative location of a UTF8 char
*
* Returns the relative character position of the desired char
* @returns the relative character position of the desired char
* or -1 if not found
*/
int
@ -1100,15 +1069,14 @@ xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
return(-1);
}
/**
* xmlUTF8Strsub:
* @utf: a sequence of UTF-8 encoded bytes
* @start: relative pos of first char
* @len: total number to copy
* @param utf a sequence of UTF-8 encoded bytes
* @param start relative pos of first char
* @param len total number to copy
*
* Create a substring from a given UTF-8 string
* Note: positions are given in units of UTF-8 chars
*
* Returns a pointer to a newly created string or NULL if the
* @returns a pointer to a newly created string or NULL if the
* start index is out of bounds or a memory allocation failed.
* If len is too large, the result is truncated.
*/
@ -1144,13 +1112,12 @@ xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
}
/**
* xmlEscapeFormatString:
* @msg: a pointer to the string in which to escape '%' characters.
* @param msg a pointer to the string in which to escape '%' characters.
* Must be a heap-allocated buffer created by libxml2 that may be
* returned, or that may be freed and replaced.
*
* Replaces the string pointed to by 'msg' with an escaped string.
* Returns the same string with all '%' characters escaped.
* @returns the same string with all '%' characters escaped.
*/
xmlChar *
xmlEscapeFormatString(xmlChar **msg)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1588
xpath.c

File diff suppressed because it is too large Load Diff

View File

@ -54,11 +54,10 @@
************************************************************************/
/**
* xmlXPtrErr:
* @ctxt: an XPTR evaluation context
* @code: error code
* @msg: error message
* @extra: extra information
* @param ctxt an XPTR evaluation context
* @param code error code
* @param msg error message
* @param extra extra information
*
* Handle an XPointer error
*/
@ -117,11 +116,10 @@ xmlXPtrErr(xmlXPathParserContextPtr ctxt, int code,
************************************************************************/
/**
* xmlXPtrGetNthChild:
* @cur: the node
* @no: the child number
* @param cur the node
* @param no the child number
*
* Returns the @no'th element child of @cur or NULL
* @returns the `no`'th element child of `cur` or NULL
*/
static xmlNodePtr
xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
@ -184,9 +182,8 @@ static void xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name);
#define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
/*
* xmlXPtrGetChildNo:
* @ctxt: the XPointer Parser context
* @index: the child number
* @param ctxt the XPointer Parser context
* @param index the child number
*
* Move the current node of the nodeset on the stack to the
* given child if found
@ -216,9 +213,8 @@ xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
}
/**
* xmlXPtrEvalXPtrPart:
* @ctxt: the XPointer Parser context
* @name: the preparsed Scheme for the XPtrPart
* @param ctxt the XPointer Parser context
* @param name the preparsed Scheme for the XPtrPart
*
* XPtrPart ::= 'xpointer' '(' XPtrExpr ')'
* | Scheme '(' SchemeSpecificExpr ')'
@ -384,9 +380,8 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
}
/**
* xmlXPtrEvalFullXPtr:
* @ctxt: the XPointer Parser context
* @name: the preparsed Scheme for the first XPtrPart
* @param ctxt the XPointer Parser context
* @param name the preparsed Scheme for the first XPtrPart
*
* FullXPtr ::= XPtrPart (S? XPtrPart)*
*
@ -464,9 +459,8 @@ xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
}
/**
* xmlXPtrEvalChildSeq:
* @ctxt: the XPointer Parser context
* @name: a possible ID name of the child sequence
* @param ctxt the XPointer Parser context
* @param name a possible ID name of the child sequence
*
* ChildSeq ::= '/1' ('/' [0-9]*)*
* | Name ('/' [0-9]*)+
@ -516,8 +510,7 @@ xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) {
/**
* xmlXPtrEvalXPointer:
* @ctxt: the XPointer Parser context
* @param ctxt the XPointer Parser context
*
* XPointer ::= Name
* | ChildSeq
@ -571,15 +564,14 @@ xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
************************************************************************/
/**
* xmlXPtrNewContext:
* @doc: the XML document
* @here: the node that directly contains the XPointer being evaluated or NULL
* @origin: the element from which a user or program initiated traversal of
* @param doc the XML document
* @param here the node that directly contains the XPointer being evaluated or NULL
* @param origin the element from which a user or program initiated traversal of
* the link, or NULL.
*
* Create a new XPointer context
*
* Returns the xmlXPathContext just allocated.
* @returns the xmlXPathContext just allocated.
*/
xmlXPathContextPtr
xmlXPtrNewContext(xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin) {
@ -595,13 +587,12 @@ xmlXPtrNewContext(xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin) {
}
/**
* xmlXPtrEval:
* @str: the XPointer expression
* @ctx: the XPointer context
* @param str the XPointer expression
* @param ctx the XPointer context
*
* Evaluate the XPath Location Path in the given context.
*
* Returns the xmlXPathObjectPtr resulting from the evaluation or NULL.
* @returns the xmlXPathObjectPtr resulting from the evaluation or NULL.
* the caller has to free the object.
*/
xmlXPathObjectPtr