diff --git a/ChangeLog b/ChangeLog index c7cb9895..16e38594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat May 19 16:50:47 CEST 2001 Daniel Veillard + + * HTMLtree.h debugXML.h parserInternals.h tree.h valid.c + xmlversion.h.in xpathInternals.h xpath.h: some cleanup for gtk-doc + * doc/html/* : rebuilt the docs + * valid.c: small patch which may improve some case when + validating. + Sat May 19 15:20:03 CEST 2001 Daniel Veillard * HTMLparser.c: Closed bug #54891 diff --git a/HTMLtree.h b/HTMLtree.h index 3888f7cc..ff20e75e 100644 --- a/HTMLtree.h +++ b/HTMLtree.h @@ -19,10 +19,40 @@ extern "C" { #endif +/** + * HTML_TEXT_NODE: + * + * Macro, a text node in a HTML document is really implemented + * the same way as a text node in an XML document. + */ #define HTML_TEXT_NODE XML_TEXT_NODE +/** + * HTML_ENTITY_REF_NODE: + * + * Macro, an entity reference in a HTML document is really implemented + * the same way as an entity reference in an XML document. + */ #define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE +/** + * HTML_COMMENT_NODE: + * + * Macro, a comment in a HTML document is really implemented + * the same way as a comment in an XML document. + */ #define HTML_COMMENT_NODE XML_COMMENT_NODE +/** + * HTML_PRESERVE_NODE: + * + * Macro, a preserved node in a HTML document is really implemented + * the same way as a CDATA section in an XML document. + */ #define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE +/** + * HTML_PI_NODE: + * + * Macro, a processing instruction in a HTML document is really implemented + * the same way as a processing instruction in an XML document. + */ #define HTML_PI_NODE XML_PI_NODE htmlDocPtr htmlNewDoc (const xmlChar *URI, diff --git a/debugXML.h b/debugXML.h index 4a55fa8d..babb8acb 100644 --- a/debugXML.h +++ b/debugXML.h @@ -65,8 +65,10 @@ void xmlLsOneNode (FILE *output, */ typedef char * (* xmlShellReadlineFunc)(char *prompt); -/* - * The shell context itself +/** + * xmlShellCtxt: + * + * A debugging shell context * TODO: add the defined function tables. */ typedef struct _xmlShellCtxt xmlShellCtxt; diff --git a/doc/html/book1.html b/doc/html/book1.html index ccd289de..998ee9ca 100644 --- a/doc/html/book1.html +++ b/doc/html/book1.html @@ -4,11 +4,12 @@ >Gnome XML Library Reference Manual

Daniel Veillard

Daniel Veillard
Copyright © 1999 by Daniel Veillard

catalog

Name

Synopsis

Description

Details

 



the file.


the resource name if found or NULL otherwise.


the system ID if found or NULL otherwise.

debugXML

Name

Synopsis

Description

Details

 


 


 


 


 


 


 


 


 


 


 


This is a generic signature for the XML shell input function

a string prompta string which will be freed by the Shell
 




This is a generic signature for the XML shell functions

a shell context a string argument a first node a second nodean int, negative returns indicating errors
 
 
 
 


the output FILE*

DOCBparser

Name

Synopsis

Description

Details










after return is the number of octets consumed.


the resulting document tree


the resulting document tree


the resulting document tree


the resulting document tree


an SGML parser context


the new parser context or NULL


zero if no error, the xmlParserErrors otherwise.


the new parser context or NULL


0, -1 in case of error. the parser context is augmented as a result of the parsing.

encoding

Name

Synopsis

Description

Details


Take a block of chars in the original encoding and try to convert +it to an UTF-8 block of chars out.

a pointer ot an array of bytes to store the UTF-8 result the lenght of out a pointer ot an array of chars in the original encoding the lenght of inthe number of byte written, or -1 by lack of space, or -2 +if the transcoding failed. +The value of inlen after return is the number of octets consumed +as the return value is positive, else unpredictiable. +The value of outlen after return is the number of ocetes consumed.
 
 
 
 


Take a block of UTF-8 chars in and try to convert it to an other +encoding. +Note: a first call designed to produce heading info is called with +in = NULL. If stateful this should also initialize the encoder state

a pointer ot an array of bytes to store the result the lenght of out a pointer ot an array of UTF-8 chars the lenght of inthe number of byte written, or -1 by lack of space, or -2 +if the transcoding failed. +The value of inlen after return is the number of octets consumed +as the return value is positive, else unpredictiable. +The value of outlen after return is the number of ocetes consumed.
 
 
 
 






the xmlCharEncodingHandlerPtr handler block


the handler or NULL if not found


 


0 in case of success, -1 in case of error


0 in case of success, -1 in case of error


NULL if not found the original name otherwise



one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE if not recognized.


the canonical name for the given encoding


one of the XML_CHAR_ENCODING_... values.





0 if success, or -1 in case of error


after return is the number of ocetes consumed.


after return is the number of ocetes consumed.


is valid.


the number of characters in the string or -1 in case of error

entities

Name

Synopsis

Description

Details






a pointer to the entity or NULL in case of error


a pointer to the entity or NULL in case of error


NULL if not, othervise the entity


A pointer to the entity structure or NULL if not found.


A pointer to the entity structure or NULL if not found.


A pointer to the entity structure or NULL if not found.


A newly allocated string with the substitution done.


A newly allocated string with the substitution done.


A newly allocated string with the substitution done.


the xmlEntitiesTablePtr just created or NULL in case of error.


the new xmlEntitiesTablePtr or NULL in case of error.


An entity table


An entity table


An entity table


HTMLparser

Name

Synopsis

Description

Details














the related htmlElemDescPtr or NULL if not found.


the associated htmlEntityDescPtr if found, NULL otherwise.


the associated htmlEntityDescPtr if found, NULL otherwise.


1 if autoclosed, 0 otherwise


1 if autoclose, 0 otherwise


the associated htmlEntityDescPtr if found, or NULL otherwise, if non-NULL *str will have to be freed by the caller.


the value parsed (as an int)


an HTML parser context


the resulting document tree


the resulting document tree


the resulting document tree


the resulting document tree


after return is the number of octets consumed.


after return is the number of octets consumed.


1 is the attribute is a script 0 otherwise


the last value for 0 for no handling, 1 for auto insertion.


an HTML parser context


the new parser context or NULL


zero if no error, the xmlParserErrors otherwise.

HTMLtree

Name

Synopsis

Description

Details






a new document


a new document, do not intialize the DTD if not provided


the current encoding as flagged in the HTML source


0 in case of success and -1 in case of error


OUT: the memory lenght


the number of byte written or -1 in case of failure.


the number of byte written or -1 in case of failure.


the current node


the current node


the number of byte written or -1 in case of failure.

Libxml Library Referencenanoftp

Name

Synopsis

Description

Details

A callback for the xmlNanoFTPList command +Note that only one of year and day:minute are specified

user provided data for the callback the file name (including "->" when links are shown) the attribute string the owner string the group string the file size the link count the year the month the day the hour the minute
 
 
 
 
 
 
 
 
 
 
 


A callback for the xmlNanoFTPGet command

the user provided context the data received its size in bytes
 
 




The URL used to initialize the context


an FTP context


the port (use 21 if 0)


the URL to the resource


-1 in case of error, 0 otherwise


-1 incase of error, 0 otherwise


-1 in case of error, 0 otherwise


The proxy URL used to initialize the proxy context



0 if Ok, -1 in case of error (other host).


the code number


the code number, or 0


-1 incase of error, 1 if CWD worked, 0 if it failed


-1 incase of error, 0 otherwise


-1 incase of error, 0 otherwise


-1 incase of error, 0 otherwise


the socket for the data connection, or <0 in case of error


-1 incase of error, 0 otherwise


the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.

nanohttp

Name

Synopsis

Description

Details



The proxy URL used to initialize the proxy context


-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller


the extra headers


if available the Content-Type information will be returned at that location


the HTTP return code for the request.


the stashed value of the WWW-Authenticate or Proxy-Authenticate header.


the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.


-1 in case of failure, 0 incase of success.


the HTTP context

Libxml Programming NotesparserxmlSAXHandlerPtr sax, void *user_data, - char *buffer, + const char *buffer, int size);

 

an xmlParserInput is an input flow for the XML processor. +Each entity parsed is associated an xmlParserInput (except the +few predefined ones). This is the case both for internal entities +- in which case the flow is already completely in memory - or +external entities - in which case we use the buf structure for +progressive reading and I18N conversions to the internal UTF-8 format.












 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 




External entity loaders types

The System ID of the resource requested The Public ID of the resource requested 
 
 





the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity


the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity


a new xmlChar * or NULL


a new xmlChar * or NULL


a new xmlChar * or NULL


a new xmlChar * or NULL


the xmlChar * for the first occurence or NULL.


the xmlChar * for the first occurence or NULL.


the xmlChar * for the first occurence or NULL.


the xmlChar * for the first occurence or NULL.


the integer result of the comparison


the integer result of the comparison


the integer result of the comparison


the integer result of the comparison


1 if they are equal, 0 if they are different


the number of xmlChar contained in the ARRAY.


a new xmlChar * containing the concatenated string.


is reallocated if needed and should not be freed


the resulting document tree


the resulting document tree


the resulting document tree


the last value for 0 for no substitution, 1 for substitution.


the last value for 0 for no substitution, 1 for substitution.


an XML parser context


the last value for 0 for no substitution, 1 for substitution.


the resulting document tree


the resulting document tree


the resulting document tree


0, -1 in case of error. the parser context is augmented as a result of the parsing.


0, -1 in case of error. the parser context is augmented as a result of the parsing.


the resulting document tree


0 in case of success or a error number otherwise


xmlSAXHandlerPtr sax, void *user_data, - char *buffer, + const char *buffer, int size);

0 in case of success or a error number otherwise


the resulting document tree


the resulting document tree


the resulting document tree


the resulting document tree


the resulting xmlDtdPtr or NULL in case of error.


the resulting xmlDtdPtr or NULL in case of error.


will be freed at parsing end.


0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise


0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise


0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise




an XML parser context


an XML parser context


an XML parser context


a file name


the new parser context or NULL


 


 


 


the new parser context or NULL


zero if no error, the xmlParserErrors otherwise.


the new parser context or NULL


the new input stream or NULL


an xmlParserNodeInfo block pointer or NULL


a node info sequence pointer


a node info sequence pointer


a long indicating the position of the record


a node info sequence pointer


 


 


 

parserInternals

Name

Synopsis

xmlCreateMemoryParserCtxt (char *buffer, +> (const char *buffer, int size);

Description

Details



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.

an UNICODE value (int)


Macro to check the following production in the XML spec

[3] S ::= (x20 | x9 | xD | xA)+

an UNICODE value (int)


Macro to check the following production in the XML spec

[85] BaseChar ::= ... long list see REC ...

an UNICODE value (int)


Macro to check the following production in the XML spec

[88] Digit ::= ... long list see REC ...

an UNICODE value (int)


Macro to check the following production in the XML spec

[87] CombiningChar ::= ... long list see REC ...

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]

an UNICODE value (int)


Macro to check the following production in the XML spec

[86] Ideographic ::= [x4E00-x9FA5] | x3007 | [x3021-x3029]

an UNICODE value (int)


Macro to check the following production in the XML spec

[84] Letter ::= BaseChar | Ideographic

an UNICODE value (int)


Macro to check the following production in the XML spec

[13] PubidChar ::= x20 | xD | xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]

an UNICODE value (int)


Skips the end of line chars

and UTF8 string pointer


Skips to the next '>' char

and UTF8 string pointer


Skips to the next '<' char

and UTF8 string pointer


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


0 if not, non-zero otherwise


 


the new parser context or NULL


xmlParserCtxtPtr xmlCreateMemoryParserCtxt (char *buffer, +> xmlCreateMemoryParserCtxt (const char *buffer, int size);

the new parser context or NULL


the xmlParserCtxtPtr or NULL


the new parser context or NULL


0 in case of success, -1 otherwise


0 in case of success, -1 otherwise


 


an XML entity pointer.


the new input stream


the new input stream or NULL


an XML parser input fragment (entity, XML fragment ...).


the current xmlChar in the parser context


an xmlParserInputPtr


the new input stream or NULL in case of error


the new input stream or NULL


the local part, and prefix is updated to get the Prefix if any.


the namespace name or NULL


the local part, and prefix is updated to get the Prefix if any.


the namespace name


the string parser or NULL.


an XML parser context


the Name parsed or NULL


the Name parsed or NULL


the Nmtoken parsed or NULL


the EntityValue parsed with reference substitued or NULL


the AttValue parsed or NULL. The value has to be freed by the caller.


the SystemLiteral parsed or NULL


the PubidLiteral parsed or NULL.


int indicating whether we are within a CDATA section



an XML parser context


the PITarget name or NULL


an XML parser context


an XML parser context


an XML parser context


XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED or XML_ATTRIBUTE_FIXED.


the notation attribute tree built while parsing


the enumeration attribute tree built while parsing


XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION


the attribute type


an XML parser context


the list of the xmlElementContentPtr describing the element choices


 


the tree of xmlElementContentPtr describing the element hierarchy.


the type of element content XML_ELEMENT_TYPE_xxx


the type of the element, or -1 in case of error


an XML parser context


the value parsed (as an int), 0 in case of error


the xmlEntityPtr if found, or NULL otherwise.


an XML parser context


an XML parser context


an XML parser context


the attribute name, and the value in *value.


the element name parsed


an XML parser context


an XML parser context


an XML parser context


an XML parser context


the string giving the XML version number, or NULL


the version string, e.g. "1.0"


the encoding name value or NULL


the encoding value or NULL


1 if standalone, 0 otherwise


an XML parser context


an XML parser context


an XML parser context


the system identifier (or URL)






A newly allocated string with the substitution done. The caller must deallocate it !


A newly allocated string with the substitution done. The caller must deallocate it !


 


 


 


 


 


 


the number of space chars skipped


the current char value and its lenght


the parser context


the parser context


 


the current char value and its lenght


the number of xmlChar written


the number of xmlChar written


the XML parser context


an XML parser input



the new parser context or NULL

SAX

Name

Synopsis

Description

Details

a xmlChar *


a xmlChar *


A SAX Locator


an int


an int


1 if true


1 if true


1 if true


the SYSTEM ID (e.g. filename or URL)


the SYSTEM ID (e.g. filename or URL)


the xmlEntityPtr if found.


the xmlEntityPtr if found.


the xmlParserInputPtr if inlined or NULL for DOM behaviour.


the entity value (without processing).


the tree of enumerated value set


the element value tree


The system ID of the entity


the name of the notation


the user data (XML parser context)


the user data (XML parser context)


The attribute value


An array of name/value attributes pairs, NULL terminated


The element name


The entity name


the number of xmlChar


the number of xmlChar


the PI data's


the namespace prefix


the namespace prefix


the xmlNsPtr or NULL if none


1 if true 0 otherwise


the namespace prefix


the comment content


the block length




tree

Name

Synopsis

xmlChar; #define CHAR -#define BAD_CAST @@ -1320,6 +1317,17 @@ HREF="libxml-tree.html#XMLNODEPTR" HREF="libxml-tree.html#XMLCHAR" >xmlChar *name); +int xmlUnsetProp (xmlNodePtr node, + const xmlChar *name); xmlAttrPtrxmlChar *nameSpace); +int xmlUnsetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name); xmlNodePtr

Description

Details




CHAR

#define CHAR xmlChar
This is a basic byte in an UTF-8 encoded string. +It's unsigned allowing to pinpoint case where char * are assigned +to xmlChar * (possibly making serialization back impossible).







































allocation method to use


the current allocation scheme


the new structure.


the new structure.


0 in case of problems, 1 otherwise


the buffer to free


the number of xmlChar written


the number of xmlChar to add


the number of xmlChar to add


the xmlChar string


the C char string


the number of xmlChar removed, or -1 in case of failure.


the new available space or -1 in case of error


the buffer


the internal content


 


allocation scheme to use


the length of data in the internal content


a pointer to the new DTD structure


a pointer to the new DTD structure


a pointer to the DTD structure or NULL if not found


the DTD structure to free up


NULL this functionnality had been removed


returns a new namespace pointer or NULL


the namespace pointer


the first namespace pointer


a new document


pointer to the document @:


a pointer to the attribute


a pointer to the attribute


a pointer to the attribute


the first property in the list


an attribute


a new xmlAttrPtr, or NULL in case of error.


a new xmlAttrPtr, or NULL in case of error.


a new xmlDtdPtr, or NULL in case of error.


a new xmlDocPtr, or NULL in case of error.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a pointer to the new node object.


a new xmlNodePtr, or NULL in case of error.


a new xmlNodePtr, or NULL in case of error.


a new xmlNodePtr, or NULL in case of error.


a pointer to the new node object.


the xmlNodePtr for the root or NULL


the last child or NULL if none.


1 yes, 0 no


1 yes, 0 no


the old root element if any was found


the new tag name


the child or NULL in case of error.


the last child or NULL in case of error.


the old node


the new element or NULL in case of error.


the new element or NULL in case of error.


the new element or NULL in case of error.


the node


the first text node augmented


lenght


the first node in the list


the node


the document


the document


the namespace pointer or NULL.


the namespace pointer or NULL.



a namespace pointer


a new xmlNsPtr, or NULL in case of error.


a new xmlNsPtr, or NULL in case of error.


the attribute pointer.


the attribute value or NULL if not found. It's up to the caller to free the memory.


xmlUnsetProp ()

int         xmlUnsetProp                    (xmlNodePtr node,
+                                             const xmlChar *name);

Remove an attribute carried by a node.

node : the node
name : the attribute name
Returns :0 if successful, -1 if not found


the attribute or the attribute declaration or NULL if neither was found.


the attribute pointer.


the attribute value or NULL if not found. It's up to the caller to free the memory.


xmlUnsetNsProp ()

int         xmlUnsetNsProp                  (xmlNodePtr node,
+                                             xmlNsPtr ns,
+                                             const xmlChar *name);

Remove an attribute carried by a node.

node : the node
ns : the namespace definition
name : the attribute name
Returns :0 if successful, -1 if not found


a pointer to the first child


a pointer to the first child


a pointer to the string copy, the calller must free it.


a pointer to the string copy, the calller must free it.


the new value of the content



extra content



a new xmlChar * or NULL if no content is available. It's up to the caller to free the memory.


a pointer to the lang value, or NULL if not found It's up to the caller to free the memory.


the langage description


-1 if xml:space is not inheried, 0 if "default", 1 if "preserve"


 


a pointer to the base URL, or NULL if not found It's up to the caller to free the memory.


the new base URI


0 if success and -1 in case of error.


 


 


the string to add


the string to add


the string to add


the number of namespace declarations created or -1 in case of error.


should formatting spaces been added


OUT: the memory lenght


Character encoding to use when generating XML text


 


the number of byte written or -1 in case of failure.


the current node


the number of byte written or -1 in case of failure.


the number of byte written or -1 in case of failure.


is formatting allowed


the number of byte written or -1 in case of failure.


0 (uncompressed) to 9 (max compression)


the compression ratio


0 (uncompressed) to 9 (max compression)


the compression ratio

uri

Name

Synopsis

Description

Details



the new structure or NULL in case of error


a new URI string (to be freed by the caller) or NULL in case of error.


a newly build xmlURIPtr or NULL in case of error


0 or the error code


a new string (to be deallocated by caller)


pointer to an xmlURI


an copy of the string, but unescaped


0 or an error code


an copy of the string, but escaped


pointer to an xmlURI

valid

Name

Synopsis

Description

Details



 


 









NULL if not a QName, otherwise the local part, and prefix is updated to get the Prefix if any.


NULL if not, othervise the entity


the new xmlNotationTablePtr or NULL in case of error.


An notation table


A notation declaration


A notation table


NULL if not, othervise the new element content structure


the new xmlElementContentPtr or NULL in case of error.


the element content tree to free


1 if one must print the englobing parenthesis, 0 otherwise


NULL if not, othervise the entity


the new xmlElementTablePtr or NULL in case of error.


An element table


An element table


An element table


the xmlEnumerationPtr just created or NULL in case of error.


the tree to free.


the xmlEnumerationPtr just created or NULL in case of error.


NULL if not new, othervise the attribute decl


the new xmlAttributeTablePtr or NULL in case of error.


An attribute table


An attribute table


An attribute declaration


NULL if not, othervise the new xmlIDPtr


 


An id table


NULL if not found, otherwise the xmlAttrPtr defining the ID


0 or 1 depending on the lookup result


-1 if the lookup failed and 0 otherwise


NULL if not, othervise the new xmlRefPtr


 


An ref table


0 or 1 depending on the lookup result


-1 if the lookup failed and 0 otherwise


NULL if not found, otherwise node set for the ID.


1 if valid or 0 otherwise


1 if valid or 0 otherwise


a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


1 if valid or 0 otherwise


0 if no, 1 if yes, and -1 if no element description is available


the xmlAttributePtr if found or NULL


the xmlNotationPtr if found or NULL


the xmlElementPtr if found or NULL


the caller is invited to grow the receiving array and retry.


the number of element in the list, or -1 in case of error.

xinclude

Name

Synopsis

Description

Details

0 if no substition were done, -1 if some processing failed or the number of substitutions done.

xmlerror

Name

Synopsis

Description

Details


 


the new handler function


extra parameters for the message display


extra parameters for the message display


extra parameters for the message display


extra parameters for the message display


an xmlParserInputPtr input


an xmlParserInputPtr input

xmlIO

Name

Synopsis

Description

Details

 


 


 


 




 


 


 


 





the new parser input or NULL


 


the new parser input or NULL


the new parser input or NULL


the new parser input or NULL


the new parser input or NULL


the new parser input or NULL


the number of chars read and stored in the buffer, or -1 in case of error.


the number of chars read and stored in the buffer, or -1 in case of error.


the number of chars read and stored in the buffer, or -1 in case of error.


a buffered parser input


 


the registered handler number or -1 in case of error



the new parser output or NULL


the new output or NULL


the new parser output or NULL


the new parser output or NULL


the new parser output or NULL


the number of chars immediately written, or -1 in case of error.


the number of chars immediately written, or -1 in case of error.


the number of byte written or -1 in case of error.


the number of byte written or -1 in case of error.


the registered handler number or -1 in case of error


the number of byte written or -1 in case of failure.


the number of byte written or -1 in case of failure.


an optional encoding string


 

xmlmemory

Name

Synopsis

MEM_LIST -#define DEBUG_MEMORY_FREED -#define MEM_CLEANUP (p,l) void (*xmlFreeFunc

Description

Details



DEBUG_MEMORY_FREED

#define DEBUG_MEMORY_FREED


MEM_CLEANUP()

#define     MEM_CLEANUP(p,l)

p : 
l :


 


 


 


 


0 on success


0 on success


0 on success


an int representing the amount of memory allocated.


a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist


number of entries to dump



 


 


 


the line number


the line number


a pointer to the new string or NULL if allocation error occured.

xpath

Name

Synopsis

xmlXPathParserContextPtr ctxt, int nargs); +#define xmlXPathNodeSetGetLength (ns) +#define xmlXPathNodeSetItem (ns, index) void xmlXPathFreeObjectxmlNodePtr node2); +int xmlXPathCastNumberToBoolean (double val); +int xmlXPathCastStringToBoolean (const xmlChar *val); +int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns); +int xmlXPathCastToBoolean (xmlXPathObjectPtr val); +double xmlXPathCastBooleanToNumber (int val); +double xmlXPathCastStringToNumber (const xmlChar *val); +double xmlXPathCastNodeToNumber (xmlNodePtr node); +double xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); +double xmlXPathCastToNumber (xmlXPathObjectPtr val); +xmlChar* xmlXPathCastBooleanToString (int val); +xmlChar* xmlXPathCastNumberToString (double val); +xmlChar* xmlXPathCastNodeToString (xmlNodePtr node); +xmlChar* xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); +xmlChar* xmlXPathCastToString (xmlXPathObjectPtr val); xmlXPathObjectPtr

Description

Details










 


 






 




 






An XPath function +The arguments (if any) are popped out of the context stack +and the result is pushed on the stack.

 


xmlXPathNodeSetGetLength()

#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)

ns : 


xmlXPathNodeSetItem()

#define     xmlXPathNodeSetItem(ns, index)

ns : 
index : 


the object to free


the newly created object.


an existing NodeSetList object


the xmlNodeSetPtr to free


the newly created object.


-2 in case of error 1 if first point < second point, 0 if that's the same node, -1 otherwise


xmlXPathCastNumberToBoolean ()

int         xmlXPathCastNumberToBoolean     (double val);

Converts a number to its boolean value

val : a number
Returns :the boolean value


xmlXPathCastStringToBoolean ()

int         xmlXPathCastStringToBoolean     (const xmlChar *val);

Converts a string to its boolean value

val : a string
Returns :the boolean value


xmlXPathCastNodeSetToBoolean ()

int         xmlXPathCastNodeSetToBoolean    (xmlNodeSetPtr ns);

Converts a node-set to its boolean value

ns : a node-set
Returns :the boolean value


xmlXPathCastToBoolean ()

int         xmlXPathCastToBoolean           (xmlXPathObjectPtr val);

val : 
Returns : 


xmlXPathCastBooleanToNumber ()

double      xmlXPathCastBooleanToNumber     (int val);

Converts a boolean to its number value

val : a boolean
Returns :the number value


xmlXPathCastStringToNumber ()

double      xmlXPathCastStringToNumber      (const xmlChar *val);

Converts a string to its number value

val : a string
Returns :the number value


xmlXPathCastNodeToNumber ()

double      xmlXPathCastNodeToNumber        (xmlNodePtr node);

Converts a node to its number value

node : a node
Returns :the number value


xmlXPathCastNodeSetToNumber ()

double      xmlXPathCastNodeSetToNumber     (xmlNodeSetPtr ns);

Converts a node-set to its number value

ns : a node-set
Returns :the number value


xmlXPathCastToNumber ()

double      xmlXPathCastToNumber            (xmlXPathObjectPtr val);

Converts an XPath object to its number value

val : an XPath object
Returns :the number value


xmlXPathCastBooleanToString ()

xmlChar*    xmlXPathCastBooleanToString     (int val);

Converts a boolean to its string value.

val : a boolean
Returns :a newly allocated string.


xmlXPathCastNumberToString ()

xmlChar*    xmlXPathCastNumberToString      (double val);

Converts a number to its string value.

val : a number
Returns :a newly allocated string.


xmlXPathCastNodeToString ()

xmlChar*    xmlXPathCastNodeToString        (xmlNodePtr node);

Converts a node to its string value.

node : a node
Returns :a newly allocated string.


xmlXPathCastNodeSetToString ()

xmlChar*    xmlXPathCastNodeSetToString     (xmlNodeSetPtr ns);

Converts a node-set to its string value.

ns : a node-set
Returns :a newly allocated string.


xmlXPathCastToString ()

xmlChar*    xmlXPathCastToString            (xmlXPathObjectPtr val);

Converts an existing object to its string() equivalent

val : an XPath object
Returns :the string value of the object, NULL in case of error. +A new string is allocated only if needed (val isn't a +string object).


)


)


)



the xmlXPathContext just allocated.


the context to free


the xmlXPathObjectPtr resulting from the eveluation or NULL. the caller has to free the object.


 


the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.


 


the xmlXPathObjectPtr resulting from the eveluation or NULL. the caller has to free the object.


the xmlXPathObjectPtr resulting from the eveluation or NULL. the caller has to free the object.


an XPATH comp

xpathInternals

Name

Synopsis

xmlXPathObjectPtr xmlXPathWrapString (xmlChar *val); +xmlXPathObjectPtr xmlXPathWrapCString (char *val); +xmlXPathObjectPtr xmlXPathNewFloat (

Description

Details



Macro to raise an XPath error and return

the error code


Macro to raise an XPath error and return 0

the error code


Macro to check that the value on top of the XPath stack is of a given +type.

the XPath type


Macro to check that the number of args passed to an XPath function matches

the number of expected args





 


 


 


indentation level


 


0 in case of success, -1 in case of error


the value or NULL if not found


 


0 in case of success, -1 in case of error


0 in case of success, -1 in case of error


0 in case of success, -1 in case of error


0 in case of success, -1 in case of error


the xmlXPathFunction or NULL if not found


the xmlXPathFunction or NULL if not found


the XPath context


the value or NULL if not found


the value or NULL if not found


the XPath context


the xmlXPathParserContext just allocated.


the context to free


 


 


the newly created object.


the newly created object.


xmlXPathWrapString ()

xmlXPathObjectPtr xmlXPathWrapString        (xmlChar *val);

Wraps the val string into an XPath object.

val : the xmlChar * value
Returns :the newly created object.


xmlXPathWrapCString ()

xmlXPathObjectPtr xmlXPathWrapCString       (char *val);

Wraps a string into an XPath object.

val : the char * value
Returns :the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


a new xmlNodePtr


a new xmlNodePtr


the node set


the number of arguments


the XPath Parser context


the XPath Parser context


the namespace name or NULL


the namespace name or NULL


the double value.


 



the number of arguments


the XPath context


 


val1 once extended or NULL in case of error.


an xmlNodePtr


the index to remove


 


the newly created object.


the newly created object.


 


 


 


 


0 or 1 depending on the results of the test.


1 if the comparaison succeeded, 0 if it failed


the XPath Parser context


the XPath Parser context


the XPath Parser context


the XPath Parser context


the XPath Parser context


the XPath Parser context


1 if true 0 otherwise


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the next element following that axis


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments


the number of arguments

xpointer

Name

Synopsis

Description

Details



the newly created object.


the xmlLocationSetPtr to free


val1 once extended or NULL in case of error.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


the newly created object.


a new xmlXPathObjectPtr


the newly created object.


an xmlXPathObjectPtr


the index to remove


the xmlXPathContext just allocated.


the xmlXPathObjectPtr resulting from the eveluation or NULL. the caller has to free the object.


the number of args


an xmlNodePtr list or NULL. the caller has to free the node tree.


the XPointer Parser context

= 0xE000) && ((c) <= 0xFFFD)) || \ (((c) >= 0x10000) && ((c) <= 0x10FFFF))) -/* +/** + * IS_BLANK: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [3] S ::= (#x20 | #x9 | #xD | #xA)+ */ #define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \ ((c) == 0x0D)) -/* +/** + * IS_BASECHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [85] BaseChar ::= ... long list see REC ... */ #define IS_BASECHAR(c) xmlIsBaseChar(c) -/* +/** + * IS_DIGIT: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [88] Digit ::= ... long list see REC ... */ #define IS_DIGIT(c) xmlIsDigit(c) -/* +/** + * IS_COMBINING: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [87] CombiningChar ::= ... long list see REC ... */ #define IS_COMBINING(c) xmlIsCombining(c) -/* +/** + * IS_EXTENDER: + * @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] */ #define IS_EXTENDER(c) xmlIsExtender(c) -/* +/** + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] */ #define IS_IDEOGRAPHIC(c) xmlIsIdeographic(c) -/* +/** + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [84] Letter ::= BaseChar | Ideographic */ #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) -/* +/** + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] */ #define IS_PUBIDCHAR(c) xmlIsPubidChar(c) +/** + * SKIP_EOL: + * @p: and UTF8 string pointer + * + * Skips the end of line chars + */ #define SKIP_EOL(p) \ if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } +/** + * MOVETO_ENDTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '>' char + */ #define MOVETO_ENDTAG(p) \ while ((*p) && (*(p) != '>')) (p)++ +/** + * MOVETO_STARTTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '<' char + */ #define MOVETO_STARTTAG(p) \ while ((*p) && (*(p) != '<')) (p)++ diff --git a/include/libxml/tree.h b/include/libxml/tree.h index 4be4c5fa..463daaa4 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -59,25 +59,36 @@ typedef enum { #endif } xmlElementType; -/* - * Size of an internal character representation. +/** + * xmlChar: * - * We use 8bit chars internal representation for memory efficiency, - * Note that with 8 bits wide xmlChars one can still use UTF-8 to handle - * correctly non ISO-Latin input. + * This is a basic byte in an UTF-8 encoded string. + * It's unsigned allowing to pinpoint case where char * are assigned + * to xmlChar * (possibly making serialization back impossible). */ typedef unsigned char xmlChar; +/* + * Removed in 2.3.9 ... nobody should still use this + * #ifndef WIN32 #ifndef CHAR #define CHAR xmlChar #endif #endif + */ +/** + * BAD_CAST: + * + * Macro to cast a string to an xmlChar * when one know its safe. + */ #define BAD_CAST (xmlChar *) -/* +/** + * xmlNotation: + * * a DTD Notation definition */ @@ -89,8 +100,10 @@ struct _xmlNotation { const xmlChar *SystemID; /* System identifier, if any */ }; -/* - * a DTD Attribute definition +/** + * xmlAttributeType: + * + * a DTD Attribute type definition */ typedef enum { @@ -106,6 +119,12 @@ typedef enum { XML_ATTRIBUTE_NOTATION } xmlAttributeType; +/** + * xmlAttributeDefault: + * + * a DTD Attribute default definition + */ + typedef enum { XML_ATTRIBUTE_NONE = 1, XML_ATTRIBUTE_REQUIRED, @@ -113,6 +132,12 @@ typedef enum { XML_ATTRIBUTE_FIXED } xmlAttributeDefault; +/** + * xmlEnumeration: + * + * list structure used when there is an enumeration in DTDs + */ + typedef struct _xmlEnumeration xmlEnumeration; typedef xmlEnumeration *xmlEnumerationPtr; struct _xmlEnumeration { @@ -120,6 +145,12 @@ struct _xmlEnumeration { const xmlChar *name; /* Enumeration name */ }; +/** + * xmlAttribute: + * + * an Attribute declaration in a DTD + */ + typedef struct _xmlAttribute xmlAttribute; typedef xmlAttribute *xmlAttributePtr; struct _xmlAttribute { @@ -144,8 +175,10 @@ struct _xmlAttribute { const xmlChar *elem; /* Element holding the attribute */ }; -/* - * a DTD Element definition. +/** + * xmlElementContentType: + * + * Possible definitions of element content types */ typedef enum { XML_ELEMENT_CONTENT_PCDATA = 1, @@ -154,6 +187,11 @@ typedef enum { XML_ELEMENT_CONTENT_OR } xmlElementContentType; +/** + * xmlElementContentOccur: + * + * Possible definitions of element content occurences + */ typedef enum { XML_ELEMENT_CONTENT_ONCE = 1, XML_ELEMENT_CONTENT_OPT, @@ -161,6 +199,13 @@ typedef enum { XML_ELEMENT_CONTENT_PLUS } xmlElementContentOccur; +/** + * xmlElementContent: + * + * an XML Element content as stored after parsing an element definition + * in a DTD. + */ + typedef struct _xmlElementContent xmlElementContent; typedef xmlElementContent *xmlElementContentPtr; struct _xmlElementContent { @@ -172,6 +217,12 @@ struct _xmlElementContent { struct _xmlElementContent *parent; /* parent */ }; +/** + * xmlElementTypeVal: + * + * the differnt possibility for an element content type + */ + typedef enum { XML_ELEMENT_TYPE_UNDEFINED = 0, XML_ELEMENT_TYPE_EMPTY = 1, @@ -180,6 +231,12 @@ typedef enum { XML_ELEMENT_TYPE_ELEMENT } xmlElementTypeVal; +/** + * xmlElement: + * + * an XML Element declaration from a DTD + */ + typedef struct _xmlElement xmlElement; typedef xmlElement *xmlElementPtr; struct _xmlElement { @@ -201,7 +258,13 @@ struct _xmlElement { const xmlChar *prefix; /* the namespace prefix if any */ }; -/* + +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; + +/** + * xmlNs: + * * An XML namespace. * Note that prefix == NULL is valid, it defines the default namespace * within the subtree (until overriden). @@ -210,9 +273,6 @@ struct _xmlElement { * xmlNsType is unified with xmlElementType */ -#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL -typedef xmlElementType xmlNsType; - typedef struct _xmlNs xmlNs; typedef xmlNs *xmlNsPtr; struct _xmlNs { @@ -222,8 +282,11 @@ struct _xmlNs { const xmlChar *prefix; /* prefix for the namespace */ }; -/* - * An XML DtD, as defined by diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h index 50f909db..cd043733 100644 --- a/include/libxml/xpath.h +++ b/include/libxml/xpath.h @@ -167,7 +167,9 @@ struct _xmlXPathAxis { xmlXPathAxisFunc func; /* the search function */ }; -/* +/** + * xmlXPathContext: + * * Expression evaluation occurs with respect to a context. * he context consists of: * - a node (the context node) @@ -229,7 +231,9 @@ struct _xmlXPathContext { typedef struct _xmlXPathCompExpr xmlXPathCompExpr; typedef xmlXPathCompExpr *xmlXPathCompExprPtr; -/* +/** + * xmlXPathParserContext: + * * An XPath parser context, it contains pure parsing informations, * an xmlXPathContext, and the stack of objects. */ @@ -249,7 +253,9 @@ struct _xmlXPathParserContext { int xptr; /* it this an XPointer expression */ }; -/* +/** + * xmlXPathFunction: + * * An XPath function * The arguments (if any) are popped out of the context stack * and the result is pushed on the stack. @@ -288,7 +294,7 @@ int xmlXPathCmpNodes (xmlNodePtr node1, */ int xmlXPathCastNumberToBoolean (double val); int xmlXPathCastStringToBoolean (const xmlChar * val); -int xmlXPathCastNodeToBoolean (xmlNodeSetPtr ns); +int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns); int xmlXPathCastToBoolean (xmlXPathObjectPtr val); double xmlXPathCastBooleanToNumber (int val); diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h index 1785d094..122244b9 100644 --- a/include/libxml/xpathInternals.h +++ b/include/libxml/xpathInternals.h @@ -22,36 +22,86 @@ extern "C" { * * ************************************************************************/ +/** + * CHECK_ERROR: + * + * macro to return from the function if an XPath error was detected + */ #define CHECK_ERROR \ if (ctxt->error != XPATH_EXPRESSION_OK) return +/** + * CHECK_ERROR0: + * + * macro to return 0 from the function if an XPath error was detected + */ #define CHECK_ERROR0 \ if (ctxt->error != XPATH_EXPRESSION_OK) return(0) +/** + * XP_ERROR: + * @X: the error code + * + * Macro to raise an XPath error and return + */ #define XP_ERROR(X) \ { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ ctxt->error = (X); return; } +/** + * XP_ERROR0: + * @X: the error code + * + * Macro to raise an XPath error and return 0 + */ #define XP_ERROR0(X) \ { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ ctxt->error = (X); return(0); } +/** + * CHECK_TYPE: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. + */ #define CHECK_TYPE(typeval) \ if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ XP_ERROR(XPATH_INVALID_TYPE) +/** + * CHECK_ARITY: + * @x: the number of expected args + * + * Macro to check that the number of args passed to an XPath function matches + */ #define CHECK_ARITY(x) \ if (nargs != (x)) \ XP_ERROR(XPATH_INVALID_ARITY); +/** + * CAST_TO_STRING: + * + * Macro to try to cast the value on the top of the XPath stack to a string + */ #define CAST_TO_STRING \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ xmlXPathStringFunction(ctxt, 1); +/** + * CAST_TO_NUMBER: + * + * Macro to try to cast the value on the top of the XPath stack to a number + */ #define CAST_TO_NUMBER \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ xmlXPathNumberFunction(ctxt, 1); +/** + * CAST_TO_BOOLEAN: + * + * Macro to try to cast the value on the top of the XPath stack to a boolean + */ #define CAST_TO_BOOLEAN \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ xmlXPathBooleanFunction(ctxt, 1); diff --git a/parserInternals.h b/parserInternals.h index 5a23c3cd..a7757899 100644 --- a/parserInternals.h +++ b/parserInternals.h @@ -20,13 +20,17 @@ extern "C" { #endif - /* + /** + * XML_MAX_NAMELEN: + * * Identifiers can be longer, but this will be more costly * at runtime. */ #define XML_MAX_NAMELEN 100 -/* +/** + * INPUT_CHUNK: + * * The parser tries to always have that amount of input ready * one of the point is providing context when reporting errors */ @@ -37,7 +41,12 @@ extern "C" { * UNICODE version of the macros. * * * ************************************************************************/ -/* +/** + * IS_CHAR: + * @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. @@ -48,57 +57,119 @@ extern "C" { (((c) >= 0xE000) && ((c) <= 0xFFFD)) || \ (((c) >= 0x10000) && ((c) <= 0x10FFFF))) -/* +/** + * IS_BLANK: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [3] S ::= (#x20 | #x9 | #xD | #xA)+ */ #define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \ ((c) == 0x0D)) -/* +/** + * IS_BASECHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [85] BaseChar ::= ... long list see REC ... */ #define IS_BASECHAR(c) xmlIsBaseChar(c) -/* +/** + * IS_DIGIT: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [88] Digit ::= ... long list see REC ... */ #define IS_DIGIT(c) xmlIsDigit(c) -/* +/** + * IS_COMBINING: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * * [87] CombiningChar ::= ... long list see REC ... */ #define IS_COMBINING(c) xmlIsCombining(c) -/* +/** + * IS_EXTENDER: + * @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] */ #define IS_EXTENDER(c) xmlIsExtender(c) -/* +/** + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] */ #define IS_IDEOGRAPHIC(c) xmlIsIdeographic(c) -/* +/** + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [84] Letter ::= BaseChar | Ideographic */ #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) -/* +/** + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec + * + * * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] */ #define IS_PUBIDCHAR(c) xmlIsPubidChar(c) +/** + * SKIP_EOL: + * @p: and UTF8 string pointer + * + * Skips the end of line chars + */ #define SKIP_EOL(p) \ if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } +/** + * MOVETO_ENDTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '>' char + */ #define MOVETO_ENDTAG(p) \ while ((*p) && (*(p) != '>')) (p)++ +/** + * MOVETO_STARTTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '<' char + */ #define MOVETO_STARTTAG(p) \ while ((*p) && (*(p) != '<')) (p)++ diff --git a/tree.h b/tree.h index 4be4c5fa..463daaa4 100644 --- a/tree.h +++ b/tree.h @@ -59,25 +59,36 @@ typedef enum { #endif } xmlElementType; -/* - * Size of an internal character representation. +/** + * xmlChar: * - * We use 8bit chars internal representation for memory efficiency, - * Note that with 8 bits wide xmlChars one can still use UTF-8 to handle - * correctly non ISO-Latin input. + * This is a basic byte in an UTF-8 encoded string. + * It's unsigned allowing to pinpoint case where char * are assigned + * to xmlChar * (possibly making serialization back impossible). */ typedef unsigned char xmlChar; +/* + * Removed in 2.3.9 ... nobody should still use this + * #ifndef WIN32 #ifndef CHAR #define CHAR xmlChar #endif #endif + */ +/** + * BAD_CAST: + * + * Macro to cast a string to an xmlChar * when one know its safe. + */ #define BAD_CAST (xmlChar *) -/* +/** + * xmlNotation: + * * a DTD Notation definition */ @@ -89,8 +100,10 @@ struct _xmlNotation { const xmlChar *SystemID; /* System identifier, if any */ }; -/* - * a DTD Attribute definition +/** + * xmlAttributeType: + * + * a DTD Attribute type definition */ typedef enum { @@ -106,6 +119,12 @@ typedef enum { XML_ATTRIBUTE_NOTATION } xmlAttributeType; +/** + * xmlAttributeDefault: + * + * a DTD Attribute default definition + */ + typedef enum { XML_ATTRIBUTE_NONE = 1, XML_ATTRIBUTE_REQUIRED, @@ -113,6 +132,12 @@ typedef enum { XML_ATTRIBUTE_FIXED } xmlAttributeDefault; +/** + * xmlEnumeration: + * + * list structure used when there is an enumeration in DTDs + */ + typedef struct _xmlEnumeration xmlEnumeration; typedef xmlEnumeration *xmlEnumerationPtr; struct _xmlEnumeration { @@ -120,6 +145,12 @@ struct _xmlEnumeration { const xmlChar *name; /* Enumeration name */ }; +/** + * xmlAttribute: + * + * an Attribute declaration in a DTD + */ + typedef struct _xmlAttribute xmlAttribute; typedef xmlAttribute *xmlAttributePtr; struct _xmlAttribute { @@ -144,8 +175,10 @@ struct _xmlAttribute { const xmlChar *elem; /* Element holding the attribute */ }; -/* - * a DTD Element definition. +/** + * xmlElementContentType: + * + * Possible definitions of element content types */ typedef enum { XML_ELEMENT_CONTENT_PCDATA = 1, @@ -154,6 +187,11 @@ typedef enum { XML_ELEMENT_CONTENT_OR } xmlElementContentType; +/** + * xmlElementContentOccur: + * + * Possible definitions of element content occurences + */ typedef enum { XML_ELEMENT_CONTENT_ONCE = 1, XML_ELEMENT_CONTENT_OPT, @@ -161,6 +199,13 @@ typedef enum { XML_ELEMENT_CONTENT_PLUS } xmlElementContentOccur; +/** + * xmlElementContent: + * + * an XML Element content as stored after parsing an element definition + * in a DTD. + */ + typedef struct _xmlElementContent xmlElementContent; typedef xmlElementContent *xmlElementContentPtr; struct _xmlElementContent { @@ -172,6 +217,12 @@ struct _xmlElementContent { struct _xmlElementContent *parent; /* parent */ }; +/** + * xmlElementTypeVal: + * + * the differnt possibility for an element content type + */ + typedef enum { XML_ELEMENT_TYPE_UNDEFINED = 0, XML_ELEMENT_TYPE_EMPTY = 1, @@ -180,6 +231,12 @@ typedef enum { XML_ELEMENT_TYPE_ELEMENT } xmlElementTypeVal; +/** + * xmlElement: + * + * an XML Element declaration from a DTD + */ + typedef struct _xmlElement xmlElement; typedef xmlElement *xmlElementPtr; struct _xmlElement { @@ -201,7 +258,13 @@ struct _xmlElement { const xmlChar *prefix; /* the namespace prefix if any */ }; -/* + +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; + +/** + * xmlNs: + * * An XML namespace. * Note that prefix == NULL is valid, it defines the default namespace * within the subtree (until overriden). @@ -210,9 +273,6 @@ struct _xmlElement { * xmlNsType is unified with xmlElementType */ -#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL -typedef xmlElementType xmlNsType; - typedef struct _xmlNs xmlNs; typedef xmlNs *xmlNsPtr; struct _xmlNs { @@ -222,8 +282,11 @@ struct _xmlNs { const xmlChar *prefix; /* prefix for the namespace */ }; -/* - * An XML DtD, as defined by vstateNr - 1; + if (ctxt->vstateNr >= ctxt->vstateMax) { ctxt->vstateMax *= 2; ctxt->vstateTab = (xmlValidState *) xmlRealloc(ctxt->vstateTab, @@ -116,6 +118,15 @@ vstateVPush(xmlValidCtxtPtr ctxt, xmlElementContentPtr cont, } ctxt->vstate = &ctxt->vstateTab[0]; } + /* + * Don't push on the stack a state already here + */ + if ((i >= 0) && (ctxt->vstateTab[i].cont == cont) && + (ctxt->vstateTab[i].node == node) && + (ctxt->vstateTab[i].depth == depth) && + (ctxt->vstateTab[i].occurs == occurs) && + (ctxt->vstateTab[i].state == state)) + return(ctxt->vstateNr); ctxt->vstateTab[ctxt->vstateNr].cont = cont; ctxt->vstateTab[ctxt->vstateNr].node = node; ctxt->vstateTab[ctxt->vstateNr].depth = depth; diff --git a/xmlversion.h.in b/xmlversion.h.in index 76b7ae08..57251234 100644 --- a/xmlversion.h.in +++ b/xmlversion.h.in @@ -25,7 +25,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); -/* +/** + * WITH_TRIO: + * * Whether the trio support need to be configured in */ #if @WITH_TRIO@ @@ -34,7 +36,9 @@ extern void xmlCheckVersion(int version); #define WITHOUT_TRIO #endif -/* +/** + * LIBXML_FTP_ENABLED: + * * Whether the FTP support is configured in */ #if @WITH_FTP@ @@ -43,7 +47,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_FTP_DISABLED #endif -/* +/** + * LIBXML_HTTP_ENABLED: + * * Whether the HTTP support is configured in */ #if @WITH_HTTP@ @@ -52,7 +58,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_HTTP_DISABLED #endif -/* +/** + * LIBXML_HTML_ENABLED: + * * Whether the HTML support is configured in */ #if @WITH_HTML@ @@ -61,7 +69,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_HTML_DISABLED #endif -/* +/** + * LIBXML_CATALOG_ENABLED: + * * Whether the Catalog support is configured in */ #if @WITH_CATALOG@ @@ -70,7 +80,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_CATALOG_DISABLED #endif -/* +/** + * LIBXML_DOCB_ENABLED: + * * Whether the SGML Docbook support is configured in */ #if @WITH_DOCB@ @@ -79,7 +91,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_DOCB_DISABLED #endif -/* +/** + * LIBXML_XPATH_ENABLED: + * * Whether XPath is configured in */ #if @WITH_XPATH@ @@ -88,7 +102,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_XPATH_DISABLED #endif -/* +/** + * LIBXML_XPTR_ENABLED: + * * Whether XPointer is configured in */ #if @WITH_XPTR@ @@ -97,7 +113,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_XPTR_DISABLED #endif -/* +/** + * LIBXML_XINCLUDE_ENABLED: + * * Whether XInclude is configured in */ #if @WITH_XINCLUDE@ @@ -106,7 +124,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_XINCLUDE_DISABLED #endif -/* +/** + * LIBXML_ICONV_ENABLED: + * * Whether iconv support is available */ #ifndef WIN32 @@ -117,7 +137,9 @@ extern void xmlCheckVersion(int version); #endif #endif -/* +/** + * LIBXML_DEBUG_ENABLED: + * * Whether Debugging module is configured in */ #if @WITH_DEBUG@ @@ -126,7 +148,9 @@ extern void xmlCheckVersion(int version); #define LIBXML_DEBUG_DISABLED #endif -/* +/** + * DEBUG_MEMORY_LOCATION: + * * Whether the memory debugging is configured in */ #if @WITH_MEM_DEBUG@ @@ -141,6 +165,11 @@ extern void xmlCheckVersion(int version); #endif #endif +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include diff --git a/xpath.h b/xpath.h index 50f909db..cd043733 100644 --- a/xpath.h +++ b/xpath.h @@ -167,7 +167,9 @@ struct _xmlXPathAxis { xmlXPathAxisFunc func; /* the search function */ }; -/* +/** + * xmlXPathContext: + * * Expression evaluation occurs with respect to a context. * he context consists of: * - a node (the context node) @@ -229,7 +231,9 @@ struct _xmlXPathContext { typedef struct _xmlXPathCompExpr xmlXPathCompExpr; typedef xmlXPathCompExpr *xmlXPathCompExprPtr; -/* +/** + * xmlXPathParserContext: + * * An XPath parser context, it contains pure parsing informations, * an xmlXPathContext, and the stack of objects. */ @@ -249,7 +253,9 @@ struct _xmlXPathParserContext { int xptr; /* it this an XPointer expression */ }; -/* +/** + * xmlXPathFunction: + * * An XPath function * The arguments (if any) are popped out of the context stack * and the result is pushed on the stack. @@ -288,7 +294,7 @@ int xmlXPathCmpNodes (xmlNodePtr node1, */ int xmlXPathCastNumberToBoolean (double val); int xmlXPathCastStringToBoolean (const xmlChar * val); -int xmlXPathCastNodeToBoolean (xmlNodeSetPtr ns); +int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns); int xmlXPathCastToBoolean (xmlXPathObjectPtr val); double xmlXPathCastBooleanToNumber (int val); diff --git a/xpathInternals.h b/xpathInternals.h index 1785d094..122244b9 100644 --- a/xpathInternals.h +++ b/xpathInternals.h @@ -22,36 +22,86 @@ extern "C" { * * ************************************************************************/ +/** + * CHECK_ERROR: + * + * macro to return from the function if an XPath error was detected + */ #define CHECK_ERROR \ if (ctxt->error != XPATH_EXPRESSION_OK) return +/** + * CHECK_ERROR0: + * + * macro to return 0 from the function if an XPath error was detected + */ #define CHECK_ERROR0 \ if (ctxt->error != XPATH_EXPRESSION_OK) return(0) +/** + * XP_ERROR: + * @X: the error code + * + * Macro to raise an XPath error and return + */ #define XP_ERROR(X) \ { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ ctxt->error = (X); return; } +/** + * XP_ERROR0: + * @X: the error code + * + * Macro to raise an XPath error and return 0 + */ #define XP_ERROR0(X) \ { xmlXPatherror(ctxt, __FILE__, __LINE__, X); \ ctxt->error = (X); return(0); } +/** + * CHECK_TYPE: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. + */ #define CHECK_TYPE(typeval) \ if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ XP_ERROR(XPATH_INVALID_TYPE) +/** + * CHECK_ARITY: + * @x: the number of expected args + * + * Macro to check that the number of args passed to an XPath function matches + */ #define CHECK_ARITY(x) \ if (nargs != (x)) \ XP_ERROR(XPATH_INVALID_ARITY); +/** + * CAST_TO_STRING: + * + * Macro to try to cast the value on the top of the XPath stack to a string + */ #define CAST_TO_STRING \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ xmlXPathStringFunction(ctxt, 1); +/** + * CAST_TO_NUMBER: + * + * Macro to try to cast the value on the top of the XPath stack to a number + */ #define CAST_TO_NUMBER \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ xmlXPathNumberFunction(ctxt, 1); +/** + * CAST_TO_BOOLEAN: + * + * Macro to try to cast the value on the top of the XPath stack to a boolean + */ #define CAST_TO_BOOLEAN \ if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ xmlXPathBooleanFunction(ctxt, 1);