diff --git a/ChangeLog b/ChangeLog index 32755a5b..a6be6140 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jul 19 15:29:26 CEST 2001 Daniel Veillard + + * configure.in Makefile.am: removed libxml softlink for good + * include/libxml/*.h *.c doc/Makefile.am: cleanup to get + 100% coverage by gtk-doc + Tue Jul 17 17:36:46 EDT 2001 Daniel Veillard * xmlmemory.c include/libxml/xmlmemory.h: debugging on IA64, diff --git a/HTMLparser.c b/HTMLparser.c index 8812c3d0..4f37f6a6 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -1785,6 +1785,9 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) { * @URI: URI for the dtd, or NULL * @ExternalID: the external ID of the DTD, or NULL * + * Creates a new HTML document without a DTD node if @URI and @ExternalID + * are NULL + * * Returns a new document, do not intialize the DTD if not provided */ htmlDocPtr @@ -1827,6 +1830,8 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) { * @URI: URI for the dtd, or NULL * @ExternalID: the external ID of the DTD, or NULL * + * Creates a new HTML document + * * Returns a new document */ htmlDocPtr diff --git a/Makefile.am b/Makefile.am index 202b2c94..a6f43318 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,14 +79,6 @@ testURI_LDADD= $(LDADDS) check-local: tests -$(srcdir)/libxml: - -$(RM) -f $(srcdir)/libxml - ln -s $(srcdir)/. $(srcdir)/libxml - -install-data: $(srcdir)/libxml - -$(libxml2_la_SOURCES): $(srcdir)/libxml - testall : tests SVGtests SAXtests tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests Scripttests diff --git a/catalog.c b/catalog.c index f4b6188b..9664c4fb 100644 --- a/catalog.c +++ b/catalog.c @@ -473,7 +473,7 @@ xmlParseCatalog(const xmlChar *value, const char *file) { * * ************************************************************************/ -/* +/** * xmlLoadCatalog: * @filename: a file path * @@ -548,7 +548,7 @@ xmlLoadCatalog(const char *filename) { return(ret); } -/* +/** * xmlLoadCatalogs: * @paths: a list of file path separated by ':' or spaces * diff --git a/configure.in b/configure.in index 977dde3c..068061cf 100644 --- a/configure.in +++ b/configure.in @@ -441,24 +441,5 @@ AC_SUBST(HAVE_ISINF) AC_SUBST(M_LIBS) AC_SUBST(RDL_LIBS) -dnl -dnl cleanup any remaining symlinks if any for include/libxml, this -dnl is only needed for the people using CVS and transitionning -dnl -if test -d $srcdir/include/CVS -then - if test -L $srcdir/include/libxml - then - rm -rf $srcdir/include/libxml - echo The CVS repository changed a bit - echo 'please run "cvs update -d" and rerun the configuration script' - exit 1 - fi - if test -e $srcdir/xmlversion.h - then - rm -f $srcdir/xmlversion.h - fi -fi - AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile include/libxml/xmlversion.h include/libxml/xmlwin32version.h xml2-config libxml-2.0.pc xml2Conf.sh) diff --git a/debugXML.c b/debugXML.c index a36ad03a..30565488 100644 --- a/debugXML.c +++ b/debugXML.c @@ -29,18 +29,31 @@ #define IS_BLANK(c) \ (((c) == '\n') || ((c) == '\r') || ((c) == '\t') || ((c) == ' ')) -void xmlDebugDumpString(FILE *output, const xmlChar *str) { +/** + * xmlDebugDumpString: + * @output: the FILE * for the output + * @str: the string + * + * Dumps informations about the string, shorten it if necessary + */ +void +xmlDebugDumpString(FILE * output, const xmlChar * str) +{ int i; + if (str == NULL) { - fprintf(output, "(NULL)"); - return; + fprintf(output, "(NULL)"); + return; } - for (i = 0;i < 40;i++) - if (str[i] == 0) return; - else if (IS_BLANK(str[i])) fputc(' ', output); - else if (str[i] >= 0x80) - fprintf(output, "#%X", str[i]); - else fputc(str[i], output); + for (i = 0; i < 40; i++) + if (str[i] == 0) + return; + else if (IS_BLANK(str[i])) + fputc(' ', output); + else if (str[i] >= 0x80) + fprintf(output, "#%X", str[i]); + else + fputc(str[i], output); fprintf(output, "..."); } @@ -457,7 +470,16 @@ xmlDebugDumpEntity(FILE *output, xmlEntityPtr ent, int depth) { } } -void xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) { +/** + * xmlDebugDumpAttr: + * @output: the FILE * for the output + * @attr: the attribute + * @depth: the indentation level. + * + * Dumps debug information for the attribute + */ +void +xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) { int i; char shift[100]; @@ -495,298 +517,371 @@ void xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) { } } -void xmlDebugDumpAttrList(FILE *output, xmlAttrPtr attr, int depth) { +/** + * xmlDebugDumpAttrList: + * @output: the FILE * for the output + * @attr: the attribute list + * @depth: the indentation level. + * + * Dumps debug information for the attribute list + */ +void +xmlDebugDumpAttrList(FILE * output, xmlAttrPtr attr, int depth) +{ while (attr != NULL) { xmlDebugDumpAttr(output, attr, depth); - attr = attr->next; + attr = attr->next; } } -void xmlDebugDumpOneNode(FILE *output, xmlNodePtr node, int depth) { +/** + * xmlDebugDumpOneNode: + * @output: the FILE * for the output + * @node: the node + * @depth: the indentation level. + * + * Dumps debug information for the element node, it is not recursive + */ +void +xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth) +{ int i; char shift[100]; - for (i = 0;((i < depth) && (i < 25));i++) + for (i = 0; ((i < depth) && (i < 25)); i++) shift[2 * i] = shift[2 * i + 1] = ' '; shift[2 * i] = shift[2 * i + 1] = 0; switch (node->type) { - case XML_ELEMENT_NODE: - fprintf(output, shift); - fprintf(output, "ELEMENT "); - if ((node->ns != NULL) && (node->ns->prefix != NULL)) { - xmlDebugDumpString(output, node->ns->prefix); - fprintf(output, ":"); - } - xmlDebugDumpString(output, node->name); - fprintf(output, "\n"); - break; - case XML_ATTRIBUTE_NODE: - fprintf(output, shift); - fprintf(output, "Error, ATTRIBUTE found here\n"); - break; - case XML_TEXT_NODE: - fprintf(output, shift); - fprintf(output, "TEXT\n"); - break; - case XML_CDATA_SECTION_NODE: - fprintf(output, shift); - fprintf(output, "CDATA_SECTION\n"); - break; - case XML_ENTITY_REF_NODE: - fprintf(output, shift); - fprintf(output, "ENTITY_REF(%s)\n", node->name); - break; - case XML_ENTITY_NODE: - fprintf(output, shift); - fprintf(output, "ENTITY\n"); - break; - case XML_PI_NODE: - fprintf(output, shift); - fprintf(output, "PI %s\n", node->name); - break; - case XML_COMMENT_NODE: - fprintf(output, shift); - fprintf(output, "COMMENT\n"); - break; - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - fprintf(output, shift); - fprintf(output, "Error, DOCUMENT found here\n"); - break; - case XML_DOCUMENT_TYPE_NODE: - fprintf(output, shift); - fprintf(output, "DOCUMENT_TYPE\n"); - break; - case XML_DOCUMENT_FRAG_NODE: - fprintf(output, shift); - fprintf(output, "DOCUMENT_FRAG\n"); - break; - case XML_NOTATION_NODE: - fprintf(output, shift); - fprintf(output, "NOTATION\n"); - break; - case XML_DTD_NODE: - xmlDebugDumpDtdNode(output, (xmlDtdPtr) node, depth); - return; - case XML_ELEMENT_DECL: - xmlDebugDumpElemDecl(output, (xmlElementPtr) node, depth); - return; - case XML_ATTRIBUTE_DECL: - xmlDebugDumpAttrDecl(output, (xmlAttributePtr) node, depth); - return; + case XML_ELEMENT_NODE: + fprintf(output, shift); + fprintf(output, "ELEMENT "); + if ((node->ns != NULL) && (node->ns->prefix != NULL)) { + xmlDebugDumpString(output, node->ns->prefix); + fprintf(output, ":"); + } + xmlDebugDumpString(output, node->name); + fprintf(output, "\n"); + break; + case XML_ATTRIBUTE_NODE: + fprintf(output, shift); + fprintf(output, "Error, ATTRIBUTE found here\n"); + break; + case XML_TEXT_NODE: + fprintf(output, shift); + fprintf(output, "TEXT\n"); + break; + case XML_CDATA_SECTION_NODE: + fprintf(output, shift); + fprintf(output, "CDATA_SECTION\n"); + break; + case XML_ENTITY_REF_NODE: + fprintf(output, shift); + fprintf(output, "ENTITY_REF(%s)\n", node->name); + break; + case XML_ENTITY_NODE: + fprintf(output, shift); + fprintf(output, "ENTITY\n"); + break; + case XML_PI_NODE: + fprintf(output, shift); + fprintf(output, "PI %s\n", node->name); + break; + case XML_COMMENT_NODE: + fprintf(output, shift); + fprintf(output, "COMMENT\n"); + break; + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: + fprintf(output, shift); + fprintf(output, "Error, DOCUMENT found here\n"); + break; + case XML_DOCUMENT_TYPE_NODE: + fprintf(output, shift); + fprintf(output, "DOCUMENT_TYPE\n"); + break; + case XML_DOCUMENT_FRAG_NODE: + fprintf(output, shift); + fprintf(output, "DOCUMENT_FRAG\n"); + break; + case XML_NOTATION_NODE: + fprintf(output, shift); + fprintf(output, "NOTATION\n"); + break; + case XML_DTD_NODE: + xmlDebugDumpDtdNode(output, (xmlDtdPtr) node, depth); + return; + case XML_ELEMENT_DECL: + xmlDebugDumpElemDecl(output, (xmlElementPtr) node, depth); + return; + case XML_ATTRIBUTE_DECL: + xmlDebugDumpAttrDecl(output, (xmlAttributePtr) node, depth); + return; case XML_ENTITY_DECL: - xmlDebugDumpEntityDecl(output, (xmlEntityPtr) node, depth); - return; + xmlDebugDumpEntityDecl(output, (xmlEntityPtr) node, depth); + return; case XML_NAMESPACE_DECL: - xmlDebugDumpNamespace(output, (xmlNsPtr) node, depth); - return; + xmlDebugDumpNamespace(output, (xmlNsPtr) node, depth); + return; case XML_XINCLUDE_START: - fprintf(output, shift); - fprintf(output, "INCLUDE START\n"); - return; + fprintf(output, shift); + fprintf(output, "INCLUDE START\n"); + return; case XML_XINCLUDE_END: - fprintf(output, shift); - fprintf(output, "INCLUDE END\n"); - return; - default: - fprintf(output, shift); - fprintf(output, "NODE_%d !!!\n", node->type); - return; + fprintf(output, shift); + fprintf(output, "INCLUDE END\n"); + return; + default: + fprintf(output, shift); + fprintf(output, "NODE_%d !!!\n", node->type); + return; } if (node->doc == NULL) { fprintf(output, shift); - fprintf(output, "doc == NULL !!!\n"); + fprintf(output, "doc == NULL !!!\n"); } - if (node->nsDef != NULL) + if (node->nsDef != NULL) xmlDebugDumpNamespaceList(output, node->nsDef, depth + 1); if (node->properties != NULL) - xmlDebugDumpAttrList(output, node->properties, depth + 1); + xmlDebugDumpAttrList(output, node->properties, depth + 1); if (node->type != XML_ENTITY_REF_NODE) { - if ((node->type != XML_ELEMENT_NODE) && - (node->content != NULL)) { - shift[2 * i] = shift[2 * i + 1] = ' ' ; - shift[2 * i + 2] = shift[2 * i + 3] = 0 ; - fprintf(output, shift); - fprintf(output, "content="); -#ifndef XML_USE_BUFFER_CONTENT - xmlDebugDumpString(output, node->content); + if ((node->type != XML_ELEMENT_NODE) && (node->content != NULL)) { + shift[2 * i] = shift[2 * i + 1] = ' '; + shift[2 * i + 2] = shift[2 * i + 3] = 0; + fprintf(output, shift); + fprintf(output, "content="); +#ifndef XML_USE_BUFFER_CONTENT + xmlDebugDumpString(output, node->content); #else - xmlDebugDumpString(output, xmlBufferContent(node->content)); + xmlDebugDumpString(output, xmlBufferContent(node->content)); #endif - fprintf(output, "\n"); - } + fprintf(output, "\n"); + } } else { xmlEntityPtr ent; - ent = xmlGetDocEntity(node->doc, node->name); - if (ent != NULL) - xmlDebugDumpEntity(output, ent, depth + 1); + + ent = xmlGetDocEntity(node->doc, node->name); + if (ent != NULL) + xmlDebugDumpEntity(output, ent, depth + 1); } /* * Do a bit of checking */ if (node->parent == NULL) - fprintf(output, "PBM: Node has no parent\n"); + fprintf(output, "PBM: Node has no parent\n"); if (node->doc == NULL) - fprintf(output, "PBM: Node has no doc\n"); + fprintf(output, "PBM: Node has no doc\n"); if ((node->parent != NULL) && (node->doc != node->parent->doc)) - fprintf(output, "PBM: Node doc differs from parent's one\n"); + fprintf(output, "PBM: Node doc differs from parent's one\n"); if (node->prev == NULL) { - if ((node->parent != NULL) && (node->parent->children != node)) - fprintf(output, "PBM: Node has no prev and not first of list\n"); + if ((node->parent != NULL) && (node->parent->children != node)) + fprintf(output, + "PBM: Node has no prev and not first of list\n"); } else { - if (node->prev->next != node) - fprintf(output, "PBM: Node prev->next : back link wrong\n"); + if (node->prev->next != node) + fprintf(output, "PBM: Node prev->next : back link wrong\n"); } if (node->next == NULL) { - if ((node->parent != NULL) && (node->parent->last != node)) - fprintf(output, "PBM: Node has no next and not last of list\n"); + if ((node->parent != NULL) && (node->parent->last != node)) + fprintf(output, + "PBM: Node has no next and not last of list\n"); } else { - if (node->next->prev != node) - fprintf(output, "PBM: Node next->prev : forward link wrong\n"); + if (node->next->prev != node) + fprintf(output, "PBM: Node next->prev : forward link wrong\n"); } } -void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth) { +/** + * xmlDebugDumpNode: + * @output: the FILE * for the output + * @node: the node + * @depth: the indentation level. + * + * Dumps debug information for the element node, it is recursive + */ +void +xmlDebugDumpNode(FILE * output, xmlNodePtr node, int depth) +{ xmlDebugDumpOneNode(output, node, depth); if ((node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) - xmlDebugDumpNodeList(output, node->children, depth + 1); + xmlDebugDumpNodeList(output, node->children, depth + 1); } -void xmlDebugDumpNodeList(FILE *output, xmlNodePtr node, int depth) { +/** + * xmlDebugDumpNodeList: + * @output: the FILE * for the output + * @node: the node list + * @depth: the indentation level. + * + * Dumps debug information for the list of element node, it is recursive + */ +void +xmlDebugDumpNodeList(FILE * output, xmlNodePtr node, int depth) +{ while (node != NULL) { xmlDebugDumpNode(output, node, depth); - node = node->next; + node = node->next; } } -void xmlDebugDumpDocumentHead(FILE *output, xmlDocPtr doc) { - if (output == NULL) output = stdout; +/** + * xmlDebugDumpDocumentHead: + * @output: the FILE * for the output + * @doc: the document + * + * Dumps debug information cncerning the document, not recursive + */ +void +xmlDebugDumpDocumentHead(FILE * output, xmlDocPtr doc) +{ + if (output == NULL) + output = stdout; if (doc == NULL) { fprintf(output, "DOCUMENT == NULL !\n"); - return; + return; } switch (doc->type) { - case XML_ELEMENT_NODE: - fprintf(output, "Error, ELEMENT found here "); - break; - case XML_ATTRIBUTE_NODE: - fprintf(output, "Error, ATTRIBUTE found here\n"); - break; - case XML_TEXT_NODE: - fprintf(output, "Error, TEXT\n"); - break; - case XML_CDATA_SECTION_NODE: - fprintf(output, "Error, CDATA_SECTION\n"); - break; - case XML_ENTITY_REF_NODE: - fprintf(output, "Error, ENTITY_REF\n"); - break; - case XML_ENTITY_NODE: - fprintf(output, "Error, ENTITY\n"); - break; - case XML_PI_NODE: - fprintf(output, "Error, PI\n"); - break; - case XML_COMMENT_NODE: - fprintf(output, "Error, COMMENT\n"); - break; - case XML_DOCUMENT_NODE: - fprintf(output, "DOCUMENT\n"); - break; - case XML_HTML_DOCUMENT_NODE: - fprintf(output, "HTML DOCUMENT\n"); - break; - case XML_DOCUMENT_TYPE_NODE: - fprintf(output, "Error, DOCUMENT_TYPE\n"); - break; - case XML_DOCUMENT_FRAG_NODE: - fprintf(output, "Error, DOCUMENT_FRAG\n"); - break; - case XML_NOTATION_NODE: - fprintf(output, "Error, NOTATION\n"); - break; - default: - fprintf(output, "NODE_%d\n", doc->type); + case XML_ELEMENT_NODE: + fprintf(output, "Error, ELEMENT found here "); + break; + case XML_ATTRIBUTE_NODE: + fprintf(output, "Error, ATTRIBUTE found here\n"); + break; + case XML_TEXT_NODE: + fprintf(output, "Error, TEXT\n"); + break; + case XML_CDATA_SECTION_NODE: + fprintf(output, "Error, CDATA_SECTION\n"); + break; + case XML_ENTITY_REF_NODE: + fprintf(output, "Error, ENTITY_REF\n"); + break; + case XML_ENTITY_NODE: + fprintf(output, "Error, ENTITY\n"); + break; + case XML_PI_NODE: + fprintf(output, "Error, PI\n"); + break; + case XML_COMMENT_NODE: + fprintf(output, "Error, COMMENT\n"); + break; + case XML_DOCUMENT_NODE: + fprintf(output, "DOCUMENT\n"); + break; + case XML_HTML_DOCUMENT_NODE: + fprintf(output, "HTML DOCUMENT\n"); + break; + case XML_DOCUMENT_TYPE_NODE: + fprintf(output, "Error, DOCUMENT_TYPE\n"); + break; + case XML_DOCUMENT_FRAG_NODE: + fprintf(output, "Error, DOCUMENT_FRAG\n"); + break; + case XML_NOTATION_NODE: + fprintf(output, "Error, NOTATION\n"); + break; + default: + fprintf(output, "NODE_%d\n", doc->type); } if (doc->name != NULL) { - fprintf(output, "name="); + fprintf(output, "name="); xmlDebugDumpString(output, BAD_CAST doc->name); - fprintf(output, "\n"); + fprintf(output, "\n"); } if (doc->version != NULL) { - fprintf(output, "version="); + fprintf(output, "version="); xmlDebugDumpString(output, doc->version); - fprintf(output, "\n"); + fprintf(output, "\n"); } if (doc->encoding != NULL) { - fprintf(output, "encoding="); + fprintf(output, "encoding="); xmlDebugDumpString(output, doc->encoding); - fprintf(output, "\n"); + fprintf(output, "\n"); } if (doc->URL != NULL) { - fprintf(output, "URL="); + fprintf(output, "URL="); xmlDebugDumpString(output, doc->URL); - fprintf(output, "\n"); + fprintf(output, "\n"); } if (doc->standalone) fprintf(output, "standalone=true\n"); - if (doc->oldNs != NULL) + if (doc->oldNs != NULL) xmlDebugDumpNamespaceList(output, doc->oldNs, 0); } -void xmlDebugDumpDocument(FILE *output, xmlDocPtr doc) { - if (output == NULL) output = stdout; +/** + * xmlDebugDumpDocument: + * @output: the FILE * for the output + * @doc: the document + * + * Dumps debug information for the document, it's recursive + */ +void +xmlDebugDumpDocument(FILE * output, xmlDocPtr doc) +{ + if (output == NULL) + output = stdout; if (doc == NULL) { fprintf(output, "DOCUMENT == NULL !\n"); - return; + return; } xmlDebugDumpDocumentHead(output, doc); if (((doc->type == XML_DOCUMENT_NODE) || - (doc->type == XML_HTML_DOCUMENT_NODE)) && - (doc->children != NULL)) + (doc->type == XML_HTML_DOCUMENT_NODE)) && (doc->children != NULL)) xmlDebugDumpNodeList(output, doc->children, 1); -} +} -void xmlDebugDumpDTD(FILE *output, xmlDtdPtr dtd) { +/** + * xmlDebugDumpDTD: + * @output: the FILE * for the output + * @dtd: the DTD + * + * Dumps debug information for the DTD + */ +void +xmlDebugDumpDTD(FILE * output, xmlDtdPtr dtd) +{ if (dtd == NULL) - return; + return; if (dtd->type != XML_DTD_NODE) { - fprintf(output, "PBM: not a DTD\n"); - return; + fprintf(output, "PBM: not a DTD\n"); + return; } if (dtd->name != NULL) - fprintf(output, "DTD(%s)", dtd->name); + fprintf(output, "DTD(%s)", dtd->name); else - fprintf(output, "DTD"); + fprintf(output, "DTD"); if (dtd->ExternalID != NULL) - fprintf(output, ", PUBLIC %s", dtd->ExternalID); + fprintf(output, ", PUBLIC %s", dtd->ExternalID); if (dtd->SystemID != NULL) - fprintf(output, ", SYSTEM %s", dtd->SystemID); + fprintf(output, ", SYSTEM %s", dtd->SystemID); fprintf(output, "\n"); /* * Do a bit of checking */ if ((dtd->parent != NULL) && (dtd->doc != dtd->parent->doc)) - fprintf(output, "PBM: Dtd doc differs from parent's one\n"); + fprintf(output, "PBM: Dtd doc differs from parent's one\n"); if (dtd->prev == NULL) { - if ((dtd->parent != NULL) && (dtd->parent->children != (xmlNodePtr)dtd)) - fprintf(output, "PBM: Dtd has no prev and not first of list\n"); + if ((dtd->parent != NULL) + && (dtd->parent->children != (xmlNodePtr) dtd)) + fprintf(output, + "PBM: Dtd has no prev and not first of list\n"); } else { - if (dtd->prev->next != (xmlNodePtr) dtd) - fprintf(output, "PBM: Dtd prev->next : back link wrong\n"); + if (dtd->prev->next != (xmlNodePtr) dtd) + fprintf(output, "PBM: Dtd prev->next : back link wrong\n"); } if (dtd->next == NULL) { - if ((dtd->parent != NULL) && (dtd->parent->last != (xmlNodePtr) dtd)) - fprintf(output, "PBM: Dtd has no next and not last of list\n"); + if ((dtd->parent != NULL) + && (dtd->parent->last != (xmlNodePtr) dtd)) + fprintf(output, "PBM: Dtd has no next and not last of list\n"); } else { - if (dtd->next->prev != (xmlNodePtr) dtd) - fprintf(output, "PBM: Dtd next->prev : forward link wrong\n"); + if (dtd->next->prev != (xmlNodePtr) dtd) + fprintf(output, "PBM: Dtd next->prev : forward link wrong\n"); } if (dtd->children == NULL) - fprintf(output, " DTD is empty\n"); + fprintf(output, " DTD is empty\n"); else xmlDebugDumpNodeList(output, dtd->children, 1); } @@ -826,70 +921,84 @@ xmlDebugDumpEntityCallback(xmlEntityPtr cur, FILE *output) { fprintf(output, "\n"); } -void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) { - if (output == NULL) output = stdout; +/** + * xmlDebugDumpEntities: + * @output: the FILE * for the output + * @doc: the document + * + * Dumps debug information for all the entities in use by the document + */ +void +xmlDebugDumpEntities(FILE * output, xmlDocPtr doc) +{ + if (output == NULL) + output = stdout; if (doc == NULL) { fprintf(output, "DOCUMENT == NULL !\n"); - return; + return; } switch (doc->type) { - case XML_ELEMENT_NODE: - fprintf(output, "Error, ELEMENT found here "); - break; - case XML_ATTRIBUTE_NODE: - fprintf(output, "Error, ATTRIBUTE found here\n"); - break; - case XML_TEXT_NODE: - fprintf(output, "Error, TEXT\n"); - break; - case XML_CDATA_SECTION_NODE: - fprintf(output, "Error, CDATA_SECTION\n"); - break; - case XML_ENTITY_REF_NODE: - fprintf(output, "Error, ENTITY_REF\n"); - break; - case XML_ENTITY_NODE: - fprintf(output, "Error, ENTITY\n"); - break; - case XML_PI_NODE: - fprintf(output, "Error, PI\n"); - break; - case XML_COMMENT_NODE: - fprintf(output, "Error, COMMENT\n"); - break; - case XML_DOCUMENT_NODE: - fprintf(output, "DOCUMENT\n"); - break; - case XML_HTML_DOCUMENT_NODE: - fprintf(output, "HTML DOCUMENT\n"); - break; - case XML_DOCUMENT_TYPE_NODE: - fprintf(output, "Error, DOCUMENT_TYPE\n"); - break; - case XML_DOCUMENT_FRAG_NODE: - fprintf(output, "Error, DOCUMENT_FRAG\n"); - break; - case XML_NOTATION_NODE: - fprintf(output, "Error, NOTATION\n"); - break; - default: - fprintf(output, "NODE_%d\n", doc->type); + case XML_ELEMENT_NODE: + fprintf(output, "Error, ELEMENT found here "); + break; + case XML_ATTRIBUTE_NODE: + fprintf(output, "Error, ATTRIBUTE found here\n"); + break; + case XML_TEXT_NODE: + fprintf(output, "Error, TEXT\n"); + break; + case XML_CDATA_SECTION_NODE: + fprintf(output, "Error, CDATA_SECTION\n"); + break; + case XML_ENTITY_REF_NODE: + fprintf(output, "Error, ENTITY_REF\n"); + break; + case XML_ENTITY_NODE: + fprintf(output, "Error, ENTITY\n"); + break; + case XML_PI_NODE: + fprintf(output, "Error, PI\n"); + break; + case XML_COMMENT_NODE: + fprintf(output, "Error, COMMENT\n"); + break; + case XML_DOCUMENT_NODE: + fprintf(output, "DOCUMENT\n"); + break; + case XML_HTML_DOCUMENT_NODE: + fprintf(output, "HTML DOCUMENT\n"); + break; + case XML_DOCUMENT_TYPE_NODE: + fprintf(output, "Error, DOCUMENT_TYPE\n"); + break; + case XML_DOCUMENT_FRAG_NODE: + fprintf(output, "Error, DOCUMENT_FRAG\n"); + break; + case XML_NOTATION_NODE: + fprintf(output, "Error, NOTATION\n"); + break; + default: + fprintf(output, "NODE_%d\n", doc->type); } if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) { - xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) - doc->intSubset->entities; - fprintf(output, "Entities in internal subset\n"); - xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output); + xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) + doc->intSubset->entities; + + fprintf(output, "Entities in internal subset\n"); + xmlHashScan(table, (xmlHashScanner) xmlDebugDumpEntityCallback, + output); } else - fprintf(output, "No entities in internal subset\n"); + fprintf(output, "No entities in internal subset\n"); if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) { - xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) - doc->extSubset->entities; - fprintf(output, "Entities in external subset\n"); - xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output); + xmlEntitiesTablePtr table = (xmlEntitiesTablePtr) + doc->extSubset->entities; + + fprintf(output, "Entities in external subset\n"); + xmlHashScan(table, (xmlHashScanner) xmlDebugDumpEntityCallback, + output); } else - fprintf(output, "No entities in external subset\n"); + fprintf(output, "No entities in external subset\n"); } static int xmlLsCountNode(xmlNodePtr node) { @@ -942,7 +1051,8 @@ static int xmlLsCountNode(xmlNodePtr node) { return(ret); } -void xmlLsOneNode(FILE *output, xmlNodePtr node) { +static void +xmlLsOneNode(FILE *output, xmlNodePtr node) { switch (node->type) { case XML_ELEMENT_NODE: fprintf(output, "-"); diff --git a/doc/Makefile.am b/doc/Makefile.am index 58d2a901..01c8f450 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -17,7 +17,7 @@ TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)/html # html_DATA = gnome-dev-info.html scan: - gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h" + gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h xmlwin32version.h win32config.h trio.h strio.h triop.h" templates: scan gtkdoc-mktmpl --module=libxml diff --git a/encoding.c b/encoding.c index aa73f778..f7c020c6 100644 --- a/encoding.c +++ b/encoding.c @@ -362,7 +362,6 @@ xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) { /** * xmlUTF8Strsub: * @utf: a sequence of UTF-8 encoded bytes - * * @start: relative pos of first char * @len: total number to copy * @@ -1768,8 +1767,8 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) { } /** - * xmlGetCharEncodingHandler: - * @enc: a string describing the char encoding. + * xmlFindCharEncodingHandler: + * @name: a string describing the char encoding. * * Search in the registrered set the handler able to read/write that encoding. * diff --git a/hash.c b/hash.c index e061c11b..ab01352c 100644 --- a/hash.c +++ b/hash.c @@ -304,7 +304,7 @@ xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, * * Find the userdata specified by the name. * - * Returns the a pointer to the userdata + * Returns the pointer to the userdata */ void * xmlHashLookup(xmlHashTablePtr table, const xmlChar *name) { @@ -319,7 +319,7 @@ xmlHashLookup(xmlHashTablePtr table, const xmlChar *name) { * * Find the userdata specified by the (name, name2) tuple. * - * Returns the a pointer to the userdata + * Returns the pointer to the userdata */ void * xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, @@ -470,7 +470,7 @@ xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, } /** - * xmlHashLookup: + * xmlHashLookup3: * @table: the hash table * @name: the name of the userdata * @name2: a second name of the userdata @@ -615,6 +615,8 @@ xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f) { * xmlHashSize: * @table: the hash table * + * Query the number of element installed in the hash table. + * * Returns the number of elements in the hash table or * -1 in case of error */ diff --git a/include/libxml/SAX.h b/include/libxml/SAX.h index aad01b88..4472f839 100644 --- a/include/libxml/SAX.h +++ b/include/libxml/SAX.h @@ -54,7 +54,7 @@ void entityDecl (void *ctx, xmlChar *content); void attributeDecl (void *ctx, const xmlChar *elem, - const xmlChar *name, + const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h index 16b0f67f..504b2e6c 100644 --- a/include/libxml/catalog.h +++ b/include/libxml/catalog.h @@ -36,7 +36,7 @@ extern "C" { #define XML_CATALOGS_NAMESPACE \ (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" -int xmlLoadCatalog (const char *URL); +int xmlLoadCatalog (const char *filename); void xmlLoadCatalogs (const char *paths); void xmlCatalogCleanup (void); void xmlCatalogDump (FILE *out); diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h index 6ed6ef91..36f86a42 100644 --- a/include/libxml/debugXML.h +++ b/include/libxml/debugXML.h @@ -43,11 +43,9 @@ void xmlDebugDumpDocumentHead(FILE *output, void xmlDebugDumpDocument (FILE *output, xmlDocPtr doc); void xmlDebugDumpDTD (FILE *output, - xmlDtdPtr doc); + xmlDtdPtr dtd); void xmlDebugDumpEntities (FILE *output, xmlDocPtr doc); -void xmlLsOneNode (FILE *output, - xmlNodePtr node); /**************************************************************** * * diff --git a/include/libxml/hash.h b/include/libxml/hash.h index dcbcc6cc..24476060 100644 --- a/include/libxml/hash.h +++ b/include/libxml/hash.h @@ -104,19 +104,10 @@ void * xmlHashLookup3 (xmlHashTablePtr table, */ xmlHashTablePtr xmlHashCopy (xmlHashTablePtr table, xmlHashCopier f); -int xmlHashSize (xmlHashTablePtr); +int xmlHashSize (xmlHashTablePtr table); void xmlHashScan (xmlHashTablePtr table, xmlHashScanner f, void *data); -void xmlHashScan1 (xmlHashTablePtr table, - const xmlChar *name, - xmlHashScanner f, - void *data); -void xmlHashScan2 (xmlHashTablePtr table, - const xmlChar *name, - const xmlChar *name2, - xmlHashScanner f, - void *data); void xmlHashScan3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, diff --git a/include/libxml/parser.h b/include/libxml/parser.h index f3ae597c..fdfb75fb 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -19,8 +19,10 @@ extern "C" { #endif -/* - * Constants. +/** + * XML_DEFAULT_VERSION: + * + * The default version of XML used: 1.0 */ #define XML_DEFAULT_VERSION "1.0" @@ -36,6 +38,7 @@ extern "C" { */ typedef void (* xmlParserInputDeallocate)(xmlChar *); + typedef struct _xmlParserInput xmlParserInput; typedef xmlParserInput *xmlParserInputPtr; struct _xmlParserInput { @@ -344,6 +347,11 @@ LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler; */ #ifdef VMS +/** + * xmlSubstituteEntitiesDefaultValue: + * + * global variable controlling the entity substitution default behaviour + */ LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultVal; #define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal #else diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h index 5370ac1c..81ecff72 100644 --- a/include/libxml/parserInternals.h +++ b/include/libxml/parserInternals.h @@ -326,12 +326,29 @@ void xmlParseMisc (xmlParserCtxtPtr ctxt); void xmlParseExternalSubset (xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID); -/* - * Entities substitution +/** + * XML_SUBSTITUTE_NONE: + * + * If no entities need to be substitued */ #define XML_SUBSTITUTE_NONE 0 +/** + * XML_SUBSTITUTE_REF: + * + * Whether general entities need to be substitued + */ #define XML_SUBSTITUTE_REF 1 +/** + * XML_SUBSTITUTE_PEREF: + * + * Whether parameter entities need to be substitued + */ #define XML_SUBSTITUTE_PEREF 2 +/** + * XML_SUBSTITUTE_BOTH: + * + * Both general and parameter entities need to be substitued + */ #define XML_SUBSTITUTE_BOTH 3 xmlChar * xmlDecodeEntities (xmlParserCtxtPtr ctxt, diff --git a/include/libxml/tree.h b/include/libxml/tree.h index b5f6302d..d72ebf7c 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -25,6 +25,12 @@ extern "C" { #endif +/** + * XML_XML_NAMESPACE: + * + * This is the namespace for the special xml: prefix predefined in the + * XML Namespace specification + */ #define XML_XML_NAMESPACE \ (const xmlChar *) "http://www.w3.org/XML/1998/namespace" @@ -249,6 +255,11 @@ struct _xmlElement { }; +/** + * XML_LOCAL_NAMESPACE: + * + * A namespace declaration node + */ #define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL typedef xmlElementType xmlNsType; @@ -259,7 +270,6 @@ typedef xmlElementType xmlNsType; * Note that prefix == NULL is valid, it defines the default namespace * within the subtree (until overriden). * - * XML_GLOBAL_NAMESPACE is now deprecated for good * xmlNsType is unified with xmlElementType */ @@ -405,8 +415,21 @@ struct _xmlNode { xmlNs *nsDef; /* namespace definitions on this node */ }; -#define XML_GET_CONTENT(n) ((n)->type == XML_ELEMENT_PTR ? NULL : (n)->content) -#define XML_GET_LINE(n) ((n)->type == XML_ELEMENT_PTR ? (int) (n)->content : 0) +/** + * XML_GET_CONTENT: + * + * macro to extract the content pointer of a node + */ +#define XML_GET_CONTENT(n) \ + ((n)->type == XML_ELEMENT_PTR ? NULL : (n)->content) + +/** + * XML_GET_LINE: + * + * macro to extract the line number of an element node + */ +#define XML_GET_LINE(n) \ + ((n)->type == XML_ELEMENT_PTR ? (int) (n)->content : 0) /** * xmlDoc: @@ -499,7 +522,6 @@ int xmlBufferGrow (xmlBufferPtr buf, unsigned int len); void xmlBufferEmpty (xmlBufferPtr buf); const xmlChar* xmlBufferContent (const xmlBufferPtr buf); -int xmlBufferUse (const xmlBufferPtr buf); void xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferAllocationScheme scheme); int xmlBufferLength (const xmlBufferPtr buf); @@ -709,7 +731,6 @@ void xmlNodeSetBase (xmlNodePtr cur, * Removing content. */ int xmlRemoveProp (xmlAttrPtr attr); -int xmlRemoveNode (xmlNodePtr node); /* TODO */ int xmlUnsetProp (xmlNodePtr node, const xmlChar *name); int xmlUnsetNsProp (xmlNodePtr node, diff --git a/include/libxml/uri.h b/include/libxml/uri.h index e4bbbe8a..972ef926 100644 --- a/include/libxml/uri.h +++ b/include/libxml/uri.h @@ -45,7 +45,7 @@ struct _xmlURI { xmlURIPtr xmlCreateURI (void); xmlChar * xmlBuildURI (const xmlChar *URI, const xmlChar *base); -xmlURIPtr xmlParseURI (const char *URI); +xmlURIPtr xmlParseURI (const char *str); int xmlParseURIReference (xmlURIPtr uri, const char *str); xmlChar * xmlSaveUri (xmlURIPtr uri); diff --git a/include/libxml/valid.h b/include/libxml/valid.h index 01d18737..5b29e8d2 100644 --- a/include/libxml/valid.h +++ b/include/libxml/valid.h @@ -160,7 +160,6 @@ xmlIDPtr xmlAddID (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -xmlIDTablePtr xmlCopyIDTable (xmlIDTablePtr table); void xmlFreeIDTable (xmlIDTablePtr table); xmlAttrPtr xmlGetID (xmlDocPtr doc, const xmlChar *ID); @@ -174,7 +173,6 @@ xmlRefPtr xmlAddRef (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -xmlRefTablePtr xmlCopyRefTable (xmlRefTablePtr table); void xmlFreeRefTable (xmlRefTablePtr table); int xmlIsRef (xmlDocPtr doc, xmlNodePtr elem, diff --git a/include/libxml/xlink.h b/include/libxml/xlink.h index 6d27166f..318ebcaf 100644 --- a/include/libxml/xlink.h +++ b/include/libxml/xlink.h @@ -60,9 +60,7 @@ typedef enum { * This is the prototype for the link detection routine * It calls the default link detection callbacks upon link detection. */ -typedef void -(*xlinkNodeDetectFunc) (void *ctx, - xmlNodePtr node); +typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); /** * The link detection module interract with the upper layers using diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h index e0cb81e1..b96b01a3 100644 --- a/include/libxml/xmlmemory.h +++ b/include/libxml/xmlmemory.h @@ -35,11 +35,16 @@ /** * DEBUG_MEMORY_LOCATION: * - * should be activated * DEBUG_MEMORY_LOCATION should be activated only when debugging * libxml i.e. if libxml has been configured with --with-debug-mem too */ #ifdef DEBUG_MEMORY_LOCATION + +/** + * MEM_LIST: + * + * keep track of all allocated blocks for error reporting + */ #define MEM_LIST /* keep a list of all the allocated memory blocks */ #endif @@ -90,9 +95,34 @@ void xmlMemoryDump (void); int xmlInitMemory (void); #ifdef DEBUG_MEMORY_LOCATION -#define xmlMalloc(x) xmlMallocLoc((x), __FILE__, __LINE__) -#define xmlRealloc(p, x) xmlReallocLoc((p), (x), __FILE__, __LINE__) -#define xmlMemStrdup(x) xmlMemStrdupLoc((x), __FILE__, __LINE__) +/** + * xmlMalloc: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library + * + * Returns the pointer to the allocated area or NULL in case of error + */ +#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__) +/** + * xmlRealloc: + * @ptr: pointer to the existing allocated area + * @size: number of bytes to allocate + * + * Wrapper for the realloc() function used in the XML library + * + * Returns the pointer to the allocated area or NULL in case of error + */ +#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) +/** + * xmlMemStrdup: + * @str: pointer to the existing string + * + * Wrapper for the strdup() function, xmlStrdup() is usually preferred + * + * Returns the pointer to the allocated area or NULL in case of error + */ +#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) void * xmlMallocLoc(size_t size, const char *file, int line); void * xmlReallocLoc(void *ptr,size_t size, const char *file, int line); diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index 7244d6fb..54bc1b61 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -20,9 +20,34 @@ extern "C" { #ifndef LIBXML2_COMPILING_MSCCDEF extern void xmlCheckVersion(int version); #endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ #define LIBXML_DOTTED_VERSION "@VERSION@" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 1002003 + */ #define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "1002003" + */ #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); /** @@ -32,8 +57,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_TRIO@ #define WITH_TRIO -#else -#define WITHOUT_TRIO #endif /** @@ -43,8 +66,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_FTP@ #define LIBXML_FTP_ENABLED -#else -#define LIBXML_FTP_DISABLED #endif /** @@ -54,8 +75,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_HTTP@ #define LIBXML_HTTP_ENABLED -#else -#define LIBXML_HTTP_DISABLED #endif /** @@ -65,8 +84,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_HTML@ #define LIBXML_HTML_ENABLED -#else -#define LIBXML_HTML_DISABLED #endif /** @@ -76,8 +93,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_CATALOG@ #define LIBXML_CATALOG_ENABLED -#else -#define LIBXML_CATALOG_DISABLED #endif /** @@ -87,8 +102,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_DOCB@ #define LIBXML_DOCB_ENABLED -#else -#define LIBXML_DOCB_DISABLED #endif /** @@ -98,8 +111,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_XPATH@ #define LIBXML_XPATH_ENABLED -#else -#define LIBXML_XPATH_DISABLED #endif /** @@ -109,8 +120,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_XPTR@ #define LIBXML_XPTR_ENABLED -#else -#define LIBXML_XPTR_DISABLED #endif /** @@ -120,8 +129,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_XINCLUDE@ #define LIBXML_XINCLUDE_ENABLED -#else -#define LIBXML_XINCLUDE_DISABLED #endif /** @@ -132,8 +139,6 @@ extern void xmlCheckVersion(int version); #if !defined(WIN32) || defined(__CYGWIN__) #if @WITH_ICONV@ #define LIBXML_ICONV_ENABLED -#else -#define LIBXML_ICONV_DISABLED #endif #endif @@ -144,8 +149,6 @@ extern void xmlCheckVersion(int version); */ #if @WITH_DEBUG@ #define LIBXML_DEBUG_ENABLED -#else -#define LIBXML_DEBUG_DISABLED #endif /** @@ -157,6 +160,11 @@ extern void xmlCheckVersion(int version); #define DEBUG_MEMORY_LOCATION #endif +/** + * LIBXML_DLL_IMPORT: + * + * Used on Windows to declare a variable as exported by the library + */ #ifndef LIBXML_DLL_IMPORT #if defined(WIN32) && !defined(STATIC) #define LIBXML_DLL_IMPORT __declspec(dllimport) diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h index 8724f1c5..a3c925a7 100644 --- a/include/libxml/xpath.h +++ b/include/libxml/xpath.h @@ -367,8 +367,6 @@ void xmlXPathFreeContext (xmlXPathContextPtr ctxt); */ xmlXPathObjectPtr xmlXPathEval (const xmlChar *str, xmlXPathContextPtr ctxt); -xmlXPathObjectPtr xmlXPathEvalXPtrExpr (const xmlChar *str, - xmlXPathContextPtr ctxt); xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar *str, xmlXPathContextPtr ctxt); int xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h index 1574e786..ca3943f4 100644 --- a/include/libxml/xpathInternals.h +++ b/include/libxml/xpathInternals.h @@ -64,6 +64,8 @@ extern "C" { * xmlXPathGetError: * @ctxt: an XPath parser context * + * Get the error code of an XPath context + * * Returns the context error */ #define xmlXPathGetError(ctxt) ((ctxt)->error) @@ -72,6 +74,8 @@ extern "C" { * xmlXPathCheckError: * @ctxt: an XPath parser context * + * Check if an XPath error was raised + * * Returns true if an error has been raised, false otherwise. */ #define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK) @@ -80,6 +84,8 @@ extern "C" { * xmlXPathGetDocument: * @ctxt: an XPath parser context * + * Get the document of an XPath context + * * Returns the context document */ #define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc) @@ -88,6 +94,8 @@ extern "C" { * xmlXPathGetContextNode: * @ctxt: an XPath parser context * + * Get the context node of an XPath context + * * Returns the context node */ #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) @@ -186,6 +194,9 @@ void * xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); * xmlXPathStackIsNodeSet: * @ctxt: an XPath parser context * + * Check if the current value on the XPath stack is a node set or + * an XSLT value tree + * * Returns true if the current object on the stack is a node-set */ #define xmlXPathStackIsNodeSet(ctxt) \ @@ -300,8 +311,7 @@ void * xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); /* * Variable Lookup forwarding */ -typedef xmlXPathObjectPtr - (*xmlXPathVariableLookupFunc) (void *ctxt, +typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, const xmlChar *name, const xmlChar *ns_uri); diff --git a/libxml.h b/libxml.h index 2954ccb1..c8f76763 100644 --- a/libxml.h +++ b/libxml.h @@ -19,6 +19,12 @@ #ifdef WITHOUT_TRIO #include #else +/** + * TRIO_REPLACE_STDIO: + * + * This macro is defined if teh trio string formatting functions are to + * be used instead of the default stdio ones. + */ #define TRIO_REPLACE_STDIO #include "trio.h" #endif diff --git a/list.c b/list.c index 0e05789c..b0acf7d8 100644 --- a/list.c +++ b/list.c @@ -226,7 +226,7 @@ xmlListSearch(xmlListPtr l, void *data) } /** - * xmlListLinkReverseSearch: + * xmlListReverseSearch: * @l: a list * @data: a search value * @@ -404,6 +404,8 @@ xmlListClear(xmlListPtr l) * xmlListEmpty: * @l: a list * + * Is the list empty ? + * * Returns 1 if the list is empty, 0 otherwise */ int @@ -416,6 +418,8 @@ xmlListEmpty(xmlListPtr l) * xmlListFront: * @l: a list * + * Get the first element in the list + * * Returns the first element in the list, or NULL */ xmlLinkPtr @@ -425,9 +429,11 @@ xmlListFront(xmlListPtr l) } /** - * xmlListFront: + * xmlListEnd: * @l: a list * + * Get the last element in the list + * * Returns the last element in the list, or NULL */ xmlLinkPtr @@ -440,6 +446,8 @@ xmlListEnd(xmlListPtr l) * xmlListSize: * @l: a list * + * Get the number of elements in the list + * * Returns the number of elements in the list */ int @@ -603,6 +611,7 @@ xmlListSort(xmlListPtr l) * xmlListWalk: * @l: a list * @walker: a processing function + * @user: a user parameter passed to the walker function * * Walk all the element of the first from first to last and * apply the walker function to it @@ -621,6 +630,7 @@ xmlListWalk(xmlListPtr l, xmlListWalker walker, const void *user) { * xmlListReverseWalk: * @l: a list * @walker: a processing function + * @user: a user parameter passed to the walker function * * Walk all the element of the list in reverse order and * apply the walker function to it diff --git a/nanoftp.c b/nanoftp.c index c6fb7d2d..c8ff2617 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -12,18 +12,11 @@ #define HAVE_NETINET_IN_H #define HAVE_NETDB_H #define HAVE_SYS_TIME_H -#include "libxml.h" -#ifdef WITHOUT_TRIO -#include -#else -#define TRIO_REPLACE_STDIO -#include "trio.h" -#endif #else /* STANDALONE */ #define NEED_SOCKETS -#include "libxml.h" #endif /* STANDALONE */ +#include "libxml.h" #ifdef LIBXML_FTP_ENABLED #include diff --git a/nanohttp.c b/nanohttp.c index 75e95b58..fb4fbd00 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -170,7 +170,7 @@ done: } /** - * xmlNanoHTTPClenup: + * xmlNanoHTTPCleanup: * * Cleanup the HTTP protocol layer. */ @@ -1177,6 +1177,8 @@ xmlNanoHTTPSave(void *ctxt, const char *filename) { * xmlNanoHTTPReturnCode: * @ctx: the HTTP context * + * Get the latest HTTP return code received + * * Returns the HTTP return code for the request. */ int @@ -1192,6 +1194,8 @@ xmlNanoHTTPReturnCode(void *ctx) { * xmlNanoHTTPAuthHeader: * @ctx: the HTTP context * + * Get the authentication header of an HTTP context + * * Returns the stashed value of the WWW-Authenticate or Proxy-Authenticate * header. */ diff --git a/parser.c b/parser.c index 4f8b07a2..108bd737 100644 --- a/parser.c +++ b/parser.c @@ -157,6 +157,51 @@ scope type name##Pop(xmlParserCtxtPtr ctxt) { \ return(ret); \ } \ +/** + * inputPop: + * @ctxt: an XML parser context + * + * Pops the top parser input from the input stack + * + * Returns the input just removed + */ +/** + * inputPush: + * @ctxt: an XML parser context + * @input: the parser input + * + * Pushes a new parser input on top of the input stack + */ +/** + * namePop: + * @ctxt: an XML parser context + * + * Pops the top element name from the name stack + * + * Returns the name just removed + */ +/** + * namePush: + * @ctxt: an XML parser context + * @name: the element name + * + * Pushes a new element name on top of the name stack + */ +/** + * nodePop: + * @ctxt: an XML parser context + * + * Pops the top element node from the node stack + * + * Returns the node just removed + */ +/** + * nodePush: + * @ctxt: an XML parser context + * @node: the element node + * + * Pushes a new element node on top of the node stack + */ /* * Those macros actually generate the functions */ @@ -4059,6 +4104,15 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) { return(ret); } +/** + * xmlParseElementChildrenContentD: + * @ctxt: an XML parser context + * + * VMS version of xmlParseElementChildrenContentDecl() + * + * Returns the tree of xmlElementContentPtr describing the element + * hierarchy. + */ /** * xmlParseElementChildrenContentDecl: * @ctxt: an XML parser context @@ -4086,7 +4140,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) { * be empty, and neither the first nor last non-blank character of * the replacement text should be a connector (| or ,). * - * returns: the tree of xmlElementContentPtr describing the element + * Returns the tree of xmlElementContentPtr describing the element * hierarchy. */ xmlElementContentPtr diff --git a/parserInternals.c b/parserInternals.c index 8a3abd35..022a994b 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -56,7 +56,7 @@ void xmlUpgradeOldNs(xmlDocPtr doc); ************************************************************************/ const char *xmlParserVersion = LIBXML_VERSION_STRING; -/* +/** * xmlCheckVersion: * @version: the include version number * @@ -128,7 +128,7 @@ static const char *xmlFeaturesList[] = { "SAX function externalSubset", }; -/* +/** * xmlGetFeaturesList: * @len: the length of the features name array (input/output) * @result: an array of string to be filled with the features name. @@ -155,7 +155,7 @@ xmlGetFeaturesList(int *len, const char **result) { return(ret); } -/* +/** * xmlGetFeature: * @ctxt: an XML/HTML parser context * @name: the feature name @@ -256,7 +256,7 @@ xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result) { return(0); } -/* +/** * xmlSetFeature: * @ctxt: an XML/HTML parser context * @name: the feature name @@ -2493,8 +2493,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, * * ************************************************************************/ -/* - * xmlCheckLanguageID +/** + * xmlCheckLanguageID: * @lang: pointer to the string value * * Checks that the value conforms to the LanguageID production: diff --git a/tree.c b/tree.c index 8b5cd1e6..e6d074e9 100644 --- a/tree.c +++ b/tree.c @@ -453,6 +453,8 @@ xmlFreeDtd(xmlDtdPtr cur) { * xmlNewDoc: * @version: xmlChar string giving the version of XML "1.0" * + * Creates a new XML document + * * Returns a new document */ xmlDocPtr @@ -4942,10 +4944,12 @@ xmlBufferDump(FILE *file, xmlBufferPtr buf) { * xmlBufferContent: * @buf: the buffer * + * Function to extract the content of a buffer + * * Returns the internal content */ -const xmlChar* +const xmlChar * xmlBufferContent(const xmlBufferPtr buf) { if(!buf) @@ -4958,6 +4962,8 @@ xmlBufferContent(const xmlBufferPtr buf) * xmlBufferLength: * @buf: the buffer * + * Function to get the length of a buffer + * * Returns the length of data in the internal content */ @@ -5162,6 +5168,15 @@ xmlBufferCCat(xmlBufferPtr buf, const char *str) { buf->content[buf->use] = 0; } +/** + * xmlBufferWriteXmlCHAR: + * @buf: the XML buffer + * @string: the string to add + * + * For VMS only. + * routine which manages and grows an output buffer. This one adds + * xmlChars at the end of the buffer. + */ /** * xmlBufferWriteCHAR: * @buf: the XML buffer @@ -6098,7 +6113,7 @@ xmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, ************************************************************************/ /** - * xmlDocDumpMemoryEnc: + * xmlDocDumpFormatMemoryEnc: * @out_doc: Document to generate XML text from * @doc_txt_ptr: Memory pointer for allocated XML text * @doc_txt_len: Length of the generated XML text diff --git a/xmlIO.c b/xmlIO.c index a7269c74..7c328c26 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -863,6 +863,15 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) { return(written); } +/** + * xmlParserInputBufferCreateFname: + * @URI: a C string containing the URI or filename + * @enc: the charset encoding if known + * + * VMS version of xmlParserInputBufferCreateFilename() + * + * Returns the new parser input or NULL + */ /** * xmlParserInputBufferCreateFilename: * @URI: a C string containing the URI or filename @@ -1547,7 +1556,7 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) { return(ret); } -/* +/** * xmlParserGetDirectory: * @filename: the path to a file * @@ -1596,7 +1605,7 @@ xmlParserGetDirectory(const char *filename) { * * ****************************************************************/ -/* +/** * xmlDefaultExternalEntityLoader: * @URL: the URL for the entity to load * @ID: the System ID for the entity to load @@ -1656,7 +1665,7 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID, static xmlExternalEntityLoader xmlCurrentExternalEntityLoader = xmlDefaultExternalEntityLoader; -/* +/** * xmlSetExternalEntityLoader: * @f: the new entity resolver function * @@ -1667,7 +1676,7 @@ xmlSetExternalEntityLoader(xmlExternalEntityLoader f) { xmlCurrentExternalEntityLoader = f; } -/* +/** * xmlGetExternalEntityLoader: * * Get the default external entity resolver function for the application @@ -1679,7 +1688,7 @@ xmlGetExternalEntityLoader(void) { return(xmlCurrentExternalEntityLoader); } -/* +/** * xmlLoadExternalEntity: * @URL: the URL for the entity to load * @ID: the System ID for the entity to load diff --git a/xpath.c b/xpath.c index b98ebac3..73143b20 100644 --- a/xpath.c +++ b/xpath.c @@ -877,6 +877,14 @@ finish: xmlXPathDebugDumpStepOp(output, comp, &comp->steps[op->ch2], depth + 1); } +/** + * xmlXPathDebugDumpCompExpr: + * @output: the FILE * for the output + * @comp: the precompiled XPath expression + * @depth: the indentation level. + * + * Dumps the tree of the compiled XPath expression. + */ void xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp, int depth) { @@ -939,6 +947,21 @@ extern type name##Pop(xmlXPathParserContextPtr ctxt) { \ return(ret); \ } \ +/** + * valuePop: + * @ctxt: an XPath evaluation context + * + * Pops the top XPath object from the value stack + * + * Returns the XPath object just removed + */ +/** + * valuePush: + * @ctxt: an XPath evaluation context + * @value: the XPath object + * + * Pushes a new XPath object on top of the value stack + */ PUSH_AND_POP(xmlXPathObjectPtr, value) /** @@ -1245,7 +1268,7 @@ const char *xmlXPathErrorMessages[] = { }; /** - * xmlXPathError: + * xmlXPatherror: * @ctxt: the XPath Parser context * @file: the file name * @line: the line number @@ -2540,7 +2563,7 @@ xmlXPathNsLookup(xmlXPathContextPtr ctxt, const xmlChar *prefix) { } /** - * xmlXPathRegisteredVariablesCleanup: + * xmlXPathRegisteredNsCleanup: * @ctxt: the XPath context * * Cleanup the XPath context data associated to registered variables @@ -3182,7 +3205,7 @@ xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns) { } /** - * xmlXpathCastToBoolean: + * xmlXPathCastToBoolean: * @val: an XPath object * * Converts an XPath object to its boolean value