1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

doc: Move brief to top, params to bottom of doc comments

This commit is contained in:
Nick Wellnhofer
2025-05-06 17:42:46 +02:00
parent 7bc7ae9db3
commit 9bbffec568
65 changed files with 6004 additions and 8035 deletions

View File

@@ -87,12 +87,11 @@ XMLPUBFUN int
* This is the core C14N function
*/
/**
* Signature for a C14N callback on visible nodes
*
* @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
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,

View File

@@ -58,9 +58,9 @@ XMLPUBFUN int
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
((0x61 <= (c)) && ((c) <= 0x7a)) || \
@@ -69,9 +69,9 @@ XMLPUBFUN int
(0xf8 <= (c)))
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
xmlIsBaseChar_ch((c)) : \
@@ -80,36 +80,36 @@ XMLPUBFUN int
XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsBlank_ch(c) (((c) == 0x20) || \
((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd))
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsBlankQ(c) (((c) < 0x100) ? \
xmlIsBlank_ch((c)) : 0)
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd) || \
(0x20 <= (c)))
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsCharQ(c) (((c) < 0x100) ? \
xmlIsChar_ch((c)) :\
@@ -120,9 +120,9 @@ XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsCombiningQ(c) (((c) < 0x100) ? \
0 : \
@@ -131,16 +131,16 @@ XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsDigitQ(c) (((c) < 0x100) ? \
xmlIsDigit_ch((c)) : \
@@ -149,16 +149,16 @@ XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsExtender_ch(c) (((c) == 0xb7))
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsExtenderQ(c) (((c) < 0x100) ? \
xmlIsExtender_ch((c)) : \
@@ -167,9 +167,9 @@ XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
0 :\
@@ -181,16 +181,16 @@ XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
/**
* @param c char to validate
*
* Automatically generated by genChRanges.py
*
* @param c char to validate
*/
#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
xmlIsPubidChar_ch((c)) : 0)

View File

@@ -121,16 +121,15 @@ typedef enum {
} xmlCharEncFlags;
/**
* @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.
*
* @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`
* @returns the number of bytes written or an xmlCharEncError code.
*/
typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
@@ -138,16 +137,15 @@ typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
/**
* @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.
*
* @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`
* @returns the number of bytes written or an xmlCharEncError code.
*/
typedef int (*xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
@@ -155,13 +153,6 @@ typedef int (*xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
/**
* @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
@@ -171,6 +162,12 @@ typedef int (*xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
* `flush` flag can be used to detect truncated sequences at EOF.
* Otherwise, the flag can be ignored.
*
* @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 xmlCharEncError code.
*/
typedef xmlCharEncError
@@ -178,9 +175,9 @@ typedef xmlCharEncError
const unsigned char *in, int *inlen, int flush);
/**
* @param vctxt conversion context
*
* Free a conversion context.
*
* @param vctxt conversion context
*/
typedef void
(*xmlCharEncConvCtxtDtor)(void *vctxt);
@@ -209,17 +206,16 @@ struct _xmlCharEncodingHandler {
};
/**
* @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`
* pointer with an encoding handler. The handler can be obtained
* from xmlCharEncNewCustomHandler().
*
* `flags` can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
*
* @param vctxt user data
* @param name encoding name
* @param flags bit mask of flags
* @param out pointer to resulting handler
* @returns an xmlParserErrors code.
*/
typedef xmlParserErrors

View File

@@ -34,8 +34,6 @@ typedef xmlHashTable *xmlHashTablePtr;
* serious trouble within the library.
*/
/**
* @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
@@ -43,6 +41,7 @@ typedef xmlHashTable *xmlHashTablePtr;
* \#define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
* This macro violated ISO C aliasing rules (gcc4 on s390 broke)
* so it is disabled now
* @param fptr pointer to a function
*/
#define XML_CAST_FPTR(fptr) fptr
@@ -51,37 +50,36 @@ typedef xmlHashTable *xmlHashTablePtr;
* function types:
*/
/**
* Callback to free data from a hash.
*
* @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);
/**
* @param payload the data in the hash
* @param name the name associated
*
* Callback to copy data from a hash.
*
* @param payload the data in the hash
* @param name the name associated
* @returns a copy of the data or NULL in case of error.
*/
typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
/**
* Callback when scanning data in a hash with the simple scanner.
*
* @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);
/**
* Callback when scanning data in a hash with the full scanner.
*
* @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.
*/
typedef void (*xmlHashScannerFull)(void *payload, void *data,
const xmlChar *name, const xmlChar *name2,

View File

@@ -27,26 +27,24 @@ typedef struct _xmlList xmlList;
typedef xmlList *xmlListPtr;
/**
* @param lk the data to deallocate
*
* Callback function used to free data from a list.
*
* @param lk the data to deallocate
*/
typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
/**
* @param data0 the first data
* @param data1 the second data
*
* Callback function used to compare 2 data.
*
* @param data0 the first data
* @param data1 the second data
* @returns 0 is equality, -1 or 1 otherwise depending on the ordering.
*/
typedef int (*xmlListDataCompare) (const void *data0, const void *data1);
/**
* @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().
*
* @param data the data found in the list
* @param user extra user provided data to the walker
* @returns 0 to stop walking the list, 1 otherwise.
*/
typedef int (*xmlListWalker) (const void *data, void *user);

View File

@@ -206,13 +206,6 @@ typedef struct _xmlParserNsData xmlParserNsData;
typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
/**
* @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.
@@ -220,6 +213,12 @@ typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
* On success, `out` should be set to a new parser input object and
* XML_ERR_OK should be returned.
*
* @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
* @returns an xmlParserErrors code.
*/
typedef xmlParserErrors
@@ -489,10 +488,6 @@ struct _xmlSAXLocator {
};
/**
* @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,
* the application can either:
@@ -500,64 +495,65 @@ struct _xmlSAXLocator {
* - or better use the xmlSetExternalEntityLoader() function to
* set up it's own entity resolution routine
*
* @param ctx the user data (XML parser context)
* @param publicId The public ID of the entity
* @param systemId The system ID of the entity
* @returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
const xmlChar *publicId,
const xmlChar *systemId);
/**
* Callback on internal subset declaration.
*
* @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.
*/
typedef void (*internalSubsetSAXFunc) (void *ctx,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID);
/**
* Callback on external subset declaration.
*
* @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.
*/
typedef void (*externalSubsetSAXFunc) (void *ctx,
const xmlChar *name,
const xmlChar *ExternalID,
const xmlChar *SystemID);
/**
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get an entity by name.
*
* @param ctx the user data (XML parser context)
* @param name The entity name
* @returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
const xmlChar *name);
/**
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Get a parameter entity by name.
*
* @param ctx the user data (XML parser context)
* @param name The entity name
* @returns the xmlEntityPtr if found.
*/
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
const xmlChar *name);
/**
* An entity definition has been parsed.
*
* @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.
*/
typedef void (*entityDeclSAXFunc) (void *ctx,
const xmlChar *name,
@@ -566,18 +562,20 @@ typedef void (*entityDeclSAXFunc) (void *ctx,
const xmlChar *systemId,
xmlChar *content);
/**
* What to do when a notation declaration has been parsed.
*
* @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.
*/
typedef void (*notationDeclSAXFunc)(void *ctx,
const xmlChar *name,
const xmlChar *publicId,
const xmlChar *systemId);
/**
* An attribute definition has been parsed.
*
* @param ctx the user data (XML parser context)
* @param elem the name of the element
* @param fullname the attribute name
@@ -585,8 +583,6 @@ typedef void (*notationDeclSAXFunc)(void *ctx,
* @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.
*/
typedef void (*attributeDeclSAXFunc)(void *ctx,
const xmlChar *elem,
@@ -596,25 +592,25 @@ typedef void (*attributeDeclSAXFunc)(void *ctx,
const xmlChar *defaultValue,
xmlEnumerationPtr tree);
/**
* An element definition has been parsed.
*
* @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.
*/
typedef void (*elementDeclSAXFunc)(void *ctx,
const xmlChar *name,
int type,
xmlElementContentPtr content);
/**
* What to do when an unparsed entity declaration is parsed.
*
* @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.
*/
typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
const xmlChar *name,
@@ -622,166 +618,166 @@ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
const xmlChar *systemId,
const xmlChar *notationName);
/**
* @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.
*
* @param ctx the user data (XML parser context)
* @param loc A SAX Locator
*/
typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
xmlSAXLocatorPtr loc);
/**
* @param ctx the user data (XML parser context)
*
* Called when the document start being processed.
*
* @param ctx the user data (XML parser context)
*/
typedef void (*startDocumentSAXFunc) (void *ctx);
/**
* @param ctx the user data (XML parser context)
*
* Called when the document end has been detected.
*
* @param ctx the user data (XML parser context)
*/
typedef void (*endDocumentSAXFunc) (void *ctx);
/**
* Called when an opening tag has been processed.
*
* @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.
*/
typedef void (*startElementSAXFunc) (void *ctx,
const xmlChar *name,
const xmlChar **atts);
/**
* Called when the end of an element has been detected.
*
* @param ctx the user data (XML parser context)
* @param name The element name
*
* Called when the end of an element has been detected.
*/
typedef void (*endElementSAXFunc) (void *ctx,
const xmlChar *name);
/**
* @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
* DOM subtree and past it in a new xmlAttr element added to
* the element.
*
* @param ctx the user data (XML parser context)
* @param name The attribute name, including namespace prefix
* @param value The attribute value
*/
typedef void (*attributeSAXFunc) (void *ctx,
const xmlChar *name,
const xmlChar *value);
/**
* Called when an entity reference is detected.
*
* @param ctx the user data (XML parser context)
* @param name The entity name
*
* Called when an entity reference is detected.
*/
typedef void (*referenceSAXFunc) (void *ctx,
const xmlChar *name);
/**
* Receiving some chars from the parser.
*
* @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.
*/
typedef void (*charactersSAXFunc) (void *ctx,
const xmlChar *ch,
int len);
/**
* Receiving some ignorable whitespaces from the parser.
* UNUSED: by default the DOM building will use characters.
*
* @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.
*/
typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
const xmlChar *ch,
int len);
/**
* A processing instruction has been parsed.
*
* @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.
*/
typedef void (*processingInstructionSAXFunc) (void *ctx,
const xmlChar *target,
const xmlChar *data);
/**
* A comment has been parsed.
*
* @param ctx the user data (XML parser context)
* @param value the comment content
*
* A comment has been parsed.
*/
typedef void (*commentSAXFunc) (void *ctx,
const xmlChar *value);
/**
* Called when a pcdata block has been parsed.
*
* @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.
*/
typedef void (*cdataBlockSAXFunc) (
void *ctx,
const xmlChar *value,
int len);
/**
* @param ctx an XML parser context
* @param msg the message to display/transmit
* Display and format a warning messages, callback.
*
* @...: extra parameters for the message display
*
* Display and format a warning messages, callback.
* @param ctx an XML parser context
* @param msg the message to display/transmit
*/
typedef void (*warningSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* @param ctx an XML parser context
* @param msg the message to display/transmit
* Display and format an error messages, callback.
*
* @...: extra parameters for the message display
*
* Display and format an error messages, callback.
* @param ctx an XML parser context
* @param msg the message to display/transmit
*/
typedef void (*errorSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* @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.
* Note: so far fatalError() SAX callbacks are not used, error()
* get all the callbacks for errors.
*
* @...: extra parameters for the message display
*
* @param ctx an XML parser context
* @param msg the message to display/transmit
*/
typedef void (*fatalErrorSAXFunc) (void *ctx,
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* @param ctx the user data (XML parser context)
*
* Is this document tagged standalone?
*
* @param ctx the user data (XML parser context)
* @returns 1 if true
*/
typedef int (*isStandaloneSAXFunc) (void *ctx);
/**
* @param ctx the user data (XML parser context)
*
* Does this document has an internal subset.
*
* @param ctx the user data (XML parser context)
* @returns 1 if true
*/
typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
/**
* @param ctx the user data (XML parser context)
*
* Does this document has an external subset?
*
* @param ctx the user data (XML parser context)
* @returns 1 if true
*/
typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
@@ -797,6 +793,10 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
#define XML_SAX2_MAGIC 0xDEEDBEAF
/**
* SAX2 callback when an element start has been detected by the parser.
* It provides the namespace information for the element, as well as
* the new namespace declarations on the element.
*
* @param ctx the user data (XML parser context)
* @param localname the local name of the element
* @param prefix the element namespace prefix if available
@@ -808,10 +808,6 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
* ones are at the end of the array
* @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.
* It provides the namespace information for the element, as well as
* the new namespace declarations on the element.
*/
typedef void (*startElementNsSAX2Func) (void *ctx,
@@ -825,13 +821,13 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
const xmlChar **attributes);
/**
* SAX2 callback when an element end has been detected by the parser.
* It provides the namespace information for the element.
*
* @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.
*/
typedef void (*endElementNsSAX2Func) (void *ctx,
@@ -985,12 +981,11 @@ struct _xmlSAXHandlerV1 {
/**
* External entity loaders types.
*
* @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.
*/
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,

View File

@@ -82,167 +82,154 @@ extern "C" {
* *
************************************************************************/
/**
* @param c an byte value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
*
* any byte character in the accepted range
* @param c an byte value (int)
*/
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
/**
* @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]
*
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
* @param c an UNICODE value (int)
*/
#define IS_CHAR(c) xmlIsCharQ(c)
/**
* @param c an xmlChar (usually an unsigned char)
*
* Behaves like IS_CHAR on single-byte value
*
* @param c an xmlChar (usually an unsigned char)
*/
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [3] S ::= (#x20 | #x9 | #xD | #xA)+
* @param c an UNICODE value (int)
*/
#define IS_BLANK(c) xmlIsBlankQ(c)
/**
* @param c an xmlChar value (normally unsigned char)
*
* Behaviour same as IS_BLANK
*
* @param c an xmlChar value (normally unsigned char)
*/
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [85] BaseChar ::= ... long list see REC ...
* @param c an UNICODE value (int)
*/
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [88] Digit ::= ... long list see REC ...
* @param c an UNICODE value (int)
*/
#define IS_DIGIT(c) xmlIsDigitQ(c)
/**
* @param c an xmlChar value (usually an unsigned char)
*
* Behaves like IS_DIGIT but with a single byte argument
*
* @param c an xmlChar value (usually an unsigned char)
*/
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [87] CombiningChar ::= ... long list see REC ...
* @param c an UNICODE value (int)
*/
#define IS_COMBINING(c) xmlIsCombiningQ(c)
/**
* @param c an xmlChar (usually an unsigned char)
*
* Always false (all combining chars > 0xff)
*
* @param c an xmlChar (usually an unsigned char)
*/
#define IS_COMBINING_CH(c) 0
/**
* @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]
* @param c an UNICODE value (int)
*/
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
/**
* @param c an xmlChar value (usually an unsigned char)
*
* Behaves like IS_EXTENDER but with a single-byte argument
*
* @param c an xmlChar value (usually an unsigned char)
*/
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
* @param c an UNICODE value (int)
*/
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
/**
* @param c an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [84] Letter ::= BaseChar | Ideographic
* @param c an UNICODE value (int)
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
/**
* @param c an xmlChar value (normally unsigned char)
*
* Macro behaves like IS_LETTER, but only check base chars
*
* @param c an xmlChar value (normally unsigned char)
*/
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
/**
* @param c an xmlChar value
*
* Macro to check [a-zA-Z]
*
* @param c an xmlChar value
*/
#define IS_ASCII_LETTER(c) ((0x61 <= ((c) | 0x20)) && \
(((c) | 0x20) <= 0x7a))
/**
* @param c an xmlChar value
*
* Macro to check [0-9]
*
* @param c an xmlChar value
*/
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
/**
* @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] |
* [-'()+,./:=?;!*#@$_%]
* @param c an UNICODE value (int)
*/
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
/**
* @param c an xmlChar value (normally unsigned char)
*
* Same as IS_PUBIDCHAR but for single-byte value
*
* @param c an xmlChar value (normally unsigned char)
*/
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)

View File

@@ -30,22 +30,24 @@ typedef xmlRelaxNG *xmlRelaxNGPtr;
/**
* @param ctx the validation context
* @param msg the message
* Signature of an error callback from a Relax-NG validation
*
* @...: extra arguments
*
* Signature of an error callback from a Relax-NG validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* @param ctx the validation context
* @param msg the message
* Signature of a warning callback from a Relax-NG validation
*
* @...: extra arguments
*
* Signature of a warning callback from a Relax-NG validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx,
const char *msg,

View File

@@ -42,20 +42,22 @@ typedef struct _xmlSchematron xmlSchematron;
typedef xmlSchematron *xmlSchematronPtr;
/**
* @param ctx the validation context
* @param msg the message
* Signature of an error callback from a Schematron validation
*
* @...: extra arguments
*
* Signature of an error callback from a Schematron validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
/**
* @param ctx the validation context
* @param msg the message
* Signature of a warning callback from a Schematron validation
*
* @...: extra arguments
*
* Signature of a warning callback from a Schematron validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);

View File

@@ -675,13 +675,12 @@ typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
/**
* A function called to acquire namespaces (xmlNs) from the wrapper.
*
* @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.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
@@ -711,16 +710,16 @@ struct _xmlDOMWrapCtxt {
};
/**
* @param node the current node
*
* Signature for the registration callback of a created node
*
* @param node the current node
*/
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
/**
* @param node the current node
*
* Signature for the deregistration callback of a discarded node
*
* @param node the current node
*/
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);

View File

@@ -35,22 +35,22 @@ typedef struct _xmlValidState xmlValidState;
typedef xmlValidState *xmlValidStatePtr;
/**
* Report a validity error.
*
* @param ctx user data (usually an xmlValidCtxtPtr)
* @param msg printf-like format string
* @param ... arguments to format
*
* Report a validity error.
*/
typedef void (*xmlValidityErrorFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* Report a validity warning.
*
* @param ctx user data (usually an xmlValidCtxtPtr)
* @param msg printf-like format string
* @param ... arguments to format
*
* Report a validity warning.
*/
typedef void (*xmlValidityWarningFunc) (void *ctx,
const char *msg,

View File

@@ -57,11 +57,11 @@ typedef enum {
} xlinkActuate;
/**
* @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.
*
* @param ctx user data pointer
* @param node the node to check
*/
typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
@@ -71,13 +71,13 @@ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
*/
/**
* This is the prototype for a simple link detection callback.
*
* @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.
*/
typedef void
(*xlinkSimpleLinkFunk) (void *ctx,
@@ -87,6 +87,8 @@ typedef void
const xlinkTitle title);
/**
* This is the prototype for a extended link detection callback.
*
* @param ctx user data pointer
* @param node the node carrying the link
* @param nbLocators the number of locators detected on the link
@@ -100,8 +102,6 @@ typedef void
* @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.
*/
typedef void
(*xlinkExtendedLinkFunk)(void *ctx,
@@ -119,6 +119,8 @@ typedef void
const xmlChar **langs);
/**
* This is the prototype for a extended link set detection callback.
*
* @param ctx user data pointer
* @param node the node carrying the link
* @param nbLocators the number of locators detected on the link
@@ -127,8 +129,6 @@ typedef void
* @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.
*/
typedef void
(*xlinkExtendedLinkSetFunk) (void *ctx,

View File

@@ -25,87 +25,78 @@ extern "C" {
#endif
/**
* @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.
*
* @param filename the filename or URI
* @returns 1 if yes and 0 if another Input module should be used
*/
typedef int (*xmlInputMatchCallback) (char const *filename);
/**
* @param filename the filename or URI
*
* Callback used in the I/O Input API to open the resource
*
* @param filename the filename or URI
* @returns an Input context or NULL in case or error
*/
typedef void * (*xmlInputOpenCallback) (char const *filename);
/**
* Callback used in the I/O Input API to read the resource
*
* @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
*/
typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
/**
* @param context an Input context
*
* Callback used in the I/O Input API to close the resource
*
* @param context an Input context
* @returns 0 or -1 in case of error
*/
typedef int (*xmlInputCloseCallback) (void * context);
#ifdef LIBXML_OUTPUT_ENABLED
/**
* @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.
*
* @param filename the filename or URI
* @returns 1 if yes and 0 if another Output module should be used
*/
typedef int (*xmlOutputMatchCallback) (char const *filename);
/**
* @param filename the filename or URI
*
* Callback used in the I/O Output API to open the resource
*
* @param filename the filename or URI
* @returns an Output context or NULL in case or error
*/
typedef void * (*xmlOutputOpenCallback) (char const *filename);
/**
* Callback used in the I/O Output API to write to the resource
*
* @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
*/
typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
int len);
/**
* @param context an Output context
*
* Callback used in the I/O Output API to close the resource
*
* @param context an Output context
* @returns 0 or -1 in case of error
*/
typedef int (*xmlOutputCloseCallback) (void * context);
#endif /* LIBXML_OUTPUT_ENABLED */
/**
* @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.
*
* @param URI the URI to read from
* @param enc the requested source encoding
* @returns the new xmlParserInputBufferPtr in case of success or NULL if no
* method was found.
*/
@@ -113,13 +104,12 @@ typedef xmlParserInputBufferPtr
(*xmlParserInputBufferCreateFilenameFunc)(const char *URI, xmlCharEncoding enc);
/**
* @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.
*
* @param URI the URI to write to
* @param encoder the requested target encoding
* @param compression compression level
* @returns the new xmlOutputBufferPtr in case of success or NULL if no
* method was found.
*/

View File

@@ -902,22 +902,21 @@ typedef enum {
} xmlParserErrors;
/**
* @param ctx user data
* @param msg printf-like format string
* @param ... arguments to format
*
* Generic error callback.
*
* @deprecated in favor of structured errors.
* @param ctx user data
* @param msg printf-like format string
* @param ... arguments to format
*/
typedef void (*xmlGenericErrorFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/**
* Structured error callback receiving an xmlError.
*
* @param userData user provided data for the error callback
* @param error the error being raised
*
* Structured error callback receiving an xmlError.
*/
typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);

View File

@@ -26,35 +26,32 @@ extern "C" {
* The XML memory wrapper support 4 basic overloadable functions.
*/
/**
* @param mem an already allocated block of memory
*
* Signature for a free() implementation.
*
* @param mem an already allocated block of memory
*/
typedef void (*xmlFreeFunc)(void *mem);
/**
* @param size the size requested in bytes
*
* Signature for a malloc() implementation.
*
* @param size the size requested in bytes
* @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);
/**
* @param mem an already allocated block of memory
* @param size the new size requested in bytes
*
* Signature for a realloc() implementation.
*
* @param mem an already allocated block of memory
* @param size the new size requested in bytes
* @returns a pointer to the newly reallocated block or NULL in case of error.
*/
typedef void *(*xmlReallocFunc)(void *mem, size_t size);
/**
* @param str a zero terminated string
*
* Signature for an strdup() implementation.
*
* @param str a zero terminated string
* @returns the copy of the string or NULL in case of error.
*/
typedef char *(*xmlStrdupFunc)(const char *str);

View File

@@ -413,12 +413,12 @@ XMLPUBFUN int
typedef void * xmlTextReaderLocatorPtr;
/**
* Signature of an error callback from a reader parser
*
* @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
*/
typedef void (*xmlTextReaderErrorFunc)(void *arg,
const char *msg,

View File

@@ -54,12 +54,12 @@ XMLPUBFUN int
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* Callback function when doing a transition in the automata
*
* @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
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
const xmlChar *token,

View File

@@ -90,21 +90,23 @@ typedef struct _xmlSchema xmlSchema;
typedef xmlSchema *xmlSchemaPtr;
/**
* @param ctx the validation context
* @param msg the message
* Signature of an error callback from an XSD validation
*
* @...: extra arguments
*
* Signature of an error callback from an XSD validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlSchemaValidityErrorFunc)
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/**
* @param ctx the validation context
* @param msg the message
* Signature of a warning callback from an XSD validation
*
* @...: extra arguments
*
* Signature of a warning callback from an XSD validation
* @param ctx the validation context
* @param msg the message
*/
typedef void (*xmlSchemaValidityWarningFunc)
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
@@ -119,14 +121,13 @@ typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
/**
* @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
*
* @param ctx user provided context
* @param file returned file information
* @param line returned line information
* @returns 0 in case of success and -1 in case of error
*/

View File

@@ -183,12 +183,12 @@ struct _xmlXPathAxis {
};
/**
* @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
* and the result is pushed on the stack.
*
* @param ctxt the XPath interprestation context
* @param nargs the number of arguments
*/
typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
@@ -198,13 +198,12 @@ typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
*/
/**
* @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.
*
* @param ctxt an XPath context
* @param name name of the variable
* @param ns_uri the namespace name hosting this variable
* @returns the XPath object value or NULL if not found.
*/
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
@@ -212,13 +211,12 @@ typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
const xmlChar *ns_uri);
/**
* @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.
*
* @param ctxt an XPath context
* @param name name of the function
* @param ns_uri the namespace name hosting this function
* @returns the XPath function or NULL if not found.
*/
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
@@ -414,19 +412,17 @@ XMLPUBVAR double xmlXPathNINF;
/* These macros may later turn into functions */
/**
* @param ns a node-set
*
* Implement a functionality similar to the DOM NodeList.length.
*
* @param ns a node-set
* @returns the number of nodes in the node-set.
*/
#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
/**
* @param ns a node-set
* @param index index of a node in the set
*
* Implements a functionality similar to the DOM NodeList.item().
*
* @param ns a node-set
* @param index index of a node in the set
* @returns the xmlNodePtr at the given `index` in `ns` or NULL if
* `index` is out of range (0 to length-1)
*/
@@ -436,10 +432,9 @@ XMLPUBVAR double xmlXPathNINF;
(ns)->nodeTab[(index)] \
: NULL)
/**
* @param ns a node-set
*
* Checks whether `ns` is empty or not.
*
* @param ns a node-set
* @returns %TRUE if `ns` is an empty node-set.
*/
#define xmlXPathNodeSetIsEmpty(ns) \

View File

@@ -42,63 +42,59 @@ extern "C" {
* shouldn't be used in \#ifdef's preprocessor instructions.
*/
/**
* Raises an error.
*
* @param ctxt an XPath parser context
* @param err an xmlXPathError code
*
* Raises an error.
*/
#define xmlXPathSetError(ctxt, err) \
{ xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
if ((ctxt) != NULL) (ctxt)->error = (err); }
/**
* @param ctxt an XPath parser context
*
* Raises an XPATH_INVALID_ARITY error.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathSetArityError(ctxt) \
xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
/**
* @param ctxt an XPath parser context
*
* Raises an XPATH_INVALID_TYPE error.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathSetTypeError(ctxt) \
xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
/**
* @param ctxt an XPath parser context
*
* Get the error code of an XPath context.
*
* @param ctxt an XPath parser context
* @returns the context error.
*/
#define xmlXPathGetError(ctxt) ((ctxt)->error)
/**
* @param ctxt an XPath parser context
*
* Check if an XPath error was raised.
*
* @param ctxt an XPath parser context
* @returns true if an error has been raised, false otherwise.
*/
#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
/**
* @param ctxt an XPath parser context
*
* Get the document of an XPath context.
*
* @param ctxt an XPath parser context
* @returns the context document.
*/
#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
/**
* @param ctxt an XPath parser context
*
* Get the context node of an XPath context.
*
* @param ctxt an XPath parser context
* @returns the context node.
*/
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
@@ -115,86 +111,85 @@ XMLPUBFUN void *
xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/**
* Pushes the boolean `val` on the context stack.
*
* @param ctxt an XPath parser context
* @param val a boolean
*
* Pushes the boolean `val` on the context stack.
*/
#define xmlXPathReturnBoolean(ctxt, val) \
valuePush((ctxt), xmlXPathNewBoolean(val))
/**
* @param ctxt an XPath parser context
*
* Pushes true on the context stack.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
/**
* @param ctxt an XPath parser context
*
* Pushes false on the context stack.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
/**
* Pushes the double `val` on the context stack.
*
* @param ctxt an XPath parser context
* @param val a double
*
* Pushes the double `val` on the context stack.
*/
#define xmlXPathReturnNumber(ctxt, val) \
valuePush((ctxt), xmlXPathNewFloat(val))
/**
* Pushes the string `str` on the context stack.
*
* @param ctxt an XPath parser context
* @param str a string
*
* Pushes the string `str` on the context stack.
*/
#define xmlXPathReturnString(ctxt, str) \
valuePush((ctxt), xmlXPathWrapString(str))
/**
* @param ctxt an XPath parser context
*
* Pushes an empty string on the stack.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathReturnEmptyString(ctxt) \
valuePush((ctxt), xmlXPathNewCString(""))
/**
* Pushes the node-set `ns` on the context stack.
*
* @param ctxt an XPath parser context
* @param ns a node-set
*
* Pushes the node-set `ns` on the context stack.
*/
#define xmlXPathReturnNodeSet(ctxt, ns) \
valuePush((ctxt), xmlXPathWrapNodeSet(ns))
/**
* @param ctxt an XPath parser context
*
* Pushes an empty node-set on the context stack.
*
* @param ctxt an XPath parser context
*/
#define xmlXPathReturnEmptyNodeSet(ctxt) \
valuePush((ctxt), xmlXPathNewNodeSet(NULL))
/**
* Pushes user data on the context stack.
*
* @param ctxt an XPath parser context
* @param val user data
*
* Pushes user data on the context stack.
*/
#define xmlXPathReturnExternal(ctxt, val) \
valuePush((ctxt), xmlXPathWrapExternal(val))
/**
* @param ctxt an XPath parser context
*
* Check if the current value on the XPath stack is a node set or
* an XSLT value tree.
*
* @param ctxt an XPath parser context
* @returns true if the current object on the stack is a node-set.
*/
#define xmlXPathStackIsNodeSet(ctxt) \
@@ -203,11 +198,10 @@ XMLPUBFUN void *
|| ((ctxt)->value->type == XPATH_XSLT_TREE)))
/**
* @param ctxt an XPath parser context
*
* Checks if the current value on the XPath stack is an external
* object.
*
* @param ctxt an XPath parser context
* @returns true if the current object on the stack is an external
* object.
*/
@@ -215,9 +209,9 @@ XMLPUBFUN void *
((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
/**
* @param ns a node-set
*
* Empties a node-set.
*
* @param ns a node-set
*/
#define xmlXPathEmptyNodeSet(ns) \
{ while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
@@ -235,45 +229,45 @@ XMLPUBFUN void *
if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
/**
* @param X the error code
*
* Macro to raise an XPath error and return.
*
* @param X the error code
*/
#define XP_ERROR(X) \
{ xmlXPathErr(ctxt, X); return; }
/**
* @param X the error code
*
* Macro to raise an XPath error and return 0.
*
* @param X the error code
*/
#define XP_ERROR0(X) \
{ xmlXPathErr(ctxt, X); return(0); }
/**
* @param typeval the XPath type
*
* Macro to check that the value on top of the XPath stack is of a given
* type.
*
* @param typeval the XPath type
*/
#define CHECK_TYPE(typeval) \
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
XP_ERROR(XPATH_INVALID_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
*
* @param typeval the XPath type
*/
#define CHECK_TYPE0(typeval) \
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
XP_ERROR0(XPATH_INVALID_TYPE)
/**
* @param x the number of expected args
*
* Macro to check that the number of args passed to an XPath function matches.
*
* @param x the number of expected args
*/
#define CHECK_ARITY(x) \
if (ctxt == NULL) return; \