From d09ab089457ae3c20cc98f9afa03379c6ebf9598 Mon Sep 17 00:00:00 2001
From: Mike Hommey
Date: Thu, 25 Mar 2004 06:59:32 +0000
Subject: [svn-inject] Installing original source version
---
doc/examples/tree1.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 doc/examples/tree1.c
(limited to 'doc/examples/tree1.c')
diff --git a/doc/examples/tree1.c b/doc/examples/tree1.c
new file mode 100644
index 0000000..8a303e2
--- /dev/null
+++ b/doc/examples/tree1.c
@@ -0,0 +1,94 @@
+/**
+ * section: Tree
+ * synopsis: Navigates a tree to print element names
+ * purpose: Parse a file to a tree, use xmlDocGetRootElement() to
+ * get the root element, then walk the document and print
+ * all the element name in document order.
+ * usage: tree1 filename_or_URL
+ * test: tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp
+ * author: Dodji Seketeli
+ * copy: see Copyright for the status of this software.
+ */
+#include
+#include
+#include
+
+#ifdef LIBXML_TREE_ENABLED
+
+/*
+ *To compile this file using gcc you can type
+ *gcc `xml2-config --cflags --libs` -o xmlexample libxml2-example.c
+ */
+
+/**
+ * print_element_names:
+ * @a_node: the initial xml node to consider.
+ *
+ * Prints the names of the all the xml elements
+ * that are siblings or children of a given xml node.
+ */
+static void
+print_element_names(xmlNode * a_node)
+{
+ xmlNode *cur_node = NULL;
+
+ for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
+ if (cur_node->type == XML_ELEMENT_NODE) {
+ printf("node type: Element, name: %s\n", cur_node->name);
+ }
+
+ print_element_names(cur_node->children);
+ }
+}
+
+
+/**
+ * Simple example to parse a file called "file.xml",
+ * walk down the DOM, and print the name of the
+ * xml elements nodes.
+ */
+int
+main(int argc, char **argv)
+{
+ xmlDoc *doc = NULL;
+ xmlNode *root_element = NULL;
+
+ if (argc != 2)
+ return(1);
+
+ /*
+ * this initialize the library and check potential ABI mismatches
+ * between the version it was compiled for and the actual shared
+ * library used.
+ */
+ LIBXML_TEST_VERSION
+
+ /*parse the file and get the DOM */
+ doc = xmlParseFile(argv[1]);
+
+ if (doc == NULL) {
+ printf("error: could not parse file file.xml\n");
+ }
+
+ /*Get the root element node */
+ root_element = xmlDocGetRootElement(doc);
+
+ print_element_names(root_element);
+
+ /*free the document */
+ xmlFreeDoc(doc);
+
+ /*
+ *Free the global variables that may
+ *have been allocated by the parser.
+ */
+ xmlCleanupParser();
+
+ return 0;
+}
+#else
+int main(void) {
+ fprintf(stderr, "Tree support not compiled in\n");
+ exit(1);
+}
+#endif
--
cgit v1.2.3
From f51dd67f3a3f472af0620391eb588eeca4533689 Mon Sep 17 00:00:00 2001
From: Mike Hommey
Date: Thu, 11 Nov 2004 12:53:54 +0000
Subject: Load /tmp/tmp.n9GTkp/libxml2-2.6.16 into
packages/libxml2/branches/upstream/current.
---
ChangeLog | 244 +
HTMLparser.c | 96 +-
HTMLtree.c | 18 +-
Makefile.am | 18 +-
Makefile.in | 47 +-
NEWS | 17 +-
SAX2.c | 85 +-
catalog.c | 38 +-
chvalid.c | 2 +
config.h.in | 6 +
configure | 77 +-
configure.in | 30 +-
debugXML.c | 27 +-
doc/APIchunk10.html | 6 +-
doc/APIchunk11.html | 1 +
doc/APIchunk12.html | 2 +
doc/APIchunk13.html | 5 +
doc/APIchunk14.html | 3 +-
doc/APIchunk15.html | 21 -
doc/APIchunk16.html | 1 +
doc/APIchunk21.html | 3 +-
doc/APIchunk22.html | 2 +
doc/APIchunk25.html | 2 +
doc/APIchunk26.html | 4 +
doc/APIchunk3.html | 1 +
doc/APIchunk4.html | 3 +-
doc/APIchunk5.html | 1 +
doc/APIchunk6.html | 4 +-
doc/APIchunk8.html | 5 +
doc/APIchunk9.html | 4 +
doc/APIconstructors.html | 2 +-
doc/APIfiles.html | 8 +-
doc/APIsymbols.html | 6 +
doc/apibuild.py | 1 +
doc/examples/examples.xml | 4 +-
doc/examples/reader3.c | 4 +-
doc/examples/testWriter.c | 4 +-
doc/examples/tree1.c | 4 +-
doc/html/libxml-list.html | 4 +-
doc/html/libxml-nanoftp.html | 12 +-
doc/html/libxml-relaxng.html | 5 +-
doc/html/libxml-tree.html | 4 +-
doc/html/libxml-valid.html | 6 +-
doc/html/libxml-xmlIO.html | 2 +-
doc/html/libxml-xmlerror.html | 1 +
doc/html/libxml-xmlmemory.html | 5 +-
doc/html/libxml-xmlstring.html | 6 +-
doc/html/libxml-xmlwriter.html | 4 +-
doc/html/libxml-xpath.html | 1 +
doc/libxml2-api.xml | 71 +-
doc/libxml2.xsa | 29 +-
doc/news.html | 12 +-
doc/xml.html | 16 +-
doc/xmllint.1 | 2 +-
doc/xmllint.xml | 3 +-
elfgcchack.h | 38 +
encoding.c | 65 +-
entities.c | 65 +-
gentest.py | 889 +
include/libxml/catalog.h | 1 +
include/libxml/debugXML.h | 3 +
include/libxml/nanoftp.h | 6 +-
include/libxml/relaxng.h | 8 +-
include/libxml/valid.h | 17 +-
include/libxml/xmlerror.h | 3 +-
include/libxml/xmlmemory.h | 2 +
include/libxml/xmlstring.h | 2 +-
include/libxml/xmlversion.h | 10 +-
include/libxml/xpath.h | 3 +-
include/libxml/xpathInternals.h | 3 +-
libxml2.spec | 6 +-
list.c | 83 +-
nanoftp.c | 43 +-
parser.c | 172 +-
parserInternals.c | 205 +-
python/generator.py | 11 +
python/libxml.c | 139 +-
python/libxml2-py.c | 429 +-
python/libxml_wrap.h | 9 +
python/setup.py | 2 +-
python/tests/Makefile.am | 6 +-
python/tests/Makefile.in | 6 +-
python/tests/dtdvalid.py | 32 +
python/tests/test.dtd | 1 +
python/types.c | 20 +
relaxng.c | 10 +-
testThreads.c | 2 +-
testapi.c | 48623 ++++++++++++++++++++++++++++++++++++++
tree.c | 73 +-
valid.c | 82 +-
win32/libxml2.def.src | 4 +
xinclude.c | 9 +-
xmlIO.c | 40 +-
xmllint.c | 4 +
xmlmemory.c | 20 +
xmlreader.c | 15 +-
xmlregexp.c | 2 +
xmlsave.c | 33 +-
xmlschemas.c | 4 +
xmlschemastypes.c | 16 +-
xmlstring.c | 22 +-
xmlunicode.c | 2 +
xmlwriter.c | 208 +-
xpath.c | 132 +-
xpointer.c | 7 +-
105 files changed, 51976 insertions(+), 600 deletions(-)
create mode 100755 gentest.py
create mode 100755 python/tests/dtdvalid.py
create mode 100644 python/tests/test.dtd
create mode 100644 testapi.c
(limited to 'doc/examples/tree1.c')
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
+
+ * NEWS configure.in doc/*: preparing release of libxml2-2.6.16
+
+Wed Nov 10 12:55:18 CET 2004 Daniel Veillard
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * xpath.c: fixed problem concerning XPath context corruption
+ during function argument evaluation (bug 157652)
+
+Mon Nov 8 18:54:52 CET 2004 Daniel Veillard
+
+ * testapi.c: more types.
+ * parserInternals.c xpath.c: more fixes
+
+Mon Nov 8 18:16:43 CET 2004 Daniel Veillard
+
+ * gentest.py testapi.c: better parser options coverage
+ * SAX2.c xpath.c: more cleanups.
+
+Tue Nov 9 01:50:08 CET 2004 Daniel Veillard
+
+ * testapi.c: trying to fix some optional support brokenness
+
+Mon Nov 8 17:25:27 CET 2004 Daniel Veillard
+
+ * 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
+
+ * gentest.py testapi.c: more coverage
+ * SAX2.c parser.c parserInternals.c: more fixes
+
+Mon Nov 8 12:55:16 CET 2004 Daniel Veillard
+
+ * parser.c testapi.c xmlIO.c xmlstring.c: more fixes.
+
+Mon Nov 8 11:24:57 CET 2004 Daniel Veillard
+
+ * 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
+
+ * gentest.py: fixed test file corruption problem
+
+Sun Nov 7 13:18:05 CET 2004 Daniel Veillard
+
+ * gentest.py testapi.c: fixed typos and avoid Catalogs verbosity
+
+Sat Nov 6 23:25:16 CET 2004 Daniel Veillard
+
+ * testapi.c: augmented the number of types
+
+Sat Nov 6 20:24:07 CET 2004 Daniel Veillard
+
+ * 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
+
+ * 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
+
+ * encoding.c: fixed a regression in iconv support.
+
+Fri Nov 5 18:19:23 CET 2004 Daniel Veillard
+
+ * 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
+
+ * 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
+
+ * gentest.py testapi.c: more coverage
+ * xmlunicode.c: one fix
+
+Fri Nov 5 23:15:51 CET 2004 Daniel Veillard
+
+ * entities.c: fixed a compilation problem on a recent change
+
+Fri Nov 5 12:50:09 CET 2004 Daniel Veillard
+
+ * gentest.py testapi.c: more coverage
+ * nanoftp.c tree.c: more fixes
+
+Fri Nov 5 11:02:28 CET 2004 Daniel Veillard
+
+ * 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
+
+ * parser.c: dohh ... stupid change killing xmlParseDoc()
+
+Thu Nov 4 18:32:22 CET 2004 Daniel Veillard
+
+ * 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
+
+ * gentest.py testapi.c: extending the tests coverage
+
+Thu Nov 4 11:52:28 CET 2004 Daniel Veillard
+
+ * Makefile.am: gentest.py was missing from the EXTRA_DIST
+
+Thu Nov 4 11:48:47 CET 2004 Daniel Veillard
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * 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
+
+ * doc/xmllint.1 doc/xmllint.xml: indicate - means stdin closing #156626
+
+Fri Oct 29 14:03:36 CEST 2004 Daniel Veillard
+
+ * 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
* 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 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
+ #include
+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
+ #include ], [
+ 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 }
xmlInitializePredefinedEntities
xmlNanoFTPRead
xmlNanoHTTPRead
+xmlNewTextWriter
+xmlNewTextWriterPushParser
xmlParseReference
xmlSAXUserParseFile
xmlSAXUserParseMemory
+xmlSaveFileTo
xmlSaveFormatFileTo
xmlSetEntityReferenceFunc
xmlTextReaderCurrentDoc
@@ -290,10 +293,10 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlSaveToIO
xmlTextReaderClose
closedxmlCtxtReadFd
+xmlNewTextWriter
xmlReadFd
xmlReaderForFd
xmlReaderNewFd
-xmlSaveFormatFileTo
xmlTextWriterEndDocument
closesxmlNanoHTTPClose
xmlNanoHTTPSave
@@ -795,6 +798,7 @@ A:link, A:visited, A:active { text-decoration: underline }
curxmlXPathAxisFunc
currentlyXML_SCHEMAS_INCLUDING_CONVERT_NS
xmlGcMemGet
+xmlMemBlocks
xmlMemGet
xmlMemUsed
xmlOutputBufferCreateFilename
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 }
xmlEncodeSpecialChars
xmlGetFeaturesList
xmlHashFree
+xmlNewTextWriter
xmlSaveUri
xmlTextReaderConstBaseUri
xmlTextReaderConstEncoding
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 }
isolat1ToUTF8
xmlCharEncodingInputFunc
xmlCharEncodingOutputFunc
+embeddedXML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
emittedxmlSetGenericErrorFunc
empty-elementxmlParseStartTag
enablexmlCatalogSetDebug
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 }
xmlDocDump
xmlDocFormatDump
xmlFileOpen
+xmlFileRead
xmlListAppend
xmlListInsert
xmlNanoHTTPFetch
@@ -141,6 +142,8 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlCreatePushParserCtxt
xmlUTF8Strpos
fieldXML_COMPLETE_ATTRS
+XML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
XML_DETECT_IDS
XML_SKIP_IDS
xmlParseMisc
@@ -182,6 +185,8 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlNanoHTTPScanProxy
findsxmlSearchNs
xmlSearchNsByHref
+finishDtdXML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
finished_xmlValidCtxt
xmlCleanupParser
xmlSkipBlankChars
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 }
w-w
x-x
y-z
-Letter g:
- garbage
- xmlGcMemGet
+Letter g:
- garanteed
- xmlUTF8Strsize
+ - garbage
- xmlGcMemGet
xmlGcMemSetup
- genChRanges
- xmlIsBaseCharQ
xmlIsBaseChar_ch
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 }
xmlNewPI
xmlSAX2ProcessingInstruction
- insufficient
- xmlCanonicPath
- - int
- _xmlParserCtxt
-c
-getColumnNumber
-getLineNumber
-htmlHandleOmittedElem
-htmlParseCharRef
-xmlIsLetter
-xmlKeepBlanksDefault
-xmlLineNumbersDefault
-xmlMallocAtomicLoc
-xmlMallocLoc
-xmlMemUsed
-xmlParseCharData
-xmlParseCharRef
-xmlPedanticParserDefault
-xmlReallocLoc
-xmlSAX2GetColumnNumber
-xmlSAX2GetLineNumber
-xmlShellCmd
-xmlSplitQName3
-xmlSubstituteEntitiesDefault
- integer
- xmlStrcasecmp
xmlStrcmp
xmlStrncasecmp
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 }
xmlValidateQName
- lib
- xmlCheckVersion
- libc
- DEBUG_MEMORY
+ - libraries
- xmlRelaxNGInitTypes
- library
- _xmlError
_xmlSchema
xmlCleanupParser
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 }
- represented
- xmlParseCharData
xmlXPathStringFunction
- represented:
- _htmlElemDesc
- - representing
- xmlMemUsed
+ - representing
- xmlMemBlocks
+xmlMemUsed
- request
- xmlIOHTTPOpenW
xmlNanoHTTPMethod
xmlNanoHTTPMethodRedir
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 }
xmlXIncludeProcessNode
xmlXIncludeProcessTree
xmlXIncludeProcessTreeFlags
+ - succeed
- xmlNewTextWriter
- succeeded
- xmlHashAddEntry
xmlHashAddEntry2
xmlHashAddEntry3
@@ -734,6 +735,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlHashUpdateEntry3
xmlXPathCompareValues
- succeeds
- xmlCheckFilename
+xmlNewTextWriterPushParser
- successful
- xmlACatalogAdd
xmlACatalogRemove
xmlBufferAdd
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 }
xmlSaveToIO
xmlShellWrite
- writer
- xmlFreeTextWriter
+xmlNewTextWriter
+xmlNewTextWriterPushParser
- writes
- xmlBufferWriteQuotedString
xmlOutputBufferWrite
xmlOutputBufferWriteEscape
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 }
xmlCopyNamespace
xmlCopyNamespaceList
xmlGetNsList
+ - xmlOutputBufferClose
- xmlSaveFileTo
+xmlSaveFormatFileTo
- xmlOutputBufferPtr
- xmlNewTextWriter
- xmlOutputCloseCallback
- xmlRegisterOutputCallbacks
- xmlOutputMatchCallback
- xmlRegisterOutputCallbacks
@@ -292,6 +294,8 @@ A:link, A:visited, A:active { text-decoration: underline }
- xmlParseFile
- xmlParseCatalogFile
- xmlParseNamespace:
- xmlParseNamespace
- xmlParseURI
- xmlURIEscape
+ - xmlParserCtxt
- XML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
- xmlParserCtxtPtr
- xmlNewParserCtxt
xmlNewTextWriterPushParser
- xmlParserError
- _xmlError
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 }
xmlXPathRoot
- Initially
- xmlSubstituteEntitiesDefault
- Initiate
- xmlNanoFTPGetSocket
+ - Initilize
- xmlRelaxNGInitTypes
- Input
- _xmlParserCtxt
xmlIOParseDTD
xmlInputCloseCallback
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 }
xmlNewDocNode
xmlNewDocNodeEatName
xmlNewTextChild
+xmlNewTextWriter
+xmlNewTextWriterPushParser
xmlParseExternalID
xmlParsePEReference
xmlParserHandlePEReference
-xmlSaveFormatFileTo
xmlTextReaderCurrentDoc
- NRK
- _htmlElemDesc
- NSDef
- xmlNamespaceParseNSDef
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 }
- Provides
- getPublicId
getSystemId
xmlGcMemGet
+xmlMemBlocks
xmlMemGet
xmlMemUsed
xmlNanoHTTPContentLength
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 }
xmlXPathNodeSetSort
- SpacingModifierLetters
- xmlUCSIsSpacingModifierLetters
- Spec
- xmlParseStartTag
- - Special
- XML_SAX2_MAGIC
+ - Special
- XML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
+XML_SAX2_MAGIC
- Specials
- xmlUCSIsSpecials
- Speed
- _xmlParserCtxt
- Standalone
- xmlParseSDDecl
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 }
- WWW-Authenticate
- xmlNanoHTTPAuthHeader
- Walk
- xmlListReverseWalk
xmlListWalk
+ - Warning
- xmlSaveFileTo
+xmlSaveFormatFileTo
- Was
- _xmlParserInput
- Well
- xmlParseBalancedChunkMemory
xmlParseBalancedChunkMemoryRecover
@@ -397,6 +399,8 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlNanoFTPFreeCtxt
xmlNanoFTPGetResponse
xmlReconciliateNs
+xmlSaveFileTo
+xmlSaveFormatFileTo
xmlValidGetValidElements
xmlXPathNextFollowing
xmlXPathStringFunction
@@ -637,6 +641,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlReallocLoc
- areas
- xmlGcMemGet
xmlGcMemSetup
+xmlMemBlocks
xmlMemShow
- args
- CHECK_ARITY
x
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 }
xmlNodeSetSpacePreserve
xmlSAX2ResolveEntity
xmlTextReaderSetParserProp
+xmlUTF8Strsize
- below
- _xmlParserCtxt
xmlParseExternalID
- better
- resolveEntity
@@ -162,6 +163,7 @@ A:link, A:visited, A:active { text-decoration: underline }
initdocbDefaultSAXHandler
inithtmlDefaultSAXHandler
initxmlDefaultSAXHandler
+xmlMemBlocks
xmlMemDisplay
xmlMemoryDump
- book1
- xmlBuildRelativeURI
@@ -186,6 +188,8 @@ A:link, A:visited, A:active { text-decoration: underline }
- breaks
- xmlCurrentChar
- broken
- xmlParseBalancedChunkMemoryRecover
xmlTextReaderNormalization
+ - buf
- xmlSaveFileTo
+xmlSaveFormatFileTo
- buffered
- xmlAllocOutputBuffer
xmlAllocParserInputBuffer
xmlFreeParserInputBuffer
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 }
xmlTextReaderConstValue
xmlTextReaderConstXmlLang
xmlTextReaderConstXmlVersion
+xmlUTF8Strpos
xmlXPathNsLookup
Type const xmlParserNodeInfo *:
xmlParserFindNodeInfo
Type docbDocPtr:
docbParseDoc
@@ -233,7 +234,6 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlURIEscape
xmlURIEscapeStr
xmlUTF8Strndup
-xmlUTF8Strpos
xmlUTF8Strsub
xmlValidCtxtNormalizeAttributeValue
xmlValidNormalizeAttributeValue
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 }
xmlRelaxNGFreeValidCtxt
xmlRelaxNGGetParserErrors
xmlRelaxNGGetValidErrors
+xmlRelaxNGInitTypes
xmlRelaxNGNewDocParserCtxt
xmlRelaxNGNewMemParserCtxt
xmlRelaxNGNewParserCtxt
@@ -1433,7 +1434,9 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlURIEscapeStr
xmlURIPtr
xmlURIUnescapeString
-
_xmlValidCtxt
+
XML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
+_xmlValidCtxt
xmlAddAttributeDecl
xmlAddElementDecl
xmlAddID
@@ -1856,6 +1859,7 @@ A:link, A:visited, A:active { text-decoration: underline }
XML_FROM_SCHEMASV
XML_FROM_TREE
XML_FROM_VALID
+XML_FROM_WRITER
XML_FROM_XINCLUDE
XML_FROM_XPATH
XML_FROM_XPOINTER
@@ -2407,6 +2411,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlMallocAtomicLoc
xmlMallocFunc
xmlMallocLoc
+xmlMemBlocks
xmlMemDisplay
xmlMemFree
xmlMemGet
@@ -2964,6 +2969,7 @@ A:link, A:visited, A:active { text-decoration: underline }
XPATH_EXPR_ERROR
XPATH_INVALID_ARITY
XPATH_INVALID_CHAR_ERROR
+XPATH_INVALID_CTXT
XPATH_INVALID_CTXT_POSITION
XPATH_INVALID_CTXT_SIZE
XPATH_INVALID_OPERAND
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 }
XML_CHECK_X
XML_COMMENT_NODE
XML_COMPLETE_ATTRS
+XML_CTXT_FINISH_DTD_0
+XML_CTXT_FINISH_DTD_1
XML_DEFAULT_VERSION
XML_DETECT_IDS
XML_DOCB_DOCUMENT_NODE
@@ -413,6 +415,7 @@ A:link, A:visited, A:active { text-decoration: underline }
XML_FROM_SCHEMASV
XML_FROM_TREE
XML_FROM_VALID
+XML_FROM_WRITER
XML_FROM_XINCLUDE
XML_FROM_XPATH
XML_FROM_XPOINTER
@@ -1251,6 +1254,7 @@ A:link, A:visited, A:active { text-decoration: underline }
XPATH_EXPR_ERROR
XPATH_INVALID_ARITY
XPATH_INVALID_CHAR_ERROR
+XPATH_INVALID_CTXT
XPATH_INVALID_CTXT_POSITION
XPATH_INVALID_CTXT_SIZE
XPATH_INVALID_OPERAND
@@ -2022,6 +2026,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlMallocAtomicLoc
xmlMallocFunc
xmlMallocLoc
+xmlMemBlocks
xmlMemDisplay
xmlMemFree
xmlMemGet
@@ -2364,6 +2369,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlRelaxNGFreeValidCtxt
xmlRelaxNGGetParserErrors
xmlRelaxNGGetValidErrors
+xmlRelaxNGInitTypes
xmlRelaxNGNewDocParserCtxt
xmlRelaxNGNewMemParserCtxt
xmlRelaxNGNewParserCtxt
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 @@
-
+
@@ -567,7 +567,6 @@
-
@@ -576,6 +575,7 @@
+
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
#include
-#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 (xmlLinkPtr l
Duplicate the list
old: | the list |
Returns: | a new copy of the list or NULL in case of error |
Function: xmlListEmpty
int xmlListEmpty (xmlListPtr l)
Is the list empty ?
-l: | a list |
Returns: | 1 if the list is empty, 0 otherwise |
Function: xmlListEnd
xmlLinkPtr xmlListEnd (xmlListPtr l)
+l: | a list |
Returns: | 1 if the list is empty, 0 if not empty and -1 in case of error |
Function: xmlListEnd
xmlLinkPtr xmlListEnd (xmlListPtr l)
Get the last element in the list
l: | a list |
Returns: | the last element in the list, or NULL |
Function: xmlListFront
xmlLinkPtr xmlListFront (xmlListPtr l)
Get the first element in the list
@@ -110,7 +110,7 @@ void xmlListDeallocator (xmlLinkPtr l
Search the list for an existing value of @data
l: | a list |
data: | a search value |
Returns: | the value associated to @data or NULL in case of error |
Function: xmlListSize
int xmlListSize (xmlListPtr l)
Get the number of elements in the list
-l: | a list |
Returns: | the number of elements in the list |
Function: xmlListSort
void xmlListSort (xmlListPtr l)
+l: | a list |
Returns: | the number of elements in the list or -1 in case of error |
Function: xmlListSort
void xmlListSort (xmlListPtr l)
Sort all the elements in the list
Function: xmlListWalk
void xmlListWalk (xmlListPtr l,
xmlListWalker walker,
const void * user)
Walk all the element of the first from first to last and apply the walker function to it
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 ftpListCallback (void * userData,
int xmlNanoFTPCloseConnection (void * ctx)
int xmlNanoFTPConnect (void * ctx)
void * xmlNanoFTPConnectTo (const char * server,
int port)
-int xmlNanoFTPCwd (void * ctx,
char * directory)
-int xmlNanoFTPDele (void * ctx,
char * file)
+int xmlNanoFTPCwd (void * ctx,
const char * directory)
+int xmlNanoFTPDele (void * ctx,
const char * file)
void xmlNanoFTPFreeCtxt (void * ctx)
int xmlNanoFTPGet (void * ctx,
ftpDataCallback callback,
void * userData,
const char * filename)
int xmlNanoFTPGetConnection (void * ctx)
int xmlNanoFTPGetResponse (void * ctx)
int xmlNanoFTPGetSocket (void * ctx,
const char * filename)
void xmlNanoFTPInit (void)
-int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
char * filename)
+int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
const char * filename)
void * xmlNanoFTPNewCtxt (const char * URL)
void * xmlNanoFTPOpen (const char * URL)
void xmlNanoFTPProxy (const char * host,
int port,
const char * user,
const char * passwd,
int type)
@@ -57,9 +57,9 @@ void ftpListCallback (void * userData,
const char * filename,
Tries to open a control connection
ctx: | an FTP context |
Returns: | -1 in case of error, 0 otherwise |
Function: xmlNanoFTPConnectTo
void * xmlNanoFTPConnectTo (const char * server,
int port)
Tries to open a control connection to the given server/port
-server: | an FTP server name |
port: | the port (use 21 if 0) |
Returns: | an fTP context or NULL if it failed |
Function: xmlNanoFTPCwd
int xmlNanoFTPCwd (void * ctx,
char * directory)
+server: | an FTP server name |
port: | the port (use 21 if 0) |
Returns: | an fTP context or NULL if it failed |
Function: xmlNanoFTPCwd
int xmlNanoFTPCwd (void * ctx,
const char * directory)
Tries to change the remote directory
-ctx: | an FTP context |
directory: | a directory on the server |
Returns: | -1 incase of error, 1 if CWD worked, 0 if it failed |
Function: xmlNanoFTPDele
int xmlNanoFTPDele (void * ctx,
char * file)
+ctx: | an FTP context |
directory: | a directory on the server |
Returns: | -1 incase of error, 1 if CWD worked, 0 if it failed |
Function: xmlNanoFTPDele
int xmlNanoFTPDele (void * ctx,
const char * file)
Tries to delete an item (file or directory) from server
ctx: | an FTP context |
file: | a file or directory on the server |
Returns: | -1 incase of error, 1 if DELE worked, 0 if it failed |
Function: xmlNanoFTPFreeCtxt
void xmlNanoFTPFreeCtxt (void * ctx)
Frees the context after closing the connection.
@@ -73,7 +73,7 @@ void ftpListCallback (void * userData,
const char * filename,
Initiate fetch of the given file from the server.
ctx: | an FTP context |
filename: | the file to retrieve (or NULL if path is in context). |
Returns: | the socket for the data connection, or <0 in case of error |
Function: xmlNanoFTPInit
void xmlNanoFTPInit (void)
Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname
-Function: xmlNanoFTPList
int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
char * filename)
+Function: xmlNanoFTPList
int xmlNanoFTPList (void * ctx,
ftpListCallback callback,
void * userData,
const char * filename)
Do a listing on the server. All files info are passed back in the callbacks.
ctx: | an FTP context |
callback: | the user callback |
userData: | the user callback data |
filename: | optional files to list |
Returns: | -1 incase of error, 0 otherwise |
Function: xmlNanoFTPNewCtxt
void * xmlNanoFTPNewCtxt (const char * URL)
Allocate and initialize a new FTP context.
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.
void xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt)
int xmlRelaxNGGetParserErrors (xmlRelaxNGParserCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc * err,
xmlRelaxNGValidityWarningFunc * warn,
void ** ctx)
int xmlRelaxNGGetValidErrors (xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc * err,
xmlRelaxNGValidityWarningFunc * warn,
void ** ctx)
+int xmlRelaxNGInitTypes (void)
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc)
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewMemParserCtxt (const char * buffer,
int size)
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewParserCtxt (const char * URL)
@@ -118,7 +119,9 @@ The content of this structure is not made public by the API.
Get the callback information used to handle errors for a validation context
ctxt: | a Relax-NG validation context |
err: | the error callback result |
warn: | the warning callback result |
ctx: | contextual data for the callbacks result |
Returns: | -1 in case of failure, 0 otherwise. |
Function: xmlRelaxNGGetValidErrors
int xmlRelaxNGGetValidErrors (xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc * err,
xmlRelaxNGValidityWarningFunc * warn,
void ** ctx)
Get the error and warning callback informations
-ctxt: | a Relax-NG validation context |
err: | the error function result |
warn: | the warning function result |
ctx: | the functions context result |
Returns: | -1 in case of error and 0 otherwise |
Function: xmlRelaxNGNewDocParserCtxt
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc)
+ctxt: | a Relax-NG validation context |
err: | the error function result |
warn: | the warning function result |
ctx: | the functions context result |
Returns: | -1 in case of error and 0 otherwise |
Function: xmlRelaxNGInitTypes
int xmlRelaxNGInitTypes (void)
+
Initilize the default type libraries.
+Returns: | 0 in case of success and -1 in case of error. |
Function: xmlRelaxNGNewDocParserCtxt
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc)
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.
doc: | a preparsed document tree |
Returns: | the parser context or NULL in case of error |
Function: xmlRelaxNGNewMemParserCtxt
xmlRelaxNGParserCtxtPtr xmlRelaxNGNewMemParserCtxt (const char * buffer,
int size)
Create an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file.
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 }
filename: | the filename (or URL) |
cur: | the document |
Returns: | the number of bytes written or -1 in case of failure. |
Function: xmlSaveFileEnc
int xmlSaveFileEnc (const char * filename,
xmlDocPtr cur,
const char * encoding)
Dump an XML document, converting it to the given encoding
filename: | the filename (or URL) |
cur: | the document |
encoding: | the name of an encoding (or NULL) |
Returns: | the number of bytes written or -1 in case of failure. |
Function: xmlSaveFileTo
int xmlSaveFileTo (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding)
-
Dump an XML document to an I/O buffer.
+
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.
buf: | an output I/O buffer |
cur: | the document |
encoding: | the encoding if any assuming the I/O layer handles the trancoding |
Returns: | the number of bytes written or -1 in case of failure. |
Function: xmlSaveFormatFile
int xmlSaveFormatFile (const char * filename,
xmlDocPtr cur,
int format)
Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called
filename: | the filename (or URL) |
cur: | the document |
format: | should formatting spaces been added |
Returns: | the number of bytes written or -1 in case of failure. |
Function: xmlSaveFormatFileEnc
int xmlSaveFormatFileEnc (const char * filename,
xmlDocPtr cur,
const char * encoding,
int format)
Dump an XML document to a file or an URL.
filename: | the filename or URL to output |
cur: | the document being saved |
encoding: | the name of the encoding to use or NULL. |
format: | should formatting spaces be added. |
Returns: | the number of bytes written or -1 in case of error. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called |
Function: xmlSaveFormatFileTo
int xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
xmlDocPtr cur,
const char * encoding,
int format)
-
Dump an XML document to an I/O buffer. NOTE: the I/O buffer is closed as part of the call.
+
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call.
buf: | an output I/O buffer |
cur: | the document |
encoding: | the encoding if any assuming the I/O layer handles the trancoding |
format: | should formatting spaces been added |
Returns: | the number of bytes written or -1 in case of failure. |
Function: xmlSearchNs
xmlNsPtr xmlSearchNs (xmlDocPtr doc,
xmlNodePtr node,
const xmlChar * nameSpace)
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.
doc: | the document |
node: | the current node |
nameSpace: | the namespace prefix |
Returns: | the namespace pointer or NULL. |
Function: xmlSearchNsByHref
xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
xmlNodePtr node,
const xmlChar * href)
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 }
Module valid from libxml2
 |    | Module valid from libxml2 |
|
|
| API for the DTD handling and the validity checking Table of ContentsStructure xmlAttributeTable struct _xmlHashTable
+ Module valid from libxml2  |    | Module valid from libxml2 |
|
|
| API for the DTD handling and the validity checking Table of Contents#define XML_CTXT_FINISH_DTD_0 #define XML_CTXT_FINISH_DTD_1 Structure xmlAttributeTable struct _xmlHashTable
The content of this structure is not made public by the API.
Typedef xmlAttributeTable * xmlAttributeTablePtr
Structure xmlElementTable struct _xmlHashTable
@@ -104,6 +104,8 @@ void xmlValidityErrorFunc (void * ctx, xmlValidityWarningFunc (void * ctx, const char * msg, ... ...)
Description
+Macro: XML_CTXT_FINISH_DTD_0#define XML_CTXT_FINISH_DTD_0 Special value for finishDtd field when embedded in an xmlParserCtxt
+Macro: XML_CTXT_FINISH_DTD_1#define XML_CTXT_FINISH_DTD_1 Special value for finishDtd field when embedded in an xmlParserCtxt
Structure xmlAttributeTable struct _xmlHashTable {
The content of this structure is not made public by the API.
} Structure xmlElementTable 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
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 state s
xmlValidState * 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 xmlOutputWriteCallback (void * contex
Wrapper around xmlFileOpen_real that try it with an unescaped version of @filename, if this fails fallback to @filename
filename: | the URI for matching | Returns: | a handler or NULL in case or failure |
Function: xmlFileReadint xmlFileRead (void * context, char * buffer, int len)
Read @len bytes to @buffer from the I/O channel.
-context: | the I/O context | buffer: | where to drop data | len: | number of bytes to write | Returns: | the number of bytes written |
Function: xmlFreeParserInputBuffervoid xmlFreeParserInputBuffer (xmlParserInputBufferPtr in)
+context: | the I/O context | buffer: | where to drop data | len: | number of bytes to write | Returns: | the number of bytes written or < 0 in case of failure |
Function: xmlFreeParserInputBuffervoid xmlFreeParserInputBuffer (xmlParserInputBufferPtr in)
Free up the memory used by a buffered parser input
in: | a buffered parser input |
Function: xmlIOFTPCloseint xmlIOFTPClose (void * context)
Close an FTP I/O channel
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 xmlStructuredErrorFunc (void * userD
XML_FROM_XSLT = 22 : The XSLT engine from libxslt
XML_FROM_VALID = 23 : The XML DTD validation with valid context
XML_FROM_CHECK = 24 : The error checking module
+ XML_FROM_WRITER = 25 : The xmlwriter module
}
Enum xmlErrorLevel {
XML_ERR_NONE = 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 xmlFreeFunc (void * mem)
void * xmlMallocFunc (size_t size)
void * xmlMallocLoc (size_t size, const char * file, int line)
+int xmlMemBlocks (void)
void xmlMemDisplay (FILE * fp)
void xmlMemFree (void * ptr)
int xmlMemGet (xmlFreeFunc * freeFunc, xmlMallocFunc * mallocFunc, xmlReallocFunc * reallocFunc, xmlStrdupFunc * strdupFunc)
@@ -68,7 +69,9 @@ void * xmlMallocFunc (size_t size)
Signature for a malloc() implementation. size: | the size requested in bytes | Returns: | a pointer to the newly allocated block or NULL in case of error. |
Function: xmlMallocLocvoid * xmlMallocLoc (size_t size, const char * file, int line)
a malloc() equivalent, with logging of the allocation info.
-size: | an int specifying the size in byte to allocate. | file: | the file name or NULL | line: | the line number | Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
Function: xmlMemDisplayvoid xmlMemDisplay (FILE * fp)
+size: | an int specifying the size in byte to allocate. | file: | the file name or NULL | line: | the line number | Returns: | a pointer to the allocated area or NULL in case of lack of memory. |
Function: xmlMemBlocksint xmlMemBlocks (void)
+ Provides the number of memory areas currently allocated
+Returns: | an int representing the number of blocks |
Function: xmlMemDisplayvoid xmlMemDisplay (FILE * fp)
show in-extenso the memory blocks allocated
fp: | a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist |
Function: xmlMemFreevoid xmlMemFree (void * ptr)
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 }
int xmlUTF8Strlen (const xmlChar * utf)
int xmlUTF8Strloc (const xmlChar * utf, const xmlChar * utfchar)
xmlChar * xmlUTF8Strndup (const xmlChar * utf, int len)
-xmlChar * xmlUTF8Strpos (const xmlChar * utf, int pos)
+const xmlChar * xmlUTF8Strpos (const xmlChar * utf, int pos)
int xmlUTF8Strsize (const xmlChar * utf, int len)
xmlChar * xmlUTF8Strsub (const xmlChar * utf, int start, int len)
Description
@@ -97,10 +97,10 @@ A:link, A:visited, A:active { text-decoration: underline }
a function to provide the relative location of a UTF8 char
utf: | the input UTF8 * | utfchar: | the UTF8 character to be found | Returns: | the relative character position of the desired char or -1 if not found |
Function: xmlUTF8StrndupxmlChar * xmlUTF8Strndup (const xmlChar * utf, int len)
a strndup for array of UTF8's
-utf: | the input UTF8 * | len: | the len of @utf (in chars) | Returns: | a new UTF8 * or NULL |
Function: xmlUTF8StrposxmlChar * xmlUTF8Strpos (const xmlChar * utf, int pos)
+utf: | the input UTF8 * | len: | the len of @utf (in chars) | Returns: | a new UTF8 * or NULL |
Function: xmlUTF8Strposconst xmlChar * xmlUTF8Strpos (const xmlChar * utf, int pos)
a function to provide the equivalent of fetching a character from a string array
utf: | the input UTF8 * | pos: | the position of the desired UTF8 char (in chars) | Returns: | a pointer to the UTF8 character or NULL |
Function: xmlUTF8Strsizeint xmlUTF8Strsize (const xmlChar * utf, int len)
- storage size of an UTF8 string
+ storage size of an UTF8 string the behaviour is not garanteed if the input string is not UTF-8
utf: | a sequence of UTF-8 encoded bytes | len: | the number of characters in the array | Returns: | the storage size of the first 'len' characters of ARRAY |
Function: xmlUTF8StrsubxmlChar * xmlUTF8Strsub (const xmlChar * utf, int start, int len)
Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars
utf: | a sequence of UTF-8 encoded bytes | start: | relative pos of first char | len: | total number to copy | Returns: | a pointer to a newly created string or NULL if any problem |
Daniel Veillard |
|
|
|
|
|
|
|
|
|