summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-11-11 12:53:54 +0000
committerMike Hommey <mh@glandium.org>2004-11-11 12:53:54 +0000
commitf51dd67f3a3f472af0620391eb588eeca4533689 (patch)
tree9184c396c489196608427d5fa35814e86a1e479f
parent9705f1a5e858108d21a0128556f42b25d16833cd (diff)
downloadlibxml2-f51dd67f3a3f472af0620391eb588eeca4533689.tar.gz
Load /tmp/tmp.n9GTkp/libxml2-2.6.16 intoupstream/2.6.16
packages/libxml2/branches/upstream/current.
-rw-r--r--ChangeLog244
-rw-r--r--HTMLparser.c96
-rw-r--r--HTMLtree.c18
-rw-r--r--Makefile.am18
-rw-r--r--Makefile.in47
-rw-r--r--NEWS17
-rw-r--r--SAX2.c85
-rw-r--r--catalog.c38
-rwxr-xr-xchvalid.c2
-rw-r--r--config.h.in6
-rwxr-xr-xconfigure77
-rw-r--r--configure.in30
-rw-r--r--debugXML.c27
-rw-r--r--doc/APIchunk10.html6
-rw-r--r--doc/APIchunk11.html1
-rw-r--r--doc/APIchunk12.html2
-rw-r--r--doc/APIchunk13.html5
-rw-r--r--doc/APIchunk14.html3
-rw-r--r--doc/APIchunk15.html21
-rw-r--r--doc/APIchunk16.html1
-rw-r--r--doc/APIchunk21.html3
-rw-r--r--doc/APIchunk22.html2
-rw-r--r--doc/APIchunk25.html2
-rw-r--r--doc/APIchunk26.html4
-rw-r--r--doc/APIchunk3.html1
-rw-r--r--doc/APIchunk4.html3
-rw-r--r--doc/APIchunk5.html1
-rw-r--r--doc/APIchunk6.html4
-rw-r--r--doc/APIchunk8.html5
-rw-r--r--doc/APIchunk9.html4
-rw-r--r--doc/APIconstructors.html2
-rw-r--r--doc/APIfiles.html8
-rw-r--r--doc/APIsymbols.html6
-rwxr-xr-xdoc/apibuild.py1
-rw-r--r--doc/examples/examples.xml4
-rw-r--r--doc/examples/reader3.c4
-rw-r--r--doc/examples/testWriter.c4
-rw-r--r--doc/examples/tree1.c4
-rw-r--r--doc/html/libxml-list.html4
-rw-r--r--doc/html/libxml-nanoftp.html12
-rw-r--r--doc/html/libxml-relaxng.html5
-rw-r--r--doc/html/libxml-tree.html4
-rw-r--r--doc/html/libxml-valid.html6
-rw-r--r--doc/html/libxml-xmlIO.html2
-rw-r--r--doc/html/libxml-xmlerror.html1
-rw-r--r--doc/html/libxml-xmlmemory.html5
-rw-r--r--doc/html/libxml-xmlstring.html6
-rw-r--r--doc/html/libxml-xmlwriter.html4
-rw-r--r--doc/html/libxml-xpath.html1
-rw-r--r--doc/libxml2-api.xml71
-rw-r--r--doc/libxml2.xsa29
-rw-r--r--doc/news.html12
-rw-r--r--doc/xml.html16
-rw-r--r--doc/xmllint.12
-rw-r--r--doc/xmllint.xml3
-rw-r--r--elfgcchack.h38
-rw-r--r--encoding.c65
-rw-r--r--entities.c65
-rwxr-xr-xgentest.py889
-rw-r--r--include/libxml/catalog.h1
-rw-r--r--include/libxml/debugXML.h3
-rw-r--r--include/libxml/nanoftp.h6
-rw-r--r--include/libxml/relaxng.h8
-rw-r--r--include/libxml/valid.h17
-rw-r--r--include/libxml/xmlerror.h3
-rw-r--r--include/libxml/xmlmemory.h2
-rw-r--r--include/libxml/xmlstring.h2
-rw-r--r--include/libxml/xmlversion.h10
-rw-r--r--include/libxml/xpath.h3
-rw-r--r--include/libxml/xpathInternals.h3
-rw-r--r--libxml2.spec6
-rw-r--r--list.c83
-rw-r--r--nanoftp.c43
-rw-r--r--parser.c172
-rw-r--r--parserInternals.c205
-rwxr-xr-xpython/generator.py11
-rw-r--r--python/libxml.c139
-rw-r--r--python/libxml2-py.c429
-rw-r--r--python/libxml_wrap.h9
-rwxr-xr-xpython/setup.py2
-rw-r--r--python/tests/Makefile.am6
-rw-r--r--python/tests/Makefile.in6
-rwxr-xr-xpython/tests/dtdvalid.py32
-rw-r--r--python/tests/test.dtd1
-rw-r--r--python/types.c20
-rw-r--r--relaxng.c10
-rw-r--r--testThreads.c2
-rw-r--r--testapi.c48623
-rw-r--r--tree.c73
-rw-r--r--valid.c82
-rw-r--r--win32/libxml2.def.src4
-rw-r--r--xinclude.c9
-rw-r--r--xmlIO.c40
-rw-r--r--xmllint.c4
-rw-r--r--xmlmemory.c20
-rw-r--r--xmlreader.c15
-rw-r--r--xmlregexp.c2
-rw-r--r--xmlsave.c33
-rw-r--r--xmlschemas.c4
-rw-r--r--xmlschemastypes.c16
-rw-r--r--xmlstring.c22
-rw-r--r--xmlunicode.c2
-rw-r--r--xmlwriter.c208
-rw-r--r--xpath.c132
-rw-r--r--xpointer.c7
105 files changed, 51976 insertions, 600 deletions
diff --git a/ChangeLog b/ChangeLog
index c7d7dc7..acbcb90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,247 @@
+Wed Nov 10 15:35:25 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * NEWS configure.in doc/*: preparing release of libxml2-2.6.16
+
+Wed Nov 10 12:55:18 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * python/generator.py python/libxml.c python/libxml2class.txt
+ python/libxml_wrap.h python/types.c: Applied patch from Brent
+ Hendricks adding support for late DTD validation.
+ * python/tests/Makefile.am python/tests/dtdvalid.py
+ python/tests/test.dtd: integrated the provided regression test
+
+Tue nov 9 19:24:31 CET 2004 Dodji Seketeli <dodji@seketeli.org>
+
+ * configure.in: detect when struct sockaddr_storage
+ has the __ss_family member instead of ss_family and
+ behave accordingly. We now can use ipv6 on aix.
+
+Tue Nov 9 17:15:46 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am gentest.py testapi.c: integrated in "make tests"
+ added -q option, and more conditional features fixes
+ * catalog.c debugXML.c parser.c testThreads.c xmllint.c
+ xmlschemastypes.c xmlwriter.cinclude/libxml/catalog.h
+ include/libxml/debugXML.h: various compilation and conditional
+ cleanups.
+ * doc/*: regenerated
+
+Tue Nov 9 15:59:50 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: better handling of conditional features
+ * HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing
+ on parser contexts closed leaks, error messages
+
+Tue Nov 9 10:21:37 GMT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * xpath.c: fixed problem concerning XPath context corruption
+ during function argument evaluation (bug 157652)
+
+Mon Nov 8 18:54:52 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * testapi.c: more types.
+ * parserInternals.c xpath.c: more fixes
+
+Mon Nov 8 18:16:43 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: better parser options coverage
+ * SAX2.c xpath.c: more cleanups.
+
+Tue Nov 9 01:50:08 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * testapi.c: trying to fix some optional support brokenness
+
+Mon Nov 8 17:25:27 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more coverage
+ * debugXML.c parser.c xmlregexp.c xpath.c: more fixes
+
+Mon Nov 8 15:02:39 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more coverage
+ * SAX2.c parser.c parserInternals.c: more fixes
+
+Mon Nov 8 12:55:16 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c testapi.c xmlIO.c xmlstring.c: more fixes.
+
+Mon Nov 8 11:24:57 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more types, more coverage
+ * parser.c parserInternals.c relaxng.c valid.c xmlIO.c
+ xmlschemastypes.c: more problems fixed
+
+Mon Nov 8 10:24:28 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * gentest.py: fixed test file corruption problem
+
+Sun Nov 7 13:18:05 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: fixed typos and avoid Catalogs verbosity
+
+Sat Nov 6 23:25:16 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * testapi.c: augmented the number of types
+
+Sat Nov 6 20:24:07 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new
+ bug fixes and documentation updates.
+
+Sat Nov 6 15:50:11 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: augmented type autogeneration for enums
+ * xpath.c include/libxml/xpath.h: removed direct error reporting.
+
+Sat Nov 6 14:27:18 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * encoding.c: fixed a regression in iconv support.
+
+Fri Nov 5 18:19:23 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: autogenerate a minimal NULL value sequence
+ for unknown pointer types
+ * HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c
+ parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c
+ xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c
+ xpointer.c: This uncovered an impressive amount of entry points
+ not checking for NULL pointers when they ought to, closing all
+ the open gaps.
+
+Fri Nov 5 16:26:28 UTC 2004 William Brack <wbrack@mmm.com.hk>
+
+ * catalog.c: fixed problem with NULL entry (bug 157407)
+ * xpath.c: fixed a couple of warnings (no change to logic)
+
+Fri Nov 5 15:30:43 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more coverage
+ * xmlunicode.c: one fix
+
+Fri Nov 5 23:15:51 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * entities.c: fixed a compilation problem on a recent change
+
+Fri Nov 5 12:50:09 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more coverage
+ * nanoftp.c tree.c: more fixes
+
+Fri Nov 5 11:02:28 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: fixed the way the generator works,
+ extended the testing, especially with more real trees and nodes.
+ * HTMLtree.c tree.c valid.c xinclude.c xmlIO.c xmlsave.c: a bunch
+ of real problems found and fixed.
+ * entities.c: fix error reporting to go through the new handlers
+
+Thu Nov 4 18:44:56 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: dohh ... stupid change killing xmlParseDoc()
+
+Thu Nov 4 18:32:22 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: changing the way the .c is generated,
+ extending the tests coverage
+ * include/libxml/nanoftp.h nanoftp.c elfgcchack.h doc/*: fixing some
+ function signatures, regenerating stuff
+ * SAX2.c parser.c xmlIO.c: another set of bug fixes and API hardening
+
+Thu Nov 4 13:32:19 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: extending the tests coverage
+
+Thu Nov 4 11:52:28 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am: gentest.py was missing from the EXTRA_DIST
+
+Thu Nov 4 11:48:47 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: extending the tests coverage
+ * HTMLtree.c tree.c xmlsave.c xpointer.c: more fixes and cleanups
+
+Thu Nov 4 00:25:36 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more fixes and extending the tests coverage
+ * nanoftp.c xmlIO.c: more fixes and hardening
+
+Wed Nov 3 20:16:24 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more fixes and extending the tests coverage
+ * valid.c: bunch of cleanups and 2 leaks removed
+
+Wed Nov 3 18:06:44 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more fixes and extending the tests coverage
+ * list.c tree.c: more fixes and hardening
+
+Wed Nov 3 15:19:22 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more fixes and extending the tests coverage
+ * relaxng.c include/libxml/relaxng.h: adding a type init interface
+ * include/libxml/xmlerror.h parser.c xmlreader.c xmlwriter.c: more
+ cleanups and bug fixes raised by the regression tests
+
+Wed Nov 3 12:49:30 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more fixes and extending the tests coverage
+ * xmlwriter.c list.c: more hardeing of APIs
+ * doc/apibuild.py: skip testapi.c when scanning the C files.
+
+Tue Nov 2 23:09:06 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more testing and coverage
+ * elfgcchack.h xmlstring.c include/libxml/xmlstring.h: more cleanups
+ * doc/*: rebuilt
+
+Tue Nov 2 19:44:32 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * gentest.py testapi.c: more developments on the API testing
+ * HTMLparser.c tree.c: more cleanups
+ * doc/*: rebuilt
+
+Tue Nov 2 15:49:34 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * xmlmemory.c include/libxml/xmlmemory.h: adding xmlMemBlocks()
+ * Makefile.am gentest.py testapi.c: work on generator of an
+ automatic API regression test tool.
+ * SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c
+ xmlstring.c: various API hardeing changes as a result of running
+ teh first set of automatic API regression tests.
+ * test/slashdot16.xml: apparently missing from CVS, commited it
+
+Mon Nov 1 15:54:18 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * xpath.c: fixed an UTF-8 parsing bug reported by Markus Bertheau
+ on #fedora-devel
+
+Sun Oct 31 22:03:38 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fixed a bug reported by Petr Pajas on the list and
+ affecting XML::Libxml
+
+Sun Oct 31 16:33:54 CET 2004 Daniel Veillard <daniel@veillard.com>
+
+ * encoding.c doc/examples/testWriter.c: Fixed bug #153937, making
+ sure the conversion functions return the number of byte written.
+ Had to fix one of the examples.
+
+Fri Oct 29 14:16:56 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+ * doc/xmllint.1 doc/xmllint.xml: indicate - means stdin closing #156626
+
+Fri Oct 29 14:03:36 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+ * python/libxml.c: register xmlSchemaSetValidErrors, patch from
+ Brent Hendricks in the mailing-list
+ * include/libxml/valid.h HTMLparser.c SAX2.c valid.c
+ parserInternals.c: fix #156626 and more generally how to find out
+ if a validation contect is part of a parsing context or not. This
+ can probably be improved to make 100% sure that vctxt->userData
+ is the parser context too. It's a bit hairy because we can't
+ change the xmlValidCtxt structure without breaking the ABI since
+ this change xmlParserCtxt information indexes.
+
Wed Oct 27 19:26:20 CEST 2004 Daniel Veillard <daniel@veillard.com>
* ChangeLog NEWS configure.in doc/*: preparing release 2.6.15
diff --git a/HTMLparser.c b/HTMLparser.c
index 947e4aa..4f84d7c 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -109,13 +109,15 @@ htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
(ctxt->instate == XML_PARSER_EOF))
return;
- ctxt->errNo = error;
+ if (ctxt != NULL)
+ ctxt->errNo = error;
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_HTML, error,
XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2,
NULL, 0, 0,
msg, str1, str2);
- ctxt->wellFormed = 0;
+ if (ctxt != NULL)
+ ctxt->wellFormed = 0;
}
/**
@@ -134,11 +136,13 @@ htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
(ctxt->instate == XML_PARSER_EOF))
return;
- ctxt->errNo = error;
+ if (ctxt != NULL)
+ ctxt->errNo = error;
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_HTML, error,
XML_ERR_ERROR, NULL, 0, NULL, NULL,
NULL, val, 0, msg, val);
- ctxt->wellFormed = 0;
+ if (ctxt != NULL)
+ ctxt->wellFormed = 0;
}
/************************************************************************
@@ -394,13 +398,15 @@ encoding_error:
* to ISO-Latin-1 (if you don't like this policy, just declare the
* encoding !)
*/
- htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
- "Input is not proper UTF-8, indicate encoding !\n",
- NULL, NULL);
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
- ctxt->sax->error(ctxt->userData, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ {
+ char buffer[150];
+
+ snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
ctxt->input->cur[0], ctxt->input->cur[1],
ctxt->input->cur[2], ctxt->input->cur[3]);
+ htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
+ "Input is not proper UTF-8, indicate encoding !\n",
+ BAD_CAST buffer, NULL);
}
ctxt->charset = XML_CHAR_ENCODING_8859_1;
@@ -1788,6 +1794,7 @@ UTF8ToHtml(unsigned char* out, int *outlen,
unsigned int c, d;
int trailing;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
if (in == NULL) {
/*
* initialization nothing to do
@@ -1882,13 +1889,17 @@ int
htmlEncodeEntities(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen, int quoteChar) {
const unsigned char* processed = in;
- const unsigned char* outend = out + (*outlen);
+ const unsigned char* outend;
const unsigned char* outstart = out;
const unsigned char* instart = in;
- const unsigned char* inend = in + (*inlen);
+ const unsigned char* inend;
unsigned int c, d;
int trailing;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL))
+ return(-1);
+ outend = out + (*outlen);
+ inend = in + (*inlen);
while (in < inend) {
d = *in++;
if (d < 0x80) { c= d; trailing= 0; }
@@ -2417,7 +2428,9 @@ const htmlEntityDesc *
htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str) {
const xmlChar *name;
const htmlEntityDesc * ent = NULL;
- *str = NULL;
+
+ if (str != NULL) *str = NULL;
+ if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
if (CUR == '&') {
NEXT;
@@ -2428,7 +2441,8 @@ htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str) {
} else {
GROW;
if (CUR == ';') {
- *str = name;
+ if (str != NULL)
+ *str = name;
/*
* Lookup the entity in the table.
@@ -2440,7 +2454,8 @@ htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str) {
htmlParseErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING,
"htmlParseEntityRef: expecting ';'\n",
NULL, NULL);
- *str = name;
+ if (str != NULL)
+ *str = name;
}
}
}
@@ -3018,6 +3033,12 @@ int
htmlParseCharRef(htmlParserCtxtPtr ctxt) {
int val = 0;
+ if ((ctxt == NULL) || (ctxt->input == NULL)) {
+ htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "htmlParseCharRef: context error\n",
+ NULL, NULL);
+ return(0);
+ }
if ((CUR == '&') && (NXT(1) == '#') &&
((NXT(2) == 'x') || NXT(2) == 'X')) {
SKIP(3);
@@ -3341,6 +3362,11 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
int meta = 0;
int i;
+ if ((ctxt == NULL) || (ctxt->input == NULL)) {
+ htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "htmlParseStartTag: context error\n", NULL, NULL);
+ return;
+ }
if (CUR != '<') return;
NEXT;
@@ -3822,9 +3848,15 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
const htmlElemDesc * info;
htmlParserNodeInfo node_info;
const xmlChar *oldname;
- int depth = ctxt->nameNr;
+ int depth;
const xmlChar *oldptr;
+ if ((ctxt == NULL) || (ctxt->input == NULL)) {
+ htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "htmlParseStartTag: context error\n", NULL, NULL);
+ return;
+ }
+ depth = ctxt->nameNr;
/* Capture start position */
if (ctxt->record_info) {
node_info.begin_pos = ctxt->input->consumed +
@@ -3947,8 +3979,13 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
xmlInitParser();
htmlDefaultSAXHandlerInit();
- ctxt->html = 1;
+ if ((ctxt == NULL) || (ctxt->input == NULL)) {
+ htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "htmlParseDocument: context error\n", NULL, NULL);
+ return(XML_ERR_INTERNAL_ERROR);
+ }
+ ctxt->html = 1;
GROW;
/*
* SAX: beginning of the document processing.
@@ -4136,6 +4173,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
ctxt->replaceEntities = 0;
ctxt->linenumbers = xmlLineNumbersDefaultValue;
ctxt->html = 1;
+ ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
ctxt->vctxt.userData = ctxt;
ctxt->vctxt.error = xmlParserValidityError;
ctxt->vctxt.warning = xmlParserValidityWarning;
@@ -5131,6 +5169,11 @@ done:
int
htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
+ if ((ctxt == NULL) || (ctxt->input == NULL)) {
+ htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "htmlParseChunk: context error\n", NULL, NULL);
+ return(XML_ERR_INTERNAL_ERROR);
+ }
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
int base = ctxt->input->base - ctxt->input->buf->buffer->content;
@@ -5360,6 +5403,9 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
/* htmlCharEncoding enc; */
xmlChar *content, *content_line = (xmlChar *) "charset=";
+ if (filename == NULL)
+ return(NULL);
+
ctxt = htmlNewParserCtxt();
if (ctxt == NULL) {
return(NULL);
@@ -5615,7 +5661,12 @@ void
htmlCtxtReset(htmlParserCtxtPtr ctxt)
{
xmlParserInputPtr input;
- xmlDictPtr dict = ctxt->dict;
+ xmlDictPtr dict;
+
+ if (ctxt == NULL)
+ return;
+
+ dict = ctxt->dict;
while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
xmlFreeInputStream(input);
@@ -5624,8 +5675,12 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
ctxt->input = NULL;
ctxt->spaceNr = 0;
- ctxt->spaceTab[0] = -1;
- ctxt->space = &ctxt->spaceTab[0];
+ if (ctxt->spaceTab != NULL) {
+ ctxt->spaceTab[0] = -1;
+ ctxt->space = &ctxt->spaceTab[0];
+ } else {
+ ctxt->space = NULL;
+ }
ctxt->nodeNr = 0;
@@ -5695,6 +5750,9 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
int
htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
{
+ if (ctxt == NULL)
+ return(-1);
+
if (options & HTML_PARSE_NOWARNING) {
ctxt->sax->warning = NULL;
ctxt->vctxt.warning = NULL;
diff --git a/HTMLtree.c b/HTMLtree.c
index 9a5d35f..f3f2aae 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -522,6 +522,8 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
xmlInitParser();
+ if ((mem == NULL) || (size == NULL))
+ return;
if (cur == NULL) {
*mem = NULL;
*size = 0;
@@ -745,7 +747,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlInitParser();
- if (cur == NULL) {
+ if ((cur == NULL) || (buf == NULL)) {
return;
}
/*
@@ -753,7 +755,8 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
*/
if (cur->type == XML_DTD_NODE)
return;
- if (cur->type == XML_HTML_DOCUMENT_NODE) {
+ if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+ (cur->type == XML_DOCUMENT_NODE)){
htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
return;
}
@@ -944,6 +947,9 @@ htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
xmlInitParser();
+ if ((buf == NULL) || (cur == NULL))
+ return;
+
/*
* force to output the stuff as HTML, especially for entities
*/
@@ -997,7 +1003,7 @@ htmlDocDump(FILE *f, xmlDocPtr cur) {
xmlInitParser();
- if (cur == NULL) {
+ if ((cur == NULL) || (f == NULL)) {
return(-1);
}
@@ -1053,6 +1059,9 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) {
const char *encoding;
int ret;
+ if ((cur == NULL) || (filename == NULL))
+ return(-1);
+
xmlInitParser();
encoding = (const char *) htmlGetMetaEncoding(cur);
@@ -1113,6 +1122,9 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
xmlCharEncodingHandlerPtr handler = NULL;
int ret;
+ if ((cur == NULL) || (filename == NULL))
+ return(-1);
+
xmlInitParser();
if (encoding != NULL) {
diff --git a/Makefile.am b/Makefile.am
index 583e812..b186b45 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@ INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAG
noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
- testReader
+ testReader testapi
bin_PROGRAMS = xmllint xmlcatalog
@@ -113,6 +113,14 @@ testReader_LDFLAGS =
testReader_DEPENDENCIES = $(DEPS)
testReader_LDADD= $(LDADDS)
+testapi.c: gentest.py doc/libxml2-api.xml
+ -@(if [ "$(PYTHON)" != "" ] ; then $(PYTHON) gentest.py ; fi )
+
+testapi_SOURCES=testapi.c
+testapi_LDFLAGS =
+testapi_DEPENDENCIES = $(DEPS)
+testapi_LDADD= $(LDADDS)
+
#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
#testOOM_LDFLAGS =
#testOOM_DEPENDENCIES = $(DEPS)
@@ -122,7 +130,7 @@ check-local: all tests
testall : tests SVGtests SAXtests
-tests: XMLtests XMLenttests NStests IDtests Errtests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@
+tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@
@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
$(MAKE) MAKEFLAGS+=--silent tests ; fi)
@(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
@@ -132,6 +140,10 @@ valgrind:
@echo '## Go get a cup of coffee it is gonna take a while ...'
$(MAKE) CHECKER='valgrind -q' tests
+APItests: testapi$(EXEEXT)
+ @echo "## Running the API regression tests this may take a little while"
+ -@($(CHECKER) $(top_builddir)/testapi -q)
+
HTMLtests : testHTML$(EXEEXT)
@(echo > .memdump)
@echo "## HTML regression tests"
@@ -1008,7 +1020,7 @@ confexecdir=$(libdir)
confexec_DATA = xml2Conf.sh
CVS_EXTRA_DIST=
EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
- libxml.m4 Copyright check-xml-test-suite.py \
+ libxml.m4 Copyright check-xml-test-suite.py gentest.py \
check-relaxng-test-suite.py check-relaxng-test-suite2.py \
check-xsddata-test-suite.py check-xinclude-test-suite.py \
example/Makefile.am example/gjobread.c example/gjobs.xml \
diff --git a/Makefile.in b/Makefile.in
index 5481aa7..abb22ac 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -17,7 +17,7 @@
-SOURCES = $(libxml2_la_SOURCES) $(testAutomata_SOURCES) $(testC14N_SOURCES) $(testHTML_SOURCES) $(testReader_SOURCES) $(testRegexp_SOURCES) $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
+SOURCES = $(libxml2_la_SOURCES) $(testAutomata_SOURCES) $(testC14N_SOURCES) $(testHTML_SOURCES) $(testReader_SOURCES) $(testRegexp_SOURCES) $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) $(testapi_SOURCES) $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -43,7 +43,8 @@ host_triplet = @host@
noinst_PROGRAMS = testSchemas$(EXEEXT) testRelax$(EXEEXT) \
testSAX$(EXEEXT) testHTML$(EXEEXT) testXPath$(EXEEXT) \
testURI$(EXEEXT) testThreads$(EXEEXT) testC14N$(EXEEXT) \
- testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT)
+ testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT) \
+ testapi$(EXEEXT)
bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
@@ -133,6 +134,8 @@ am_testURI_OBJECTS = testURI.$(OBJEXT)
testURI_OBJECTS = $(am_testURI_OBJECTS)
am_testXPath_OBJECTS = testXPath.$(OBJEXT)
testXPath_OBJECTS = $(am_testXPath_OBJECTS)
+am_testapi_OBJECTS = testapi.$(OBJEXT)
+testapi_OBJECTS = $(am_testapi_OBJECTS)
am_xmlcatalog_OBJECTS = xmlcatalog.$(OBJEXT)
xmlcatalog_OBJECTS = $(am_xmlcatalog_OBJECTS)
am_xmllint_OBJECTS = xmllint.$(OBJEXT)
@@ -162,12 +165,13 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/testSAX.Po ./$(DEPDIR)/testSchemas.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/testThreads@THREADS_W32@.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/testURI.Po ./$(DEPDIR)/testXPath.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/threads.Plo ./$(DEPDIR)/tree.Plo \
-@AMDEP_TRUE@ ./$(DEPDIR)/trio.Plo ./$(DEPDIR)/triostr.Plo \
-@AMDEP_TRUE@ ./$(DEPDIR)/uri.Plo ./$(DEPDIR)/valid.Plo \
-@AMDEP_TRUE@ ./$(DEPDIR)/xinclude.Plo ./$(DEPDIR)/xlink.Plo \
-@AMDEP_TRUE@ ./$(DEPDIR)/xmlIO.Plo ./$(DEPDIR)/xmlcatalog.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/xmllint.Po ./$(DEPDIR)/xmlmemory.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/testapi.Po ./$(DEPDIR)/threads.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/tree.Plo ./$(DEPDIR)/trio.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/triostr.Plo ./$(DEPDIR)/uri.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/valid.Plo ./$(DEPDIR)/xinclude.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/xlink.Plo ./$(DEPDIR)/xmlIO.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/xmlcatalog.Po ./$(DEPDIR)/xmllint.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/xmlmemory.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/xmlreader.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/xmlregexp.Plo ./$(DEPDIR)/xmlsave.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/xmlschemas.Plo \
@@ -188,14 +192,14 @@ SOURCES = $(libxml2_la_SOURCES) $(testAutomata_SOURCES) \
$(testC14N_SOURCES) $(testHTML_SOURCES) $(testReader_SOURCES) \
$(testRegexp_SOURCES) $(testRelax_SOURCES) $(testSAX_SOURCES) \
$(testSchemas_SOURCES) $(testThreads_SOURCES) \
- $(testURI_SOURCES) $(testXPath_SOURCES) $(xmlcatalog_SOURCES) \
- $(xmllint_SOURCES)
+ $(testURI_SOURCES) $(testXPath_SOURCES) $(testapi_SOURCES) \
+ $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
DIST_SOURCES = $(am__libxml2_la_SOURCES_DIST) $(testAutomata_SOURCES) \
$(testC14N_SOURCES) $(testHTML_SOURCES) $(testReader_SOURCES) \
$(testRegexp_SOURCES) $(testRelax_SOURCES) $(testSAX_SOURCES) \
$(testSchemas_SOURCES) $(testThreads_SOURCES) \
- $(testURI_SOURCES) $(testXPath_SOURCES) $(xmlcatalog_SOURCES) \
- $(xmllint_SOURCES)
+ $(testURI_SOURCES) $(testXPath_SOURCES) $(testapi_SOURCES) \
+ $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
@@ -506,12 +510,16 @@ testReader_SOURCES = testReader.c
testReader_LDFLAGS =
testReader_DEPENDENCIES = $(DEPS)
testReader_LDADD = $(LDADDS)
+testapi_SOURCES = testapi.c
+testapi_LDFLAGS =
+testapi_DEPENDENCIES = $(DEPS)
+testapi_LDADD = $(LDADDS)
CLEANFILES = xml2Conf.sh
confexecdir = $(libdir)
confexec_DATA = xml2Conf.sh
CVS_EXTRA_DIST =
EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
- libxml.m4 Copyright check-xml-test-suite.py \
+ libxml.m4 Copyright check-xml-test-suite.py gentest.py \
check-relaxng-test-suite.py check-relaxng-test-suite2.py \
check-xsddata-test-suite.py check-xinclude-test-suite.py \
example/Makefile.am example/gjobread.c example/gjobs.xml \
@@ -691,6 +699,9 @@ testURI$(EXEEXT): $(testURI_OBJECTS) $(testURI_DEPENDENCIES)
testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES)
@rm -f testXPath$(EXEEXT)
$(LINK) $(testXPath_LDFLAGS) $(testXPath_OBJECTS) $(testXPath_LDADD) $(LIBS)
+testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES)
+ @rm -f testapi$(EXEEXT)
+ $(LINK) $(testapi_LDFLAGS) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS)
xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES)
@rm -f xmlcatalog$(EXEEXT)
$(LINK) $(xmlcatalog_LDFLAGS) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS)
@@ -757,6 +768,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreads@THREADS_W32@.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testURI.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testXPath.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testapi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trio.Plo@am__quote@
@@ -1337,6 +1349,9 @@ uninstall-man: uninstall-man1 uninstall-man3
uninstall-man1 uninstall-man3 uninstall-pkgconfigDATA
+testapi.c: gentest.py doc/libxml2-api.xml
+ -@(if [ "$(PYTHON)" != "" ] ; then $(PYTHON) gentest.py ; fi )
+
#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
#testOOM_LDFLAGS =
#testOOM_DEPENDENCIES = $(DEPS)
@@ -1346,7 +1361,7 @@ check-local: all tests
testall : tests SVGtests SAXtests
-tests: XMLtests XMLenttests NStests IDtests Errtests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@
+tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TEST_SAX@ @TEST_PUSH@ @TEST_HTML@ @TEST_PHTML@ @TEST_VALID@ URItests @TEST_XPATH@ @TEST_XPTR@ @TEST_XINCLUDE@ @TEST_C14N@ @TEST_DEBUG@ @TEST_CATALOG@ @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@ Timingtests @TEST_VTIME@ @PYTHON_TESTS@
@(if [ "@PYTHON_SUBDIR@" != "" ] ; then cd python ; \
$(MAKE) MAKEFLAGS+=--silent tests ; fi)
@(cd doc/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
@@ -1356,6 +1371,10 @@ valgrind:
@echo '## Go get a cup of coffee it is gonna take a while ...'
$(MAKE) CHECKER='valgrind -q' tests
+APItests: testapi$(EXEEXT)
+ @echo "## Running the API regression tests this may take a little while"
+ -@($(CHECKER) $(top_builddir)/testapi -q)
+
HTMLtests : testHTML$(EXEEXT)
@(echo > .memdump)
@echo "## HTML regression tests"
diff --git a/NEWS b/NEWS
index 585a53f..e9f1c1a 100644
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,22 @@ ChangeLog.html
describes the recents commits
to the CVS at
http://cvs.gnome.org/viewcvs/libxml2/
- code base.There is the list of public releases:2.6.15: Oct 27 2004 - security fixes on the nanoftp and nanohttp modules
+ code base.There is the list of public releases:
+2.6.16: Nov 10 2004:
+ - general hardening and bug fixing crossing all the API based on new
+ automated regression testing
+ - build fix: IPv6 build and test on AIX (Dodji Seketeli)
+ - bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
+ conversion functions return values, UTF-8 bug affecting XPath reported by
+ Markus Bertheau, catalog problem with NULL entries (William Brack)
+ - documentation: fix to xmllint man page, some API function descritpion
+ were updated.
+ - improvements: DTD validation APIs provided at the Python level (Brent
+ Hendricks)
+
+
+2.6.15: Oct 27 2004:
+ - security fixes on the nanoftp and nanohttp modules
- build fixes: xmllint detection bug in configure, building outside the
source tree (Thomas Fitzsimmons)
- bug fixes: HTML parser on broken ASCII chars in names (William), Python
diff --git a/SAX2.c b/SAX2.c
index cda9ac5..cf8a615 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -51,11 +51,13 @@
*/
static void
xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "%s: out of memory\n", msg);
- ctxt->errNo = XML_ERR_NO_MEMORY;
- ctxt->instate = XML_PARSER_EOF;
- ctxt->disableSAX = 1;
+ if (ctxt != NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "%s: out of memory\n", msg);
+ ctxt->errNo = XML_ERR_NO_MEMORY;
+ ctxt->instate = XML_PARSER_EOF;
+ ctxt->disableSAX = 1;
+ }
}
/**
@@ -77,16 +79,19 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
(ctxt->instate == XML_PARSER_EOF))
return;
- ctxt->errNo = error;
- if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
- schannel = ctxt->sax->serror;
+ if (ctxt != NULL) {
+ ctxt->errNo = error;
+ if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
+ schannel = ctxt->sax->serror;
+ }
__xmlRaiseError(schannel,
ctxt->vctxt.error, ctxt->vctxt.userData,
ctxt, NULL, XML_FROM_DTD, error,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
(const char *) str2, NULL, 0, 0,
msg, (const char *) str1, (const char *) str2);
- ctxt->valid = 0;
+ if (ctxt != NULL)
+ ctxt->valid = 0;
}
/**
@@ -117,6 +122,7 @@ const xmlChar *
xmlSAX2GetSystemId(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
return((const xmlChar *) ctxt->input->filename);
}
@@ -132,6 +138,7 @@ int
xmlSAX2GetLineNumber(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
return(ctxt->input->line);
}
@@ -147,6 +154,7 @@ int
xmlSAX2GetColumnNumber(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctx == NULL) || (ctxt->input == NULL)) return(0);
return(ctxt->input->col);
}
@@ -162,6 +170,7 @@ int
xmlSAX2IsStandalone(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctx == NULL) || (ctxt->myDoc == NULL)) return(0);
return(ctxt->myDoc->standalone == 1);
}
@@ -177,6 +186,7 @@ int
xmlSAX2HasInternalSubset(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
return(ctxt->myDoc->intSubset != NULL);
}
@@ -192,6 +202,7 @@ int
xmlSAX2HasExternalSubset(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if ((ctxt == NULL) || (ctxt->myDoc == NULL)) return(0);
return(ctxt->myDoc->extSubset != NULL);
}
@@ -210,6 +221,7 @@ xmlSAX2InternalSubset(void *ctx, const xmlChar *name,
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlDtdPtr dtd;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2InternalSubset(%s, %s, %s)\n",
@@ -246,6 +258,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2ExternalSubset(%s, %s, %s)\n",
@@ -366,6 +379,7 @@ xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId
xmlChar *URI;
const char *base = NULL;
+ if (ctx == NULL) return(NULL);
if (ctxt->input != NULL)
base = ctxt->input->filename;
if (base == NULL)
@@ -400,6 +414,7 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlEntityPtr ret = NULL;
+ if (ctx == NULL) return(NULL);
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2GetEntity(%s)\n", name);
@@ -479,6 +494,7 @@ xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlEntityPtr ret;
+ if (ctx == NULL) return(NULL);
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2GetParameterEntity(%s)\n", name);
@@ -507,6 +523,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type,
xmlEntityPtr ent;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2EntityDecl(%s, %d, %s, %s, %s)\n",
@@ -578,6 +595,7 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
xmlAttributePtr attr;
xmlChar *name = NULL, *prefix = NULL;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2AttributeDecl(%s, %s, %d, %d, %s, ...)\n",
@@ -641,6 +659,7 @@ xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type,
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlElementPtr elem = NULL;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2ElementDecl(%s, %d, ...)\n", name, type);
@@ -685,6 +704,7 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name,
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNotationPtr nota = NULL;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2NotationDecl(%s, %s, %s)\n", name, publicId, systemId);
@@ -735,6 +755,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name,
{
xmlEntityPtr ent;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2UnparsedEntityDecl(%s, %s, %s, %s)\n",
@@ -817,6 +838,8 @@ xmlSAX2StartDocument(void *ctx)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlDocPtr doc;
+ if (ctx == NULL) return;
+
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2StartDocument()\n");
@@ -876,6 +899,7 @@ xmlSAX2EndDocument(void *ctx)
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2EndDocument()\n");
#endif
+ if (ctx == NULL) return;
#ifdef LIBXML_VALID_ENABLED
if (ctxt->validate && ctxt->wellFormed &&
ctxt->myDoc && ctxt->myDoc->intSubset)
@@ -890,7 +914,9 @@ xmlSAX2EndDocument(void *ctx)
ctxt->myDoc->encoding = ctxt->encoding;
ctxt->encoding = NULL;
}
- if ((ctxt->inputTab[0]->encoding != NULL) && (ctxt->myDoc != NULL) &&
+ if ((ctxt->inputTab != NULL) &&
+ (ctxt->inputNr > 0) && (ctxt->inputTab[0] != NULL) &&
+ (ctxt->inputTab[0]->encoding != NULL) && (ctxt->myDoc != NULL) &&
(ctxt->myDoc->encoding == NULL)) {
ctxt->myDoc->encoding = xmlStrdup(ctxt->inputTab[0]->encoding);
}
@@ -1387,7 +1413,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
- xmlNodePtr parent = ctxt->node;
+ xmlNodePtr parent;
xmlNsPtr ns;
xmlChar *name;
xmlChar *prefix;
@@ -1395,6 +1421,8 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
const xmlChar *value;
int i;
+ if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
+ parent = ctxt->node;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2StartElement(%s)\n", fullname);
@@ -1562,7 +1590,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
* If it's the Document root, finish the DTD validation and
* check the document root element for validity
*/
- if ((ctxt->validate) && (ctxt->vctxt.finishDtd == 0)) {
+ if ((ctxt->validate) && (ctxt->vctxt.finishDtd == XML_CTXT_FINISH_DTD_0)) {
int chk;
chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
@@ -1571,7 +1599,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
if (chk < 0)
ctxt->wellFormed = 0;
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
- ctxt->vctxt.finishDtd = 1;
+ ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_1;
}
#endif /* LIBXML_VALID_ENABLED */
@@ -1592,8 +1620,10 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserNodeInfo node_info;
- xmlNodePtr cur = ctxt->node;
+ xmlNodePtr cur;
+ if (ctx == NULL) return;
+ cur = ctxt->node;
#ifdef DEBUG_SAX
if (name == NULL)
xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2EndElement(NULL)\n");
@@ -1983,11 +2013,13 @@ xmlSAX2StartElementNs(void *ctx,
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
- xmlNodePtr parent = ctxt->node;
+ xmlNodePtr parent;
xmlNsPtr last = NULL, ns;
const xmlChar *uri, *pref;
int i, j;
+ if (ctx == NULL) return;
+ parent = ctxt->node;
/*
* First check on validity:
*/
@@ -2132,7 +2164,7 @@ xmlSAX2StartElementNs(void *ctx,
* If it's the Document root, finish the DTD validation and
* check the document root element for validity
*/
- if ((ctxt->validate) && (ctxt->vctxt.finishDtd == 0)) {
+ if ((ctxt->validate) && (ctxt->vctxt.finishDtd == XML_CTXT_FINISH_DTD_0)) {
int chk;
chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
@@ -2141,7 +2173,7 @@ xmlSAX2StartElementNs(void *ctx,
if (chk < 0)
ctxt->wellFormed = 0;
ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
- ctxt->vctxt.finishDtd = 1;
+ ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_1;
}
#endif /* LIBXML_VALID_ENABLED */
}
@@ -2164,8 +2196,10 @@ xmlSAX2EndElementNs(void *ctx,
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserNodeInfo node_info;
- xmlNodePtr cur = ctxt->node;
+ xmlNodePtr cur;
+ if (ctx == NULL) return;
+ cur = ctxt->node;
/* Capture end position and add node */
if ((ctxt->record_info) && (cur != NULL)) {
node_info.end_pos = ctxt->input->cur - ctxt->input->base;
@@ -2200,6 +2234,7 @@ xmlSAX2Reference(void *ctx, const xmlChar *name)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2Reference(%s)\n", name);
@@ -2229,6 +2264,7 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr lastChild;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2Characters(%.30s, %d)\n", ch, len);
@@ -2357,8 +2393,10 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
- xmlNodePtr parent = ctxt->node;
+ xmlNodePtr parent;
+ if (ctx == NULL) return;
+ parent = ctxt->node;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2ProcessingInstruction(%s, %s)\n", target, data);
@@ -2411,8 +2449,10 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
- xmlNodePtr parent = ctxt->node;
+ xmlNodePtr parent;
+ if (ctx == NULL) return;
+ parent = ctxt->node;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2Comment(%s)\n", value);
#endif
@@ -2464,6 +2504,7 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret, lastChild;
+ if (ctx == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.pcdata(%.10s, %d)\n", value, len);
@@ -2610,7 +2651,7 @@ xmlDefaultSAXHandlerInit(void)
void
xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr)
{
- if(hdlr->initialized != 0)
+ if ((hdlr == NULL) || (hdlr->initialized != 0))
return;
hdlr->internalSubset = xmlSAX2InternalSubset;
@@ -2668,7 +2709,7 @@ htmlDefaultSAXHandlerInit(void)
void
xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr)
{
- if(hdlr->initialized != 0)
+ if ((hdlr == NULL) || (hdlr->initialized != 0))
return;
hdlr->internalSubset = xmlSAX2InternalSubset;
diff --git a/catalog.c b/catalog.c
index 93356cd..3168efd 100644
--- a/catalog.c
+++ b/catalog.c
@@ -878,9 +878,11 @@ xmlParseCatalogFile(const char *filename) {
ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
+#ifdef LIBXML_SAX1_ENABLED
if (xmlDefaultSAXHandler.error != NULL) {
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
}
+#endif
return(NULL);
}
@@ -1262,25 +1264,27 @@ xmlParseXMLCatalogNode(xmlNodePtr cur, xmlCatalogPrefer prefer,
BAD_CAST "nextCatalog", NULL,
BAD_CAST "catalog", prefer, cgroup);
}
- if ((entry != NULL) && (parent != NULL)) {
- entry->parent = parent;
- if (parent->children == NULL)
- parent->children = entry;
- else {
- xmlCatalogEntryPtr prev;
+ if (entry != NULL) {
+ if (parent != NULL) {
+ entry->parent = parent;
+ if (parent->children == NULL)
+ parent->children = entry;
+ else {
+ xmlCatalogEntryPtr prev;
- prev = parent->children;
- while (prev->next != NULL)
- prev = prev->next;
- prev->next = entry;
+ prev = parent->children;
+ while (prev->next != NULL)
+ prev = prev->next;
+ prev->next = entry;
+ }
+ }
+ if (entry->type == XML_CATA_GROUP) {
+ /*
+ * Recurse to propagate prefer to the subtree
+ * (xml:base handling is automated)
+ */
+ xmlParseXMLCatalogNodeList(cur->children, prefer, parent, entry);
}
- }
- if (entry->type == XML_CATA_GROUP) {
- /*
- * Recurse to propagate prefer to the subtree
- * (xml:base handling is automated)
- */
- xmlParseXMLCatalogNodeList(cur->children, prefer, parent, entry);
}
if (base != NULL)
xmlFree(base);
diff --git a/chvalid.c b/chvalid.c
index d47bc6a..9a2c407 100755
--- a/chvalid.c
+++ b/chvalid.c
@@ -166,6 +166,8 @@ xmlCharInRange (unsigned int val, const xmlChRangeGroupPtr rptr) {
int low, high, mid;
xmlChSRangePtr sptr;
xmlChLRangePtr lptr;
+
+ if (rptr == NULL) return(0);
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
if (rptr->nbShortRange == 0)
return 0;
diff --git a/config.h.in b/config.h.in
index 8a65287..590e0ce 100644
--- a/config.h.in
+++ b/config.h.in
@@ -25,6 +25,9 @@
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
+/* Whether struct sockaddr::__ss_family exists */
+#undef HAVE_BROKEN_SS_FAMILY
+
/* Define to 1 if you have the `class' function. */
#undef HAVE_CLASS
@@ -279,5 +282,8 @@
/* Win32 Std C name mangling work-around */
#undef snprintf
+/* ss_family is not defined here, use __ss_family instead */
+#undef ss_family
+
/* Win32 Std C name mangling work-around */
#undef vsnprintf
diff --git a/configure b/configure
index 568dd22..3742f20 100755
--- a/configure
+++ b/configure
@@ -1616,7 +1616,7 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=15
+LIBXML_MICRO_VERSION=16
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -25855,6 +25855,75 @@ cat >>confdefs.h <<\_ACEOF
#define SUPPORT_IP6
_ACEOF
+ have_broken_ss_family=no
+
+ echo "$as_me:$LINENO: checking broken struct sockaddr::ss_family" >&5
+echo $ECHO_N "checking broken struct sockaddr::ss_family... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <sys/socket.h>
+ #include <sys/types.h>
+int
+main ()
+{
+
+ struct sockaddr_storage ss ;
+ ss.__ss_family = 0 ;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ have_broken_ss_family=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+have_broken_ss_family=no
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $have_broken_ss_family" >&5
+echo "${ECHO_T}$have_broken_ss_family" >&6
+ if test x$have_broken_ss_family = xyes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BROKEN_SS_FAMILY
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define ss_family __ss_family
+_ACEOF
+
+ fi
have_getaddrinfo=no
echo "$as_me:$LINENO: checking for getaddrinfo" >&5
@@ -26418,7 +26487,7 @@ else
CFLAGS="${CFLAGS} -fexceptions"
fi
- CFLAGS="${CFLAGS} -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
+ CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
@@ -26600,7 +26669,9 @@ if [ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ] || \
with_docbook="yes"
fi
fi
- CFLAGS="-g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
+ if test "${CC}" = "gcc" ; then
+ CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
+ fi
STATIC_BINARIES="-static"
else
STATIC_BINARIES=
diff --git a/configure.in b/configure.in
index 64a6c0e..026e9b1 100644
--- a/configure.in
+++ b/configure.in
@@ -5,7 +5,7 @@ AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=15
+LIBXML_MICRO_VERSION=16
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -243,6 +243,28 @@ if test $enable_ipv6 = yes; then
if test $have_ipv6 = yes; then
AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
+ have_broken_ss_family=no
+
+ dnl *********************************************************************
+ dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
+ dnl a ss_family member, but rather __ss_family. Let's detect that
+ dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these platforms.
+ dnl ********************************************************************
+ AC_MSG_CHECKING([broken struct sockaddr::ss_family])
+ AC_TRY_COMPILE([
+ #include <sys/socket.h>
+ #include <sys/types.h>], [
+ struct sockaddr_storage ss ;
+ ss.__ss_family = 0 ;
+ ],
+ have_broken_ss_family=yes,
+ have_broken_ss_family=no
+ )
+ AC_MSG_RESULT($have_broken_ss_family)
+ if test x$have_broken_ss_family = xyes ; then
+ AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], [Whether struct sockaddr::__ss_family exists])
+ AC_DEFINE(ss_family, __ss_family, [ss_family is not defined here, use __ss_family instead])
+ fi
have_getaddrinfo=no
AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
@@ -309,7 +331,7 @@ else
CFLAGS="${CFLAGS} -fexceptions"
fi
- CFLAGS="${CFLAGS} -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
+ CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
@@ -446,7 +468,9 @@ if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
with_docbook="yes"
fi
fi
- CFLAGS="-g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
+ if test "${CC}" = "gcc" ; then
+ CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
+ fi
STATIC_BINARIES="-static"
dnl -Wcast-qual -ansi
else
diff --git a/debugXML.c b/debugXML.c
index 94be70d..1b8fd70 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -1151,6 +1151,7 @@ xmlCtxtDumpDocHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
static void
xmlCtxtDumpDocumentHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
{
+ if (doc == NULL) return;
xmlCtxtDumpDocHead(ctxt, doc);
if (!ctxt->check) {
if (doc->name != NULL) {
@@ -1258,6 +1259,7 @@ xmlCtxtDumpEntityCallback(xmlEntityPtr cur, xmlDebugCtxtPtr ctxt)
static void
xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc)
{
+ if (doc == NULL) return;
xmlCtxtDumpDocHead(ctxt, doc);
if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
@@ -1354,6 +1356,7 @@ void
xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) {
xmlDebugCtxt ctxt;
+ if (output == NULL) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
ctxt.depth = depth;
@@ -1374,6 +1377,7 @@ xmlDebugDumpEntities(FILE * output, xmlDocPtr doc)
{
xmlDebugCtxt ctxt;
+ if (output == NULL) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
xmlCtxtDumpEntities(&ctxt, doc);
@@ -1393,6 +1397,7 @@ xmlDebugDumpAttrList(FILE * output, xmlAttrPtr attr, int depth)
{
xmlDebugCtxt ctxt;
+ if (output == NULL) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
ctxt.depth = depth;
@@ -1413,6 +1418,7 @@ xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth)
{
xmlDebugCtxt ctxt;
+ if (output == NULL) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
ctxt.depth = depth;
@@ -1628,6 +1634,7 @@ xmlLsCountNode(xmlNodePtr node) {
*/
void
xmlLsOneNode(FILE *output, xmlNodePtr node) {
+ if (output == NULL) return;
if (node == NULL) {
fprintf(output, "NULL\n");
return;
@@ -1765,6 +1772,7 @@ xmlBoolToText(int boolval)
return("False");
}
+#ifdef LIBXML_XPATH_ENABLED
/****************************************************************
* *
* The XML shell related functions *
@@ -1834,9 +1842,11 @@ xmlShellPrintXPathError(int errorType, const char *arg)
"%s is an XSLT value tree\n", arg);
break;
}
+#if 0
xmlGenericError(xmlGenericErrorContext,
"Try casting the result string function (xpath builtin)\n",
arg);
+#endif
}
@@ -2391,6 +2401,7 @@ xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename,
xmlDocPtr doc;
int html = 0;
+ if ((ctxt == NULL) || (filename == NULL)) return(-1);
if (ctxt->doc != NULL)
html = (ctxt->doc->type == XML_HTML_DOCUMENT_NODE);
@@ -2445,8 +2456,6 @@ xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
if (node == NULL)
return (-1);
if ((filename == NULL) || (filename[0] == 0)) {
- xmlGenericError(xmlGenericErrorContext,
- "Write command requires a filename argument\n");
return (-1);
}
#ifdef W_OK
@@ -2512,10 +2521,12 @@ xmlShellSave(xmlShellCtxtPtr ctxt, char *filename,
xmlNodePtr node ATTRIBUTE_UNUSED,
xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
- if (ctxt->doc == NULL)
+ if ((ctxt == NULL) || (ctxt->doc == NULL))
return (-1);
if ((filename == NULL) || (filename[0] == 0))
filename = ctxt->filename;
+ if (filename == NULL)
+ return (-1);
#ifdef W_OK
if (access((char *) filename, W_OK)) {
xmlGenericError(xmlGenericErrorContext,
@@ -2575,6 +2586,7 @@ xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd,
xmlValidCtxt vctxt;
int res = -1;
+ if ((ctxt == NULL) || (ctxt->doc == NULL)) return(-1);
vctxt.userData = stderr;
vctxt.error = (xmlValidityErrorFunc) fprintf;
vctxt.warning = (xmlValidityWarningFunc) fprintf;
@@ -2697,7 +2709,7 @@ xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer,
{
xmlChar *path;
- if (node == NULL)
+ if ((node == NULL) || (buffer == NULL))
return (-1);
path = xmlGetNodePath(node);
@@ -2873,7 +2885,11 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) {
- xmlShellWrite(ctxt, arg, NULL, NULL);
+ if ((arg == NULL) || (arg[0] == 0))
+ xmlGenericError(xmlGenericErrorContext,
+ "Write command requires a filename argument\n");
+ else
+ xmlShellWrite(ctxt, arg, NULL, NULL);
#endif /* LIBXML_OUTPUT_ENABLED */
} else if (!strcmp(command, "grep")) {
xmlShellGrep(ctxt, arg, ctxt->node, NULL);
@@ -3183,4 +3199,5 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
free(cmdline); /* not xmlFree here ! */
}
+#endif /* LIBXML_XPATH_ENABLED */
#endif /* LIBXML_DEBUG_ENABLED */
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html
index c5625ef..65f6f7b 100644
--- a/doc/APIchunk10.html
+++ b/doc/APIchunk10.html
@@ -45,9 +45,12 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-entities.html#xmlInitializePredefinedEntities">xmlInitializePredefinedEntities</a><br />
<a href="html/libxml-nanoftp.html#xmlNanoFTPRead">xmlNanoFTPRead</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPRead">xmlNanoHTTPRead</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
<a href="html/libxml-parserInternals.html#xmlParseReference">xmlParseReference</a><br />
<a href="html/libxml-parser.html#xmlSAXUserParseFile">xmlSAXUserParseFile</a><br />
<a href="html/libxml-parser.html#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a><br />
+<a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
<a href="html/libxml-parserInternals.html#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br />
@@ -290,10 +293,10 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlsave.html#xmlSaveToIO">xmlSaveToIO</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderClose">xmlTextReaderClose</a><br />
</dd><dt>closed</dt><dd><a href="html/libxml-parser.html#xmlCtxtReadFd">xmlCtxtReadFd</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
<a href="html/libxml-parser.html#xmlReadFd">xmlReadFd</a><br />
<a href="html/libxml-xmlreader.html#xmlReaderForFd">xmlReaderForFd</a><br />
<a href="html/libxml-xmlreader.html#xmlReaderNewFd">xmlReaderNewFd</a><br />
-<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
<a href="html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a><br />
</dd><dt>closes</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPClose">xmlNanoHTTPClose</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPSave">xmlNanoHTTPSave</a><br />
@@ -795,6 +798,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>cur</dt><dd><a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
</dd><dt>currently</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_INCLUDING_CONVERT_NS">XML_SCHEMAS_INCLUDING_CONVERT_NS</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferCreateFilename">xmlOutputBufferCreateFilename</a><br />
diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html
index e24a542..ef399a3 100644
--- a/doc/APIchunk11.html
+++ b/doc/APIchunk11.html
@@ -54,6 +54,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-entities.html#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a><br />
<a href="html/libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a><br />
<a href="html/libxml-hash.html#xmlHashFree">xmlHashFree</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
<a href="html/libxml-uri.html#xmlSaveUri">xmlSaveUri</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderConstBaseUri">xmlTextReaderConstBaseUri</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderConstEncoding">xmlTextReaderConstEncoding</a><br />
diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html
index 030c8f7..2e5756f 100644
--- a/doc/APIchunk12.html
+++ b/doc/APIchunk12.html
@@ -100,6 +100,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-encoding.html#isolat1ToUTF8">isolat1ToUTF8</a><br />
<a href="html/libxml-encoding.html#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a><br />
<a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
+</dd><dt>embedded</dt><dd><a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
</dd><dt>emitted</dt><dd><a href="html/libxml-xmlerror.html#xmlSetGenericErrorFunc">xmlSetGenericErrorFunc</a><br />
</dd><dt>empty-element</dt><dd><a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
</dd><dt>enable</dt><dd><a href="html/libxml-catalog.html#xmlCatalogSetDebug">xmlCatalogSetDebug</a><br />
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html
index 19d36a9..8b5c459 100644
--- a/doc/APIchunk13.html
+++ b/doc/APIchunk13.html
@@ -89,6 +89,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlDocDump">xmlDocDump</a><br />
<a href="html/libxml-tree.html#xmlDocFormatDump">xmlDocFormatDump</a><br />
<a href="html/libxml-xmlIO.html#xmlFileOpen">xmlFileOpen</a><br />
+<a href="html/libxml-xmlIO.html#xmlFileRead">xmlFileRead</a><br />
<a href="html/libxml-list.html#xmlListAppend">xmlListAppend</a><br />
<a href="html/libxml-list.html#xmlListInsert">xmlListInsert</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
@@ -141,6 +142,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br />
</dd><dt>field</dt><dd><a href="html/libxml-parser.html#XML_COMPLETE_ATTRS">XML_COMPLETE_ATTRS</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
<a href="html/libxml-parser.html#XML_DETECT_IDS">XML_DETECT_IDS</a><br />
<a href="html/libxml-parser.html#XML_SKIP_IDS">XML_SKIP_IDS</a><br />
<a href="html/libxml-parserInternals.html#xmlParseMisc">xmlParseMisc</a><br />
@@ -182,6 +185,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-nanohttp.html#xmlNanoHTTPScanProxy">xmlNanoHTTPScanProxy</a><br />
</dd><dt>finds</dt><dd><a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
<a href="html/libxml-tree.html#xmlSearchNsByHref">xmlSearchNsByHref</a><br />
+</dd><dt>finishDtd</dt><dd><a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
</dd><dt>finished</dt><dd><a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
<a href="html/libxml-parserInternals.html#xmlSkipBlankChars">xmlSkipBlankChars</a><br />
diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html
index 11e6f70..c31732d 100644
--- a/doc/APIchunk14.html
+++ b/doc/APIchunk14.html
@@ -35,7 +35,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="APIchunk25.html">w-w</a>
<a href="APIchunk26.html">x-x</a>
<a href="APIchunk27.html">y-z</a>
-</h2><h2>Letter g:</h2><dl><dt>garbage</dt><dd><a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
+</h2><h2>Letter g:</h2><dl><dt>garanteed</dt><dd><a href="html/libxml-xmlstring.html#xmlUTF8Strsize">xmlUTF8Strsize</a><br />
+</dd><dt>garbage</dt><dd><a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemSetup">xmlGcMemSetup</a><br />
</dd><dt>genChRanges</dt><dd><a href="html/libxml-chvalid.html#xmlIsBaseCharQ">xmlIsBaseCharQ</a><br />
<a href="html/libxml-chvalid.html#xmlIsBaseChar_ch">xmlIsBaseChar_ch</a><br />
diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html
index 31bb8f1..41093c0 100644
--- a/doc/APIchunk15.html
+++ b/doc/APIchunk15.html
@@ -395,27 +395,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewPI">xmlNewPI</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2ProcessingInstruction">xmlSAX2ProcessingInstruction</a><br />
</dd><dt>insufficient</dt><dd><a href="html/libxml-uri.html#xmlCanonicPath">xmlCanonicPath</a><br />
-</dd><dt>int</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
-<a href="">c</a><br />
-<a href="html/libxml-SAX.html#getColumnNumber">getColumnNumber</a><br />
-<a href="html/libxml-SAX.html#getLineNumber">getLineNumber</a><br />
-<a href="html/libxml-HTMLparser.html#htmlHandleOmittedElem">htmlHandleOmittedElem</a><br />
-<a href="html/libxml-HTMLparser.html#htmlParseCharRef">htmlParseCharRef</a><br />
-<a href="html/libxml-parserInternals.html#xmlIsLetter">xmlIsLetter</a><br />
-<a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
-<a href="html/libxml-parser.html#xmlLineNumbersDefault">xmlLineNumbersDefault</a><br />
-<a href="html/libxml-xmlmemory.html#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a><br />
-<a href="html/libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a><br />
-<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseCharData">xmlParseCharData</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseCharRef">xmlParseCharRef</a><br />
-<a href="html/libxml-parser.html#xmlPedanticParserDefault">xmlPedanticParserDefault</a><br />
-<a href="html/libxml-xmlmemory.html#xmlReallocLoc">xmlReallocLoc</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2GetColumnNumber">xmlSAX2GetColumnNumber</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2GetLineNumber">xmlSAX2GetLineNumber</a><br />
-<a href="html/libxml-debugXML.html#xmlShellCmd">xmlShellCmd</a><br />
-<a href="html/libxml-tree.html#xmlSplitQName3">xmlSplitQName3</a><br />
-<a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</dd><dt>integer</dt><dd><a href="html/libxml-xmlstring.html#xmlStrcasecmp">xmlStrcasecmp</a><br />
<a href="html/libxml-xmlstring.html#xmlStrcmp">xmlStrcmp</a><br />
<a href="html/libxml-xmlstring.html#xmlStrncasecmp">xmlStrncasecmp</a><br />
diff --git a/doc/APIchunk16.html b/doc/APIchunk16.html
index 214b8e1..bfea7cf 100644
--- a/doc/APIchunk16.html
+++ b/doc/APIchunk16.html
@@ -188,6 +188,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlValidateQName">xmlValidateQName</a><br />
</dd><dt>lib</dt><dd><a href="html/libxml-xmlversion.html#xmlCheckVersion">xmlCheckVersion</a><br />
</dd><dt>libc</dt><dd><a href="html/libxml-xmlmemory.html#DEBUG_MEMORY">DEBUG_MEMORY</a><br />
+</dd><dt>libraries</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGInitTypes">xmlRelaxNGInitTypes</a><br />
</dd><dt>library</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
<a href="html/libxml-schemasInternals.html#_xmlSchema">_xmlSchema</a><br />
<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html
index 13d61f5..e36896a 100644
--- a/doc/APIchunk21.html
+++ b/doc/APIchunk21.html
@@ -399,7 +399,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>represented</dt><dd><a href="html/libxml-parserInternals.html#xmlParseCharData">xmlParseCharData</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
</dd><dt>represented:</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
-</dd><dt>representing</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
+</dd><dt>representing</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
</dd><dt>request</dt><dd><a href="html/libxml-xmlIO.html#xmlIOHTTPOpenW">xmlIOHTTPOpenW</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethodRedir">xmlNanoHTTPMethodRedir</a><br />
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html
index 175b72e..0765be4 100644
--- a/doc/APIchunk22.html
+++ b/doc/APIchunk22.html
@@ -723,6 +723,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xinclude.html#xmlXIncludeProcessNode">xmlXIncludeProcessNode</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessTree">xmlXIncludeProcessTree</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessTreeFlags">xmlXIncludeProcessTreeFlags</a><br />
+</dd><dt>succeed</dt><dd><a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
</dd><dt>succeeded</dt><dd><a href="html/libxml-hash.html#xmlHashAddEntry">xmlHashAddEntry</a><br />
<a href="html/libxml-hash.html#xmlHashAddEntry2">xmlHashAddEntry2</a><br />
<a href="html/libxml-hash.html#xmlHashAddEntry3">xmlHashAddEntry3</a><br />
@@ -734,6 +735,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-hash.html#xmlHashUpdateEntry3">xmlHashUpdateEntry3</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathCompareValues">xmlXPathCompareValues</a><br />
</dd><dt>succeeds</dt><dd><a href="html/libxml-xmlIO.html#xmlCheckFilename">xmlCheckFilename</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
</dd><dt>successful</dt><dd><a href="html/libxml-catalog.html#xmlACatalogAdd">xmlACatalogAdd</a><br />
<a href="html/libxml-catalog.html#xmlACatalogRemove">xmlACatalogRemove</a><br />
<a href="html/libxml-tree.html#xmlBufferAdd">xmlBufferAdd</a><br />
diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html
index 4aa21d1..ac3ff8b 100644
--- a/doc/APIchunk25.html
+++ b/doc/APIchunk25.html
@@ -243,6 +243,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlsave.html#xmlSaveToIO">xmlSaveToIO</a><br />
<a href="html/libxml-debugXML.html#xmlShellWrite">xmlShellWrite</a><br />
</dd><dt>writer</dt><dd><a href="html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
</dd><dt>writes</dt><dd><a href="html/libxml-tree.html#xmlBufferWriteQuotedString">xmlBufferWriteQuotedString</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferWrite">xmlOutputBufferWrite</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferWriteEscape">xmlOutputBufferWriteEscape</a><br />
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html
index bfde6d1..7f88fd3 100644
--- a/doc/APIchunk26.html
+++ b/doc/APIchunk26.html
@@ -278,6 +278,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlCopyNamespace">xmlCopyNamespace</a><br />
<a href="html/libxml-tree.html#xmlCopyNamespaceList">xmlCopyNamespaceList</a><br />
<a href="html/libxml-tree.html#xmlGetNsList">xmlGetNsList</a><br />
+</dd><dt>xmlOutputBufferClose</dt><dd><a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
+<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
</dd><dt>xmlOutputBufferPtr</dt><dd><a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
</dd><dt>xmlOutputCloseCallback</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
</dd><dt>xmlOutputMatchCallback</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
@@ -292,6 +294,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xmlParseFile</dt><dd><a href="html/libxml-catalog.html#xmlParseCatalogFile">xmlParseCatalogFile</a><br />
</dd><dt>xmlParseNamespace:</dt><dd><a href="html/libxml-parserInternals.html#xmlParseNamespace">xmlParseNamespace</a><br />
</dd><dt>xmlParseURI</dt><dd><a href="html/libxml-uri.html#xmlURIEscape">xmlURIEscape</a><br />
+</dd><dt>xmlParserCtxt</dt><dd><a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
</dd><dt>xmlParserCtxtPtr</dt><dd><a href="html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
</dd><dt>xmlParserError</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html
index 5849049..0ac8f21 100644
--- a/doc/APIchunk3.html
+++ b/doc/APIchunk3.html
@@ -308,6 +308,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathRoot">xmlXPathRoot</a><br />
</dd><dt>Initially</dt><dd><a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</dd><dt>Initiate</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPGetSocket">xmlNanoFTPGetSocket</a><br />
+</dd><dt>Initilize</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGInitTypes">xmlRelaxNGInitTypes</a><br />
</dd><dt>Input</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-parser.html#xmlIOParseDTD">xmlIOParseDTD</a><br />
<a href="html/libxml-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a><br />
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html
index 6558fd0..f830b7b 100644
--- a/doc/APIchunk4.html
+++ b/doc/APIchunk4.html
@@ -197,10 +197,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
+<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
<a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
<a href="html/libxml-parserInternals.html#xmlParsePEReference">xmlParsePEReference</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
-<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br />
</dd><dt>NRK</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
</dd><dt>NSDef</dt><dd><a href="html/libxml-parserInternals.html#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a><br />
diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html
index dbed0af..d3cc136 100644
--- a/doc/APIchunk5.html
+++ b/doc/APIchunk5.html
@@ -190,6 +190,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Provides</dt><dd><a href="html/libxml-SAX.html#getPublicId">getPublicId</a><br />
<a href="html/libxml-SAX.html#getSystemId">getSystemId</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPContentLength">xmlNanoHTTPContentLength</a><br />
diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html
index a760e36..668cd2d 100644
--- a/doc/APIchunk6.html
+++ b/doc/APIchunk6.html
@@ -440,7 +440,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathNodeSetSort">xmlXPathNodeSetSort</a><br />
</dd><dt>SpacingModifierLetters</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsSpacingModifierLetters">xmlUCSIsSpacingModifierLetters</a><br />
</dd><dt>Spec</dt><dd><a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
-</dd><dt>Special</dt><dd><a href="html/libxml-parser.html#XML_SAX2_MAGIC">XML_SAX2_MAGIC</a><br />
+</dd><dt>Special</dt><dd><a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
+<a href="html/libxml-parser.html#XML_SAX2_MAGIC">XML_SAX2_MAGIC</a><br />
</dd><dt>Specials</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsSpecials">xmlUCSIsSpecials</a><br />
</dd><dt>Speed</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
</dd><dt>Standalone</dt><dd><a href="html/libxml-parserInternals.html#xmlParseSDDecl">xmlParseSDDecl</a><br />
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html
index 443d438..4287db3 100644
--- a/doc/APIchunk8.html
+++ b/doc/APIchunk8.html
@@ -85,6 +85,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>WWW-Authenticate</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPAuthHeader">xmlNanoHTTPAuthHeader</a><br />
</dd><dt>Walk</dt><dd><a href="html/libxml-list.html#xmlListReverseWalk">xmlListReverseWalk</a><br />
<a href="html/libxml-list.html#xmlListWalk">xmlListWalk</a><br />
+</dd><dt>Warning</dt><dd><a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
+<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
</dd><dt>Was</dt><dd><a href="html/libxml-parser.html#_xmlParserInput">_xmlParserInput</a><br />
</dd><dt>Well</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
@@ -397,6 +399,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a><br />
<a href="html/libxml-nanoftp.html#xmlNanoFTPGetResponse">xmlNanoFTPGetResponse</a><br />
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
+<a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
+<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
<a href="html/libxml-valid.html#xmlValidGetValidElements">xmlValidGetValidElements</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNextFollowing">xmlXPathNextFollowing</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
@@ -637,6 +641,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlReallocLoc">xmlReallocLoc</a><br />
</dd><dt>areas</dt><dd><a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemSetup">xmlGcMemSetup</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a><br />
</dd><dt>args</dt><dd><a href="html/libxml-xpathInternals.html#CHECK_ARITY">CHECK_ARITY</a><br />
<a href="">x</a><br />
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html
index 7a05689..29a0da4 100644
--- a/doc/APIchunk9.html
+++ b/doc/APIchunk9.html
@@ -121,6 +121,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNodeSetSpacePreserve">xmlNodeSetSpacePreserve</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2ResolveEntity">xmlSAX2ResolveEntity</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
+<a href="html/libxml-xmlstring.html#xmlUTF8Strsize">xmlUTF8Strsize</a><br />
</dd><dt>below</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
</dd><dt>better</dt><dd><a href="html/libxml-SAX.html#resolveEntity">resolveEntity</a><br />
@@ -162,6 +163,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-SAX.html#initdocbDefaultSAXHandler">initdocbDefaultSAXHandler</a><br />
<a href="html/libxml-SAX.html#inithtmlDefaultSAXHandler">inithtmlDefaultSAXHandler</a><br />
<a href="html/libxml-SAX.html#initxmlDefaultSAXHandler">initxmlDefaultSAXHandler</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a><br />
</dd><dt>book1</dt><dd><a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
@@ -186,6 +188,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>breaks</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
</dd><dt>broken</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
+</dd><dt>buf</dt><dd><a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
+<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
</dd><dt>buffered</dt><dd><a href="html/libxml-xmlIO.html#xmlAllocOutputBuffer">xmlAllocOutputBuffer</a><br />
<a href="html/libxml-xmlIO.html#xmlAllocParserInputBuffer">xmlAllocParserInputBuffer</a><br />
<a href="html/libxml-xmlIO.html#xmlFreeParserInputBuffer">xmlFreeParserInputBuffer</a><br />
diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html
index e00c5c4..fbe9e0c 100644
--- a/doc/APIconstructors.html
+++ b/doc/APIconstructors.html
@@ -42,6 +42,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderConstXmlLang">xmlTextReaderConstXmlLang</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderConstXmlVersion">xmlTextReaderConstXmlVersion</a><br />
+<a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNsLookup">xmlXPathNsLookup</a><br />
</p><h2>Type const xmlParserNodeInfo *:</h2><p><a href="html/libxml-parser.html#xmlParserFindNodeInfo">xmlParserFindNodeInfo</a><br />
</p><h2>Type docbDocPtr:</h2><p><a href="html/libxml-DOCBparser.html#docbParseDoc">docbParseDoc</a><br />
@@ -233,7 +234,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-uri.html#xmlURIEscape">xmlURIEscape</a><br />
<a href="html/libxml-uri.html#xmlURIEscapeStr">xmlURIEscapeStr</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strndup">xmlUTF8Strndup</a><br />
-<a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strsub">xmlUTF8Strsub</a><br />
<a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
diff --git a/doc/APIfiles.html b/doc/APIfiles.html
index 3dc6559..cc09f7d 100644
--- a/doc/APIfiles.html
+++ b/doc/APIfiles.html
@@ -910,6 +910,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGFreeValidCtxt">xmlRelaxNGFreeValidCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGInitTypes">xmlRelaxNGInitTypes</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewMemParserCtxt">xmlRelaxNGNewMemParserCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewParserCtxt">xmlRelaxNGNewParserCtxt</a><br />
@@ -1433,7 +1434,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-uri.html#xmlURIEscapeStr">xmlURIEscapeStr</a><br />
<a href="html/libxml-uri.html#xmlURIPtr">xmlURIPtr</a><br />
<a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
-</p><h2><a name="valid" id="valid">Module valid</a>:</h2><p><a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
+</p><h2><a name="valid" id="valid">Module valid</a>:</h2><p><a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
+<a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
<a href="html/libxml-valid.html#xmlAddAttributeDecl">xmlAddAttributeDecl</a><br />
<a href="html/libxml-valid.html#xmlAddElementDecl">xmlAddElementDecl</a><br />
<a href="html/libxml-valid.html#xmlAddID">xmlAddID</a><br />
@@ -1856,6 +1859,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_FROM_SCHEMASV">XML_FROM_SCHEMASV</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_TREE">XML_FROM_TREE</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_VALID">XML_FROM_VALID</a><br />
+<a href="html/libxml-xmlerror.html#XML_FROM_WRITER">XML_FROM_WRITER</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XINCLUDE">XML_FROM_XINCLUDE</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XPATH">XML_FROM_XPATH</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XPOINTER">XML_FROM_XPOINTER</a><br />
@@ -2407,6 +2411,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
@@ -2964,6 +2969,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpath.html#XPATH_EXPR_ERROR">XPATH_EXPR_ERROR</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_ARITY">XPATH_INVALID_ARITY</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CHAR_ERROR">XPATH_INVALID_CHAR_ERROR</a><br />
+<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT">XPATH_INVALID_CTXT</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT_POSITION">XPATH_INVALID_CTXT_POSITION</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT_SIZE">XPATH_INVALID_CTXT_SIZE</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_OPERAND">XPATH_INVALID_OPERAND</a><br />
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html
index 19a0caa..b1fd6a6 100644
--- a/doc/APIsymbols.html
+++ b/doc/APIsymbols.html
@@ -223,6 +223,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_CHECK_X">XML_CHECK_X</a><br />
<a href="html/libxml-tree.html#XML_COMMENT_NODE">XML_COMMENT_NODE</a><br />
<a href="html/libxml-parser.html#XML_COMPLETE_ATTRS">XML_COMPLETE_ATTRS</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a><br />
+<a href="html/libxml-valid.html#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a><br />
<a href="html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a><br />
<a href="html/libxml-parser.html#XML_DETECT_IDS">XML_DETECT_IDS</a><br />
<a href="html/libxml-tree.html#XML_DOCB_DOCUMENT_NODE">XML_DOCB_DOCUMENT_NODE</a><br />
@@ -413,6 +415,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_FROM_SCHEMASV">XML_FROM_SCHEMASV</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_TREE">XML_FROM_TREE</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_VALID">XML_FROM_VALID</a><br />
+<a href="html/libxml-xmlerror.html#XML_FROM_WRITER">XML_FROM_WRITER</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XINCLUDE">XML_FROM_XINCLUDE</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XPATH">XML_FROM_XPATH</a><br />
<a href="html/libxml-xmlerror.html#XML_FROM_XPOINTER">XML_FROM_XPOINTER</a><br />
@@ -1251,6 +1254,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpath.html#XPATH_EXPR_ERROR">XPATH_EXPR_ERROR</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_ARITY">XPATH_INVALID_ARITY</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CHAR_ERROR">XPATH_INVALID_CHAR_ERROR</a><br />
+<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT">XPATH_INVALID_CTXT</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT_POSITION">XPATH_INVALID_CTXT_POSITION</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_CTXT_SIZE">XPATH_INVALID_CTXT_SIZE</a><br />
<a href="html/libxml-xpath.html#XPATH_INVALID_OPERAND">XPATH_INVALID_OPERAND</a><br />
@@ -2022,6 +2026,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
@@ -2364,6 +2369,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGFreeValidCtxt">xmlRelaxNGFreeValidCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGInitTypes">xmlRelaxNGInitTypes</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewMemParserCtxt">xmlRelaxNGNewMemParserCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewParserCtxt">xmlRelaxNGNewParserCtxt</a><br />
diff --git a/doc/apibuild.py b/doc/apibuild.py
index 059d0bb..2cbf32f 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -32,6 +32,7 @@ ignored_files = {
"rngparser.c": "not yet integrated",
"rngparser.h": "not yet integrated",
"elfgcchack.h": "not a normal header",
+ "testapi.c": "generated regression tests",
}
ignored_words = {
diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml
index 96534fc..bded118 100644
--- a/doc/examples/examples.xml
+++ b/doc/examples/examples.xml
@@ -100,7 +100,7 @@
<macro line='67' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<enum line='36' file='tree' name='XML_ELEMENT_NODE'/>
<function line='79' file='tree' name='xmlFreeDoc'/>
- <function line='67' file='parser' name='xmlParseFile'/>
+ <function line='67' file='parser' name='xmlReadFile'/>
<function line='74' file='tree' name='xmlDocGetRootElement'/>
</uses>
</example>
@@ -567,7 +567,6 @@
</symbol>
<symbol name='xmlParseFile'>
<ref filename='xpath1.c'/>
- <ref filename='tree1.c'/>
<ref filename='xpath2.c'/>
</symbol>
<symbol name='xmlParserCtxtPtr'>
@@ -576,6 +575,7 @@
</symbol>
<symbol name='xmlReadFile'>
<ref filename='parse1.c'/>
+ <ref filename='tree1.c'/>
</symbol>
<symbol name='xmlReadMemory'>
<ref filename='io1.c'/>
diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c
index 2da7532..acbff4f 100644
--- a/doc/examples/reader3.c
+++ b/doc/examples/reader3.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <libxml/xmlreader.h>
-#ifdef LIBXML_READER_ENABLED
+#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
/**
* streamFile:
@@ -113,7 +113,7 @@ int main(int argc, char **argv) {
#else
int main(void) {
- fprintf(stderr, "XInclude support not compiled in\n");
+ fprintf(stderr, "Reader or Pattern support not compiled in\n");
exit(1);
}
#endif
diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c
index c5e9c39..e158f97 100644
--- a/doc/examples/testWriter.c
+++ b/doc/examples/testWriter.c
@@ -1168,8 +1168,8 @@ ConvertInput(const char *in, const char *encoding)
if (out != 0) {
temp = size - 1;
ret = handler->input(out, &out_size, (const xmlChar *) in, &temp);
- if (ret || temp - size + 1) {
- if (ret) {
+ if ((ret < 0) || (temp - size + 1)) {
+ if (ret < 0) {
printf("ConvertInput: conversion wasn't successful.\n");
} else {
printf
diff --git a/doc/examples/tree1.c b/doc/examples/tree1.c
index 8a303e2..8644cf1 100644
--- a/doc/examples/tree1.c
+++ b/doc/examples/tree1.c
@@ -64,10 +64,10 @@ main(int argc, char **argv)
LIBXML_TEST_VERSION
/*parse the file and get the DOM */
- doc = xmlParseFile(argv[1]);
+ doc = xmlReadFile(argv[1], NULL, 0);
if (doc == NULL) {
- printf("error: could not parse file file.xml\n");
+ printf("error: could not parse file %s\n", argv[1]);
}
/*Get the root element node */
diff --git a/doc/html/libxml-list.html b/doc/html/libxml-list.html
index 627047d..004a7a7 100644
--- a/doc/html/libxml-list.html
+++ b/doc/html/libxml-list.html
@@ -78,7 +78,7 @@ void xmlListDeallocator (<a href="libxml-list.html#xmlLinkPtr">xmlLinkPtr</a> l
</pre><p>Duplicate the list</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>old</tt></i>:</span></td><td>the list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new copy of the list or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlListEmpty" id="xmlListEmpty"></a>Function: xmlListEmpty</h3><pre class="programlisting">int xmlListEmpty (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
</pre><p>Is the list empty ?</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the list is empty, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlListEnd" id="xmlListEnd"></a>Function: xmlListEnd</h3><pre class="programlisting"><a href="libxml-list.html#xmlLinkPtr">xmlLinkPtr</a> xmlListEnd (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the list is empty, 0 if not empty and -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlListEnd" id="xmlListEnd"></a>Function: xmlListEnd</h3><pre class="programlisting"><a href="libxml-list.html#xmlLinkPtr">xmlLinkPtr</a> xmlListEnd (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
</pre><p>Get the last element in the list</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the last element in the list, or NULL</td></tr></tbody></table></div><h3><a name="xmlListFront" id="xmlListFront"></a>Function: xmlListFront</h3><pre class="programlisting"><a href="libxml-list.html#xmlLinkPtr">xmlLinkPtr</a> xmlListFront (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
</pre><p>Get the first element in the list</p>
@@ -110,7 +110,7 @@ void xmlListDeallocator (<a href="libxml-list.html#xmlLinkPtr">xmlLinkPtr</a> l
</pre><p>Search the list for an existing value of @data</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>a search value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the value associated to @data or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlListSize" id="xmlListSize"></a>Function: xmlListSize</h3><pre class="programlisting">int xmlListSize (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
</pre><p>Get the number of elements in the list</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of elements in the list</td></tr></tbody></table></div><h3><a name="xmlListSort" id="xmlListSort"></a>Function: xmlListSort</h3><pre class="programlisting">void xmlListSort (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of elements in the list or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlListSort" id="xmlListSort"></a>Function: xmlListSort</h3><pre class="programlisting">void xmlListSort (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l)<br />
</pre><p>Sort all the elements in the list</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>l</tt></i>:</span></td><td>a list</td></tr></tbody></table></div><h3><a name="xmlListWalk" id="xmlListWalk"></a>Function: xmlListWalk</h3><pre class="programlisting">void xmlListWalk (<a href="libxml-list.html#xmlListPtr">xmlListPtr</a> l, <br /> <a href="libxml-list.html#xmlListWalker">xmlListWalker</a> walker, <br /> const void * user)<br />
</pre><p>Walk all the element of the first from first to last and apply the walker function to it</p>
diff --git a/doc/html/libxml-nanoftp.html b/doc/html/libxml-nanoftp.html
index 9fc521b..7c71162 100644
--- a/doc/html/libxml-nanoftp.html
+++ b/doc/html/libxml-nanoftp.html
@@ -22,15 +22,15 @@ void <a href="#ftpListCallback">ftpListCallback</a> (void * userData, <br />
<pre class="programlisting">int <a href="#xmlNanoFTPCloseConnection">xmlNanoFTPCloseConnection</a> (void * ctx)</pre>
<pre class="programlisting">int <a href="#xmlNanoFTPConnect">xmlNanoFTPConnect</a> (void * ctx)</pre>
<pre class="programlisting">void * <a href="#xmlNanoFTPConnectTo">xmlNanoFTPConnectTo</a> (const char * server, <br /> int port)</pre>
-<pre class="programlisting">int <a href="#xmlNanoFTPCwd">xmlNanoFTPCwd</a> (void * ctx, <br /> char * directory)</pre>
-<pre class="programlisting">int <a href="#xmlNanoFTPDele">xmlNanoFTPDele</a> (void * ctx, <br /> char * file)</pre>
+<pre class="programlisting">int <a href="#xmlNanoFTPCwd">xmlNanoFTPCwd</a> (void * ctx, <br /> const char * directory)</pre>
+<pre class="programlisting">int <a href="#xmlNanoFTPDele">xmlNanoFTPDele</a> (void * ctx, <br /> const char * file)</pre>
<pre class="programlisting">void <a href="#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a> (void * ctx)</pre>
<pre class="programlisting">int <a href="#xmlNanoFTPGet">xmlNanoFTPGet</a> (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br /> void * userData, <br /> const char * filename)</pre>
<pre class="programlisting">int <a href="#xmlNanoFTPGetConnection">xmlNanoFTPGetConnection</a> (void * ctx)</pre>
<pre class="programlisting">int <a href="#xmlNanoFTPGetResponse">xmlNanoFTPGetResponse</a> (void * ctx)</pre>
<pre class="programlisting">int <a href="#xmlNanoFTPGetSocket">xmlNanoFTPGetSocket</a> (void * ctx, <br /> const char * filename)</pre>
<pre class="programlisting">void <a href="#xmlNanoFTPInit">xmlNanoFTPInit</a> (void)</pre>
-<pre class="programlisting">int <a href="#xmlNanoFTPList">xmlNanoFTPList</a> (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br /> void * userData, <br /> char * filename)</pre>
+<pre class="programlisting">int <a href="#xmlNanoFTPList">xmlNanoFTPList</a> (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br /> void * userData, <br /> const char * filename)</pre>
<pre class="programlisting">void * <a href="#xmlNanoFTPNewCtxt">xmlNanoFTPNewCtxt</a> (const char * URL)</pre>
<pre class="programlisting">void * <a href="#xmlNanoFTPOpen">xmlNanoFTPOpen</a> (const char * URL)</pre>
<pre class="programlisting">void <a href="#xmlNanoFTPProxy">xmlNanoFTPProxy</a> (const char * host, <br /> int port, <br /> const char * user, <br /> const char * passwd, <br /> int type)</pre>
@@ -57,9 +57,9 @@ void ftpListCallback (void * userData, <br /> const char * filename, <br
</pre><p>Tries to open a control connection</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnectTo" id="xmlNanoFTPConnectTo"></a>Function: xmlNanoFTPConnectTo</h3><pre class="programlisting">void * xmlNanoFTPConnectTo (const char * server, <br /> int port)<br />
</pre><p>Tries to open a control connection to the given server/port</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>server</tt></i>:</span></td><td>an FTP server name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the port (use 21 if 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an fTP context or NULL if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCwd" id="xmlNanoFTPCwd"></a>Function: xmlNanoFTPCwd</h3><pre class="programlisting">int xmlNanoFTPCwd (void * ctx, <br /> char * directory)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>server</tt></i>:</span></td><td>an FTP server name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the port (use 21 if 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an fTP context or NULL if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCwd" id="xmlNanoFTPCwd"></a>Function: xmlNanoFTPCwd</h3><pre class="programlisting">int xmlNanoFTPCwd (void * ctx, <br /> const char * directory)<br />
</pre><p>Tries to change the remote directory</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int xmlNanoFTPDele (void * ctx, <br /> char * file)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int xmlNanoFTPDele (void * ctx, <br /> const char * file)<br />
</pre><p>Tries to delete an item (file or directory) from server</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPFreeCtxt" id="xmlNanoFTPFreeCtxt"></a>Function: xmlNanoFTPFreeCtxt</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt (void * ctx)<br />
</pre><p>Frees the context after closing the connection.</p>
@@ -73,7 +73,7 @@ void ftpListCallback (void * userData, <br /> const char * filename, <br
</pre><p>Initiate fetch of the given file from the server.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve (or NULL if path is in context).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or &lt;0 in case of error</td></tr></tbody></table></div><h3><a name="xmlNanoFTPInit" id="xmlNanoFTPInit"></a>Function: xmlNanoFTPInit</h3><pre class="programlisting">void xmlNanoFTPInit (void)<br />
</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p>
-<h3><a name="xmlNanoFTPList" id="xmlNanoFTPList"></a>Function: xmlNanoFTPList</h3><pre class="programlisting">int xmlNanoFTPList (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br /> void * userData, <br /> char * filename)<br />
+<h3><a name="xmlNanoFTPList" id="xmlNanoFTPList"></a>Function: xmlNanoFTPList</h3><pre class="programlisting">int xmlNanoFTPList (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br /> void * userData, <br /> const char * filename)<br />
</pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPNewCtxt" id="xmlNanoFTPNewCtxt"></a>Function: xmlNanoFTPNewCtxt</h3><pre class="programlisting">void * xmlNanoFTPNewCtxt (const char * URL)<br />
</pre><p>Allocate and initialize a new FTP context.</p>
diff --git a/doc/html/libxml-relaxng.html b/doc/html/libxml-relaxng.html
index 6e20a12..d611ce1 100644
--- a/doc/html/libxml-relaxng.html
+++ b/doc/html/libxml-relaxng.html
@@ -29,6 +29,7 @@ The content of this structure is not made public by the API.
<pre class="programlisting">void <a href="#xmlRelaxNGFreeValidCtxt">xmlRelaxNGFreeValidCtxt</a> (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt)</pre>
<pre class="programlisting">int <a href="#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a> (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br /> void ** ctx)</pre>
<pre class="programlisting">int <a href="#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a> (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br /> void ** ctx)</pre>
+<pre class="programlisting">int <a href="#xmlRelaxNGInitTypes">xmlRelaxNGInitTypes</a> (void)</pre>
<pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> <a href="#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)</pre>
<pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> <a href="#xmlRelaxNGNewMemParserCtxt">xmlRelaxNGNewMemParserCtxt</a> (const char * buffer, <br /> int size)</pre>
<pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> <a href="#xmlRelaxNGNewParserCtxt">xmlRelaxNGNewParserCtxt</a> (const char * URL)</pre>
@@ -118,7 +119,9 @@ The content of this structure is not made public by the API.
</pre><p>Get the callback information used to handle errors for a validation context</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGGetValidErrors" id="xmlRelaxNGGetValidErrors"></a>Function: xmlRelaxNGGetValidErrors</h3><pre class="programlisting">int xmlRelaxNGGetValidErrors (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br /> void ** ctx)<br />
</pre><p>Get the error and warning callback informations</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlRelaxNGNewDocParserCtxt" id="xmlRelaxNGNewDocParserCtxt"></a>Function: xmlRelaxNGNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> xmlRelaxNGNewDocParserCtxt (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlRelaxNGInitTypes" id="xmlRelaxNGInitTypes"></a>Function: xmlRelaxNGInitTypes</h3><pre class="programlisting">int xmlRelaxNGInitTypes (void)<br />
+</pre><p>Initilize the default type libraries.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGNewDocParserCtxt" id="xmlRelaxNGNewDocParserCtxt"></a>Function: xmlRelaxNGNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> xmlRelaxNGNewDocParserCtxt (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
</pre><p>Create an XML RelaxNGs parser context for that document. Note: since the process of compiling a RelaxNG schemas modifies the document, the @doc parameter is duplicated internally.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a preparsed document tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlRelaxNGNewMemParserCtxt" id="xmlRelaxNGNewMemParserCtxt"></a>Function: xmlRelaxNGNewMemParserCtxt</h3><pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> xmlRelaxNGNewMemParserCtxt (const char * buffer, <br /> int size)<br />
</pre><p>Create an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file.</p>
diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html
index 99c4bd9..f5d4241 100644
--- a/doc/html/libxml-tree.html
+++ b/doc/html/libxml-tree.html
@@ -833,13 +833,13 @@ A:link, A:visited, A:active { text-decoration: underline }
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSaveFileEnc" id="xmlSaveFileEnc"></a>Function: xmlSaveFileEnc</h3><pre class="programlisting">int xmlSaveFileEnc (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding)<br />
</pre><p>Dump an XML document, converting it to the given encoding</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the name of an encoding (or NULL)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSaveFileTo" id="xmlSaveFileTo"></a>Function: xmlSaveFileTo</h3><pre class="programlisting">int xmlSaveFileTo (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding)<br />
-</pre><p>Dump an XML document to an I/O buffer.</p>
+</pre><p>Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>an output I/O buffer</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding if any assuming the I/O layer handles the trancoding</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSaveFormatFile" id="xmlSaveFormatFile"></a>Function: xmlSaveFormatFile</h3><pre class="programlisting">int xmlSaveFormatFile (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> int format)<br />
</pre><p>Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node indenting only if <a href="libxml-globals.html#xmlIndentTreeOutput">xmlIndentTreeOutput</a> = 1 or xmlKeepBlanksDefault(0) was called</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSaveFormatFileEnc" id="xmlSaveFormatFileEnc"></a>Function: xmlSaveFormatFileEnc</h3><pre class="programlisting">int xmlSaveFormatFileEnc (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding, <br /> int format)<br />
</pre><p>Dump an XML document to a file or an URL.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename or URL to output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document being saved</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the name of the encoding to use or NULL.</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces be added.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error. Note that @format = 1 provide node indenting only if <a href="libxml-globals.html#xmlIndentTreeOutput">xmlIndentTreeOutput</a> = 1 or xmlKeepBlanksDefault(0) was called</td></tr></tbody></table></div><h3><a name="xmlSaveFormatFileTo" id="xmlSaveFormatFileTo"></a>Function: xmlSaveFormatFileTo</h3><pre class="programlisting">int xmlSaveFormatFileTo (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding, <br /> int format)<br />
-</pre><p>Dump an XML document to an I/O buffer. NOTE: the I/O buffer is closed as part of the call.</p>
+</pre><p>Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>an output I/O buffer</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding if any assuming the I/O layer handles the trancoding</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xmlSearchNs" id="xmlSearchNs"></a>Function: xmlSearchNs</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlSearchNs (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * nameSpace)<br />
</pre><p>Search a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return NULL otherwise. @nameSpace can be NULL, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't declare the namespace within those you will be in troubles !!! A warning is generated to cover this case.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>nameSpace</tt></i>:</span></td><td>the namespace prefix</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the namespace pointer or NULL.</td></tr></tbody></table></div><h3><a name="xmlSearchNsByHref" id="xmlSearchNsByHref"></a>Function: xmlSearchNsByHref</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> xmlSearchNsByHref (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * href)<br />
diff --git a/doc/html/libxml-valid.html b/doc/html/libxml-valid.html
index bc18015..e26d184 100644
--- a/doc/html/libxml-valid.html
+++ b/doc/html/libxml-valid.html
@@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Module valid from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module valid from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-uri.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-uri.html">uri</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xinclude.html">xinclude</a></th><td><a accesskey="n" href="libxml-xinclude.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>API for the DTD handling and the validity checking </p><h2>Table of Contents</h2><pre class="programlisting">Structure <a href="#xmlAttributeTable">xmlAttributeTable</a><br />struct _xmlHashTable
+ </style><title>Module valid from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module valid from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-uri.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-uri.html">uri</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xinclude.html">xinclude</a></th><td><a accesskey="n" href="libxml-xinclude.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>API for the DTD handling and the validity checking </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#XML_CTXT_FINISH_DTD_0">XML_CTXT_FINISH_DTD_0</a></pre><pre class="programlisting">#define <a href="#XML_CTXT_FINISH_DTD_1">XML_CTXT_FINISH_DTD_1</a></pre><pre class="programlisting">Structure <a href="#xmlAttributeTable">xmlAttributeTable</a><br />struct _xmlHashTable
The content of this structure is not made public by the API.
</pre><pre class="programlisting">Typedef <a href="libxml-valid.html#xmlAttributeTable">xmlAttributeTable</a> * <a name="xmlAttributeTablePtr" id="xmlAttributeTablePtr">xmlAttributeTablePtr</a>
</pre><pre class="programlisting">Structure <a href="#xmlElementTable">xmlElementTable</a><br />struct _xmlHashTable
@@ -104,6 +104,8 @@ void <a href="#xmlValidityErrorFunc">xmlValidityErrorFunc</a> (void * ctx, <br
void <a href="#xmlValidityWarningFunc">xmlValidityWarningFunc</a> (void * ctx, <br /> const char * msg, <br /> ... ...)
</pre>
<h2>Description</h2>
+<h3><a name="XML_CTXT_FINISH_DTD_0" id="XML_CTXT_FINISH_DTD_0"></a>Macro: XML_CTXT_FINISH_DTD_0</h3><pre>#define XML_CTXT_FINISH_DTD_0</pre><p>Special value for finishDtd field when embedded in an <a href="libxml-tree.html#xmlParserCtxt">xmlParserCtxt</a></p>
+<h3><a name="XML_CTXT_FINISH_DTD_1" id="XML_CTXT_FINISH_DTD_1"></a>Macro: XML_CTXT_FINISH_DTD_1</h3><pre>#define XML_CTXT_FINISH_DTD_1</pre><p>Special value for finishDtd field when embedded in an <a href="libxml-tree.html#xmlParserCtxt">xmlParserCtxt</a></p>
<h3><a name="xmlAttributeTable" id="xmlAttributeTable">Structure xmlAttributeTable</a></h3><pre class="programlisting">Structure xmlAttributeTable<br />struct _xmlHashTable {
The content of this structure is not made public by the API.
}</pre><h3><a name="xmlElementTable" id="xmlElementTable">Structure xmlElementTable</a></h3><pre class="programlisting">Structure xmlElementTable<br />struct _xmlHashTable {
@@ -122,7 +124,7 @@ The content of this structure is not made public by the API.
int nodeNr : Depth of the parsing stack
int nodeMax : Max depth of the parsing stack
<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * nodeTab : array of nodes
- int finishDtd : finished validating the Dtd ?
+ unsigned int finishDtd : finished validating the Dtd ?
<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc : the document
int valid : temporary validity check result state s
<a href="libxml-valid.html#xmlValidState">xmlValidState</a> * vstate : current state
diff --git a/doc/html/libxml-xmlIO.html b/doc/html/libxml-xmlIO.html
index 1e3b3c3..1aaf3cd 100644
--- a/doc/html/libxml-xmlIO.html
+++ b/doc/html/libxml-xmlIO.html
@@ -102,7 +102,7 @@ int <a href="#xmlOutputWriteCallback">xmlOutputWriteCallback</a> (void * contex
</pre><p>Wrapper around xmlFileOpen_real that try it with an unescaped version of @filename, if this fails fallback to @filename</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the URI for matching</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a handler or NULL in case or failure</td></tr></tbody></table></div><h3><a name="xmlFileRead" id="xmlFileRead"></a>Function: xmlFileRead</h3><pre class="programlisting">int xmlFileRead (void * context, <br /> char * buffer, <br /> int len)<br />
</pre><p>Read @len bytes to @buffer from the I/O channel.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>context</tt></i>:</span></td><td>the I/O context</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>where to drop data</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>number of bytes to write</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written</td></tr></tbody></table></div><h3><a name="xmlFreeParserInputBuffer" id="xmlFreeParserInputBuffer"></a>Function: xmlFreeParserInputBuffer</h3><pre class="programlisting">void xmlFreeParserInputBuffer (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>context</tt></i>:</span></td><td>the I/O context</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>where to drop data</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>number of bytes to write</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or &lt; 0 in case of failure</td></tr></tbody></table></div><h3><a name="xmlFreeParserInputBuffer" id="xmlFreeParserInputBuffer"></a>Function: xmlFreeParserInputBuffer</h3><pre class="programlisting">void xmlFreeParserInputBuffer (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in)<br />
</pre><p>Free up the memory used by a buffered parser input</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a buffered parser input</td></tr></tbody></table></div><h3><a name="xmlIOFTPClose" id="xmlIOFTPClose"></a>Function: xmlIOFTPClose</h3><pre class="programlisting">int xmlIOFTPClose (void * context)<br />
</pre><p>Close an FTP I/O channel</p>
diff --git a/doc/html/libxml-xmlerror.html b/doc/html/libxml-xmlerror.html
index 93aaa79..a0bfb49 100644
--- a/doc/html/libxml-xmlerror.html
+++ b/doc/html/libxml-xmlerror.html
@@ -77,6 +77,7 @@ void <a href="#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> (void * userD
<a name="XML_FROM_XSLT" id="XML_FROM_XSLT">XML_FROM_XSLT</a> = 22 : The XSLT engine from libxslt
<a name="XML_FROM_VALID" id="XML_FROM_VALID">XML_FROM_VALID</a> = 23 : The XML DTD validation with valid context
<a name="XML_FROM_CHECK" id="XML_FROM_CHECK">XML_FROM_CHECK</a> = 24 : The error checking module
+ <a name="XML_FROM_WRITER" id="XML_FROM_WRITER">XML_FROM_WRITER</a> = 25 : The xmlwriter module
}
</pre><h3>Enum <a name="xmlErrorLevel" id="xmlErrorLevel">xmlErrorLevel</a></h3><pre class="programlisting">Enum xmlErrorLevel {
<a name="XML_ERR_NONE" id="XML_ERR_NONE">XML_ERR_NONE</a> = 0
diff --git a/doc/html/libxml-xmlmemory.html b/doc/html/libxml-xmlmemory.html
index 90f9167..23d3416 100644
--- a/doc/html/libxml-xmlmemory.html
+++ b/doc/html/libxml-xmlmemory.html
@@ -30,6 +30,7 @@ void <a href="#xmlFreeFunc">xmlFreeFunc</a> (void * mem)
void * <a href="#xmlMallocFunc">xmlMallocFunc</a> (size_t size)
</pre>
<pre class="programlisting">void * <a href="#xmlMallocLoc">xmlMallocLoc</a> (size_t size, <br /> const char * file, <br /> int line)</pre>
+<pre class="programlisting">int <a href="#xmlMemBlocks">xmlMemBlocks</a> (void)</pre>
<pre class="programlisting">void <a href="#xmlMemDisplay">xmlMemDisplay</a> (FILE * fp)</pre>
<pre class="programlisting">void <a href="#xmlMemFree">xmlMemFree</a> (void * ptr)</pre>
<pre class="programlisting">int <a href="#xmlMemGet">xmlMemGet</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br /> <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)</pre>
@@ -68,7 +69,9 @@ void * xmlMallocFunc (size_t size)
</pre><p>Signature for a malloc() implementation.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the size requested in bytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the newly allocated block or NULL in case of error.</td></tr></tbody></table></div><br />
<h3><a name="xmlMallocLoc" id="xmlMallocLoc"></a>Function: xmlMallocLoc</h3><pre class="programlisting">void * xmlMallocLoc (size_t size, <br /> const char * file, <br /> int line)<br />
</pre><p>a malloc() equivalent, with logging of the allocation info.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div><h3><a name="xmlMemDisplay" id="xmlMemDisplay"></a>Function: xmlMemDisplay</h3><pre class="programlisting">void xmlMemDisplay (FILE * fp)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div><h3><a name="xmlMemBlocks" id="xmlMemBlocks"></a>Function: xmlMemBlocks</h3><pre class="programlisting">int xmlMemBlocks (void)<br />
+</pre><p>Provides the number of memory areas currently allocated</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int representing the number of blocks</td></tr></tbody></table></div><h3><a name="xmlMemDisplay" id="xmlMemDisplay"></a>Function: xmlMemDisplay</h3><pre class="programlisting">void xmlMemDisplay (FILE * fp)<br />
</pre><p>show in-extenso the memory blocks allocated</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr></tbody></table></div><h3><a name="xmlMemFree" id="xmlMemFree"></a>Function: xmlMemFree</h3><pre class="programlisting">void xmlMemFree (void * ptr)<br />
</pre><p></p>
diff --git a/doc/html/libxml-xmlstring.html b/doc/html/libxml-xmlstring.html
index 490df42..9b29924 100644
--- a/doc/html/libxml-xmlstring.html
+++ b/doc/html/libxml-xmlstring.html
@@ -38,7 +38,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<pre class="programlisting">int <a href="#xmlUTF8Strlen">xmlUTF8Strlen</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf)</pre>
<pre class="programlisting">int <a href="#xmlUTF8Strloc">xmlUTF8Strloc</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utfchar)</pre>
<pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlUTF8Strndup">xmlUTF8Strndup</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int len)</pre>
-<pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlUTF8Strpos">xmlUTF8Strpos</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int pos)</pre>
+<pre class="programlisting">const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlUTF8Strpos">xmlUTF8Strpos</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int pos)</pre>
<pre class="programlisting">int <a href="#xmlUTF8Strsize">xmlUTF8Strsize</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int len)</pre>
<pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlUTF8Strsub">xmlUTF8Strsub</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int start, <br /> int len)</pre>
<h2>Description</h2>
@@ -97,10 +97,10 @@ A:link, A:visited, A:active { text-decoration: underline }
</pre><p>a function to provide the relative location of a UTF8 char</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><span class="term"><i><tt>utfchar</tt></i>:</span></td><td>the UTF8 character to be found</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the relative character position of the desired char or -1 if not found</td></tr></tbody></table></div><h3><a name="xmlUTF8Strndup" id="xmlUTF8Strndup"></a>Function: xmlUTF8Strndup</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlUTF8Strndup (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int len)<br />
</pre><p>a strndup for array of UTF8's</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the len of @utf (in chars)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new UTF8 * or NULL</td></tr></tbody></table></div><h3><a name="xmlUTF8Strpos" id="xmlUTF8Strpos"></a>Function: xmlUTF8Strpos</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlUTF8Strpos (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int pos)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the len of @utf (in chars)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new UTF8 * or NULL</td></tr></tbody></table></div><h3><a name="xmlUTF8Strpos" id="xmlUTF8Strpos"></a>Function: xmlUTF8Strpos</h3><pre class="programlisting">const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlUTF8Strpos (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int pos)<br />
</pre><p>a function to provide the equivalent of fetching a character from a string array</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><span class="term"><i><tt>pos</tt></i>:</span></td><td>the position of the desired UTF8 char (in chars)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the UTF8 character or NULL</td></tr></tbody></table></div><h3><a name="xmlUTF8Strsize" id="xmlUTF8Strsize"></a>Function: xmlUTF8Strsize</h3><pre class="programlisting">int xmlUTF8Strsize (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int len)<br />
-</pre><p>storage size of an UTF8 string</p>
+</pre><p>storage size of an UTF8 string the behaviour is not garanteed if the input string is not UTF-8</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the number of <a href="libxml-SAX.html#characters">characters</a> in the array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage size of the first 'len' <a href="libxml-SAX.html#characters">characters</a> of ARRAY</td></tr></tbody></table></div><h3><a name="xmlUTF8Strsub" id="xmlUTF8Strsub"></a>Function: xmlUTF8Strsub</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlUTF8Strsub (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * utf, <br /> int start, <br /> int len)<br />
</pre><p>Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><span class="term"><i><tt>start</tt></i>:</span></td><td>relative pos of first char</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>total number to copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to a newly created string or NULL if any problem</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
diff --git a/doc/html/libxml-xmlwriter.html b/doc/html/libxml-xmlwriter.html
index 071ced6..3127a8b 100644
--- a/doc/html/libxml-xmlwriter.html
+++ b/doc/html/libxml-xmlwriter.html
@@ -100,7 +100,7 @@ The content of this structure is not made public by the API.
}</pre><h3><a name="xmlFreeTextWriter" id="xmlFreeTextWriter"></a>Function: xmlFreeTextWriter</h3><pre class="programlisting">void xmlFreeTextWriter (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br />
</pre><p>Deallocate all the resources associated to the writer</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>writer</tt></i>:</span></td><td>the <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a></td></tr></tbody></table></div><h3><a name="xmlNewTextWriter" id="xmlNewTextWriter"></a>Function: xmlNewTextWriter</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriter (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out)<br />
-</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure using an <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a></p>
+</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure using an <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> NOTE: the @out parameter will be deallocated when the writer is closed (if the call succeed.)</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlNewTextWriterDoc" id="xmlNewTextWriterDoc"></a>Function: xmlNewTextWriterDoc</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriterDoc (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> * doc, <br /> int compression)<br />
</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure with @*doc as output</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>address of a <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> to hold the new XML document tree</td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>compress the output?</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlNewTextWriterFilename" id="xmlNewTextWriterFilename"></a>Function: xmlNewTextWriterFilename</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriterFilename (const char * uri, <br /> int compression)<br />
@@ -108,7 +108,7 @@ The content of this structure is not made public by the API.
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>the URI of the resource for the output</td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>compress the output?</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlNewTextWriterMemory" id="xmlNewTextWriterMemory"></a>Function: xmlNewTextWriterMemory</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriterMemory (<a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br /> int compression)<br />
</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure with @buf as output TODO: handle compression</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td><a href="libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a></td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>compress the output?</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlNewTextWriterPushParser" id="xmlNewTextWriterPushParser"></a>Function: xmlNewTextWriterPushParser</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriterPushParser (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> int compression)<br />
-</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure with @ctxt as output TODO: handle compression</p>
+</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure with @ctxt as output NOTE: the @ctxt context will be freed with the resulting writer (if the call succeeds). TODO: handle compression</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> to hold the new XML document tree</td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>compress the output?</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlNewTextWriterTree" id="xmlNewTextWriterTree"></a>Function: xmlNewTextWriterTree</h3><pre class="programlisting"><a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> xmlNewTextWriterTree (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int compression)<br />
</pre><p>Create a new <a href="libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a> structure with @doc as output starting at @node</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a></td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> or NULL for doc-&gt;children</td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>compress the output?</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlTextWriterEndAttribute" id="xmlTextWriterEndAttribute"></a>Function: xmlTextWriterEndAttribute</h3><pre class="programlisting">int xmlTextWriterEndAttribute (<a href="libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br />
diff --git a/doc/html/libxml-xpath.html b/doc/html/libxml-xpath.html
index 5594973..0fccabf 100644
--- a/doc/html/libxml-xpath.html
+++ b/doc/html/libxml-xpath.html
@@ -159,6 +159,7 @@ The content of this structure is not made public by the API.
<a name="XPATH_UNDEF_PREFIX_ERROR" id="XPATH_UNDEF_PREFIX_ERROR">XPATH_UNDEF_PREFIX_ERROR</a> = 19
<a name="XPATH_ENCODING_ERROR" id="XPATH_ENCODING_ERROR">XPATH_ENCODING_ERROR</a> = 20
<a name="XPATH_INVALID_CHAR_ERROR" id="XPATH_INVALID_CHAR_ERROR">XPATH_INVALID_CHAR_ERROR</a> = 21
+ <a name="XPATH_INVALID_CTXT" id="XPATH_INVALID_CTXT">XPATH_INVALID_CTXT</a> = 22
}
</pre><h3><a name="xmlXPathFunct" id="xmlXPathFunct">Structure xmlXPathFunct</a></h3><pre class="programlisting">Structure xmlXPathFunct<br />struct _xmlXPathFunct {
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name : the function name
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 3da8dbe..6a93755 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -1023,6 +1023,7 @@
<exports symbol='xmlRelaxNGGetValidErrors' type='function'/>
<exports symbol='xmlRelaxNGNewMemParserCtxt' type='function'/>
<exports symbol='xmlRelaxNGDump' type='function'/>
+ <exports symbol='xmlRelaxNGInitTypes' type='function'/>
<exports symbol='xmlRelaxNGValidityErrorFunc' type='function'/>
<exports symbol='xmlRelaxNGParse' type='function'/>
<exports symbol='xmlRelaxNGDumpTree' type='function'/>
@@ -1557,6 +1558,8 @@
<summary>The DTD validation</summary>
<description>API for the DTD handling and the validity checking </description>
<author>Daniel Veillard </author>
+ <exports symbol='XML_CTXT_FINISH_DTD_0' type='macro'/>
+ <exports symbol='XML_CTXT_FINISH_DTD_1' type='macro'/>
<exports symbol='xmlElementTable' type='typedef'/>
<exports symbol='xmlValidStatePtr' type='typedef'/>
<exports symbol='xmlIDTablePtr' type='typedef'/>
@@ -1992,6 +1995,7 @@
<exports symbol='XML_SCHEMAP_INVALID_ATTR_COMBINATION' type='enum'/>
<exports symbol='XML_RNGP_PARAM_FORBIDDEN' type='enum'/>
<exports symbol='XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD' type='enum'/>
+ <exports symbol='XML_FROM_WRITER' type='enum'/>
<exports symbol='XML_ERR_UNSUPPORTED_ENCODING' type='enum'/>
<exports symbol='XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME' type='enum'/>
<exports symbol='XML_ERR_ENTITYREF_IN_PROLOG' type='enum'/>
@@ -2578,6 +2582,7 @@
<exports symbol='xmlReallocFunc' type='function'/>
<exports symbol='xmlMallocFunc' type='function'/>
<exports symbol='xmlMemDisplay' type='function'/>
+ <exports symbol='xmlMemBlocks' type='function'/>
<exports symbol='xmlGcMemSetup' type='function'/>
<exports symbol='xmlMemShow' type='function'/>
<exports symbol='xmlMemoryStrdup' type='function'/>
@@ -3177,6 +3182,7 @@
<exports symbol='XPATH_RANGE' type='enum'/>
<exports symbol='XPTR_SYNTAX_ERROR' type='enum'/>
<exports symbol='XPATH_LOCATIONSET' type='enum'/>
+ <exports symbol='XPATH_INVALID_CTXT' type='enum'/>
<exports symbol='XPATH_INVALID_CHAR_ERROR' type='enum'/>
<exports symbol='XPATH_UNDEF_VARIABLE_ERROR' type='enum'/>
<exports symbol='XPATH_UNCLOSED_ERROR' type='enum'/>
@@ -3191,9 +3197,9 @@
<exports symbol='XPATH_EXPR_ERROR' type='enum'/>
<exports symbol='XPATH_VARIABLE_REF_ERROR' type='enum'/>
<exports symbol='XPATH_INVALID_TYPE' type='enum'/>
- <exports symbol='XPATH_INVALID_CTXT_SIZE' type='enum'/>
- <exports symbol='XPATH_INVALID_CTXT_POSITION' type='enum'/>
<exports symbol='XPATH_UNDEFINED' type='enum'/>
+ <exports symbol='XPATH_INVALID_CTXT_POSITION' type='enum'/>
+ <exports symbol='XPATH_INVALID_CTXT_SIZE' type='enum'/>
<exports symbol='XPATH_MEMORY_ERROR' type='enum'/>
<exports symbol='XPATH_UNFINISHED_LITERAL_ERROR' type='enum'/>
<exports symbol='XPATH_NUMBER' type='enum'/>
@@ -3751,6 +3757,12 @@
<macro name='XML_COMPLETE_ATTRS' file='parser'>
<info>Bit in the loadsubset context field to tell to do complete the elements attributes lists with the ones defaulted from the DTDs. Use it to initialize xmlLoadExtDtdDefaultValue.</info>
</macro>
+ <macro name='XML_CTXT_FINISH_DTD_0' file='valid'>
+ <info>Special value for finishDtd field when embedded in an xmlParserCtxt</info>
+ </macro>
+ <macro name='XML_CTXT_FINISH_DTD_1' file='valid'>
+ <info>Special value for finishDtd field when embedded in an xmlParserCtxt</info>
+ </macro>
<macro name='XML_DEFAULT_VERSION' file='parser'>
<info>The default version of XML used: 1.0</info>
</macro>
@@ -4465,7 +4477,7 @@
<enum name='XML_EXTERNAL_PARAMETER_ENTITY' file='entities' value='5' type='xmlEntityType'/>
<enum name='XML_FROM_C14N' file='xmlerror' value='21' type='xmlErrorDomain' info='The Canonicalization module'/>
<enum name='XML_FROM_CATALOG' file='xmlerror' value='20' type='xmlErrorDomain' info='The Catalog module'/>
- <enum name='XML_FROM_CHECK' file='xmlerror' value='24' type='xmlErrorDomain' info=' The error checking module'/>
+ <enum name='XML_FROM_CHECK' file='xmlerror' value='24' type='xmlErrorDomain' info='The error checking module'/>
<enum name='XML_FROM_DATATYPE' file='xmlerror' value='15' type='xmlErrorDomain' info='The W3C XML Schemas Datatype module'/>
<enum name='XML_FROM_DTD' file='xmlerror' value='4' type='xmlErrorDomain' info='The XML DTD validation with parser contex'/>
<enum name='XML_FROM_FTP' file='xmlerror' value='9' type='xmlErrorDomain' info='The FTP module'/>
@@ -4484,6 +4496,7 @@
<enum name='XML_FROM_SCHEMASV' file='xmlerror' value='17' type='xmlErrorDomain' info='The W3C XML Schemas validation module'/>
<enum name='XML_FROM_TREE' file='xmlerror' value='2' type='xmlErrorDomain' info='The tree module'/>
<enum name='XML_FROM_VALID' file='xmlerror' value='23' type='xmlErrorDomain' info='The XML DTD validation with valid context'/>
+ <enum name='XML_FROM_WRITER' file='xmlerror' value='25' type='xmlErrorDomain' info=' The xmlwriter module'/>
<enum name='XML_FROM_XINCLUDE' file='xmlerror' value='11' type='xmlErrorDomain' info='The XInclude processing'/>
<enum name='XML_FROM_XPATH' file='xmlerror' value='12' type='xmlErrorDomain' info='The XPath module'/>
<enum name='XML_FROM_XPOINTER' file='xmlerror' value='13' type='xmlErrorDomain' info='The XPointer module'/>
@@ -5244,6 +5257,7 @@
<enum name='XPATH_EXPR_ERROR' file='xpath' value='7' type='xmlXPathError'/>
<enum name='XPATH_INVALID_ARITY' file='xpath' value='12' type='xmlXPathError'/>
<enum name='XPATH_INVALID_CHAR_ERROR' file='xpath' value='21' type='xmlXPathError'/>
+ <enum name='XPATH_INVALID_CTXT' file='xpath' value='22' type='xmlXPathError'/>
<enum name='XPATH_INVALID_CTXT_POSITION' file='xpath' value='14' type='xmlXPathError'/>
<enum name='XPATH_INVALID_CTXT_SIZE' file='xpath' value='13' type='xmlXPathError'/>
<enum name='XPATH_INVALID_OPERAND' file='xpath' value='10' type='xmlXPathError'/>
@@ -6125,7 +6139,7 @@ actually an xmlCharEncoding'/>
<field name='nodeNr' type='int' info=' Depth of the parsing stack'/>
<field name='nodeMax' type='int' info=' Max depth of the parsing stack'/>
<field name='nodeTab' type='xmlNodePtr *' info=' array of nodes'/>
- <field name='finishDtd' type='int' info=' finished validating the Dtd ?'/>
+ <field name='finishDtd' type='unsigned int' info=' finished validating the Dtd ?'/>
<field name='doc' type='xmlDocPtr' info=' the document'/>
<field name='valid' type='int' info=' temporary validity check result state state used for non-determinist content validation'/>
<field name='vstate' type='xmlValidState *' info=' current state'/>
@@ -8866,7 +8880,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlFileRead' file='xmlIO'>
<info>Read @len bytes to @buffer from the I/O channel.</info>
- <return type='int' info='the number of bytes written'/>
+ <return type='int' info='the number of bytes written or &lt; 0 in case of failure'/>
<arg name='context' type='void *' info='the I/O context'/>
<arg name='buffer' type='char *' info='where to drop data'/>
<arg name='len' type='int' info='number of bytes to write'/>
@@ -9735,7 +9749,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlListEmpty' file='list'>
<info>Is the list empty ?</info>
- <return type='int' info='1 if the list is empty, 0 otherwise'/>
+ <return type='int' info='1 if the list is empty, 0 if not empty and -1 in case of error'/>
<arg name='l' type='xmlListPtr' info='a list'/>
</function>
<function name='xmlListEnd' file='list'>
@@ -9826,7 +9840,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlListSize' file='list'>
<info>Get the number of elements in the list</info>
- <return type='int' info='the number of elements in the list'/>
+ <return type='int' info='the number of elements in the list or -1 in case of error'/>
<arg name='l' type='xmlListPtr' info='a list'/>
</function>
<function name='xmlListSort' file='list'>
@@ -9914,6 +9928,10 @@ actually an xmlCharEncoding'/>
<arg name='file' type='const char *' info='the file name or NULL'/>
<arg name='line' type='int' info='the line number'/>
</function>
+ <function name='xmlMemBlocks' file='xmlmemory'>
+ <info>Provides the number of memory areas currently allocated</info>
+ <return type='int' info='an int representing the number of blocks'/>
+ </function>
<function name='xmlMemDisplay' file='xmlmemory'>
<info>show in-extenso the memory blocks allocated</info>
<return type='void'/>
@@ -10044,14 +10062,14 @@ actually an xmlCharEncoding'/>
<info>Tries to change the remote directory</info>
<return type='int' info='-1 incase of error, 1 if CWD worked, 0 if it failed'/>
<arg name='ctx' type='void *' info='an FTP context'/>
- <arg name='directory' type='char *' info='a directory on the server'/>
+ <arg name='directory' type='const char *' info='a directory on the server'/>
</function>
<function name='xmlNanoFTPDele' file='nanoftp'>
<cond>LIBXML_FTP_ENABLED</cond>
<info>Tries to delete an item (file or directory) from server</info>
<return type='int' info='-1 incase of error, 1 if DELE worked, 0 if it failed'/>
<arg name='ctx' type='void *' info='an FTP context'/>
- <arg name='file' type='char *' info='a file or directory on the server'/>
+ <arg name='file' type='const char *' info='a file or directory on the server'/>
</function>
<function name='xmlNanoFTPFreeCtxt' file='nanoftp'>
<cond>LIBXML_FTP_ENABLED</cond>
@@ -10099,7 +10117,7 @@ actually an xmlCharEncoding'/>
<arg name='ctx' type='void *' info='an FTP context'/>
<arg name='callback' type='ftpListCallback' info='the user callback'/>
<arg name='userData' type='void *' info='the user callback data'/>
- <arg name='filename' type='char *' info='optional files to list'/>
+ <arg name='filename' type='const char *' info='optional files to list'/>
</function>
<function name='xmlNanoFTPNewCtxt' file='nanoftp'>
<cond>LIBXML_FTP_ENABLED</cond>
@@ -10533,7 +10551,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlNewTextWriter' file='xmlwriter'>
<cond>LIBXML_WRITER_ENABLED</cond>
- <info>Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr</info>
+ <info>Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr NOTE: the @out parameter will be deallocated when the writer is closed (if the call succeed.)</info>
<return type='xmlTextWriterPtr' info='the new xmlTextWriterPtr or NULL in case of error'/>
<arg name='out' type='xmlOutputBufferPtr' info='an xmlOutputBufferPtr'/>
</function>
@@ -10560,7 +10578,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlNewTextWriterPushParser' file='xmlwriter'>
<cond>LIBXML_WRITER_ENABLED</cond>
- <info>Create a new xmlNewTextWriter structure with @ctxt as output TODO: handle compression</info>
+ <info>Create a new xmlNewTextWriter structure with @ctxt as output NOTE: the @ctxt context will be freed with the resulting writer (if the call succeeds). TODO: handle compression</info>
<return type='xmlTextWriterPtr' info='the new xmlTextWriterPtr or NULL in case of error'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='xmlParserCtxtPtr to hold the new XML document tree'/>
<arg name='compression' type='int' info='compress the output?'/>
@@ -11767,6 +11785,11 @@ actually an xmlCharEncoding'/>
<arg name='warn' type='xmlRelaxNGValidityWarningFunc *' info='the warning function result'/>
<arg name='ctx' type='void **' info='the functions context result'/>
</function>
+ <function name='xmlRelaxNGInitTypes' file='relaxng'>
+ <cond>LIBXML_SCHEMAS_ENABLED</cond>
+ <info>Initilize the default type libraries.</info>
+ <return type='int' info='0 in case of success and -1 in case of error.'/>
+ </function>
<function name='xmlRelaxNGNewDocParserCtxt' file='relaxng'>
<cond>LIBXML_SCHEMAS_ENABLED</cond>
<info>Create an XML RelaxNGs parser context for that document. Note: since the process of compiling a RelaxNG schemas modifies the document, the @doc parameter is duplicated internally.</info>
@@ -12244,7 +12267,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlSaveFileTo' file='tree'>
<cond>LIBXML_OUTPUT_ENABLED</cond>
- <info>Dump an XML document to an I/O buffer.</info>
+ <info>Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.</info>
<return type='int' info='the number of bytes written or -1 in case of failure.'/>
<arg name='buf' type='xmlOutputBufferPtr' info='an output I/O buffer'/>
<arg name='cur' type='xmlDocPtr' info='the document'/>
@@ -12275,7 +12298,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlSaveFormatFileTo' file='tree'>
<cond>LIBXML_OUTPUT_ENABLED</cond>
- <info>Dump an XML document to an I/O buffer. NOTE: the I/O buffer is closed as part of the call.</info>
+ <info>Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.</info>
<return type='int' info='the number of bytes written or -1 in case of failure.'/>
<arg name='buf' type='xmlOutputBufferPtr' info='an output I/O buffer'/>
<arg name='cur' type='xmlDocPtr' info='the document'/>
@@ -12735,6 +12758,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShell' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.</info>
<return type='void'/>
<arg name='doc' type='xmlDocPtr' info='the initial document'/>
@@ -12744,6 +12768,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellBase' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;base&quot; dumps the current XML base of the node</info>
<return type='int' info='0'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12753,6 +12778,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellCat' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;cat&quot; dumps the serialization node content (XML or HTML).</info>
<return type='int' info='0'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12762,6 +12788,7 @@ actually an xmlCharEncoding'/>
</function>
<functype name='xmlShellCmd' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>This is a generic signature for the XML shell functions.</info>
<return type='int' info='an int, negative returns indicating errors.'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='a shell context'/>
@@ -12771,6 +12798,7 @@ actually an xmlCharEncoding'/>
</functype>
<function name='xmlShellDir' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;dir&quot; dumps informations about the node (namespace, attributes, content).</info>
<return type='int' info='0'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12780,6 +12808,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellDu' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;du&quot; show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</info>
<return type='int' info='0 or -1 in case of error'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12789,6 +12818,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellList' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;ls&quot; Does an Unix like listing of the given node (like a directory)</info>
<return type='int' info='0'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12798,6 +12828,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellLoad' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;load&quot; loads a new document specified by the filename</info>
<return type='int' info='0 or -1 if loading failed'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12807,12 +12838,14 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellPrintNode' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Print node to the output FILE</info>
<return type='void'/>
<arg name='node' type='xmlNodePtr' info='a non-null node to print to the output FILE'/>
</function>
<function name='xmlShellPrintXPathError' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Print the xpath error to libxml default error channel</info>
<return type='void'/>
<arg name='errorType' type='int' info='valid xpath error id'/>
@@ -12820,12 +12853,14 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellPrintXPathResult' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Prints result to the output FILE</info>
<return type='void'/>
<arg name='list' type='xmlXPathObjectPtr' info='a valid result generated by an xpath evaluation'/>
</function>
<function name='xmlShellPwd' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;pwd&quot; Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.</info>
<return type='int' info='0 or -1 in case of error'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12835,12 +12870,14 @@ actually an xmlCharEncoding'/>
</function>
<functype name='xmlShellReadlineFunc' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>This is a generic signature for the XML shell input function.</info>
<return type='char *' info='a string which will be freed by the Shell.'/>
<arg name='prompt' type='char *' info='a string prompt'/>
</functype>
<function name='xmlShellSave' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<cond>LIBXML_OUTPUT_ENABLED</cond>
<info>Implements the XML shell function &quot;save&quot; Write the current document to the filename, or it&apos;s original name</info>
<return type='int' info='0 or -1 in case of error'/>
@@ -12851,6 +12888,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellValidate' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<info>Implements the XML shell function &quot;validate&quot; Validate the document, if a DTD path is provided, then the validation is done against the given DTD.</info>
<return type='int' info='0 or -1 in case of error'/>
<arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
@@ -12860,6 +12898,7 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlShellWrite' file='debugXML'>
<cond>LIBXML_DEBUG_ENABLED</cond>
+ <cond>LIBXML_XPATH_ENABLED</cond>
<cond>LIBXML_OUTPUT_ENABLED</cond>
<info>Implements the XML shell function &quot;write&quot; Write the current node to the filename, it saves the serialization of the subtree under the @node specified</info>
<return type='int' info='0 or -1 in case of error'/>
@@ -15263,12 +15302,12 @@ actually an xmlCharEncoding'/>
</function>
<function name='xmlUTF8Strpos' file='xmlstring'>
<info>a function to provide the equivalent of fetching a character from a string array</info>
- <return type='xmlChar *' info='a pointer to the UTF8 character or NULL'/>
+ <return type='const xmlChar *' info='a pointer to the UTF8 character or NULL'/>
<arg name='utf' type='const xmlChar *' info='the input UTF8 *'/>
<arg name='pos' type='int' info='the position of the desired UTF8 char (in chars)'/>
</function>
<function name='xmlUTF8Strsize' file='xmlstring'>
- <info>storage size of an UTF8 string</info>
+ <info>storage size of an UTF8 string the behaviour is not garanteed if the input string is not UTF-8</info>
<return type='int' info='the storage size of the first &apos;len&apos; characters of ARRAY'/>
<arg name='utf' type='const xmlChar *' info='a sequence of UTF-8 encoded bytes'/>
<arg name='len' type='int' info='the number of characters in the array'/>
diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa
index d093fb7..a4def81 100644
--- a/doc/libxml2.xsa
+++ b/doc/libxml2.xsa
@@ -8,19 +8,24 @@
</vendor>
<product id="libxml2">
<name>libxml2</name>
- <version>2.6.13</version>
- <last-release> Aug 31 2004</last-release>
+ <version>2.6.15</version>
+ <last-release> Oct 27 2004</last-release>
<info-url>http://xmlsoft.org/</info-url>
- <changes> - build fixes: Windows and zlib (Igor Zlatkovic), -O flag with gcc,
- Solaris compiler warning, fixing RPM BuildRequires,
- - fixes: DTD loading on Windows (Igor), Schemas error reports APIs
- (Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 (William Brack
- and Julius Mittenzwei), Schemas facet check (Kasimier), default namespace
- problem (William), Schemas hexbinary empty values, encoding error could
- genrate a serialization loop.
- - Improvements: Schemas validity improvements (Kasimier), added --path
- and --load-trace options to xmllint
- - documentation: tutorial update (John Fleck)
+ <changes> - security fixes on the nanoftp and nanohttp modules
+ - build fixes: xmllint detection bug in configure, building outside the
+ source tree (Thomas Fitzsimmons)
+ - bug fixes: HTML parser on broken ASCII chars in names (William), Python
+ paths (Malcolm Tredinnick), xmlHasNsProp and default namespace (William),
+ saving to python file objects (Malcolm Tredinnick), DTD lookup fix
+ (Malcolm), save back &lt;group&gt; in catalogs (William), tree build
+ fixes (DV and Rob Richards), Schemas memory bug, structured error handler
+ on Python 64bits, thread local memory deallocation, memory leak reported
+ by Volker Roth, xmlValidateDtd in the presence of an internal subset,
+ entities and _private problem (William), xmlBuildRelativeURI error
+ (William).
+ - improvements: better XInclude error reports (William), tree debugging
+ module and tests, convenience functions at the Reader API (Graham
+ Bennett), add support for PI in the HTML parser.
</changes>
</product>
diff --git a/doc/news.html b/doc/news.html
index d625f1d..6cbd423 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -12,7 +12,17 @@ to help those</p><ul><li>More testing on RelaxNG</li>
<li>Finishing up <a href="http://www.w3.org/TR/xmlschema-1/">XML
Schemas</a></li>
</ul><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="http://cvs.gnome.org/viewcvs/libxml2/">CVS</a> code base.</p><p>There is the list of public releases:</p><p>2.6.15: Oct 27 2004</p><ul><li>security fixes on the nanoftp and nanohttp modules</li>
+to the <a href="http://cvs.gnome.org/viewcvs/libxml2/">CVS</a> code base.</p><p>There is the list of public releases:</p><h3>2.6.16: Nov 10 2004</h3><ul><li>general hardening and bug fixing crossing all the API based on new
+ automated regression testing</li>
+ <li>build fix: IPv6 build and test on AIX (Dodji Seketeli)</li>
+ <li>bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
+ conversion functions return values, UTF-8 bug affecting XPath reported by
+ Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
+ <li>documentation: fix to xmllint man page, some API function descritpion
+ were updated.</li>
+ <li>improvements: DTD validation APIs provided at the Python level (Brent
+ Hendricks) </li>
+</ul><h3>2.6.15: Oct 27 2004</h3><ul><li>security fixes on the nanoftp and nanohttp modules</li>
<li>build fixes: xmllint detection bug in configure, building outside the
source tree (Thomas Fitzsimmons)</li>
<li>bug fixes: HTML parser on broken ASCII chars in names (William), Python
diff --git a/doc/xml.html b/doc/xml.html
index c373b2d..e0e484f 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -680,7 +680,21 @@ to the <a href="http://cvs.gnome.org/viewcvs/libxml2/">CVS</a> code base.</p>
<p>There is the list of public releases:</p>
-<p>2.6.15: Oct 27 2004</p>
+<h3>2.6.16: Nov 10 2004</h3>
+<ul>
+ <li>general hardening and bug fixing crossing all the API based on new
+ automated regression testing</li>
+ <li>build fix: IPv6 build and test on AIX (Dodji Seketeli)</li>
+ <li>bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
+ conversion functions return values, UTF-8 bug affecting XPath reported by
+ Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
+ <li>documentation: fix to xmllint man page, some API function descritpion
+ were updated.</li>
+ <li>improvements: DTD validation APIs provided at the Python level (Brent
+ Hendricks) </li>
+</ul>
+
+<h3>2.6.15: Oct 27 2004</h3>
<ul>
<li>security fixes on the nanoftp and nanohttp modules</li>
<li>build fixes: xmllint detection bug in configure, building outside the
diff --git a/doc/xmllint.1 b/doc/xmllint.1
index 7d2a513..3875961 100644
--- a/doc/xmllint.1
+++ b/doc/xmllint.1
@@ -31,7 +31,7 @@ xmllint \- command line XML tool
.SH "INTRODUCTION"
.PP
-The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in XML code and in the XML parser itself\&.
+The xmllint program parses one or more XML files, specified on the command line as \fIxmlfile\fR (or the standard input if the filename provided is \- )\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in XML code and in the XML parser itself\&.
.PP
It is included in libxml2\&.
diff --git a/doc/xmllint.xml b/doc/xmllint.xml
index e0ba0ee..8ab468f 100644
--- a/doc/xmllint.xml
+++ b/doc/xmllint.xml
@@ -104,7 +104,8 @@
<title>Introduction</title>
<para>
The xmllint program parses one or more XML files, specified on the
- command line as <replaceable>xmlfile</replaceable>. It prints various
+ command line as <replaceable>xmlfile</replaceable> (or the standard
+ input if the filename provided is - ). It prints various
types of output, depending upon the options selected. It is useful for
detecting errors both in <acronym>XML</acronym> code and in the
<acronym>XML</acronym> parser itself.
diff --git a/elfgcchack.h b/elfgcchack.h
index 2fd2ee4..3f430fe 100644
--- a/elfgcchack.h
+++ b/elfgcchack.h
@@ -2154,6 +2154,10 @@ extern __typeof (xmlMallocLoc) xmlMallocLoc__internal_alias __attribute((visibil
extern __typeof (xmlMallocLoc) xmlMallocLoc __attribute((alias("xmlMallocLoc__internal_alias")));
#define xmlMallocLoc xmlMallocLoc__internal_alias
+extern __typeof (xmlMemBlocks) xmlMemBlocks__internal_alias __attribute((visibility("hidden")));
+extern __typeof (xmlMemBlocks) xmlMemBlocks __attribute((alias("xmlMemBlocks__internal_alias")));
+#define xmlMemBlocks xmlMemBlocks__internal_alias
+
extern __typeof (xmlMemDisplay) xmlMemDisplay__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlMemDisplay) xmlMemDisplay __attribute((alias("xmlMemDisplay__internal_alias")));
#define xmlMemDisplay xmlMemDisplay__internal_alias
@@ -3479,6 +3483,12 @@ extern __typeof (xmlRelaxNGGetValidErrors) xmlRelaxNGGetValidErrors __attribute(
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
+extern __typeof (xmlRelaxNGInitTypes) xmlRelaxNGInitTypes__internal_alias __attribute((visibility("hidden")));
+extern __typeof (xmlRelaxNGInitTypes) xmlRelaxNGInitTypes __attribute((alias("xmlRelaxNGInitTypes__internal_alias")));
+#define xmlRelaxNGInitTypes xmlRelaxNGInitTypes__internal_alias
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
extern __typeof (xmlRelaxNGNewDocParserCtxt) xmlRelaxNGNewDocParserCtxt__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlRelaxNGNewDocParserCtxt) xmlRelaxNGNewDocParserCtxt __attribute((alias("xmlRelaxNGNewDocParserCtxt__internal_alias")));
#define xmlRelaxNGNewDocParserCtxt xmlRelaxNGNewDocParserCtxt__internal_alias
@@ -4167,92 +4177,120 @@ extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer __attribute((a
#define xmlSetupParserForBuffer xmlSetupParserForBuffer__internal_alias
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShell) xmlShell__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShell) xmlShell __attribute((alias("xmlShell__internal_alias")));
#define xmlShell xmlShell__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellBase) xmlShellBase__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellBase) xmlShellBase __attribute((alias("xmlShellBase__internal_alias")));
#define xmlShellBase xmlShellBase__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellCat) xmlShellCat__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellCat) xmlShellCat __attribute((alias("xmlShellCat__internal_alias")));
#define xmlShellCat xmlShellCat__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellDir) xmlShellDir__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellDir) xmlShellDir __attribute((alias("xmlShellDir__internal_alias")));
#define xmlShellDir xmlShellDir__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellDu) xmlShellDu__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellDu) xmlShellDu __attribute((alias("xmlShellDu__internal_alias")));
#define xmlShellDu xmlShellDu__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellList) xmlShellList__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellList) xmlShellList __attribute((alias("xmlShellList__internal_alias")));
#define xmlShellList xmlShellList__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellLoad) xmlShellLoad__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellLoad) xmlShellLoad __attribute((alias("xmlShellLoad__internal_alias")));
#define xmlShellLoad xmlShellLoad__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellPrintNode) xmlShellPrintNode__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellPrintNode) xmlShellPrintNode __attribute((alias("xmlShellPrintNode__internal_alias")));
#define xmlShellPrintNode xmlShellPrintNode__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError __attribute((alias("xmlShellPrintXPathError__internal_alias")));
#define xmlShellPrintXPathError xmlShellPrintXPathError__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult __attribute((alias("xmlShellPrintXPathResult__internal_alias")));
#define xmlShellPrintXPathResult xmlShellPrintXPathResult__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellPwd) xmlShellPwd__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellPwd) xmlShellPwd __attribute((alias("xmlShellPwd__internal_alias")));
#define xmlShellPwd xmlShellPwd__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
extern __typeof (xmlShellSave) xmlShellSave__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellSave) xmlShellSave __attribute((alias("xmlShellSave__internal_alias")));
#define xmlShellSave xmlShellSave__internal_alias
#endif
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
extern __typeof (xmlShellValidate) xmlShellValidate__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellValidate) xmlShellValidate __attribute((alias("xmlShellValidate__internal_alias")));
#define xmlShellValidate xmlShellValidate__internal_alias
#endif
+#endif
#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
extern __typeof (xmlShellWrite) xmlShellWrite__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlShellWrite) xmlShellWrite __attribute((alias("xmlShellWrite__internal_alias")));
#define xmlShellWrite xmlShellWrite__internal_alias
#endif
#endif
+#endif
extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars__internal_alias __attribute((visibility("hidden")));
extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars __attribute((alias("xmlSkipBlankChars__internal_alias")));
diff --git a/encoding.c b/encoding.c
index e05c375..6483322 100644
--- a/encoding.c
+++ b/encoding.c
@@ -125,7 +125,7 @@ asciiToUTF8(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = processed - base;
- return(0);
+ return(*outlen);
}
#ifdef LIBXML_OUTPUT_ENABLED
@@ -155,6 +155,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
unsigned int c, d;
int trailing;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
if (in == NULL) {
/*
* initialization nothing to do
@@ -209,7 +210,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = processed - instart;
- return(0);
+ return(*outlen);
}
#endif /* LIBXML_OUTPUT_ENABLED */
@@ -232,10 +233,14 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen) {
unsigned char* outstart = out;
const unsigned char* base = in;
- unsigned char* outend = out + *outlen;
+ unsigned char* outend;
const unsigned char* inend;
const unsigned char* instop;
+ if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
+ return(-1);
+
+ outend = out + *outlen;
inend = in + (*inlen);
instop = inend;
@@ -255,7 +260,7 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = in - base;
- return(0);
+ return(*outlen);
}
/**
@@ -291,7 +296,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
*outlen = len;
*inlenb = len;
- return(0);
+ return(*outlen);
}
@@ -322,6 +327,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
unsigned int c, d;
int trailing;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
if (in == NULL) {
/*
* initialization nothing to do
@@ -381,7 +387,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = processed - instart;
- return(0);
+ return(*outlen);
}
#endif /* LIBXML_OUTPUT_ENABLED */
@@ -470,7 +476,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlenb = processed - inb;
- return(0);
+ return(*outlen);
}
#ifdef LIBXML_OUTPUT_ENABLED
@@ -503,6 +509,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
unsigned short tmp1, tmp2;
/* UTF16LE encoding has no BOM */
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
if (in == NULL) {
*outlen = 0;
*inlen = 0;
@@ -578,7 +585,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
}
*outlen = (out - outstart) * 2;
*inlen = processed - instart;
- return(0);
+ return(*outlen);
}
/**
@@ -710,7 +717,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlenb = processed - inb;
- return(0);
+ return(*outlen);
}
#ifdef LIBXML_OUTPUT_ENABLED
@@ -743,6 +750,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
unsigned short tmp1, tmp2;
/* UTF-16BE has no BOM */
+ if ((outb == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
if (in == NULL) {
*outlen = 0;
*inlen = 0;
@@ -815,7 +823,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
}
*outlen = (out - outstart) * 2;
*inlen = processed - instart;
- return(0);
+ return(*outlen);
}
#endif /* LIBXML_OUTPUT_ENABLED */
@@ -839,6 +847,8 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
xmlCharEncoding
xmlDetectCharEncoding(const unsigned char* in, int len)
{
+ if (in == NULL)
+ return(XML_CHAR_ENCODING_NONE);
if (len >= 4) {
if ((in[0] == 0x00) && (in[1] == 0x00) &&
(in[2] == 0x00) && (in[3] == 0x3C))
@@ -1653,15 +1663,19 @@ xmlFindCharEncodingHandler(const char *name) {
* The value of @outlen after return is the number of ocetes consumed.
*/
static int
-xmlIconvWrapper(iconv_t cd,
- unsigned char *out, int *outlen,
- const unsigned char *in, int *inlen) {
-
- size_t icv_inlen = *inlen, icv_outlen = *outlen;
+xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
+ const unsigned char *in, int *inlen) {
+ size_t icv_inlen, icv_outlen;
const char *icv_in = (const char *) in;
char *icv_out = (char *) out;
int ret;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
+ if (outlen != NULL) *outlen = 0;
+ return(-1);
+ }
+ icv_inlen = *inlen;
+ icv_outlen = *outlen;
ret = iconv(cd, (char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
if (in != NULL) {
*inlen -= icv_inlen;
@@ -2154,7 +2168,7 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
written = 32000;
ret = xmlIconvWrapper(handler->iconv_out, &convbuf[0],
&written, cur, &toconv);
- if (ret == -1) {
+ if (ret < 0) {
if (written > 0)
ret = -2;
else
@@ -2203,6 +2217,9 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
const unsigned char* inend;
const unsigned char* instart = in;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
+ (xlattable == NULL))
+ return(-1);
if (in == NULL) {
/*
* initialization nothing to do
@@ -2290,7 +2307,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = in - instart;
- return(0);
+ return(*outlen);
}
/**
@@ -2311,12 +2328,18 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen,
unsigned short const *unicodetable) {
unsigned char* outstart = out;
- unsigned char* outend = out + *outlen;
+ unsigned char* outend;
const unsigned char* instart = in;
- const unsigned char* inend = in + *inlen;
+ const unsigned char* inend;
const unsigned char* instop = inend;
- unsigned int c = *in;
+ unsigned int c;
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
+ (in == NULL) || (xlattable == NULL))
+ return(-1);
+ outend = out + *outlen;
+ inend = in + *inlen;
+ c = *in;
while (in < inend && out < outend - 1) {
if (c >= 0x80) {
c = unicodetable [c - 0x80];
@@ -2350,7 +2373,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
}
*outlen = out - outstart;
*inlen = in - instart;
- return (0);
+ return (*outlen);
}
diff --git a/entities.c b/entities.c
index 5b6f931..913a4e6 100644
--- a/entities.c
+++ b/entities.c
@@ -61,6 +61,31 @@ static xmlEntity xmlEntityApos = {
NULL, NULL, NULL, NULL, 0
};
+/**
+ * xmlEntitiesErrMemory:
+ * @extra: extra informations
+ *
+ * Handle an out of memory condition
+ */
+static void
+xmlEntitiesErrMemory(const char *extra)
+{
+ __xmlSimpleError(XML_FROM_TREE, XML_ERR_NO_MEMORY, NULL, NULL, extra);
+}
+
+/**
+ * xmlEntitiesErr:
+ * @code: the error code
+ * @msg: the message
+ *
+ * Handle an out of memory condition
+ */
+static void
+xmlEntitiesErr(xmlParserErrors code, const char *msg)
+{
+ __xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL);
+}
+
/*
* xmlFreeEntity : clean-up an entity record.
*/
@@ -118,8 +143,7 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
return(NULL);
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlAddEntity: out of memory\n");
+ xmlEntitiesErrMemory("xmlAddEntity:: malloc failed");
return(NULL);
}
memset(ret, 0, sizeof(xmlEntity));
@@ -213,13 +237,13 @@ xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type,
xmlDtdPtr dtd;
if (doc == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlAddDtdEntity: doc == NULL !\n");
+ xmlEntitiesErr(XML_DTD_NO_DOC,
+ "xmlAddDtdEntity: document is NULL");
return(NULL);
}
if (doc->extSubset == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlAddDtdEntity: document without external subset !\n");
+ xmlEntitiesErr(XML_DTD_NO_DTD,
+ "xmlAddDtdEntity: document without external subset");
return(NULL);
}
dtd = doc->extSubset;
@@ -262,13 +286,13 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
xmlDtdPtr dtd;
if (doc == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlAddDocEntity: document is NULL !\n");
+ xmlEntitiesErr(XML_DTD_NO_DOC,
+ "xmlAddDocEntity: document is NULL");
return(NULL);
}
if (doc->intSubset == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlAddDocEntity: document without internal subset !\n");
+ xmlEntitiesErr(XML_DTD_NO_DTD,
+ "xmlAddDocEntity: document without internal subset");
return(NULL);
}
dtd = doc->intSubset;
@@ -404,7 +428,7 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
buffer = (xmlChar *) \
xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
if (buffer == NULL) { \
- xmlGenericError(xmlGenericErrorContext, "realloc failed\n"); \
+ xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed");\
return(NULL); \
} \
}
@@ -440,7 +464,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
buffer_size = 1000;
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
- xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
+ xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: malloc failed");
return(NULL);
}
out = buffer;
@@ -498,8 +522,8 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
int val = 0, l = 1;
if (*cur < 0xC0) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlEncodeEntitiesReentrant : input not UTF-8\n");
+ xmlEntitiesErr(XML_CHECK_NOT_UTF8,
+ "xmlEncodeEntitiesReentrant : input not UTF-8");
if (doc != NULL)
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
snprintf(buf, sizeof(buf), "&#%d;", *cur);
@@ -531,7 +555,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
l = 4;
}
if ((l == 1) || (!IS_CHAR(val))) {
- xmlGenericError(xmlGenericErrorContext,
+ xmlEntitiesErr(XML_ERR_INVALID_CHAR,
"xmlEncodeEntitiesReentrant : char out of range\n");
if (doc != NULL)
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
@@ -593,7 +617,7 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
buffer_size = 1000;
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) {
- xmlGenericError(xmlGenericErrorContext, "malloc failed\n");
+ xmlEntitiesErrMemory("xmlEncodeSpecialChars: malloc failed");
return(NULL);
}
out = buffer;
@@ -703,8 +727,7 @@ xmlCopyEntity(xmlEntityPtr ent) {
cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
if (cur == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlCopyEntity: out of memory !\n");
+ xmlEntitiesErrMemory("xmlCopyEntity:: malloc failed");
return(NULL);
}
memset(cur, 0, sizeof(xmlEntity));
@@ -792,6 +815,7 @@ xmlDumpEntityContent(xmlBufferPtr buf, const xmlChar *content) {
*/
void
xmlDumpEntityDecl(xmlBufferPtr buf, xmlEntityPtr ent) {
+ if ((buf == NULL) || (ent == NULL)) return;
switch (ent->etype) {
case XML_INTERNAL_GENERAL_ENTITY:
xmlBufferWriteChar(buf, "<!ENTITY ");
@@ -863,9 +887,8 @@ xmlDumpEntityDecl(xmlBufferPtr buf, xmlEntityPtr ent) {
xmlBufferWriteChar(buf, ">\n");
break;
default:
- xmlGenericError(xmlGenericErrorContext,
- "xmlDumpEntitiesDecl: internal: unknown type %d\n",
- ent->etype);
+ xmlEntitiesErr(XML_DTD_UNKNOWN_ENTITY,
+ "xmlDumpEntitiesDecl: internal: unknown type entity type");
}
}
diff --git a/gentest.py b/gentest.py
new file mode 100755
index 0000000..8975cd9
--- /dev/null
+++ b/gentest.py
@@ -0,0 +1,889 @@
+#!/usr/bin/python -u
+#
+# generate a tester program for the API
+#
+import sys
+import os
+import string
+try:
+ import libxml2
+except:
+ print "libxml2 python bindings not available, skipping testapi.c generation"
+ sys.exit(0)
+
+#
+# Modules we don't want skip in API test
+#
+skipped_modules = [ "SAX", "xlink", "threads", "globals",
+ "xmlmemory", "xmlversion", "xmlexports",
+ #deprecated
+ "DOCBparser",
+]
+
+#
+# defines for each module
+#
+modules_defines = {
+ "HTMLparser": "LIBXML_HTML_ENABLED",
+ "catalog": "LIBXML_CATALOG_ENABLED",
+ "xmlreader": "LIBXML_READER_ENABLED",
+ "relaxng": "LIBXML_SCHEMAS_ENABLED",
+ "schemasInternals": "LIBXML_SCHEMAS_ENABLED",
+ "xmlschemas": "LIBXML_SCHEMAS_ENABLED",
+ "xmlschemastypes": "LIBXML_SCHEMAS_ENABLED",
+ "xpath": "LIBXML_XPATH_ENABLED",
+ "xpathInternals": "LIBXML_XPATH_ENABLED",
+ "xinclude": "LIBXML_XINCLUDE_ENABLED",
+ "xpointer": "LIBXML_XPTR_ENABLED",
+ "xmlregexp" : "LIBXML_REGEXP_ENABLED",
+ "xmlautomata" : "LIBXML_AUTOMATA_ENABLED",
+ "xmlsave" : "LIBXML_OUTPUT_ENABLED",
+ "DOCBparser" : "LIBXML_DOCB_ENABLED",
+}
+
+#
+# defines for specific functions
+#
+function_defines = {
+ "htmlDefaultSAXHandlerInit": "LIBXML_HTML_ENABLED",
+ "xmlSAX2EndElement" : "LIBXML_SAX1_ENABLED",
+ "xmlSAX2StartElement" : "LIBXML_SAX1_ENABLED",
+ "xmlSAXDefaultVersion" : "LIBXML_SAX1_ENABLED",
+ "UTF8Toisolat1" : "LIBXML_OUTPUT_ENABLED",
+ "xmlCleanupPredefinedEntities": "LIBXML_LEGACY_ENABLED",
+ "xmlInitializePredefinedEntities": "LIBXML_LEGACY_ENABLED",
+ "xmlSetFeature": "LIBXML_LEGACY_ENABLED",
+ "xmlGetFeature": "LIBXML_LEGACY_ENABLED",
+ "xmlGetFeaturesList": "LIBXML_LEGACY_ENABLED",
+ "xmlIOParseDTD": "LIBXML_VALID_ENABLED",
+ "xmlParseDTD": "LIBXML_VALID_ENABLED",
+ "xmlParseDoc": "LIBXML_SAX1_ENABLED",
+ "xmlParseMemory": "LIBXML_SAX1_ENABLED",
+ "xmlRecoverDoc": "LIBXML_SAX1_ENABLED",
+ "xmlParseFile": "LIBXML_SAX1_ENABLED",
+ "xmlRecoverFile": "LIBXML_SAX1_ENABLED",
+ "xmlRecoverMemory": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseFileWithData": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseMemory": "LIBXML_SAX1_ENABLED",
+ "xmlSAXUserParseMemory": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseDoc": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseDTD": "LIBXML_SAX1_ENABLED",
+ "xmlSAXUserParseFile": "LIBXML_SAX1_ENABLED",
+ "xmlParseEntity": "LIBXML_SAX1_ENABLED",
+ "xmlParseExternalEntity": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseMemoryWithData": "LIBXML_SAX1_ENABLED",
+ "xmlParseBalancedChunkMemory": "LIBXML_SAX1_ENABLED",
+ "xmlParseBalancedChunkMemoryRecover": "LIBXML_SAX1_ENABLED",
+ "xmlSetupParserForBuffer": "LIBXML_SAX1_ENABLED",
+ "xmlStopParser": "LIBXML_PUSH_ENABLED",
+ "xmlAttrSerializeTxtContent": "LIBXML_OUTPUT_ENABLED",
+ "xmlSAXParseFile": "LIBXML_SAX1_ENABLED",
+ "xmlSAXParseEntity": "LIBXML_SAX1_ENABLED",
+ "xmlNewTextChild": "LIBXML_TREE_ENABLED",
+ "xmlNewDocRawNode": "LIBXML_TREE_ENABLED",
+ "xmlNewProp": "LIBXML_TREE_ENABLED",
+ "xmlReconciliateNs": "LIBXML_TREE_ENABLED",
+ "xmlValidateNCName": "LIBXML_TREE_ENABLED",
+ "xmlValidateNMToken": "LIBXML_TREE_ENABLED",
+ "xmlValidateName": "LIBXML_TREE_ENABLED",
+ "xmlNewChild": "LIBXML_TREE_ENABLED",
+ "xmlValidateQName": "LIBXML_TREE_ENABLED",
+ "xmlSprintfElementContent": "LIBXML_OUTPUT_ENABLED",
+ "xmlValidGetPotentialChildren" : "LIBXML_VALID_ENABLED",
+ "xmlValidGetValidElements" : "LIBXML_VALID_ENABLED",
+ "docbDefaultSAXHandlerInit" : "LIBXML_DOCB_ENABLED",
+ "xmlTextReaderPreservePattern" : "LIBXML_PATTERN_ENABLED",
+}
+
+#
+# Some function really need to be skipped for the tests.
+#
+skipped_functions = [
+# block on I/O
+"xmlFdRead", "xmlReadFd", "xmlCtxtReadFd",
+"htmlFdRead", "htmlReadFd", "htmlCtxtReadFd",
+"xmlReaderNewFd", "xmlReaderForFd",
+"xmlIORead", "xmlReadIO", "xmlCtxtReadIO",
+"htmlIORead", "htmlReadIO", "htmlCtxtReadIO",
+"xmlReaderNewIO", "xmlBufferDump", "xmlNanoFTPConnect",
+"xmlNanoFTPConnectTo",
+# Complex I/O APIs
+"xmlCreateIOParserCtxt", "xmlParserInputBufferCreateIO",
+"xmlRegisterInputCallbacks", "xmlReaderForIO",
+"xmlOutputBufferCreateIO", "xmlRegisterOutputCallbacks",
+"xmlSaveToIO",
+# library state cleanup, generate false leak informations and other
+# troubles, heavillyb tested otherwise.
+"xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc",
+"xmlSetTreeDoc", "xmlUnlinkNode",
+# hard to avoid leaks in the tests
+"xmlStrcat", "xmlStrncat", "xmlCatalogAddLocal", "xmlNewTextWriterDoc",
+"xmlXPathNewValueTree", "xmlXPathWrapString",
+# unimplemented
+"xmlTextReaderReadInnerXml", "xmlTextReaderReadOuterXml",
+"xmlTextReaderReadString",
+# destructor
+"xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose",
+# deprecated
+"xmlCatalogGetPublic", "xmlCatalogGetSystem", "xmlEncodeEntities",
+"xmlNewGlobalNs", "xmlHandleEntity", "xmlNamespaceParseNCName",
+"xmlNamespaceParseNSDef", "xmlNamespaceParseQName",
+"xmlParseNamespace", "xmlParseQuotedString", "xmlParserHandleReference",
+"xmlScanName",
+"xmlDecodeEntities",
+# allocators
+"xmlMemFree",
+# verbosity
+"xmlCatalogSetDebug", "xmlShellPrintXPathError", "xmlShellPrintNode",
+# Internal functions, no user space should really call them
+"xmlParseAttribute", "xmlParseAttributeListDecl", "xmlParseName",
+"xmlParseNmtoken", "xmlParseEntityValue", "xmlParseAttValue",
+"xmlParseSystemLiteral", "xmlParsePubidLiteral", "xmlParseCharData",
+"xmlParseExternalID", "xmlParseComment", "xmlParsePITarget", "xmlParsePI",
+"xmlParseNotationDecl", "xmlParseEntityDecl", "xmlParseDefaultDecl",
+"xmlParseNotationType", "xmlParseEnumerationType", "xmlParseEnumeratedType",
+"xmlParseAttributeType", "xmlParseAttributeListDecl",
+"xmlParseElementMixedContentDecl", "xmlParseElementChildrenContentDecl",
+"xmlParseElementContentDecl", "xmlParseElementDecl", "xmlParseMarkupDecl",
+"xmlParseCharRef", "xmlParseEntityRef", "xmlParseReference",
+"xmlParsePEReference", "xmlParseDocTypeDecl", "xmlParseAttribute",
+"xmlParseStartTag", "xmlParseEndTag", "xmlParseCDSect", "xmlParseContent",
+"xmlParseElement", "xmlParseVersionNum", "xmlParseVersionInfo",
+"xmlParseEncName", "xmlParseEncodingDecl", "xmlParseSDDecl",
+"xmlParseXMLDecl", "xmlParseTextDecl", "xmlParseMisc",
+"xmlParseExternalSubset", "xmlParserHandlePEReference",
+"xmlSkipBlankChars",
+]
+
+#
+# Those functions have side effect on the global state
+# and hence generate errors on memory allocation tests
+#
+skipped_memcheck = [ "xmlLoadCatalog", "xmlAddEncodingAlias",
+ "xmlSchemaInitTypes", "xmlNanoFTPProxy", "xmlNanoFTPScanProxy",
+ "xmlNanoHTTPScanProxy", "xmlResetLastError", "xmlCatalogConvert",
+ "xmlCatalogRemove", "xmlLoadCatalogs", "xmlCleanupCharEncodingHandlers",
+ "xmlInitCharEncodingHandlers", "xmlCatalogCleanup",
+ "xmlSchemaGetBuiltInType",
+ "htmlParseFile", # loads the catalogs
+]
+
+#
+# Extra code needed for some test cases
+#
+extra_pre_call = {
+ "xmlSAXUserParseFile": """
+#ifdef LIBXML_SAX1_ENABLED
+ if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
+#endif
+""",
+ "xmlSAXUserParseMemory": """
+#ifdef LIBXML_SAX1_ENABLED
+ if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
+#endif
+""",
+ "xmlParseBalancedChunkMemory": """
+#ifdef LIBXML_SAX1_ENABLED
+ if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
+#endif
+""",
+ "xmlParseBalancedChunkMemoryRecover": """
+#ifdef LIBXML_SAX1_ENABLED
+ if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
+#endif
+""",
+ "xmlParserInputBufferCreateFd":
+ "if (fd >= 0) fd = -1;",
+}
+extra_post_call = {
+ "xmlAddChild":
+ "if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }",
+ "xmlAddChildList":
+ "if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }",
+ "xmlAddSibling":
+ "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }",
+ "xmlAddNextSibling":
+ "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }",
+ "xmlAddPrevSibling":
+ "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }",
+ "xmlDocSetRootElement":
+ "if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }",
+ "xmlReplaceNode":
+ """if (cur != NULL) {
+ xmlUnlinkNode(cur);
+ xmlFreeNode(cur) ; cur = NULL ; }
+ if (old != NULL) {
+ xmlUnlinkNode(old);
+ xmlFreeNode(old) ; old = NULL ; }
+ ret_val = NULL;""",
+ "xmlTextMerge":
+ """if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
+ xmlUnlinkNode(second);
+ xmlFreeNode(second) ; second = NULL ; }""",
+ "xmlBuildQName":
+ """if ((ret_val != NULL) && (ret_val != ncname) &&
+ (ret_val != prefix) && (ret_val != memory))
+ xmlFree(ret_val);
+ ret_val = NULL;""",
+ "xmlDictReference": "xmlDictFree(dict);",
+ # Functions which deallocates one of their parameters
+ "xmlXPathConvertBoolean": """val = NULL;""",
+ "xmlXPathConvertNumber": """val = NULL;""",
+ "xmlXPathConvertString": """val = NULL;""",
+ "xmlSaveFileTo": """buf = NULL;""",
+ "xmlSaveFormatFileTo": """buf = NULL;""",
+ "xmlIOParseDTD": "input = NULL;",
+ "xmlRemoveProp": "cur = NULL;",
+ "xmlNewNs": "if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);",
+ "xmlCopyNamespace": "if (ret_val != NULL) xmlFreeNs(ret_val);",
+ "xmlCopyNamespaceList": "if (ret_val != NULL) xmlFreeNsList(ret_val);",
+ "xmlNewTextWriter": "if (ret_val != NULL) out = NULL;",
+ "xmlNewTextWriterPushParser": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;",
+ "xmlNewIOInputStream": "if (ret_val != NULL) input = NULL;",
+ "htmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
+ "htmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
+ "xmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
+ "xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
+ "xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
+}
+
+modules = []
+
+def is_skipped_module(name):
+ for mod in skipped_modules:
+ if mod == name:
+ return 1
+ return 0
+
+def is_skipped_function(name):
+ for fun in skipped_functions:
+ if fun == name:
+ return 1
+ # Do not test destructors
+ if string.find(name, 'Free') != -1:
+ return 1
+ return 0
+
+def is_skipped_memcheck(name):
+ for fun in skipped_memcheck:
+ if fun == name:
+ return 1
+ return 0
+
+missing_types = {}
+def add_missing_type(name, func):
+ try:
+ list = missing_types[name]
+ list.append(func)
+ except:
+ missing_types[name] = [func]
+
+generated_param_types = []
+def add_generated_param_type(name):
+ generated_param_types.append(name)
+
+generated_return_types = []
+def add_generated_return_type(name):
+ generated_return_types.append(name)
+
+missing_functions = {}
+missing_functions_nr = 0
+def add_missing_functions(name, module):
+ global missing_functions_nr
+
+ missing_functions_nr = missing_functions_nr + 1
+ try:
+ list = missing_functions[module]
+ list.append(name)
+ except:
+ missing_functions[module] = [name]
+
+#
+# Provide the type generators and destructors for the parameters
+#
+
+def type_convert(str, name, info, module, function, pos):
+# res = string.replace(str, " ", " ")
+# res = string.replace(str, " ", " ")
+# res = string.replace(str, " ", " ")
+ res = string.replace(str, " *", "_ptr")
+# res = string.replace(str, "*", "_ptr")
+ res = string.replace(res, " ", "_")
+ if res == 'const_char_ptr':
+ if string.find(name, "file") != -1 or \
+ string.find(name, "uri") != -1 or \
+ string.find(name, "URI") != -1 or \
+ string.find(info, "filename") != -1 or \
+ string.find(info, "URI") != -1 or \
+ string.find(info, "URL") != -1:
+ if string.find(function, "Save") != -1 or \
+ string.find(function, "Create") != -1 or \
+ string.find(function, "Write") != -1:
+ return('fileoutput')
+ return('filepath')
+ if res == 'void_ptr':
+ if module == 'nanoftp' and name == 'ctx':
+ return('xmlNanoFTPCtxtPtr')
+ if function == 'xmlNanoFTPNewCtxt':
+ return('xmlNanoFTPCtxtPtr')
+ if module == 'nanohttp' and name == 'ctx':
+ return('xmlNanoHTTPCtxtPtr')
+ if function == 'xmlIOHTTPOpenW':
+ return('xmlNanoHTTPCtxtPtr')
+ if string.find(name, "data") != -1:
+ return('userdata');
+ if string.find(name, "user") != -1:
+ return('userdata');
+ if res == 'xmlDoc_ptr':
+ res = 'xmlDocPtr';
+ if res == 'xmlNode_ptr':
+ res = 'xmlNodePtr';
+ if res == 'xmlDict_ptr':
+ res = 'xmlDictPtr';
+ if res == 'xmlNodePtr' and pos != 0:
+ if (function == 'xmlAddChild' and pos == 2) or \
+ (function == 'xmlAddChildList' and pos == 2) or \
+ (function == 'xmlAddNextSibling' and pos == 2) or \
+ (function == 'xmlAddSibling' and pos == 2) or \
+ (function == 'xmlDocSetRootElement' and pos == 2) or \
+ (function == 'xmlReplaceNode' and pos == 2) or \
+ (function == 'xmlTextMerge') or \
+ (function == 'xmlAddPrevSibling' and pos == 2):
+ return('xmlNodePtr_in');
+ if res == 'const xmlBufferPtr':
+ res = 'xmlBufferPtr';
+ if res == 'xmlChar_ptr' and name == 'name' and \
+ string.find(function, "EatName") != -1:
+ return('eaten_name')
+ if res == 'void_ptr*':
+ res = 'void_ptr_ptr'
+ if res == 'char_ptr*':
+ res = 'char_ptr_ptr'
+ if res == 'xmlChar_ptr*':
+ res = 'xmlChar_ptr_ptr'
+ if res == 'const_xmlChar_ptr*':
+ res = 'const_xmlChar_ptr_ptr'
+ if res == 'const_char_ptr*':
+ res = 'const_char_ptr_ptr'
+ if res == 'FILE_ptr' and module == 'debugXML':
+ res = 'debug_FILE_ptr';
+ if res == 'int' and name == 'options':
+ if module == 'parser' or module == 'xmlreader':
+ res = 'parseroptions'
+
+ return res
+
+known_param_types = []
+
+def is_known_param_type(name, rtype):
+ global test
+ for type in known_param_types:
+ if type == name:
+ return 1
+ for type in generated_param_types:
+ if type == name:
+ return 1
+
+ if name[-3:] == 'Ptr' or name[-4:] == '_ptr':
+ if rtype[0:6] == 'const ':
+ crtype = rtype[6:]
+ else:
+ crtype = rtype
+
+ define = 0
+ if modules_defines.has_key(module):
+ test.write("#ifdef %s\n" % (modules_defines[module]))
+ define = 1
+ test.write("""
+#define gen_nb_%s 1
+static %s gen_%s(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+""" % (name, crtype, name, name, rtype))
+ if define == 1:
+ test.write("#endif\n\n")
+ add_generated_param_type(name)
+ return 1
+
+ return 0
+
+#
+# Provide the type destructors for the return values
+#
+
+known_return_types = []
+
+def is_known_return_type(name):
+ for type in known_return_types:
+ if type == name:
+ return 1
+ return 0
+
+#
+# Copy the beginning of the C test program result
+#
+
+input = open("testapi.c", "r")
+test = open('testapi.c.new', 'w')
+
+def compare_and_save():
+ global test
+
+ test.close()
+ input = open("testapi.c", "r").read()
+ test = open('testapi.c.new', "r").read()
+ if input != test:
+ os.system("rm testapi.c ; mv testapi.c.new testapi.c")
+ print("Updated testapi.c")
+ else:
+ print("Generated testapi.c is identical")
+
+line = input.readline()
+while line != "":
+ if line == "/* CUT HERE: everything below that line is generated */\n":
+ break;
+ if line[0:15] == "#define gen_nb_":
+ type = string.split(line[15:])[0]
+ known_param_types.append(type)
+ if line[0:19] == "static void desret_":
+ type = string.split(line[19:], '(')[0]
+ known_return_types.append(type)
+ test.write(line)
+ line = input.readline()
+input.close()
+
+if line == "":
+ print "Could not find the CUT marker in testapi.c skipping generation"
+ test.close()
+ sys.exit(0)
+
+print("Scanned testapi.c: found %d parameters types and %d return types\n" % (
+ len(known_param_types), len(known_return_types)))
+test.write("/* CUT HERE: everything below that line is generated */\n")
+
+
+#
+# Open the input API description
+#
+doc = libxml2.readFile('doc/libxml2-api.xml', None, 0)
+if doc == None:
+ print "Failed to load doc/libxml2-api.xml"
+ sys.exit(1)
+ctxt = doc.xpathNewContext()
+
+#
+# Generate constructors and return type handling for all enums
+#
+enums = ctxt.xpathEval("/api/symbols/typedef[@type='enum']")
+for enum in enums:
+ name = enum.xpathEval('string(@name)')
+ if name == None:
+ continue;
+ module = enum.xpathEval('string(@file)')
+ define = 0
+
+ if is_known_param_type(name, name) == 0:
+ values = ctxt.xpathEval("/api/symbols/enum[@type='%s']" % name)
+ i = 0
+ vals = []
+ for value in values:
+ vname = value.xpathEval('string(@name)')
+ if vname == None:
+ continue;
+ i = i + 1
+ if i >= 5:
+ break;
+ vals.append(vname)
+ if vals == []:
+ print "Didn't found any value for enum %s" % (name)
+ continue
+ if modules_defines.has_key(module):
+ test.write("#ifdef %s\n" % (modules_defines[module]))
+ define = 1
+ test.write("#define gen_nb_%s %d\n" % (name, len(vals)))
+ test.write("""static %s gen_%s(int no, int nr ATTRIBUTE_UNUSED) {\n""" %
+ (name, name))
+ i = 1
+ for value in vals:
+ test.write(" if (no == %d) return(%s);\n" % (i, value))
+ i = i + 1
+ test.write(""" return(0);
+}
+""");
+ known_param_types.append(name)
+
+ if is_known_return_type(name) == 0:
+ if define == 0 and modules_defines.has_key(module):
+ test.write("#ifdef %s\n" % (modules_defines[module]))
+ define = 1
+ test.write("""static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_%s(%s val ATTRIBUTE_UNUSED) {
+}
+
+""" % (name, name, name, name))
+ known_return_types.append(name)
+ if define == 1:
+ test.write("#endif\n\n")
+
+#
+# Load the interfaces
+#
+headers = ctxt.xpathEval("/api/files/file")
+for file in headers:
+ name = file.xpathEval('string(@name)')
+ if (name == None) or (name == ''):
+ continue
+
+ #
+ # Some module may be skipped because they don't really consists
+ # of user callable APIs
+ #
+ if is_skipped_module(name):
+ continue
+
+ #
+ # do not test deprecated APIs
+ #
+ desc = file.xpathEval('string(description)')
+ if string.find(desc, 'DEPRECATED') != -1:
+ print "Skipping deprecated interface %s" % name
+ continue;
+
+ test.write("#include <libxml/%s.h>\n" % name)
+ modules.append(name)
+
+#
+# Generate the callers signatures
+#
+for module in modules:
+ test.write("static int test_%s(void);\n" % module);
+
+#
+# Generate the top caller
+#
+
+test.write("""
+/**
+ * testlibxml2:
+ *
+ * Main entry point of the tester for the full libxml2 module,
+ * it calls all the tester entry point for each module.
+ *
+ * Returns the number of error found
+ */
+static int
+testlibxml2(void)
+{
+ int test_ret = 0;
+
+""")
+
+for module in modules:
+ test.write(" test_ret += test_%s();\n" % module)
+
+test.write("""
+ printf("Total: %d functions, %d tests, %d errors\\n",
+ function_tests, call_tests, test_ret);
+ return(test_ret);
+}
+
+""")
+
+#
+# How to handle a function
+#
+nb_tests = 0
+
+def generate_test(module, node):
+ global test
+ global nb_tests
+ nb_cond = 0
+ no_gen = 0
+
+ name = node.xpathEval('string(@name)')
+ if is_skipped_function(name):
+ return
+
+ #
+ # check we know how to handle the args and return values
+ # and store the informations for the generation
+ #
+ try:
+ args = node.xpathEval("arg")
+ except:
+ args = []
+ t_args = []
+ n = 0
+ for arg in args:
+ n = n + 1
+ rtype = arg.xpathEval("string(@type)")
+ if rtype == 'void':
+ break;
+ info = arg.xpathEval("string(@info)")
+ nam = arg.xpathEval("string(@name)")
+ type = type_convert(rtype, nam, info, module, name, n)
+ if is_known_param_type(type, rtype) == 0:
+ add_missing_type(type, name);
+ no_gen = 1
+ t_args.append((nam, type, rtype, info))
+
+ try:
+ rets = node.xpathEval("return")
+ except:
+ rets = []
+ t_ret = None
+ for ret in rets:
+ rtype = ret.xpathEval("string(@type)")
+ info = ret.xpathEval("string(@info)")
+ type = type_convert(rtype, 'return', info, module, name, 0)
+ if rtype == 'void':
+ break
+ if is_known_return_type(type) == 0:
+ add_missing_type(type, name);
+ no_gen = 1
+ t_ret = (type, rtype, info)
+ break
+
+ test.write("""
+static int
+test_%s(void) {
+ int test_ret = 0;
+
+""" % (name))
+
+ if no_gen == 1:
+ add_missing_functions(name, module)
+ test.write("""
+ /* missing type support */
+ return(test_ret);
+}
+
+""")
+ return
+
+ try:
+ conds = node.xpathEval("cond")
+ for cond in conds:
+ test.write("#ifdef %s\n" % (cond.get_content()))
+ nb_cond = nb_cond + 1
+ except:
+ pass
+
+ define = 0
+ if function_defines.has_key(name):
+ test.write("#ifdef %s\n" % (function_defines[name]))
+ define = 1
+
+ # Declare the memory usage counter
+ no_mem = is_skipped_memcheck(name)
+ if no_mem == 0:
+ test.write(" int mem_base;\n");
+
+ # Declare the return value
+ if t_ret != None:
+ test.write(" %s ret_val;\n" % (t_ret[1]))
+
+ # Declare the arguments
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ if (type[-3:] == 'Ptr' or type[-4:] == '_ptr') and \
+ rtype[0:6] == 'const ':
+ crtype = rtype[6:]
+ else:
+ crtype = rtype
+ # add declaration
+ test.write(" %s %s; /* %s */\n" % (crtype, nam, info))
+ test.write(" int n_%s;\n" % (nam))
+ test.write("\n")
+
+ # Cascade loop on of each argument list of values
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ #
+ test.write(" for (n_%s = 0;n_%s < gen_nb_%s;n_%s++) {\n" % (
+ nam, nam, type, nam))
+
+ # log the memory usage
+ if no_mem == 0:
+ test.write(" mem_base = xmlMemBlocks();\n");
+
+ # prepare the call
+ i = 0;
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ #
+ test.write(" %s = gen_%s(n_%s, %d);\n" % (nam, type, nam, i))
+ i = i + 1;
+
+ # do the call, and clanup the result
+ if extra_pre_call.has_key(name):
+ test.write(" %s\n"% (extra_pre_call[name]))
+ if t_ret != None:
+ test.write("\n ret_val = %s(" % (name))
+ need = 0
+ for arg in t_args:
+ (nam, type, rtype, info) = arg
+ if need:
+ test.write(", ")
+ else:
+ need = 1
+ test.write("%s" % nam);
+ test.write(");\n")
+ if extra_post_call.has_key(name):
+ test.write(" %s\n"% (extra_post_call[name]))
+ test.write(" desret_%s(ret_val);\n" % t_ret[0])
+ else:
+ test.write("\n %s(" % (name));
+ need = 0;
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ if need:
+ test.write(", ")
+ else:
+ need = 1
+ test.write("%s" % nam)
+ test.write(");\n")
+ if extra_post_call.has_key(name):
+ test.write(" %s\n"% (extra_post_call[name]))
+
+ test.write(" call_tests++;\n");
+
+ # Free the arguments
+ i = 0;
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ #
+ test.write(" des_%s(n_%s, %s, %d);\n" % (type, nam, nam, i))
+ i = i + 1;
+
+ test.write(" xmlResetLastError();\n");
+ # Check the memory usage
+ if no_mem == 0:
+ test.write(""" if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %%d blocks found in %s",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+""" % (name));
+ for arg in t_args:
+ (nam, type, rtype, info) = arg;
+ test.write(""" printf(" %%d", n_%s);\n""" % (nam))
+ test.write(""" printf("\\n");\n""")
+ test.write(" }\n")
+
+ for arg in t_args:
+ test.write(" }\n")
+
+ test.write(" function_tests++;\n")
+ #
+ # end of conditional
+ #
+ while nb_cond > 0:
+ test.write("#endif\n")
+ nb_cond = nb_cond -1
+ if define == 1:
+ test.write("#endif\n")
+
+ nb_tests = nb_tests + 1;
+
+ test.write("""
+ return(test_ret);
+}
+
+""")
+
+#
+# Generate all module callers
+#
+for module in modules:
+ # gather all the functions exported by that module
+ try:
+ functions = ctxt.xpathEval("/api/symbols/function[@file='%s']" % (module))
+ except:
+ print "Failed to gather functions from module %s" % (module)
+ continue;
+
+ # iterate over all functions in the module generating the test
+ i = 0
+ nb_tests_old = nb_tests
+ for function in functions:
+ i = i + 1
+ generate_test(module, function);
+
+ # header
+ test.write("""static int
+test_%s(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing %s : %d of %d functions ...\\n");
+""" % (module, module, nb_tests - nb_tests_old, i))
+
+ # iterate over all functions in the module generating the call
+ for function in functions:
+ name = function.xpathEval('string(@name)')
+ if is_skipped_function(name):
+ continue
+ test.write(" test_ret += test_%s();\n" % (name))
+
+ # footer
+ test.write("""
+ if (test_ret != 0)
+ printf("Module %s: %%d errors\\n", test_ret);
+ return(test_ret);
+}
+""" % (module))
+
+#
+# Generate direct module caller
+#
+test.write("""static int
+test_module(const char *module) {
+""");
+for module in modules:
+ test.write(""" if (!strcmp(module, "%s")) return(test_%s());\n""" % (
+ module, module))
+test.write(""" return(0);
+}
+""");
+
+print "Generated test for %d modules and %d functions" %(len(modules), nb_tests)
+
+compare_and_save()
+
+missing_list = []
+for missing in missing_types.keys():
+ if missing == 'va_list' or missing == '...':
+ continue;
+
+ n = len(missing_types[missing])
+ missing_list.append((n, missing))
+
+def compare_missing(a, b):
+ return b[0] - a[0]
+
+missing_list.sort(compare_missing)
+print "Missing support for %d functions and %d types see missing.lst" % (missing_functions_nr, len(missing_list))
+lst = open("missing.lst", "w")
+lst.write("Missing support for %d types" % (len(missing_list)))
+lst.write("\n")
+for miss in missing_list:
+ lst.write("%s: %d :" % (miss[1], miss[0]))
+ i = 0
+ for n in missing_types[miss[1]]:
+ i = i + 1
+ if i > 5:
+ lst.write(" ...")
+ break
+ lst.write(" %s" % (n))
+ lst.write("\n")
+lst.write("\n")
+lst.write("\n")
+lst.write("Missing support per module");
+for module in missing_functions.keys():
+ lst.write("module %s:\n %s\n" % (module, missing_functions[module]))
+
+lst.close()
+
+
diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h
index 2996330..b444137 100644
--- a/include/libxml/catalog.h
+++ b/include/libxml/catalog.h
@@ -21,6 +21,7 @@
#include <libxml/xmlversion.h>
#include <libxml/xmlstring.h>
+#include <libxml/tree.h>
#ifdef LIBXML_CATALOG_ENABLED
diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h
index d3b123c..733ccd4 100644
--- a/include/libxml/debugXML.h
+++ b/include/libxml/debugXML.h
@@ -91,6 +91,7 @@ XMLPUBFUN const char * XMLCALL
* *
****************************************************************/
+#ifdef LIBXML_XPATH_ENABLED
/**
* xmlShellReadlineFunc:
* @prompt: a string prompt
@@ -204,6 +205,8 @@ XMLPUBFUN void XMLCALL
xmlShellReadlineFunc input,
FILE *output);
+#endif /* LIBXML_XPATH_ENABLED */
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h
index 95280db..e3c28a0 100644
--- a/include/libxml/nanoftp.h
+++ b/include/libxml/nanoftp.h
@@ -109,10 +109,10 @@ XMLPUBFUN int XMLCALL
*/
XMLPUBFUN int XMLCALL
xmlNanoFTPCwd (void *ctx,
- char *directory);
+ const char *directory);
XMLPUBFUN int XMLCALL
xmlNanoFTPDele (void *ctx,
- char *file);
+ const char *file);
XMLPUBFUN int XMLCALL
xmlNanoFTPGetConnection (void *ctx);
@@ -122,7 +122,7 @@ XMLPUBFUN int XMLCALL
xmlNanoFTPList (void *ctx,
ftpListCallback callback,
void *userData,
- char *filename);
+ const char *filename);
XMLPUBFUN int XMLCALL
xmlNanoFTPGetSocket (void *ctx,
const char *filename);
diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h
index 3254400..ca3c13b 100644
--- a/include/libxml/relaxng.h
+++ b/include/libxml/relaxng.h
@@ -94,6 +94,12 @@ typedef enum {
XML_RELAXNGP_FREE_DOC = 1,
XML_RELAXNGP_CRNG = 2
} xmlRelaxNGParserFlag;
+
+XMLPUBFUN int XMLCALL
+ xmlRelaxNGInitTypes (void);
+XMLPUBFUN void XMLCALL
+ xmlRelaxNGCleanupTypes (void);
+
/*
* Interfaces for parsing.
*/
@@ -153,8 +159,6 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN int XMLCALL
xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
- xmlRelaxNGCleanupTypes (void);
/*
* Interfaces for progressive validation when possible
*/
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index a734902..99777d1 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -58,6 +58,21 @@ typedef void (*xmlValidityWarningFunc) (void *ctx,
const char *msg,
...);
+#ifdef IN_LIBXML
+/**
+ * XML_CTXT_FINISH_DTD_0:
+ *
+ * Special value for finishDtd field when embedded in an xmlParserCtxt
+ */
+#define XML_CTXT_FINISH_DTD_0 0xabcd1234
+/**
+ * XML_CTXT_FINISH_DTD_1:
+ *
+ * Special value for finishDtd field when embedded in an xmlParserCtxt
+ */
+#define XML_CTXT_FINISH_DTD_1 0xabcd1235
+#endif
+
/*
* xmlValidCtxt:
* An xmlValidCtxt is used for error reporting when validating.
@@ -75,7 +90,7 @@ struct _xmlValidCtxt {
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
- int finishDtd; /* finished validating the Dtd ? */
+ unsigned int finishDtd; /* finished validating the Dtd ? */
xmlDocPtr doc; /* the document */
int valid; /* temporary validity check result */
diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
index d893369..29fe748 100644
--- a/include/libxml/xmlerror.h
+++ b/include/libxml/xmlerror.h
@@ -58,7 +58,8 @@ typedef enum {
XML_FROM_C14N, /* The Canonicalization module */
XML_FROM_XSLT, /* The XSLT engine from libxslt */
XML_FROM_VALID, /* The XML DTD validation with valid context */
- XML_FROM_CHECK /* The error checking module */
+ XML_FROM_CHECK, /* The error checking module */
+ XML_FROM_WRITER /* The xmlwriter module */
} xmlErrorDomain;
/**
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index 0e6a767..235721c 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -139,6 +139,8 @@ XMLPUBFUN void XMLCALL
*/
XMLPUBFUN int XMLCALL
xmlMemUsed (void);
+XMLPUBFUN int XMLCALL
+ xmlMemBlocks (void);
XMLPUBFUN void XMLCALL
xmlMemDisplay (FILE *fp);
XMLPUBFUN void XMLCALL
diff --git a/include/libxml/xmlstring.h b/include/libxml/xmlstring.h
index 74ae405..39f846e 100644
--- a/include/libxml/xmlstring.h
+++ b/include/libxml/xmlstring.h
@@ -117,7 +117,7 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN xmlChar * XMLCALL
xmlUTF8Strndup (const xmlChar *utf,
int len);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlUTF8Strpos (const xmlChar *utf,
int pos);
XMLPUBFUN int XMLCALL
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index 5939cba..5814bf9 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
-#define LIBXML_DOTTED_VERSION "2.6.15"
+#define LIBXML_DOTTED_VERSION "2.6.16"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 1002003
*/
-#define LIBXML_VERSION 20615
+#define LIBXML_VERSION 20616
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "1002003"
*/
-#define LIBXML_VERSION_STRING "20615"
+#define LIBXML_VERSION_STRING "20616"
/**
* LIBXML_VERSION_EXTRA:
*
* extra version information, used to show a CVS compilation
*/
-#define LIBXML_VERSION_EXTRA "-CVS2214"
+#define LIBXML_VERSION_EXTRA "-CVS2257"
/**
* LIBXML_TEST_VERSION:
@@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int 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(20615);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20616);
#ifndef VMS
#if 0
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index 20426e7..19a2354 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -62,7 +62,8 @@ typedef enum {
XPTR_SUB_RESOURCE_ERROR,
XPATH_UNDEF_PREFIX_ERROR,
XPATH_ENCODING_ERROR,
- XPATH_INVALID_CHAR_ERROR
+ XPATH_INVALID_CHAR_ERROR,
+ XPATH_INVALID_CTXT
} xmlXPathError;
/*
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index 88ee27c..dcd5243 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -40,7 +40,7 @@ extern "C" {
*/
#define xmlXPathSetError(ctxt, err) \
{ xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
- (ctxt)->error = (err); }
+ if ((ctxt) != NULL) (ctxt)->error = (err); }
/**
* xmlXPathSetArityError:
@@ -294,6 +294,7 @@ XMLPUBFUN void * XMLCALL
* Macro to check that the number of args passed to an XPath function matches.
*/
#define CHECK_ARITY(x) \
+ if (ctxt == NULL) return; \
if (nargs != (x)) \
XP_ERROR(XPATH_INVALID_ARITY);
diff --git a/libxml2.spec b/libxml2.spec
index 50d386f..7a3234e 100644
--- a/libxml2.spec
+++ b/libxml2.spec
@@ -1,6 +1,6 @@
Summary: Library providing XML and HTML support
Name: libxml2
-Version: 2.6.15
+Version: 2.6.16
Release: 1
License: MIT
Group: Development/Libraries
@@ -159,8 +159,8 @@ rm -fr %{buildroot}
%doc doc/python.html
%changelog
-* Wed Oct 27 2004 Daniel Veillard <veillard@redhat.com>
-- upstream release 2.6.15 see http://xmlsoft.org/news.html
+* Wed Nov 10 2004 Daniel Veillard <veillard@redhat.com>
+- upstream release 2.6.16 see http://xmlsoft.org/news.html
* Thu Jan 2 2003 Daniel Veillard <veillard@redhat.com>
- integrated drv_libxml2 xml.sax driver from StÚphane Bidoul
diff --git a/list.c b/list.c
index 18a8297..ccd2233 100644
--- a/list.c
+++ b/list.c
@@ -99,6 +99,8 @@ xmlListLowerSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
for(lk = l->sentinel->next;lk != l->sentinel && l->linkCompare(lk->data, data) <0 ;lk = lk->next);
return lk;
}
@@ -117,6 +119,8 @@ xmlListHigherSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev);
return lk;
}
@@ -134,6 +138,8 @@ static xmlLinkPtr
xmlListLinkSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
lk = xmlListLowerSearch(l, data);
if (lk == l->sentinel)
return NULL;
@@ -157,6 +163,8 @@ static xmlLinkPtr
xmlListLinkReverseSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
lk = xmlListHigherSearch(l, data);
if (lk == l->sentinel)
return NULL;
@@ -223,6 +231,8 @@ void *
xmlListSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
lk = xmlListLinkSearch(l, data);
if (lk)
return (lk->data);
@@ -242,6 +252,8 @@ void *
xmlListReverseSearch(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(NULL);
lk = xmlListLinkReverseSearch(l, data);
if (lk)
return (lk->data);
@@ -262,6 +274,8 @@ xmlListInsert(xmlListPtr l, void *data)
{
xmlLinkPtr lkPlace, lkNew;
+ if (l == NULL)
+ return(1);
lkPlace = xmlListLowerSearch(l, data);
/* Add the new link */
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
@@ -292,6 +306,8 @@ int xmlListAppend(xmlListPtr l, void *data)
{
xmlLinkPtr lkPlace, lkNew;
+ if (l == NULL)
+ return(1);
lkPlace = xmlListHigherSearch(l, data);
/* Add the new link */
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
@@ -316,6 +332,9 @@ int xmlListAppend(xmlListPtr l, void *data)
*/
void xmlListDelete(xmlListPtr l)
{
+ if (l == NULL)
+ return;
+
xmlListClear(l);
xmlFree(l->sentinel);
xmlFree(l);
@@ -335,6 +354,8 @@ xmlListRemoveFirst(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(0);
/*Find the first instance of this data */
lk = xmlListLinkSearch(l, data);
if (lk != NULL) {
@@ -358,6 +379,8 @@ xmlListRemoveLast(xmlListPtr l, void *data)
{
xmlLinkPtr lk;
+ if (l == NULL)
+ return(0);
/*Find the last instance of this data */
lk = xmlListLinkReverseSearch(l, data);
if (lk != NULL) {
@@ -381,6 +404,8 @@ xmlListRemoveAll(xmlListPtr l, void *data)
{
int count=0;
+ if (l == NULL)
+ return(0);
while(xmlListRemoveFirst(l, data))
count++;
@@ -396,8 +421,11 @@ xmlListRemoveAll(xmlListPtr l, void *data)
void
xmlListClear(xmlListPtr l)
{
- xmlLinkPtr lk = l->sentinel->next;
+ xmlLinkPtr lk;
+ if (l == NULL)
+ return;
+ lk = l->sentinel->next;
while(lk != l->sentinel) {
xmlLinkPtr next = lk->next;
@@ -412,11 +440,13 @@ xmlListClear(xmlListPtr l)
*
* Is the list empty ?
*
- * Returns 1 if the list is empty, 0 otherwise
+ * Returns 1 if the list is empty, 0 if not empty and -1 in case of error
*/
int
xmlListEmpty(xmlListPtr l)
{
+ if (l == NULL)
+ return(-1);
return (l->sentinel->next == l->sentinel);
}
@@ -431,6 +461,8 @@ xmlListEmpty(xmlListPtr l)
xmlLinkPtr
xmlListFront(xmlListPtr l)
{
+ if (l == NULL)
+ return(NULL);
return (l->sentinel->next);
}
@@ -445,6 +477,8 @@ xmlListFront(xmlListPtr l)
xmlLinkPtr
xmlListEnd(xmlListPtr l)
{
+ if (l == NULL)
+ return(NULL);
return (l->sentinel->prev);
}
@@ -454,7 +488,7 @@ xmlListEnd(xmlListPtr l)
*
* Get the number of elements in the list
*
- * Returns the number of elements in the list
+ * Returns the number of elements in the list or -1 in case of error
*/
int
xmlListSize(xmlListPtr l)
@@ -462,6 +496,8 @@ xmlListSize(xmlListPtr l)
xmlLinkPtr lk;
int count=0;
+ if (l == NULL)
+ return(-1);
/* TODO: keep a counter in xmlList instead */
for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next, count++);
return count;
@@ -507,6 +543,8 @@ xmlListPushFront(xmlListPtr l, void *data)
{
xmlLinkPtr lkPlace, lkNew;
+ if (l == NULL)
+ return(0);
lkPlace = l->sentinel;
/* Add the new link */
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
@@ -537,6 +575,8 @@ xmlListPushBack(xmlListPtr l, void *data)
{
xmlLinkPtr lkPlace, lkNew;
+ if (l == NULL)
+ return(0);
lkPlace = l->sentinel->prev;
/* Add the new link */
if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {
@@ -563,6 +603,8 @@ xmlListPushBack(xmlListPtr l, void *data)
void *
xmlLinkGetData(xmlLinkPtr lk)
{
+ if (lk == NULL)
+ return(NULL);
return lk->data;
}
@@ -573,18 +615,22 @@ xmlLinkGetData(xmlLinkPtr lk)
* Reverse the order of the elements in the list
*/
void
-xmlListReverse(xmlListPtr l) {
- xmlLinkPtr lk;
- xmlLinkPtr lkPrev = l->sentinel;
-
- for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
+xmlListReverse(xmlListPtr l)
+{
+ xmlLinkPtr lk;
+ xmlLinkPtr lkPrev;
+
+ if (l == NULL)
+ return;
+ lkPrev = l->sentinel;
+ for (lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
+ lkPrev->next = lkPrev->prev;
+ lkPrev->prev = lk;
+ lkPrev = lk;
+ }
+ /* Fix up the last node */
lkPrev->next = lkPrev->prev;
lkPrev->prev = lk;
- lkPrev = lk;
- }
- /* Fix up the last node */
- lkPrev->next = lkPrev->prev;
- lkPrev->prev = lk;
}
/**
@@ -598,6 +644,8 @@ xmlListSort(xmlListPtr l)
{
xmlListPtr lTemp;
+ if (l == NULL)
+ return;
if(xmlListEmpty(l))
return;
@@ -628,6 +676,8 @@ void
xmlListWalk(xmlListPtr l, xmlListWalker walker, const void *user) {
xmlLinkPtr lk;
+ if ((l == NULL) || (walker == NULL))
+ return;
for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
if((walker(lk->data, user)) == 0)
break;
@@ -647,6 +697,8 @@ void
xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, const void *user) {
xmlLinkPtr lk;
+ if ((l == NULL) || (walker == NULL))
+ return;
for(lk = l->sentinel->prev; lk != l->sentinel; lk = lk->prev) {
if((walker(lk->data, user)) == 0)
break;
@@ -680,6 +732,9 @@ xmlListPtr
xmlListDup(const xmlListPtr old)
{
xmlListPtr cur;
+
+ if (old == NULL)
+ return(NULL);
/* Hmmm, how to best deal with allocation issues when copying
* lists. If there is a de-allocator, should responsibility lie with
* the new list or the old list. Surely not both. I'll arbitrarily
@@ -708,6 +763,8 @@ xmlListCopy(xmlListPtr cur, const xmlListPtr old)
/* Walk the old tree and insert the data into the new one */
xmlLinkPtr lk;
+ if ((old == NULL) || (cur == NULL))
+ return(1);
for(lk = old->sentinel->next; lk != old->sentinel; lk = lk->next) {
if (0 !=xmlListInsert(cur, lk->data)) {
xmlListDelete(cur);
diff --git a/nanoftp.c b/nanoftp.c
index 16e6242..83a23b0 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -260,12 +260,18 @@ xmlNanoFTPCleanup(void) {
void
xmlNanoFTPProxy(const char *host, int port, const char *user,
const char *passwd, int type) {
- if (proxy != NULL)
+ if (proxy != NULL) {
xmlFree(proxy);
- if (proxyUser != NULL)
+ proxy = NULL;
+ }
+ if (proxyUser != NULL) {
xmlFree(proxyUser);
- if (proxyPasswd != NULL)
+ proxyUser = NULL;
+ }
+ if (proxyPasswd != NULL) {
xmlFree(proxyPasswd);
+ proxyPasswd = NULL;
+ }
if (host)
proxy = xmlMemStrdup(host);
if (user)
@@ -697,11 +703,11 @@ xmlNanoFTPNewCtxt(const char *URL) {
ret->controlFd = -1;
unescaped = xmlURIUnescapeString(URL, 0, NULL);
- if (unescaped != NULL)
+ if (unescaped != NULL) {
xmlNanoFTPScanURL(ret, unescaped);
- else if (URL != NULL)
+ xmlFree(unescaped);
+ } else if (URL != NULL)
xmlNanoFTPScanURL(ret, URL);
- xmlFree(unescaped);
return(ret);
}
@@ -777,6 +783,8 @@ xmlNanoFTPGetMore(void *ctx) {
int len;
int size;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
+
if ((ctxt->controlBufIndex < 0) || (ctxt->controlBufIndex > FTP_BUF_SIZE)) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext,
@@ -856,6 +864,8 @@ xmlNanoFTPReadResponse(void *ctx) {
int len;
int res = -1, cur = -1;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
+
get_more:
/*
* Assumes everything up to controlBuf[controlBufIndex] has been read
@@ -943,6 +953,7 @@ xmlNanoFTPCheckResponse(void *ctx) {
fd_set rfd;
struct timeval tv;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
tv.tv_sec = 0;
tv.tv_usec = 0;
FD_ZERO(&rfd);
@@ -1031,6 +1042,8 @@ xmlNanoFTPQuit(void *ctx) {
char buf[200];
int len, res;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
+
snprintf(buf, sizeof(buf), "QUIT\r\n");
len = strlen(buf);
#ifdef DEBUG_FTP
@@ -1442,6 +1455,8 @@ xmlNanoFTPConnectTo(const char *server, int port) {
xmlNanoFTPInit();
if (server == NULL)
return(NULL);
+ if (port <= 0)
+ return(NULL);
ctxt = (xmlNanoFTPCtxtPtr) xmlNanoFTPNewCtxt(NULL);
ctxt->hostname = xmlMemStrdup(server);
if (port != 0)
@@ -1465,12 +1480,14 @@ xmlNanoFTPConnectTo(const char *server, int port) {
*/
int
-xmlNanoFTPCwd(void *ctx, char *directory) {
+xmlNanoFTPCwd(void *ctx, const char *directory) {
xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;
char buf[400];
int len;
int res;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
+
/*
* Expected response code for CWD:
*
@@ -1511,12 +1528,14 @@ xmlNanoFTPCwd(void *ctx, char *directory) {
*/
int
-xmlNanoFTPDele(void *ctx, char *file) {
+xmlNanoFTPDele(void *ctx, const char *file) {
xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;
char buf[400];
int len;
int res;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0) || (file == NULL)) return(-1);
+
/*
* Expected response code for DELE:
*
@@ -1572,6 +1591,8 @@ xmlNanoFTPGetConnection(void *ctx) {
#endif
SOCKLEN_T dataAddrLen;
+ if (ctxt == NULL) return(-1);
+
memset (&dataAddr, 0, sizeof(dataAddr));
#ifdef SUPPORT_IP6
if ((ctxt->ftpAddr).ss_family == AF_INET6) {
@@ -1735,6 +1756,8 @@ xmlNanoFTPCloseConnection(void *ctx) {
fd_set rfd, efd;
struct timeval tv;
+ if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1);
+
closesocket(ctxt->dataFd); ctxt->dataFd = -1;
tv.tv_sec = 15;
tv.tv_usec = 0;
@@ -1907,7 +1930,7 @@ xmlNanoFTPParseList(const char *list, ftpListCallback callback, void *userData)
int
xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData,
- char *filename) {
+ const char *filename) {
xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;
char buf[4096 + 1];
int len, res;
@@ -2019,6 +2042,8 @@ xmlNanoFTPGetSocket(void *ctx, const char *filename) {
xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx;
char buf[300];
int res, len;
+ if (ctx == NULL)
+ return(-1);
if ((filename == NULL) && (ctxt->path == NULL))
return(-1);
ctxt->dataFd = xmlNanoFTPGetConnection(ctxt);
diff --git a/parser.c b/parser.c
index b5ecd2e..baa9c47 100644
--- a/parser.c
+++ b/parser.c
@@ -949,6 +949,8 @@ mem_error:
int
inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
{
+ if ((ctxt == NULL) || (value == NULL))
+ return(0);
if (ctxt->inputNr >= ctxt->inputMax) {
ctxt->inputMax *= 2;
ctxt->inputTab =
@@ -977,6 +979,8 @@ inputPop(xmlParserCtxtPtr ctxt)
{
xmlParserInputPtr ret;
+ if (ctxt == NULL)
+ return(NULL);
if (ctxt->inputNr <= 0)
return (0);
ctxt->inputNr--;
@@ -1000,16 +1004,19 @@ inputPop(xmlParserCtxtPtr ctxt)
int
nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
{
+ if (ctxt == NULL) return(0);
if (ctxt->nodeNr >= ctxt->nodeMax) {
- ctxt->nodeMax *= 2;
- ctxt->nodeTab =
- (xmlNodePtr *) xmlRealloc(ctxt->nodeTab,
- ctxt->nodeMax *
+ xmlNodePtr *tmp;
+
+ tmp = (xmlNodePtr *) xmlRealloc(ctxt->nodeTab,
+ ctxt->nodeMax * 2 *
sizeof(ctxt->nodeTab[0]));
- if (ctxt->nodeTab == NULL) {
+ if (tmp == NULL) {
xmlErrMemory(ctxt, NULL);
return (0);
}
+ ctxt->nodeTab = tmp;
+ ctxt->nodeMax *= 2;
}
if (((unsigned int) ctxt->nodeNr) > xmlParserMaxDepth) {
xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR,
@@ -1035,8 +1042,9 @@ nodePop(xmlParserCtxtPtr ctxt)
{
xmlNodePtr ret;
+ if (ctxt == NULL) return(NULL);
if (ctxt->nodeNr <= 0)
- return (0);
+ return (NULL);
ctxt->nodeNr--;
if (ctxt->nodeNr > 0)
ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
@@ -1132,6 +1140,8 @@ nameNsPop(xmlParserCtxtPtr ctxt)
int
namePush(xmlParserCtxtPtr ctxt, const xmlChar * value)
{
+ if (ctxt == NULL) return (-1);
+
if (ctxt->nameNr >= ctxt->nameMax) {
const xmlChar * *tmp;
ctxt->nameMax *= 2;
@@ -1164,8 +1174,8 @@ namePop(xmlParserCtxtPtr ctxt)
{
const xmlChar *ret;
- if (ctxt->nameNr <= 0)
- return (0);
+ if ((ctxt == NULL) || (ctxt->nameNr <= 0))
+ return (NULL);
ctxt->nameNr--;
if (ctxt->nameNr > 0)
ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
@@ -1412,7 +1422,7 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
*/
xmlChar
xmlPopInput(xmlParserCtxtPtr ctxt) {
- if (ctxt->inputNr == 1) return(0); /* End of main Input */
+ if ((ctxt == NULL) || (ctxt->inputNr <= 1)) return(0);
if (xmlParserDebugEntities)
xmlGenericError(xmlGenericErrorContext,
"Popping input %d\n", ctxt->inputNr);
@@ -1926,7 +1936,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
int c,l;
int nbchars = 0;
- if ((str == NULL) || (len < 0))
+ if ((ctxt == NULL) || (str == NULL) || (len < 0))
return(NULL);
last = str + len;
@@ -2068,6 +2078,7 @@ mem_error:
xmlChar *
xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what,
xmlChar end, xmlChar end2, xmlChar end3) {
+ if ((ctxt == NULL) || (str == NULL)) return(NULL);
return(xmlStringLenDecodeEntities(ctxt, str, xmlStrlen(str), what,
end, end2, end3));
}
@@ -2180,6 +2191,7 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) {
const xmlChar *cur = name;
int c;
+ if (prefix == NULL) return(NULL);
*prefix = NULL;
if (cur == NULL) return(NULL);
@@ -2992,6 +3004,7 @@ mem_error:
xmlChar *
xmlParseAttValue(xmlParserCtxtPtr ctxt) {
+ if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0));
}
@@ -3199,15 +3212,17 @@ get_more_space:
const xmlChar *tmp = ctxt->input->cur;
ctxt->input->cur = in;
- if (ctxt->sax->ignorableWhitespace !=
- ctxt->sax->characters) {
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->ignorableWhitespace !=
+ ctxt->sax->characters)) {
if (areBlanks(ctxt, tmp, nbchar, 1)) {
ctxt->sax->ignorableWhitespace(ctxt->userData,
tmp, nbchar);
} else if (ctxt->sax->characters != NULL)
ctxt->sax->characters(ctxt->userData,
tmp, nbchar);
- } else if (ctxt->sax->characters != NULL) {
+ } else if ((ctxt->sax != NULL) &&
+ (ctxt->sax->characters != NULL)) {
ctxt->sax->characters(ctxt->userData,
tmp, nbchar);
}
@@ -3241,7 +3256,8 @@ get_more:
}
nbchar = in - ctxt->input->cur;
if (nbchar > 0) {
- if ((ctxt->sax->ignorableWhitespace !=
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->ignorableWhitespace !=
ctxt->sax->characters) &&
(IS_BLANK_CH(*ctxt->input->cur))) {
const xmlChar *tmp = ctxt->input->cur;
@@ -3255,7 +3271,7 @@ get_more:
tmp, nbchar);
line = ctxt->input->line;
col = ctxt->input->col;
- } else {
+ } else if (ctxt->sax != NULL) {
if (ctxt->sax->characters != NULL)
ctxt->sax->characters(ctxt->userData,
ctxt->input->cur, nbchar);
@@ -8541,6 +8557,9 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
xmlInitParser();
+ if ((ctxt == NULL) || (ctxt->input == NULL))
+ return(-1);
+
GROW;
/*
@@ -8700,6 +8719,9 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
xmlChar start[4];
xmlCharEncoding enc;
+ if ((ctxt == NULL) || (ctxt->input == NULL))
+ return(-1);
+
xmlDefaultSAXHandlerInit();
xmlDetectSAX2(ctxt);
@@ -8942,6 +8964,9 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
xmlChar cur, next;
const xmlChar *lastlt, *lastgt;
+ if (ctxt->input == NULL)
+ return(0);
+
#ifdef DEBUG_PUSH
switch (ctxt->instate) {
case XML_PARSER_EOF:
@@ -9801,6 +9826,8 @@ done:
int
xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
+ if (ctxt == NULL)
+ return(XML_ERR_INTERNAL_ERROR);
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
if (ctxt->instate == XML_PARSER_START)
@@ -9849,13 +9876,16 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
/*
* Check for termination
*/
- int avail = 0;
+ int avail = 0;
+
+ if (ctxt->input != NULL) {
if (ctxt->input->buf == NULL)
- avail = ctxt->input->length -
- (ctxt->input->cur - ctxt->input->base);
- else
- avail = ctxt->input->buf->buffer->use -
- (ctxt->input->cur - ctxt->input->base);
+ avail = ctxt->input->length -
+ (ctxt->input->cur - ctxt->input->base);
+ else
+ avail = ctxt->input->buf->buffer->use -
+ (ctxt->input->cur - ctxt->input->base);
+ }
if ((ctxt->instate != XML_PARSER_EOF) &&
(ctxt->instate != XML_PARSER_EPILOG)) {
@@ -9957,7 +9987,11 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
xmlFreeParserCtxt(ctxt);
return(NULL);
}
- memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
+ memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
+ if (sax->initialized == XML_SAX2_MAGIC)
+ memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
+ else
+ memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
if (user_data != NULL)
ctxt->userData = user_data;
}
@@ -10038,6 +10072,8 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
xmlParserCtxtPtr ctxt;
xmlParserInputPtr inputStream;
xmlParserInputBufferPtr buf;
+
+ if (ioread == NULL) return(NULL);
buf = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, enc);
if (buf == NULL) return(NULL);
@@ -10058,7 +10094,11 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
xmlFree(ctxt);
return(NULL);
}
- memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
+ memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
+ if (sax->initialized == XML_SAX2_MAGIC)
+ memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
+ else
+ memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
if (user_data != NULL)
ctxt->userData = user_data;
}
@@ -10253,7 +10293,8 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
if (input == NULL) {
if (sax != NULL) ctxt->sax = NULL;
xmlFreeParserCtxt(ctxt);
- xmlFree(systemIdCanonic);
+ if (systemIdCanonic != NULL)
+ xmlFree(systemIdCanonic);
return(NULL);
}
@@ -10362,6 +10403,8 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
xmlChar start[4];
xmlCharEncoding enc;
+ if (ctx == NULL) return(-1);
+
if (ctx->depth > 40) {
return(XML_ERR_ENTITY_LOOP);
}
@@ -11163,7 +11206,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
xmlParserCtxtPtr ctxt;
xmlDocPtr newDoc;
xmlSAXHandlerPtr oldsax = NULL;
- xmlNodePtr content;
+ xmlNodePtr content, newRoot;
int size;
int ret = 0;
@@ -11193,14 +11236,23 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
xmlFreeParserCtxt(ctxt);
return(-1);
}
- newDoc->dict = ctxt->dict;
- xmlDictReference(newDoc->dict);
+ if ((doc != NULL) && (doc->dict != NULL)) {
+ xmlDictFree(ctxt->dict);
+ ctxt->dict = doc->dict;
+ xmlDictReference(ctxt->dict);
+ ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
+ ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
+ ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
+ ctxt->dictNames = 1;
+ } else {
+ xmlCtxtUseOptions(ctxt, XML_PARSE_NODICT);
+ }
if (doc != NULL) {
newDoc->intSubset = doc->intSubset;
newDoc->extSubset = doc->extSubset;
}
- newDoc->children = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
- if (newDoc->children == NULL) {
+ newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
+ if (newRoot == NULL) {
if (sax != NULL)
ctxt->sax = oldsax;
xmlFreeParserCtxt(ctxt);
@@ -11209,7 +11261,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
xmlFreeDoc(newDoc);
return(-1);
}
- nodePush(ctxt, newDoc->children);
+ xmlAddChild((xmlNodePtr) newDoc, newRoot);
+ nodePush(ctxt, newRoot);
if (doc == NULL) {
ctxt->myDoc = newDoc;
} else {
@@ -11253,21 +11306,22 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
ret = 0;
}
- if (lst != NULL && (ret == 0 || recover == 1)) {
- xmlNodePtr cur;
+ if ((lst != NULL) && ((ret == 0) || (recover == 1))) {
+ xmlNodePtr cur;
- /*
- * Return the newly created nodeset after unlinking it from
- * they pseudo parent.
- */
- cur = newDoc->children->children;
- *lst = cur;
- while (cur != NULL) {
- cur->parent = NULL;
- cur = cur->next;
- }
- newDoc->children->children = NULL;
+ /*
+ * Return the newly created nodeset after unlinking it from
+ * they pseudo parent.
+ */
+ cur = newDoc->children->children;
+ *lst = cur;
+ while (cur != NULL) {
+ xmlSetTreeDoc(cur, doc);
+ cur->parent = NULL;
+ cur = cur->next;
}
+ newDoc->children->children = NULL;
+ }
if (sax != NULL)
ctxt->sax = oldsax;
@@ -11627,10 +11681,13 @@ xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const xmlChar* buffer,
{
xmlParserInputPtr input;
+ if ((ctxt == NULL) || (buffer == NULL))
+ return;
+
input = xmlNewInputStream(ctxt);
if (input == NULL) {
xmlErrMemory(NULL, "parsing new buffer: out of memory\n");
- xmlFree(ctxt);
+ xmlClearParserCtxt(ctxt);
return;
}
@@ -11684,6 +11741,10 @@ xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data,
}
if (sax != NULL)
ctxt->sax = NULL;
+ if (ctxt->myDoc != NULL) {
+ xmlFreeDoc(ctxt->myDoc);
+ ctxt->myDoc = NULL;
+ }
xmlFreeParserCtxt(ctxt);
return ret;
@@ -11886,6 +11947,10 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data,
ret = -1;
}
ctxt->sax = oldsax;
+ if (ctxt->myDoc != NULL) {
+ xmlFreeDoc(ctxt->myDoc);
+ ctxt->myDoc = NULL;
+ }
xmlFreeParserCtxt(ctxt);
return ret;
@@ -11929,6 +11994,7 @@ xmlDocPtr
xmlSAXParseDoc(xmlSAXHandlerPtr sax, xmlChar *cur, int recovery) {
xmlDocPtr ret;
xmlParserCtxtPtr ctxt;
+ xmlSAXHandlerPtr oldsax = NULL;
if (cur == NULL) return(NULL);
@@ -11936,6 +12002,7 @@ xmlSAXParseDoc(xmlSAXHandlerPtr sax, xmlChar *cur, int recovery) {
ctxt = xmlCreateDocParserCtxt(cur);
if (ctxt == NULL) return(NULL);
if (sax != NULL) {
+ oldsax = ctxt->sax;
ctxt->sax = sax;
ctxt->userData = NULL;
}
@@ -11948,8 +12015,8 @@ xmlSAXParseDoc(xmlSAXHandlerPtr sax, xmlChar *cur, int recovery) {
xmlFreeDoc(ctxt->myDoc);
ctxt->myDoc = NULL;
}
- if (sax != NULL)
- ctxt->sax = NULL;
+ if (sax != NULL)
+ ctxt->sax = oldsax;
xmlFreeParserCtxt(ctxt);
return(ret);
@@ -12083,6 +12150,10 @@ xmlCleanupParser(void) {
#ifdef LIBXML_OUTPUT_ENABLED
xmlCleanupOutputCallbacks();
#endif
+#ifdef LIBXML_SCHEMAS_ENABLED
+ xmlSchemaCleanupTypes();
+ xmlRelaxNGCleanupTypes();
+#endif
xmlCleanupGlobals();
xmlResetLastError();
xmlCleanupThreads(); /* must be last if called not from the main thread */
@@ -12118,7 +12189,12 @@ void
xmlCtxtReset(xmlParserCtxtPtr ctxt)
{
xmlParserInputPtr input;
- xmlDictPtr dict = ctxt->dict;
+ xmlDictPtr dict;
+
+ if (ctxt == NULL)
+ return;
+
+ dict = ctxt->dict;
while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
xmlFreeInputStream(input);
@@ -12314,6 +12390,8 @@ xmlCtxtResetPush(xmlParserCtxtPtr ctxt, const char *chunk,
int
xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
{
+ if (ctxt == NULL)
+ return(-1);
if (options & XML_PARSE_RECOVER) {
ctxt->recovery = 1;
options -= XML_PARSE_RECOVER;
diff --git a/parserInternals.c b/parserInternals.c
index 09f8bb8..994aaa2 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -281,6 +281,7 @@ xmlParserInputRead(xmlParserInputPtr in, int len) {
int used;
int indx;
+ if (in == NULL) return(-1);
#ifdef DEBUG_INPUT
xmlGenericError(xmlGenericErrorContext, "Read\n");
#endif
@@ -330,6 +331,7 @@ xmlParserInputGrow(xmlParserInputPtr in, int len) {
int ret;
int indx;
+ if (in == NULL) return(-1);
#ifdef DEBUG_INPUT
xmlGenericError(xmlGenericErrorContext, "Grow\n");
#endif
@@ -388,6 +390,7 @@ xmlParserInputShrink(xmlParserInputPtr in) {
#ifdef DEBUG_INPUT
xmlGenericError(xmlGenericErrorContext, "Shrink\n");
#endif
+ if (in == NULL) return;
if (in->buf == NULL) return;
if (in->base == NULL) return;
if (in->cur == NULL) return;
@@ -444,7 +447,8 @@ xmlParserInputShrink(xmlParserInputPtr in) {
void
xmlNextChar(xmlParserCtxtPtr ctxt)
{
- if (ctxt->instate == XML_PARSER_EOF)
+ if ((ctxt == NULL) || (ctxt->instate == XML_PARSER_EOF) ||
+ (ctxt->input == NULL))
return;
if (ctxt->charset == XML_CHAR_ENCODING_UTF8) {
@@ -570,14 +574,20 @@ encoding_error:
* to ISO-Latin-1 (if you don't like this policy, just declare the
* encoding !)
*/
- __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
- "Input is not proper UTF-8, indicate encoding !\n",
- NULL, NULL);
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
- ctxt->sax->error(ctxt->userData,
- "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
- ctxt->input->cur[0], ctxt->input->cur[1],
- ctxt->input->cur[2], ctxt->input->cur[3]);
+ if ((ctxt == NULL) || (ctxt->input == NULL) ||
+ (ctxt->input->end - ctxt->input->cur < 4)) {
+ __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
+ "Input is not proper UTF-8, indicate encoding !\n",
+ NULL, NULL);
+ } else {
+ char buffer[150];
+
+ snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ ctxt->input->cur[0], ctxt->input->cur[1],
+ ctxt->input->cur[2], ctxt->input->cur[3]);
+ __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
+ "Input is not proper UTF-8, indicate encoding !\n%s",
+ BAD_CAST buffer, NULL);
}
ctxt->charset = XML_CHAR_ENCODING_8859_1;
ctxt->input->cur++;
@@ -604,6 +614,7 @@ encoding_error:
int
xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
+ if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
if (ctxt->instate == XML_PARSER_EOF)
return(0);
@@ -716,13 +727,15 @@ encoding_error:
* to ISO-Latin-1 (if you don't like this policy, just declare the
* encoding !)
*/
- __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
- "Input is not proper UTF-8, indicate encoding !\n",
- NULL, NULL);
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
- ctxt->sax->error(ctxt->userData, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ {
+ char buffer[150];
+
+ snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
ctxt->input->cur[0], ctxt->input->cur[1],
ctxt->input->cur[2], ctxt->input->cur[3]);
+ __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
+ "Input is not proper UTF-8, indicate encoding !\n%s",
+ BAD_CAST buffer, NULL);
}
ctxt->charset = XML_CHAR_ENCODING_8859_1;
*len = 1;
@@ -744,6 +757,7 @@ encoding_error:
int
xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar * cur, int *len)
{
+ if ((len == NULL) || (cur == NULL)) return(0);
if ((ctxt == NULL) || (ctxt->charset == XML_CHAR_ENCODING_UTF8)) {
/*
* We are supposed to handle UTF8, check it's valid
@@ -810,20 +824,31 @@ xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar * cur, int *len)
encoding_error:
/*
+ * An encoding problem may arise from a truncated input buffer
+ * splitting a character in the middle. In that case do not raise
+ * an error but return 0 to endicate an end of stream problem
+ */
+ if ((ctxt == NULL) || (ctxt->input == NULL) ||
+ (ctxt->input->end - ctxt->input->cur < 4)) {
+ *len = 0;
+ return(0);
+ }
+ /*
* If we detect an UTF8 error that probably mean that the
* input encoding didn't get properly advertised in the
* declaration header. Report the error and switch the encoding
* to ISO-Latin-1 (if you don't like this policy, just declare the
* encoding !)
*/
- __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
- "Input is not proper UTF-8, indicate encoding !\n",
- NULL, NULL);
- if ((ctxt != NULL) && (ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
- ctxt->sax->error(ctxt->userData,
- "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
- ctxt->input->cur[0], ctxt->input->cur[1],
- ctxt->input->cur[2], ctxt->input->cur[3]);
+ {
+ char buffer[150];
+
+ snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ ctxt->input->cur[0], ctxt->input->cur[1],
+ ctxt->input->cur[2], ctxt->input->cur[3]);
+ __xmlErrEncoding(ctxt, XML_ERR_INVALID_CHAR,
+ "Input is not proper UTF-8, indicate encoding !\n%s",
+ BAD_CAST buffer, NULL);
}
*len = 1;
return ((int) *cur);
@@ -840,6 +865,7 @@ encoding_error:
*/
int
xmlCopyCharMultiByte(xmlChar *out, int val) {
+ if (out == NULL) return(0);
/*
* We are supposed to handle UTF8, check it's valid
* From rfc2044: encoding of the Unicode values on UTF-8:
@@ -882,6 +908,7 @@ xmlCopyCharMultiByte(xmlChar *out, int val) {
int
xmlCopyChar(int len ATTRIBUTE_UNUSED, xmlChar *out, int val) {
+ if (out == NULL) return(0);
/* the len parameter is ignored */
if (val >= 0x80) {
return(xmlCopyCharMultiByte (out, val));
@@ -911,6 +938,7 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
{
xmlCharEncodingHandlerPtr handler;
+ if (ctxt == NULL) return(-1);
switch (enc) {
case XML_CHAR_ENCODING_ERROR:
__xmlErrEncoding(ctxt, XML_ERR_UNKNOWN_ENCODING,
@@ -1329,6 +1357,7 @@ xmlNewIOInputStream(xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input,
xmlCharEncoding enc) {
xmlParserInputPtr inputStream;
+ if (input == NULL) return(NULL);
if (xmlParserDebugEntities)
xmlGenericError(xmlGenericErrorContext, "new input from I/O\n");
inputStream = xmlNewInputStream(ctxt);
@@ -1513,6 +1542,8 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
int
xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
{
+ xmlParserInputPtr input;
+
if(ctxt==NULL) {
xmlErrInternal(NULL, "Got NULL parser context\n", NULL);
return(-1);
@@ -1520,12 +1551,14 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
xmlDefaultSAXHandlerInit();
- ctxt->dict = xmlDictCreate();
+ if (ctxt->dict == NULL)
+ ctxt->dict = xmlDictCreate();
if (ctxt->dict == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
return(-1);
}
- ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
+ if (ctxt->sax == NULL)
+ ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
if (ctxt->sax == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
return(-1);
@@ -1536,8 +1569,11 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
ctxt->maxatts = 0;
ctxt->atts = NULL;
/* Allocate the Input stack */
- ctxt->inputTab = (xmlParserInputPtr *)
- xmlMalloc(5 * sizeof(xmlParserInputPtr));
+ if (ctxt->inputTab == NULL) {
+ ctxt->inputTab = (xmlParserInputPtr *)
+ xmlMalloc(5 * sizeof(xmlParserInputPtr));
+ ctxt->inputMax = 5;
+ }
if (ctxt->inputTab == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
ctxt->inputNr = 0;
@@ -1545,8 +1581,10 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
ctxt->input = NULL;
return(-1);
}
+ while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
+ xmlFreeInputStream(input);
+ }
ctxt->inputNr = 0;
- ctxt->inputMax = 5;
ctxt->input = NULL;
ctxt->version = NULL;
@@ -1561,7 +1599,10 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
ctxt->directory = NULL;
/* Allocate the Node stack */
- ctxt->nodeTab = (xmlNodePtr *) xmlMalloc(10 * sizeof(xmlNodePtr));
+ if (ctxt->nodeTab == NULL) {
+ ctxt->nodeTab = (xmlNodePtr *) xmlMalloc(10 * sizeof(xmlNodePtr));
+ ctxt->nodeMax = 10;
+ }
if (ctxt->nodeTab == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
ctxt->nodeNr = 0;
@@ -1573,11 +1614,13 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
return(-1);
}
ctxt->nodeNr = 0;
- ctxt->nodeMax = 10;
ctxt->node = NULL;
/* Allocate the Name stack */
- ctxt->nameTab = (const xmlChar **) xmlMalloc(10 * sizeof(xmlChar *));
+ if (ctxt->nameTab == NULL) {
+ ctxt->nameTab = (const xmlChar **) xmlMalloc(10 * sizeof(xmlChar *));
+ ctxt->nameMax = 10;
+ }
if (ctxt->nameTab == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
ctxt->nodeNr = 0;
@@ -1592,11 +1635,13 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
return(-1);
}
ctxt->nameNr = 0;
- ctxt->nameMax = 10;
ctxt->name = NULL;
/* Allocate the space stack */
- ctxt->spaceTab = (int *) xmlMalloc(10 * sizeof(int));
+ if (ctxt->spaceTab == NULL) {
+ ctxt->spaceTab = (int *) xmlMalloc(10 * sizeof(int));
+ ctxt->spaceMax = 10;
+ }
if (ctxt->spaceTab == NULL) {
xmlErrMemory(NULL, "cannot initialize parser context\n");
ctxt->nodeNr = 0;
@@ -1630,6 +1675,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
if (ctxt->keepBlanks == 0)
ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
+ ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
ctxt->vctxt.userData = ctxt;
ctxt->vctxt.error = xmlParserValidityError;
ctxt->vctxt.warning = xmlParserValidityWarning;
@@ -1783,9 +1829,10 @@ xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
if (ctxt==NULL)
return;
xmlClearNodeInfoSeq(&ctxt->node_seq);
- xmlInitParserCtxt(ctxt);
+ xmlCtxtReset(ctxt);
}
+
/**
* xmlParserFindNodeInfo:
* @ctx: an XML parser context
@@ -1795,17 +1842,20 @@ xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
*
* Returns an xmlParserNodeInfo block pointer or NULL
*/
-const xmlParserNodeInfo* xmlParserFindNodeInfo(const xmlParserCtxtPtr ctx,
- const xmlNodePtr node)
+const xmlParserNodeInfo *
+xmlParserFindNodeInfo(const xmlParserCtxtPtr ctx, const xmlNodePtr node)
{
- unsigned long pos;
-
- /* Find position where node should be at */
- pos = xmlParserFindNodeInfoIndex(&ctx->node_seq, node);
- if (pos < ctx->node_seq.length && ctx->node_seq.buffer[pos].node == node)
- return &ctx->node_seq.buffer[pos];
- else
- return NULL;
+ unsigned long pos;
+
+ if ((ctx == NULL) || (node == NULL))
+ return (NULL);
+ /* Find position where node should be at */
+ pos = xmlParserFindNodeInfoIndex(&ctx->node_seq, node);
+ if (pos < ctx->node_seq.length
+ && ctx->node_seq.buffer[pos].node == node)
+ return &ctx->node_seq.buffer[pos];
+ else
+ return NULL;
}
@@ -1818,9 +1868,11 @@ const xmlParserNodeInfo* xmlParserFindNodeInfo(const xmlParserCtxtPtr ctx,
void
xmlInitNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
{
- seq->length = 0;
- seq->maximum = 0;
- seq->buffer = NULL;
+ if (seq == NULL)
+ return;
+ seq->length = 0;
+ seq->maximum = 0;
+ seq->buffer = NULL;
}
/**
@@ -1833,12 +1885,13 @@ xmlInitNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
void
xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
{
- if ( seq->buffer != NULL )
- xmlFree(seq->buffer);
- xmlInitNodeInfoSeq(seq);
+ if (seq == NULL)
+ return;
+ if (seq->buffer != NULL)
+ xmlFree(seq->buffer);
+ xmlInitNodeInfoSeq(seq);
}
-
/**
* xmlParserFindNodeInfoIndex:
* @seq: a node info sequence pointer
@@ -1850,31 +1903,35 @@ xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
*
* Returns a long indicating the position of the record
*/
-unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
- const xmlNodePtr node)
+unsigned long
+xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
+ const xmlNodePtr node)
{
- unsigned long upper, lower, middle;
- int found = 0;
-
- /* Do a binary search for the key */
- lower = 1;
- upper = seq->length;
- middle = 0;
- while ( lower <= upper && !found) {
- middle = lower + (upper - lower) / 2;
- if ( node == seq->buffer[middle - 1].node )
- found = 1;
- else if ( node < seq->buffer[middle - 1].node )
- upper = middle - 1;
+ unsigned long upper, lower, middle;
+ int found = 0;
+
+ if ((seq == NULL) || (node == NULL))
+ return (-1);
+
+ /* Do a binary search for the key */
+ lower = 1;
+ upper = seq->length;
+ middle = 0;
+ while (lower <= upper && !found) {
+ middle = lower + (upper - lower) / 2;
+ if (node == seq->buffer[middle - 1].node)
+ found = 1;
+ else if (node < seq->buffer[middle - 1].node)
+ upper = middle - 1;
+ else
+ lower = middle + 1;
+ }
+
+ /* Return position */
+ if (middle == 0 || seq->buffer[middle - 1].node < node)
+ return middle;
else
- lower = middle + 1;
- }
-
- /* Return position */
- if ( middle == 0 || seq->buffer[middle - 1].node < node )
- return middle;
- else
- return middle - 1;
+ return middle - 1;
}
@@ -1891,6 +1948,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
{
unsigned long pos;
+ if ((ctxt == NULL) || (info == NULL)) return;
+
/* Find pos and check to see if node is already in the sequence */
pos = xmlParserFindNodeInfoIndex(&ctxt->node_seq, (xmlNodePtr)
info->node);
diff --git a/python/generator.py b/python/generator.py
index 04b3832..6032065 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -270,6 +270,7 @@ py_types = {
'xmlParserCtxt *': ('O', "parserCtxt", "xmlParserCtxtPtr", "xmlParserCtxtPtr"),
'htmlParserCtxtPtr': ('O', "parserCtxt", "xmlParserCtxtPtr", "xmlParserCtxtPtr"),
'htmlParserCtxt *': ('O', "parserCtxt", "xmlParserCtxtPtr", "xmlParserCtxtPtr"),
+ 'xmlValidCtxtPtr': ('O', "ValidCtxt", "xmlValidCtxtPtr", "xmlValidCtxtPtr"),
'xmlCatalogPtr': ('O', "catalog", "xmlCatalogPtr", "xmlCatalogPtr"),
'FILE *': ('O', "File", "FILEPtr", "FILE *"),
'xmlURIPtr': ('O', "URI", "xmlURIPtr", "xmlURIPtr"),
@@ -345,6 +346,14 @@ def skip_function(name):
return 1
if name == "xmlErrMemory":
return 1
+
+ if name == "xmlValidBuildContentModel":
+ return 1
+ if name == "xmlValidateElementDecl":
+ return 1
+ if name == "xmlValidateAttributeDecl":
+ return 1
+
return 0
def print_function_wrapper(name, output, export, include):
@@ -668,6 +677,7 @@ classes_type = {
"xmlParserCtxt *": ("._o", "parserCtxt(_obj=%s)", "parserCtxt"),
"htmlParserCtxtPtr": ("._o", "parserCtxt(_obj=%s)", "parserCtxt"),
"htmlParserCtxt *": ("._o", "parserCtxt(_obj=%s)", "parserCtxt"),
+ "xmlValidCtxtPtr": ("._o", "ValidCtxt(_obj=%s)", "ValidCtxt"),
"xmlCatalogPtr": ("._o", "catalog(_obj=%s)", "catalog"),
"xmlURIPtr": ("._o", "URI(_obj=%s)", "URI"),
"xmlErrorPtr": ("._o", "Error(_obj=%s)", "Error"),
@@ -718,6 +728,7 @@ classes_destructors = {
"Schema": "xmlSchemaFree",
"SchemaParserCtxt": "xmlSchemaFreeParserCtxt",
"SchemaValidCtxt": "xmlSchemaFreeValidCtxt",
+ "ValidCtxt": "xmlFreeValidCtxt",
}
functions_noexcept = {
diff --git a/python/libxml.c b/python/libxml.c
index bb2649a..ae1a0f4 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -1554,7 +1554,7 @@ libxml_xmlParserCtxtGenericErrorFuncHandler(void *ctx, int severity, char *str)
xmlParserCtxtPyCtxtPtr pyCtxt;
#ifdef DEBUG_ERROR
- printf("libxml_xmlParserCtxtGenericErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+ printf("libxml_xmlParserCtxtGenericErrorFuncHandler(%p, %s, ...) called\n", ctx, str);
#endif
ctxt = (xmlParserCtxtPtr)ctx;
@@ -1723,6 +1723,141 @@ libxml_xmlFreeParserCtxt(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
return(Py_None);
}
+/***
+ * xmlValidCtxt stuff
+ */
+
+typedef struct
+{
+ PyObject *warn;
+ PyObject *error;
+ PyObject *arg;
+} xmlValidCtxtPyCtxt;
+typedef xmlValidCtxtPyCtxt *xmlValidCtxtPyCtxtPtr;
+
+static void
+libxml_xmlValidCtxtGenericErrorFuncHandler(void *ctx, int severity, char *str)
+{
+ PyObject *list;
+ PyObject *result;
+ xmlValidCtxtPyCtxtPtr pyCtxt;
+
+#ifdef DEBUG_ERROR
+ printf("libxml_xmlValidCtxtGenericErrorFuncHandler(%p, %d, %s, ...) called\n", ctx, severity, str);
+#endif
+
+ pyCtxt = (xmlValidCtxtPyCtxtPtr)ctx;
+
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_charPtrWrap(str));
+ PyTuple_SetItem(list, 1, pyCtxt->arg);
+ Py_XINCREF(pyCtxt->arg);
+ result = PyEval_CallObject(pyCtxt->error, list);
+ if (result == NULL)
+ {
+ /* TODO: manage for the exception to be propagated... */
+ PyErr_Print();
+ }
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+}
+
+static void
+libxml_xmlValidCtxtGenericWarningFuncHandler(void *ctx, int severity, char *str)
+{
+ PyObject *list;
+ PyObject *result;
+ xmlValidCtxtPyCtxtPtr pyCtxt;
+
+#ifdef DEBUG_ERROR
+ printf("libxml_xmlValidCtxtGenericWarningFuncHandler(%p, %d, %s, ...) called\n", ctx, severity, str);
+#endif
+
+ pyCtxt = (xmlValidCtxtPyCtxtPtr)ctx;
+
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_charPtrWrap(str));
+ PyTuple_SetItem(list, 1, pyCtxt->arg);
+ Py_XINCREF(pyCtxt->arg);
+ result = PyEval_CallObject(pyCtxt->warn, list);
+ if (result == NULL)
+ {
+ /* TODO: manage for the exception to be propagated... */
+ PyErr_Print();
+ }
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+}
+
+static void
+libxml_xmlValidCtxtErrorFuncHandler(void *ctx, const char *msg, ...)
+{
+ va_list ap;
+
+ va_start(ap, msg);
+ libxml_xmlValidCtxtGenericErrorFuncHandler(ctx,XML_PARSER_SEVERITY_VALIDITY_ERROR,libxml_buildMessage(msg,ap));
+ va_end(ap);
+}
+
+static void
+libxml_xmlValidCtxtWarningFuncHandler(void *ctx, const char *msg, ...)
+{
+ va_list ap;
+
+ va_start(ap, msg);
+ libxml_xmlValidCtxtGenericWarningFuncHandler(ctx,XML_PARSER_SEVERITY_VALIDITY_WARNING,libxml_buildMessage(msg,ap));
+ va_end(ap);
+}
+
+static PyObject *
+libxml_xmlSetValidErrors(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
+{
+ PyObject *py_retval;
+ PyObject *pyobj_error;
+ PyObject *pyobj_warn;
+ PyObject *pyobj_ctx;
+ PyObject *pyobj_arg = Py_None;
+ xmlValidCtxtPtr ctxt;
+ xmlValidCtxtPyCtxtPtr pyCtxt;
+
+ if (!PyArg_ParseTuple
+ (args, (char *) "OOO|O:xmlSetValidErrors", &pyobj_ctx, &pyobj_error, &pyobj_warn, &pyobj_arg))
+ return (NULL);
+
+#ifdef DEBUG_ERROR
+ printf("libxml_xmlSetValidErrors(%p, %p, %p) called\n", pyobj_ctx, pyobj_error, pyobj_warn);
+#endif
+
+ ctxt = PyValidCtxt_Get(pyobj_ctx);
+ pyCtxt = xmlMalloc(sizeof(xmlValidCtxtPyCtxt));
+ if (pyCtxt == NULL) {
+ py_retval = libxml_intWrap(-1);
+ return(py_retval);
+ }
+ memset(pyCtxt, 0, sizeof(xmlValidCtxtPyCtxt));
+
+
+ /* TODO: check warn and error is a function ! */
+ Py_XDECREF(pyCtxt->error);
+ Py_XINCREF(pyobj_error);
+ pyCtxt->error = pyobj_error;
+
+ Py_XDECREF(pyCtxt->warn);
+ Py_XINCREF(pyobj_warn);
+ pyCtxt->warn = pyobj_warn;
+
+ Py_XDECREF(pyCtxt->arg);
+ Py_XINCREF(pyobj_arg);
+ pyCtxt->arg = pyobj_arg;
+
+ ctxt->error = libxml_xmlValidCtxtErrorFuncHandler;
+ ctxt->warning = libxml_xmlValidCtxtWarningFuncHandler;
+ ctxt->userData = pyCtxt;
+
+ py_retval = libxml_intWrap(1);
+ return (py_retval);
+}
+
/************************************************************************
* *
* Per xmlTextReader error handler *
@@ -3482,6 +3617,7 @@ static PyMethodDef libxmlMethods[] = {
{(char *) "type", libxml_type, METH_VARARGS, NULL},
{(char *) "doc", libxml_doc, METH_VARARGS, NULL},
{(char *) "xmlNewNode", libxml_xmlNewNode, METH_VARARGS, NULL},
+ {(char *)"xmlSetValidErrors", libxml_xmlSetValidErrors, METH_VARARGS, NULL},
#ifdef LIBXML_OUTPUT_ENABLED
{(char *) "serializeNode", libxml_serializeNode, METH_VARARGS, NULL},
{(char *) "saveNodeTo", libxml_saveNodeTo, METH_VARARGS, NULL},
@@ -3505,6 +3641,7 @@ static PyMethodDef libxmlMethods[] = {
#ifdef LIBXML_SCHEMAS_ENABLED
{(char *)"xmlRelaxNGSetValidErrors", libxml_xmlRelaxNGSetValidErrors, METH_VARARGS, NULL},
{(char *)"xmlRelaxNGFreeValidCtxt", libxml_xmlRelaxNGFreeValidCtxt, METH_VARARGS, NULL},
+ {(char *)"xmlSchemaSetValidErrors", libxml_xmlSchemaSetValidErrors, METH_VARARGS, NULL},
#endif
#ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
diff --git a/python/libxml2-py.c b/python/libxml2-py.c
index e67f193..2dc4649 100644
--- a/python/libxml2-py.c
+++ b/python/libxml2-py.c
@@ -368,6 +368,28 @@ libxml_xmlNanoFTPCleanup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBU
}
PyObject *
+libxml_xmlValidateOneElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOO:xmlValidateOneElement", &pyobj_ctxt, &pyobj_doc, &pyobj_elem))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+
+ c_retval = xmlValidateOneElement(ctxt, doc, elem);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlRecoverMemory(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlDocPtr c_retval;
@@ -502,6 +524,30 @@ libxml_xmlSchemaSetValidOptions(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
#endif /* LIBXML_SCHEMAS_ENABLED */
PyObject *
+libxml_xmlValidCtxtNormalizeAttributeValue(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ xmlChar * c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+ xmlChar * name;
+ xmlChar * value;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOOzz:xmlValidCtxtNormalizeAttributeValue", &pyobj_ctxt, &pyobj_doc, &pyobj_elem, &name, &value))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+
+ c_retval = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, name, value);
+ py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlFreeNs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
xmlNsPtr cur;
PyObject *pyobj_cur;
@@ -936,6 +982,29 @@ libxml_xmlParseNamespace(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlValidatePopElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+ xmlChar * qname;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOOz:xmlValidatePopElement", &pyobj_ctxt, &pyobj_doc, &pyobj_elem, &qname))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+
+ c_retval = xmlValidatePopElement(ctxt, doc, elem, qname);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlStrncasecmp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -1328,20 +1397,18 @@ libxml_xmlCatalogSetDebug(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(py_retval);
}
+#ifdef LIBXML_SCHEMAS_ENABLED
PyObject *
-libxml_xmlUCSIsMiscellaneousMathematicalSymbolsB(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+libxml_xmlRelaxNGInitTypes(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) {
PyObject *py_retval;
int c_retval;
- int code;
-
- if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsMiscellaneousMathematicalSymbolsB", &code))
- return(NULL);
- c_retval = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
+ c_retval = xmlRelaxNGInitTypes();
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
+#endif /* LIBXML_SCHEMAS_ENABLED */
PyObject *
libxml_xmlParserGetDirectory(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
@@ -1654,6 +1721,32 @@ libxml_xmlTextReaderConstEncoding(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
}
PyObject *
+libxml_xmlValidateOneAttribute(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+ xmlAttrPtr attr;
+ PyObject *pyobj_attr;
+ xmlChar * value;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOOOz:xmlValidateOneAttribute", &pyobj_ctxt, &pyobj_doc, &pyobj_elem, &pyobj_attr, &value))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+ attr = (xmlAttrPtr) PyxmlNode_Get(pyobj_attr);
+
+ c_retval = xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlHasNsProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlAttrPtr c_retval;
@@ -1858,6 +1951,25 @@ libxml_xmlCleanupInputCallbacks(PyObject *self ATTRIBUTE_UNUSED, PyObject *args
}
PyObject *
+libxml_xmlValidateRoot(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+
+ if (!PyArg_ParseTuple(args, (char *)"OO:xmlValidateRoot", &pyobj_ctxt, &pyobj_doc))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlValidateRoot(ctxt, doc);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlNormalizeURIPath(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -3158,6 +3270,28 @@ libxml_xmlSetListDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(Py_None);
}
+PyObject *
+libxml_xmlValidateDtd(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlDtdPtr dtd;
+ PyObject *pyobj_dtd;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOO:xmlValidateDtd", &pyobj_ctxt, &pyobj_doc, &pyobj_dtd))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ dtd = (xmlDtdPtr) PyxmlNode_Get(pyobj_dtd);
+
+ c_retval = xmlValidateDtd(ctxt, doc, dtd);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
#ifdef LIBXML_HTML_ENABLED
PyObject *
libxml_htmlReadFile(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
@@ -3313,6 +3447,28 @@ libxml_xmlUCSIsCombiningMarksforSymbols(PyObject *self ATTRIBUTE_UNUSED, PyObjec
}
PyObject *
+libxml_xmlValidateElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOO:xmlValidateElement", &pyobj_ctxt, &pyobj_doc, &pyobj_elem))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+
+ c_retval = xmlValidateElement(ctxt, doc, elem);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlPopInputCallbacks(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) {
PyObject *py_retval;
int c_retval;
@@ -5475,6 +5631,25 @@ libxml_xmlRelaxNGValidateFullElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *
#endif /* LIBXML_SCHEMAS_ENABLED */
PyObject *
+libxml_xmlValidateDocument(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+
+ if (!PyArg_ParseTuple(args, (char *)"OO:xmlValidateDocument", &pyobj_ctxt, &pyobj_doc))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlValidateDocument(ctxt, doc);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlUCSIsLimbu(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -5788,6 +5963,25 @@ libxml_xmlXPathNotEqualValues(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
#endif /* LIBXML_XPATH_ENABLED */
PyObject *
+libxml_xmlValidateDtdFinal(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+
+ if (!PyArg_ParseTuple(args, (char *)"OO:xmlValidateDtdFinal", &pyobj_ctxt, &pyobj_doc))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlValidateDtdFinal(ctxt, doc);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlParseEncName(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlChar * c_retval;
@@ -6068,6 +6262,23 @@ libxml_htmlNodeDumpOutput(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
#endif /* LIBXML_HTML_ENABLED */
+PyObject *
+libxml_xmlEncodeSpecialChars(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ xmlChar * c_retval;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlChar * input;
+
+ if (!PyArg_ParseTuple(args, (char *)"Oz:xmlEncodeSpecialChars", &pyobj_doc, &input))
+ return(NULL);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlEncodeSpecialChars(doc, input);
+ py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval);
+ return(py_retval);
+}
+
#ifdef LIBXML_HTML_ENABLED
PyObject *
libxml_htmlParseElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
@@ -6648,6 +6859,26 @@ libxml_xmlLoadCatalogs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(Py_None);
}
+PyObject *
+libxml_xmlValidateNotationUse(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlChar * notationName;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOz:xmlValidateNotationUse", &pyobj_ctxt, &pyobj_doc, &notationName))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlValidateNotationUse(ctxt, doc, notationName);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
#ifdef LIBXML_HTML_ENABLED
PyObject *
libxml_htmlCtxtReadDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
@@ -7104,23 +7335,6 @@ libxml_xmlBuildQName(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
-libxml_xmlEncodeSpecialChars(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
- PyObject *py_retval;
- xmlChar * c_retval;
- xmlDocPtr doc;
- PyObject *pyobj_doc;
- xmlChar * input;
-
- if (!PyArg_ParseTuple(args, (char *)"Oz:xmlEncodeSpecialChars", &pyobj_doc, &input))
- return(NULL);
- doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
-
- c_retval = xmlEncodeSpecialChars(doc, input);
- py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval);
- return(py_retval);
-}
-
-PyObject *
libxml_xmlFreePropList(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
xmlAttrPtr cur;
PyObject *pyobj_cur;
@@ -7382,6 +7596,16 @@ libxml_xmlRegexpPrint(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
#endif /* LIBXML_REGEXP_ENABLED */
PyObject *
+libxml_xmlNewValidCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) {
+ PyObject *py_retval;
+ xmlValidCtxtPtr c_retval;
+
+ c_retval = xmlNewValidCtxt();
+ py_retval = libxml_xmlValidCtxtPtrWrap((xmlValidCtxtPtr) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlUCSIsCatSm(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -9427,6 +9651,20 @@ libxml_xmlUCSIsArabic(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlUCSIsMiscellaneousMathematicalSymbolsB(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ int code;
+
+ if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsMiscellaneousMathematicalSymbolsB", &code))
+ return(NULL);
+
+ c_retval = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlNanoHTTPCleanup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) {
xmlNanoHTTPCleanup();
@@ -9621,6 +9859,29 @@ libxml_xmlCatalogConvert(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBU
}
PyObject *
+libxml_xmlValidatePushElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+ xmlChar * qname;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOOz:xmlValidatePushElement", &pyobj_ctxt, &pyobj_doc, &pyobj_elem, &qname))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+
+ c_retval = xmlValidatePushElement(ctxt, doc, elem, qname);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlUCSIsTaiXuanJingSymbols(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -10369,6 +10630,24 @@ libxml_xmlXPathStartsWithFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg
#endif /* LIBXML_XPATH_ENABLED */
PyObject *
+libxml_xmlValidatePushCData(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlChar * data;
+ int len;
+
+ if (!PyArg_ParseTuple(args, (char *)"Ozi:xmlValidatePushCData", &pyobj_ctxt, &data, &len))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+
+ c_retval = xmlValidatePushCData(ctxt, data, len);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlSearchNsByHref(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlNsPtr c_retval;
@@ -10501,21 +10780,23 @@ libxml_xmlCheckFilename(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(py_retval);
}
+#ifdef LIBXML_XPATH_ENABLED
PyObject *
-libxml_xmlParseDTD(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
- PyObject *py_retval;
- xmlDtdPtr c_retval;
- xmlChar * ExternalID;
- xmlChar * SystemID;
+libxml_xmlXPathFloorFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ xmlXPathParserContextPtr ctxt;
+ PyObject *pyobj_ctxt;
+ int nargs;
- if (!PyArg_ParseTuple(args, (char *)"zz:xmlParseDTD", &ExternalID, &SystemID))
+ if (!PyArg_ParseTuple(args, (char *)"Oi:xmlXPathFloorFunction", &pyobj_ctxt, &nargs))
return(NULL);
+ ctxt = (xmlXPathParserContextPtr) PyxmlXPathParserContext_Get(pyobj_ctxt);
- c_retval = xmlParseDTD(ExternalID, SystemID);
- py_retval = libxml_xmlNodePtrWrap((xmlNodePtr) c_retval);
- return(py_retval);
+ xmlXPathFloorFunction(ctxt, nargs);
+ Py_INCREF(Py_None);
+ return(Py_None);
}
+#endif /* LIBXML_XPATH_ENABLED */
PyObject *
libxml_xmlUCSIsTibetan(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
@@ -10565,23 +10846,21 @@ libxml_xmlSchemaValidCtxtGetOptions(PyObject *self ATTRIBUTE_UNUSED, PyObject *a
}
#endif /* LIBXML_SCHEMAS_ENABLED */
-#ifdef LIBXML_XPATH_ENABLED
PyObject *
-libxml_xmlXPathFloorFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
- xmlXPathParserContextPtr ctxt;
- PyObject *pyobj_ctxt;
- int nargs;
+libxml_xmlParseDTD(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ xmlDtdPtr c_retval;
+ xmlChar * ExternalID;
+ xmlChar * SystemID;
- if (!PyArg_ParseTuple(args, (char *)"Oi:xmlXPathFloorFunction", &pyobj_ctxt, &nargs))
+ if (!PyArg_ParseTuple(args, (char *)"zz:xmlParseDTD", &ExternalID, &SystemID))
return(NULL);
- ctxt = (xmlXPathParserContextPtr) PyxmlXPathParserContext_Get(pyobj_ctxt);
- xmlXPathFloorFunction(ctxt, nargs);
- Py_INCREF(Py_None);
- return(Py_None);
+ c_retval = xmlParseDTD(ExternalID, SystemID);
+ py_retval = libxml_xmlNodePtrWrap((xmlNodePtr) c_retval);
+ return(py_retval);
}
-#endif /* LIBXML_XPATH_ENABLED */
PyObject *
libxml_xmlNewGlobalNs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
@@ -10601,6 +10880,25 @@ libxml_xmlNewGlobalNs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlValidateDocumentFinal(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+
+ if (!PyArg_ParseTuple(args, (char *)"OO:xmlValidateDocumentFinal", &pyobj_ctxt, &pyobj_doc))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+
+ c_retval = xmlValidateDocumentFinal(ctxt, doc);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlIsLetter(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
@@ -10748,6 +11046,33 @@ libxml_xmlParseURI(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlValidateOneNamespace(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ int c_retval;
+ xmlValidCtxtPtr ctxt;
+ PyObject *pyobj_ctxt;
+ xmlDocPtr doc;
+ PyObject *pyobj_doc;
+ xmlNodePtr elem;
+ PyObject *pyobj_elem;
+ xmlChar * prefix;
+ xmlNsPtr ns;
+ PyObject *pyobj_ns;
+ xmlChar * value;
+
+ if (!PyArg_ParseTuple(args, (char *)"OOOzOz:xmlValidateOneNamespace", &pyobj_ctxt, &pyobj_doc, &pyobj_elem, &prefix, &pyobj_ns, &value))
+ return(NULL);
+ ctxt = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_ctxt);
+ doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc);
+ elem = (xmlNodePtr) PyxmlNode_Get(pyobj_elem);
+ ns = (xmlNsPtr) PyxmlNode_Get(pyobj_ns);
+
+ c_retval = xmlValidateOneNamespace(ctxt, doc, elem, prefix, ns, value);
+ py_retval = libxml_intWrap((int) c_retval);
+ return(py_retval);
+}
+
+PyObject *
libxml_xmlCopyProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlAttrPtr c_retval;
@@ -11197,7 +11522,7 @@ libxml_xmlStrncatNew(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *
libxml_xmlUTF8Strpos(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
- xmlChar * c_retval;
+ const xmlChar * c_retval;
xmlChar * utf;
int pos;
@@ -11205,7 +11530,7 @@ libxml_xmlUTF8Strpos(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(NULL);
c_retval = xmlUTF8Strpos(utf, pos);
- py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval);
+ py_retval = libxml_xmlCharPtrConstWrap((const xmlChar *) c_retval);
return(py_retval);
}
@@ -11893,6 +12218,20 @@ libxml_xmlNodeSetName(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlFreeValidCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ xmlValidCtxtPtr cur;
+ PyObject *pyobj_cur;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:xmlFreeValidCtxt", &pyobj_cur))
+ return(NULL);
+ cur = (xmlValidCtxtPtr) PyValidCtxt_Get(pyobj_cur);
+
+ xmlFreeValidCtxt(cur);
+ Py_INCREF(Py_None);
+ return(Py_None);
+}
+
+PyObject *
libxml_xmlUCSIsYiRadicals(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
int c_retval;
diff --git a/python/libxml_wrap.h b/python/libxml_wrap.h
index e821075..2758e99 100644
--- a/python/libxml_wrap.h
+++ b/python/libxml_wrap.h
@@ -73,6 +73,14 @@ typedef struct {
xmlParserCtxtPtr obj;
} PyparserCtxt_Object;
+#define PyValidCtxt_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyValidCtxt_Object *)(v))->obj))
+
+typedef struct {
+ PyObject_HEAD
+ xmlValidCtxtPtr obj;
+} PyValidCtxt_Object;
+
#define Pycatalog_Get(v) (((v) == Py_None) ? NULL : \
(((Pycatalog_Object *)(v))->obj))
@@ -213,6 +221,7 @@ PyObject * libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt);
PyObject * libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt);
PyObject * libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt);
PyObject * libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj);
+PyObject * libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid);
PyObject * libxml_xmlCatalogPtrWrap(xmlCatalogPtr obj);
PyObject * libxml_xmlURIPtrWrap(xmlURIPtr uri);
PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer);
diff --git a/python/setup.py b/python/setup.py
index e8bd1ae..75bf340 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -226,7 +226,7 @@ else:
setup (name = "libxml2-python",
# On *nix, the version number is created from setup.py.in
# On windows, it is set by configure.js
- version = "2.6.15",
+ version = "2.6.16",
description = descr,
author = "Daniel Veillard",
author_email = "veillard@redhat.com",
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
index 722e0ec..1ae9b6c 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -36,12 +36,14 @@ PYTESTS= \
thread2.py \
sync.py \
tstLastError.py \
- indexes.py
+ indexes.py \
+ dtdvalid.py
XMLS= \
tst.xml \
valid.xml \
- invalid.xml
+ invalid.xml \
+ test.dtd
EXTRA_DIST = $(PYTESTS) $(XMLS)
diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in
index 3b55268..9113a20 100644
--- a/python/tests/Makefile.in
+++ b/python/tests/Makefile.in
@@ -285,12 +285,14 @@ PYTESTS = \
thread2.py \
sync.py \
tstLastError.py \
- indexes.py
+ indexes.py \
+ dtdvalid.py
XMLS = \
tst.xml \
valid.xml \
- invalid.xml
+ invalid.xml \
+ test.dtd
EXTRA_DIST = $(PYTESTS) $(XMLS)
all: all-am
diff --git a/python/tests/dtdvalid.py b/python/tests/dtdvalid.py
new file mode 100755
index 0000000..2011f2c
--- /dev/null
+++ b/python/tests/dtdvalid.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python -u
+import libxml2
+import sys
+
+# Memory debug specific
+libxml2.debugMemory(1)
+
+dtd="""<!ELEMENT foo EMPTY>"""
+instance="""<?xml version="1.0"?>
+<foo></foo>"""
+
+dtd = libxml2.parseDTD(None, 'test.dtd')
+ctxt = libxml2.newValidCtxt()
+doc = libxml2.parseDoc(instance)
+ret = doc.validateDtd(ctxt, dtd)
+if ret != 1:
+ print "error doing DTD validation"
+ sys.exit(1)
+
+doc.freeDoc()
+dtd.freeDtd()
+del dtd
+del ctxt
+
+# Memory debug specific
+libxml2.cleanupParser()
+if libxml2.debugMemory(1) == 0:
+ print "OK"
+else:
+ print "Memory leak %d bytes" % (libxml2.debugMemory(1))
+ libxml2.dumpMemory()
+
diff --git a/python/tests/test.dtd b/python/tests/test.dtd
new file mode 100644
index 0000000..b61b438
--- /dev/null
+++ b/python/tests/test.dtd
@@ -0,0 +1 @@
+<!ELEMENT foo EMPTY>
diff --git a/python/types.c b/python/types.c
index fa91a65..329d270 100644
--- a/python/types.c
+++ b/python/types.c
@@ -478,6 +478,26 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
}
PyObject *
+libxml_xmlValidCtxtPtrWrap(xmlValidCtxtPtr valid)
+{
+ PyObject *ret;
+
+#ifdef DEBUG
+ printf("libxml_xmlValidCtxtPtrWrap: valid = %p\n", valid);
+#endif
+ if (valid == NULL) {
+ Py_INCREF(Py_None);
+ return (Py_None);
+ }
+
+ ret =
+ PyCObject_FromVoidPtrAndDesc((void *) valid,
+ (char *) "xmlValidCtxtPtr", NULL);
+
+ return (ret);
+}
+
+PyObject *
libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
{
PyObject *ret;
diff --git a/relaxng.c b/relaxng.c
index ae6c63d..af4de86 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -248,6 +248,7 @@ struct _xmlRelaxNGParserCtxt {
xmlAutomataStatePtr state; /* used to build the automata */
int crng; /* compact syntax and other flags */
+ int freedoc; /* need to free the document */
};
#define FLAGS_IGNORABLE 1
@@ -2781,7 +2782,7 @@ xmlRelaxNGRegisterTypeLibrary(const xmlChar * namespace, void *data,
*
* Returns 0 in case of success and -1 in case of error.
*/
-static int
+int
xmlRelaxNGInitTypes(void)
{
if (xmlRelaxNGTypeInitialized != 0)
@@ -6657,6 +6658,7 @@ xmlRelaxNGNewDocParserCtxt(xmlDocPtr doc)
}
memset(ret, 0, sizeof(xmlRelaxNGParserCtxt));
ret->document = copy;
+ ret->freedoc = 1;
ret->userData = xmlGenericErrorContext;
return (ret);
}
@@ -6693,6 +6695,8 @@ xmlRelaxNGFreeParserCtxt(xmlRelaxNGParserCtxtPtr ctxt)
xmlRelaxNGFreeDefine(ctxt->defTab[i]);
xmlFree(ctxt->defTab);
}
+ if ((ctxt->document != NULL) && (ctxt->freedoc))
+ xmlFreeDoc(ctxt->document);
xmlFree(ctxt);
}
@@ -7671,6 +7675,8 @@ xmlRelaxNGDumpGrammar(FILE * output, xmlRelaxNGGrammarPtr grammar, int top)
void
xmlRelaxNGDump(FILE * output, xmlRelaxNGPtr schema)
{
+ if (output == NULL)
+ return;
if (schema == NULL) {
fprintf(output, "RelaxNG empty or failed to compile\n");
return;
@@ -7700,6 +7706,8 @@ xmlRelaxNGDump(FILE * output, xmlRelaxNGPtr schema)
void
xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema)
{
+ if (output == NULL)
+ return;
if (schema == NULL) {
fprintf(output, "RelaxNG empty or failed to compile\n");
return;
diff --git a/testThreads.c b/testThreads.c
index d740a14..7147182 100644
--- a/testThreads.c
+++ b/testThreads.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include "libxml.h"
-#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED)
+#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_SAX1_ENABLED)
#include <libxml/globals.h>
#include <libxml/threads.h>
#include <libxml/parser.h>
diff --git a/testapi.c b/testapi.c
new file mode 100644
index 0000000..22c845d
--- /dev/null
+++ b/testapi.c
@@ -0,0 +1,48623 @@
+/*
+ * testapi.c: libxml2 API tester program.
+ *
+ * Automatically generated by gentest.py from libxml2-api.xml
+ *
+ * See Copyright for the status of this software.
+ *
+ * daniel@veillard.com
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <libxml/xmlerror.h>
+#include <libxml/relaxng.h>
+
+static int testlibxml2(void);
+static int test_module(const char *module);
+
+static int generic_errors = 0;
+static int call_tests = 0;
+static int function_tests = 0;
+
+static xmlChar chartab[1024];
+static int inttab[1024];
+static unsigned long longtab[1024];
+
+static xmlDocPtr api_doc = NULL;
+static xmlDtdPtr api_dtd = NULL;
+static xmlNodePtr api_root = NULL;
+static xmlAttrPtr api_attr = NULL;
+static xmlNsPtr api_ns = NULL;
+
+static void
+structured_errors(void *userData ATTRIBUTE_UNUSED,
+ xmlErrorPtr error ATTRIBUTE_UNUSED) {
+ generic_errors++;
+}
+
+static void
+free_api_doc(void) {
+ xmlFreeDoc(api_doc);
+ api_doc = NULL;
+ api_dtd = NULL;
+ api_root = NULL;
+ api_attr = NULL;
+ api_ns = NULL;
+}
+
+static xmlDocPtr
+get_api_doc(void) {
+ if (api_doc == NULL) {
+ api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
+ api_root = NULL;
+ api_attr = NULL;
+ }
+ return(api_doc);
+}
+
+static xmlDtdPtr
+get_api_dtd(void) {
+ if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
+ get_api_doc();
+ if ((api_doc != NULL) && (api_doc->children != NULL) &&
+ (api_doc->children->type == XML_DTD_NODE))
+ api_dtd = (xmlDtdPtr) api_doc->children;
+ }
+ return(api_dtd);
+}
+
+static xmlNodePtr
+get_api_root(void) {
+ if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
+ get_api_doc();
+ if ((api_doc != NULL) && (api_doc->children != NULL) &&
+ (api_doc->children->next != NULL) &&
+ (api_doc->children->next->type == XML_ELEMENT_NODE))
+ api_root = api_doc->children->next;
+ }
+ return(api_root);
+}
+
+static xmlNsPtr
+get_api_ns(void) {
+ get_api_root();
+ if (api_root != NULL)
+ api_ns = api_root->nsDef;
+ return(api_ns);
+}
+
+static xmlAttrPtr
+get_api_attr(void) {
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
+ static int nr = 0;
+ xmlChar name[20];
+#endif
+
+ if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
+ get_api_root();
+ }
+ if (api_root == NULL)
+ return(NULL);
+ if (api_root->properties != NULL) {
+ api_attr = api_root->properties;
+ return(api_root->properties);
+ }
+ api_attr = NULL;
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
+ snprintf((char *) name, 20, "foo%d", nr++);
+ api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
+#endif
+ return(api_attr);
+}
+
+static int quiet = 0;
+
+int main(int argc, char **argv) {
+ int ret;
+ int blocks, mem;
+
+ memset(chartab, 0, sizeof(chartab));
+ strncpy((char *) chartab, " chartab\n", 20);
+ memset(inttab, 0, sizeof(inttab));
+ memset(longtab, 0, sizeof(longtab));
+
+ xmlInitParser();
+#ifdef LIBXML_SCHEMAS_ENABLED
+ xmlRelaxNGInitTypes();
+#endif
+
+ LIBXML_TEST_VERSION
+
+ xmlSetStructuredErrorFunc(NULL, structured_errors);
+
+ if (argc >= 2) {
+ if (!strcmp(argv[1], "-q")) {
+ quiet = 1;
+ if (argc >= 3)
+ ret = test_module(argv[2]);
+ else
+ ret = testlibxml2();
+ } else {
+ ret = test_module(argv[1]);
+ }
+ } else
+ ret = testlibxml2();
+
+ xmlCleanupParser();
+ blocks = xmlMemBlocks();
+ mem = xmlMemUsed();
+ if ((blocks != 0) || (mem != 0)) {
+ printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
+ }
+ xmlMemoryDump();
+
+ return (ret != 0);
+}
+
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+#include <libxml/catalog.h>
+#include <libxml/chvalid.h>
+#include <libxml/dict.h>
+#include <libxml/encoding.h>
+#include <libxml/entities.h>
+#include <libxml/hash.h>
+#include <libxml/list.h>
+#include <libxml/nanoftp.h>
+#include <libxml/nanohttp.h>
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/pattern.h>
+#include <libxml/relaxng.h>
+#include <libxml/schemasInternals.h>
+#include <libxml/tree.h>
+#include <libxml/uri.h>
+#include <libxml/valid.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlIO.h>
+#include <libxml/xmlerror.h>
+#include <libxml/xmlreader.h>
+#include <libxml/xmlsave.h>
+#include <libxml/xmlschemas.h>
+#include <libxml/xmlschemastypes.h>
+#include <libxml/xmlstring.h>
+#include <libxml/xmlwriter.h>
+#include <libxml/xpath.h>
+#include <libxml/xpointer.h>
+#include <libxml/debugXML.h>
+
+#define gen_nb_void_ptr 2
+
+static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#if 0
+#define gen_nb_const_void_ptr 2
+
+static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return((const void *) "immutable string");
+ return(NULL);
+}
+static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+#define gen_nb_userdata 3
+
+static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return((void *) &call_tests);
+ if (no == 1) return((void *) -1);
+ return(NULL);
+}
+static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+
+#define gen_nb_int 4
+
+static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(0);
+ if (no == 1) return(1);
+ if (no == 2) return(-1);
+ if (no == 3) return(122);
+ return(-1);
+}
+
+static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_parseroptions 5
+
+static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
+ if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
+ if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
+ if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
+ return(XML_PARSE_SAX1);
+}
+
+static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#if 0
+#define gen_nb_long 5
+
+static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(0);
+ if (no == 1) return(1);
+ if (no == 2) return(-1);
+ if (no == 3) return(122);
+ return(-1);
+}
+
+static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+#define gen_nb_xmlChar 4
+
+static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return('a');
+ if (no == 1) return(' ');
+ if (no == 2) return('°');
+ return(0);
+}
+
+static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_unsigned_int 3
+
+static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(0);
+ if (no == 1) return(1);
+ if (no == 2) return(122);
+ return(-1);
+}
+
+static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_unsigned_long 4
+
+static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(0);
+ if (no == 1) return(1);
+ if (no == 2) return(122);
+ return(-1);
+}
+
+static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_double 4
+
+static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(0);
+ if (no == 1) return(-1.1);
+#if defined(LIBXML_XPATH_ENABLED)
+ if (no == 2) return(xmlXPathNAN);
+#endif
+ return(-1);
+}
+
+static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_unsigned_long_ptr 2
+
+static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
+ if (no == 0) return(&longtab[nr]);
+ return(NULL);
+}
+
+static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_int_ptr 2
+
+static int *gen_int_ptr(int no, int nr) {
+ if (no == 0) return(&inttab[nr]);
+ return(NULL);
+}
+
+static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_const_char_ptr 4
+
+static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return((char *) "foo");
+ if (no == 1) return((char *) "<foo/>");
+ if (no == 2) return((char *) "test/ent2");
+ return(NULL);
+}
+static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlChar_ptr 2
+
+static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(&chartab[0]);
+ return(NULL);
+}
+static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_FILE_ptr 2
+
+static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(fopen("test.out", "a+"));
+ return(NULL);
+}
+static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) fclose(val);
+}
+
+#define gen_nb_debug_FILE_ptr 2
+static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(fopen("test.out", "a+"));
+}
+static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) fclose(val);
+}
+
+#define gen_nb_const_xmlChar_ptr 5
+
+static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return((xmlChar *) "foo");
+ if (no == 1) return((xmlChar *) "<foo/>");
+ if (no == 2) return((xmlChar *) "n°ne");
+ if (no == 3) return((xmlChar *) " 2ab ");
+ return(NULL);
+}
+static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_filepath 8
+
+static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return("missing.xml");
+ if (no == 1) return("<foo/>");
+ if (no == 2) return("test/ent2");
+ if (no == 3) return("test/valid/REC-xml-19980210.xml");
+ if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
+ if (no == 5) return("http://missing.example.org/");
+ if (no == 6) return("http://missing. example.org/");
+ return(NULL);
+}
+static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_eaten_name 2
+
+static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
+ return(NULL);
+}
+static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_fileoutput 6
+
+static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return("/missing.xml");
+ if (no == 1) return("<foo/>");
+ if (no == 2) return("ftp://missing.example.org/foo");
+ if (no == 3) return("http://missing.example.org/");
+ if (no == 4) return("http://missing. example.org/");
+ return(NULL);
+}
+static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlParserCtxtPtr 3
+static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewParserCtxt());
+ if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
+ return(NULL);
+}
+static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL)
+ xmlFreeParserCtxt(val);
+}
+
+#define gen_nb_xmlSAXHandlerPtr 2
+static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
+#ifdef LIBXML_SAX1_ENABLED
+ if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
+#endif
+ return(NULL);
+}
+static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlValidCtxtPtr 2
+static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
+#ifdef LIBXML_VALID_ENABLED
+ if (no == 0) return(xmlNewValidCtxt());
+#endif
+ return(NULL);
+}
+static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
+#ifdef LIBXML_VALID_ENABLED
+ if (val != NULL)
+ xmlFreeValidCtxt(val);
+#endif
+}
+
+#define gen_nb_xmlParserInputBufferPtr 8
+
+static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
+ if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
+ if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
+ if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
+ if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
+ if (no == 5) return(xmlParserInputBufferCreateFilename("http://missing.example.org/", XML_CHAR_ENCODING_NONE));
+ if (no == 6) return(xmlParserInputBufferCreateFilename("http://missing. example.org/", XML_CHAR_ENCODING_NONE));
+ return(NULL);
+}
+static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
+ xmlFreeParserInputBuffer(val);
+}
+
+#define gen_nb_xmlDocPtr 3
+static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
+ if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
+ return(NULL);
+}
+static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
+ if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
+ xmlFreeDoc(val);
+}
+
+#define gen_nb_xmlAttrPtr 2
+static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(get_api_attr());
+ return(NULL);
+}
+static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) free_api_doc();
+}
+
+#define gen_nb_xmlDictPtr 2
+static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlDictCreate());
+ return(NULL);
+}
+static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL)
+ xmlDictFree(val);
+}
+
+#define gen_nb_xmlNodePtr 3
+static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
+ if (no == 1) return(get_api_root());
+ return(NULL);
+/* if (no == 2) return((xmlNodePtr) get_api_doc()); */
+}
+static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) free_api_doc();
+ else if (val != NULL) {
+ xmlUnlinkNode(val);
+ xmlFreeNode(val);
+ }
+}
+
+#define gen_nb_xmlDtdPtr 3
+static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0)
+ return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
+ if (no == 1) return(get_api_dtd());
+ return(NULL);
+}
+static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) free_api_doc();
+ else if (val != NULL) {
+ xmlUnlinkNode((xmlNodePtr) val);
+ xmlFreeNode((xmlNodePtr) val);
+ }
+}
+
+#define gen_nb_xmlNsPtr 2
+static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(get_api_ns());
+ return(NULL);
+}
+static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) free_api_doc();
+}
+
+#define gen_nb_xmlNodePtr_in 3
+static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
+ if (no == 0) return(xmlNewText(BAD_CAST "text"));
+ return(NULL);
+}
+static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#ifdef LIBXML_WRITER_ENABLED
+#define gen_nb_xmlTextWriterPtr 2
+static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
+ return(NULL);
+}
+static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) xmlFreeTextWriter(val);
+}
+#endif
+
+#ifdef LIBXML_READER_ENABLED
+#define gen_nb_xmlTextReaderPtr 4
+static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
+ if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
+ if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
+ return(NULL);
+}
+static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) xmlFreeTextReader(val);
+}
+#endif
+
+#define gen_nb_xmlBufferPtr 3
+static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlBufferCreate());
+ if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
+ return(NULL);
+}
+static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlBufferFree(val);
+ }
+}
+
+#define gen_nb_xmlListPtr 2
+static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlListCreate(NULL, NULL));
+ return(NULL);
+}
+static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlListDelete(val);
+ }
+}
+
+#define gen_nb_xmlHashTablePtr 2
+static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlHashCreate(10));
+ return(NULL);
+}
+static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlHashFree(val, NULL);
+ }
+}
+
+#include <libxml/xpathInternals.h>
+
+#ifdef LIBXML_XPATH_ENABLED
+#define gen_nb_xmlXPathObjectPtr 5
+static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
+ if (no == 1) return(xmlXPathNewFloat(1.1));
+ if (no == 2) return(xmlXPathNewBoolean(1));
+ if (no == 3) return(xmlXPathNewNodeSet(NULL));
+ return(NULL);
+}
+static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlXPathFreeObject(val);
+ }
+}
+#endif
+
+#ifdef LIBXML_OUTPUT_ENABLED
+#define gen_nb_xmlOutputBufferPtr 2
+static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
+ return(NULL);
+}
+static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlOutputBufferClose(val);
+ }
+}
+#endif
+
+#ifdef LIBXML_FTP_ENABLED
+#define gen_nb_xmlNanoFTPCtxtPtr 4
+static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNanoFTPNewCtxt("ftp://example.com/"));
+ if (no == 1) return(xmlNanoFTPNewCtxt("http://example.com/"));
+ if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
+ return(NULL);
+}
+static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL) {
+ xmlNanoFTPFreeCtxt(val);
+ }
+}
+#endif
+
+#ifdef LIBXML_HTTP_ENABLED
+#define gen_nb_xmlNanoHTTPCtxtPtr 1
+static void *gen_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+#define gen_nb_xmlCharEncoding 4
+static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(XML_CHAR_ENCODING_UTF8);
+ if (no == 1) return(XML_CHAR_ENCODING_NONE);
+ if (no == 0) return(XML_CHAR_ENCODING_8859_1);
+ return(XML_CHAR_ENCODING_ERROR);
+}
+static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlHashDeallocator 2
+static void
+test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
+}
+
+static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(test_xmlHashDeallocator);
+ return(NULL);
+}
+static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+
+static void desret_int(int val ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
+}
+static void desret_long(long val ATTRIBUTE_UNUSED) {
+}
+static void desret_double(double val ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
+}
+#if 0
+static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
+}
+#endif
+static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
+}
+static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
+}
+static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlChar_ptr(xmlChar *val) {
+ if (val != NULL)
+ xmlFree(val);
+}
+static void desret_xmlDocPtr(xmlDocPtr val) {
+ if (val != api_doc)
+ xmlFreeDoc(val);
+}
+static void desret_xmlDictPtr(xmlDictPtr val) {
+ xmlDictFree(val);
+}
+#ifdef LIBXML_OUTPUT_ENABLED
+static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
+ xmlOutputBufferClose(val);
+}
+#endif
+#ifdef LIBXML_READER_ENABLED
+static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
+ xmlFreeTextReader(val);
+}
+#endif
+static void desret_xmlNodePtr(xmlNodePtr val) {
+ if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
+ xmlUnlinkNode(val);
+ xmlFreeNode(val);
+ }
+}
+static void desret_xmlAttrPtr(xmlAttrPtr val) {
+ if (val != NULL) {
+ xmlUnlinkNode((xmlNodePtr) val);
+ xmlFreeNode((xmlNodePtr) val);
+ }
+}
+static void desret_xmlEntityPtr(xmlEntityPtr val) {
+ if (val != NULL) {
+ xmlUnlinkNode((xmlNodePtr) val);
+ xmlFreeNode((xmlNodePtr) val);
+ }
+}
+static void desret_xmlElementPtr(xmlElementPtr val) {
+ if (val != NULL) {
+ xmlUnlinkNode((xmlNodePtr) val);
+ }
+}
+static void desret_xmlAttributePtr(xmlAttributePtr val) {
+ if (val != NULL) {
+ xmlUnlinkNode((xmlNodePtr) val);
+ }
+}
+static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlDtdPtr(xmlDtdPtr val) {
+ desret_xmlNodePtr((xmlNodePtr)val);
+}
+#ifdef LIBXML_XPATH_ENABLED
+static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
+ xmlXPathFreeObject(val);
+}
+static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
+ xmlXPathFreeNodeSet(val);
+}
+#endif
+static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
+ xmlFreeParserCtxt(val);
+}
+
+static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
+ xmlFreeParserInputBuffer(val);
+}
+static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
+ xmlFreeInputStream(val);
+}
+#ifdef LIBXML_WRITER_ENABLED
+static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
+ xmlFreeTextWriter(val);
+}
+#endif
+static void desret_xmlBufferPtr(xmlBufferPtr val) {
+ xmlBufferFree(val);
+}
+#ifdef LIBXML_SCHEMAS_ENABLED
+static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
+ xmlSchemaFreeParserCtxt(val);
+}
+static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
+ xmlRelaxNGFreeParserCtxt(val);
+}
+#endif
+#ifdef LIBXML_HTML_ENABLED
+static void desret_const_htmlEntityDesc_ptr(const htmlEntityDescPtr val ATTRIBUTE_UNUSED) {
+}
+#endif
+
+/* cut and pasted from autogenerated to avoid troubles */
+#define gen_nb_const_xmlChar_ptr_ptr 1
+static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_unsigned_char_ptr 1
+static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_const_unsigned_char_ptr 1
+static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#ifdef LIBXML_HTML_ENABLED
+#define gen_nb_const_htmlNodePtr 1
+static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+#ifdef LIBXML_HTML_ENABLED
+#define gen_nb_htmlDocPtr 3
+static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(htmlNewDoc(NULL, NULL));
+ if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
+ return(NULL);
+}
+static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
+ xmlFreeDoc(val);
+}
+static void desret_htmlDocPtr(htmlDocPtr val) {
+ if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
+ xmlFreeDoc(val);
+}
+#define gen_nb_htmlParserCtxtPtr 3
+static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if (no == 0) return(xmlNewParserCtxt());
+ if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
+ return(NULL);
+}
+static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ if (val != NULL)
+ htmlFreeParserCtxt(val);
+}
+static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
+ if (val != NULL)
+ htmlFreeParserCtxt(val);
+}
+#endif
+
+#ifdef LIBXML_XPATH_ENABLED
+#define gen_nb_xmlNodeSetPtr 1
+static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+#define gen_nb_xmlShellCtxtPtr 1
+static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+#endif
+
+#ifdef LIBXML_PATTERN_ENABLED
+#define gen_nb_xmlPatternPtr 1
+static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+/************************************************************************
+ * *
+ * WARNING: end of the manually maintained part of the test code *
+ * do not remove or alter the CUT HERE line *
+ * *
+ ************************************************************************/
+
+/* CUT HERE: everything below that line is generated */
+#ifdef LIBXML_HTML_ENABLED
+#define gen_nb_htmlParserOption 4
+static htmlParserOption gen_htmlParserOption(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(HTML_PARSE_NOBLANKS);
+ if (no == 2) return(HTML_PARSE_NOERROR);
+ if (no == 3) return(HTML_PARSE_NONET);
+ if (no == 4) return(HTML_PARSE_NOWARNING);
+ return(0);
+}
+static void des_htmlParserOption(int no ATTRIBUTE_UNUSED, htmlParserOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_htmlParserOption(htmlParserOption val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_HTML_ENABLED
+#define gen_nb_htmlStatus 4
+static htmlStatus gen_htmlStatus(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(HTML_DEPRECATED);
+ if (no == 2) return(HTML_INVALID);
+ if (no == 3) return(HTML_NA);
+ if (no == 4) return(HTML_REQUIRED);
+ return(0);
+}
+static void des_htmlStatus(int no ATTRIBUTE_UNUSED, htmlStatus val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#define gen_nb_xlinkActuate 3
+static xlinkActuate gen_xlinkActuate(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XLINK_ACTUATE_AUTO);
+ if (no == 2) return(XLINK_ACTUATE_NONE);
+ if (no == 3) return(XLINK_ACTUATE_ONREQUEST);
+ return(0);
+}
+static void des_xlinkActuate(int no ATTRIBUTE_UNUSED, xlinkActuate val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xlinkActuate(xlinkActuate val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xlinkShow 4
+static xlinkShow gen_xlinkShow(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XLINK_SHOW_EMBED);
+ if (no == 2) return(XLINK_SHOW_NEW);
+ if (no == 3) return(XLINK_SHOW_NONE);
+ if (no == 4) return(XLINK_SHOW_REPLACE);
+ return(0);
+}
+static void des_xlinkShow(int no ATTRIBUTE_UNUSED, xlinkShow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xlinkShow(xlinkShow val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xlinkType 4
+static xlinkType gen_xlinkType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XLINK_TYPE_EXTENDED);
+ if (no == 2) return(XLINK_TYPE_EXTENDED_SET);
+ if (no == 3) return(XLINK_TYPE_NONE);
+ if (no == 4) return(XLINK_TYPE_SIMPLE);
+ return(0);
+}
+static void des_xlinkType(int no ATTRIBUTE_UNUSED, xlinkType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xlinkType(xlinkType val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlAttributeDefault 4
+static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ATTRIBUTE_FIXED);
+ if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
+ if (no == 3) return(XML_ATTRIBUTE_NONE);
+ if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
+ return(0);
+}
+static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlAttributeDefault(xmlAttributeDefault val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlAttributeType 4
+static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ATTRIBUTE_CDATA);
+ if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
+ if (no == 3) return(XML_ATTRIBUTE_ENTITY);
+ if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
+ return(0);
+}
+static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlAttributeType(xmlAttributeType val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlBufferAllocationScheme 3
+static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
+ if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
+ if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
+ return(0);
+}
+static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
+}
+
+#ifdef LIBXML_CATALOG_ENABLED
+#define gen_nb_xmlCatalogAllow 4
+static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_CATA_ALLOW_ALL);
+ if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
+ if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
+ if (no == 4) return(XML_CATA_ALLOW_NONE);
+ return(0);
+}
+static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_CATALOG_ENABLED
+#define gen_nb_xmlCatalogPrefer 3
+static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_CATA_PREFER_NONE);
+ if (no == 2) return(XML_CATA_PREFER_PUBLIC);
+ if (no == 3) return(XML_CATA_PREFER_SYSTEM);
+ return(0);
+}
+static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#define gen_nb_xmlElementContentOccur 4
+static xmlElementContentOccur gen_xmlElementContentOccur(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ELEMENT_CONTENT_MULT);
+ if (no == 2) return(XML_ELEMENT_CONTENT_ONCE);
+ if (no == 3) return(XML_ELEMENT_CONTENT_OPT);
+ if (no == 4) return(XML_ELEMENT_CONTENT_PLUS);
+ return(0);
+}
+static void des_xmlElementContentOccur(int no ATTRIBUTE_UNUSED, xmlElementContentOccur val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlElementContentOccur(xmlElementContentOccur val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlElementContentType 4
+static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
+ if (no == 2) return(XML_ELEMENT_CONTENT_OR);
+ if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
+ if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
+ return(0);
+}
+static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlElementContentType(xmlElementContentType val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlElementType 4
+static xmlElementType gen_xmlElementType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ATTRIBUTE_DECL);
+ if (no == 2) return(XML_ATTRIBUTE_NODE);
+ if (no == 3) return(XML_CDATA_SECTION_NODE);
+ if (no == 4) return(XML_COMMENT_NODE);
+ return(0);
+}
+static void des_xmlElementType(int no ATTRIBUTE_UNUSED, xmlElementType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlElementType(xmlElementType val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlElementTypeVal 4
+static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ELEMENT_TYPE_ANY);
+ if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
+ if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
+ if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
+ return(0);
+}
+static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlElementTypeVal(xmlElementTypeVal val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlEntityType 4
+static xmlEntityType gen_xmlEntityType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_EXTERNAL_GENERAL_PARSED_ENTITY);
+ if (no == 2) return(XML_EXTERNAL_GENERAL_UNPARSED_ENTITY);
+ if (no == 3) return(XML_EXTERNAL_PARAMETER_ENTITY);
+ if (no == 4) return(XML_INTERNAL_GENERAL_ENTITY);
+ return(0);
+}
+static void des_xmlEntityType(int no ATTRIBUTE_UNUSED, xmlEntityType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlEntityType(xmlEntityType val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlErrorDomain 4
+static xmlErrorDomain gen_xmlErrorDomain(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_FROM_C14N);
+ if (no == 2) return(XML_FROM_CATALOG);
+ if (no == 3) return(XML_FROM_CHECK);
+ if (no == 4) return(XML_FROM_DATATYPE);
+ return(0);
+}
+static void des_xmlErrorDomain(int no ATTRIBUTE_UNUSED, xmlErrorDomain val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlErrorDomain(xmlErrorDomain val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlErrorLevel 4
+static xmlErrorLevel gen_xmlErrorLevel(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_ERR_ERROR);
+ if (no == 2) return(XML_ERR_FATAL);
+ if (no == 3) return(XML_ERR_NONE);
+ if (no == 4) return(XML_ERR_WARNING);
+ return(0);
+}
+static void des_xmlErrorLevel(int no ATTRIBUTE_UNUSED, xmlErrorLevel val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlErrorLevel(xmlErrorLevel val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlParserErrors 4
+static xmlParserErrors gen_xmlParserErrors(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_C14N_CREATE_CTXT);
+ if (no == 2) return(XML_C14N_CREATE_STACK);
+ if (no == 3) return(XML_C14N_INVALID_NODE);
+ if (no == 4) return(XML_C14N_REQUIRES_UTF8);
+ return(0);
+}
+static void des_xmlParserErrors(int no ATTRIBUTE_UNUSED, xmlParserErrors val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlParserInputState 4
+static xmlParserInputState gen_xmlParserInputState(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_PARSER_ATTRIBUTE_VALUE);
+ if (no == 2) return(XML_PARSER_CDATA_SECTION);
+ if (no == 3) return(XML_PARSER_COMMENT);
+ if (no == 4) return(XML_PARSER_CONTENT);
+ return(0);
+}
+static void des_xmlParserInputState(int no ATTRIBUTE_UNUSED, xmlParserInputState val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserInputState(xmlParserInputState val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlParserMode 4
+static xmlParserMode gen_xmlParserMode(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_PARSE_DOM);
+ if (no == 2) return(XML_PARSE_PUSH_DOM);
+ if (no == 3) return(XML_PARSE_PUSH_SAX);
+ if (no == 4) return(XML_PARSE_READER);
+ return(0);
+}
+static void des_xmlParserMode(int no ATTRIBUTE_UNUSED, xmlParserMode val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserMode(xmlParserMode val ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlParserOption 4
+static xmlParserOption gen_xmlParserOption(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_PARSE_DTDATTR);
+ if (no == 2) return(XML_PARSE_DTDLOAD);
+ if (no == 3) return(XML_PARSE_DTDVALID);
+ if (no == 4) return(XML_PARSE_NOBLANKS);
+ return(0);
+}
+static void des_xmlParserOption(int no ATTRIBUTE_UNUSED, xmlParserOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserOption(xmlParserOption val ATTRIBUTE_UNUSED) {
+}
+
+#ifdef LIBXML_READER_ENABLED
+#define gen_nb_xmlParserProperties 4
+static xmlParserProperties gen_xmlParserProperties(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_PARSER_DEFAULTATTRS);
+ if (no == 2) return(XML_PARSER_LOADDTD);
+ if (no == 3) return(XML_PARSER_SUBST_ENTITIES);
+ if (no == 4) return(XML_PARSER_VALIDATE);
+ return(0);
+}
+static void des_xmlParserProperties(int no ATTRIBUTE_UNUSED, xmlParserProperties val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserProperties(xmlParserProperties val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_READER_ENABLED
+#define gen_nb_xmlParserSeverities 4
+static xmlParserSeverities gen_xmlParserSeverities(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_PARSER_SEVERITY_ERROR);
+ if (no == 2) return(XML_PARSER_SEVERITY_VALIDITY_ERROR);
+ if (no == 3) return(XML_PARSER_SEVERITY_VALIDITY_WARNING);
+ if (no == 4) return(XML_PARSER_SEVERITY_WARNING);
+ return(0);
+}
+static void des_xmlParserSeverities(int no ATTRIBUTE_UNUSED, xmlParserSeverities val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlParserSeverities(xmlParserSeverities val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_READER_ENABLED
+#define gen_nb_xmlReaderTypes 4
+static xmlReaderTypes gen_xmlReaderTypes(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_READER_TYPE_ATTRIBUTE);
+ if (no == 2) return(XML_READER_TYPE_CDATA);
+ if (no == 3) return(XML_READER_TYPE_COMMENT);
+ if (no == 4) return(XML_READER_TYPE_DOCUMENT);
+ return(0);
+}
+static void des_xmlReaderTypes(int no ATTRIBUTE_UNUSED, xmlReaderTypes val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlReaderTypes(xmlReaderTypes val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlRelaxNGParserFlag 3
+static xmlRelaxNGParserFlag gen_xmlRelaxNGParserFlag(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_RELAXNGP_CRNG);
+ if (no == 2) return(XML_RELAXNGP_FREE_DOC);
+ if (no == 3) return(XML_RELAXNGP_NONE);
+ return(0);
+}
+static void des_xmlRelaxNGParserFlag(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserFlag val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlRelaxNGParserFlag(xmlRelaxNGParserFlag val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlRelaxNGValidErr 4
+static xmlRelaxNGValidErr gen_xmlRelaxNGValidErr(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_RELAXNG_ERR_ATTREXTRANS);
+ if (no == 2) return(XML_RELAXNG_ERR_ATTRNAME);
+ if (no == 3) return(XML_RELAXNG_ERR_ATTRNONS);
+ if (no == 4) return(XML_RELAXNG_ERR_ATTRVALID);
+ return(0);
+}
+static void des_xmlRelaxNGValidErr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidErr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlRelaxNGValidErr(xmlRelaxNGValidErr val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlSchemaContentType 4
+static xmlSchemaContentType gen_xmlSchemaContentType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_SCHEMA_CONTENT_ANY);
+ if (no == 2) return(XML_SCHEMA_CONTENT_BASIC);
+ if (no == 3) return(XML_SCHEMA_CONTENT_ELEMENTS);
+ if (no == 4) return(XML_SCHEMA_CONTENT_EMPTY);
+ return(0);
+}
+static void des_xmlSchemaContentType(int no ATTRIBUTE_UNUSED, xmlSchemaContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlSchemaContentType(xmlSchemaContentType val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlSchemaTypeType 4
+static xmlSchemaTypeType gen_xmlSchemaTypeType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_SCHEMA_FACET_ENUMERATION);
+ if (no == 2) return(XML_SCHEMA_FACET_FRACTIONDIGITS);
+ if (no == 3) return(XML_SCHEMA_FACET_LENGTH);
+ if (no == 4) return(XML_SCHEMA_FACET_MAXEXCLUSIVE);
+ return(0);
+}
+static void des_xmlSchemaTypeType(int no ATTRIBUTE_UNUSED, xmlSchemaTypeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlSchemaTypeType(xmlSchemaTypeType val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlSchemaValType 4
+static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
+ if (no == 2) return(XML_SCHEMAS_ANYTYPE);
+ if (no == 3) return(XML_SCHEMAS_ANYURI);
+ if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
+ return(0);
+}
+static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlSchemaValidError 4
+static xmlSchemaValidError gen_xmlSchemaValidError(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_SCHEMAS_ERR_);
+ if (no == 2) return(XML_SCHEMAS_ERR_ATTRINVALID);
+ if (no == 3) return(XML_SCHEMAS_ERR_ATTRUNKNOWN);
+ if (no == 4) return(XML_SCHEMAS_ERR_CONSTRUCT);
+ return(0);
+}
+static void des_xmlSchemaValidError(int no ATTRIBUTE_UNUSED, xmlSchemaValidError val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlSchemaValidError(xmlSchemaValidError val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+#define gen_nb_xmlSchemaValidOption 1
+static xmlSchemaValidOption gen_xmlSchemaValidOption(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_SCHEMA_VAL_VC_I_CREATE);
+ return(0);
+}
+static void des_xmlSchemaValidOption(int no ATTRIBUTE_UNUSED, xmlSchemaValidOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlSchemaValidOption(xmlSchemaValidOption val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_READER_ENABLED
+#define gen_nb_xmlTextReaderMode 4
+static xmlTextReaderMode gen_xmlTextReaderMode(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XML_TEXTREADER_MODE_CLOSED);
+ if (no == 2) return(XML_TEXTREADER_MODE_EOF);
+ if (no == 3) return(XML_TEXTREADER_MODE_ERROR);
+ if (no == 4) return(XML_TEXTREADER_MODE_INITIAL);
+ return(0);
+}
+static void des_xmlTextReaderMode(int no ATTRIBUTE_UNUSED, xmlTextReaderMode val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlTextReaderMode(xmlTextReaderMode val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_XPATH_ENABLED
+#define gen_nb_xmlXPathError 4
+static xmlXPathError gen_xmlXPathError(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XPATH_ENCODING_ERROR);
+ if (no == 2) return(XPATH_EXPRESSION_OK);
+ if (no == 3) return(XPATH_EXPR_ERROR);
+ if (no == 4) return(XPATH_INVALID_ARITY);
+ return(0);
+}
+static void des_xmlXPathError(int no ATTRIBUTE_UNUSED, xmlXPathError val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlXPathError(xmlXPathError val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#ifdef LIBXML_XPATH_ENABLED
+#define gen_nb_xmlXPathObjectType 4
+static xmlXPathObjectType gen_xmlXPathObjectType(int no, int nr ATTRIBUTE_UNUSED) {
+ if (no == 1) return(XPATH_BOOLEAN);
+ if (no == 2) return(XPATH_LOCATIONSET);
+ if (no == 3) return(XPATH_NODESET);
+ if (no == 4) return(XPATH_NUMBER);
+ return(0);
+}
+static void des_xmlXPathObjectType(int no ATTRIBUTE_UNUSED, xmlXPathObjectType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+static void desret_xmlXPathObjectType(xmlXPathObjectType val ATTRIBUTE_UNUSED) {
+}
+
+#endif
+
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+#include <libxml/SAX2.h>
+#include <libxml/c14n.h>
+#include <libxml/catalog.h>
+#include <libxml/chvalid.h>
+#include <libxml/debugXML.h>
+#include <libxml/dict.h>
+#include <libxml/encoding.h>
+#include <libxml/entities.h>
+#include <libxml/hash.h>
+#include <libxml/list.h>
+#include <libxml/nanoftp.h>
+#include <libxml/nanohttp.h>
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/pattern.h>
+#include <libxml/relaxng.h>
+#include <libxml/schemasInternals.h>
+#include <libxml/tree.h>
+#include <libxml/uri.h>
+#include <libxml/valid.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlIO.h>
+#include <libxml/xmlautomata.h>
+#include <libxml/xmlerror.h>
+#include <libxml/xmlreader.h>
+#include <libxml/xmlregexp.h>
+#include <libxml/xmlsave.h>
+#include <libxml/xmlschemas.h>
+#include <libxml/xmlschemastypes.h>
+#include <libxml/xmlstring.h>
+#include <libxml/xmlunicode.h>
+#include <libxml/xmlwriter.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+#include <libxml/xpointer.h>
+static int test_HTMLparser(void);
+static int test_HTMLtree(void);
+static int test_SAX2(void);
+static int test_c14n(void);
+static int test_catalog(void);
+static int test_chvalid(void);
+static int test_debugXML(void);
+static int test_dict(void);
+static int test_encoding(void);
+static int test_entities(void);
+static int test_hash(void);
+static int test_list(void);
+static int test_nanoftp(void);
+static int test_nanohttp(void);
+static int test_parser(void);
+static int test_parserInternals(void);
+static int test_pattern(void);
+static int test_relaxng(void);
+static int test_schemasInternals(void);
+static int test_tree(void);
+static int test_uri(void);
+static int test_valid(void);
+static int test_xinclude(void);
+static int test_xmlIO(void);
+static int test_xmlautomata(void);
+static int test_xmlerror(void);
+static int test_xmlreader(void);
+static int test_xmlregexp(void);
+static int test_xmlsave(void);
+static int test_xmlschemas(void);
+static int test_xmlschemastypes(void);
+static int test_xmlstring(void);
+static int test_xmlunicode(void);
+static int test_xmlwriter(void);
+static int test_xpath(void);
+static int test_xpathInternals(void);
+static int test_xpointer(void);
+
+/**
+ * testlibxml2:
+ *
+ * Main entry point of the tester for the full libxml2 module,
+ * it calls all the tester entry point for each module.
+ *
+ * Returns the number of error found
+ */
+static int
+testlibxml2(void)
+{
+ int test_ret = 0;
+
+ test_ret += test_HTMLparser();
+ test_ret += test_HTMLtree();
+ test_ret += test_SAX2();
+ test_ret += test_c14n();
+ test_ret += test_catalog();
+ test_ret += test_chvalid();
+ test_ret += test_debugXML();
+ test_ret += test_dict();
+ test_ret += test_encoding();
+ test_ret += test_entities();
+ test_ret += test_hash();
+ test_ret += test_list();
+ test_ret += test_nanoftp();
+ test_ret += test_nanohttp();
+ test_ret += test_parser();
+ test_ret += test_parserInternals();
+ test_ret += test_pattern();
+ test_ret += test_relaxng();
+ test_ret += test_schemasInternals();
+ test_ret += test_tree();
+ test_ret += test_uri();
+ test_ret += test_valid();
+ test_ret += test_xinclude();
+ test_ret += test_xmlIO();
+ test_ret += test_xmlautomata();
+ test_ret += test_xmlerror();
+ test_ret += test_xmlreader();
+ test_ret += test_xmlregexp();
+ test_ret += test_xmlsave();
+ test_ret += test_xmlschemas();
+ test_ret += test_xmlschemastypes();
+ test_ret += test_xmlstring();
+ test_ret += test_xmlunicode();
+ test_ret += test_xmlwriter();
+ test_ret += test_xpath();
+ test_ret += test_xpathInternals();
+ test_ret += test_xpointer();
+
+ printf("Total: %d functions, %d tests, %d errors\n",
+ function_tests, call_tests, test_ret);
+ return(test_ret);
+}
+
+
+static int
+test_UTF8ToHtml(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ unsigned char * out; /* a pointer to an array of bytes to store the result */
+ int n_out;
+ int * outlen; /* the length of @out */
+ int n_outlen;
+ unsigned char * in; /* a pointer to an array of UTF-8 chars */
+ int n_in;
+ int * inlen; /* the length of @in */
+ int n_inlen;
+
+ for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
+ for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
+ for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
+ for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
+ mem_base = xmlMemBlocks();
+ out = gen_unsigned_char_ptr(n_out, 0);
+ outlen = gen_int_ptr(n_outlen, 1);
+ in = gen_const_unsigned_char_ptr(n_in, 2);
+ inlen = gen_int_ptr(n_inlen, 3);
+
+ ret_val = UTF8ToHtml(out, outlen, in, inlen);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_char_ptr(n_out, out, 0);
+ des_int_ptr(n_outlen, outlen, 1);
+ des_const_unsigned_char_ptr(n_in, in, 2);
+ des_int_ptr(n_inlen, inlen, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in UTF8ToHtml",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_outlen);
+ printf(" %d", n_in);
+ printf(" %d", n_inlen);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+#ifdef LIBXML_HTML_ENABLED
+
+#define gen_nb_const_htmlElemDesc_ptr 1
+static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+
+static int
+test_htmlAttrAllowed(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlStatus ret_val;
+ htmlElemDesc * elt; /* HTML element */
+ int n_elt;
+ xmlChar * attr; /* HTML attribute */
+ int n_attr;
+ int legacy; /* whether to allow deprecated attributes */
+ int n_legacy;
+
+ for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
+ for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
+ for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
+ mem_base = xmlMemBlocks();
+ elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
+ attr = gen_const_xmlChar_ptr(n_attr, 1);
+ legacy = gen_int(n_legacy, 2);
+
+ ret_val = htmlAttrAllowed(elt, attr, legacy);
+ desret_htmlStatus(ret_val);
+ call_tests++;
+ des_const_htmlElemDesc_ptr(n_elt, elt, 0);
+ des_const_xmlChar_ptr(n_attr, attr, 1);
+ des_int(n_legacy, legacy, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlAttrAllowed",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_elt);
+ printf(" %d", n_attr);
+ printf(" %d", n_legacy);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+#ifdef LIBXML_HTML_ENABLED
+
+#define gen_nb_htmlNodePtr 1
+static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+
+static int
+test_htmlAutoCloseTag(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlDocPtr doc; /* the HTML document */
+ int n_doc;
+ xmlChar * name; /* The tag name */
+ int n_name;
+ htmlNodePtr elem; /* the HTML element */
+ int n_elem;
+
+ for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_htmlDocPtr(n_doc, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ elem = gen_htmlNodePtr(n_elem, 2);
+
+ ret_val = htmlAutoCloseTag(doc, name, elem);
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlDocPtr(n_doc, doc, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_htmlNodePtr(n_elem, elem, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlAutoCloseTag",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_name);
+ printf(" %d", n_elem);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCreateMemoryParserCtxt(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlParserCtxtPtr ret_val;
+ char * buffer; /* a pointer to a char array */
+ int n_buffer;
+ int size; /* the size of the array */
+ int n_size;
+
+ for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
+ for (n_size = 0;n_size < gen_nb_int;n_size++) {
+ mem_base = xmlMemBlocks();
+ buffer = gen_const_char_ptr(n_buffer, 0);
+ size = gen_int(n_size, 1);
+
+ ret_val = htmlCreateMemoryParserCtxt(buffer, size);
+ desret_htmlParserCtxtPtr(ret_val);
+ call_tests++;
+ des_const_char_ptr(n_buffer, buffer, 0);
+ des_int(n_size, size, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buffer);
+ printf(" %d", n_size);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+#ifdef LIBXML_HTML_ENABLED
+
+#define gen_nb_htmlSAXHandlerPtr 1
+static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+
+static int
+test_htmlCreatePushParserCtxt(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_PUSH_ENABLED
+ int mem_base;
+ htmlParserCtxtPtr ret_val;
+ htmlSAXHandlerPtr sax; /* a SAX handler */
+ int n_sax;
+ void * user_data; /* The user data returned on SAX callbacks */
+ int n_user_data;
+ char * chunk; /* a pointer to an array of chars */
+ int n_chunk;
+ int size; /* number of chars in the array */
+ int n_size;
+ const char * filename; /* an optional file name or URI */
+ int n_filename;
+ xmlCharEncoding enc; /* an optional encoding */
+ int n_enc;
+
+ for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
+ for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
+ for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
+ for (n_size = 0;n_size < gen_nb_int;n_size++) {
+ for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
+ for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
+ mem_base = xmlMemBlocks();
+ sax = gen_htmlSAXHandlerPtr(n_sax, 0);
+ user_data = gen_userdata(n_user_data, 1);
+ chunk = gen_const_char_ptr(n_chunk, 2);
+ size = gen_int(n_size, 3);
+ filename = gen_fileoutput(n_filename, 4);
+ enc = gen_xmlCharEncoding(n_enc, 5);
+
+ ret_val = htmlCreatePushParserCtxt(sax, user_data, chunk, size, filename, enc);
+ desret_htmlParserCtxtPtr(ret_val);
+ call_tests++;
+ des_htmlSAXHandlerPtr(n_sax, sax, 0);
+ des_userdata(n_user_data, user_data, 1);
+ des_const_char_ptr(n_chunk, chunk, 2);
+ des_int(n_size, size, 3);
+ des_fileoutput(n_filename, filename, 4);
+ des_xmlCharEncoding(n_enc, enc, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_sax);
+ printf(" %d", n_user_data);
+ printf(" %d", n_chunk);
+ printf(" %d", n_size);
+ printf(" %d", n_filename);
+ printf(" %d", n_enc);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCtxtReadDoc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ xmlChar * cur; /* a pointer to a zero terminated string */
+ int n_cur;
+ const char * URL; /* the base URL to use for the document */
+ int n_URL;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
+ for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ cur = gen_const_xmlChar_ptr(n_cur, 1);
+ URL = gen_filepath(n_URL, 2);
+ encoding = gen_const_char_ptr(n_encoding, 3);
+ options = gen_int(n_options, 4);
+
+ ret_val = htmlCtxtReadDoc(ctxt, cur, URL, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_const_xmlChar_ptr(n_cur, cur, 1);
+ des_filepath(n_URL, URL, 2);
+ des_const_char_ptr(n_encoding, encoding, 3);
+ des_int(n_options, options, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCtxtReadDoc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_cur);
+ printf(" %d", n_URL);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCtxtReadFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ const char * filename; /* a file or URL */
+ int n_filename;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ filename = gen_filepath(n_filename, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+ options = gen_int(n_options, 3);
+
+ ret_val = htmlCtxtReadFile(ctxt, filename, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_filepath(n_filename, filename, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ des_int(n_options, options, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCtxtReadFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_filename);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCtxtReadMemory(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ char * buffer; /* a pointer to a char array */
+ int n_buffer;
+ int size; /* the size of the array */
+ int n_size;
+ const char * URL; /* the base URL to use for the document */
+ int n_URL;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
+ for (n_size = 0;n_size < gen_nb_int;n_size++) {
+ for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ buffer = gen_const_char_ptr(n_buffer, 1);
+ size = gen_int(n_size, 2);
+ URL = gen_filepath(n_URL, 3);
+ encoding = gen_const_char_ptr(n_encoding, 4);
+ options = gen_int(n_options, 5);
+
+ ret_val = htmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_const_char_ptr(n_buffer, buffer, 1);
+ des_int(n_size, size, 2);
+ des_filepath(n_URL, URL, 3);
+ des_const_char_ptr(n_encoding, encoding, 4);
+ des_int(n_options, options, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCtxtReadMemory",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_buffer);
+ printf(" %d", n_size);
+ printf(" %d", n_URL);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCtxtReset(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+
+ htmlCtxtReset(ctxt);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCtxtReset",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlCtxtUseOptions(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ options = gen_int(n_options, 1);
+
+ ret_val = htmlCtxtUseOptions(ctxt, options);
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_int(n_options, options, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlCtxtUseOptions",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlElementAllowedHere(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlElemDesc * parent; /* HTML parent element */
+ int n_parent;
+ xmlChar * elt; /* HTML element */
+ int n_elt;
+
+ for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
+ for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
+ mem_base = xmlMemBlocks();
+ parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
+ elt = gen_const_xmlChar_ptr(n_elt, 1);
+
+ ret_val = htmlElementAllowedHere(parent, elt);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_htmlElemDesc_ptr(n_parent, parent, 0);
+ des_const_xmlChar_ptr(n_elt, elt, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlElementAllowedHere",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_parent);
+ printf(" %d", n_elt);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlElementStatusHere(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlStatus ret_val;
+ htmlElemDesc * parent; /* HTML parent element */
+ int n_parent;
+ htmlElemDesc * elt; /* HTML element */
+ int n_elt;
+
+ for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
+ for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
+ mem_base = xmlMemBlocks();
+ parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
+ elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
+
+ ret_val = htmlElementStatusHere(parent, elt);
+ desret_htmlStatus(ret_val);
+ call_tests++;
+ des_const_htmlElemDesc_ptr(n_parent, parent, 0);
+ des_const_htmlElemDesc_ptr(n_elt, elt, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlElementStatusHere",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_parent);
+ printf(" %d", n_elt);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlEncodeEntities(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ unsigned char * out; /* a pointer to an array of bytes to store the result */
+ int n_out;
+ int * outlen; /* the length of @out */
+ int n_outlen;
+ unsigned char * in; /* a pointer to an array of UTF-8 chars */
+ int n_in;
+ int * inlen; /* the length of @in */
+ int n_inlen;
+ int quoteChar; /* the quote character to escape (' or ") or zero. */
+ int n_quoteChar;
+
+ for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
+ for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
+ for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
+ for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
+ for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
+ mem_base = xmlMemBlocks();
+ out = gen_unsigned_char_ptr(n_out, 0);
+ outlen = gen_int_ptr(n_outlen, 1);
+ in = gen_const_unsigned_char_ptr(n_in, 2);
+ inlen = gen_int_ptr(n_inlen, 3);
+ quoteChar = gen_int(n_quoteChar, 4);
+
+ ret_val = htmlEncodeEntities(out, outlen, in, inlen, quoteChar);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_char_ptr(n_out, out, 0);
+ des_int_ptr(n_outlen, outlen, 1);
+ des_const_unsigned_char_ptr(n_in, in, 2);
+ des_int_ptr(n_inlen, inlen, 3);
+ des_int(n_quoteChar, quoteChar, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlEncodeEntities",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_outlen);
+ printf(" %d", n_in);
+ printf(" %d", n_inlen);
+ printf(" %d", n_quoteChar);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlEntityLookup(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ const htmlEntityDesc * ret_val;
+ xmlChar * name; /* the entity name */
+ int n_name;
+
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ name = gen_const_xmlChar_ptr(n_name, 0);
+
+ ret_val = htmlEntityLookup(name);
+ desret_const_htmlEntityDesc_ptr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_name, name, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlEntityLookup",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlEntityValueLookup(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ const htmlEntityDesc * ret_val;
+ unsigned int value; /* the entity's unicode value */
+ int n_value;
+
+ for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
+ mem_base = xmlMemBlocks();
+ value = gen_unsigned_int(n_value, 0);
+
+ ret_val = htmlEntityValueLookup(value);
+ desret_const_htmlEntityDesc_ptr(ret_val);
+ call_tests++;
+ des_unsigned_int(n_value, value, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlEntityValueLookup",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_value);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlHandleOmittedElem(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ int val; /* int 0 or 1 */
+ int n_val;
+
+ for (n_val = 0;n_val < gen_nb_int;n_val++) {
+ mem_base = xmlMemBlocks();
+ val = gen_int(n_val, 0);
+
+ ret_val = htmlHandleOmittedElem(val);
+ desret_int(ret_val);
+ call_tests++;
+ des_int(n_val, val, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlHandleOmittedElem",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_val);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlIsAutoClosed(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlDocPtr doc; /* the HTML document */
+ int n_doc;
+ htmlNodePtr elem; /* the HTML element */
+ int n_elem;
+
+ for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
+ for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_htmlDocPtr(n_doc, 0);
+ elem = gen_htmlNodePtr(n_elem, 1);
+
+ ret_val = htmlIsAutoClosed(doc, elem);
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlDocPtr(n_doc, doc, 0);
+ des_htmlNodePtr(n_elem, elem, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlIsAutoClosed",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_elem);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlIsScriptAttribute(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlChar * name; /* an attribute name */
+ int n_name;
+
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ name = gen_const_xmlChar_ptr(n_name, 0);
+
+ ret_val = htmlIsScriptAttribute(name);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_name, name, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlIsScriptAttribute",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeStatus(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlStatus ret_val;
+ htmlNodePtr node; /* an htmlNodePtr in a tree */
+ int n_node;
+ int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
+ int n_legacy;
+
+ for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
+ for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
+ mem_base = xmlMemBlocks();
+ node = gen_const_htmlNodePtr(n_node, 0);
+ legacy = gen_int(n_legacy, 1);
+
+ ret_val = htmlNodeStatus(node, legacy);
+ desret_htmlStatus(ret_val);
+ call_tests++;
+ des_const_htmlNodePtr(n_node, node, 0);
+ des_int(n_legacy, legacy, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeStatus",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_node);
+ printf(" %d", n_legacy);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseCharRef(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+
+ ret_val = htmlParseCharRef(ctxt);
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseCharRef",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseChunk(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_PUSH_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ char * chunk; /* an char array */
+ int n_chunk;
+ int size; /* the size in byte of the chunk */
+ int n_size;
+ int terminate; /* last chunk indicator */
+ int n_terminate;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
+ for (n_size = 0;n_size < gen_nb_int;n_size++) {
+ for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ chunk = gen_const_char_ptr(n_chunk, 1);
+ size = gen_int(n_size, 2);
+ terminate = gen_int(n_terminate, 3);
+
+ ret_val = htmlParseChunk(ctxt, chunk, size, terminate);
+ if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_const_char_ptr(n_chunk, chunk, 1);
+ des_int(n_size, size, 2);
+ des_int(n_terminate, terminate, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseChunk",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_chunk);
+ printf(" %d", n_size);
+ printf(" %d", n_terminate);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseDoc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ xmlChar * cur; /* a pointer to an array of xmlChar */
+ int n_cur;
+ char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
+ int n_encoding;
+
+ for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ mem_base = xmlMemBlocks();
+ cur = gen_xmlChar_ptr(n_cur, 0);
+ encoding = gen_const_char_ptr(n_encoding, 1);
+
+ ret_val = htmlParseDoc(cur, encoding);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_xmlChar_ptr(n_cur, cur, 0);
+ des_const_char_ptr(n_encoding, encoding, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseDoc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseDocument(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+
+ ret_val = htmlParseDocument(ctxt);
+ if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseDocument",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseElement(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+
+ htmlParseElement(ctxt);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseElement",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseEntityRef(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ const htmlEntityDesc * ret_val;
+ htmlParserCtxtPtr ctxt; /* an HTML parser context */
+ int n_ctxt;
+ xmlChar ** str; /* location to store the entity name */
+ int n_str;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
+ for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
+ str = gen_const_xmlChar_ptr_ptr(n_str, 1);
+
+ ret_val = htmlParseEntityRef(ctxt, str);
+ desret_const_htmlEntityDesc_ptr(ret_val);
+ call_tests++;
+ des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
+ des_const_xmlChar_ptr_ptr(n_str, str, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlParseEntityRef",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_str);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlParseFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ htmlDocPtr ret_val;
+ const char * filename; /* the filename */
+ int n_filename;
+ char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
+ int n_encoding;
+
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ filename = gen_filepath(n_filename, 0);
+ encoding = gen_const_char_ptr(n_encoding, 1);
+
+ ret_val = htmlParseFile(filename, encoding);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_filepath(n_filename, filename, 0);
+ des_const_char_ptr(n_encoding, encoding, 1);
+ xmlResetLastError();
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlReadDoc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ xmlChar * cur; /* a pointer to a zero terminated string */
+ int n_cur;
+ const char * URL; /* the base URL to use for the document */
+ int n_URL;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
+ for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ cur = gen_const_xmlChar_ptr(n_cur, 0);
+ URL = gen_filepath(n_URL, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+ options = gen_int(n_options, 3);
+
+ ret_val = htmlReadDoc(cur, URL, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_cur, cur, 0);
+ des_filepath(n_URL, URL, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ des_int(n_options, options, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlReadDoc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_cur);
+ printf(" %d", n_URL);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlReadFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ const char * filename; /* a file or URL */
+ int n_filename;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_filepath(n_filename, 0);
+ encoding = gen_const_char_ptr(n_encoding, 1);
+ options = gen_int(n_options, 2);
+
+ ret_val = htmlReadFile(filename, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_filepath(n_filename, filename, 0);
+ des_const_char_ptr(n_encoding, encoding, 1);
+ des_int(n_options, options, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlReadFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlReadMemory(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ char * buffer; /* a pointer to a char array */
+ int n_buffer;
+ int size; /* the size of the array */
+ int n_size;
+ const char * URL; /* the base URL to use for the document */
+ int n_URL;
+ char * encoding; /* the document encoding, or NULL */
+ int n_encoding;
+ int options; /* a combination of htmlParserOption(s) */
+ int n_options;
+
+ for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
+ for (n_size = 0;n_size < gen_nb_int;n_size++) {
+ for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_options = 0;n_options < gen_nb_int;n_options++) {
+ mem_base = xmlMemBlocks();
+ buffer = gen_const_char_ptr(n_buffer, 0);
+ size = gen_int(n_size, 1);
+ URL = gen_filepath(n_URL, 2);
+ encoding = gen_const_char_ptr(n_encoding, 3);
+ options = gen_int(n_options, 4);
+
+ ret_val = htmlReadMemory(buffer, size, URL, encoding, options);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_const_char_ptr(n_buffer, buffer, 0);
+ des_int(n_size, size, 1);
+ des_filepath(n_URL, URL, 2);
+ des_const_char_ptr(n_encoding, encoding, 3);
+ des_int(n_options, options, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlReadMemory",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buffer);
+ printf(" %d", n_size);
+ printf(" %d", n_URL);
+ printf(" %d", n_encoding);
+ printf(" %d", n_options);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSAXParseDoc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ xmlChar * cur; /* a pointer to an array of xmlChar */
+ int n_cur;
+ char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
+ int n_encoding;
+ htmlSAXHandlerPtr sax; /* the SAX handler block */
+ int n_sax;
+ void * userData; /* if using SAX, this pointer will be provided on callbacks. */
+ int n_userData;
+
+ for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
+ for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
+ mem_base = xmlMemBlocks();
+ cur = gen_xmlChar_ptr(n_cur, 0);
+ encoding = gen_const_char_ptr(n_encoding, 1);
+ sax = gen_htmlSAXHandlerPtr(n_sax, 2);
+ userData = gen_userdata(n_userData, 3);
+
+ ret_val = htmlSAXParseDoc(cur, encoding, sax, userData);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_xmlChar_ptr(n_cur, cur, 0);
+ des_const_char_ptr(n_encoding, encoding, 1);
+ des_htmlSAXHandlerPtr(n_sax, sax, 2);
+ des_userdata(n_userData, userData, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSAXParseDoc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf(" %d", n_sax);
+ printf(" %d", n_userData);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSAXParseFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ const char * filename; /* the filename */
+ int n_filename;
+ char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
+ int n_encoding;
+ htmlSAXHandlerPtr sax; /* the SAX handler block */
+ int n_sax;
+ void * userData; /* if using SAX, this pointer will be provided on callbacks. */
+ int n_userData;
+
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
+ for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_filepath(n_filename, 0);
+ encoding = gen_const_char_ptr(n_encoding, 1);
+ sax = gen_htmlSAXHandlerPtr(n_sax, 2);
+ userData = gen_userdata(n_userData, 3);
+
+ ret_val = htmlSAXParseFile(filename, encoding, sax, userData);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_filepath(n_filename, filename, 0);
+ des_const_char_ptr(n_encoding, encoding, 1);
+ des_htmlSAXHandlerPtr(n_sax, sax, 2);
+ des_userdata(n_userData, userData, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSAXParseFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf(" %d", n_encoding);
+ printf(" %d", n_sax);
+ printf(" %d", n_userData);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlTagLookup(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+static int
+test_HTMLparser(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
+ test_ret += test_UTF8ToHtml();
+ test_ret += test_htmlAttrAllowed();
+ test_ret += test_htmlAutoCloseTag();
+ test_ret += test_htmlCreateMemoryParserCtxt();
+ test_ret += test_htmlCreatePushParserCtxt();
+ test_ret += test_htmlCtxtReadDoc();
+ test_ret += test_htmlCtxtReadFile();
+ test_ret += test_htmlCtxtReadMemory();
+ test_ret += test_htmlCtxtReset();
+ test_ret += test_htmlCtxtUseOptions();
+ test_ret += test_htmlElementAllowedHere();
+ test_ret += test_htmlElementStatusHere();
+ test_ret += test_htmlEncodeEntities();
+ test_ret += test_htmlEntityLookup();
+ test_ret += test_htmlEntityValueLookup();
+ test_ret += test_htmlHandleOmittedElem();
+ test_ret += test_htmlIsAutoClosed();
+ test_ret += test_htmlIsScriptAttribute();
+ test_ret += test_htmlNodeStatus();
+ test_ret += test_htmlParseCharRef();
+ test_ret += test_htmlParseChunk();
+ test_ret += test_htmlParseDoc();
+ test_ret += test_htmlParseDocument();
+ test_ret += test_htmlParseElement();
+ test_ret += test_htmlParseEntityRef();
+ test_ret += test_htmlParseFile();
+ test_ret += test_htmlReadDoc();
+ test_ret += test_htmlReadFile();
+ test_ret += test_htmlReadMemory();
+ test_ret += test_htmlSAXParseDoc();
+ test_ret += test_htmlSAXParseFile();
+ test_ret += test_htmlTagLookup();
+
+ if (test_ret != 0)
+ printf("Module HTMLparser: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_htmlDocContentDumpFormatOutput(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlOutputBufferPtr buf; /* the HTML buffer output */
+ int n_buf;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+ char * encoding; /* the encoding string */
+ int n_encoding;
+ int format; /* should formatting spaces been added */
+ int n_format;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_format = 0;n_format < gen_nb_int;n_format++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlOutputBufferPtr(n_buf, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+ format = gen_int(n_format, 3);
+
+ htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
+ call_tests++;
+ des_xmlOutputBufferPtr(n_buf, buf, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ des_int(n_format, format, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf(" %d", n_format);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlDocContentDumpOutput(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlOutputBufferPtr buf; /* the HTML buffer output */
+ int n_buf;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+ char * encoding; /* the encoding string */
+ int n_encoding;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlOutputBufferPtr(n_buf, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+
+ htmlDocContentDumpOutput(buf, cur, encoding);
+ call_tests++;
+ des_xmlOutputBufferPtr(n_buf, buf, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlDocContentDumpOutput",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlDocDump(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ FILE * f; /* the FILE* */
+ int n_f;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+
+ for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ mem_base = xmlMemBlocks();
+ f = gen_FILE_ptr(n_f, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+
+ ret_val = htmlDocDump(f, cur);
+ desret_int(ret_val);
+ call_tests++;
+ des_FILE_ptr(n_f, f, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlDocDump",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_f);
+ printf(" %d", n_cur);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlChar_ptr_ptr 1
+static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_htmlDocDumpMemory(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+ xmlChar ** mem; /* OUT: the memory pointer */
+ int n_mem;
+ int * size; /* OUT: the memory length */
+ int n_size;
+
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
+ for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
+ mem_base = xmlMemBlocks();
+ cur = gen_xmlDocPtr(n_cur, 0);
+ mem = gen_xmlChar_ptr_ptr(n_mem, 1);
+ size = gen_int_ptr(n_size, 2);
+
+ htmlDocDumpMemory(cur, mem, size);
+ call_tests++;
+ des_xmlDocPtr(n_cur, cur, 0);
+ des_xmlChar_ptr_ptr(n_mem, mem, 1);
+ des_int_ptr(n_size, size, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlDocDumpMemory",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_cur);
+ printf(" %d", n_mem);
+ printf(" %d", n_size);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlGetMetaEncoding(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ const xmlChar * ret_val;
+ htmlDocPtr doc; /* the document */
+ int n_doc;
+
+ for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_htmlDocPtr(n_doc, 0);
+
+ ret_val = htmlGetMetaEncoding(doc);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_htmlDocPtr(n_doc, doc, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlGetMetaEncoding",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlIsBooleanAttr(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlChar * name; /* the name of the attribute to check */
+ int n_name;
+
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ name = gen_const_xmlChar_ptr(n_name, 0);
+
+ ret_val = htmlIsBooleanAttr(name);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_name, name, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlIsBooleanAttr",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNewDoc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ xmlChar * URI; /* URI for the dtd, or NULL */
+ int n_URI;
+ xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
+ int n_ExternalID;
+
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
+ mem_base = xmlMemBlocks();
+ URI = gen_const_xmlChar_ptr(n_URI, 0);
+ ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
+
+ ret_val = htmlNewDoc(URI, ExternalID);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_URI, URI, 0);
+ des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNewDoc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_URI);
+ printf(" %d", n_ExternalID);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNewDocNoDtD(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ htmlDocPtr ret_val;
+ xmlChar * URI; /* URI for the dtd, or NULL */
+ int n_URI;
+ xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
+ int n_ExternalID;
+
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
+ mem_base = xmlMemBlocks();
+ URI = gen_const_xmlChar_ptr(n_URI, 0);
+ ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
+
+ ret_val = htmlNewDocNoDtD(URI, ExternalID);
+ desret_htmlDocPtr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_URI, URI, 0);
+ des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNewDocNoDtD",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_URI);
+ printf(" %d", n_ExternalID);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeDump(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlBufferPtr buf; /* the HTML buffer output */
+ int n_buf;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlNodePtr cur; /* the current node */
+ int n_cur;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlBufferPtr(n_buf, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+ cur = gen_xmlNodePtr(n_cur, 2);
+
+ ret_val = htmlNodeDump(buf, doc, cur);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlBufferPtr(n_buf, buf, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ des_xmlNodePtr(n_cur, cur, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeDump",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_doc);
+ printf(" %d", n_cur);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeDumpFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ FILE * out; /* the FILE pointer */
+ int n_out;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlNodePtr cur; /* the current node */
+ int n_cur;
+
+ for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ mem_base = xmlMemBlocks();
+ out = gen_FILE_ptr(n_out, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+ cur = gen_xmlNodePtr(n_cur, 2);
+
+ htmlNodeDumpFile(out, doc, cur);
+ call_tests++;
+ des_FILE_ptr(n_out, out, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ des_xmlNodePtr(n_cur, cur, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeDumpFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_doc);
+ printf(" %d", n_cur);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeDumpFileFormat(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ FILE * out; /* the FILE pointer */
+ int n_out;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlNodePtr cur; /* the current node */
+ int n_cur;
+ char * encoding; /* the document encoding */
+ int n_encoding;
+ int format; /* should formatting spaces been added */
+ int n_format;
+
+ for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_format = 0;n_format < gen_nb_int;n_format++) {
+ mem_base = xmlMemBlocks();
+ out = gen_FILE_ptr(n_out, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+ cur = gen_xmlNodePtr(n_cur, 2);
+ encoding = gen_const_char_ptr(n_encoding, 3);
+ format = gen_int(n_format, 4);
+
+ ret_val = htmlNodeDumpFileFormat(out, doc, cur, encoding, format);
+ desret_int(ret_val);
+ call_tests++;
+ des_FILE_ptr(n_out, out, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ des_xmlNodePtr(n_cur, cur, 2);
+ des_const_char_ptr(n_encoding, encoding, 3);
+ des_int(n_format, format, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_doc);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf(" %d", n_format);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeDumpFormatOutput(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlOutputBufferPtr buf; /* the HTML buffer output */
+ int n_buf;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlNodePtr cur; /* the current node */
+ int n_cur;
+ char * encoding; /* the encoding string */
+ int n_encoding;
+ int format; /* should formatting spaces been added */
+ int n_format;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_format = 0;n_format < gen_nb_int;n_format++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlOutputBufferPtr(n_buf, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+ cur = gen_xmlNodePtr(n_cur, 2);
+ encoding = gen_const_char_ptr(n_encoding, 3);
+ format = gen_int(n_format, 4);
+
+ htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
+ call_tests++;
+ des_xmlOutputBufferPtr(n_buf, buf, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ des_xmlNodePtr(n_cur, cur, 2);
+ des_const_char_ptr(n_encoding, encoding, 3);
+ des_int(n_format, format, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_doc);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf(" %d", n_format);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlNodeDumpOutput(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlOutputBufferPtr buf; /* the HTML buffer output */
+ int n_buf;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlNodePtr cur; /* the current node */
+ int n_cur;
+ char * encoding; /* the encoding string */
+ int n_encoding;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlOutputBufferPtr(n_buf, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+ cur = gen_xmlNodePtr(n_cur, 2);
+ encoding = gen_const_char_ptr(n_encoding, 3);
+
+ htmlNodeDumpOutput(buf, doc, cur, encoding);
+ call_tests++;
+ des_xmlOutputBufferPtr(n_buf, buf, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ des_xmlNodePtr(n_cur, cur, 2);
+ des_const_char_ptr(n_encoding, encoding, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlNodeDumpOutput",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_doc);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSaveFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ const char * filename; /* the filename (or URL) */
+ int n_filename;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+
+ for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_fileoutput(n_filename, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+
+ ret_val = htmlSaveFile(filename, cur);
+ desret_int(ret_val);
+ call_tests++;
+ des_fileoutput(n_filename, filename, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSaveFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf(" %d", n_cur);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSaveFileEnc(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ const char * filename; /* the filename */
+ int n_filename;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+ char * encoding; /* the document encoding */
+ int n_encoding;
+
+ for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_fileoutput(n_filename, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+
+ ret_val = htmlSaveFileEnc(filename, cur, encoding);
+ desret_int(ret_val);
+ call_tests++;
+ des_fileoutput(n_filename, filename, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSaveFileEnc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSaveFileFormat(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ const char * filename; /* the filename */
+ int n_filename;
+ xmlDocPtr cur; /* the document */
+ int n_cur;
+ char * encoding; /* the document encoding */
+ int n_encoding;
+ int format; /* should formatting spaces been added */
+ int n_format;
+
+ for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
+ for (n_format = 0;n_format < gen_nb_int;n_format++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_fileoutput(n_filename, 0);
+ cur = gen_xmlDocPtr(n_cur, 1);
+ encoding = gen_const_char_ptr(n_encoding, 2);
+ format = gen_int(n_format, 3);
+
+ ret_val = htmlSaveFileFormat(filename, cur, encoding, format);
+ desret_int(ret_val);
+ call_tests++;
+ des_fileoutput(n_filename, filename, 0);
+ des_xmlDocPtr(n_cur, cur, 1);
+ des_const_char_ptr(n_encoding, encoding, 2);
+ des_int(n_format, format, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSaveFileFormat",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf(" %d", n_cur);
+ printf(" %d", n_encoding);
+ printf(" %d", n_format);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlSetMetaEncoding(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ int ret_val;
+ htmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlChar * encoding; /* the encoding string */
+ int n_encoding;
+
+ for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
+ for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_htmlDocPtr(n_doc, 0);
+ encoding = gen_const_xmlChar_ptr(n_encoding, 1);
+
+ ret_val = htmlSetMetaEncoding(doc, encoding);
+ desret_int(ret_val);
+ call_tests++;
+ des_htmlDocPtr(n_doc, doc, 0);
+ des_const_xmlChar_ptr(n_encoding, encoding, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlSetMetaEncoding",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_encoding);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+static int
+test_HTMLtree(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
+ test_ret += test_htmlDocContentDumpFormatOutput();
+ test_ret += test_htmlDocContentDumpOutput();
+ test_ret += test_htmlDocDump();
+ test_ret += test_htmlDocDumpMemory();
+ test_ret += test_htmlGetMetaEncoding();
+ test_ret += test_htmlIsBooleanAttr();
+ test_ret += test_htmlNewDoc();
+ test_ret += test_htmlNewDocNoDtD();
+ test_ret += test_htmlNodeDump();
+ test_ret += test_htmlNodeDumpFile();
+ test_ret += test_htmlNodeDumpFileFormat();
+ test_ret += test_htmlNodeDumpFormatOutput();
+ test_ret += test_htmlNodeDumpOutput();
+ test_ret += test_htmlSaveFile();
+ test_ret += test_htmlSaveFileEnc();
+ test_ret += test_htmlSaveFileFormat();
+ test_ret += test_htmlSetMetaEncoding();
+
+ if (test_ret != 0)
+ printf("Module HTMLtree: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_docbDefaultSAXHandlerInit(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DOCB_ENABLED
+ int mem_base;
+
+ mem_base = xmlMemBlocks();
+
+ docbDefaultSAXHandlerInit();
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_htmlDefaultSAXHandlerInit(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+
+ mem_base = xmlMemBlocks();
+
+ htmlDefaultSAXHandlerInit();
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDefaultSAXHandlerInit(void) {
+ int test_ret = 0;
+
+ int mem_base;
+
+ mem_base = xmlMemBlocks();
+
+ xmlDefaultSAXHandlerInit();
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlEnumerationPtr 1
+static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlSAX2AttributeDecl(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * elem; /* the name of the element */
+ int n_elem;
+ xmlChar * fullname; /* the attribute name */
+ int n_fullname;
+ int type; /* the attribute type */
+ int n_type;
+ int def; /* the type of default value */
+ int n_def;
+ xmlChar * defaultValue; /* the attribute default value */
+ int n_defaultValue;
+ xmlEnumerationPtr tree; /* the tree of enumerated value set */
+ int n_tree;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
+ for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
+ for (n_type = 0;n_type < gen_nb_int;n_type++) {
+ for (n_def = 0;n_def < gen_nb_int;n_def++) {
+ for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
+ for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ elem = gen_const_xmlChar_ptr(n_elem, 1);
+ fullname = gen_const_xmlChar_ptr(n_fullname, 2);
+ type = gen_int(n_type, 3);
+ def = gen_int(n_def, 4);
+ defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
+ tree = gen_xmlEnumerationPtr(n_tree, 6);
+
+ xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_elem, elem, 1);
+ des_const_xmlChar_ptr(n_fullname, fullname, 2);
+ des_int(n_type, type, 3);
+ des_int(n_def, def, 4);
+ des_const_xmlChar_ptr(n_defaultValue, defaultValue, 5);
+ des_xmlEnumerationPtr(n_tree, tree, 6);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_elem);
+ printf(" %d", n_fullname);
+ printf(" %d", n_type);
+ printf(" %d", n_def);
+ printf(" %d", n_defaultValue);
+ printf(" %d", n_tree);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2CDataBlock(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * value; /* The pcdata content */
+ int n_value;
+ int len; /* the block length */
+ int n_len;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
+ for (n_len = 0;n_len < gen_nb_int;n_len++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ value = gen_const_xmlChar_ptr(n_value, 1);
+ len = gen_int(n_len, 2);
+
+ xmlSAX2CDataBlock(ctx, value, len);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_value, value, 1);
+ des_int(n_len, len, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2CDataBlock",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_value);
+ printf(" %d", n_len);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2Characters(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * ch; /* a xmlChar string */
+ int n_ch;
+ int len; /* the number of xmlChar */
+ int n_len;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
+ for (n_len = 0;n_len < gen_nb_int;n_len++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ ch = gen_const_xmlChar_ptr(n_ch, 1);
+ len = gen_int(n_len, 2);
+
+ xmlSAX2Characters(ctx, ch, len);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_ch, ch, 1);
+ des_int(n_len, len, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2Characters",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_ch);
+ printf(" %d", n_len);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2Comment(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * value; /* the xmlSAX2Comment content */
+ int n_value;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ value = gen_const_xmlChar_ptr(n_value, 1);
+
+ xmlSAX2Comment(ctx, value);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_value, value, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2Comment",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_value);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlElementContentPtr 1
+static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlSAX2ElementDecl(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* the element name */
+ int n_name;
+ int type; /* the element type */
+ int n_type;
+ xmlElementContentPtr content; /* the element value tree */
+ int n_content;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_type = 0;n_type < gen_nb_int;n_type++) {
+ for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ type = gen_int(n_type, 2);
+ content = gen_xmlElementContentPtr(n_content, 3);
+
+ xmlSAX2ElementDecl(ctx, name, type, content);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_int(n_type, type, 2);
+ des_xmlElementContentPtr(n_content, content, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2ElementDecl",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_type);
+ printf(" %d", n_content);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2EndDocument(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ xmlSAX2EndDocument(ctx);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2EndDocument",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2EndElement(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_SAX1_ENABLED
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The element name */
+ int n_name;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+
+ xmlSAX2EndElement(ctx, name);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2EndElement",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2EndElementNs(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * localname; /* the local name of the element */
+ int n_localname;
+ xmlChar * prefix; /* the element namespace prefix if available */
+ int n_prefix;
+ xmlChar * URI; /* the element namespace name if available */
+ int n_URI;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
+ for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ localname = gen_const_xmlChar_ptr(n_localname, 1);
+ prefix = gen_const_xmlChar_ptr(n_prefix, 2);
+ URI = gen_const_xmlChar_ptr(n_URI, 3);
+
+ xmlSAX2EndElementNs(ctx, localname, prefix, URI);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_localname, localname, 1);
+ des_const_xmlChar_ptr(n_prefix, prefix, 2);
+ des_const_xmlChar_ptr(n_URI, URI, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2EndElementNs",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_localname);
+ printf(" %d", n_prefix);
+ printf(" %d", n_URI);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2EntityDecl(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* the entity name */
+ int n_name;
+ int type; /* the entity type */
+ int n_type;
+ xmlChar * publicId; /* The public ID of the entity */
+ int n_publicId;
+ xmlChar * systemId; /* The system ID of the entity */
+ int n_systemId;
+ xmlChar * content; /* the entity value (without processing). */
+ int n_content;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_type = 0;n_type < gen_nb_int;n_type++) {
+ for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
+ for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
+ for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ type = gen_int(n_type, 2);
+ publicId = gen_const_xmlChar_ptr(n_publicId, 3);
+ systemId = gen_const_xmlChar_ptr(n_systemId, 4);
+ content = gen_xmlChar_ptr(n_content, 5);
+
+ xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_int(n_type, type, 2);
+ des_const_xmlChar_ptr(n_publicId, publicId, 3);
+ des_const_xmlChar_ptr(n_systemId, systemId, 4);
+ des_xmlChar_ptr(n_content, content, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2EntityDecl",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_type);
+ printf(" %d", n_publicId);
+ printf(" %d", n_systemId);
+ printf(" %d", n_content);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2ExternalSubset(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* the root element name */
+ int n_name;
+ xmlChar * ExternalID; /* the external ID */
+ int n_ExternalID;
+ xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
+ int n_SystemID;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
+ for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
+ SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
+
+ xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
+ des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_ExternalID);
+ printf(" %d", n_SystemID);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetColumnNumber(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2GetColumnNumber(ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetEntity(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlEntityPtr ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The entity name */
+ int n_name;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+
+ ret_val = xmlSAX2GetEntity(ctx, name);
+ desret_xmlEntityPtr(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetEntity",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetLineNumber(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2GetLineNumber(ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetParameterEntity(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlEntityPtr ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The entity name */
+ int n_name;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+
+ ret_val = xmlSAX2GetParameterEntity(ctx, name);
+ desret_xmlEntityPtr(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetPublicId(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const xmlChar * ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2GetPublicId(ctx);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetPublicId",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2GetSystemId(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const xmlChar * ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2GetSystemId(ctx);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2GetSystemId",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2HasExternalSubset(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2HasExternalSubset(ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2HasInternalSubset(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2HasInternalSubset(ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2IgnorableWhitespace(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * ch; /* a xmlChar string */
+ int n_ch;
+ int len; /* the number of xmlChar */
+ int n_len;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
+ for (n_len = 0;n_len < gen_nb_int;n_len++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ ch = gen_const_xmlChar_ptr(n_ch, 1);
+ len = gen_int(n_len, 2);
+
+ xmlSAX2IgnorableWhitespace(ctx, ch, len);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_ch, ch, 1);
+ des_int(n_len, len, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_ch);
+ printf(" %d", n_len);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlSAXHandler_ptr 1
+static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlSAX2InitDefaultSAXHandler(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlSAXHandler * hdlr; /* the SAX handler */
+ int n_hdlr;
+ int warning; /* flag if non-zero sets the handler warning procedure */
+ int n_warning;
+
+ for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
+ for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
+ mem_base = xmlMemBlocks();
+ hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
+ warning = gen_int(n_warning, 1);
+
+ xmlSAX2InitDefaultSAXHandler(hdlr, warning);
+ call_tests++;
+ des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
+ des_int(n_warning, warning, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_hdlr);
+ printf(" %d", n_warning);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2InitDocbDefaultSAXHandler(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DOCB_ENABLED
+ int mem_base;
+ xmlSAXHandler * hdlr; /* the SAX handler */
+ int n_hdlr;
+
+ for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
+ mem_base = xmlMemBlocks();
+ hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
+
+ xmlSAX2InitDocbDefaultSAXHandler(hdlr);
+ call_tests++;
+ des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_hdlr);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_HTML_ENABLED
+ int mem_base;
+ xmlSAXHandler * hdlr; /* the SAX handler */
+ int n_hdlr;
+
+ for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
+ mem_base = xmlMemBlocks();
+ hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
+
+ xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
+ call_tests++;
+ des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_hdlr);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2InternalSubset(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* the root element name */
+ int n_name;
+ xmlChar * ExternalID; /* the external ID */
+ int n_ExternalID;
+ xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
+ int n_SystemID;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
+ for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
+ SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
+
+ xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
+ des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2InternalSubset",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_ExternalID);
+ printf(" %d", n_SystemID);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2IsStandalone(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ ret_val = xmlSAX2IsStandalone(ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2IsStandalone",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2NotationDecl(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The name of the notation */
+ int n_name;
+ xmlChar * publicId; /* The public ID of the entity */
+ int n_publicId;
+ xmlChar * systemId; /* The system ID of the entity */
+ int n_systemId;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
+ for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ publicId = gen_const_xmlChar_ptr(n_publicId, 2);
+ systemId = gen_const_xmlChar_ptr(n_systemId, 3);
+
+ xmlSAX2NotationDecl(ctx, name, publicId, systemId);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_const_xmlChar_ptr(n_publicId, publicId, 2);
+ des_const_xmlChar_ptr(n_systemId, systemId, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2NotationDecl",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_publicId);
+ printf(" %d", n_systemId);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2ProcessingInstruction(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * target; /* the target name */
+ int n_target;
+ xmlChar * data; /* the PI data's */
+ int n_data;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
+ for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ target = gen_const_xmlChar_ptr(n_target, 1);
+ data = gen_const_xmlChar_ptr(n_data, 2);
+
+ xmlSAX2ProcessingInstruction(ctx, target, data);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_target, target, 1);
+ des_const_xmlChar_ptr(n_data, data, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_target);
+ printf(" %d", n_data);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2Reference(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The entity name */
+ int n_name;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+
+ xmlSAX2Reference(ctx, name);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2Reference",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2ResolveEntity(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlParserInputPtr ret_val;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * publicId; /* The public ID of the entity */
+ int n_publicId;
+ xmlChar * systemId; /* The system ID of the entity */
+ int n_systemId;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
+ for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ publicId = gen_const_xmlChar_ptr(n_publicId, 1);
+ systemId = gen_const_xmlChar_ptr(n_systemId, 2);
+
+ ret_val = xmlSAX2ResolveEntity(ctx, publicId, systemId);
+ desret_xmlParserInputPtr(ret_val);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_publicId, publicId, 1);
+ des_const_xmlChar_ptr(n_systemId, systemId, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_publicId);
+ printf(" %d", n_systemId);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlSAXLocatorPtr 1
+static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlSAX2SetDocumentLocator(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlSAXLocatorPtr loc; /* A SAX Locator */
+ int n_loc;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ loc = gen_xmlSAXLocatorPtr(n_loc, 1);
+
+ xmlSAX2SetDocumentLocator(ctx, loc);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_xmlSAXLocatorPtr(n_loc, loc, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_loc);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2StartDocument(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+
+ xmlSAX2StartDocument(ctx);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2StartDocument",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2StartElement(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_SAX1_ENABLED
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * fullname; /* The element name, including namespace prefix */
+ int n_fullname;
+ xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
+ int n_atts;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
+ for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ fullname = gen_const_xmlChar_ptr(n_fullname, 1);
+ atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
+
+ xmlSAX2StartElement(ctx, fullname, atts);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_fullname, fullname, 1);
+ des_const_xmlChar_ptr_ptr(n_atts, atts, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2StartElement",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_fullname);
+ printf(" %d", n_atts);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2StartElementNs(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * localname; /* the local name of the element */
+ int n_localname;
+ xmlChar * prefix; /* the element namespace prefix if available */
+ int n_prefix;
+ xmlChar * URI; /* the element namespace name if available */
+ int n_URI;
+ int nb_namespaces; /* number of namespace definitions on that node */
+ int n_nb_namespaces;
+ xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
+ int n_namespaces;
+ int nb_attributes; /* the number of attributes on that node */
+ int n_nb_attributes;
+ int nb_defaulted; /* the number of defaulted attributes. */
+ int n_nb_defaulted;
+ xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
+ int n_attributes;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
+ for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
+ for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
+ for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
+ for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
+ for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ localname = gen_const_xmlChar_ptr(n_localname, 1);
+ prefix = gen_const_xmlChar_ptr(n_prefix, 2);
+ URI = gen_const_xmlChar_ptr(n_URI, 3);
+ nb_namespaces = gen_int(n_nb_namespaces, 4);
+ namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
+ nb_attributes = gen_int(n_nb_attributes, 6);
+ nb_defaulted = gen_int(n_nb_defaulted, 7);
+ attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
+
+ xmlSAX2StartElementNs(ctx, localname, prefix, URI, nb_namespaces, namespaces, nb_attributes, nb_defaulted, attributes);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_localname, localname, 1);
+ des_const_xmlChar_ptr(n_prefix, prefix, 2);
+ des_const_xmlChar_ptr(n_URI, URI, 3);
+ des_int(n_nb_namespaces, nb_namespaces, 4);
+ des_const_xmlChar_ptr_ptr(n_namespaces, namespaces, 5);
+ des_int(n_nb_attributes, nb_attributes, 6);
+ des_int(n_nb_defaulted, nb_defaulted, 7);
+ des_const_xmlChar_ptr_ptr(n_attributes, attributes, 8);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2StartElementNs",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_localname);
+ printf(" %d", n_prefix);
+ printf(" %d", n_URI);
+ printf(" %d", n_nb_namespaces);
+ printf(" %d", n_namespaces);
+ printf(" %d", n_nb_attributes);
+ printf(" %d", n_nb_defaulted);
+ printf(" %d", n_attributes);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAX2UnparsedEntityDecl(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ void * ctx; /* the user data (XML parser context) */
+ int n_ctx;
+ xmlChar * name; /* The name of the entity */
+ int n_name;
+ xmlChar * publicId; /* The public ID of the entity */
+ int n_publicId;
+ xmlChar * systemId; /* The system ID of the entity */
+ int n_systemId;
+ xmlChar * notationName; /* the name of the notation */
+ int n_notationName;
+
+ for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
+ for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
+ for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
+ mem_base = xmlMemBlocks();
+ ctx = gen_void_ptr(n_ctx, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ publicId = gen_const_xmlChar_ptr(n_publicId, 2);
+ systemId = gen_const_xmlChar_ptr(n_systemId, 3);
+ notationName = gen_const_xmlChar_ptr(n_notationName, 4);
+
+ xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName);
+ call_tests++;
+ des_void_ptr(n_ctx, ctx, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_const_xmlChar_ptr(n_publicId, publicId, 2);
+ des_const_xmlChar_ptr(n_systemId, systemId, 3);
+ des_const_xmlChar_ptr(n_notationName, notationName, 4);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctx);
+ printf(" %d", n_name);
+ printf(" %d", n_publicId);
+ printf(" %d", n_systemId);
+ printf(" %d", n_notationName);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAXDefaultVersion(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_SAX1_ENABLED
+ int mem_base;
+ int ret_val;
+ int version; /* the version, 1 or 2 */
+ int n_version;
+
+ for (n_version = 0;n_version < gen_nb_int;n_version++) {
+ mem_base = xmlMemBlocks();
+ version = gen_int(n_version, 0);
+
+ ret_val = xmlSAXDefaultVersion(version);
+ desret_int(ret_val);
+ call_tests++;
+ des_int(n_version, version, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAXDefaultVersion",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_version);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSAXVersion(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlSAXHandler * hdlr; /* the SAX handler */
+ int n_hdlr;
+ int version; /* the version, 1 or 2 */
+ int n_version;
+
+ for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
+ for (n_version = 0;n_version < gen_nb_int;n_version++) {
+ mem_base = xmlMemBlocks();
+ hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
+ version = gen_int(n_version, 1);
+
+ ret_val = xmlSAXVersion(hdlr, version);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
+ des_int(n_version, version, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSAXVersion",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_hdlr);
+ printf(" %d", n_version);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+static int
+test_SAX2(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
+ test_ret += test_docbDefaultSAXHandlerInit();
+ test_ret += test_htmlDefaultSAXHandlerInit();
+ test_ret += test_xmlDefaultSAXHandlerInit();
+ test_ret += test_xmlSAX2AttributeDecl();
+ test_ret += test_xmlSAX2CDataBlock();
+ test_ret += test_xmlSAX2Characters();
+ test_ret += test_xmlSAX2Comment();
+ test_ret += test_xmlSAX2ElementDecl();
+ test_ret += test_xmlSAX2EndDocument();
+ test_ret += test_xmlSAX2EndElement();
+ test_ret += test_xmlSAX2EndElementNs();
+ test_ret += test_xmlSAX2EntityDecl();
+ test_ret += test_xmlSAX2ExternalSubset();
+ test_ret += test_xmlSAX2GetColumnNumber();
+ test_ret += test_xmlSAX2GetEntity();
+ test_ret += test_xmlSAX2GetLineNumber();
+ test_ret += test_xmlSAX2GetParameterEntity();
+ test_ret += test_xmlSAX2GetPublicId();
+ test_ret += test_xmlSAX2GetSystemId();
+ test_ret += test_xmlSAX2HasExternalSubset();
+ test_ret += test_xmlSAX2HasInternalSubset();
+ test_ret += test_xmlSAX2IgnorableWhitespace();
+ test_ret += test_xmlSAX2InitDefaultSAXHandler();
+ test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
+ test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
+ test_ret += test_xmlSAX2InternalSubset();
+ test_ret += test_xmlSAX2IsStandalone();
+ test_ret += test_xmlSAX2NotationDecl();
+ test_ret += test_xmlSAX2ProcessingInstruction();
+ test_ret += test_xmlSAX2Reference();
+ test_ret += test_xmlSAX2ResolveEntity();
+ test_ret += test_xmlSAX2SetDocumentLocator();
+ test_ret += test_xmlSAX2StartDocument();
+ test_ret += test_xmlSAX2StartElement();
+ test_ret += test_xmlSAX2StartElementNs();
+ test_ret += test_xmlSAX2UnparsedEntityDecl();
+ test_ret += test_xmlSAXDefaultVersion();
+ test_ret += test_xmlSAXVersion();
+
+ if (test_ret != 0)
+ printf("Module SAX2: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_xmlC14NDocDumpMemory(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_C14N_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlDocPtr doc; /* the XML document for canonization */
+ int n_doc;
+ xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
+ int n_nodes;
+ int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
+ int n_exclusive;
+ xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
+ int n_inclusive_ns_prefixes;
+ int with_comments; /* include comments in the result (!=0) or not (==0) */
+ int n_with_comments;
+ xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
+ int n_doc_txt_ptr;
+
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
+ for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
+ for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
+ for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
+ for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_xmlDocPtr(n_doc, 0);
+ nodes = gen_xmlNodeSetPtr(n_nodes, 1);
+ exclusive = gen_int(n_exclusive, 2);
+ inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
+ with_comments = gen_int(n_with_comments, 4);
+ doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
+
+ ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDocPtr(n_doc, doc, 0);
+ des_xmlNodeSetPtr(n_nodes, nodes, 1);
+ des_int(n_exclusive, exclusive, 2);
+ des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
+ des_int(n_with_comments, with_comments, 4);
+ des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_nodes);
+ printf(" %d", n_exclusive);
+ printf(" %d", n_inclusive_ns_prefixes);
+ printf(" %d", n_with_comments);
+ printf(" %d", n_doc_txt_ptr);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlC14NDocSave(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_C14N_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlDocPtr doc; /* the XML document for canonization */
+ int n_doc;
+ xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
+ int n_nodes;
+ int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
+ int n_exclusive;
+ xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
+ int n_inclusive_ns_prefixes;
+ int with_comments; /* include comments in the result (!=0) or not (==0) */
+ int n_with_comments;
+ const char * filename; /* the filename to store canonical XML image */
+ int n_filename;
+ int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
+ int n_compression;
+
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
+ for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
+ for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
+ for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
+ for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
+ for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_xmlDocPtr(n_doc, 0);
+ nodes = gen_xmlNodeSetPtr(n_nodes, 1);
+ exclusive = gen_int(n_exclusive, 2);
+ inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
+ with_comments = gen_int(n_with_comments, 4);
+ filename = gen_fileoutput(n_filename, 5);
+ compression = gen_int(n_compression, 6);
+
+ ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDocPtr(n_doc, doc, 0);
+ des_xmlNodeSetPtr(n_nodes, nodes, 1);
+ des_int(n_exclusive, exclusive, 2);
+ des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
+ des_int(n_with_comments, with_comments, 4);
+ des_fileoutput(n_filename, filename, 5);
+ des_int(n_compression, compression, 6);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlC14NDocSave",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_nodes);
+ printf(" %d", n_exclusive);
+ printf(" %d", n_inclusive_ns_prefixes);
+ printf(" %d", n_with_comments);
+ printf(" %d", n_filename);
+ printf(" %d", n_compression);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlC14NDocSaveTo(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_C14N_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlDocPtr doc; /* the XML document for canonization */
+ int n_doc;
+ xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
+ int n_nodes;
+ int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
+ int n_exclusive;
+ xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
+ int n_inclusive_ns_prefixes;
+ int with_comments; /* include comments in the result (!=0) or not (==0) */
+ int n_with_comments;
+ xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
+ int n_buf;
+
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
+ for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
+ for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
+ for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
+ for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_xmlDocPtr(n_doc, 0);
+ nodes = gen_xmlNodeSetPtr(n_nodes, 1);
+ exclusive = gen_int(n_exclusive, 2);
+ inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
+ with_comments = gen_int(n_with_comments, 4);
+ buf = gen_xmlOutputBufferPtr(n_buf, 5);
+
+ ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDocPtr(n_doc, doc, 0);
+ des_xmlNodeSetPtr(n_nodes, nodes, 1);
+ des_int(n_exclusive, exclusive, 2);
+ des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
+ des_int(n_with_comments, with_comments, 4);
+ des_xmlOutputBufferPtr(n_buf, buf, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlC14NDocSaveTo",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_nodes);
+ printf(" %d", n_exclusive);
+ printf(" %d", n_inclusive_ns_prefixes);
+ printf(" %d", n_with_comments);
+ printf(" %d", n_buf);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlC14NExecute(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+static int
+test_c14n(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
+ test_ret += test_xmlC14NDocDumpMemory();
+ test_ret += test_xmlC14NDocSave();
+ test_ret += test_xmlC14NDocSaveTo();
+ test_ret += test_xmlC14NExecute();
+
+ if (test_ret != 0)
+ printf("Module c14n: %d errors\n", test_ret);
+ return(test_ret);
+}
+#ifdef LIBXML_CATALOG_ENABLED
+
+#define gen_nb_xmlCatalogPtr 1
+static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+#endif
+
+
+static int
+test_xmlACatalogAdd(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * type; /* the type of record to add to the catalog */
+ int n_type;
+ xmlChar * orig; /* the system, public or prefix to match */
+ int n_orig;
+ xmlChar * replace; /* the replacement value for the match */
+ int n_replace;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
+ for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
+ for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ type = gen_const_xmlChar_ptr(n_type, 1);
+ orig = gen_const_xmlChar_ptr(n_orig, 2);
+ replace = gen_const_xmlChar_ptr(n_replace, 3);
+
+ ret_val = xmlACatalogAdd(catal, type, orig, replace);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_type, type, 1);
+ des_const_xmlChar_ptr(n_orig, orig, 2);
+ des_const_xmlChar_ptr(n_replace, replace, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogAdd",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_type);
+ printf(" %d", n_orig);
+ printf(" %d", n_replace);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogDump(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ FILE * out; /* the file. */
+ int n_out;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ out = gen_FILE_ptr(n_out, 1);
+
+ xmlACatalogDump(catal, out);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_FILE_ptr(n_out, out, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogDump",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_out);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogRemove(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * value; /* the value to remove */
+ int n_value;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ value = gen_const_xmlChar_ptr(n_value, 1);
+
+ ret_val = xmlACatalogRemove(catal, value);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_value, value, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogRemove",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_value);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogResolve(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * pubID; /* the public ID string */
+ int n_pubID;
+ xmlChar * sysID; /* the system ID string */
+ int n_sysID;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
+ for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ pubID = gen_const_xmlChar_ptr(n_pubID, 1);
+ sysID = gen_const_xmlChar_ptr(n_sysID, 2);
+
+ ret_val = xmlACatalogResolve(catal, pubID, sysID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_pubID, pubID, 1);
+ des_const_xmlChar_ptr(n_sysID, sysID, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogResolve",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_pubID);
+ printf(" %d", n_sysID);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogResolvePublic(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * pubID; /* the public ID string */
+ int n_pubID;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ pubID = gen_const_xmlChar_ptr(n_pubID, 1);
+
+ ret_val = xmlACatalogResolvePublic(catal, pubID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_pubID, pubID, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogResolvePublic",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_pubID);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogResolveSystem(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * sysID; /* the system ID string */
+ int n_sysID;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ sysID = gen_const_xmlChar_ptr(n_sysID, 1);
+
+ ret_val = xmlACatalogResolveSystem(catal, sysID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_sysID, sysID, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogResolveSystem",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_sysID);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlACatalogResolveURI(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlCatalogPtr catal; /* a Catalog */
+ int n_catal;
+ xmlChar * URI; /* the URI */
+ int n_URI;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+ URI = gen_const_xmlChar_ptr(n_URI, 1);
+
+ ret_val = xmlACatalogResolveURI(catal, URI);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ des_const_xmlChar_ptr(n_URI, URI, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlACatalogResolveURI",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf(" %d", n_URI);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogAdd(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlChar * type; /* the type of record to add to the catalog */
+ int n_type;
+ xmlChar * orig; /* the system, public or prefix to match */
+ int n_orig;
+ xmlChar * replace; /* the replacement value for the match */
+ int n_replace;
+
+ for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
+ for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
+ for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
+ mem_base = xmlMemBlocks();
+ type = gen_const_xmlChar_ptr(n_type, 0);
+ orig = gen_const_xmlChar_ptr(n_orig, 1);
+ replace = gen_const_xmlChar_ptr(n_replace, 2);
+
+ ret_val = xmlCatalogAdd(type, orig, replace);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_type, type, 0);
+ des_const_xmlChar_ptr(n_orig, orig, 1);
+ des_const_xmlChar_ptr(n_replace, replace, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogAdd",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_type);
+ printf(" %d", n_orig);
+ printf(" %d", n_replace);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogCleanup(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+
+
+ xmlCatalogCleanup();
+ call_tests++;
+ xmlResetLastError();
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogConvert(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int ret_val;
+
+
+ ret_val = xmlCatalogConvert();
+ desret_int(ret_val);
+ call_tests++;
+ xmlResetLastError();
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogDump(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ FILE * out; /* the file. */
+ int n_out;
+
+ for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
+ mem_base = xmlMemBlocks();
+ out = gen_FILE_ptr(n_out, 0);
+
+ xmlCatalogDump(out);
+ call_tests++;
+ des_FILE_ptr(n_out, out, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogDump",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogGetDefaults(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlCatalogAllow ret_val;
+
+ mem_base = xmlMemBlocks();
+
+ ret_val = xmlCatalogGetDefaults();
+ desret_xmlCatalogAllow(ret_val);
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogGetDefaults",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogIsEmpty(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlCatalogPtr catal; /* should this create an SGML catalog */
+ int n_catal;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+
+ ret_val = xmlCatalogIsEmpty(catal);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogIsEmpty",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogLocalResolve(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ void * catalogs; /* a document's list of catalogs */
+ int n_catalogs;
+ xmlChar * pubID; /* the public ID string */
+ int n_pubID;
+ xmlChar * sysID; /* the system ID string */
+ int n_sysID;
+
+ for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
+ for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
+ for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
+ mem_base = xmlMemBlocks();
+ catalogs = gen_void_ptr(n_catalogs, 0);
+ pubID = gen_const_xmlChar_ptr(n_pubID, 1);
+ sysID = gen_const_xmlChar_ptr(n_sysID, 2);
+
+ ret_val = xmlCatalogLocalResolve(catalogs, pubID, sysID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_void_ptr(n_catalogs, catalogs, 0);
+ des_const_xmlChar_ptr(n_pubID, pubID, 1);
+ des_const_xmlChar_ptr(n_sysID, sysID, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogLocalResolve",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catalogs);
+ printf(" %d", n_pubID);
+ printf(" %d", n_sysID);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogLocalResolveURI(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ void * catalogs; /* a document's list of catalogs */
+ int n_catalogs;
+ xmlChar * URI; /* the URI */
+ int n_URI;
+
+ for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ mem_base = xmlMemBlocks();
+ catalogs = gen_void_ptr(n_catalogs, 0);
+ URI = gen_const_xmlChar_ptr(n_URI, 1);
+
+ ret_val = xmlCatalogLocalResolveURI(catalogs, URI);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_void_ptr(n_catalogs, catalogs, 0);
+ des_const_xmlChar_ptr(n_URI, URI, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catalogs);
+ printf(" %d", n_URI);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogRemove(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int ret_val;
+ xmlChar * value; /* the value to remove */
+ int n_value;
+
+ for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
+ value = gen_const_xmlChar_ptr(n_value, 0);
+
+ ret_val = xmlCatalogRemove(value);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_value, value, 0);
+ xmlResetLastError();
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogResolve(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlChar * pubID; /* the public ID string */
+ int n_pubID;
+ xmlChar * sysID; /* the system ID string */
+ int n_sysID;
+
+ for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
+ for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
+ mem_base = xmlMemBlocks();
+ pubID = gen_const_xmlChar_ptr(n_pubID, 0);
+ sysID = gen_const_xmlChar_ptr(n_sysID, 1);
+
+ ret_val = xmlCatalogResolve(pubID, sysID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_pubID, pubID, 0);
+ des_const_xmlChar_ptr(n_sysID, sysID, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogResolve",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_pubID);
+ printf(" %d", n_sysID);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogResolvePublic(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlChar * pubID; /* the public ID string */
+ int n_pubID;
+
+ for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
+ mem_base = xmlMemBlocks();
+ pubID = gen_const_xmlChar_ptr(n_pubID, 0);
+
+ ret_val = xmlCatalogResolvePublic(pubID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_pubID, pubID, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogResolvePublic",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_pubID);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogResolveSystem(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlChar * sysID; /* the system ID string */
+ int n_sysID;
+
+ for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
+ mem_base = xmlMemBlocks();
+ sysID = gen_const_xmlChar_ptr(n_sysID, 0);
+
+ ret_val = xmlCatalogResolveSystem(sysID);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_sysID, sysID, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogResolveSystem",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_sysID);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogResolveURI(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlChar * ret_val;
+ xmlChar * URI; /* the URI */
+ int n_URI;
+
+ for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
+ mem_base = xmlMemBlocks();
+ URI = gen_const_xmlChar_ptr(n_URI, 0);
+
+ ret_val = xmlCatalogResolveURI(URI);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_const_xmlChar_ptr(n_URI, URI, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogResolveURI",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_URI);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogSetDefaultPrefer(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlCatalogPrefer ret_val;
+ xmlCatalogPrefer prefer; /* the default preference for delegation */
+ int n_prefer;
+
+ for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
+ mem_base = xmlMemBlocks();
+ prefer = gen_xmlCatalogPrefer(n_prefer, 0);
+
+ ret_val = xmlCatalogSetDefaultPrefer(prefer);
+ desret_xmlCatalogPrefer(ret_val);
+ call_tests++;
+ des_xmlCatalogPrefer(n_prefer, prefer, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_prefer);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCatalogSetDefaults(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlCatalogAllow allow; /* what catalogs should be accepted */
+ int n_allow;
+
+ for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
+ mem_base = xmlMemBlocks();
+ allow = gen_xmlCatalogAllow(n_allow, 0);
+
+ xmlCatalogSetDefaults(allow);
+ call_tests++;
+ des_xmlCatalogAllow(n_allow, allow, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCatalogSetDefaults",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_allow);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlConvertSGMLCatalog(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlCatalogPtr catal; /* the catalog */
+ int n_catal;
+
+ for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
+ mem_base = xmlMemBlocks();
+ catal = gen_xmlCatalogPtr(n_catal, 0);
+
+ ret_val = xmlConvertSGMLCatalog(catal);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCatalogPtr(n_catal, catal, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_catal);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlInitializeCatalog(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+
+ mem_base = xmlMemBlocks();
+
+ xmlInitializeCatalog();
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlInitializeCatalog",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlLoadACatalog(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlLoadCatalog(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int ret_val;
+ const char * filename; /* a file path */
+ int n_filename;
+
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ filename = gen_filepath(n_filename, 0);
+
+ ret_val = xmlLoadCatalog(filename);
+ desret_int(ret_val);
+ call_tests++;
+ des_filepath(n_filename, filename, 0);
+ xmlResetLastError();
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlLoadCatalogs(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ char * pathss; /* a list of directories separated by a colon or a space. */
+ int n_pathss;
+
+ for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
+ pathss = gen_const_char_ptr(n_pathss, 0);
+
+ xmlLoadCatalogs(pathss);
+ call_tests++;
+ des_const_char_ptr(n_pathss, pathss, 0);
+ xmlResetLastError();
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlLoadSGMLSuperCatalog(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlNewCatalog(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlParseCatalogFile(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_CATALOG_ENABLED
+ int mem_base;
+ xmlDocPtr ret_val;
+ const char * filename; /* the filename */
+ int n_filename;
+
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ mem_base = xmlMemBlocks();
+ filename = gen_filepath(n_filename, 0);
+
+ ret_val = xmlParseCatalogFile(filename);
+ desret_xmlDocPtr(ret_val);
+ call_tests++;
+ des_filepath(n_filename, filename, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlParseCatalogFile",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_filename);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+static int
+test_catalog(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
+ test_ret += test_xmlACatalogAdd();
+ test_ret += test_xmlACatalogDump();
+ test_ret += test_xmlACatalogRemove();
+ test_ret += test_xmlACatalogResolve();
+ test_ret += test_xmlACatalogResolvePublic();
+ test_ret += test_xmlACatalogResolveSystem();
+ test_ret += test_xmlACatalogResolveURI();
+ test_ret += test_xmlCatalogAdd();
+ test_ret += test_xmlCatalogCleanup();
+ test_ret += test_xmlCatalogConvert();
+ test_ret += test_xmlCatalogDump();
+ test_ret += test_xmlCatalogGetDefaults();
+ test_ret += test_xmlCatalogIsEmpty();
+ test_ret += test_xmlCatalogLocalResolve();
+ test_ret += test_xmlCatalogLocalResolveURI();
+ test_ret += test_xmlCatalogRemove();
+ test_ret += test_xmlCatalogResolve();
+ test_ret += test_xmlCatalogResolvePublic();
+ test_ret += test_xmlCatalogResolveSystem();
+ test_ret += test_xmlCatalogResolveURI();
+ test_ret += test_xmlCatalogSetDefaultPrefer();
+ test_ret += test_xmlCatalogSetDefaults();
+ test_ret += test_xmlConvertSGMLCatalog();
+ test_ret += test_xmlInitializeCatalog();
+ test_ret += test_xmlLoadACatalog();
+ test_ret += test_xmlLoadCatalog();
+ test_ret += test_xmlLoadCatalogs();
+ test_ret += test_xmlLoadSGMLSuperCatalog();
+ test_ret += test_xmlNewCatalog();
+ test_ret += test_xmlParseCatalogFile();
+
+ if (test_ret != 0)
+ printf("Module catalog: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+#define gen_nb_const_xmlChRangeGroupPtr 1
+static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlCharInRange(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int val; /* character to be validated */
+ int n_val;
+ xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
+ int n_rptr;
+
+ for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
+ for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
+ mem_base = xmlMemBlocks();
+ val = gen_unsigned_int(n_val, 0);
+ rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
+
+ ret_val = xmlCharInRange(val, rptr);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_val, val, 0);
+ des_const_xmlChRangeGroupPtr(n_rptr, rptr, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCharInRange",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_val);
+ printf(" %d", n_rptr);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsBaseChar(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsBaseChar(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsBaseChar",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsBlank(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsBlank(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsBlank",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsChar(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsChar(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsChar",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsCombining(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsCombining(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsCombining",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsDigit(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsDigit(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsDigit",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsExtender(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsExtender(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsExtender",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsIdeographic(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsIdeographic(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsIdeographic",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlIsPubidChar(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned int ch; /* character to validate */
+ int n_ch;
+
+ for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
+ mem_base = xmlMemBlocks();
+ ch = gen_unsigned_int(n_ch, 0);
+
+ ret_val = xmlIsPubidChar(ch);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_int(n_ch, ch, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlIsPubidChar",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ch);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+static int
+test_chvalid(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
+ test_ret += test_xmlCharInRange();
+ test_ret += test_xmlIsBaseChar();
+ test_ret += test_xmlIsBlank();
+ test_ret += test_xmlIsChar();
+ test_ret += test_xmlIsCombining();
+ test_ret += test_xmlIsDigit();
+ test_ret += test_xmlIsExtender();
+ test_ret += test_xmlIsIdeographic();
+ test_ret += test_xmlIsPubidChar();
+
+ if (test_ret != 0)
+ printf("Module chvalid: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_xmlBoolToText(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ const char * ret_val;
+ int boolval; /* a bool to turn into text */
+ int n_boolval;
+
+ for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
+ mem_base = xmlMemBlocks();
+ boolval = gen_int(n_boolval, 0);
+
+ ret_val = xmlBoolToText(boolval);
+ desret_const_char_ptr(ret_val);
+ call_tests++;
+ des_int(n_boolval, boolval, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlBoolToText",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_boolval);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugCheckDocument(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ int ret_val;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+
+ ret_val = xmlDebugCheckDocument(output, doc);
+ desret_int(ret_val);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugCheckDocument",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_doc);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpAttr(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlAttrPtr attr; /* the attribute */
+ int n_attr;
+ int depth; /* the indentation level. */
+ int n_depth;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
+ for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ attr = gen_xmlAttrPtr(n_attr, 1);
+ depth = gen_int(n_depth, 2);
+
+ xmlDebugDumpAttr(output, attr, depth);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlAttrPtr(n_attr, attr, 1);
+ des_int(n_depth, depth, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpAttr",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_attr);
+ printf(" %d", n_depth);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpAttrList(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlAttrPtr attr; /* the attribute list */
+ int n_attr;
+ int depth; /* the indentation level. */
+ int n_depth;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
+ for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ attr = gen_xmlAttrPtr(n_attr, 1);
+ depth = gen_int(n_depth, 2);
+
+ xmlDebugDumpAttrList(output, attr, depth);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlAttrPtr(n_attr, attr, 1);
+ des_int(n_depth, depth, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpAttrList",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_attr);
+ printf(" %d", n_depth);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpDTD(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlDtdPtr dtd; /* the DTD */
+ int n_dtd;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ dtd = gen_xmlDtdPtr(n_dtd, 1);
+
+ xmlDebugDumpDTD(output, dtd);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlDtdPtr(n_dtd, dtd, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpDTD",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_dtd);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpDocument(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+
+ xmlDebugDumpDocument(output, doc);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpDocument",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_doc);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpDocumentHead(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+
+ xmlDebugDumpDocumentHead(output, doc);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_doc);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpEntities(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ doc = gen_xmlDocPtr(n_doc, 1);
+
+ xmlDebugDumpEntities(output, doc);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlDocPtr(n_doc, doc, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpEntities",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_doc);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpNode(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlNodePtr node; /* the node */
+ int n_node;
+ int depth; /* the indentation level. */
+ int n_depth;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ node = gen_xmlNodePtr(n_node, 1);
+ depth = gen_int(n_depth, 2);
+
+ xmlDebugDumpNode(output, node, depth);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlNodePtr(n_node, node, 1);
+ des_int(n_depth, depth, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpNode",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_node);
+ printf(" %d", n_depth);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpNodeList(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlNodePtr node; /* the node list */
+ int n_node;
+ int depth; /* the indentation level. */
+ int n_depth;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ node = gen_xmlNodePtr(n_node, 1);
+ depth = gen_int(n_depth, 2);
+
+ xmlDebugDumpNodeList(output, node, depth);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlNodePtr(n_node, node, 1);
+ des_int(n_depth, depth, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpNodeList",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_node);
+ printf(" %d", n_depth);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpOneNode(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlNodePtr node; /* the node */
+ int n_node;
+ int depth; /* the indentation level. */
+ int n_depth;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ node = gen_xmlNodePtr(n_node, 1);
+ depth = gen_int(n_depth, 2);
+
+ xmlDebugDumpOneNode(output, node, depth);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlNodePtr(n_node, node, 1);
+ des_int(n_depth, depth, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpOneNode",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_node);
+ printf(" %d", n_depth);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDebugDumpString(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlChar * str; /* the string */
+ int n_str;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ str = gen_const_xmlChar_ptr(n_str, 1);
+
+ xmlDebugDumpString(output, str);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_const_xmlChar_ptr(n_str, str, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDebugDumpString",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_str);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlLsCountNode(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlNodePtr node; /* the node to count */
+ int n_node;
+
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ mem_base = xmlMemBlocks();
+ node = gen_xmlNodePtr(n_node, 0);
+
+ ret_val = xmlLsCountNode(node);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlNodePtr(n_node, node, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlLsCountNode",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_node);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlLsOneNode(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+ int mem_base;
+ FILE * output; /* the FILE * for the output */
+ int n_output;
+ xmlNodePtr node; /* the node to dump */
+ int n_node;
+
+ for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ mem_base = xmlMemBlocks();
+ output = gen_debug_FILE_ptr(n_output, 0);
+ node = gen_xmlNodePtr(n_node, 1);
+
+ xmlLsOneNode(output, node);
+ call_tests++;
+ des_debug_FILE_ptr(n_output, output, 0);
+ des_xmlNodePtr(n_node, node, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlLsOneNode",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_output);
+ printf(" %d", n_node);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+#define gen_nb_char_ptr 1
+static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlShell(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellBase(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * arg; /* unused */
+ int n_arg;
+ xmlNodePtr node; /* a node */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ arg = gen_char_ptr(n_arg, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellBase(ctxt, arg, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_arg, arg, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellBase",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_arg);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellCat(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * arg; /* unused */
+ int n_arg;
+ xmlNodePtr node; /* a node */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ arg = gen_char_ptr(n_arg, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellCat(ctxt, arg, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_arg, arg, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellCat",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_arg);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellDir(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * arg; /* unused */
+ int n_arg;
+ xmlNodePtr node; /* a node */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ arg = gen_char_ptr(n_arg, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellDir(ctxt, arg, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_arg, arg, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellDir",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_arg);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellDu(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * arg; /* unused */
+ int n_arg;
+ xmlNodePtr tree; /* a node defining a subtree */
+ int n_tree;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
+ for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ arg = gen_char_ptr(n_arg, 1);
+ tree = gen_xmlNodePtr(n_tree, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellDu(ctxt, arg, tree, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_arg, arg, 1);
+ des_xmlNodePtr(n_tree, tree, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellDu",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_arg);
+ printf(" %d", n_tree);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellList(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * arg; /* unused */
+ int n_arg;
+ xmlNodePtr node; /* a node */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ arg = gen_char_ptr(n_arg, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellList(ctxt, arg, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_arg, arg, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellList",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_arg);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellLoad(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * filename; /* the file name */
+ int n_filename;
+ xmlNodePtr node; /* unused */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ filename = gen_char_ptr(n_filename, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellLoad(ctxt, filename, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_filename, filename, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellLoad",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_filename);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellPrintXPathResult(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
+ int n_list;
+
+ for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
+ mem_base = xmlMemBlocks();
+ list = gen_xmlXPathObjectPtr(n_list, 0);
+
+ xmlShellPrintXPathResult(list);
+ call_tests++;
+ des_xmlXPathObjectPtr(n_list, list, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellPrintXPathResult",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_list);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellPwd(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * buffer; /* the output buffer */
+ int n_buffer;
+ xmlNodePtr node; /* a node */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ buffer = gen_char_ptr(n_buffer, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellPwd(ctxt, buffer, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_buffer, buffer, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellPwd",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_buffer);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellSave(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * filename; /* the file name (optional) */
+ int n_filename;
+ xmlNodePtr node; /* unused */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ filename = gen_char_ptr(n_filename, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellSave(ctxt, filename, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_filename, filename, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellSave",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_filename);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellValidate(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * dtd; /* the DTD URI (optional) */
+ int n_dtd;
+ xmlNodePtr node; /* unused */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ dtd = gen_char_ptr(n_dtd, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellValidate(ctxt, dtd, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_dtd, dtd, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellValidate",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_dtd);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlShellWrite(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_DEBUG_ENABLED
+#ifdef LIBXML_XPATH_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ xmlShellCtxtPtr ctxt; /* the shell context */
+ int n_ctxt;
+ char * filename; /* the file name */
+ int n_filename;
+ xmlNodePtr node; /* a node in the tree */
+ int n_node;
+ xmlNodePtr node2; /* unused */
+ int n_node2;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
+ for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
+ filename = gen_char_ptr(n_filename, 1);
+ node = gen_xmlNodePtr(n_node, 2);
+ node2 = gen_xmlNodePtr(n_node2, 3);
+
+ ret_val = xmlShellWrite(ctxt, filename, node, node2);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
+ des_char_ptr(n_filename, filename, 1);
+ des_xmlNodePtr(n_node, node, 2);
+ des_xmlNodePtr(n_node2, node2, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlShellWrite",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf(" %d", n_filename);
+ printf(" %d", n_node);
+ printf(" %d", n_node2);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+#endif
+#endif
+
+ return(test_ret);
+}
+
+static int
+test_debugXML(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
+ test_ret += test_xmlBoolToText();
+ test_ret += test_xmlDebugCheckDocument();
+ test_ret += test_xmlDebugDumpAttr();
+ test_ret += test_xmlDebugDumpAttrList();
+ test_ret += test_xmlDebugDumpDTD();
+ test_ret += test_xmlDebugDumpDocument();
+ test_ret += test_xmlDebugDumpDocumentHead();
+ test_ret += test_xmlDebugDumpEntities();
+ test_ret += test_xmlDebugDumpNode();
+ test_ret += test_xmlDebugDumpNodeList();
+ test_ret += test_xmlDebugDumpOneNode();
+ test_ret += test_xmlDebugDumpString();
+ test_ret += test_xmlLsCountNode();
+ test_ret += test_xmlLsOneNode();
+ test_ret += test_xmlShell();
+ test_ret += test_xmlShellBase();
+ test_ret += test_xmlShellCat();
+ test_ret += test_xmlShellDir();
+ test_ret += test_xmlShellDu();
+ test_ret += test_xmlShellList();
+ test_ret += test_xmlShellLoad();
+ test_ret += test_xmlShellPrintXPathResult();
+ test_ret += test_xmlShellPwd();
+ test_ret += test_xmlShellSave();
+ test_ret += test_xmlShellValidate();
+ test_ret += test_xmlShellWrite();
+
+ if (test_ret != 0)
+ printf("Module debugXML: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_xmlDictCreate(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlDictPtr ret_val;
+
+ mem_base = xmlMemBlocks();
+
+ ret_val = xmlDictCreate();
+ desret_xmlDictPtr(ret_val);
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictCreate",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictCreateSub(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlDictPtr ret_val;
+ xmlDictPtr sub; /* an existing dictionnary */
+ int n_sub;
+
+ for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
+ mem_base = xmlMemBlocks();
+ sub = gen_xmlDictPtr(n_sub, 0);
+
+ ret_val = xmlDictCreateSub(sub);
+ desret_xmlDictPtr(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_sub, sub, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictCreateSub",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_sub);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictLookup(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const xmlChar * ret_val;
+ xmlDictPtr dict; /* the dictionnary */
+ int n_dict;
+ xmlChar * name; /* the name of the userdata */
+ int n_name;
+ int len; /* the length of the name, if -1 it is recomputed */
+ int n_len;
+
+ for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_len = 0;n_len < gen_nb_int;n_len++) {
+ mem_base = xmlMemBlocks();
+ dict = gen_xmlDictPtr(n_dict, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ len = gen_int(n_len, 2);
+
+ ret_val = xmlDictLookup(dict, name, len);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_dict, dict, 0);
+ des_const_xmlChar_ptr(n_name, name, 1);
+ des_int(n_len, len, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictLookup",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_dict);
+ printf(" %d", n_name);
+ printf(" %d", n_len);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictOwns(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlDictPtr dict; /* the dictionnary */
+ int n_dict;
+ xmlChar * str; /* the string */
+ int n_str;
+
+ for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
+ for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
+ mem_base = xmlMemBlocks();
+ dict = gen_xmlDictPtr(n_dict, 0);
+ str = gen_const_xmlChar_ptr(n_str, 1);
+
+ ret_val = xmlDictOwns(dict, str);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_dict, dict, 0);
+ des_const_xmlChar_ptr(n_str, str, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictOwns",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_dict);
+ printf(" %d", n_str);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictQLookup(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const xmlChar * ret_val;
+ xmlDictPtr dict; /* the dictionnary */
+ int n_dict;
+ xmlChar * prefix; /* the prefix */
+ int n_prefix;
+ xmlChar * name; /* the name */
+ int n_name;
+
+ for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
+ for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ mem_base = xmlMemBlocks();
+ dict = gen_xmlDictPtr(n_dict, 0);
+ prefix = gen_const_xmlChar_ptr(n_prefix, 1);
+ name = gen_const_xmlChar_ptr(n_name, 2);
+
+ ret_val = xmlDictQLookup(dict, prefix, name);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_dict, dict, 0);
+ des_const_xmlChar_ptr(n_prefix, prefix, 1);
+ des_const_xmlChar_ptr(n_name, name, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictQLookup",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_dict);
+ printf(" %d", n_prefix);
+ printf(" %d", n_name);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictReference(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlDictPtr dict; /* the dictionnary */
+ int n_dict;
+
+ for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
+ mem_base = xmlMemBlocks();
+ dict = gen_xmlDictPtr(n_dict, 0);
+
+ ret_val = xmlDictReference(dict);
+ xmlDictFree(dict);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_dict, dict, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictReference",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_dict);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDictSize(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlDictPtr dict; /* the dictionnary */
+ int n_dict;
+
+ for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
+ mem_base = xmlMemBlocks();
+ dict = gen_xmlDictPtr(n_dict, 0);
+
+ ret_val = xmlDictSize(dict);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlDictPtr(n_dict, dict, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDictSize",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_dict);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+static int
+test_dict(void) {
+ int test_ret = 0;
+
+ if (quiet == 0) printf("Testing dict : 7 of 8 functions ...\n");
+ test_ret += test_xmlDictCreate();
+ test_ret += test_xmlDictCreateSub();
+ test_ret += test_xmlDictLookup();
+ test_ret += test_xmlDictOwns();
+ test_ret += test_xmlDictQLookup();
+ test_ret += test_xmlDictReference();
+ test_ret += test_xmlDictSize();
+
+ if (test_ret != 0)
+ printf("Module dict: %d errors\n", test_ret);
+ return(test_ret);
+}
+
+static int
+test_UTF8Toisolat1(void) {
+ int test_ret = 0;
+
+#ifdef LIBXML_OUTPUT_ENABLED
+ int mem_base;
+ int ret_val;
+ unsigned char * out; /* a pointer to an array of bytes to store the result */
+ int n_out;
+ int * outlen; /* the length of @out */
+ int n_outlen;
+ unsigned char * in; /* a pointer to an array of UTF-8 chars */
+ int n_in;
+ int * inlen; /* the length of @in */
+ int n_inlen;
+
+ for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
+ for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
+ for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
+ for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
+ mem_base = xmlMemBlocks();
+ out = gen_unsigned_char_ptr(n_out, 0);
+ outlen = gen_int_ptr(n_outlen, 1);
+ in = gen_const_unsigned_char_ptr(n_in, 2);
+ inlen = gen_int_ptr(n_inlen, 3);
+
+ ret_val = UTF8Toisolat1(out, outlen, in, inlen);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_char_ptr(n_out, out, 0);
+ des_int_ptr(n_outlen, outlen, 1);
+ des_const_unsigned_char_ptr(n_in, in, 2);
+ des_int_ptr(n_inlen, inlen, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in UTF8Toisolat1",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_outlen);
+ printf(" %d", n_in);
+ printf(" %d", n_inlen);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_isolat1ToUTF8(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ unsigned char * out; /* a pointer to an array of bytes to store the result */
+ int n_out;
+ int * outlen; /* the length of @out */
+ int n_outlen;
+ unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
+ int n_in;
+ int * inlen; /* the length of @in */
+ int n_inlen;
+
+ for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
+ for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
+ for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
+ for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
+ mem_base = xmlMemBlocks();
+ out = gen_unsigned_char_ptr(n_out, 0);
+ outlen = gen_int_ptr(n_outlen, 1);
+ in = gen_const_unsigned_char_ptr(n_in, 2);
+ inlen = gen_int_ptr(n_inlen, 3);
+
+ ret_val = isolat1ToUTF8(out, outlen, in, inlen);
+ desret_int(ret_val);
+ call_tests++;
+ des_unsigned_char_ptr(n_out, out, 0);
+ des_int_ptr(n_outlen, outlen, 1);
+ des_const_unsigned_char_ptr(n_in, in, 2);
+ des_int_ptr(n_inlen, inlen, 3);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in isolat1ToUTF8",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf(" %d", n_outlen);
+ printf(" %d", n_in);
+ printf(" %d", n_inlen);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlAddEncodingAlias(void) {
+ int test_ret = 0;
+
+ int ret_val;
+ char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
+ int n_name;
+ char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
+ int n_alias;
+
+ for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
+ for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
+ name = gen_const_char_ptr(n_name, 0);
+ alias = gen_const_char_ptr(n_alias, 1);
+
+ ret_val = xmlAddEncodingAlias(name, alias);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_char_ptr(n_name, name, 0);
+ des_const_char_ptr(n_alias, alias, 1);
+ xmlResetLastError();
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlCharEncodingHandler_ptr 1
+static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlCharEncCloseFunc(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
+ int n_handler;
+
+ for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
+ mem_base = xmlMemBlocks();
+ handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
+
+ ret_val = xmlCharEncCloseFunc(handler);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCharEncCloseFunc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_handler);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCharEncFirstLine(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
+ int n_handler;
+ xmlBufferPtr out; /* an xmlBuffer for the output. */
+ int n_out;
+ xmlBufferPtr in; /* an xmlBuffer for the input */
+ int n_in;
+
+ for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
+ for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
+ for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
+ mem_base = xmlMemBlocks();
+ handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
+ out = gen_xmlBufferPtr(n_out, 1);
+ in = gen_xmlBufferPtr(n_in, 2);
+
+ ret_val = xmlCharEncFirstLine(handler, out, in);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
+ des_xmlBufferPtr(n_out, out, 1);
+ des_xmlBufferPtr(n_in, in, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCharEncFirstLine",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_handler);
+ printf(" %d", n_out);
+ printf(" %d", n_in);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCharEncInFunc(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
+ int n_handler;
+ xmlBufferPtr out; /* an xmlBuffer for the output. */
+ int n_out;
+ xmlBufferPtr in; /* an xmlBuffer for the input */
+ int n_in;
+
+ for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
+ for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
+ for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
+ mem_base = xmlMemBlocks();
+ handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
+ out = gen_xmlBufferPtr(n_out, 1);
+ in = gen_xmlBufferPtr(n_in, 2);
+
+ ret_val = xmlCharEncInFunc(handler, out, in);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
+ des_xmlBufferPtr(n_out, out, 1);
+ des_xmlBufferPtr(n_in, in, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCharEncInFunc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_handler);
+ printf(" %d", n_out);
+ printf(" %d", n_in);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCharEncOutFunc(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
+ int n_handler;
+ xmlBufferPtr out; /* an xmlBuffer for the output. */
+ int n_out;
+ xmlBufferPtr in; /* an xmlBuffer for the input */
+ int n_in;
+
+ for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
+ for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
+ for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
+ mem_base = xmlMemBlocks();
+ handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
+ out = gen_xmlBufferPtr(n_out, 1);
+ in = gen_xmlBufferPtr(n_in, 2);
+
+ ret_val = xmlCharEncOutFunc(handler, out, in);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
+ des_xmlBufferPtr(n_out, out, 1);
+ des_xmlBufferPtr(n_in, in, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCharEncOutFunc",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_handler);
+ printf(" %d", n_out);
+ printf(" %d", n_in);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCleanupCharEncodingHandlers(void) {
+ int test_ret = 0;
+
+
+
+ xmlCleanupCharEncodingHandlers();
+ call_tests++;
+ xmlResetLastError();
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlCleanupEncodingAliases(void) {
+ int test_ret = 0;
+
+ int mem_base;
+
+ mem_base = xmlMemBlocks();
+
+ xmlCleanupEncodingAliases();
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDelEncodingAlias(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
+ int n_alias;
+
+ for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
+ mem_base = xmlMemBlocks();
+ alias = gen_const_char_ptr(n_alias, 0);
+
+ ret_val = xmlDelEncodingAlias(alias);
+ desret_int(ret_val);
+ call_tests++;
+ des_const_char_ptr(n_alias, alias, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDelEncodingAlias",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_alias);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlDetectCharEncoding(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlCharEncoding ret_val;
+ unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
+ int n_in;
+ int len; /* pointer to the length of the buffer */
+ int n_len;
+
+ for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
+ for (n_len = 0;n_len < gen_nb_int;n_len++) {
+ mem_base = xmlMemBlocks();
+ in = gen_const_unsigned_char_ptr(n_in, 0);
+ len = gen_int(n_len, 1);
+
+ ret_val = xmlDetectCharEncoding(in, len);
+ desret_xmlCharEncoding(ret_val);
+ call_tests++;
+ des_const_unsigned_char_ptr(n_in, in, 0);
+ des_int(n_len, len, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlDetectCharEncoding",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_in);
+ printf(" %d", n_len);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlFindCharEncodingHandler(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlGetCharEncodingHandler(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlGetCharEncodingName(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const char * ret_val;
+ xmlCharEncoding enc; /* the encoding */
+ int n_enc;
+
+ for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
+ mem_base = xmlMemBlocks();
+ enc = gen_xmlCharEncoding(n_enc, 0);
+
+ ret_val = xmlGetCharEncodingName(enc);
+ desret_const_char_ptr(ret_val);
+ call_tests++;
+ des_xmlCharEncoding(n_enc, enc, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlGetCharEncodingName",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_enc);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlGetEncodingAlias(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ const char * ret_val;
+ char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
+ int n_alias;
+
+ for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
+ mem_base = xmlMemBlocks();
+ alias = gen_const_char_ptr(n_alias, 0);
+
+ ret_val = xmlGetEncodingAlias(alias);
+ desret_const_char_ptr(ret_val);
+ call_tests++;
+ des_const_char_ptr(n_alias, alias, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlGetEncodingAlias",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_alias);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlInitCharEncodingHandlers(void) {
+ int test_ret = 0;
+
+
+
+ xmlInitCharEncodingHandlers();
+ call_tests++;
+ xmlResetLastError();
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlNewCharEncodingHandler(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int