From 17049f05f9ef09b3dc2a9c5d1de3f21de7c03193 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 13 Sep 2005 09:58:33 +0000 Subject: Load /tmp/tmp.2Zlqcz/libxml2-2.6.22 into packages/libxml2/branches/upstream/current. --- doc/devhelp/libxml2-xmlsave.html | 124 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 doc/devhelp/libxml2-xmlsave.html (limited to 'doc/devhelp/libxml2-xmlsave.html') diff --git a/doc/devhelp/libxml2-xmlsave.html b/doc/devhelp/libxml2-xmlsave.html new file mode 100644 index 0000000..0c416f4 --- /dev/null +++ b/doc/devhelp/libxml2-xmlsave.html @@ -0,0 +1,124 @@ + + + + + xmlsave: the XML document serializer + + + + + + + + + + + + + + + + +

+ xmlsave +

+

xmlsave - the XML document serializer

+

API to save document or subtree of document

+

Author(s): Daniel Veillard

+
+

Synopsis

+
typedef enum xmlSaveOption;
+typedef struct _xmlSaveCtxt xmlSaveCtxt;
+typedef xmlSaveCtxt * xmlSaveCtxtPtr;
+xmlSaveCtxtPtr	xmlSaveToIO		(xmlOutputWriteCallback iowrite, 
xmlOutputCloseCallback ioclose,
void * ioctx,
const char * encoding,
int options); +xmlSaveCtxtPtr xmlSaveToFd (int fd,
const char * encoding,
int options); +int xmlSaveClose (xmlSaveCtxtPtr ctxt); +int xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
xmlCharEncodingOutputFunc escape); +xmlSaveCtxtPtr xmlSaveToFilename (const char * filename,
const char * encoding,
int options); +int xmlSaveFlush (xmlSaveCtxtPtr ctxt); +long xmlSaveDoc (xmlSaveCtxtPtr ctxt,
xmlDocPtr doc); +int xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
xmlCharEncodingOutputFunc escape); +long xmlSaveTree (xmlSaveCtxtPtr ctxt,
xmlNodePtr node); +
+
+
+

Description

+
+
+

Details

+
+

Structure xmlSaveCtxt

struct _xmlSaveCtxt {
+The content of this structure is not made public by the API.
+} xmlSaveCtxt;
+

+

+
+

Typedef xmlSaveCtxtPtr

xmlSaveCtxt * xmlSaveCtxtPtr;
+

+

+
+

Enum xmlSaveOption

enum xmlSaveOption {
+    XML_SAVE_FORMAT = 1 /* format save output */
+    XML_SAVE_NO_DECL = 2 /* drop the xml declaration */
+    XML_SAVE_NO_EMPTY = 4 /* no empty tags */
+    XML_SAVE_NO_XHTML = 8 /*  disable XHTML1 specific rules */
+};
+

+

+
+

xmlSaveClose ()

int	xmlSaveClose			(xmlSaveCtxtPtr ctxt)
+

Close a document saving context, i.e. make sure that all bytes have been output and free the associated data.

+
ctxt:a document saving context
Returns:the number of byte written or -1 in case of error.
+
+

xmlSaveDoc ()

long	xmlSaveDoc			(xmlSaveCtxtPtr ctxt, 
xmlDocPtr doc)
+

Save a full document to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead

+
ctxt:a document saving context
doc:a document
Returns:the number of byte written or -1 in case of error
+
+

xmlSaveFlush ()

int	xmlSaveFlush			(xmlSaveCtxtPtr ctxt)
+

Flush a document saving context, i.e. make sure that all bytes have been output.

+
ctxt:a document saving context
Returns:the number of byte written or -1 in case of error.
+
+

xmlSaveSetAttrEscape ()

int	xmlSaveSetAttrEscape		(xmlSaveCtxtPtr ctxt, 
xmlCharEncodingOutputFunc escape)
+

Set a custom escaping function to be used for text in attribute content

+
ctxt:a document saving context
escape:the escaping function
Returns:0 if successful or -1 in case of error.
+
+

xmlSaveSetEscape ()

int	xmlSaveSetEscape		(xmlSaveCtxtPtr ctxt, 
xmlCharEncodingOutputFunc escape)
+

Set a custom escaping function to be used for text in element content

+
ctxt:a document saving context
escape:the escaping function
Returns:0 if successful or -1 in case of error.
+
+

xmlSaveToFd ()

xmlSaveCtxtPtr	xmlSaveToFd		(int fd, 
const char * encoding,
int options)
+

Create a document saving context serializing to a file descriptor with the encoding and the options given.

+
fd:a file descriptor number
encoding:the encoding name to use or NULL
options:a set of xmlSaveOptions
Returns:a new serialization context or NULL in case of error.
+
+

xmlSaveToFilename ()

xmlSaveCtxtPtr	xmlSaveToFilename	(const char * filename, 
const char * encoding,
int options)
+

Create a document saving context serializing to a filename or possibly to an URL (but this is less reliable) with the encoding and the options given.

+
filename:a file name or an URL
encoding:the encoding name to use or NULL
options:a set of xmlSaveOptions
Returns:a new serialization context or NULL in case of error.
+
+

xmlSaveToIO ()

xmlSaveCtxtPtr	xmlSaveToIO		(xmlOutputWriteCallback iowrite, 
xmlOutputCloseCallback ioclose,
void * ioctx,
const char * encoding,
int options)
+

Create a document saving context serializing to a file descriptor with the encoding and the options given

+
iowrite:an I/O write function
ioclose:an I/O close function
ioctx:an I/O handler
encoding:the encoding name to use or NULL
options:a set of xmlSaveOptions
Returns:a new serialization context or NULL in case of error.
+
+

xmlSaveTree ()

long	xmlSaveTree			(xmlSaveCtxtPtr ctxt, 
xmlNodePtr node)
+

Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead

+
ctxt:a document saving context
node:a document
Returns:the number of byte written or -1 in case of error
+
+
+
+ + -- cgit v1.2.3 From 0fd83af441e251fc23fc1af7959fd6ecfa105fe1 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 6 Jan 2006 18:28:17 +0100 Subject: Load /tmp/tmp.U9vXwU/libxml2-2.6.23 into local/libxml2/branches/upstream/current. --- ChangeLog | 540 ++ HTMLparser.c | 11 +- HTMLtree.c | 22 +- Makefile.am | 2 +- Makefile.in | 2 +- NEWS | 332 +- SAX2.c | 4 + c14n.c | 2 +- config.h.in | 18 +- configure | 615 +- configure.in | 65 +- doc/APIchunk0.html | 8 +- doc/APIchunk1.html | 1 + doc/APIchunk10.html | 19 +- doc/APIchunk11.html | 10 +- doc/APIchunk12.html | 28 +- doc/APIchunk13.html | 14 +- doc/APIchunk14.html | 42 +- doc/APIchunk15.html | 17 +- doc/APIchunk16.html | 7 +- doc/APIchunk17.html | 12 +- doc/APIchunk18.html | 5 +- doc/APIchunk19.html | 7 +- doc/APIchunk2.html | 10 +- doc/APIchunk20.html | 10 +- doc/APIchunk21.html | 20 +- doc/APIchunk22.html | 47 +- doc/APIchunk23.html | 22 +- doc/APIchunk24.html | 28 +- doc/APIchunk25.html | 7 +- doc/APIchunk26.html | 5 +- doc/APIchunk27.html | 3 - doc/APIchunk28.html | 13 +- doc/APIchunk29.html | 1 + doc/APIchunk3.html | 1 + doc/APIchunk4.html | 4 + doc/APIchunk5.html | 9 +- doc/APIchunk6.html | 7 +- doc/APIchunk7.html | 5 +- doc/APIchunk8.html | 9 +- doc/APIchunk9.html | 10 +- doc/APIconstructors.html | 4 +- doc/APIfiles.html | 17 + doc/APIfunctions.html | 14 + doc/APIsymbols.html | 17 + doc/FAQ.html | 63 +- doc/Makefile.am | 1 - doc/Makefile.in | 1 - doc/XMLinfo.html | 2 +- doc/XSLT.html | 2 +- doc/bugs.html | 2 +- doc/catalog.html | 2 +- doc/contribs.html | 8 +- doc/devhelp/libxml2-HTMLtree.html | 9 +- doc/devhelp/libxml2-pattern.html | 14 +- doc/devhelp/libxml2-relaxng.html | 2 +- doc/devhelp/libxml2-schemasInternals.html | 145 +- doc/devhelp/libxml2-tree.html | 2 +- doc/devhelp/libxml2-valid.html | 6 +- doc/devhelp/libxml2-xmlIO.html | 7 +- doc/devhelp/libxml2-xmlerror.html | 5 + doc/devhelp/libxml2-xmlreader.html | 9 +- doc/devhelp/libxml2-xmlregexp.html | 12 +- doc/devhelp/libxml2-xmlsave.html | 5 + doc/devhelp/libxml2-xmlschemas.html | 73 +- doc/devhelp/libxml2-xmlstring.html | 8 +- doc/devhelp/libxml2.devhelp | 17 + doc/downloads.html | 9 +- doc/encoding.html | 16 +- doc/examples/Makefile.am | 104 +- doc/examples/Makefile.in | 102 +- doc/examples/examples.xml | 418 +- doc/help.html | 2 +- doc/html/libxml-HTMLtree.html | 5 +- doc/html/libxml-pattern.html | 12 +- doc/html/libxml-relaxng.html | 2 +- doc/html/libxml-schemasInternals.html | 127 +- doc/html/libxml-tree.html | 2 +- doc/html/libxml-valid.html | 6 +- doc/html/libxml-xmlIO.html | 5 +- doc/html/libxml-xmlerror.html | 5 + doc/html/libxml-xmlreader.html | 7 +- doc/html/libxml-xmlregexp.html | 10 +- doc/html/libxml-xmlsave.html | 5 +- doc/html/libxml-xmlschemas.html | 69 +- doc/html/libxml-xmlstring.html | 8 +- doc/index.html | 6 +- doc/intro.html | 2 +- doc/libxml2-api.xml | 384 +- doc/libxml2.xsa | 52 +- doc/namespaces.html | 2 +- doc/news.html | 332 +- doc/python.html | 15 +- doc/site.xsl | 2 +- doc/xml.html | 492 +- doc/xmldtd.html | 2 +- doc/xmlreader.html | 4 +- elfgcchack.h | 64 +- error.c | 19 +- gentest.py | 1 + include/libxml/HTMLtree.h | 5 + include/libxml/pattern.h | 7 + include/libxml/schemasInternals.h | 177 +- include/libxml/valid.h | 2 +- include/libxml/xmlIO.h | 4 + include/libxml/xmlerror.h | 5 + include/libxml/xmlreader.h | 9 + include/libxml/xmlregexp.h | 4 +- include/libxml/xmlsave.h | 4 +- include/libxml/xmlschemas.h | 7 +- include/libxml/xmlversion.h | 10 +- include/libxml/xmlversion.h.in | 2 +- include/win32config.h | 4 +- include/wsockcompat.h | 12 + legacy.c | 1 - libxml.3 | 2 +- libxml.spec.in | 30 - libxml2.spec | 36 +- macos/src/config-mac.h | 9 - nanohttp.c | 142 +- parser.c | 43 +- parserInternals.c | 62 +- pattern.c | 517 +- python/libxml.py | 3 +- python/libxml2-py.c | 98 +- python/setup.py | 2 +- relaxng.c | 1 - result/HTML/53867.html | 66 + result/HTML/53867.html.err | 0 result/HTML/53867.html.sax | 26 + result/XPath/tests/nodespat | 94 + result/c14n/exc-without-comments/test-2 | 11 + result/noent/ns7 | 2 + result/ns7 | 2 + result/ns7.rde | 1 + result/ns7.rdr | 1 + result/ns7.sax | 5 + result/ns7.sax2 | 5 + result/regexp/* | 1 - result/regexp/hard | 5 + result/schemas/bug303566_1_1.err | 2 +- result/schemas/bug312957_1_0.err | 2 +- result/schemas/bug321475_1_0 | 1 + result/schemas/bug321475_1_0.err | 0 result/schemas/bug322411_1_0 | 1 + result/schemas/bug322411_1_0.err | 0 result/schemas/bug323510_1_0 | 1 + result/schemas/bug323510_1_0.err | 1 + result/schemas/decimal-1_1_0 | 1 + result/schemas/decimal-1_1_0.err | 8 + result/schemas/decimal-2_1_0 | 1 + result/schemas/decimal-2_1_0.err | 4 + result/schemas/decimal-3_1_0 | 1 + result/schemas/decimal-3_1_0.err | 8 + result/schemas/derivation-ok-extension-err_0_0.err | 2 +- result/schemas/derivation-ok-extension_0_0.err | 2 +- .../derivation-ok-restriction-2-1-1_0_0.err | 12 +- .../derivation-ok-restriction-4-1-err_0_0.err | 6 +- result/schemas/element-err_0_0.err | 22 +- result/schemas/idc-keyref-err1_1_0 | 1 + result/schemas/idc-keyref-err1_1_0.err | 1 + result/schemas/include3_0_0.err | 2 +- result/schemas/restriction-attr1_0_0.err | 2 +- result/schemas/scc-no-xmlns_0_0.err | 2 +- result/schemas/scc-no-xsi_0_0.err | 2 +- result/schemas/src-attribute1_0_0.err | 2 +- result/schemas/src-attribute2_0_0.err | 2 +- result/schemas/src-attribute3-1_0_0.err | 2 +- result/schemas/src-attribute3-2-form_0_0.err | 2 +- result/schemas/src-attribute3-2-st_0_0.err | 2 +- result/schemas/src-attribute3-2-type_0_0.err | 2 +- result/schemas/src-attribute4_0_0.err | 2 +- result/schemas/src-element1_0_0.err | 2 +- result/schemas/src-element3_0_0.err | 4 +- runsuite.c | 53 +- runtest.c | 18 +- schematron.c | 6 +- test/HTML/53867.html | 69 + test/XPath/docs/nodes | 2 + test/XPath/tests/nodespat | 5 + test/c14n/exc-without-comments/test-2.xml | 20 + test/c14n/exc-without-comments/test-2.xpath | 6 + test/ns7 | 1 + test/regexp/hard | 5 + test/schemas/bug321475_0.xml | 10 + test/schemas/bug321475_1.xsd | 48 + test/schemas/bug322411_0.xml | 93 + test/schemas/bug322411_1.xsd | 35 + test/schemas/bug323510_0.xml | 3 + test/schemas/bug323510_1.xsd | 12 + test/schemas/decimal-1.xml | 37 + test/schemas/decimal-1.xsd | 29 + test/schemas/decimal-1_0.xml | 24 + test/schemas/decimal-1_1.xsd | 19 + test/schemas/decimal-2_0.xml | 14 + test/schemas/decimal-2_1.xsd | 18 + test/schemas/decimal-3_0.xml | 17 + test/schemas/decimal-3_1.xsd | 18 + test/schemas/idc-keyref-err1_0.xml | 14 + test/schemas/idc-keyref-err1_1.xsd | 53 + testapi.c | 446 +- tree.c | 95 +- uri.c | 144 +- valid.c | 23 +- vms/config.vms | 9 - win32/Makefile.mingw | 4 +- win32/Makefile.mingw.orig | 336 + win32/Makefile.mingw.rej | 17 + win32/configure.js | 8 + win32/libxml2.def.src | 9 + xmlIO.c | 55 +- xmlmodule.c | 9 +- xmlreader.c | 211 +- xmlregexp.c | 517 +- xmlsave.c | 47 +- xmlschemas.c | 9553 ++++++++++++-------- xmlschemastypes.c | 166 +- xmlstring.c | 14 +- xmlwriter.c | 75 +- xpath.c | 97 +- 220 files changed, 12466 insertions(+), 6252 deletions(-) create mode 100644 result/HTML/53867.html create mode 100644 result/HTML/53867.html.err create mode 100644 result/HTML/53867.html.sax create mode 100644 result/XPath/tests/nodespat create mode 100644 result/c14n/exc-without-comments/test-2 create mode 100644 result/noent/ns7 create mode 100644 result/ns7 create mode 100644 result/ns7.rde create mode 100644 result/ns7.rdr create mode 100644 result/ns7.sax create mode 100644 result/ns7.sax2 delete mode 100644 result/regexp/* create mode 100644 result/schemas/bug321475_1_0 create mode 100644 result/schemas/bug321475_1_0.err create mode 100644 result/schemas/bug322411_1_0 create mode 100644 result/schemas/bug322411_1_0.err create mode 100644 result/schemas/bug323510_1_0 create mode 100644 result/schemas/bug323510_1_0.err create mode 100644 result/schemas/decimal-1_1_0 create mode 100644 result/schemas/decimal-1_1_0.err create mode 100644 result/schemas/decimal-2_1_0 create mode 100644 result/schemas/decimal-2_1_0.err create mode 100644 result/schemas/decimal-3_1_0 create mode 100644 result/schemas/decimal-3_1_0.err create mode 100644 result/schemas/idc-keyref-err1_1_0 create mode 100644 result/schemas/idc-keyref-err1_1_0.err create mode 100644 test/HTML/53867.html create mode 100644 test/XPath/docs/nodes create mode 100644 test/XPath/tests/nodespat create mode 100644 test/c14n/exc-without-comments/test-2.xml create mode 100644 test/c14n/exc-without-comments/test-2.xpath create mode 100644 test/ns7 create mode 100644 test/schemas/bug321475_0.xml create mode 100644 test/schemas/bug321475_1.xsd create mode 100644 test/schemas/bug322411_0.xml create mode 100644 test/schemas/bug322411_1.xsd create mode 100644 test/schemas/bug323510_0.xml create mode 100644 test/schemas/bug323510_1.xsd create mode 100644 test/schemas/decimal-1.xml create mode 100644 test/schemas/decimal-1.xsd create mode 100644 test/schemas/decimal-1_0.xml create mode 100644 test/schemas/decimal-1_1.xsd create mode 100644 test/schemas/decimal-2_0.xml create mode 100644 test/schemas/decimal-2_1.xsd create mode 100644 test/schemas/decimal-3_0.xml create mode 100644 test/schemas/decimal-3_1.xsd create mode 100644 test/schemas/idc-keyref-err1_0.xml create mode 100644 test/schemas/idc-keyref-err1_1.xsd create mode 100644 win32/Makefile.mingw.orig create mode 100644 win32/Makefile.mingw.rej (limited to 'doc/devhelp/libxml2-xmlsave.html') diff --git a/ChangeLog b/ChangeLog index b8cd4e5..46037c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,543 @@ +Thu Jan 5 16:25:06 CET 2006 Daniel Veillard + + * NEWS configure.in libxml.spec.in testapi.c doc/*: upated the news + regenerated the docs, preparing for release of 2.6.23 + * pattern.c xmlschemas.c: fixed some comments + +Thu Jan 5 15:48:27 CET 2006 Kasimier Buchcik + + * test/XPath/docs/nodes test/XPath/tests/nodespat + result/XPath/tests/nodespat: Added regression tests for + the latest XPath/pattern fixes. + +Thu Jan 5 15:43:38 CET 2006 Kasimier Buchcik + + * pattern.c: Another fix to handle "foo//.": "foo" was not + included in the resulting node-set. + +Thu Jan 5 13:22:29 CET 2006 Kasimier Buchcik + + * pattern.c xpath.c include/libxml/pattern.h: + Fixed bug #322928, reported by Erich Schubert: The bug was + in pattern.c, which is used for a tiny subset of xpath + expression which can be evaluated in an optimized way. + The doc-node was never considered when evaluating "//" + expressions. Additionally, we fixed resolution + to nodes of any type in pattern.c; i.e. a "//." didn't work + yet, as it did select only element-nodes. Due to this + issue the pushing of nodes in xpath.c needed to be adjusted + as well. + +Wed Jan 4 18:07:47 CET 2006 Daniel Veillard + + * parser.c: tiny refactoring patch from Bjorn Reese + +Wed Jan 4 15:00:51 CET 2006 Daniel Veillard + + * SAX2.c: fix bug #324432 with + * test/ns7 resul//ns7*: added to the regression tests + +Wed Jan 4 10:53:56 CET 2006 Daniel Veillard + + * include/wsockcompat.h: applied patch from Mark Junker, fixing a + MinGW compilation problem, should close bug #324943 + +Tue Jan 3 11:49:54 CET 2006 Kasimier Buchcik + + * xmlschemas.c: Removed last dependency on the obsolete enum + xmlSchemaValidError. + +Mon Jan 2 11:20:00 CET 2006 Daniel Veillard + + * xmlreader.c include/libxml/xmlreader.h xmlschemas.c: compilation + and doc build fixes from Michael Day + +Wed Dec 28 22:12:34 CET 2005 Daniel Veillard + + * xmlregexp.c: bug in xmlRegExecPushString2() pointed out by + Sreeni Nair. + +Tue Dec 20 16:55:31 CET 2005 Rob Richards + + * tree.c: fix bug #322136 in xmlNodeBufGetContent when entity ref is + a child of an element (fix by Oleksandr Kononenko). + * HTMLtree.c include/libxml/HTMLtree.h: Add htmlDocDumpMemoryFormat. + +Tue Dec 20 11:43:06 CET 2005 Kasimier Buchcik + + * xmlschemas.c xmlstring.c: Fixed a segfault during + text concatenation when validating a node tree: + xmlStrncat was called with a @len of -1; but unlike + xmlStrncatNew, it does not calculate the length + automatically in such a case (reported by Judy Hay + on the mailing list). + Updated the descriptions of the involved string + functions to note this. + +Thu Dec 15 12:11:07 CET 2005 Daniel Veillard + + * nanohttp.c: applied patch from Gary Coady to accept gzipped + http resources. + +Wed Dec 14 18:41:26 CET 2005 Kasimier Buchcik + + * win32/configure.js: Added enable/disable of runtime + debugging (LIBXML_DEBUG_RUNTIME). + +Wed Dec 14 18:11:50 CET 2005 Kasimier Buchcik + + * include/libxml/xmlversion.h.in: Fixed to define + LIBXML_DEBUG_RUNTIME on the basis of @WITH_RUN_DEBUG@. + +Tue Dec 13 12:49:23 CET 2005 Kasimier Buchcik + + * test/schemas/bug321475* result/schemas/bug321475*: + Added regression test for bug #321475 (reported by + Gabor Nagy). Fixing of bug #323510 seemed to have + fixed this bug as well. + +Mon Dec 12 16:19:16 CET 2005 Kasimier Buchcik + + * test/schemas/bug323510* result/schemas/bug323510*: + Added regression test for bug #323510. + +Mon Dec 12 16:11:13 CET 2005 Kasimier Buchcik + + * xmlschemas.c: Workaround for bug #323510 (reported by + Jonathan Filiatrault): substituted the epsilon transition + for a labelled transition, in order to avoid a bug in + xmlregexp.c which eliminated the epsilon transition and + marked the initial state as final. + +Mon Dec 12 14:25:46 CET 2005 Daniel Veillard + + * xmlreader.c: Gary Coady pointed a memory leak in + xmlTextReaderReadInnerXml() applied patch fixing #323864 + +Sat Dec 10 12:08:28 CET 2005 Daniel Veillard + + * HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c + testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number + of warnings shown by HP-UX compiler and reported by Rick Jones + +Fri Dec 9 18:57:31 CET 2005 Rob Richards + + * xmlwriter.c: Insert space between pubid and sysid when both + passed to xmlTextWriterStartDTD and indenting not being used. + Remove no longer used Mem callbacks. + +Fri Dec 9 11:01:16 CET 2005 Kasimier Buchcik + + * runsuite.c: Changed to instantly mark instance-tests as + failed if the corresponding schema was invalid. This + reflects the side of the Python code for the XML Schema test + suite. We now get the same number of failed tests on both + sides. + +Wed Dec 7 14:59:01 CET 2005 Kasimier Buchcik + + * xmlreader.c include/libxml/xmlreader.h: Added + xmlTextReaderSchemaValidateCtxt() to the API. + +Wed Dec 7 12:59:56 CET 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed a segfault: the instance document was + still tried to be validated, if the schema, dynamically + acquired using XSI was invalid, thus mangled. The + validation will stop (or rather won't validate) now in + such a case. The schema parser error code will be set + on the validion context now; this is somehow not nice, + but it assures that the validation context indicates an + error in there was a parser error. + +Tue Dec 6 18:57:23 CET 2005 Daniel Veillard + + * xmlreader.c: small doc patch from Aron Stansvik + * legacy.c: another doc patch for a deprecated API + +Mon Dec 5 16:23:49 CET 2005 Kasimier Buchcik + + * Makefile.am: Tiny change for 'make tests': raised + the number of expected failures for James Clark's + XML Schema datatype tests from 10 to 11. The additional + reported error was agreed to be correct long time ago, + but we missed to adjust the message reported by + the testing script. + +Fri Dec 2 13:51:14 CET 2005 Kasimier Buchcik + + * result/schemas/decimal* result/schemas/bug322411*: + Added missing regression test results for the latest IDC + and xs:decimal bugs. + +Wed Nov 30 12:22:23 CET 2005 Kasimier Buchcik + + * test/schemas/decimal* test/schemas/bug322411*: Added + regression tests for the latest IDC and xs:decimal bugs. + +Wed Nov 30 11:57:35 CET 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed bubbling of duplicate IDC nodes: the + parent's list of duplicates was filled with NULLs instead + of the nodes under certain conditions. This lead to a + segfault when the list's entries were accessed. + +Mon Nov 28 17:28:53 CET 2005 Kasimier Buchcik + + * xmlschemastypes.c: Fixed parsing of xs:decimal to + allow/deny special lexical forms. Fixed the totalDigits + for values in the range (x < 1) && (x > -1) && (x != 0); + E.g "0.123" has now a totalDigits of 3 (was 4 previously). + Adjusted the comparison function for decimals due to this + change. As a side effect comparison against zeroes was + optimized. + +Mon Nov 28 13:25:11 CET 2005 Kasimier Buchcik + + * xmlschemas.c: An assignment to a local variable, which was + used to access the IDC node list, was missing after the + reallocation of the list (reported by Fabrice GUY + bug #322411). Renamed the define ENABLE_IDC_NODE_TABLES + to ENABLE_IDC_NODE_TABLES_TEST and *disabled* it, since + it is used to force bubbling of IDC node tables even + if not necessary; this was intended to be used for test + purposes, but I obviously missed to disable it (although + it apparently helped finding the bug). + +Wed Nov 23 17:34:52 CET 2005 Kasimier Buchcik + + * xmlschemas.c: In xmlSchemaAssembleByXSI() the return value + of xmlSchemaGetMetaAttrInfo() was not assigned to anything; + this caused XSI-driven-dynamic schema acquisition to fail + with @noNamespaceSchemaLocation (reported by Julien Lamy + on the mailing list). + +Tue Nov 22 18:31:34 CET 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed a bug in xmlSchemaFindRedefCompInGraph() + which caused the search for components to stop at the + first encountered attribute group component. + Fixed error report in xmlSchemaCheckSRCRedefineFirst(): the + designation of a not-found component was not reported. + +Mon Nov 21 12:23:28 CET 2005 Daniel Veillard + + * xmlschemastypes.c: Albert Chin found another signed/unsigned problem + in the date and time code raised on IRIX 6.5 + +Fri Nov 18 18:13:38 CET 2005 Kasimier Buchcik + + * xmlschemas.c include/libxml/xmlschemas.h: + Added xmlSchemaSetParserStructuredErrors() to the API. + Fixed channeling of error relevant information to + subsequent parser/validation contexts. + +Thu Nov 17 14:11:43 CET 2005 Daniel Veillard + + * parserInternals.c: removed unreachable code pointed out by + Oleksandr Kononenko, fixes bug #321695 + +Thu Nov 17 08:24:31 CET 2005 Daniel Veillard + + * parser.c: use ctxt->standalone = -2 to indicate that the + XMLDecl was parsed but no standalone attribute was found, + suggested by Michael Day to detect if an XMLDecl was found. + +Tue Nov 15 09:49:24 CET 2005 Daniel Veillard + + * runtest.c: Hisashi Fujinaka pointed that errors in Schemas tests + were not properly reported. + +Sun Nov 13 13:42:41 CET 2005 Daniel Veillard + + * xmlIO.c: applied patch from Geert Jansen to remove xmlBufferClose() + which is not needed. + +Fri Nov 11 13:48:52 CET 2005 Kasimier Buchcik + + * xmlschemas.c: Changed xmlSchemaFormatIDCKeySequence() + to use xmlSchemaGetCanonValueWhtspExt() in order to + correctly report values for xs:anySimpleType. + * test/schemas/idc-keyref-err1* + result/schemas/idc-keyref-err1*: Added a test for this change. + +Wed Nov 9 13:07:24 EST 2005 Rob Richards + + * xmlIO.c xmlwriter.c: function consolidation when writing to xmlBuffer. + Return error condition not len if xmlwriter fails writing to buffer. + +Wed Nov 9 09:54:54 CET 2005 Daniel Veillard + + * xmlsave.c xmlIO.c include/libxml/xmlIO.h include/libxml/xmlsave.h: + applied patch from Geert Jansen to implement the save function to + a xmlBuffer, and a bit of cleanup. + +Mon Nov 7 14:58:39 CET 2005 Kasimier Buchcik + + * xmlschemas.c xmlschemastypes.c: Fixed the type of the + totalDigits value to be positiveInteger. + Fixed crash in an error report function when we gave it + the document node; only element and attribute nodes are + processed now (reported by Rob Richards). + +Tue Nov 1 16:22:29 CET 2005 Daniel Veillard + + * xmlregexp.c: fix bug #319897, problem with counted atoms + when the transition itself is counted too + * result/regexp/hard test/regexp/hard: augmented the regression + tests with the problem exposed. + +Tue Nov 1 11:54:39 CET 2005 Daniel Veillard + + * win32/Makefile.mingw include/win32config.h: applied patch from + Mark Junker to fix compilation with MinGW + +Fri Oct 28 18:36:08 CEST 2005 Daniel Veillard + + * libxml.3: tiny fix from Albert Chin + * runsuite.c runtest.c testapi.c: portability cleanup for arch + needing trio for *printf + +Fri Oct 28 12:21:39 EDT 2005 Rob Richards + + * tree.c: add additional checks to prevent tree corruption. fix problem + copying attribute using xmlDocCopyNode from one document to another. + +Fri Oct 28 17:58:13 CEST 2005 Daniel Veillard + + * config.h.in configure.in vms/config.vms macos/src/config-mac.h: + cleanup from Albert Chin + * doc/Makefile.am: html/index.sgml doesn't exist anymore + +Fri Oct 28 16:53:51 CEST 2005 Daniel Veillard + + * xmlIO.c xmlmodule.c: more portability patches from Albert Chin for + HP-UX and AIX + +Fri Oct 28 10:36:10 CEST 2005 Daniel Veillard + + * xmlmodule.c configure.in: applied 2 patches from Albert Chin for + module portability + +Fri Oct 28 10:24:39 CEST 2005 Daniel Veillard + + * error.c: fixing a portability problem on some old Unices with + patch from Albert Chin + +2005-10-27 Aleksey Sanin + + * c14n.c result/c14n/exc-without-comments/test-2 + test/c14n/exc-without-comments/test-2.xml + test/c14n/exc-without-comments/test-2.xpath: fixing + bug in exc-c14n namespace visibility + test case (bug #319367) + +Thu Oct 27 16:10:31 CEST 2005 Daniel Veillard + + * python/libxml.py: remove warnings to stdout patch from Nic Ferrier + +Thu Oct 27 13:54:52 CEST 2005 Daniel Veillard + + * valid.c xmlregexp.c include/libxml/valid.h + include/libxml/xmlregexp.h: avoid function parameters names 'list' + as this seems to give troubles with VC6 and stl as reported by + Samuel Diaz Garcia. + +Wed Oct 26 10:59:21 CEST 2005 Daniel Veillard + + * parserInternals.c: fix a problem in some error case on Solaris + when passed a NULL filename, pointed by Albert Chin. + +Tue Oct 25 14:34:58 CEST 2005 Daniel Veillard + + * HTMLparser.c: script HTML parser error fix, corrects bug #319715 + * result/HTML/53867* test/HTML/53867.html: added test from Michael Day + to the regression suite + +Tue Oct 25 14:21:11 CEST 2005 Daniel Veillard + + * HTMLparser.c: typo fix from Michael Day + +Mon Oct 24 20:16:23 EDT 2005 Rob Richards + + * tree.c: fix issue adding non-namespaced attributes in xmlAddChild(), + xmlAddNextSibling() and xmlAddPrevSibling() (bug #319108) - part 1. + +Sat Oct 22 10:00:41 HKT 2005 William Brack + + * parser.c: fixed second spot where CRLF split between chunks + could cause trouble (bug #319279) + * gentest.py, testapi.c: fixed two problems involved with + --with-minimum compilation (compilation errors with schematron + and formal expressions tests) + +Fri Oct 21 10:50:14 EDT 2005 Rob Richards + + * xmlsave.c: prevent output of fragment tags when serializing XHTML. + +Wed Oct 19 16:53:47 BST 2005 Daniel Veillard + + * xmlregexp.c: commiting a some fixes and debug done yesterday in + the London airport. + +Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik + + * xmlschemas.c: Removed creation of a temporary parser context + during validation when processing xsi:type; this previously + added a string to the dict of the schema - to assure thread + safety, we don't want to modify a given schema during + validation. + +Thu Oct 20 17:05:29 HKT 2005 William Brack + + * xmlwriter.c: fixed problem in xmlTextWriterVSprintf caused by + misuse of vsnprintf + * configure.in, config.h.in: added a configuration check for + va_copy and added a define for VA_COPY for xmlwriter.c fix + * parser.c: fixed problem with CRLF split between chunks (bug + #319279) (fix provided by Brion Vibber) + +Wed Oct 19 18:49:52 CEST 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed a potential memory leak in + xmlSchemaCheckCSelectorXPath() when an internal error occurs. + Fixed setting of ctxt->err to the given error code in + the parsing error functions. + * pattern.c: Added internal xmlCompileIDCXPathPath() as a + starting point for IDC XPath compilation; this and some other + tiny changes fixes issues regarding whitespace in the + expressions and IDC selector/field relevant restrictions of + the subset of XPath. Fixed a missing blocking of attributes + in xmlStreamPushInternal(). + +Mon Oct 17 15:06:05 EDT 2005 Daniel Veillard + + * runtest.c: removed the error message + * relaxng.c xmlschemas.c: removed 2 instability warnings from function + documentation + * include/libxml/schemasInternals.h: changed warning about API stability + * xmlregexp.c: trying to improve runtime execution of non-deterministic + regexps and automata. Not fully finished but should be way better. + +Mon Oct 17 16:12:02 CEST 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed a memory leak in + xmlSchemaContentModelDump(). Added output of local types + in xmlSchemaElementDump(). Tiny cosmetical changes to the + dump output. + +Mon Oct 17 14:29:08 CEST 2005 Kasimier Buchcik + + * tree.c pattern.c: Silenced intel compiler warnings (reported + by Kjartan Maraas, bug #318517). + * xmlschemas.c: The above changes in pattern.c revealed an + inconsistency wrt IDCs: we now _only_ pop XPath states, if + we really pushed them beforehand; this was previously not + checked for the case when we discover an element node to be + invalid wrt the content model. + Fixed segfault in xmlSchemaGetEffectiveValueConstraint(). + +Fri Oct 14 16:40:18 CEST 2005 Kasimier Buchcik + + * result/schemas/*.err: Adapted regression test results. + +Fri Oct 14 16:21:22 CEST 2005 Kasimier Buchcik + + * xmlschemas.c: Fixed some identity-constraint issues: + Restructured IDC node-tables + Allowed IDCs to resolve also to nodes of complex type with + simple content. + Added check for keyrefs with references to keyrefs. + IDC target-nodes were interferring with IDC node-tables, + since they used one list of entries only. I separated this + one big list into 3 lists: 1 for IDC node-table entries, + 1 for _duplicates_ of IDC node-table entries and 1 for + IDC target-nodes. More code, but cleaner and it works at last. + Keyrefs will fail to resolve to duplicate key/unique entries. + I thought this was already working this way, but it didn't. + The wording of the definition for [node table] in the spec + can lead to a scenario, where keyrefs resolve perfectly, even + if the relevant key-sequences of the referenced key/unique have + duplicates in the subtree. Currently only Saxon 8.5.1 is + dissallowing resolution to duplicate entries correctly - we + will follow Saxon here. + Removed some intel compiler warnings (reported by + Kjartan Maraas, bug #318517). + * pattern.c: Fixed an IDC-XPath problem when resolving to + attributes. + +Mon Oct 14 01:15:14 CEST 2005 Rob Richards + * nanohttp.c include/wsockcompat.h: applied patch from Kolja Nowak + to use getaddrinfo() if supported in Windows build (bug# 317431). + +Mon Oct 10 15:33:48 CEST 2005 Kasimier Buchcik + + * result/schemas/*: Adapted regression test results. + +Mon Oct 10 15:12:43 CEST 2005 Kasimier Buchcik + + * xmlschemas.c include/libxml/schemasInternals.h + include/libxml/xmlerror.h: Initial implementation for + redefinitions; this still misses checks for restrictions + of the content model of complex types. + Fixed default/fixed values for attributes (looks like they + did not work in the last releases). + Completed constraints for attribute uses. + Seperated attribute derivation from attribute constraints. + Completed constraints for attribute group definitions. + Disallowing s of schemas in no target namespace if the + importing schema is a chameleon schema. This contradicts + the way Saxon, Xerces-J, XSV and IBM's SQC works, but the + W3C XML Schema WG, thinks it is correct to dissalow such + imports. + Added cos-all-limited constraints. + Restructured reference resolution to model groups and element + declarations. + Misc cleanup. + +Fri Oct 7 04:34:12 CEST 2005 Rob Richards + + * schematron.c xmlregexp.c: remove warnings under Windows. + +Wed Sep 28 23:42:14 CEST 2005 Daniel Veillard + + * parser.c: applied patch from Massimo Morara fixing bug #317447 + about risk of invalid write in xmlStringLenDecodeEntities + +Tue Sep 27 11:20:57 CEST 2005 Daniel Veillard + + * error.c: Adrian Mouat pointed out redundancies in xmlReportError() + +Mon Sep 26 19:18:24 CEST 2005 Daniel Veillard + + * xmlregexp.c: seems a test to avoid duplicate transition is + really needed at all times. Luka Por gave an example hitting + this. Changed back the internal API. + +Thu Sep 22 13:14:07 CEST 2005 Daniel Veillard + + * xmlreader.c: fixing leak in xmlTextReaderReadString() #316924 + +Thu Sep 15 16:12:44 CEST 2005 Daniel Veillard + + * uri.c: more fixes to the behaviour of xmlBuildRelativeURI + +Thu Sep 15 15:08:21 CEST 2005 Daniel Veillard + + * xmlregexp.c: detect combinatory explosion and return with + a runtime error in those case, c.f. #316338 though maybe we + should not see such an explosion with that specific regexp, + more checking needs to be done. + +Wed Sep 14 19:52:18 CEST 2005 Kasimier Buchcik + + * include/libxml/schemasInternals.h: Added some comments for the + struct fields. + +Wed Sep 14 13:24:27 HKT 2005 William Brack + + * uri.c: fixed problem when xmlBuildRelativeURI was given a + blank path (bug 316224) + Mon Sep 12 23:41:40 CEST 2005 Daniel Veillard * NEWS configure.in doc//*: release of 2.6.22 updated doc and diff --git a/HTMLparser.c b/HTMLparser.c index d11ae08..12afdd8 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2678,7 +2678,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { break; /* while */ } else { htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH, - "Element %s embbeds close tag\n", + "Element %s embeds close tag\n", ctxt->name, NULL); } } else { @@ -2701,6 +2701,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { } nbchar = 0; } + GROW; NEXTL(l); cur = CUR_CHAR(l); } @@ -4778,7 +4779,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { } break; case XML_PARSER_START_TAG: { - const xmlChar *name, *oldname; + const xmlChar *name; int failed; const htmlElemDesc * info; @@ -4831,7 +4832,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { SKIP(2); if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) ctxt->sax->endElement(ctxt->userData, name); - oldname = htmlnamePop(ctxt); + htmlnamePop(ctxt); ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, @@ -4852,7 +4853,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { */ if (xmlStrEqual(name, ctxt->name)) { nodePop(ctxt); - oldname = htmlnamePop(ctxt); + htmlnamePop(ctxt); } ctxt->instate = XML_PARSER_CONTENT; @@ -4869,7 +4870,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if ((info != NULL) && (info->empty)) { if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) ctxt->sax->endElement(ctxt->userData, name); - oldname = htmlnamePop(ctxt); + htmlnamePop(ctxt); } ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH diff --git a/HTMLtree.c b/HTMLtree.c index e77ee65..d73024a 100644 --- a/HTMLtree.c +++ b/HTMLtree.c @@ -506,16 +506,17 @@ htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) { } /** - * htmlDocDumpMemory: + * htmlDocDumpMemoryFormat: * @cur: the document * @mem: OUT: the memory pointer * @size: OUT: the memory length + * @format: should formatting spaces been added * * Dump an HTML document in memory and return the xmlChar * and it's size. * It's up to the caller to free the memory. */ void -htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { +htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { xmlOutputBufferPtr buf; xmlCharEncodingHandlerPtr handler = NULL; const char *encoding; @@ -572,7 +573,8 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { return; } - htmlDocContentDumpOutput(buf, cur, NULL); + htmlDocContentDumpFormatOutput(buf, cur, NULL, format); + xmlOutputBufferFlush(buf); if (buf->conv != NULL) { *size = buf->conv->use; @@ -584,6 +586,20 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { (void)xmlOutputBufferClose(buf); } +/** + * htmlDocDumpMemory: + * @cur: the document + * @mem: OUT: the memory pointer + * @size: OUT: the memory length + * + * Dump an HTML document in memory and return the xmlChar * and it's size. + * It's up to the caller to free the memory. + */ +void +htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { + htmlDocDumpMemoryFormat(cur, mem, size, 1); +} + /************************************************************************ * * diff --git a/Makefile.am b/Makefile.am index ee09a7b..5ef9d90 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1070,7 +1070,7 @@ SchemasPythonTests: LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ echo "## XML Schemas datatypes Python based test suite" ; \ - echo "## It is normal to see 10 errors reported" ; \ + echo "## It is normal to see 11 errors reported" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ fi) @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) diff --git a/Makefile.in b/Makefile.in index 3e66d17..d238442 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2328,7 +2328,7 @@ SchemasPythonTests: LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ echo "## XML Schemas datatypes Python based test suite" ; \ - echo "## It is normal to see 10 errors reported" ; \ + echo "## It is normal to see 11 errors reported" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ fi) @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" MAKEFLAGS+=--silent pytests ; fi) diff --git a/NEWS b/NEWS index 6d91fc6..ccb9ace 100644 --- a/NEWS +++ b/NEWS @@ -15,176 +15,216 @@ ChangeLog.html to the CVS at http://cvs.gnome.org/viewcvs/libxml2/ code base.There is the list of public releases: +2.6.23: Jan 5 2006: + - portability fixes: Windows (Rob Richards), getaddrinfo on Windows + (Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas), + --with-minimum compilation fixes (William Brack), error case handling fix + on Solaris (Albert Chin), don't use 'list' as parameter name reported by + Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin), + MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick Jones), + + - code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose + (Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring + parsing code (Bjorn Reese) + - bug fixes: xmlBuildRelativeURI and empty path (William Brack), + combinatory explosion and performances in regexp code, leak in + xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo + Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik), + XPath pattern based evaluation bugs (DV & Kasimier), + xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in + xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of + vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF + split problem (William), issues with non-namespaced attributes in + xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards), + HTML parsing of script, Python must not output to stdout (Nic Ferrier), + exclusive C14N namespace visibility (Aleksey Sanin), XSD dataype + totalDigits bug (Kasimier Buchcik), error handling when writing to an + xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi + Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix + XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier), + fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml + (Gary Coady), regexp bug affecting schemas (Kasimier), configuration of + runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs + (Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair), + compilation and build fixes (Michael Day), removed dependancies on + xmlSchemaValidError (Kasimier), bug with , more XPath + pattern based evaluation fixes (Kasimier) + - improvements: XSD Schemas redefinitions/restrictions (Kasimier + Buchcik), node copy checks and fix for attribute (Rob Richards), counted + transition bug in regexps, ctxt->standalone = -2 to indicate no + standalone attribute was found, add xmlSchemaSetParserStructuredErrors() + (Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API + (Kasimier), handle gzipped HTTP resources (Gary Coady), add + htmlDocDumpMemoryFormat. (Rob Richards), + - documentation: typo (Michael Day), libxml man page (Albert Chin), save + function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik), + + + 2.6.22: Sep 12 2005: - build fixes: compile without schematron (Stéphane Bidoul) - bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i, - CDATA push parser bug, xmlElemDump problem with XHTML1 doc, - XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, - fix some output formatting for meta element (Rob Richards), - script and style XHTML1 serialization (David Madore), Attribute - derivation fixups in XSD (Kasimier Buchcik), better IDC error - reports (Kasimier Buchcik) - - - improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), - add XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements - preparing for derive (Kasimier Buchcik). + CDATA push parser bug, xmlElemDump problem with XHTML1 doc, + XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some + output formatting for meta element (Rob Richards), script and style + XHTML1 serialization (David Madore), Attribute derivation fixups in XSD + (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik) + - improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add + XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for + derive (Kasimier Buchcik). - documentation: generation of gtk-doc like docs, integration with - devhelp. + devhelp. 2.6.21: Sep 4 2005: - build fixes: Cygwin portability fixes (Gerrit P. Haase), calling - convention problems on Windows (Marcus Boerger), cleanups based on - Linus' sparse tool, update of win32/configure.js (Rob Richards), - remove warnings on Windows(Marcus Boerger), compilation without SAX1, - detection of the Python binary, use $GCC inestad of $CC = 'gcc' (Andrew - W. Nosenko), compilation/link with threads and old gcc, compile - problem by C370 on Z/OS, + convention problems on Windows (Marcus Boerger), cleanups based on Linus' + sparse tool, update of win32/configure.js (Rob Richards), remove warnings + on Windows(Marcus Boerger), compilation without SAX1, detection of the + Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko), + compilation/link with threads and old gcc, compile problem by C370 on + Z/OS, - bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8 - bug (Jiri Netolicky), XPath NaN compare bug (William Brack), - htmlParseScript potential bug, Schemas regexp handling of spaces, - Base64 Schemas comparisons NIST passes, automata build error xsd:all, - xmlGetNodePath for namespaced attributes (Alexander Pohoyda), - xmlSchemas foreign namespaces handling, XML Schemas facet comparison - (Kupriyanov Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier - Buchcik), xml: namespace ahndling in Schemas (Kasimier), empty model - group in Schemas (Kasimier), wilcard in Schemas (Kasimier), URI - composition (William), xs:anyType in Schemas (Kasimier), Python resolver - emmitting error messages directly, Python xmlAttr.parent (Jakub Piotr - Clapa), trying to fix the file path/URI conversion, - xmlTextReaderGetAttribute fix (Rob Richards), xmlSchemaFreeAnnot memleak - (Kasimier), HTML UTF-8 serialization, streaming XPath, Schemas determinism - detection problem, XInclude bug, Schemas context type (Dean Hill), - validation fix (Derek Poon), xmlTextReaderGetAttribute[Ns] namespaces - (Rob Richards), Schemas type fix (Kuba Nowakowski), UTF-8 parser bug, - error in encoding handling, xmlGetLineNo fixes, bug on entities handling, - entity name extraction in error handling with XInclude, text nodes - in HTML body tags (Gary Coady), xml:id and IDness at the treee level - fixes, XPath streaming patterns bugs. + bug (Jiri Netolicky), XPath NaN compare bug (William Brack), + htmlParseScript potential bug, Schemas regexp handling of spaces, Base64 + Schemas comparisons NIST passes, automata build error xsd:all, + xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas + foreign namespaces handling, XML Schemas facet comparison (Kupriyanov + Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml: + namespace ahndling in Schemas (Kasimier), empty model group in Schemas + (Kasimier), wilcard in Schemas (Kasimier), URI composition (William), + xs:anyType in Schemas (Kasimier), Python resolver emmitting error + messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to + fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob + Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8 + serialization, streaming XPath, Schemas determinism detection problem, + XInclude bug, Schemas context type (Dean Hill), validation fix (Derek + Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas + type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling, + xmlGetLineNo fixes, bug on entities handling, entity name extraction in + error handling with XInclude, text nodes in HTML body tags (Gary Coady), + xml:id and IDness at the treee level fixes, XPath streaming patterns + bugs. - improvements: structured interfaces for schemas and RNG error reports - (Marcus Boerger), optimization of the char data inner loop parsing - (thanks to Behdad Esfahbod for the idea), schematron validation - though not finished yet, xmlSaveOption to omit XML declaration, - keyref match error reports (Kasimier), formal expression handling - code not plugged yet, more lax mode for the HTML parser, - parser XML_PARSE_COMPACT option for text nodes allocation. + (Marcus Boerger), optimization of the char data inner loop parsing + (thanks to Behdad Esfahbod for the idea), schematron validation though + not finished yet, xmlSaveOption to omit XML declaration, keyref match + error reports (Kasimier), formal expression handling code not plugged + yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option + for text nodes allocation. - documentation: xmllint man page had --nonet duplicated 2.6.20: Jul 10 2005: - - build fixes: Windows build (Rob Richards), Mingw compilation (Igor - Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and - andriy@google.com), use gcc weak references to pthread to avoid the - pthread dependancy on Linux, compilation problem (Steve Nairn), - compiling of subset (Morten Welinder), IPv6/ss_family compilation - (William Brack), compilation when disabling parts of the library, - standalone test distribution. - - - bug fixes: bug in lang(), memory cleanup on errors (William Brack), - HTTP query strings (Aron Stansvik), memory leak in DTD (William), - integer overflow in XPath (William), nanoftp buffer size, pattern - "." apth fixup (Kasimier), leak in tree reported by Malcolm Rowe, - replaceNode patch (Brent Hendricks), CDATA with NULL content - (Mark Vakoc), xml:base fixup on XInclude (William), pattern - fixes (William), attribute bug in exclusive c14n (Aleksey Sanin), - xml:space and xml:lang with SAX2 (Rob Richards), namespace - trouble in complex parsing (Malcolm Rowe), XSD type QNames fixes - (Kasimier), XPath streaming fixups (William), RelaxNG bug (Rob Richards), - Schemas for Schemas fixes (Kasimier), removal of ID (Rob Richards), - a small RelaxNG leak, HTML parsing in push mode bug (James Bursa), - failure to detect UTF-8 parsing bugs in CDATA sections, areBlanks() - heuristic failure, duplicate attributes in DTD bug (William). - - - improvements: lot of work on Schemas by Kasimier Buchcik both on - conformance and streaming, Schemas validation messages (Kasimier - Buchcik, Matthew Burgess), namespace removal at the python level - (Brent Hendricks), Update to new Schemas regression tests from - W3C/Nist (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation - of xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), - standalone test framework and programs, new DOM import APIs - xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and - xmlDOMWrapRemoveNode(), extension of xmllint capabilities for - SAX and Schemas regression tests, xmlStopParser() available in - pull mode too, ienhancement to xmllint --shell namespaces support, - Windows port of the standalone testing tools (Kasimier and William), - xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() - SAX Schemas APIs, Schemas xmlReader support. - + - build fixes: Windows build (Rob Richards), Mingw compilation (Igor + Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and + andriy@google.com), use gcc weak references to pthread to avoid the + pthread dependancy on Linux, compilation problem (Steve Nairn), compiling + of subset (Morten Welinder), IPv6/ss_family compilation (William Brack), + compilation when disabling parts of the library, standalone test + distribution. + - bug fixes: bug in lang(), memory cleanup on errors (William Brack), + HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer + overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup + (Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch + (Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup + on XInclude (William), pattern fixes (William), attribute bug in + exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob + Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type + QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug + (Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob + Richards), a small RelaxNG leak, HTML parsing in push mode bug (James + Bursa), failure to detect UTF-8 parsing bugs in CDATA sections, + areBlanks() heuristic failure, duplicate attributes in DTD bug + (William). + - improvements: lot of work on Schemas by Kasimier Buchcik both on + conformance and streaming, Schemas validation messages (Kasimier Buchcik, + Matthew Burgess), namespace removal at the python level (Brent + Hendricks), Update to new Schemas regression tests from W3C/Nist + (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of + xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), + standalone test framework and programs, new DOM import APIs + xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and + xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and + Schemas regression tests, xmlStopParser() available in pull mode too, + ienhancement to xmllint --shell namespaces support, Windows port of the + standalone testing tools (Kasimier and William), + xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX + Schemas APIs, Schemas xmlReader support. 2.6.19: Apr 02 2005: - - build fixes: drop .la from RPMs, --with-minimum build fix (William - Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with - AIX 5.3 compiler, fixed elfgcchack.h generation and PLT reduction - code on Linux/ELF/gcc4 - - bug fixes: schemas type decimal fixups (William Brack), xmmlint return - code (Gerry Murphy), small schemas fixes (Matthew Burgess and - GUY Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey - Sanin), segfault in Schemas (Kasimier Buchcik), Schemas attribute - validation (Kasimier), Prop related functions and xmlNewNodeEatName - (Rob Richards), HTML serialization of name attribute on a elements, - Python error handlers leaks and improvement (Brent Hendricks), - uninitialized variable in encoding code, Relax-NG validation bug, - potential crash if gnorableWhitespace is NULL, xmlSAXParseDoc and - xmlParseDoc signatures, switched back to assuming UTF-8 in case - no encoding is given at serialization time - - improvements: lot of work on Schemas by Kasimier Buchcik on facets - checking and also mixed handling. + - build fixes: drop .la from RPMs, --with-minimum build fix (William + Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX + 5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on + Linux/ELF/gcc4 + - bug fixes: schemas type decimal fixups (William Brack), xmmlint return + code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY + Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin), + segfault in Schemas (Kasimier Buchcik), Schemas attribute validation + (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards), + HTML serialization of name attribute on a elements, Python error handlers + leaks and improvement (Brent Hendricks), uninitialized variable in + encoding code, Relax-NG validation bug, potential crash if + gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures, + switched back to assuming UTF-8 in case no encoding is given at + serialization time + - improvements: lot of work on Schemas by Kasimier Buchcik on facets + checking and also mixed handling. - 2.6.18: Mar 13 2005: - - build fixes: warnings (Peter Breitenlohner), testapi.c generation, - Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), - some gcc4 fixes, HP-UX portability fixes (Rick Jones). - - bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and - xmlreader stopping on non-fatal errors, thread support for dictionnaries - reference counting (Gary Coady), internal subset and push problem, - URL saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python - paths fixup (Stephane Bidoul), xmlGetNodePath and namespaces, - xmlSetNsProp fix (Mike Hommey), warning should not count as error - (William Brack), xmlCreatePushParser empty chunk, XInclude parser - flags (William), cleanup FTP and HTTP code to reuse the uri parsing - and IPv6 (William), xmlTextWriterStartAttributeNS fix (Rob Richards), - XMLLINT_INDENT being empty (William), xmlWriter bugs (Rob Richards), - multithreading on Windows (Rich Salz), xmlSearchNsByHref fix (Kasimier), - Python binding leak (Brent Hendricks), aliasing bug exposed by gcc4 - on s390, xmlTextReaderNext bug (Rob Richards), Schemas decimal type - fixes (William Brack), xmlByteConsumed static buffer (Ben Maurer). - - improvement: speedup parsing comments and DTDs, dictionnary support for - hash tables, Schemas Identity constraints (Kasimier), streaming XPath - subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical - values handling (Kasimier), add xmlTextReaderByteConsumed (Aron - Stansvik), - - Documentation: Wiki support (Joel Reed) - + - build fixes: warnings (Peter Breitenlohner), testapi.c generation, + Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), + some gcc4 fixes, HP-UX portability fixes (Rick Jones). + - bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and + xmlreader stopping on non-fatal errors, thread support for dictionnaries + reference counting (Gary Coady), internal subset and push problem, URL + saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths + fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix + (Mike Hommey), warning should not count as error (William Brack), + xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup + FTP and HTTP code to reuse the uri parsing and IPv6 (William), + xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being + empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows + (Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent + Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug + (Rob Richards), Schemas decimal type fixes (William Brack), + xmlByteConsumed static buffer (Ben Maurer). + - improvement: speedup parsing comments and DTDs, dictionnary support for + hash tables, Schemas Identity constraints (Kasimier), streaming XPath + subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical + values handling (Kasimier), add xmlTextReaderByteConsumed (Aron + Stansvik), + - Documentation: Wiki support (Joel Reed) 2.6.17: Jan 16 2005: - - build fixes: Windows, warnings removal (William Brack), - maintainer-clean dependency(William), build in a different directory - (William), fixing --with-minimum configure build (William), BeOS - build (Marcin Konicki), Python-2.4 detection (William), compilation - on AIX (Dan McNichol) + - build fixes: Windows, warnings removal (William Brack), + maintainer-clean dependency(William), build in a different directory + (William), fixing --with-minimum configure build (William), BeOS build + (Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan + McNichol) - bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile() - to use the catalog(s), loop on output (William Brack), XPath memory leak, - ID deallocation problem (Steve Shepard), debugDumpNode crash (William), - warning not using error callback (William), xmlStopParser bug (William), - UTF-16 with BOM on DTDs (William), namespace bug on empty elements - in push mode (Rob Richards), line and col computations fixups (Aleksey - Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), - patterns with too many steps, bug in RNG choice optimization, line - number sometimes missing. - - - improvements: XSD Schemas (Kasimier Buchcik), python generator (William), - xmlUTF8Strpos speedup (William), unicode Python strings (William), - XSD error reports (Kasimier Buchcik), Python __str__ call serialize(). - - - new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber - for the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs - (mostly Joel Reed), error extraction API from regexps, new XMLSave - option for format (Phil Shafer) - - documentation: site improvement (John Fleck), FAQ entries (William). + to use the catalog(s), loop on output (William Brack), XPath memory leak, + ID deallocation problem (Steve Shepard), debugDumpNode crash (William), + warning not using error callback (William), xmlStopParser bug (William), + UTF-16 with BOM on DTDs (William), namespace bug on empty elements in + push mode (Rob Richards), line and col computations fixups (Aleksey + Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), + patterns with too many steps, bug in RNG choice optimization, line number + sometimes missing. + - improvements: XSD Schemas (Kasimier Buchcik), python generator + (William), xmlUTF8Strpos speedup (William), unicode Python strings + (William), XSD error reports (Kasimier Buchcik), Python __str__ call + serialize(). + - new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for + the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel + Reed), error extraction API from regexps, new XMLSave option for format + (Phil Shafer) + - documentation: site improvement (John Fleck), FAQ entries + (William). 2.6.16: Nov 10 2004: @@ -197,7 +237,7 @@ http://cvs.gnome.org/viewcvs/libxml2/ - documentation: fix to xmllint man page, some API function descritpion were updated. - improvements: DTD validation APIs provided at the Python level (Brent - Hendricks) + Hendricks) 2.6.15: Oct 27 2004: diff --git a/SAX2.c b/SAX2.c index 9f7edf6..17425e7 100644 --- a/SAX2.c +++ b/SAX2.c @@ -2233,9 +2233,13 @@ xmlSAX2StartElementNs(void *ctx, */ if ((URI != NULL) && (ret->ns == NULL)) { ret->ns = xmlSearchNs(ctxt->myDoc, parent, prefix); + if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) { + ret->ns = xmlSearchNs(ctxt->myDoc, ret, prefix); + } if (ret->ns == NULL) { ns = xmlNewNs(ret, NULL, prefix); if (ns == NULL) { + xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); return; } diff --git a/c14n.c b/c14n.c index 32c7004..33a5803 100644 --- a/c14n.c +++ b/c14n.c @@ -802,7 +802,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) if(xmlStrlen(attr->ns->prefix) == 0) { has_empty_ns = 1; } - } else if(attr->ns == NULL) { + } else if((attr->ns != NULL) && (xmlStrlen(attr->ns->prefix) == 0) && (xmlStrlen(attr->ns->href) == 0)) { has_visibly_utilized_empty_ns = 1; } } diff --git a/config.h.in b/config.h.in index 8484193..1dafc10 100644 --- a/config.h.in +++ b/config.h.in @@ -97,24 +97,12 @@ /* Define if history library is there (-lhistory) */ #undef HAVE_LIBHISTORY -/* Define to 1 if you have the `inet' library (-linet). */ -#undef HAVE_LIBINET - -/* Define to 1 if you have the `net' library (-lnet). */ -#undef HAVE_LIBNET - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - /* Define if pthread library is there (-lpthread) */ #undef HAVE_LIBPTHREAD /* Define if readline library is there (-lreadline) */ #undef HAVE_LIBREADLINE -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Have compression library */ #undef HAVE_LIBZ @@ -237,6 +225,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Whether va_copy() is available */ +#undef HAVE_VA_COPY + /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF @@ -252,6 +243,9 @@ /* Define to 1 if you have the `_stat' function. */ #undef HAVE__STAT +/* Whether __va_copy() is available */ +#undef HAVE___VA_COPY + /* Name of package */ #undef PACKAGE diff --git a/configure b/configure index ac6e4bb..ad70461 100755 --- a/configure +++ b/configure @@ -1618,7 +1618,7 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=6 -LIBXML_MICRO_VERSION=22 +LIBXML_MICRO_VERSION=23 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 @@ -19934,8 +19934,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# AM_MAINTAINER_MODE _cppflags="${CPPFLAGS}" @@ -26028,58 +26026,20 @@ fi done -echo "$as_me:$LINENO: checking for gethostent" >&5 -echo $ECHO_N "checking for gethostent... $ECHO_C" >&6 -if test "${ac_cv_func_gethostent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +echo "$as_me:$LINENO: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $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. */ -/* Define gethostent to an innocuous variant, in case declares gethostent. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostent innocuous_gethostent - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostent (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostent - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostent (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostent) || defined (__stub___gethostent) -choke me -#else -char (*f) () = gethostent; -#endif -#ifdef __cplusplus -} -#endif - +#include +va_list ap1,ap2; int main () { -return f != gethostent; +va_copy(ap1,ap2); ; return 0; } @@ -26106,47 +26066,38 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_gethostent=yes + have_va_copy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_gethostent=no +have_va_copy=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostent" >&5 -echo "${ECHO_T}$ac_cv_func_gethostent" >&6 -if test $ac_cv_func_gethostent = yes; then - : -else +echo "$as_me:$LINENO: result: $have_va_copy" >&5 +echo "${ECHO_T}$have_va_copy" >&6 +if test x"$have_va_copy" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_VA_COPY 1 +_ACEOF -echo "$as_me:$LINENO: checking for gethostent in -lnsl" >&5 -echo $ECHO_N "checking for gethostent in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF + echo "$as_me:$LINENO: checking for __va_copy" >&5 +echo $ECHO_N "checking for __va_copy... $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. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostent (); +#include + va_list ap1,ap2; int main () { -gethostent (); +__va_copy(ap1,ap2); ; return 0; } @@ -26173,82 +26124,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostent=yes + have___va_copy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_nsl_gethostent=no +have___va_copy=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostent" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostent" >&6 -if test $ac_cv_lib_nsl_gethostent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF - - LIBS="-lnsl $LIBS" + echo "$as_me:$LINENO: result: $have___va_copy" >&5 +echo "${ECHO_T}$have___va_copy" >&6 + if test x"$have___va_copy" = x"yes"; then -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE___VA_COPY 1 +_ACEOF + fi fi -echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then +echo "$as_me:$LINENO: checking for library containing gethostent" >&5 +echo $ECHO_N "checking for library containing gethostent... $ECHO_C" >&6 +if test "${ac_cv_search_gethostent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +ac_cv_search_gethostent=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - +char gethostent (); int main () { -return f != setsockopt; +gethostent (); ; return 0; } @@ -26275,30 +26195,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes + ac_cv_search_gethostent="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - -echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF +if test "$ac_cv_search_gethostent" = no; then + for ac_lib in nsl; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -26311,11 +26219,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char setsockopt (); +char gethostent (); int main () { -setsockopt (); +gethostent (); ; return 0; } @@ -26342,82 +26250,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_socket_setsockopt=yes + ac_cv_search_gethostent="-l$ac_lib" +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + done fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 -if test $ac_cv_lib_socket_setsockopt = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF - - LIBS="-lsocket $LIBS" - +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_gethostent" >&5 +echo "${ECHO_T}$ac_cv_search_gethostent" >&6 +if test "$ac_cv_search_gethostent" != no; then + test "$ac_cv_search_gethostent" = "none required" || LIBS="$ac_cv_search_gethostent $LIBS" fi -echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then +echo "$as_me:$LINENO: checking for library containing setsockopt" >&5 +echo $ECHO_N "checking for library containing setsockopt... $ECHO_C" >&6 +if test "${ac_cv_search_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +ac_cv_search_setsockopt=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - int main () { -return f != setsockopt; +setsockopt (); ; return 0; } @@ -26444,30 +26321,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes + ac_cv_search_setsockopt="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - -echo "$as_me:$LINENO: checking for setsockopt in -lnet" >&5 -echo $ECHO_N "checking for setsockopt in -lnet... $ECHO_C" >&6 -if test "${ac_cv_lib_net_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnet $LIBS" -cat >conftest.$ac_ext <<_ACEOF +if test "$ac_cv_search_setsockopt" = no; then + for ac_lib in socket net; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -26511,82 +26376,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_net_setsockopt=yes + ac_cv_search_setsockopt="-l$ac_lib" +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_net_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + done fi -echo "$as_me:$LINENO: result: $ac_cv_lib_net_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_net_setsockopt" >&6 -if test $ac_cv_lib_net_setsockopt = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNET 1 -_ACEOF - - LIBS="-lnet $LIBS" - +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_search_setsockopt" >&6 +if test "$ac_cv_search_setsockopt" != no; then + test "$ac_cv_search_setsockopt" = "none required" || LIBS="$ac_cv_search_setsockopt $LIBS" fi -echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then +echo "$as_me:$LINENO: checking for library containing connect" >&5 +echo $ECHO_N "checking for library containing connect... $ECHO_C" >&6 +if test "${ac_cv_search_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +ac_cv_search_connect=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif - int main () { -return f != connect; +connect (); ; return 0; } @@ -26613,30 +26447,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_connect=yes + ac_cv_search_connect="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 -if test $ac_cv_func_connect = yes; then - : -else - -echo "$as_me:$LINENO: checking for connect in -linet" >&5 -echo $ECHO_N "checking for connect in -linet... $ECHO_C" >&6 -if test "${ac_cv_lib_inet_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF +if test "$ac_cv_search_connect" = no; then + for ac_lib in inet; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -26680,27 +26502,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_inet_connect=yes + ac_cv_search_connect="-l$ac_lib" +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_inet_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + done fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_connect" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_connect" >&6 -if test $ac_cv_lib_inet_connect = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINET 1 -_ACEOF - - LIBS="-linet $LIBS" - +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_connect" >&5 +echo "${ECHO_T}$ac_cv_search_connect" >&6 +if test "$ac_cv_search_connect" != no; then + test "$ac_cv_search_connect" = "none required" || LIBS="$ac_cv_search_connect $LIBS" fi @@ -26708,7 +26526,7 @@ fi echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5 echo $ECHO_N "checking for type of socket length (socklen_t)... $ECHO_C" >&6 cat > conftest.$ac_ext < @@ -26719,7 +26537,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: socklen_t *" >&5 @@ -26731,7 +26549,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26742,7 +26560,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: size_t *" >&5 @@ -26754,7 +26572,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26765,7 +26583,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:26768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: int *" >&5 @@ -27529,7 +27347,7 @@ RDL_LIBS="" if test "${GCC}" != "yes" ; then case "${host}" in - *-*-hpux* ) + hppa*-*-hpux* ) CFLAGS="${CFLAGS} -Wp,-H30000" ;; *-dec-osf* ) @@ -27777,8 +27595,101 @@ fi ;; *) - MODULE_EXTENSION=".so" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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_exeext' + { (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 + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + libxml_have_shl_load=yes +else + + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -27844,18 +27755,105 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then - WITH_MODULES=1 - MODULE_PLATFORM_LIBS="-ldld" + MODULE_PLATFORM_LIBS="-ldld" + libxml_have_shl_load=yes +else -cat >>confdefs.h <<\_ACEOF -#define HAVE_SHLLOAD + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -fi +#ifdef __STDC__ +# include +#else +# include +#endif +#undef dlopen - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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_exeext' + { (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 + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + libxml_have_dlopen=yes +else + + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -27921,16 +27919,44 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then + MODULE_PLATFORM_LIBS="-ldl" + libxml_have_dlopen=yes +fi + +fi + +fi + +fi + + + if test "${libxml_have_shl_load}" = "yes"; then + MODULE_EXTENSION=".sl" WITH_MODULES=1 - MODULE_PLATFORM_LIBS="-ldl" cat >>confdefs.h <<\_ACEOF -#define HAVE_DLOPEN +#define HAVE_SHLLOAD _ACEOF + fi -fi + if test "${libxml_have_dlopen}" = "yes"; then + case "${host}" in + *-*-hpux* ) + MODULE_EXTENSION=".sl" + ;; + * ) + MODULE_EXTENSION=".so" + ;; + esac + WITH_MODULES=1 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DLOPEN +_ACEOF + + fi ;; esac fi @@ -31039,3 +31065,4 @@ fi chmod +x xml2-config python/setup.py +echo Done configuring diff --git a/configure.in b/configure.in index 6119d61..253b63a 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=22 +LIBXML_MICRO_VERSION=23 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 @@ -50,8 +50,6 @@ test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL -# AM_MAINTAINER_MODE - dnl dnl We process the AC_ARG_WITH first so that later we can modify dnl some of them to try to prevent impossible combinations. This @@ -432,11 +430,31 @@ dnl Checking the standard string functions availability AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, NEED_TRIO=1) +dnl Checking for va_copy availability +AC_MSG_CHECKING([for va_copy]) +AC_TRY_LINK([#include +va_list ap1,ap2;], [va_copy(ap1,ap2);], +have_va_copy=yes, +have_va_copy=no) +AC_MSG_RESULT($have_va_copy) +if test x"$have_va_copy" = x"yes"; then + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_MSG_CHECKING([for __va_copy]) + AC_TRY_LINK([#include + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + have___va_copy=yes, + have___va_copy=no) + AC_MSG_RESULT($have___va_copy) + if test x"$have___va_copy" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi +fi + dnl Checks for inet libraries: -AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) -AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) -AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(net, setsockopt)) -AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect)) +AC_SEARCH_LIBS(gethostent, [nsl]) +AC_SEARCH_LIBS(setsockopt, [socket net]) +AC_SEARCH_LIBS(connect, [inet]) dnl Determine what socket length (socklen_t) data type is AC_MSG_CHECKING([for type of socket length (socklen_t)]) @@ -569,7 +587,7 @@ dnl DEC : Enable NaN/Inf dnl if test "${GCC}" != "yes" ; then case "${host}" in - *-*-hpux* ) + hppa*-*-hpux* ) CFLAGS="${CFLAGS} -Wp,-H30000" ;; *-dec-osf* ) @@ -703,18 +721,34 @@ if test "$with_modules" != "no" ; then ]) ;; *) - MODULE_EXTENSION=".so" - AC_CHECK_LIB(dld, shl_load, [ + AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [ + AC_CHECK_LIB(dld, shl_load, [ + MODULE_PLATFORM_LIBS="-ldld" + libxml_have_shl_load=yes], [ + AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [ + AC_CHECK_LIB(dl, dlopen, [ + MODULE_PLATFORM_LIBS="-ldl" + libxml_have_dlopen=yes])])])]) + + if test "${libxml_have_shl_load}" = "yes"; then + MODULE_EXTENSION=".sl" WITH_MODULES=1 - MODULE_PLATFORM_LIBS="-ldld" AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) - ]) + fi - AC_CHECK_LIB(dl, dlopen, [ + if test "${libxml_have_dlopen}" = "yes"; then + case "${host}" in + *-*-hpux* ) + MODULE_EXTENSION=".sl" + ;; + * ) + MODULE_EXTENSION=".so" + ;; + esac + WITH_MODULES=1 - MODULE_PLATFORM_LIBS="-ldl" AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) - ]) + fi ;; esac fi @@ -1320,3 +1354,4 @@ ln -s Copyright COPYING AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py) chmod +x xml2-config python/setup.py +echo Done configuring diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index 36b401b..7763664 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -73,7 +73,9 @@ A:link, A:visited, A:active { text-decoration: underline }
Activation
xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
+
Actually
XML_SCHEMAS_TYPE_VARIETY_ABSENT
Add
xmlACatalogAdd
xmlAddChild
xmlAddChildList
@@ -96,7 +98,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCleanupGlobals
xmlInitGlobals
AegeanNumbers
xmlUCSIsAegeanNumbers
-
All
xmlNanoFTPGet
+
All
_xmlSchema
+_xmlSchemaType
+xmlNanoFTPGet
xmlNanoFTPList
xmlParseAttValue
xmlTextWriterEndDocument
@@ -203,6 +207,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseInNodeContext
xmlSAXParseEntity
Base
_xmlParserInput
+_xmlSchemaType
xmlNodeGetBase
BaseChar
IS_BASECHAR
IS_LETTER
@@ -230,6 +235,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Both
XML_SUBSTITUTE_BOTH
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
BoxDrawing
xmlUCSIsBoxDrawing
BraillePatterns
xmlUCSIsBraillePatterns
Brzozowski
xmlExpExpDerive
diff --git a/doc/APIchunk1.html b/doc/APIchunk1.html index 668482d..2736de5 100644 --- a/doc/APIchunk1.html +++ b/doc/APIchunk1.html @@ -301,6 +301,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlReconciliateNs
Correct
xmlSetCompressMode
xmlSetDocCompressMode
+
Could
_xmlSchemaType
Count
xmlLsCountNode
Creates
htmlNewDoc
htmlNewDocNoDtD
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html index 74cea54..c397308 100644 --- a/doc/APIchunk10.html +++ b/doc/APIchunk10.html @@ -55,6 +55,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellDir
xmlTextWriterWriteRawLen
above
xmlParseMarkupDecl
+xmlStreamWantsAnyNode
xmlXPathSubstringFunction
absent
XML_SCHEMAS_ELEM_BLOCK_ABSENT
XML_SCHEMAS_ELEM_BLOCK_EXTENSION
@@ -106,6 +107,7 @@ A:link, A:visited, A:active { text-decoration: underline }
account
xmlSchemaValidateFacetWhtsp
act
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
activate
xmlTextReaderSetParserProp
activated
DEBUG_MEMORY
xmlAutomataNewAllTrans
@@ -119,6 +121,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
activation
xmlGetLineNo
acts
xmlGetProp
@@ -162,6 +165,7 @@ A:link, A:visited, A:active { text-decoration: underline } attributeSAXFunc
htmlDocContentDumpFormatOutput
htmlDocContentDumpOutput
+htmlDocDumpMemoryFormat
htmlNodeDump
htmlNodeDumpFile
htmlNodeDumpFileFormat
@@ -196,6 +200,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathSubstringFunction
additional
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
+
additionally
xmlStreamWantsAnyNode
address
xmlModuleSymbol
xmlNewTextWriterDoc
adds
xmlAutomataNewAllTrans
@@ -362,6 +367,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoFTPProxy
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlTextReaderPreserve
xmlTextReaderPreservePattern
xmlXPathStringEvalNumber
@@ -415,7 +421,6 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_ANYATTR_SKIP
XML_SCHEMAS_ANYATTR_STRICT
XML_SCHEMAS_ELEM_NSDEFAULT
-_xmlSchema
xmlNamespaceParseNCName
xmlNamespaceParseNSDef
xmlNamespaceParseQName
@@ -525,11 +530,16 @@ A:link, A:visited, A:active { text-decoration: underline }
atomic
xmlGcMemGet
xmlGcMemSetup
attached
xmlTextReaderGetRemainder
-
attr
XML_SCHEMAS_ATTRGROUP_MARKED
+
attr
XML_SCHEMAS_ATTRGROUP_HAS_REFS
+XML_SCHEMAS_ATTRGROUP_MARKED
+XML_SCHEMAS_ATTRGROUP_REDEFINED
_xmlID
_xmlRef
+
attribute-
xmlStreamPushNode
attribute-list
xmlParseDefaultDecl
xmlParseEntityRef
+
attribute-node
xmlStreamPushAttr
+
attribute-nodes
xmlStreamWantsAnyNode
attributeFormDefault
XML_SCHEMAS_QUALIF_ATTR
augmented
docbParseDocument
htmlParseDocument
@@ -546,8 +556,11 @@ A:link, A:visited, A:active { text-decoration: underline }
autoclose
htmlAutoCloseTag
autoclosed
htmlIsAutoClosed
autogeneration
xmlKeepBlanksDefault
-
automatically
xmlCharEncOutFunc
+
automatically
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+xmlCharEncOutFunc
xmlNewTextChild
+xmlStrncatNew
+
automaton
_xmlSchemaType
autoreference
_xmlDoc
avoiding
xmlTextReaderNext
xmlTextReaderNextSibling
diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html index 763623f..ce2a617 100644 --- a/doc/APIchunk11.html +++ b/doc/APIchunk11.html @@ -58,10 +58,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewStringInputStream
xmlRelaxNGNewValidCtxt
xmlSchemaNewStringValue
-xmlSchemaNewValidCtxt
-xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
-xmlSchemaValidateStream
xmlSchematronNewValidCtxt
xmlSetCompressMode
xmlSetDocCompressMode
@@ -96,6 +92,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetParserProp
xmlTextReaderSetSchema
xmlValidGetValidElements
@@ -194,7 +191,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseElementMixedContentDecl
bracket
xmlParseCharData
branch
xmlDOMWrapRemoveNode
-xmlSchemaValidateOneElement
break
_xmlError
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
@@ -210,6 +206,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAllocParserInputBuffer
xmlFreeParserInputBuffer
xmlOutputBufferClose
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -264,7 +261,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaParse
xmlSchematronParse
xmlTextReaderNextSibling
-
built-in
xmlSchemaGetBuiltInListSimpleTypeItemType
+
built-in
_xmlSchemaType
+xmlSchemaGetBuiltInListSimpleTypeItemType
xmlSchemaGetBuiltInType
xmlSchemaIsBuiltInTypeFacet
xmlSchemaValidateFacetWhtsp
diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html index 9d1944e..6db6d0d 100644 --- a/doc/APIchunk12.html +++ b/doc/APIchunk12.html @@ -37,7 +37,8 @@ A:link, A:visited, A:active { text-decoration: underline } w-w x-x y-z -

Letter c:

calculates
xmlUTF8Size
+

Letter c:

calculated
xmlStrncatNew
+
calculates
xmlUTF8Size
calling
_xmlXPathContext
xmlBuildRelativeURI
xmlC14NDocDumpMemory
@@ -51,7 +52,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathSubValues
xmlXPathValueFlipSign
calls
xlinkNodeDetectFunc
-xmlSchemaSAXPlug
xmlXPathAxisFunc
came
xmlPopInput
cannot
xmlParseAttribute
@@ -121,6 +121,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlLoadCatalogs
category
xmlUCSIsCat
cause
xmlShellPrintXPathError
+
cdata-section-
xmlStreamPushNode
+xmlStreamWantsAnyNode
ceiling
xmlXPathCeilingFunction
certainly
xmlTextReaderGetRemainder
chained
xmlFreeNsList
@@ -128,10 +130,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCtxtResetLastError
xmlNanoFTPCwd
xmlParseSDDecl
-xmlRelaxNGParse
xmlResetLastError
xmlSchemaCollapseString
-xmlSchemaParse
xmlSchemaWhiteSpaceReplace
xmlSubstituteEntitiesDefault
xmlSwitchEncoding
@@ -318,6 +318,7 @@ A:link, A:visited, A:active { text-decoration: underline }
combining
IS_COMBINING_CH
come
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
coment
xmlTextWriterEndComment
comes
xmlValidityErrorFunc
xmlValidityWarningFunc
@@ -341,6 +342,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteFormatComment
xmlTextWriterWriteVFormatComment
xmlXPathIsNodeType
+
comment-
xmlStreamPushNode
+xmlStreamWantsAnyNode
comments
xmlC14NDocDumpMemory
xmlC14NDocSave
xmlC14NDocSaveTo
@@ -415,6 +418,9 @@ A:link, A:visited, A:active { text-decoration: underline } LIBXML_SCHEMATRON_ENABLED
LIBXML_TEST_VERSION
LIBXML_UNICODE_ENABLED
+_xmlSchemaAttribute
+_xmlSchemaElement
+_xmlSchemaFacet
xmlAutomataCompile
xmlCheckVersion
xmlExpDump
@@ -451,6 +457,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNodeGetBase
complex
XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
+_xmlSchemaType
complexType
XML_SCHEMAS_TYPE_ABSTRACT
XML_SCHEMAS_TYPE_BLOCK_DEFAULT
XML_SCHEMAS_TYPE_BLOCK_EXTENSION
@@ -459,6 +466,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_FINAL_RESTRICTION
XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
complicated
xmlBuildRelativeURI
+
component
_xmlSchemaType
components
_xmlSchema
compound
xmlXPathFreeNodeSet
xmlXPtrFreeLocationSet
@@ -580,7 +588,9 @@ A:link, A:visited, A:active { text-decoration: underline }
consist
xmlXPathNextAncestor
constant
XML_SAX2_MAGIC
xmlByteConsumed
-
constraint
_xmlSchemaWildcard
+
constraint
_xmlSchemaAttribute
+_xmlSchemaElement
+_xmlSchemaWildcard
_xmlSchemaWildcardNs
xmlParseEntityRef
xmlValidateNotationDecl
@@ -644,7 +654,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrlen
xmlXPathDistinct
xmlXPathDistinctSorted
-
contains
xmlCurrentChar
+
contains
XML_SCHEMAS_ATTRGROUP_HAS_REFS
+xmlCurrentChar
xmlParseEntityRef
xmlParsePEReference
xmlParserHandlePEReference
@@ -693,6 +704,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetParserErrors
xmlSchemaSetParserErrors
continuing
xmlXPathSubstringFunction
+
contraint
_xmlSchemaElement
contrary
xmlNodeListGetRawString
xmlXPathFreeNodeSetList
control
_xmlXPathContext
@@ -743,6 +755,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathStringFunction
xmlXPathStringLengthFunction
converter
xmlAllocOutputBuffer
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -782,6 +795,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
xmlValidateDtd
count
ftpListCallback
@@ -807,7 +821,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCreateEnumeration
xmlNewCatalog
xmlNewDtd
-xmlNewGlobalNs
xmlNewNs
creates
xmlAutomataNewAllTrans
xmlAutomataNewCountTrans
@@ -850,7 +863,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlMemGet
xmlMemUsed
xmlOutputBufferCreateFilename
-xmlSchemaValidateFile
custom
xmlDOMWrapAdoptNode
xmlSaveSetAttrEscape
xmlSaveSetEscape
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html index a44fa80..d286a7a 100644 --- a/doc/APIchunk13.html +++ b/doc/APIchunk13.html @@ -44,6 +44,8 @@ A:link, A:visited, A:active { text-decoration: underline }
day:minute
ftpListCallback
de-coupled
xmlValidateDtd
deactivated
xmlTextReaderRelaxNGSetSchema
+xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
deallocate
_xmlParserInput
xmlCleanupParser
@@ -112,7 +114,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathDebugDumpObject
decimal
xmlXPathStringFunction
decl
XML_SCHEMAS_ELEM_INTERNAL_CHECKED
-_xmlSchemaAttribute
xmlAddAttributeDecl
xmlNewDocElementContent
xmlNewElementContent
@@ -212,6 +213,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAX2StartElementNs
xmlTextReaderPreservePattern
xmlValidateDtd
+
defs
_xmlSchema
+_xmlSchemaElement
delayed
xmlOutputBufferWrite
xmlOutputBufferWriteEscape
xmlOutputBufferWriteString
@@ -248,18 +251,17 @@ A:link, A:visited, A:active { text-decoration: underline } xmlExpStringDerive
des
xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
-xmlTextReaderSchemaValidate
xmlTextReaderSetSchema
desactivated
xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
-xmlTextReaderSchemaValidate
xmlTextReaderSetSchema
descendant
xmlXPathNextDescendant
descendant-or-self
xmlXPathNextDescendantOrSelf
descendants
xmlXPathNextDescendant
xmlXPathNextDescendantOrSelf
xmlXPathNextFollowing
-
described
xmlValidateAttributeDecl
+
described
xmlStreamWantsAnyNode
+xmlValidateAttributeDecl
xmlValidateDocument
xmlValidateDocumentFinal
xmlValidateDtdFinal
@@ -350,7 +352,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAX2EndElementNs
xmlSAX2Reference
xmlSAX2StartElementNs
-xmlSchemaIsValid
detection
docbCreatePushParserCtxt
xlinkExtendedLinkFunk
xlinkExtendedLinkSetFunk
@@ -378,6 +379,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlPatterncompile
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
dictionnary
_xmlParserCtxt
_xmlXPathContext
xmlDictCreate
@@ -586,9 +588,7 @@ A:link, A:visited, A:active { text-decoration: underline }
duplicates
xmlSchemaCopyValue
duration
xmlSchemaGetCanonValue
during
xmlSAXDefaultVersion
-xmlSchemaIsValid
xmlSchemaNewDocParserCtxt
-xmlSchemaSetValidOptions
xmlSchematronNewDocParserCtxt
dynamic
LIBXML_MODULE_EXTENSION

A-B diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html index 5c7e274..c093285 100644 --- a/doc/APIchunk14.html +++ b/doc/APIchunk14.html @@ -70,9 +70,12 @@ A:link, A:visited, A:active { text-decoration: underline } resolveEntitySAXFunc
xmlSAX2ResolveEntity

elem
XML_SCHEMAS_ELEM_INTERNAL_CHECKED
-
element-
xmlXPathOrderDocElems
+
element-
xmlStreamPushNode
+xmlXPathOrderDocElems
element-node
xmlDOMWrapReconcileNamespaces
+xmlStreamPush
element-nodes
xmlDOMWrapReconcileNamespaces
+xmlStreamWantsAnyNode
elementFormDefault
XML_SCHEMAS_QUALIF_ELEM
elementdecl
xmlParseElementDecl
xmlParseMarkupDecl
@@ -256,6 +259,35 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathConvertBoolean
xmlXPathConvertNumber
xmlXPathConvertString
+
errors
INPUT_CHUNK
+_xmlSAXHandler
+_xmlSAXHandlerV1
+_xmlValidCtxt
+_xmlXPathContext
+fatalErrorSAXFunc
+initGenericErrorDefaultFunc
+xmlCharEncOutFunc
+xmlCheckHTTPInput
+xmlDOMWrapAdoptNode
+xmlDOMWrapReconcileNamespaces
+xmlDOMWrapRemoveNode
+xmlDebugCheckDocument
+xmlExpGetLanguage
+xmlExpGetStart
+xmlHashAddEntry
+xmlHashAddEntry2
+xmlHashAddEntry3
+xmlRelaxNGGetParserErrors
+xmlRelaxNGSetParserErrors
+xmlSchemaGetCanonValue
+xmlSchemaGetCanonValueWhtsp
+xmlSchemaGetParserErrors
+xmlSchemaSetParserErrors
+xmlSchemaValueAppend
+xmlSchemaValueGetAsString
+xmlSchemaValueGetNext
+xmlShellCmd
+xmlStreamWantsAnyNode
errror
xmlDOMWrapNewCtxt
escape
docbEncodeEntities
htmlEncodeEntities
@@ -277,7 +309,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveSetEscape
especially
xmlExpParse
established
xmlNanoFTPUpdateURL
-
etc
xmlDocGetRootElement
+
etc
_xmlSchemaFacet
+xmlDocGetRootElement
xmlDocSetRootElement
xmlParseInNodeContext
evaluate
xmlXPathEvalExpr
@@ -309,11 +342,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseBalancedChunkMemoryRecover
xmlTextWriterFullEndElement
xmlXPathRoundFunction
-
event
xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
-xmlSchemaValidateStream
events
htmlSAXParseDoc
-xmlSchemaValidateStream
ever
xmlExpCtxtNbCons
everywhere
xmlSAXParseFileWithData
xmlSAXParseMemoryWithData
@@ -375,6 +404,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchematronNewParserCtxt
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
experimental
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
xmlDOMWrapRemoveNode
diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html index da7f8f7..c6452a2 100644 --- a/doc/APIchunk15.html +++ b/doc/APIchunk15.html @@ -55,6 +55,7 @@ A:link, A:visited, A:active { text-decoration: underline }
facets
XML_SCHEMAS_TYPE_FACETSNEEDVALUE
XML_SCHEMAS_TYPE_HAS_FACETS
XML_SCHEMAS_TYPE_NORMVALUENEEDED
+_xmlSchemaType
xmlSchemaCheckFacet
facility
xmlExpCtxtNbCons
xmlExpCtxtNbNodes
@@ -102,7 +103,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXParseMemoryWithData
far
_xmlParserCtxt
fatalErrorSAXFunc
-xmlSchemaIsValid
fashion
xmlNewRMutex
fast
htmlInitAutoClose
faster
htmlNodeStatus
@@ -118,6 +118,8 @@ A:link, A:visited, A:active { text-decoration: underline }
fed
xmlCreatePushParserCtxt
xmlNewTextReader
xmlNewTextReaderFilename
+xmlStreamPushNode
+xmlStreamWantsAnyNode
fetch
xmlNanoFTPGetSocket
xmlNanoFTPOpen
xmlNanoHTTPFetch
@@ -202,7 +204,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderIsValid
flagged
_htmlElemDesc
htmlGetMetaEncoding
-
flags
_xmlXPathContext
+
flags
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+_xmlXPathContext
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
xmlPatterncompile
@@ -222,9 +225,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStringLenGetNodeList
floor
xmlXPathFloorFunction
flow
xmlScanName
-xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
-xmlSchemaValidateStream
flushes
xmlOutputBufferClose
xmlOutputBufferFlush
follow
xmlAutomataNewNegTrans
@@ -285,6 +285,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteVFormatString
formatting
htmlDocContentDumpFormatOutput
+htmlDocDumpMemoryFormat
htmlNodeDump
htmlNodeDumpFile
htmlNodeDumpFileFormat
@@ -307,7 +308,6 @@ A:link, A:visited, A:active { text-decoration: underline } htmlSAXParseFile
xmlParseCtxtExternalEntity
xmlParseExternalEntity
-
forward
xmlSchemaValidateStream
fptr
XML_CAST_FPTR
fragment
_xmlURI
xmlNewDocFragment
@@ -381,10 +381,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGSetParserErrors
xmlRelaxNGSetValidErrors
xmlRelaxNGSetValidStructuredErrors
-xmlSchemaGetValidErrors
xmlSchemaSetParserErrors
-xmlSchemaSetValidErrors
-xmlSchemaSetValidStructuredErrors
+xmlSchemaSetParserStructuredErrors
xmlShellCmd
xmlSwitchEncoding
xmlSwitchInputEncoding
@@ -396,7 +394,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidCtxtNormalizeAttributeValue
xmlValidNormalizeAttributeValue
xmlXIncludeSetFlags
-
future
xmlSchemaValidateFile

A-B C-C D-E diff --git a/doc/APIchunk16.html b/doc/APIchunk16.html index d04b049..dcc30f1 100644 --- a/doc/APIchunk16.html +++ b/doc/APIchunk16.html @@ -161,12 +161,13 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathFloorFunction
xmlXPathSubstringFunction

greater-than
xmlNewTextChild
-
group
XML_SCHEMAS_ATTRGROUP_MARKED
+
group
XML_SCHEMAS_ATTRGROUP_HAS_REFS
+XML_SCHEMAS_ATTRGROUP_MARKED
+XML_SCHEMAS_ATTRGROUP_REDEFINED
XML_SCHEMAS_ELEM_FINAL_ABSENT
XML_SCHEMAS_ELEM_FINAL_EXTENSION
XML_SCHEMAS_ELEM_FINAL_RESTRICTION
XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD
-_xmlSchemaAttribute
_xmlSchemaAttributeGroup
_xmlSchemaElement
ftpListCallback
@@ -275,8 +276,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetBuiltInListSimpleTypeItemType
highly
htmlParseElement
xmlParseElement
-xmlRelaxNGParse
-xmlSchemaParse
hold
xmlDOMWrapReconcileNamespaces
xmlNewTextWriterDoc
xmlNewTextWriterPushParser
diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html index 22d1024..eabec9f 100644 --- a/doc/APIchunk17.html +++ b/doc/APIchunk17.html @@ -40,6 +40,8 @@ A:link, A:visited, A:active { text-decoration: underline }

Letter i:

iconv
LIBXML_ICONV_ENABLED
LIBXML_ISO8859X_ENABLED
identify
xmlParseAttributeType
+
identity-constraint
_xmlSchema
+_xmlSchemaElement
ignorable
ignorableWhitespace
ignorableWhitespaceSAXFunc
xmlIsBlankNode
@@ -130,6 +132,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoFTPList
xmlNanoHTTPFetch
xmlNanoHTTPSave
+
incl
_xmlSchemaType
include
XINCLUDE_NODE
xmlC14NDocDumpMemory
xmlC14NDocSave
@@ -217,6 +220,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPOpenRedir
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
indicates
XML_SCHEMAS_TYPE_FACETSNEEDVALUE
XML_SCHEMAS_TYPE_INTERNAL_INVALID
XML_SCHEMAS_TYPE_INTERNAL_RESOLVED
@@ -288,7 +292,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewTextReader
xmlRelaxNGGetParserErrors
xmlSchemaGetParserErrors
-xmlSchemaValidateStream
xmlTextReaderByteConsumed
xmlXPathOrderDocElems
informations
_xmlAttr
@@ -313,13 +316,12 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxParserSetFlag
xmlSAX2EndElementNs
xmlSAX2StartElementNs
-xmlSchemaGetValidErrors
-xmlSchemaSetValidErrors
xmlShellDir
xmlXIncludeProcessNode
informative
_xmlError
infos
_xmlParserCtxt
inherited
_xmlParserCtxt
+_xmlSchemaType
xmlEntityReferenceFunc
xmlNodeGetSpacePreserve
xmlXPathNextAttribute
@@ -327,6 +329,7 @@ A:link, A:visited, A:active { text-decoration: underline }
inherits
xmlNewChild
xmlNewTextChild
initial
_xmlDoc
+_xmlSchemaAttribute
xmlAutomataGetInitState
xmlBufferCreateSize
xmlInitNodeInfoSeq
@@ -442,8 +445,6 @@ A:link, A:visited, A:active { text-decoration: underline } htmlParseDocument
xmlParseDocument
xmlParseReference
-xmlRelaxNGParse
-xmlSchemaParse
xmlTextReaderCurrentDoc
xmlTextReaderCurrentNode
interfaces
LIBXML_AUTOMATA_ENABLED
@@ -463,7 +464,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGNewDocParserCtxt
xmlRemoveID
xmlRemoveRef
-xmlSchemaValidateFile
interned
xmlPatterncompile
xmlTextReaderConstString
interning
xmlCopyNodeList
diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index 8bc0157..51e8c2a 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -73,8 +73,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathOrderDocElems
keyword
xmlParseDefaultDecl
kill
xmlCheckVersion
-
kind
_xmlSchemaAttribute
-_xmlSchemaAttributeGroup
+
kind
_xmlSchemaAttributeGroup
_xmlSchemaElement
_xmlSchemaFacet
_xmlSchemaNotation
@@ -134,8 +133,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRootNode
xmlSaveFileTo
xmlSaveFormatFileTo
-xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
leading
xmlParseAttValue
xmlParseElementChildrenContentDecl
xmlParseElementMixedContentDecl
diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html index cecaf32..c54ee8d 100644 --- a/doc/APIchunk19.html +++ b/doc/APIchunk19.html @@ -51,7 +51,6 @@ A:link, A:visited, A:active { text-decoration: underline }
main
xmlIsMainThread
maintained
xmlRemoveID
xmlRemoveRef
-xmlSchemaSAXPlug
major
xmlDecodeEntities
make
xmlCreateEntitiesTable
xmlNewNode
@@ -149,12 +148,14 @@ A:link, A:visited, A:active { text-decoration: underline } xmlExpMaxToken
xmlExpNewCtxt
xmlPatternMaxDepth
+
maybe
_xmlSchemaElement
mean
xmlPatternMinDepth
means
xmlExpNewRange
xmlSetGenericErrorFunc
xmlSetStructuredErrorFunc
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
mechanism
_xmlXPathContext
xmlStructuredErrorFunc
xmlXPathRegisterFuncLookup
@@ -177,6 +178,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteVFormatString
xmlXPathStringFunction
+
member-types
_xmlSchemaType
memo
getSystemId
xmlSAX2GetSystemId
memorylist
xmlMemDisplay
@@ -259,7 +261,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXParseMemory
xmlSAXParseMemoryWithData
xmlSetCompressMode
-
model
xmlValidBuildContentModel
+
model
_xmlSchemaType
+xmlValidBuildContentModel
modified
xmlBufferCreateStatic
xmlNodeAddContent
xmlNodeAddContentLen
diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index 9a0e7ab..85de2bb 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -133,15 +133,6 @@ A:link, A:visited, A:active { text-decoration: underline }
DefaultDecl
xmlParseAttributeListDecl
xmlParseDefaultDecl
Deletes
xmlListDelete
-
Deprecated
_xmlSchema
-htmlAttrAllowed
-xmlCleanupPredefinedEntities
-xmlCopyElementContent
-xmlFreeElementContent
-xmlInitializePredefinedEntities
-xmlNewElementContent
-xmlParseQuotedString
-xmlSprintfElementContent
Depth
_xmlParserCtxt
_xmlValidCtxt
Dereference
xmlExpFree
@@ -155,6 +146,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderIsNamespaceDecl
xmlTextReaderStandalone
Devanagari
xmlUCSIsDevanagari
+
Different
xmlStreamPushNode
Digit
IS_DIGIT
xmlNamespaceParseNCName
xmlParseName
diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index 01db33a..9d751f3 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -80,7 +80,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathLangFunction
nearly
xmlSAXParseFileWithData
xmlSAXParseMemoryWithData
-
necessary
_htmlElemDesc
+
necessary
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+_htmlElemDesc
xmlCheckUTF8
xmlDebugDumpString
need
WITH_TRIO
@@ -101,6 +102,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRegExecErrInfo
xmlRegExecNextValues
xmlSchemaNewStringValue
+xmlStreamWantsAnyNode
xmlValidGetValidElements
xmlXPathNewContext
needed
_xmlParserCtxt
@@ -116,7 +118,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseElementChildrenContentDecl
xmlParseElementMixedContentDecl
xmlReconciliateNs
-xmlSchemaSAXPlug
xmlSetBufferAllocationScheme
xmlShellPwd
xmlStrncat
@@ -136,6 +137,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrstr
needs
xmlEntityReferenceFunc
xmlSchemaValidateFacetWhtsp
+xmlStreamWantsAnyNode
xmlXPathNodeSetFreeNs
negated
_xmlSchemaWildcard
negative
xmlC14NDocDumpMemory
@@ -215,7 +217,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlIsLetter
xmlSAX2InitDefaultSAXHandler
xmlXPathBooleanFunction
-
none
getNamespace
+
none
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+getNamespace
xmlDecodeEntities
xmlGetLastChild
xmlOutputBufferCreateFilename
@@ -265,7 +268,6 @@ A:link, A:visited, A:active { text-decoration: underline } _xmlSchema
_xmlSchemaElement
xmlDecodeEntities
-xmlNewGlobalNs
xmlParserHandleReference
xmlScanName
ns-decls
xmlDOMWrapAdoptNode
diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html index 6789f9d..13518b1 100644 --- a/doc/APIchunk21.html +++ b/doc/APIchunk21.html @@ -50,11 +50,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathMultValues
xmlXPathSubValues
obligated
xmlParseEntityRef
-
obsolete
_xmlSchemaAttribute
-xmlNormalizeWindowsPath
+
obsolete
xmlNormalizeWindowsPath
obsolete:
XML_SCHEMAS_ELEM_TOPLEVEL
occupied
xmlCanonicPath
-
occur
xmlParseComment
+
occur
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+xmlParseComment
xmlParseMarkupDecl
occured
xmlCtxtGetLastError
xmlDictCreate
@@ -152,6 +152,7 @@ A:link, A:visited, A:active { text-decoration: underline }
onto
xmlParserInputBufferGrow
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
opaque
_xmlSchema
_xmlURI
open
htmlCtxtReadFd
@@ -222,7 +223,6 @@ A:link, A:visited, A:active { text-decoration: underline }
option
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
xmlGetLineNo
-xmlSchemaValidCtxtGetOptions
optional
XML_SCHEMAS_ATTR_USE_OPTIONAL
docbCreatePushParserCtxt
htmlCreatePushParserCtxt
@@ -244,7 +244,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseMisc
xmlPatterncompile
xmlSchemaCheckFacet
-xmlSchemaValidateStream
xmlShellSave
xmlShellValidate
xmlURIUnescapeString
@@ -252,12 +251,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCtxtUseOptions
xmlDOMWrapRemoveNode
xmlModuleOpen
+xmlSaveToBuffer
xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
-xmlSchemaSetValidOptions
-xmlSchemaValidCtxtGetOptions
-xmlSchemaValidateFile
+xmlTextReaderSchemaValidateCtxt
ordered
xmlListAppend
xmlListInsert
xmlXPathNextAncestor
@@ -278,14 +276,14 @@ A:link, A:visited, A:active { text-decoration: underline }
oriented
xmlValidityErrorFunc
xmlValidityWarningFunc
origin
_xmlXPathContext
-
original
xmlCharEncodingInputFunc
+
original
_xmlSchemaElement
+_xmlSchemaFacet
+xmlCharEncodingInputFunc
xmlCopyError
xmlGetEncodingAlias
xmlListMerge
xmlParseEntityValue
xmlParseURIRaw
-xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
xmlShellSave
xmlStrcat
xmlStrncat
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index 42008e7..fdec580 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -81,8 +81,6 @@ A:link, A:visited, A:active { text-decoration: underline }
partial
xmlOutputBufferWrite
xmlOutputBufferWriteEscape
xmlOutputBufferWriteString
-
particle
_xmlSchemaAttribute
-_xmlSchemaElement
particular
_xmlNodeSet
pass
xmlCurrentChar
xmlRelaxParserSetFlag
@@ -137,7 +135,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlPatternStreamable
xmlPatterncompile
xmlSchemaValidateFacetWhtsp
+xmlStreamWantsAnyNode
xmlTextReaderPreservePattern
+
patterns
_xmlSchemaFacet
pcdata
cdataBlock
cdataBlockSAXFunc
xmlSAX2CDataBlock
@@ -179,8 +179,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlReconciliateNs
xmlRegExecErrInfo
xmlRegExecNextValues
-xmlSchemaSAXPlug
-xmlSchemaSAXUnplug
xmlValidGetValidElements
points
_xmlChRangeGroup
pop
xmlPopInput
@@ -199,8 +197,36 @@ A:link, A:visited, A:active { text-decoration: underline }
positioned
xmlTextReaderReadString
positionned
xmlTextReaderReadAttributeValue
positions
xmlUTF8Strsub
-
possible
_xmlSchemaType
-xmlCopyNodeList
+
positive
UTF8ToHtml
+UTF8Toisolat1
+docbEncodeEntities
+htmlEncodeEntities
+isolat1ToUTF8
+xmlBufferAdd
+xmlBufferAddHead
+xmlBufferCCat
+xmlBufferCat
+xmlCharEncodingInputFunc
+xmlCharEncodingOutputFunc
+xmlRelaxNGValidateDoc
+xmlSchemaCheckFacet
+xmlSchemaValPredefTypeNode
+xmlSchemaValPredefTypeNodeNoNorm
+xmlSchemaValidateFacet
+xmlSchemaValidateFacetWhtsp
+xmlSchemaValidateLengthFacet
+xmlSchemaValidateLengthFacetWhtsp
+xmlSchemaValidateListSimpleTypeFacet
+xmlSchemaValidatePredefinedType
+xmlTextReaderPreservePattern
+xmlValidateNCName
+xmlValidateNMToken
+xmlValidateName
+xmlValidateQName
+xmlXPathBooleanFunction
+xmlXPathFloorFunction
+xmlXPathStringFunction
+
possible
xmlCopyNodeList
xmlCreateEntityParserCtxt
xmlParseDefaultDecl
xmlParseExternalID
@@ -210,6 +236,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
xmlValidateDtdFinal
possibly
xmlDocGetRootElement
@@ -249,7 +276,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlPatternStreamable
xmlRegNewExecCtxt
xmlRelaxNGNewValidCtxt
-xmlSchemaNewValidCtxt
xmlSchematronNewValidCtxt
xmlTextReaderRelaxNGSetSchema
xmlTextReaderSetSchema
@@ -403,8 +429,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
processing-instruction
xmlXPathIsNodeType
+
processing-instruction-node
xmlStreamPushNode
+
processing-instruction-nodes
xmlStreamWantsAnyNode
processor
xmlCurrentChar
xmlParseAttValue
xmlParseEntityRef
@@ -425,6 +454,7 @@ A:link, A:visited, A:active { text-decoration: underline }
progresses
xmlRegNewExecCtxt
progressive
_xmlParserCtxt
xmlAllocParserInputBuffer
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -484,7 +514,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlOutputMatchCallback
xmlSaveFormatFile
xmlSaveFormatFileEnc
-xmlSchemaValidateStream
xmlUTF8Strloc
xmlUTF8Strpos
provides
endElementNsSAX2Func
@@ -519,6 +548,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStreamPop
xmlXPathEvalExpr
pushed
xmlRegExecErrInfo
+xmlStreamPushNode
+xmlStreamWantsAnyNode
xmlXPathFunction
pushing
xmlParsePEReference
put
xmlCatalogAdd
diff --git a/doc/APIchunk23.html b/doc/APIchunk23.html index d5a969d..b217f1c 100644 --- a/doc/APIchunk23.html +++ b/doc/APIchunk23.html @@ -116,8 +116,7 @@ A:link, A:visited, A:active { text-decoration: underline }
read-only
xmlDictCreateSub
readable
xmlStrEqual
reader-
xmlTextReaderGetRemainder
-
reading
xmlSchemaValidateStream
-xmlShell
+
reading
xmlShell
ready
INPUT_CHUNK
xmlAutomataCompile
realloc
_xmlBuffer
@@ -212,9 +211,9 @@ A:link, A:visited, A:active { text-decoration: underline }
recursively
xmlLoadACatalog
xmlParseAttValue
redeclared
xmlReconciliateNs
-
redef
_xmlSchemaAttributeGroup
+
redefined
XML_SCHEMAS_ATTRGROUP_REDEFINED
+XML_SCHEMAS_TYPE_REDEFINED
redefinition
xmlErrMemory
-
redefinitions
_xmlSchemaType
redir
xmlNanoHTTPMethodRedir
redirected
xmlNanoHTTPMethodRedir
xmlNanoHTTPOpenRedir
@@ -235,10 +234,10 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAddRef
xmlFreeRefTable
xmlNewCharRef
-
referenced
_xmlSchemaAttributeGroup
-xmlLinkGetData
+
referenced
xmlLinkGetData
xmlParseAttValue
-
references
XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
+
references
XML_SCHEMAS_ATTRGROUP_HAS_REFS
+XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
XML_SCHEMAS_ELEM_CIRCULAR
XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
htmlParseEntityRef
@@ -268,6 +267,7 @@ A:link, A:visited, A:active { text-decoration: underline }
refs
_xmlDoc
_xmlParserCtxt
refuse
xmlNewNs
+
regex
_xmlSchemaFacet
regexp
_xmlElement
xmlAutomataCompile
xmlRegExecErrInfo
@@ -397,7 +397,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlHashUpdateEntry2
xmlHashUpdateEntry3
xmlNewTextChild
-xmlSchemaSAXPlug
xmlXPathTranslateFunction
replacement
xmlACatalogAdd
xmlCatalogAdd
@@ -474,6 +473,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSetStructuredErrorFunc
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
resides
xmlTextReaderConstXmlLang
xmlTextReaderXmlLang
resize
xmlBufferResize
@@ -504,7 +504,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGFreeParserCtxt
xmlRelaxNGFreeValidCtxt
xmlSchemaFreeParserCtxt
-xmlSchemaFreeValidCtxt
xmlSchematronFreeParserCtxt
xmlSchematronFreeValidCtxt
xmlTextReaderClose
@@ -516,8 +515,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPContentLength
responsible
xmlC14NDocDumpMemory
xmlCanonicPath
-
restored
xmlSchemaSAXUnplug
-xmlTextReaderSetErrorHandler
+
restored
xmlTextReaderSetErrorHandler
xmlTextReaderSetStructuredErrorHandler
restrict
xmlParseExternalID
restriction
XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION
@@ -586,7 +584,6 @@ A:link, A:visited, A:active { text-decoration: underline } internalSubsetSAXFunc
xmlDocGetRootElement
xmlDocSetRootElement
-xmlNewGlobalNs
xmlParseDocTypeDecl
xmlParseNamespace
xmlPatternFromRoot
@@ -595,6 +592,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellPwd
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlValidateRoot
xmlXPathNewValueTree
xmlXPathRoot
diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html index ed6bc81..63d494b 100644 --- a/doc/APIchunk24.html +++ b/doc/APIchunk24.html @@ -80,6 +80,7 @@ A:link, A:visited, A:active { text-decoration: underline }
saving
LIBXML_OUTPUT_ENABLED
LIBXML_WRITER_ENABLED
xmlKeepBlanksDefault
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -89,6 +90,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveFlush
xmlSaveSetAttrEscape
xmlSaveSetEscape
+xmlSaveToBuffer
xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
@@ -124,13 +126,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetFacetValueAsULong
xmlSchemaGetValType
xmlSchemaNewMemParserCtxt
-xmlSchemaValidateDoc
xmlSchemaValidateFacet
xmlSchemaValidateFacetWhtsp
-xmlSchemaValidateFile
-xmlSchemaValidateStream
xmlSchematronNewMemParserCtxt
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
schematron
xmlSchematronValidateDoc
scheme
_xmlURI
xmlBufferSetAllocationScheme
@@ -186,8 +186,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidateOneElement
xmlValidateOneNamespace
seq
xmlParseElementChildrenContentDecl
-
sequence
_xmlSchemaElement
-_xmlSchemaFacet
+
sequence
_xmlSchemaFacet
_xmlSchemaType
xmlCharEncOutFunc
xmlClearNodeInfoSeq
@@ -214,6 +213,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathNormalizeFunction
sequqnce
xmlExpIsNillable
serialization
LIBXML_OUTPUT_ENABLED
+xmlSaveToBuffer
xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
@@ -221,7 +221,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellWrite
xmlValidatePopElement
xmlValidatePushElement
-
serializing
xmlSaveToFd
+
serializing
xmlSaveToBuffer
+xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
server
_xmlURI
@@ -327,6 +328,7 @@ A:link, A:visited, A:active { text-decoration: underline }
simple
XML_SCHEMAS_TYPE_ABSTRACT
XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
+_xmlSchemaType
xlinkSimpleLinkFunk
xmlAttrSerializeTxtContent
xmlFreeMutex
@@ -348,7 +350,8 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_VARIETY_UNION
simply
xmlSetGenericErrorFunc
xmlSetStructuredErrorFunc
-
since
xmlBuildRelativeURI
+
since
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+xmlBuildRelativeURI
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
xmlParseExternalID
@@ -438,6 +441,7 @@ A:link, A:visited, A:active { text-decoration: underline }
spaces
_xmlParserCtxt
htmlDocContentDumpFormatOutput
htmlDocContentDumpOutput
+htmlDocDumpMemoryFormat
htmlNodeDumpFileFormat
htmlNodeDumpFormatOutput
htmlNodeDumpOutput
@@ -555,7 +559,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewCharRef
xmlNewTextWriterTree
xmlSaveTree
-xmlSchemaValidateOneElement
xmlXPathOrderDocElems
xmlXPathSubstringFunction
xmlXPtrNewCollapsedRange
@@ -646,8 +649,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrdup
xmlStrdupFunc
streamable
xmlPatternStreamable
-xmlSchemaValidateFile
streaming
xmlPatternGetStreamCtxt
+xmlStreamWantsAnyNode
streams
_xmlParserCtxt
xmlSkipBlankChars
strict
XML_SCHEMAS_ANYATTR_STRICT
@@ -669,8 +672,10 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRegExecErrInfo
xmlRegExecNextValues
xmlRegexpCompile
+xmlStrEqual
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlStrncatNew
stripping
xmlXPathNormalizeFunction
strncasecmp
xmlStrncasecmp
@@ -690,7 +695,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaNewQNameValue
xmlSchemaNewStringValue
structured
xmlRelaxNGSetValidStructuredErrors
-xmlSchemaSetValidStructuredErrors
+xmlSchemaSetParserStructuredErrors
xmlSetStructuredErrorFunc
structures
xmlFreeDoc
xmlFreeNs
@@ -715,8 +720,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlExpSubsume
subexpressions
xmlExpParse
subject
xmlParseSDDecl
-xmlRelaxNGParse
-xmlSchemaParse
sublanguage
xmlXPathLangFunction
submits
xmlRegisterHTTPPostCallbacks
subsequent
xmlIOHTTPOpenW
@@ -763,7 +766,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlReconciliateNs
xmlRelaxNGValidateFullElement
xmlSaveTree
-xmlSchemaValidateOneElement
xmlShellDu
xmlShellWrite
xmlTextReaderExpand
diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html index 98b46a8..594667e 100644 --- a/doc/APIchunk25.html +++ b/doc/APIchunk25.html @@ -101,6 +101,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathNotEqualValues
tested
_xmlParserInput
testing
xmlRegexpCompile
+
text-
xmlStreamPushNode
+xmlStreamWantsAnyNode
text-node
xmlIsBlankNode
textDecl?
xmlParseExternalSubset
than
xmlCheckUTF8
@@ -166,6 +168,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlHashUpdateEntry3
xmlXPathSubstringFunction
xmlXPathTranslateFunction
+
this?
_xmlSchemaType
those
xmlCheckLanguageID
xmlKeepBlanksDefault
xmlParseSDDecl
@@ -400,15 +403,17 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPtrLocationSetMerge
xmlXPtrNewLocationSetNodes
two-character
xmlCurrentChar
-
typ
_xmlSchemaTypeLink
+
type:
xmlStreamPushNode
typefixed
XML_SCHEMAS_TYPE_INTERNAL_RESOLVED
types
XML_SCHEMAS_FACET_COLLAPSE
+_xmlSchemaType
_xmlXPathContext
xmlExternalEntityLoader
xmlParseSDDecl
xmlSchemaGetCanonValue
xmlSchemaNewStringValue
xmlSchemaValidateFacetWhtsp
+xmlStreamWantsAnyNode
typo
xmlParseTextDecl

A-B C-C diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html index 8a0befa..0f38063 100644 --- a/doc/APIchunk26.html +++ b/doc/APIchunk26.html @@ -68,6 +68,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_FINAL_UNION
XML_SCHEMAS_TYPE_VARIETY_ATOMIC
XML_SCHEMAS_TYPE_VARIETY_UNION
+_xmlSchemaType
xmlXPathIdFunction

unique
_xmlParserInput
_xmlSchema
@@ -117,7 +118,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseEntityRef
xmlParserHandleReference
xmlSAX2UnparsedEntityDecl
-
unplug
xmlSchemaSAXPlug
unpredictable
UTF8ToHtml
UTF8Toisolat1
docbEncodeEntities
@@ -150,7 +150,6 @@ A:link, A:visited, A:active { text-decoration: underline } _xmlXPathContext
xmlDOMWrapReconcileNamespaces
xmlDOMWrapRemoveNode
-xmlSchemaValidateFile
xmlShellBase
xmlShellCat
xmlShellDir
@@ -182,6 +181,8 @@ A:link, A:visited, A:active { text-decoration: underline }
usage
xmlGetBufferAllocationScheme
xmlSetBufferAllocationScheme
used:
XML_DEFAULT_VERSION
+
used?
_xmlSchemaAttribute
+_xmlSchemaElement
useful
xmlGcMemGet
xmlGcMemSetup
xmlNewRMutex
diff --git a/doc/APIchunk27.html b/doc/APIchunk27.html index 2db1f05..a5257c9 100644 --- a/doc/APIchunk27.html +++ b/doc/APIchunk27.html @@ -63,9 +63,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGSetValidErrors
xmlSAX2InitDefaultSAXHandler
xmlSchemaGetParserErrors
-xmlSchemaGetValidErrors
xmlSchemaSetParserErrors
-xmlSchemaSetValidErrors
xmlSearchNs
xmlTextReaderSetErrorHandler
xmlTextReaderSetStructuredErrorHandler
@@ -115,7 +113,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCheckLanguageID
xmlKeepBlanksDefault
xmlMemShow
-xmlSchemaIsValid
xmlXIncludeProcess
xmlXIncludeProcessFlags
xmlXIncludeProcessNode
diff --git a/doc/APIchunk28.html b/doc/APIchunk28.html index 232b492..8fb67a9 100644 --- a/doc/APIchunk28.html +++ b/doc/APIchunk28.html @@ -109,7 +109,9 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlBuffer
xmlCharEncFirstLine
xmlCharEncInFunc
xmlCharEncOutFunc
+xmlOutputBufferCreateBuffer
xmlBufferPtr
xmlNewTextWriterMemory
+xmlOutputBufferCreateBuffer
xmlBuildURI
xmlBuildRelativeURI
xmlBytesConsumed
xmlTextReaderByteConsumed
xmlCatalogAllow
xmlCatalogGetDefaults
@@ -339,6 +341,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlPatternGetStreamCtxt
xmlPatternStreamable
xmlPatterncompile
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlPopInput:
xmlPopInput
xmlPushInput:
xmlPushInput
xmlRFreeMutex
xmlFreeRMutex
@@ -385,22 +388,20 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlSAX2StartDocument
startDocument
xmlSAX2StartElement
startElement
xmlSAX2UnparsedEntityDecl
unparsedEntityDecl
-
xmlSAXHandlerPtr
xmlSchemaSAXPlug
xmlSAXVersion
xmlSAXDefaultVersion
-
xmlSaveOptions
xmlSaveToFd
+
xmlSaveOptions
xmlSaveToBuffer
+xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
-
xmlSchemaAttributeGroupPtr
_xmlSchemaAttributeGroup
-
xmlSchemaSAXPlug
xmlSchemaSAXUnplug
xmlSchemaValType
xmlSchemaGetValType
-
xmlSchemaValidOption
xmlSchemaSetValidOptions
xmlSchematronValidOptions
xmlSchematronNewValidCtxt
xmlSetExternalEntityLoader
resolveEntity
resolveEntitySAXFunc
xmlSAX2ResolveEntity
xmlSnprintfElementContent
xmlSprintfElementContent
-
xmlStrEqual
xmlStrEqual
+
xmlStrcmp
xmlStrEqual
xmlStrdup
xmlNewNode
+
xmlStreamPush
xmlStreamPushNode
xmlStringDecodeEntities
xmlDecodeEntities
xmlStringGetNodeList
xmlParseAttValue
xmlStrncat
xmlStrncatNew
diff --git a/doc/APIchunk29.html b/doc/APIchunk29.html index e9edd2c..3469fca 100644 --- a/doc/APIchunk29.html +++ b/doc/APIchunk29.html @@ -54,6 +54,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveTree
xmlSchemaGetCanonValue
xmlSchemaGetCanonValueWhtsp
+xmlTextReaderSchemaValidateCtxt
you
xmlNewDocNode
xmlNewDocNodeEatName
xmlNewTextChild
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html index e2ac654..7d6d9e0 100644 --- a/doc/APIchunk3.html +++ b/doc/APIchunk3.html @@ -176,6 +176,7 @@ A:link, A:visited, A:active { text-decoration: underline }
HighSurrogates
xmlUCSIsHighSurrogates
Hiragana
xmlUCSIsHiragana
Hmm
xmlSchemaValueGetAsBoolean
+
Holds
_xmlSchemaType
How
_xmlParserInput
However
docbFreeParserCtxt
htmlFreeParserCtxt
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 858dadd..01c825a 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -86,6 +86,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXParseDTD
Local
_xmlOutputBuffer
_xmlParserInputBuffer
+_xmlSchemaType
LocalPart
xmlNamespaceParseQName
xmlSplitQName
xmlSplitQName2
@@ -212,6 +213,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserHandlePEReference
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlTextReaderCurrentDoc
NRK
_htmlElemDesc
NSDef
xmlNamespaceParseNSDef
@@ -275,6 +277,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Non-static
xmlIOHTTPOpenW
Normalization
xmlNormalizeURIPath
Normalization:
xmlParseAttValue
+
Not
_xmlSchemaElement
NotaNumber
xmlXPathIsNaN
Notation
_xmlNotation
xmlParseEntityDecl
@@ -311,6 +314,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveFormatFile
xmlSaveFormatFileEnc
xmlSchemaValidateFacetWhtsp
+xmlStrncat
xmlTextReaderSetParserProp
xmlValidateDtd
Note:
fatalErrorSAXFunc
diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html index 31e1e79..f54bb37 100644 --- a/doc/APIchunk5.html +++ b/doc/APIchunk5.html @@ -45,12 +45,17 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRegExecErrInfo
xmlRegExecNextValues
OUT:
htmlDocDumpMemory
+htmlDocDumpMemoryFormat
xmlDocDumpFormatMemory
xmlDocDumpMemory
Obsolete
XML_SCHEMAS_ANYATTR_LAX
XML_SCHEMAS_ANYATTR_SKIP
XML_SCHEMAS_ANYATTR_STRICT
XML_SCHEMAS_ELEM_NSDEFAULT
+_xmlSchema
+_xmlSchemaElement
+_xmlSchemaFacet
+_xmlSchemaType
Obtain
xmlTextReaderLocatorBaseURI
xmlTextReaderLocatorLineNumber
Ogham
xmlUCSIsOgham
@@ -65,6 +70,8 @@ A:link, A:visited, A:active { text-decoration: underline }
Optional
_htmlElemDesc
Oriya
xmlUCSIsOriya
Osmanya
xmlUCSIsOsmanya
+
Otherwise
xmlStreamPush
+xmlStreamPushAttr
Output
xmlOutputCloseCallback
xmlOutputMatchCallback
xmlOutputOpenCallback
@@ -145,7 +152,6 @@ A:link, A:visited, A:active { text-decoration: underline }
People
xmlEncodeEntities
PhoneticExtensions
xmlUCSIsPhoneticExtensions
Please
xmlNormalizeWindowsPath
-
Plug
xmlSchemaSAXPlug
Pointer
xmlCheckUTF8
Points
xmlXPtrNewRangePoints
Pop
xmlRelaxNGValidatePopElement
@@ -235,6 +241,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGValidatePushElement
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlValidatePushElement
Pushes
inputPush
namePush
diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html index b6d4741..3f790bb 100644 --- a/doc/APIchunk6.html +++ b/doc/APIchunk6.html @@ -58,6 +58,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Qualified
xmlSplitQName3
Query
xmlDictSize
xmlHashSize
+xmlStreamWantsAnyNode
Question:
xmlParseTextDecl

Letter R:

REC
IS_BASECHAR
IS_COMBINING
@@ -88,6 +89,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
Reader
xmlTextReaderPreserve
xmlTextReaderPreservePattern
@@ -109,7 +111,6 @@ A:link, A:visited, A:active { text-decoration: underline }
Recurse
xmlSearchNsByHref
Recursion
xmlParsePEReference
xmlParserHandlePEReference
-
Redefinitions
_xmlSchemaAttributeGroup
Ref
_xmlRef
xmlAddRef
xmlFreeRefTable
@@ -170,7 +171,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGSetValidErrors
xmlRelaxNGSetValidStructuredErrors
xmlRelaxNGValidateDoc
-
RelaxNG
xmlRelaxNGCleanupTypes
+
RelaxNG
_xmlSchemaElement
+xmlRelaxNGCleanupTypes
xmlRelaxNGDump
xmlRelaxNGDumpTree
xmlRelaxNGFree
@@ -182,7 +184,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxParserSetFlag
xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
-xmlTextReaderSchemaValidate
RelaxNGs
xmlRelaxNGNewDocParserCtxt
xmlRelaxNGNewMemParserCtxt
xmlRelaxNGNewParserCtxt
diff --git a/doc/APIchunk7.html b/doc/APIchunk7.html index 5c9847c..5b71d96 100644 --- a/doc/APIchunk7.html +++ b/doc/APIchunk7.html @@ -50,7 +50,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAX2InitDocbDefaultSAXHandler
xmlSAX2InitHtmlDefaultSAXHandler
xmlSAX2StartElementNs
-xmlSchemaValidateStream
SAX::substituteEntities
xmlSubstituteEntitiesDefault
SDDecl
xmlParseSDDecl
SDDecl?
xmlParseXMLDecl
@@ -107,6 +106,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetBuiltInListSimpleTypeItemType
xmlSchemaGetCanonValue
xmlSchemaParse
+xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
Schemas
LIBXML_SCHEMAS_ENABLED
xmlRegexpCompile
@@ -118,7 +119,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaNewDocParserCtxt
xmlSchemaNewMemParserCtxt
xmlSchemaNewParserCtxt
-xmlSchemaNewValidCtxt
Schematron
LIBXML_SCHEMATRON_ENABLED
xmlSchematronFree
xmlSchematronParse
@@ -168,7 +168,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlExpDump
Sets
htmlSetMetaEncoding
xmlBufferSetAllocationScheme
-xmlSchemaSetValidOptions
xmlXPathDifference
xmlXPathDistinct
xmlXPathDistinctSorted
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index 0407e65..8c3b0a4 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -51,7 +51,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStringLenGetNodeList
TODO
xmlParseElementChildrenContentDecl
xmlParseSDDecl
-
TODO:
htmlEntityLookup
+
TODO:
XML_SCHEMAS_TYPE_VARIETY_ABSENT
+htmlEntityLookup
htmlEntityValueLookup
htmlNodeDumpFileFormat
xmlDecodeEntities
@@ -161,7 +162,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidateOneElement
xmlValidateOneNamespace
xmlValidateRoot
-
Type
xmlParseAttribute
+
Type
_xmlSchemaType
+xmlParseAttribute
xmlParseAttributeType
xmlParseDocTypeDecl
xmlParseElement
@@ -218,7 +220,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlReplaceNode
xmlUnlinkNode
Unlinks
xmlDOMWrapRemoveNode
-
Unplug
xmlSchemaSAXUnplug
Unregisters
xmlCleanupEncodingAliases
xmlDelEncodingAlias
Update
xmlNanoFTPUpdateURL
@@ -245,11 +246,13 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
Used
XML_SCHEMAS_ANY_LAX
XML_SCHEMAS_ANY_STRICT
XML_SCHEMAS_ATTR_USE_PROHIBITED
XML_SKIP_IDS
+_xmlSchemaType
xmlCatalogGetDefaults
xmlCatalogSetDebug
xmlCatalogSetDefaults
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html index 91895db..ac0163d 100644 --- a/doc/APIchunk9.html +++ b/doc/APIchunk9.html @@ -41,9 +41,6 @@ A:link, A:visited, A:active { text-decoration: underline }
Validate
XML_SCHEMAS_ANY_LAX
xmlRelaxNGValidateDoc
xmlRelaxNGValidateFullElement
-xmlSchemaValidateDoc
-xmlSchemaValidateOneElement
-xmlSchemaValidateStream
xmlSchematronValidateDoc
xmlShellValidate
xmlValidateAttributeValue
@@ -74,8 +71,7 @@ A:link, A:visited, A:active { text-decoration: underline }
VersionNum
xmlParseVersionInfo
xmlParseVersionNum

Letter W:

W3C
xmlTextReaderSchemaValidate
-
WARNING
xmlRelaxNGParse
-xmlSchemaParse
+xmlTextReaderSchemaValidateCtxt
WARNING:
xmlDOMWrapAdoptNode
xmlDOMWrapReconcileNamespaces
xmlDOMWrapRemoveNode
@@ -92,6 +88,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserHandlePEReference
xmlParserHandleReference
WWW-Authenticate
xmlNanoHTTPAuthHeader
+
WXS
_xmlSchemaElement
Walk
xmlListReverseWalk
xmlListWalk
Warning
xmlSaveFileTo
@@ -156,7 +153,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidateOneElement
xmlValidateOneNamespace
xmlValidateRoot
-
XML-Schema
xmlSchemaGetValidErrors
XMLDecl
xmlParseXMLDecl
XMLDecl?
xmlParseDocument
XMLSchema
xmlSchemaGetPredefinedType
@@ -186,6 +182,7 @@ A:link, A:visited, A:active { text-decoration: underline }
XML_ENTITY_DECL
_xmlEntity
XML_ERR_OK
xmlParseInNodeContext
XML_SCHEMAS_ELEM_GLOBAL
XML_SCHEMAS_ELEM_TOPLEVEL
+
XML_SCHEMAS_FACET_PRESERVE
_xmlSchemaFacet
XML_SCHEMAS_STRING
xmlSchemaNewStringValue
XML_SUBSTITUTE_PEREF
xmlDecodeEntities
xmlStringDecodeEntities
@@ -209,6 +206,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPtrRangeToFunction
XSD
xmlAutomataNewNegTrans
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetSchema
XSLT
_xmlNode
_xmlXPathContext
diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html index 9598e49..7029c33 100644 --- a/doc/APIconstructors.html +++ b/doc/APIconstructors.html @@ -430,6 +430,7 @@ A:link, A:visited, A:active { text-decoration: underline }

Type xmlOutputBufferCreateFilenameFunc:

xmlOutputBufferCreateFilenameDefault
xmlThrDefOutputBufferCreateFilenameDefault

Type xmlOutputBufferPtr:

xmlAllocOutputBuffer
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -481,7 +482,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRelaxNGNewParserCtxt

Type xmlRelaxNGPtr:

xmlRelaxNGParse

Type xmlRelaxNGValidCtxtPtr:

xmlRelaxNGNewValidCtxt
-

Type xmlSaveCtxtPtr:

xmlSaveToFd
+

Type xmlSaveCtxtPtr:

xmlSaveToBuffer
+xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO

Type xmlSchemaFacetPtr:

xmlSchemaNewFacet
diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 744feb1..4f960e0 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -102,6 +102,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlDocContentDumpOutput
htmlDocDump
htmlDocDumpMemory
+htmlDocDumpMemoryFormat
htmlGetMetaEncoding
htmlIsBooleanAttr
htmlNewDoc
@@ -914,6 +915,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStreamPop
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
+xmlStreamWantsAnyNode

Module relaxng:

XML_RELAXNGP_CRNG
XML_RELAXNGP_FREE_DOC
XML_RELAXNGP_NONE
@@ -1000,7 +1003,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_ANY_SKIP
XML_SCHEMAS_ANY_STRICT
XML_SCHEMAS_ATTRGROUP_GLOBAL
+XML_SCHEMAS_ATTRGROUP_HAS_REFS
XML_SCHEMAS_ATTRGROUP_MARKED
+XML_SCHEMAS_ATTRGROUP_REDEFINED
XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
XML_SCHEMAS_ATTR_FIXED
XML_SCHEMAS_ATTR_GLOBAL
@@ -1103,6 +1108,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_MIXED
XML_SCHEMAS_TYPE_NORMVALUENEEDED
XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
+XML_SCHEMAS_TYPE_REDEFINED
XML_SCHEMAS_TYPE_VARIETY_ABSENT
XML_SCHEMAS_TYPE_VARIETY_ATOMIC
XML_SCHEMAS_TYPE_VARIETY_LIST
@@ -1124,6 +1130,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS
XML_SCHEMA_CONTENT_SIMPLE
XML_SCHEMA_CONTENT_UNKNOWN
+XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
XML_SCHEMA_EXTRA_QNAMEREF
XML_SCHEMA_FACET_ENUMERATION
XML_SCHEMA_FACET_FRACTIONDIGITS
@@ -1142,6 +1149,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_TYPE_ANY_ATTRIBUTE
XML_SCHEMA_TYPE_ATTRIBUTE
XML_SCHEMA_TYPE_ATTRIBUTEGROUP
+XML_SCHEMA_TYPE_ATTRIBUTE_USE
XML_SCHEMA_TYPE_BASIC
XML_SCHEMA_TYPE_CHOICE
XML_SCHEMA_TYPE_COMPLEX
@@ -1707,6 +1715,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNoNetExternalEntityLoader
xmlNormalizeWindowsPath
xmlOutputBufferClose
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -2187,13 +2196,18 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SAVE_NOT_UTF8
XML_SAVE_NO_DOCTYPE
XML_SAVE_UNKNOWN_ENCODING
+XML_SCHEMAP_AG_PROPS_CORRECT
XML_SCHEMAP_ATTRFORMDEFAULT_VALUE
XML_SCHEMAP_ATTRGRP_NONAME_NOREF
XML_SCHEMAP_ATTR_NONAME_NOREF
+XML_SCHEMAP_AU_PROPS_CORRECT
XML_SCHEMAP_AU_PROPS_CORRECT_2
XML_SCHEMAP_A_PROPS_CORRECT_2
+XML_SCHEMAP_A_PROPS_CORRECT_3
XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF
+XML_SCHEMAP_COS_ALL_LIMITED
XML_SCHEMAP_COS_CT_EXTENDS_1_1
+XML_SCHEMAP_COS_CT_EXTENDS_1_2
XML_SCHEMAP_COS_CT_EXTENDS_1_3
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1
XML_SCHEMAP_COS_ST_DERIVED_OK_2_2
@@ -2692,6 +2706,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetErrorHandler
xmlTextReaderSetParserProp
xmlTextReaderSetSchema
@@ -2759,6 +2774,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveOption
xmlSaveSetAttrEscape
xmlSaveSetEscape
+xmlSaveToBuffer
xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
@@ -2811,6 +2827,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaSAXPlugStruct
xmlSchemaSAXUnplug
xmlSchemaSetParserErrors
+xmlSchemaSetParserStructuredErrors
xmlSchemaSetValidErrors
xmlSchemaSetValidOptions
xmlSchemaSetValidStructuredErrors
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 3d660c4..593cc82 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -371,6 +371,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrdup
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
xmlStringCurrentChar
xmlStringDecodeEntities
xmlStringGetNodeList
@@ -557,6 +558,7 @@ A:link, A:visited, A:active { text-decoration: underline } UTF8Toisolat1
docbEncodeEntities
htmlDocDumpMemory
+htmlDocDumpMemoryFormat
htmlEncodeEntities
isolat1ToUTF8
xmlCharEncodingInputFunc
@@ -839,6 +841,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXUserParseMemory
xmlSaveToIO
xmlSchemaSetParserErrors
+xmlSchemaSetParserStructuredErrors
xmlSchemaSetValidErrors
xmlSchemaSetValidStructuredErrors
xmlSchemaValidateStream
@@ -960,6 +963,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewTextWriterMemory
xmlNodeBufGetContent
xmlNodeDump
+xmlOutputBufferCreateBuffer
+xmlSaveToBuffer

Type xmlC14NIsVisibleCallback:

xmlC14NExecute

Type xmlCatalogAllow:

xmlCatalogSetDefaults

Type xmlCatalogPrefer:

xmlCatalogSetDefaultPrefer
@@ -1003,6 +1008,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrncat
xmlXPathWrapString

Type xmlChar **:

htmlDocDumpMemory
+htmlDocDumpMemoryFormat
xmlC14NDocDumpMemory
xmlC14NDocSave
xmlC14NDocSaveTo
@@ -1042,6 +1048,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCharEncInFunc
xmlCharEncOutFunc

Type xmlCharEncodingHandlerPtr:

xmlAllocOutputBuffer
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -1076,6 +1083,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlDocContentDumpOutput
htmlDocDump
htmlDocDumpMemory
+htmlDocDumpMemoryFormat
htmlNodeDump
htmlNodeDumpFile
htmlNodeDumpFileFormat
@@ -1865,6 +1873,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetParserErrors
xmlSchemaParse
xmlSchemaSetParserErrors
+xmlSchemaSetParserStructuredErrors

Type xmlSchemaPtr:

xmlSchemaDump
xmlSchemaFree
xmlSchemaNewValidCtxt
@@ -1913,6 +1922,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaValidateFile
xmlSchemaValidateOneElement
xmlSchemaValidateStream
+xmlTextReaderSchemaValidateCtxt

Type xmlSchemaValidityErrorFunc:

xmlSchemaSetParserErrors
xmlSchemaSetValidErrors

Type xmlSchemaValidityErrorFunc *:

xmlSchemaGetParserErrors
@@ -1952,7 +1962,10 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStreamPop
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
+xmlStreamWantsAnyNode

Type xmlStructuredErrorFunc:

xmlRelaxNGSetValidStructuredErrors
+xmlSchemaSetParserStructuredErrors
xmlSchemaSetValidStructuredErrors
xmlSetStructuredErrorFunc
xmlTextReaderSetStructuredErrorHandler
@@ -2028,6 +2041,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetErrorHandler
xmlTextReaderSetParserProp
xmlTextReaderSetSchema
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index a335a81..36d294c 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -779,13 +779,18 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SAVE_NO_XHTML
XML_SAVE_UNKNOWN_ENCODING
XML_SAX2_MAGIC
+XML_SCHEMAP_AG_PROPS_CORRECT
XML_SCHEMAP_ATTRFORMDEFAULT_VALUE
XML_SCHEMAP_ATTRGRP_NONAME_NOREF
XML_SCHEMAP_ATTR_NONAME_NOREF
+XML_SCHEMAP_AU_PROPS_CORRECT
XML_SCHEMAP_AU_PROPS_CORRECT_2
XML_SCHEMAP_A_PROPS_CORRECT_2
+XML_SCHEMAP_A_PROPS_CORRECT_3
XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF
+XML_SCHEMAP_COS_ALL_LIMITED
XML_SCHEMAP_COS_CT_EXTENDS_1_1
+XML_SCHEMAP_COS_CT_EXTENDS_1_2
XML_SCHEMAP_COS_CT_EXTENDS_1_3
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1
XML_SCHEMAP_COS_ST_DERIVED_OK_2_2
@@ -977,7 +982,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_ANY_SKIP
XML_SCHEMAS_ANY_STRICT
XML_SCHEMAS_ATTRGROUP_GLOBAL
+XML_SCHEMAS_ATTRGROUP_HAS_REFS
XML_SCHEMAS_ATTRGROUP_MARKED
+XML_SCHEMAS_ATTRGROUP_REDEFINED
XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
XML_SCHEMAS_ATTR_FIXED
XML_SCHEMAS_ATTR_GLOBAL
@@ -1106,6 +1113,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_MIXED
XML_SCHEMAS_TYPE_NORMVALUENEEDED
XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
+XML_SCHEMAS_TYPE_REDEFINED
XML_SCHEMAS_TYPE_VARIETY_ABSENT
XML_SCHEMAS_TYPE_VARIETY_ATOMIC
XML_SCHEMAS_TYPE_VARIETY_LIST
@@ -1211,6 +1219,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS
XML_SCHEMA_CONTENT_SIMPLE
XML_SCHEMA_CONTENT_UNKNOWN
+XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
XML_SCHEMA_EXTRA_QNAMEREF
XML_SCHEMA_FACET_ENUMERATION
XML_SCHEMA_FACET_FRACTIONDIGITS
@@ -1229,6 +1238,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_TYPE_ANY_ATTRIBUTE
XML_SCHEMA_TYPE_ATTRIBUTE
XML_SCHEMA_TYPE_ATTRIBUTEGROUP
+XML_SCHEMA_TYPE_ATTRIBUTE_USE
XML_SCHEMA_TYPE_BASIC
XML_SCHEMA_TYPE_CHOICE
XML_SCHEMA_TYPE_COMPLEX
@@ -1534,6 +1544,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlDocContentDumpOutput
htmlDocDump
htmlDocDumpMemory
+htmlDocDumpMemoryFormat
htmlDocPtr
htmlElemDesc
htmlElemDescPtr
@@ -2331,6 +2342,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNsType
xmlOutputBuffer
xmlOutputBufferClose
+xmlOutputBufferCreateBuffer
xmlOutputBufferCreateFd
xmlOutputBufferCreateFile
xmlOutputBufferCreateFilename
@@ -2637,6 +2649,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveOption
xmlSaveSetAttrEscape
xmlSaveSetEscape
+xmlSaveToBuffer
xmlSaveToFd
xmlSaveToFilename
xmlSaveToIO
@@ -2704,6 +2717,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaSAXPlugStruct
xmlSchemaSAXUnplug
xmlSchemaSetParserErrors
+xmlSchemaSetParserStructuredErrors
xmlSchemaSetValidErrors
xmlSchemaSetValidOptions
xmlSchemaSetValidStructuredErrors
@@ -2819,6 +2833,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStreamPop
xmlStreamPush
xmlStreamPushAttr
+xmlStreamPushNode
+xmlStreamWantsAnyNode
xmlStringComment
xmlStringCurrentChar
xmlStringDecodeEntities
@@ -2910,6 +2926,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSchemaValidate
+xmlTextReaderSchemaValidateCtxt
xmlTextReaderSetErrorHandler
xmlTextReaderSetParserProp
xmlTextReaderSetSchema
diff --git a/doc/FAQ.html b/doc/FAQ.html index 7f68c99..da553fb 100644 --- a/doc/FAQ.html +++ b/doc/FAQ.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -FAQ
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

The XML C parser and toolkit of Gnome

FAQ

Main Menu
Related links

Table of Contents:

  • License(s)
  • +FAQ
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    FAQ

    Main Menu
    Related links

    Table of Contents:

    • License(s)
    • Installation
    • Compilation
    • Developer corner
    • @@ -118,40 +118,47 @@ A:link, A:visited, A:active { text-decoration: underline }

      CFLAGS=`xml2-config --cflags`

      LIBS=`xml2-config --libs`

      -
    • I want to install my own copy of libxml2 in my home directory and link - my programs against it, but it doesn't work +
    • I want to install my own copy of libxml2 in my home directory and + link my programs against it, but it doesn't work

      There are many different ways to accomplish this. Here is one way to - do this under Linux. Suppose your home directory is /home/user. - Then:

      + do this under Linux. Suppose your home directory is /home/user. + Then:

      • Create a subdirectory, let's call it myxml
      • unpack the libxml2 distribution into that subdirectory
      • -
      • chdir into the unpacked distribution (/home/user/myxml/libxml2 - )
      • +
      • chdir into the unpacked distribution + (/home/user/myxml/libxml2 )
      • configure the library using the "--prefix" switch, - specifying an installation subdirectory in /home/user/myxml, - e.g. -

        ./configure --prefix /home/user/myxml/xmlinst {other - configuration options}

      • + specifying an installation subdirectory in + /home/user/myxml, e.g. +

        ./configure --prefix /home/user/myxml/xmlinst {other + configuration options}

        +
      • now run make followed by make install
      • At this point, the installation subdirectory contains the complete - "private" include files, library files and binary program files (e.g. - xmllint), located in -

        /home/user/myxml/xmlinst/lib, /home/user/myxml/xmlinst/include - and /home/user/myxml/xmlinst/bin

        - respectively.
      • -
      • In order to use this "private" library, you should first add it - to the beginning of your default PATH (so that your own private - program files such as xmllint will be used instead of the normal - system ones). To do this, the Bash command would be -

        export PATH=/home/user/myxml/xmlinst/bin:$PATH

      • + "private" include files, library files and binary program files (e.g. + xmllint), located in +

        /home/user/myxml/xmlinst/lib, + /home/user/myxml/xmlinst/include and + /home/user/myxml/xmlinst/bin

        + respectively. +
      • In order to use this "private" library, you should first add it to + the beginning of your default PATH (so that your own private program + files such as xmllint will be used instead of the normal system + ones). To do this, the Bash command would be +

        export PATH=/home/user/myxml/xmlinst/bin:$PATH

        +
      • Now suppose you have a program test1.c that you would - like to compile with your "private" library. Simply compile it - using the command

        gcc `xml2-config --cflags --libs` -o test - test.c

        Note that, because your PATH has been set with - /home/user/myxml/xmlinst/bin at the beginning, the - xml2-config program which you just installed will be used instead of - the system default one, and this will automatically get the - correct libraries linked with your program.
    • + like to compile with your "private" library. Simply compile it using + the command +

      gcc `xml2-config --cflags --libs` -o test test.c

      + Note that, because your PATH has been set with + /home/user/myxml/xmlinst/bin at the beginning, the xml2-config + program which you just installed will be used instead of the system + default one, and this will automatically get the correct + libraries linked with your program. +
    + +

  • xmlDocDump() generates output on one line.

    Libxml2 will not invent spaces in the content of a document since all spaces in the content of a document are diff --git a/doc/Makefile.am b/doc/Makefile.am index 7332659..55c5ef5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -110,7 +110,6 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html -@INSTALL@ -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html -@INSTALL@ -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html - -@INSTALL@ -m 0644 $(srcdir)/html/index.sgml $(DESTDIR)$(HTML_DIR)/html $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial -@INSTALL@ -m 0644 $(srcdir)/tutorial/*.* \ $(DESTDIR)$(HTML_DIR)/tutorial diff --git a/doc/Makefile.in b/doc/Makefile.in index b8b3d34..f80c05f 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -731,7 +731,6 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html -@INSTALL@ -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html -@INSTALL@ -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html - -@INSTALL@ -m 0644 $(srcdir)/html/index.sgml $(DESTDIR)$(HTML_DIR)/html $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/tutorial -@INSTALL@ -m 0644 $(srcdir)/tutorial/*.* \ $(DESTDIR)$(HTML_DIR)/tutorial diff --git a/doc/XMLinfo.html b/doc/XMLinfo.html index e89bdad..ad43eff 100644 --- a/doc/XMLinfo.html +++ b/doc/XMLinfo.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -XML
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    XML

    Main Menu
    Related links

    XML is a standard for +XML
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    XML

    Main Menu
    Related links

    XML is a standard for markup-based structured documents. Here is an example XML document:

    <?xml version="1.0"?>
     <EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
    diff --git a/doc/XSLT.html b/doc/XSLT.html
    index 7212cb6..41adf2f 100644
    --- a/doc/XSLT.html
    +++ b/doc/XSLT.html
    @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica}
     H2 {font-family: Verdana,Arial,Helvetica}
     H3 {font-family: Verdana,Arial,Helvetica}
     A:link, A:visited, A:active { text-decoration: underline }
    -XSLT
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    XSLT

    Main Menu
    Related links

    Check the separate libxslt page

    XSL Transformations, is a +XSLT
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    XSLT

    Main Menu
    Related links

    Check the separate libxslt page

    XSL Transformations, is a language for transforming XML documents into other XML documents (or HTML/textual output).

    A separate library called libxslt is available implementing XSLT-1.0 for libxml2. This module "libxslt" too can be found in the Gnome CVS base.

    You can check the progresses on the libxslt Changelog.

    Daniel Veillard

    diff --git a/doc/bugs.html b/doc/bugs.html index cadebe8..f598051 100644 --- a/doc/bugs.html +++ b/doc/bugs.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Reporting bugs and getting help
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    Reporting bugs and getting help

    Main Menu
    Related links

    Well, bugs or missing features are always possible, and I will make a +Reporting bugs and getting help
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    Reporting bugs and getting help

    Main Menu
    Related links

    Well, bugs or missing features are always possible, and I will make a point of fixing them in a timely fashion. The best way to report a bug is to use the Gnome bug tracking database (make sure to use the "libxml2" module name). I diff --git a/doc/catalog.html b/doc/catalog.html index 9947f90..3750123 100644 --- a/doc/catalog.html +++ b/doc/catalog.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Catalog support
    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
    Made with Libxml2 Logo

    The XML C parser and toolkit of Gnome

    Catalog support

    Main Menu
    Related links

    Table of Content:

    1. General overview
    2. +Catalog support
      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
      Made with Libxml2 Logo

      The XML C parser and toolkit of Gnome

      Catalog support

      Main Menu
      Related links

      Table of Content:

      1. General overview
      2. The definition
      3. Using catalogs
      4. Some examples
      5. diff --git a/doc/contribs.html b/doc/contribs.html index 8ea1843..a89c9ea 100644 --- a/doc/contribs.html +++ b/doc/contribs.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Contributions
        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
        Made with Libxml2 Logo

        The XML C parser and toolkit of Gnome

        Contributions

        Main Menu
        Related links
        • Bjorn Reese, William Brack and Thomas Broyer have provided a number of +Contributions
          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
          Made with Libxml2 Logo

          The XML C parser and toolkit of Gnome

          Contributions

          Main Menu
          Related links

          Daniel Veillard

          diff --git a/doc/devhelp/libxml2-HTMLtree.html b/doc/devhelp/libxml2-HTMLtree.html index b7c35b4..6430f8b 100644 --- a/doc/devhelp/libxml2-HTMLtree.html +++ b/doc/devhelp/libxml2-HTMLtree.html @@ -51,9 +51,10 @@ int htmlNodeDumpFileFormat (FILE * out,
          xmlDocPtr doc,
          xmlNodePtr cur,
          const char * encoding,
          int format); void htmlDocDumpMemory (xmlDocPtr cur,
          xmlChar ** mem,
          int * size); int htmlSaveFile (const char * filename,
          xmlDocPtr cur); -htmlDocPtr htmlNewDocNoDtD (const xmlChar * URI,
          const xmlChar * ExternalID); int htmlDocDump (FILE * f,
          xmlDocPtr cur); +void htmlDocDumpMemoryFormat (xmlDocPtr cur,
          xmlChar ** mem,
          int * size,
          int format); int htmlIsBooleanAttr (const xmlChar * name); +int htmlSaveFileFormat (const char * filename,
          xmlDocPtr cur,
          const char * encoding,
          int format); void htmlNodeDumpFormatOutput (xmlOutputBufferPtr buf,
          xmlDocPtr doc,
          xmlNodePtr cur,
          const char * encoding,
          int format); int htmlSetMetaEncoding (htmlDocPtr doc,
          const xmlChar * encoding); int htmlSaveFileEnc (const char * filename,
          xmlDocPtr cur,
          const char * encoding); @@ -63,7 +64,7 @@ int htmlNodeDump (xmlChar * htmlGetMetaEncoding (htmlDocPtr doc); void htmlNodeDumpFile (FILE * out,
          xmlDocPtr doc,
          xmlNodePtr cur); void htmlDocContentDumpFormatOutput (xmlOutputBufferPtr buf,
          xmlDocPtr cur,
          const char * encoding,
          int format); -int htmlSaveFileFormat (const char * filename,
          xmlDocPtr cur,
          const char * encoding,
          int format); +htmlDocPtr htmlNewDocNoDtD (const xmlChar * URI,
          const xmlChar * ExternalID); void htmlDocContentDumpOutput (xmlOutputBufferPtr buf,
          xmlDocPtr cur,
          const char * encoding); @@ -108,6 +109,10 @@ void htmlDocContentDumpOutput (

          htmlDocDumpMemory ()

          void	htmlDocDumpMemory		(xmlDocPtr cur, 
          xmlChar ** mem,
          int * size)

          Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.

          cur:the document
          mem:OUT: the memory pointer
          size:OUT: the memory length
          +
          +

          htmlDocDumpMemoryFormat ()

          void	htmlDocDumpMemoryFormat		(xmlDocPtr cur, 
          xmlChar ** mem,
          int * size,
          int format)
          +

          Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.

          +
          cur:the document
          mem:OUT: the memory pointer
          size:OUT: the memory length
          format:should formatting spaces been added

          htmlGetMetaEncoding ()

          const xmlChar *	htmlGetMetaEncoding	(htmlDocPtr doc)

          Encoding definition lookup in the Meta tags

          diff --git a/doc/devhelp/libxml2-pattern.html b/doc/devhelp/libxml2-pattern.html index 621767e..321bd79 100644 --- a/doc/devhelp/libxml2-pattern.html +++ b/doc/devhelp/libxml2-pattern.html @@ -55,11 +55,13 @@ void xmlFreePatternList (xmlPatternStreamable (xmlPatternPtr comp); int xmlStreamPushAttr (xmlStreamCtxtPtr stream,
          const xmlChar * name,
          const xmlChar * ns); int xmlPatternMatch (xmlPatternPtr comp,
          xmlNodePtr node); +int xmlStreamWantsAnyNode (xmlStreamCtxtPtr streamCtxt); int xmlStreamPop (xmlStreamCtxtPtr stream); void xmlFreePattern (xmlPatternPtr comp); int xmlStreamPush (xmlStreamCtxtPtr stream,
          const xmlChar * name,
          const xmlChar * ns); int xmlPatternMaxDepth (xmlPatternPtr comp); xmlPatternPtr xmlPatterncompile (const xmlChar * pattern,
          xmlDict * dict,
          int flags,
          const xmlChar ** namespaces); +int xmlStreamPushNode (xmlStreamCtxtPtr stream,
          const xmlChar * name,
          const xmlChar * ns,
          int nodeType); void xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
          @@ -143,13 +145,21 @@ The content of this structure is not made public by the API.
          stream:the stream context
          Returns:-1 in case of error, 0 otherwise.

          xmlStreamPush ()

          int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
          const xmlChar * name,
          const xmlChar * ns)
          -

          Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.

          +

          Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an element-node.

          stream:the stream context
          name:the current name
          ns:the namespace name
          Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

          xmlStreamPushAttr ()

          int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
          const xmlChar * name,
          const xmlChar * ns)
          -

          Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.

          +

          Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node.

          stream:the stream context
          name:the current name
          ns:the namespace name
          Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

          +

          xmlStreamPushNode ()

          int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
          const xmlChar * name,
          const xmlChar * ns,
          int nodeType)
          +

          Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Different from xmlStreamPush() this function can be fed with nodes of type: element-, attribute-, text-, cdata-section-, comment- and processing-instruction-node.

          +
          stream:the stream context
          name:the current name
          ns:the namespace name
          nodeType:the type of the node being pushed
          Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.
          +
          +

          xmlStreamWantsAnyNode ()

          int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)
          +

          Query if the streaming pattern additionally needs to be fed with text-, cdata-section-, comment- and processing-instruction-nodes. If the result is 0 then only element-nodes and attribute-nodes need to be pushed.

          +
          streamCtxt:the stream context
          Returns:1 in case of need of nodes of the above described types, 0 otherwise. -1 on API errors.
          +
          diff --git a/doc/devhelp/libxml2-relaxng.html b/doc/devhelp/libxml2-relaxng.html index a10bd11..9dd4bb1 100644 --- a/doc/devhelp/libxml2-relaxng.html +++ b/doc/devhelp/libxml2-relaxng.html @@ -228,7 +228,7 @@ The content of this structure is not made public by the API.
          schema:a precompiled XML RelaxNGs
          Returns:the validation context or NULL in case of error

          xmlRelaxNGParse ()

          xmlRelaxNGPtr	xmlRelaxNGParse		(xmlRelaxNGParserCtxtPtr ctxt)
          -

          parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change

          +

          parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

          ctxt:a Relax-NG parser context
          Returns:the internal XML RelaxNG structure built from the resource or NULL in case of error

          xmlRelaxNGSetParserErrors ()

          void	xmlRelaxNGSetParserErrors	(xmlRelaxNGParserCtxtPtr ctxt, 
          xmlRelaxNGValidityErrorFunc err,
          xmlRelaxNGValidityWarningFunc warn,
          void * ctx)
          diff --git a/doc/devhelp/libxml2-schemasInternals.html b/doc/devhelp/libxml2-schemasInternals.html index ba7d1c1..2f9cbc9 100644 --- a/doc/devhelp/libxml2-schemasInternals.html +++ b/doc/devhelp/libxml2-schemasInternals.html @@ -39,7 +39,7 @@ schemasInternals

          schemasInternals - internal interfaces for XML Schemas

          -

          internal interfaces for the XML Schemas handling and schema validity checking

          +

          internal interfaces for the XML Schemas handling and schema validity checking The Schemas development is a Work In Progress. Some of those interfaces are not garanteed to be API or ABI stable !

          Author(s): Daniel Veillard

          Synopsis

          @@ -66,11 +66,12 @@ #define XML_SCHEMAS_ATTR_USE_PROHIBITED; #define XML_SCHEMAS_ELEM_NILLABLE; #define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION; -#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED; +#define XML_SCHEMAS_ATTRGROUP_REDEFINED; #define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD; #define XML_SCHEMAS_TYPE_BLOCK_DEFAULT; #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION; #define XML_SCHEMAS_TYPE_FINAL_EXTENSION; +#define XML_SCHEMAS_TYPE_REDEFINED; #define XML_SCHEMAS_ELEM_FIXED; #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD; #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC; @@ -90,7 +91,9 @@ #define XML_SCHEMAS_ANYATTR_LAX; #define XML_SCHEMAS_TYPE_GLOBAL; #define XML_SCHEMAS_TYPE_ABSTRACT; +#define XML_SCHEMAS_TYPE_MIXED; #define XML_SCHEMAS_ATTR_FIXED; +#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED; #define XML_SCHEMAS_ANY_SKIP; #define XML_SCHEMAS_FINAL_DEFAULT_LIST; #define XML_SCHEMAS_TYPE_VARIETY_ABSENT; @@ -99,7 +102,7 @@ #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED; #define XML_SCHEMAS_ELEM_NSDEFAULT; #define XML_SCHEMAS_ELEM_GLOBAL; -#define XML_SCHEMAS_TYPE_MIXED; +#define XML_SCHEMAS_ELEM_TOPLEVEL; #define XML_SCHEMAS_ANY_LAX; #define XML_SCHEMAS_TYPE_FINAL_RESTRICTION; #define XML_SCHEMAS_TYPE_HAS_FACETS; @@ -108,7 +111,7 @@ #define XML_SCHEMAS_ELEM_FINAL_ABSENT; #define XML_SCHEMAS_TYPE_BLOCK_EXTENSION; #define XML_SCHEMAS_TYPE_INTERNAL_INVALID; -#define XML_SCHEMAS_ELEM_TOPLEVEL; +#define XML_SCHEMAS_ATTRGROUP_HAS_REFS; #define XML_SCHEMAS_ELEM_ABSTRACT; #define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION; #define XML_SCHEMAS_TYPE_FINAL_UNION; @@ -187,10 +190,18 @@ void xmlSchemaFreeWildcard (

          Macro XML_SCHEMAS_ATTRGROUP_GLOBAL

          #define XML_SCHEMAS_ATTRGROUP_GLOBAL;
           

          The attribute wildcard has been already builded.

          +
          +
          +

          Macro XML_SCHEMAS_ATTRGROUP_HAS_REFS

          #define XML_SCHEMAS_ATTRGROUP_HAS_REFS;
          +

          Whether this attr. group contains attr. group references.


          Macro XML_SCHEMAS_ATTRGROUP_MARKED

          #define XML_SCHEMAS_ATTRGROUP_MARKED;
           

          Marks the attr group as marked; used for circular checks.

          +
          +
          +

          Macro XML_SCHEMAS_ATTRGROUP_REDEFINED

          #define XML_SCHEMAS_ATTRGROUP_REDEFINED;
          +

          The attr group was redefined.


          Macro XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED

          #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED;
          @@ -443,10 +454,14 @@ void	xmlSchemaFreeWildcard		(

          Macro XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD

          #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD;
           

          the complexType owns an attribute wildcard, i.e. it can be freed by the complexType

          +
          +
          +

          Macro XML_SCHEMAS_TYPE_REDEFINED

          #define XML_SCHEMAS_TYPE_REDEFINED;
          +

          The type was redefined.


          Macro XML_SCHEMAS_TYPE_VARIETY_ABSENT

          #define XML_SCHEMAS_TYPE_VARIETY_ABSENT;
          -

          the simpleType has a variety of "absent".

          +

          the simpleType has a variety of "absent". TODO: Actually not necessary :-/, since if none of the variety flags occur then it's automatically absent.


          Macro XML_SCHEMAS_TYPE_VARIETY_ATOMIC

          #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC;
          @@ -489,25 +504,25 @@ void	xmlSchemaFreeWildcard		(

          Structure xmlSchemaAttribute

          struct _xmlSchemaAttribute {
          -    xmlSchemaTypeType	type	: The kind of type
          -    struct _xmlSchemaAttribute *	next	: the next attribute if in a group ...
          -    const xmlChar *	name	: name of the declaration or empty if particle
          -    const xmlChar *	id
          -    const xmlChar *	ref	: the local name of the attribute decl. if a particle
          -    const xmlChar *	refNs	: the ns URI of the attribute decl. if a particle
          +    xmlSchemaTypeType	type
          +    struct _xmlSchemaAttribute *	next	: the next attribute (not used?)
          +    const xmlChar *	name	: the name of the declaration
          +    const xmlChar *	id	: Deprecated; not used
          +    const xmlChar *	ref	: Deprecated; not used
          +    const xmlChar *	refNs	: Deprecated; not used
               const xmlChar *	typeName	: the local name of the type definition
               const xmlChar *	typeNs	: the ns URI of the type definition
               xmlSchemaAnnotPtr	annot
          -    xmlSchemaTypePtr	base	: obsolete, not used
          -    int	occurs
          -    const xmlChar *	defValue
          +    xmlSchemaTypePtr	base	: Deprecated; not used
          +    int	occurs	: Deprecated; not used
          +    const xmlChar *	defValue	: The initial value of the value constraint
               xmlSchemaTypePtr	subtypes	: the type definition
               xmlNodePtr	node
               const xmlChar *	targetNamespace
               int	flags
          -    const xmlChar *	refPrefix
          -    xmlSchemaValPtr	defVal
          -    xmlSchemaAttributePtr	refDecl
          +    const xmlChar *	refPrefix	: Deprecated; not used
          +    xmlSchemaValPtr	defVal	: The compiled value constraint
          +    xmlSchemaAttributePtr	refDecl	: Deprecated; not used
           } xmlSchemaAttribute;
           

          @@ -517,16 +532,17 @@ void xmlSchemaFreeWildcard (attribute if in a group ... const xmlChar * name const xmlChar * id - const xmlChar * ref - const xmlChar * refNs + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used xmlSchemaAnnotPtr annot - xmlSchemaAttributePtr attributes + xmlSchemaAttributePtr attributes : Deprecated; not used xmlNodePtr node int flags xmlSchemaWildcardPtr attributeWildcard - const xmlChar * refPrefix - xmlSchemaAttributeGroupPtr refItem : The referenced attribute group - const xmlChar * targetNamespace : xmlSchemaAttributeGroupPtr redef Redefinitions + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaAttributeGroupPtr refItem : Deprecated; not used + const xmlChar * targetNamespace + void * attrUses } xmlSchemaAttributeGroup;

          @@ -556,7 +572,7 @@ void xmlSchemaFreeWildcard (XML_SCHEMA_CONTENT_ELEMENTS = 2 XML_SCHEMA_CONTENT_MIXED = 3 XML_SCHEMA_CONTENT_SIMPLE = 4 - XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5 /* obsolete, not used */ + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5 /* Obsolete */ XML_SCHEMA_CONTENT_BASIC = 6 XML_SCHEMA_CONTENT_ANY = 7 }; @@ -565,17 +581,17 @@ void xmlSchemaFreeWildcard (

          Structure xmlSchemaElement

          struct _xmlSchemaElement {
               xmlSchemaTypeType	type	: The kind of type
          -    struct _xmlSchemaType *	next	: the next type if in a sequence ...
          +    struct _xmlSchemaType *	next	: Not used?
               const xmlChar *	name
          -    const xmlChar *	id
          -    const xmlChar *	ref	: the local name of the element declaration if a particle
          -    const xmlChar *	refNs	: the ns URI of the element declaration if a particle
          +    const xmlChar *	id	: Deprecated; not used
          +    const xmlChar *	ref	: Deprecated; not used
          +    const xmlChar *	refNs	: Deprecated; not used
               xmlSchemaAnnotPtr	annot
               xmlSchemaTypePtr	subtypes	: the type definition
               xmlSchemaAttributePtr	attributes
               xmlNodePtr	node
          -    int	minOccurs
          -    int	maxOccurs
          +    int	minOccurs	: Deprecated; not used
          +    int	maxOccurs	: Deprecated; not used
               int	flags
               const xmlChar *	targetNamespace
               const xmlChar *	namedType
          @@ -583,13 +599,13 @@ void	xmlSchemaFreeWildcard		(xmlChar *	substGroup
               const xmlChar *	substGroupNs
               const xmlChar *	scope
          -    const xmlChar *	value
          +    const xmlChar *	value	: The original value of the value constraint.
               struct _xmlSchemaElement *	refDecl	: This will now be used for the substitution group affiliation
          -    xmlRegexpPtr	contModel
          +    xmlRegexpPtr	contModel	: Obsolete for WXS, maybe used for RelaxNG
               xmlSchemaContentType	contentType
          -    const xmlChar *	refPrefix
          -    xmlSchemaValPtr	defVal
          -    void *	idcs
          +    const xmlChar *	refPrefix	: Deprecated; not used
          +    xmlSchemaValPtr	defVal	: The compiled value contraint.
          +    void *	idcs	: The identity-constraint defs
           } xmlSchemaElement;
           

          @@ -601,14 +617,14 @@ void xmlSchemaFreeWildcard (

          Structure xmlSchemaFacet

          struct _xmlSchemaFacet {
               xmlSchemaTypeType	type	: The kind of type
               struct _xmlSchemaFacet *	next	: the next type if in a sequence ...
          -    const xmlChar *	value
          -    const xmlChar *	id
          +    const xmlChar *	value	: The original value
          +    const xmlChar *	id	: Obsolete
               xmlSchemaAnnotPtr	annot
               xmlNodePtr	node
          -    int	fixed
          +    int	fixed	: XML_SCHEMAS_FACET_PRESERVE, etc.
               int	whitespace
          -    xmlSchemaValPtr	val
          -    xmlRegexpPtr	regexp
          +    xmlSchemaValPtr	val	: The compiled value
          +    xmlRegexpPtr	regexp	: The regex for patterns
           } xmlSchemaFacet;
           

          @@ -646,39 +662,40 @@ void xmlSchemaFreeWildcard (xmlSchemaTypeType type : The kind of type struct _xmlSchemaType * next : the next type if in a sequence ... const xmlChar * name - const xmlChar * id - const xmlChar * ref - const xmlChar * refNs + const xmlChar * id : Deprecated; not used + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used xmlSchemaAnnotPtr annot xmlSchemaTypePtr subtypes - xmlSchemaAttributePtr attributes + xmlSchemaAttributePtr attributes : Deprecated; not used xmlNodePtr node - int minOccurs - int maxOccurs + int minOccurs : Deprecated; not used + int maxOccurs : Deprecated; not used int flags xmlSchemaContentType contentType - const xmlChar * base - const xmlChar * baseNs - xmlSchemaTypePtr baseType - xmlSchemaFacetPtr facets - struct _xmlSchemaType * redef : possible redefinitions for the type - int recurse - xmlSchemaAttributeLinkPtr attributeUses + const xmlChar * base : Base type's local name + const xmlChar * baseNs : Base type's target namespace + xmlSchemaTypePtr baseType : The base type component + xmlSchemaFacetPtr facets : Local facets + struct _xmlSchemaType * redef : Deprecated; not used + int recurse : Obsolete + xmlSchemaAttributeLinkPtr * attributeUses : Deprecated; not used xmlSchemaWildcardPtr attributeWildcard - int builtInType - xmlSchemaTypeLinkPtr memberTypes - xmlSchemaFacetLinkPtr facetSet - const xmlChar * refPrefix - xmlSchemaTypePtr contentTypeDef - xmlRegexpPtr contModel + int builtInType : Type of built-in types. + xmlSchemaTypeLinkPtr memberTypes : member-types if a union type. + xmlSchemaFacetLinkPtr facetSet : All facets (incl. inherited) + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaTypePtr contentTypeDef : Used for the simple content of complex types. Could we use @subtypes + xmlRegexpPtr contModel : Holds the automaton of the content model const xmlChar * targetNamespace + void * attrUses } xmlSchemaType;


          Structure xmlSchemaTypeLink

          struct _xmlSchemaTypeLink {
               struct _xmlSchemaTypeLink *	next	: the next type link ...
          -    xmlSchemaTypePtr	type	: the linked typ
          +    xmlSchemaTypePtr	type	: the linked type
           } xmlSchemaTypeLink;
           

          @@ -717,6 +734,7 @@ void xmlSchemaFreeWildcard (XML_SCHEMA_TYPE_IDC_KEY = 23 XML_SCHEMA_TYPE_IDC_KEYREF = 24 XML_SCHEMA_TYPE_PARTICLE = 25 + XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26 XML_SCHEMA_FACET_MININCLUSIVE = 1000 XML_SCHEMA_FACET_MINEXCLUSIVE = 1001 XML_SCHEMA_FACET_MAXINCLUSIVE = 1002 @@ -730,6 +748,7 @@ void xmlSchemaFreeWildcard (XML_SCHEMA_FACET_MAXLENGTH = 1010 XML_SCHEMA_FACET_MINLENGTH = 1011 XML_SCHEMA_EXTRA_QNAMEREF = 2000 + XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001 };

          @@ -798,11 +817,11 @@ The content of this structure is not made public by the API.


          Structure xmlSchemaWildcard

          struct _xmlSchemaWildcard {
               xmlSchemaTypeType	type	: The kind of type
          -    const xmlChar *	id
          +    const xmlChar *	id	: Deprecated; not used
               xmlSchemaAnnotPtr	annot
               xmlNodePtr	node
          -    int	minOccurs
          -    int	maxOccurs
          +    int	minOccurs	: Deprecated; not used
          +    int	maxOccurs	: Deprecated; not used
               int	processContents
               int	any	: Indicates if the ns constraint is of ##any
               xmlSchemaWildcardNsPtr	nsSet	: The list of allowed namespaces
          diff --git a/doc/devhelp/libxml2-tree.html b/doc/devhelp/libxml2-tree.html
          index 9b77b9a..9395f76 100644
          --- a/doc/devhelp/libxml2-tree.html
          +++ b/doc/devhelp/libxml2-tree.html
          @@ -1225,7 +1225,7 @@ void	xmlFreeNsList			(
          doc:the document pointer
          name:the DTD name
          ExternalID:the external ID
          SystemID:the system ID
          Returns:a pointer to the new DTD structure

          xmlNewGlobalNs ()

          xmlNsPtr	xmlNewGlobalNs		(xmlDocPtr doc, 
          const xmlChar * href,
          const xmlChar * prefix)
          -

          Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! It now create a namespace on the root element of the document if found.

          +

          Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!

          doc:the document carrying the namespace
          href:the URI associated
          prefix:the prefix for the namespace
          Returns:NULL this functionality had been removed

          xmlNewNode ()

          xmlNodePtr	xmlNewNode		(xmlNsPtr ns, 
          const xmlChar * name)
          diff --git a/doc/devhelp/libxml2-valid.html b/doc/devhelp/libxml2-valid.html index 7832502..3b23e67 100644 --- a/doc/devhelp/libxml2-valid.html +++ b/doc/devhelp/libxml2-valid.html @@ -81,7 +81,7 @@ int xmlValidateAttributeDecl (xmlElementPtr xmlGetDtdQElementDesc (xmlDtdPtr dtd,
          const xmlChar * name,
          const xmlChar * prefix); xmlNotationTablePtr xmlCopyNotationTable (xmlNotationTablePtr table); int xmlValidateDocument (xmlValidCtxtPtr ctxt,
          xmlDocPtr doc); -int xmlValidGetPotentialChildren (xmlElementContent * ctree,
          const xmlChar ** list,
          int * len,
          int max); +int xmlValidGetPotentialChildren (xmlElementContent * ctree,
          const xmlChar ** names,
          int * len,
          int max); xmlNotationPtr xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
          xmlDtdPtr dtd,
          const xmlChar * name,
          const xmlChar * PublicID,
          const xmlChar * SystemID); int xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
          xmlDocPtr doc,
          xmlElementPtr elem); xmlAttributePtr xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
          xmlDtdPtr dtd,
          const xmlChar * elem,
          const xmlChar * name,
          const xmlChar * ns,
          xmlAttributeType type,
          xmlAttributeDefault def,
          const xmlChar * defaultValue,
          xmlEnumerationPtr tree); @@ -426,9 +426,9 @@ The content of this structure is not made public by the API.

          Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly

          ctxt:the validation context or NULL
          doc:the document
          elem:the parent
          name:the attribute name
          value:the attribute value
          Returns:a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.

          -

          xmlValidGetPotentialChildren ()

          int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
          const xmlChar ** list,
          int * len,
          int max)
          +

          xmlValidGetPotentialChildren ()

          int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
          const xmlChar ** names,
          int * len,
          int max)

          Build/extend a list of potential children allowed by the content tree

          -
          ctree:an element content tree
          list:an array to store the list of child names
          len:a pointer to the number of element in the list
          max:the size of the array
          Returns:the number of element in the list, or -1 in case of error.
          +
          ctree:an element content tree
          names:an array to store the list of child names
          len:a pointer to the number of element in the list
          max:the size of the array
          Returns:the number of element in the list, or -1 in case of error.

          xmlValidGetValidElements ()

          int	xmlValidGetValidElements	(xmlNode * prev, 
          xmlNode * next,
          const xmlChar ** names,
          int max)

          This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd. The insertion point is defined using @prev and @next in the following ways: to insert before 'node': xmlValidGetValidElements(node->prev, node, ... to insert next 'node': xmlValidGetValidElements(node, node->next, ... to replace 'node': xmlValidGetValidElements(node->prev, node->next, ... to prepend a child to 'node': xmlValidGetValidElements(NULL, node->childs, to append a child to 'node': xmlValidGetValidElements(node->last, NULL, ... pointers to the element names are inserted at the beginning of the array and do not need to be freed.

          diff --git a/doc/devhelp/libxml2-xmlIO.html b/doc/devhelp/libxml2-xmlIO.html index 9e03d5f..8c41d1d 100644 --- a/doc/devhelp/libxml2-xmlIO.html +++ b/doc/devhelp/libxml2-xmlIO.html @@ -71,9 +71,10 @@ int xmlRegisterInputCallbacks (xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); void xmlRegisterDefaultInputCallbacks (void); int xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
          int len); +typedef int xmlOutputCloseCallback (void * context); xmlOutputBufferPtr xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); xmlParserInputPtr xmlNoNetExternalEntityLoader (const char * URL,
          const char * ID,
          xmlParserCtxtPtr ctxt); -typedef int xmlOutputCloseCallback (void * context); +xmlOutputBufferPtr xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
          xmlCharEncodingHandlerPtr encoder); int xmlIOHTTPMatch (const char * filename); void * xmlIOHTTPOpen (const char * filename); xmlParserInputBufferPtr xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
          xmlInputCloseCallback ioclose,
          void * ioctx,
          xmlCharEncoding enc); @@ -229,6 +230,10 @@ void * xmlIOHTTPOpenW (const char * post_uri,

          xmlOutputBufferClose ()

          int	xmlOutputBufferClose		(xmlOutputBufferPtr out)

          flushes and close the output I/O channel and free up all the associated resources

          out:a buffered output
          Returns:the number of byte written or -1 in case of error.
          +
          +

          xmlOutputBufferCreateBuffer ()

          xmlOutputBufferPtr	xmlOutputBufferCreateBuffer	(xmlBufferPtr buffer, 
          xmlCharEncodingHandlerPtr encoder)
          +

          Create a buffered output for the progressive saving to a xmlBuffer

          +
          buffer:a xmlBufferPtr
          encoder:the encoding converter or NULL
          Returns:the new parser output or NULL

          xmlOutputBufferCreateFd ()

          xmlOutputBufferPtr	xmlOutputBufferCreateFd	(int fd, 
          xmlCharEncodingHandlerPtr encoder)

          Create a buffered output for the progressive saving to a file descriptor

          diff --git a/doc/devhelp/libxml2-xmlerror.html b/doc/devhelp/libxml2-xmlerror.html index 44792da..d0eb477 100644 --- a/doc/devhelp/libxml2-xmlerror.html +++ b/doc/devhelp/libxml2-xmlerror.html @@ -811,6 +811,11 @@ void xmlResetError (XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084 /* 3084 */ XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085 /* 3085 */ XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086 /* 3085 */ + XML_SCHEMAP_AG_PROPS_CORRECT = 3087 /* 3086 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088 /* 3087 */ + XML_SCHEMAP_AU_PROPS_CORRECT = 3089 /* 3088 */ + XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090 /* 3089 */ + XML_SCHEMAP_COS_ALL_LIMITED = 3091 /* 3090 */ XML_MODULE_OPEN = 4900 /* 4900 */ XML_MODULE_CLOSE = 4901 /* 4901 */ XML_CHECK_FOUND_ELEMENT = 5000 diff --git a/doc/devhelp/libxml2-xmlreader.html b/doc/devhelp/libxml2-xmlreader.html index 585f47e..a3bbbb5 100644 --- a/doc/devhelp/libxml2-xmlreader.html +++ b/doc/devhelp/libxml2-xmlreader.html @@ -124,6 +124,7 @@ int xmlReaderNewMemory (xmlChar * xmlTextReaderConstValue (xmlTextReaderPtr reader); xmlTextReaderPtr xmlNewTextReader (xmlParserInputBufferPtr input,
          const char * URI); xmlChar * xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
          int no); +int xmlTextReaderSchemaValidateCtxt (xmlTextReaderPtr reader,
          xmlSchemaValidCtxtPtr ctxt,
          int options); xmlChar * xmlTextReaderLocalName (xmlTextReaderPtr reader); xmlNodePtr xmlTextReaderExpand (xmlTextReaderPtr reader); const xmlChar * xmlTextReaderConstName (xmlTextReaderPtr reader); @@ -513,8 +514,12 @@ The content of this structure is not made public by the API.
          reader:the xmlTextReaderPtr used
          rng:the path to a RelaxNG schema or NULL
          Returns:0 in case the RelaxNG validation could be (des)activated and -1 in case of error.

          xmlTextReaderSchemaValidate ()

          int	xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader, 
          const char * xsd)
          -

          Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). if @xsd is NULL, then RelaxNG validation is desactivated.

          -
          reader:the xmlTextReaderPtr used
          xsd:the path to a W3C XSD schema or NULL
          Returns:0 in case the schemas validation could be (des)activated and -1 in case of error.
          +

          Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is NULL, then XML Schema validation is deactivated.

          +
          reader:the xmlTextReaderPtr used
          xsd:the path to a W3C XSD schema or NULL
          Returns:0 in case the schemas validation could be (de)activated and -1 in case of error.
          +
          +

          xmlTextReaderSchemaValidateCtxt ()

          int	xmlTextReaderSchemaValidateCtxt	(xmlTextReaderPtr reader, 
          xmlSchemaValidCtxtPtr ctxt,
          int options)
          +

          Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is NULL, then XML Schema validation is deactivated.

          +
          reader:the xmlTextReaderPtr used
          ctxt:the XML Schema validation context or NULL
          options:options (not used yet)
          Returns:0 in case the schemas validation could be (de)activated and -1 in case of error.

          xmlTextReaderSetErrorHandler ()

          void	xmlTextReaderSetErrorHandler	(xmlTextReaderPtr reader, 
          xmlTextReaderErrorFunc f,
          void * arg)

          Register a callback function that will be called on error and warnings. If @f is NULL, the default error and warning handlers are restored.

          diff --git a/doc/devhelp/libxml2-xmlregexp.html b/doc/devhelp/libxml2-xmlregexp.html index 0de6668..e783648 100644 --- a/doc/devhelp/libxml2-xmlregexp.html +++ b/doc/devhelp/libxml2-xmlregexp.html @@ -75,10 +75,10 @@ void xmlExpFree (xmlExpNodePtr xmlExpNewAtom (xmlExpCtxtPtr ctxt,
          const xmlChar * name,
          int len); int xmlRegexpExec (xmlRegexpPtr comp,
          const xmlChar * content); int xmlRegExecPushString (xmlRegExecCtxtPtr exec,
          const xmlChar * value,
          void * data); -int xmlExpGetStart (xmlExpCtxtPtr ctxt,
          xmlExpNodePtr exp,
          const xmlChar ** list,
          int len); +int xmlExpGetStart (xmlExpCtxtPtr ctxt,
          xmlExpNodePtr exp,
          const xmlChar ** tokList,
          int len); xmlExpNodePtr xmlExpParse (xmlExpCtxtPtr ctxt,
          const char * expr); xmlExpCtxtPtr xmlExpNewCtxt (int maxNodes,
          xmlDictPtr dict); -int xmlExpGetLanguage (xmlExpCtxtPtr ctxt,
          xmlExpNodePtr exp,
          const xmlChar ** list,
          int len); +int xmlExpGetLanguage (xmlExpCtxtPtr ctxt,
          xmlExpNodePtr exp,
          const xmlChar ** langList,
          int len); xmlExpNodePtr xmlExpStringDerive (xmlExpCtxtPtr ctxt,
          xmlExpNodePtr exp,
          const xmlChar * str,
          int len); int xmlExpCtxtNbNodes (xmlExpCtxtPtr ctxt); int xmlExpMaxToken (xmlExpNodePtr expr); @@ -178,13 +178,13 @@ The content of this structure is not made public by the API.

          Free an expression context

          ctxt:an expression context

          -

          xmlExpGetLanguage ()

          int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
          xmlExpNodePtr exp,
          const xmlChar ** list,
          int len)
          +

          xmlExpGetLanguage ()

          int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
          xmlExpNodePtr exp,
          const xmlChar ** langList,
          int len)

          Find all the strings used in @exp and store them in @list

          -
          ctxt:the expression context
          exp:the expression
          list:where to store the tokens
          len:the allocated lenght of @list
          Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings
          +
          ctxt:the expression context
          exp:the expression
          langList:where to store the tokens
          len:the allocated lenght of @list
          Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

          -

          xmlExpGetStart ()

          int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
          xmlExpNodePtr exp,
          const xmlChar ** list,
          int len)
          +

          xmlExpGetStart ()

          int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
          xmlExpNodePtr exp,
          const xmlChar ** tokList,
          int len)

          Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]

          -
          ctxt:the expression context
          exp:the expression
          list:where to store the tokens
          len:the allocated lenght of @list
          Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings
          +
          ctxt:the expression context
          exp:the expression
          tokList:where to store the tokens
          len:the allocated lenght of @list
          Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

          xmlExpIsNillable ()

          int	xmlExpIsNillable		(xmlExpNodePtr exp)

          Finds if the expression is nillable, i.e. if it accepts the empty sequqnce

          diff --git a/doc/devhelp/libxml2-xmlsave.html b/doc/devhelp/libxml2-xmlsave.html index 0c416f4..910a1df 100644 --- a/doc/devhelp/libxml2-xmlsave.html +++ b/doc/devhelp/libxml2-xmlsave.html @@ -50,6 +50,7 @@ typedef xmlSaveCtxt * xmlSaveCtxtPtr xmlSaveToFd (int fd,
          const char * encoding,
          int options); int xmlSaveClose (xmlSaveCtxtPtr ctxt); int xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
          xmlCharEncodingOutputFunc escape); +xmlSaveCtxtPtr xmlSaveToBuffer (xmlBufferPtr buffer,
          const char * encoding,
          int options); xmlSaveCtxtPtr xmlSaveToFilename (const char * filename,
          const char * encoding,
          int options); int xmlSaveFlush (xmlSaveCtxtPtr ctxt); long xmlSaveDoc (xmlSaveCtxtPtr ctxt,
          xmlDocPtr doc); @@ -101,6 +102,10 @@ The content of this structure is not made public by the API.

          xmlSaveSetEscape ()

          int	xmlSaveSetEscape		(xmlSaveCtxtPtr ctxt, 
          xmlCharEncodingOutputFunc escape)

          Set a custom escaping function to be used for text in element content

          ctxt:a document saving context
          escape:the escaping function
          Returns:0 if successful or -1 in case of error.
          +
          +

          xmlSaveToBuffer ()

          xmlSaveCtxtPtr	xmlSaveToBuffer		(xmlBufferPtr buffer, 
          const char * encoding,
          int options)
          +

          Create a document saving context serializing to a buffer with the encoding and the options given

          +
          buffer:a buffer
          encoding:the encoding name to use or NULL
          options:a set of xmlSaveOptions
          Returns:a new serialization context or NULL in case of error.

          xmlSaveToFd ()

          xmlSaveCtxtPtr	xmlSaveToFd		(int fd, 
          const char * encoding,
          int options)

          Create a document saving context serializing to a file descriptor with the encoding and the options given.

          diff --git a/doc/devhelp/libxml2-xmlschemas.html b/doc/devhelp/libxml2-xmlschemas.html index bf5120e..4801ea5 100644 --- a/doc/devhelp/libxml2-xmlschemas.html +++ b/doc/devhelp/libxml2-xmlschemas.html @@ -68,7 +68,7 @@ void xmlSchemaSetValidStructuredErr void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
          xmlSchemaValidityErrorFunc err,
          xmlSchemaValidityWarningFunc warn,
          void * ctx); int xmlSchemaValidCtxtGetOptions (xmlSchemaValidCtxtPtr ctxt); int xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
          const char * filename,
          int options); -int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
          xmlDocPtr doc); +int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
          xmlDocPtr instance); void xmlSchemaFree (xmlSchemaPtr schema); xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt (const char * buffer,
          int size); int xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
          xmlSchemaValidityErrorFunc * err,
          xmlSchemaValidityWarningFunc * warn,
          void ** ctx); @@ -77,6 +77,7 @@ void xmlSchemaSetParserErrors (xmlSchemaValidityWarningFunc (void * ctx,
          const char * msg,
          ... ...); void xmlSchemaDump (FILE * output,
          xmlSchemaPtr schema); void xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); +void xmlSchemaSetParserStructuredErrors (xmlSchemaParserCtxtPtr ctxt,
          xmlStructuredErrorFunc serror,
          void * ctx); xmlSchemaValidCtxtPtr xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
          @@ -90,7 +91,7 @@ void xmlSchemaFreeValidCtxt (xmlChar * name : schema name const xmlChar * targetNamespace : the target namespace const xmlChar * version - const xmlChar * id + const xmlChar * id : Obsolete xmlDocPtr doc xmlSchemaAnnotPtr annot int flags @@ -106,8 +107,8 @@ void xmlSchemaFreeValidCtxt (xmlHashTablePtr idcDef - void * volatiles : Deprecated; not used anymore. + xmlHashTablePtr idcDef : All identity-constraint defs. + void * volatiles : Obsolete } xmlSchema;

          @@ -204,20 +205,20 @@ The content of this structure is not made public by the API.
          ctxt:the schema parser context

          xmlSchemaFreeValidCtxt ()

          void	xmlSchemaFreeValidCtxt		(xmlSchemaValidCtxtPtr ctxt)
          -

          Free the resources associated to the schema validation context

          -
          ctxt:the schema validation context
          +

          +

          ctxt:

          xmlSchemaGetParserErrors ()

          int	xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
          xmlSchemaValidityErrorFunc * err,
          xmlSchemaValidityWarningFunc * warn,
          void ** ctx)

          Get the callback information used to handle errors for a parser context

          ctxt:a XMl-Schema parser 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

          xmlSchemaGetValidErrors ()

          int	xmlSchemaGetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
          xmlSchemaValidityErrorFunc * err,
          xmlSchemaValidityWarningFunc * warn,
          void ** ctx)
          -

          Get the error and warning callback informations

          -
          ctxt:a XML-Schema 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
          +

          +

          ctxt:
          err:
          warn:
          ctx:
          Returns:

          xmlSchemaIsValid ()

          int	xmlSchemaIsValid		(xmlSchemaValidCtxtPtr ctxt)
          -

          Check if any error was detected during validation.

          -
          ctxt:the schema validation context
          Returns:1 if valid so far, 0 if errors were detected, and -1 in case of internal error.
          +

          +

          ctxt:
          Returns:

          xmlSchemaNewDocParserCtxt ()

          xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc)

          Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.

          @@ -232,56 +233,60 @@ The content of this structure is not made public by the API.
          URL:the location of the schema
          Returns:the parser context or NULL in case of error

          xmlSchemaNewValidCtxt ()

          xmlSchemaValidCtxtPtr	xmlSchemaNewValidCtxt	(xmlSchemaPtr schema)
          -

          Create an XML Schemas validation context based on the given schema.

          -
          schema:a precompiled XML Schemas
          Returns:the validation context or NULL in case of error
          +

          +

          schema:
          Returns:

          xmlSchemaParse ()

          xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt)
          -

          parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change

          +

          parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

          ctxt:a schema validation context
          Returns:the internal XML Schema structure built from the resource or NULL in case of error

          xmlSchemaSAXPlug ()

          xmlSchemaSAXPlugPtr	xmlSchemaSAXPlug	(xmlSchemaValidCtxtPtr ctxt, 
          xmlSAXHandlerPtr * sax,
          void ** user_data)
          -

          Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.

          -
          ctxt:a schema validation context
          sax:a pointer to the original xmlSAXHandlerPtr
          user_data:a pointer to the original SAX user data pointer
          Returns:a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.
          +

          +

          ctxt:
          sax:
          user_data:
          Returns:

          xmlSchemaSAXUnplug ()

          int	xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug)
          -

          Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.

          -
          plug:a data structure returned by xmlSchemaSAXPlug
          Returns:0 in case of success and -1 in case of failure.
          +

          +

          plug:
          Returns:

          xmlSchemaSetParserErrors ()

          void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
          xmlSchemaValidityErrorFunc err,
          xmlSchemaValidityWarningFunc warn,
          void * ctx)

          Set the callback functions used to handle errors for a validation context

          ctxt:a schema validation context
          err:the error callback
          warn:the warning callback
          ctx:contextual data for the callbacks
          +
          +

          xmlSchemaSetParserStructuredErrors ()

          void	xmlSchemaSetParserStructuredErrors	(xmlSchemaParserCtxtPtr ctxt, 
          xmlStructuredErrorFunc serror,
          void * ctx)
          +

          Set the structured error callback

          +
          ctxt:a schema parser context
          serror:the structured error function
          ctx:the functions context

          xmlSchemaSetValidErrors ()

          void	xmlSchemaSetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
          xmlSchemaValidityErrorFunc err,
          xmlSchemaValidityWarningFunc warn,
          void * ctx)
          -

          Set the error and warning callback informations

          -
          ctxt:a schema validation context
          err:the error function
          warn:the warning function
          ctx:the functions context
          +

          +

          ctxt:
          err:
          warn:
          ctx:

          xmlSchemaSetValidOptions ()

          int	xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt, 
          int options)
          -

          Sets the options to be used during the validation.

          -
          ctxt:a schema validation context
          options:a combination of xmlSchemaValidOption
          Returns:0 in case of success, -1 in case of an API error.
          +

          +

          ctxt:
          options:
          Returns:

          xmlSchemaSetValidStructuredErrors ()

          void	xmlSchemaSetValidStructuredErrors	(xmlSchemaValidCtxtPtr ctxt, 
          xmlStructuredErrorFunc serror,
          void * ctx)
          -

          Set the structured error callback

          -
          ctxt:a schema validation context
          serror:the structured error function
          ctx:the functions context
          +

          +

          ctxt:
          serror:
          ctx:

          xmlSchemaValidCtxtGetOptions ()

          int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)
          -

          Get the validation context options.

          -
          ctxt:a schema validation context
          Returns:the option combination or -1 on error.
          +

          +

          ctxt:
          Returns:

          -

          xmlSchemaValidateDoc ()

          int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
          xmlDocPtr doc)
          -

          Validate a document tree in memory.

          -
          ctxt:a schema validation context
          doc:a parsed document tree
          Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.
          +

          xmlSchemaValidateFile ()

          int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
          const char * filename,
          int options)
          -

          Do a schemas validation of the given resource, it will use the SAX streamable validation internally.

          -
          ctxt:a schema validation context
          filename:the URI of the instance
          options:a future set of options, currently unused
          Returns:0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.
          +

          +

          ctxt:
          filename:
          options:
          Returns:

          xmlSchemaValidateOneElement ()

          int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
          xmlNodePtr elem)
          -

          Validate a branch of a tree, starting with the given @elem.

          -
          ctxt:a schema validation context
          elem:an element node
          Returns:0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.
          +

          +

          ctxt:
          elem:
          Returns:

          xmlSchemaValidateStream ()

          int	xmlSchemaValidateStream		(xmlSchemaValidCtxtPtr ctxt, 
          xmlParserInputBufferPtr input,
          xmlCharEncoding enc,
          xmlSAXHandlerPtr sax,
          void * user_data)
          -

          Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.

          -
          ctxt:a schema validation context
          input:the input to use for reading the data
          enc:an optional encoding information
          sax:a SAX handler for the resulting events
          user_data:the context to provide to the SAX handler.
          Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.
          +

          +

          ctxt:
          input:
          enc:
          sax:
          user_data:
          Returns:

          diff --git a/doc/devhelp/libxml2-xmlstring.html b/doc/devhelp/libxml2-xmlstring.html index f7abfa3..43da9a4 100644 --- a/doc/devhelp/libxml2-xmlstring.html +++ b/doc/devhelp/libxml2-xmlstring.html @@ -108,7 +108,7 @@ int xmlUTF8Strloc (const
          utf:a sequence of UTF-8 encoded bytes
          len:a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence.
          Returns:the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error)

          xmlStrEqual ()

          int	xmlStrEqual			(const xmlChar * str1, 
          const xmlChar * str2)
          -

          Check if both string are equal of have same content Should be a bit more readable and faster than xmlStrEqual()

          +

          Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp()

          str1:the first xmlChar *
          str2:the second xmlChar *
          Returns:1 if they are equal, 0 if they are different


          xmlStrncat ()

          xmlChar *	xmlStrncat		(xmlChar * cur, 
          const xmlChar * add,
          int len)
          -

          a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add.

          +

          a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned.

          cur:the original xmlChar * array
          add:the xmlChar * array added
          len:the length of @add
          Returns:a new xmlChar *, the original @cur is reallocated if needed and should not be freed

          xmlStrncatNew ()

          xmlChar *	xmlStrncatNew		(const xmlChar * str1, 
          const xmlChar * str2,
          int len)
          -

          same as xmlStrncat, but creates a new string. The original two strings are not freed.

          -
          str1:first xmlChar string
          str2:second xmlChar string
          len:the len of @str2
          Returns:a new xmlChar * or NULL
          +

          same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically.

          +
          str1:first xmlChar string
          str2:second xmlChar string
          len:the len of @str2 or < 0
          Returns:a new xmlChar * or NULL

          xmlStrncmp ()

          int	xmlStrncmp			(const xmlChar * str1, 
          const xmlChar * str2,
          int len)

          a strncmp for xmlChar's

          diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp index edc74cd..c8d5572 100644 --- a/doc/devhelp/libxml2.devhelp +++ b/doc/devhelp/libxml2.devhelp @@ -166,7 +166,9 @@ + + @@ -230,6 +232,7 @@ + @@ -956,13 +959,18 @@ + + + + + @@ -1309,6 +1317,7 @@ + @@ -1327,6 +1336,7 @@ + @@ -1922,6 +1932,7 @@ + @@ -2521,6 +2532,7 @@ + @@ -2757,6 +2769,7 @@ + @@ -2801,6 +2814,7 @@ + @@ -2881,6 +2895,8 @@ + + @@ -2961,6 +2977,7 @@ + diff --git a/doc/downloads.html b/doc/downloads.html index b0347d7..8dcfab9 100644 --- a/doc/downloads.html +++ b/doc/downloads.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Downloads
          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
          Made with Libxml2 Logo

          The XML C parser and toolkit of Gnome

          Downloads

          Main Menu
          Related links

          The latest versions of libxml2 can be found on the xmlsoft.org server ( HTTP, FTP and rsync are available), there is also +Downloads
          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
          Made with Libxml2 Logo

          The XML C parser and toolkit of Gnome

          Downloads

          Main Menu
          Related links

          The latest versions of libxml2 can be found on the xmlsoft.org server ( HTTP, FTP and rsync are available), there is also mirrors (Australia( Web), France) or on the Gnome FTP server as source archive , Antonin Sprinzl also provide a mirror in Austria. (NOTE that you need both the libxml(2) and libxml(2)-devel @@ -17,12 +17,13 @@ Windows binaries made by Igor Zlatovic are available in the Igor Zlatkovic is now the maintainer of the Windows port, he provides binaries. -

        • Blastwave provides - Solaris binaries.
        • +
        • Blastwave provides Solaris + binaries.
        • Steve Ball provides Mac Os X binaries.
        • The HP-UX porting center provides HP-UX binaries
        • -
        • Bull provides precompiled RPMs for AIX as patr of their GNOME packages
        • +
        • Bull provides precompiled RPMs for AIX as + patr of their GNOME packages
        • If you know other supported binary ports, please contact me.

          Snapshot:

          Contributions:

          I do accept external contributions, especially if compiling on another diff --git a/doc/encoding.html b/doc/encoding.html index 04d54e7..47171f7 100644 --- a/doc/encoding.html +++ b/doc/encoding.html @@ -7,14 +7,13 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Encodings support
          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
          Made with Libxml2 Logo

          The XML C parser and toolkit of Gnome

          Encodings support

          Main Menu
          Related links

          If you are not really familiar with Internationalization (usual shortcut +Encodings support
          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
          Made with Libxml2 Logo

          The XML C parser and toolkit of Gnome

          Encodings support

          Main Menu
          Related links

          If you are not really familiar with Internationalization (usual shortcut is I18N) , Unicode, characters and glyphs, I suggest you read a presentation by Tim Bray on Unicode and why you should care about it.

          If you don't understand why it does not make sense to have a string -without knowing what encoding it uses, then as Joel Spolsky said -please do -not write another line of code until you finish reading that article.. -It is a prerequisite to understand this page, and avoid a lot of problems -with libxml2, XML or text processing in general.

          Table of Content:

          1. What does internationalization support +without knowing what encoding it uses, then as Joel Spolsky said please do not +write another line of code until you finish reading that article.. It is +a prerequisite to understand this page, and avoid a lot of problems with +libxml2, XML or text processing in general.

            Table of Content:

            1. What does internationalization support mean ?
            2. The internal encoding, how and why
            3. @@ -185,7 +184,10 @@ detecting such a tag on input. Except for that the processing is the same set of encodings supported by iconv can be instantly be used by libxml. On a linux machine with glibc-2.1 the list of supported encodings and aliases fill 3 full pages, and include UCS-4, the full set of ISO-Latin encodings, and the -various Japanese ones.

              Encoding aliases

              From 2.2.3, libxml2 has support to register encoding names aliases. The +various Japanese ones.

              To convert from the UTF-8 values returned from the API to another encoding +then it is possible to use the function provided from the encoding module like UTF8Toisolat1, or use the +POSIX iconv() +API directly.

              Encoding aliases

              From 2.2.3, libxml2 has support to register encoding names aliases. The goal is to be able to parse document whose encoding is supported but where the name differs (for example from the default set of names accepted by iconv). The following functions allow to register and handle new aliases for diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 0bc8934..55a674d 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -15,20 +15,40 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) -EXTRA_DIST=examples.xsl index.py test3.xml tst.xml test2.xml writer.xml test1.xml examples.xml xpath1.res tree2.res reader3.res tree1.res reader1.res xpath2.res reader4.res io2.res io1.res +EXTRA_DIST=examples.xsl index.py examples.xml test1.xml test2.xml test3.xml tst.xml writer.xml io1.res io2.res reader1.res reader3.res reader4.res tree1.res tree2.res xpath1.res xpath2.res -noinst_PROGRAMS=reader3 io2 reader1 reader2 reader4 testWriter parse3 tree2 tree1 xpath2 parse1 xpath1 io1 parse4 parse2 +noinst_PROGRAMS=io1 io2 parse1 parse2 parse3 parse4 reader1 reader2 reader3 reader4 testWriter tree1 tree2 xpath1 xpath2 -reader3_SOURCES=reader3.c -reader3_LDFLAGS= -reader3_DEPENDENCIES= $(DEPS) -reader3_LDADD= @RDL_LIBS@ $(LDADDS) +io1_SOURCES=io1.c +io1_LDFLAGS= +io1_DEPENDENCIES= $(DEPS) +io1_LDADD= @RDL_LIBS@ $(LDADDS) io2_SOURCES=io2.c io2_LDFLAGS= io2_DEPENDENCIES= $(DEPS) io2_LDADD= @RDL_LIBS@ $(LDADDS) +parse1_SOURCES=parse1.c +parse1_LDFLAGS= +parse1_DEPENDENCIES= $(DEPS) +parse1_LDADD= @RDL_LIBS@ $(LDADDS) + +parse2_SOURCES=parse2.c +parse2_LDFLAGS= +parse2_DEPENDENCIES= $(DEPS) +parse2_LDADD= @RDL_LIBS@ $(LDADDS) + +parse3_SOURCES=parse3.c +parse3_LDFLAGS= +parse3_DEPENDENCIES= $(DEPS) +parse3_LDADD= @RDL_LIBS@ $(LDADDS) + +parse4_SOURCES=parse4.c +parse4_LDFLAGS= +parse4_DEPENDENCIES= $(DEPS) +parse4_LDADD= @RDL_LIBS@ $(LDADDS) + reader1_SOURCES=reader1.c reader1_LDFLAGS= reader1_DEPENDENCIES= $(DEPS) @@ -39,6 +59,11 @@ reader2_LDFLAGS= reader2_DEPENDENCIES= $(DEPS) reader2_LDADD= @RDL_LIBS@ $(LDADDS) +reader3_SOURCES=reader3.c +reader3_LDFLAGS= +reader3_DEPENDENCIES= $(DEPS) +reader3_LDADD= @RDL_LIBS@ $(LDADDS) + reader4_SOURCES=reader4.c reader4_LDFLAGS= reader4_DEPENDENCIES= $(DEPS) @@ -49,50 +74,25 @@ testWriter_LDFLAGS= testWriter_DEPENDENCIES= $(DEPS) testWriter_LDADD= @RDL_LIBS@ $(LDADDS) -parse3_SOURCES=parse3.c -parse3_LDFLAGS= -parse3_DEPENDENCIES= $(DEPS) -parse3_LDADD= @RDL_LIBS@ $(LDADDS) - -tree2_SOURCES=tree2.c -tree2_LDFLAGS= -tree2_DEPENDENCIES= $(DEPS) -tree2_LDADD= @RDL_LIBS@ $(LDADDS) - tree1_SOURCES=tree1.c tree1_LDFLAGS= tree1_DEPENDENCIES= $(DEPS) tree1_LDADD= @RDL_LIBS@ $(LDADDS) -xpath2_SOURCES=xpath2.c -xpath2_LDFLAGS= -xpath2_DEPENDENCIES= $(DEPS) -xpath2_LDADD= @RDL_LIBS@ $(LDADDS) - -parse1_SOURCES=parse1.c -parse1_LDFLAGS= -parse1_DEPENDENCIES= $(DEPS) -parse1_LDADD= @RDL_LIBS@ $(LDADDS) +tree2_SOURCES=tree2.c +tree2_LDFLAGS= +tree2_DEPENDENCIES= $(DEPS) +tree2_LDADD= @RDL_LIBS@ $(LDADDS) xpath1_SOURCES=xpath1.c xpath1_LDFLAGS= xpath1_DEPENDENCIES= $(DEPS) xpath1_LDADD= @RDL_LIBS@ $(LDADDS) -io1_SOURCES=io1.c -io1_LDFLAGS= -io1_DEPENDENCIES= $(DEPS) -io1_LDADD= @RDL_LIBS@ $(LDADDS) - -parse4_SOURCES=parse4.c -parse4_LDFLAGS= -parse4_DEPENDENCIES= $(DEPS) -parse4_LDADD= @RDL_LIBS@ $(LDADDS) - -parse2_SOURCES=parse2.c -parse2_LDFLAGS= -parse2_DEPENDENCIES= $(DEPS) -parse2_LDADD= @RDL_LIBS@ $(LDADDS) +xpath2_SOURCES=xpath2.c +xpath2_LDFLAGS= +xpath2_DEPENDENCIES= $(DEPS) +xpath2_LDADD= @RDL_LIBS@ $(LDADDS) valgrind: $(MAKE) CHECKER='valgrind' tests @@ -100,35 +100,35 @@ valgrind: tests: $(noinst_PROGRAMS) @(echo '## examples regression tests') @(echo > .memdump) - @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse1 test1.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse2 test2.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse3) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse4 test3.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse3) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse1 test1.xml) + @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse4 test3.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse2 test2.xml) + @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) diff --git a/doc/examples/Makefile.in b/doc/examples/Makefile.in index de15f68..4f45c76 100644 --- a/doc/examples/Makefile.in +++ b/doc/examples/Makefile.in @@ -38,11 +38,11 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = reader3$(EXEEXT) io2$(EXEEXT) reader1$(EXEEXT) \ - reader2$(EXEEXT) reader4$(EXEEXT) testWriter$(EXEEXT) \ - parse3$(EXEEXT) tree2$(EXEEXT) tree1$(EXEEXT) xpath2$(EXEEXT) \ - parse1$(EXEEXT) xpath1$(EXEEXT) io1$(EXEEXT) parse4$(EXEEXT) \ - parse2$(EXEEXT) +noinst_PROGRAMS = io1$(EXEEXT) io2$(EXEEXT) parse1$(EXEEXT) \ + parse2$(EXEEXT) parse3$(EXEEXT) parse4$(EXEEXT) \ + reader1$(EXEEXT) reader2$(EXEEXT) reader3$(EXEEXT) \ + reader4$(EXEEXT) testWriter$(EXEEXT) tree1$(EXEEXT) \ + tree2$(EXEEXT) xpath1$(EXEEXT) xpath2$(EXEEXT) subdir = doc/examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -325,15 +325,31 @@ target_alias = @target_alias@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ DEPS = $(top_builddir)/libxml2.la LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ -EXTRA_DIST = examples.xsl index.py test3.xml tst.xml test2.xml writer.xml test1.xml examples.xml xpath1.res tree2.res reader3.res tree1.res reader1.res xpath2.res reader4.res io2.res io1.res -reader3_SOURCES = reader3.c -reader3_LDFLAGS = -reader3_DEPENDENCIES = $(DEPS) -reader3_LDADD = @RDL_LIBS@ $(LDADDS) +EXTRA_DIST = examples.xsl index.py examples.xml test1.xml test2.xml test3.xml tst.xml writer.xml io1.res io2.res reader1.res reader3.res reader4.res tree1.res tree2.res xpath1.res xpath2.res +io1_SOURCES = io1.c +io1_LDFLAGS = +io1_DEPENDENCIES = $(DEPS) +io1_LDADD = @RDL_LIBS@ $(LDADDS) io2_SOURCES = io2.c io2_LDFLAGS = io2_DEPENDENCIES = $(DEPS) io2_LDADD = @RDL_LIBS@ $(LDADDS) +parse1_SOURCES = parse1.c +parse1_LDFLAGS = +parse1_DEPENDENCIES = $(DEPS) +parse1_LDADD = @RDL_LIBS@ $(LDADDS) +parse2_SOURCES = parse2.c +parse2_LDFLAGS = +parse2_DEPENDENCIES = $(DEPS) +parse2_LDADD = @RDL_LIBS@ $(LDADDS) +parse3_SOURCES = parse3.c +parse3_LDFLAGS = +parse3_DEPENDENCIES = $(DEPS) +parse3_LDADD = @RDL_LIBS@ $(LDADDS) +parse4_SOURCES = parse4.c +parse4_LDFLAGS = +parse4_DEPENDENCIES = $(DEPS) +parse4_LDADD = @RDL_LIBS@ $(LDADDS) reader1_SOURCES = reader1.c reader1_LDFLAGS = reader1_DEPENDENCIES = $(DEPS) @@ -342,6 +358,10 @@ reader2_SOURCES = reader2.c reader2_LDFLAGS = reader2_DEPENDENCIES = $(DEPS) reader2_LDADD = @RDL_LIBS@ $(LDADDS) +reader3_SOURCES = reader3.c +reader3_LDFLAGS = +reader3_DEPENDENCIES = $(DEPS) +reader3_LDADD = @RDL_LIBS@ $(LDADDS) reader4_SOURCES = reader4.c reader4_LDFLAGS = reader4_DEPENDENCIES = $(DEPS) @@ -350,42 +370,22 @@ testWriter_SOURCES = testWriter.c testWriter_LDFLAGS = testWriter_DEPENDENCIES = $(DEPS) testWriter_LDADD = @RDL_LIBS@ $(LDADDS) -parse3_SOURCES = parse3.c -parse3_LDFLAGS = -parse3_DEPENDENCIES = $(DEPS) -parse3_LDADD = @RDL_LIBS@ $(LDADDS) -tree2_SOURCES = tree2.c -tree2_LDFLAGS = -tree2_DEPENDENCIES = $(DEPS) -tree2_LDADD = @RDL_LIBS@ $(LDADDS) tree1_SOURCES = tree1.c tree1_LDFLAGS = tree1_DEPENDENCIES = $(DEPS) tree1_LDADD = @RDL_LIBS@ $(LDADDS) -xpath2_SOURCES = xpath2.c -xpath2_LDFLAGS = -xpath2_DEPENDENCIES = $(DEPS) -xpath2_LDADD = @RDL_LIBS@ $(LDADDS) -parse1_SOURCES = parse1.c -parse1_LDFLAGS = -parse1_DEPENDENCIES = $(DEPS) -parse1_LDADD = @RDL_LIBS@ $(LDADDS) +tree2_SOURCES = tree2.c +tree2_LDFLAGS = +tree2_DEPENDENCIES = $(DEPS) +tree2_LDADD = @RDL_LIBS@ $(LDADDS) xpath1_SOURCES = xpath1.c xpath1_LDFLAGS = xpath1_DEPENDENCIES = $(DEPS) xpath1_LDADD = @RDL_LIBS@ $(LDADDS) -io1_SOURCES = io1.c -io1_LDFLAGS = -io1_DEPENDENCIES = $(DEPS) -io1_LDADD = @RDL_LIBS@ $(LDADDS) -parse4_SOURCES = parse4.c -parse4_LDFLAGS = -parse4_DEPENDENCIES = $(DEPS) -parse4_LDADD = @RDL_LIBS@ $(LDADDS) -parse2_SOURCES = parse2.c -parse2_LDFLAGS = -parse2_DEPENDENCIES = $(DEPS) -parse2_LDADD = @RDL_LIBS@ $(LDADDS) +xpath2_SOURCES = xpath2.c +xpath2_LDFLAGS = +xpath2_DEPENDENCIES = $(DEPS) +xpath2_LDADD = @RDL_LIBS@ $(LDADDS) all: all-am .SUFFIXES: @@ -710,35 +710,35 @@ valgrind: tests: $(noinst_PROGRAMS) @(echo '## examples regression tests') @(echo > .memdump) - @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse1 test1.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse2 test2.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse3) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./parse4 test3.xml) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) + @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse3) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse1 test1.xml) + @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse4 test3.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse2 test2.xml) + @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml index 91122ad..22f730c 100644 --- a/doc/examples/examples.xml +++ b/doc/examples/examples.xml @@ -1,28 +1,28 @@ - - Show how to extract subdocuments with xmlReader - Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.) - reader3 - reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp + + Example of custom Input/Output + Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way. + io1 + io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp Daniel Veillard see Copyright for the status of this software. -

              xmlReader
              +
              InputOutput
              - <libxml/xmlreader.h> + <libxml/parser.h> + <libxml/xmlIO.h> + <libxml/xinclude.h> + <libxml/tree.h> - - - - - - - - - - - - + + + + + + + + + @@ -48,6 +48,97 @@ + + Parse an XML file to a tree and free it + Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree + parse1 test1.xml + parse1 test1.xml + Daniel Veillard + see Copyright for the status of this software. +
              Parsing
              + + <libxml/tree.h> + <libxml/parser.h> + + + + + + + + + +
              + + Parse and validate an XML file to a tree and free the result + Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree. + parse2 test2.xml + parse2 test2.xml + Daniel Veillard + see Copyright for the status of this software. +
              Parsing
              + + <libxml/tree.h> + <libxml/parser.h> + + + + + + + + + + + + + +
              + + Parse an XML document in memory to a tree and free it + Demonstrate the use of xmlReadMemory() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree + parse3 + parse3 + Daniel Veillard + see Copyright for the status of this software. +
              Parsing
              + + <libxml/tree.h> + <libxml/parser.h> + + + + + + + + + +
              + + Parse an XML document chunk by chunk to a tree and free it + Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree + parse4 test3.xml + parse4 test3.xml + Daniel Veillard + see Copyright for the status of this software. +
              Parsing
              + + <libxml/tree.h> + <libxml/parser.h> + + + + + + + + + + + + +
              Parse an XML file with an xmlReader Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.) @@ -89,17 +180,14 @@ - - - @@ -108,6 +196,27 @@ + + Show how to extract subdocuments with xmlReader + Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.) + reader3 + reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp + Daniel Veillard + see Copyright for the status of this software. +
              xmlReader
              + + <libxml/xmlreader.h> + + + + + + + + + + +
              Parse multiple XML files reusing an xmlReader Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.) @@ -120,17 +229,12 @@ <libxml/xmlreader.h> - - - - - @@ -152,9 +256,7 @@ - - @@ -163,10 +265,8 @@ - - @@ -175,32 +275,28 @@ - - - Parse an XML document in memory to a tree and free it - Demonstrate the use of xmlReadMemory() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree - parse3 - parse3 - Daniel Veillard + + Navigates a tree to print element names + 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. + tree1 filename_or_URL + tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp + Dodji Seketeli see Copyright for the status of this software. -
              Parsing
              +
              Tree
              <libxml/tree.h> <libxml/parser.h> - - - - - - + + +
              @@ -224,73 +320,9 @@ - - - Navigates a tree to print element names - 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. - tree1 filename_or_URL - tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp - Dodji Seketeli - see Copyright for the status of this software. -
              Tree
              - - <libxml/tree.h> - <libxml/parser.h> - - - - - - -
              - - Load a document, locate subelements with XPath, modify said elements and save the resulting document. - Shows how to make a full round-trip from a load/edit/save - xpath2 <xml-file> <xpath-expr> <new-value> - xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp - Aleksey Sanin and Daniel Veillard - see Copyright for the status of this software. -
              XPath
              - - <libxml/parser.h> - <libxml/xpath.h> - <libxml/xpathInternals.h> - <libxml/tree.h> - - - - - - - - - - - - - - - -
              - - Parse an XML file to a tree and free it - Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree - parse1 test1.xml - parse1 test1.xml - Daniel Veillard - see Copyright for the status of this software. -
              Parsing
              - - <libxml/tree.h> - <libxml/parser.h> - - - - -
              Evaluate XPath expression and prints result node set. Shows how to evaluate XPath expression and register known namespaces in XPath context. @@ -324,74 +356,42 @@ - - Example of custom Input/Output - Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way. - io1 - io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp - Daniel Veillard - see Copyright for the status of this software. -
              InputOutput
              - - <libxml/parser.h> - <libxml/xmlIO.h> - <libxml/xinclude.h> - <libxml/tree.h> - - - - - - - -
              - - Parse an XML document chunk by chunk to a tree and free it - Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree - parse4 test3.xml - parse4 test3.xml - Daniel Veillard + + Load a document, locate subelements with XPath, modify said elements and save the resulting document. + Shows how to make a full round-trip from a load/edit/save + xpath2 <xml-file> <xpath-expr> <new-value> + xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp + Aleksey Sanin and Daniel Veillard see Copyright for the status of this software. -
              Parsing
              +
              XPath
              - <libxml/tree.h> <libxml/parser.h> - - - - - - - -
              - - Parse and validate an XML file to a tree and free the result - Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree. - parse2 test2.xml - parse2 test2.xml - Daniel Veillard - see Copyright for the status of this software. -
              Parsing
              - + <libxml/xpath.h> + <libxml/xpathInternals.h> <libxml/tree.h> - <libxml/parser.h> - - - - - + + + + + + + + + + +
              - - - - - + + + + + @@ -401,15 +401,15 @@ - + - + @@ -430,12 +430,12 @@ - - - - - + + + + + @@ -447,9 +447,9 @@ + - @@ -458,12 +458,12 @@ - + - - + + - + @@ -479,40 +479,40 @@ - + - - + + - + - + - + - + - - - - - + + + + + @@ -566,25 +566,25 @@ - + - + - + - + - + @@ -647,15 +647,15 @@ - + - + @@ -692,28 +692,28 @@ - + - + - + - + - + - + @@ -721,27 +721,27 @@
              - +
              - - + +
              - +
              - +
              - +
              diff --git a/doc/help.html b/doc/help.html index 3148b84..a9925b2 100644 --- a/doc/help.html +++ b/doc/help.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -How to help
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              The XML C parser and toolkit of Gnome

              How to help

              Main Menu
              Related links

              You can help the project in various ways, the best thing to do first is to +How to help
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              The XML C parser and toolkit of Gnome

              How to help

              Main Menu
              Related links

              You can help the project in various ways, the best thing to do first is to subscribe to the mailing-list as explained before, check the archives and the Gnome bug database:

              1. Provide patches when you find problems.
              2. Provide the diffs when you port libxml2 to a new platform. They may not diff --git a/doc/html/libxml-HTMLtree.html b/doc/html/libxml-HTMLtree.html index bc9bbe9..55ff739 100644 --- a/doc/html/libxml-HTMLtree.html +++ b/doc/html/libxml-HTMLtree.html @@ -14,6 +14,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                void	htmlDocContentDumpOutput	(xmlOutputBufferPtr buf, 
                xmlDocPtr cur,
                const char * encoding)
                int	htmlDocDump			(FILE * f, 
                xmlDocPtr cur)
                void	htmlDocDumpMemory		(xmlDocPtr cur, 
                xmlChar ** mem,
                int * size)
                +
                void	htmlDocDumpMemoryFormat		(xmlDocPtr cur, 
                xmlChar ** mem,
                int * size,
                int format)
                const xmlChar *	htmlGetMetaEncoding	(htmlDocPtr doc)
                int	htmlIsBooleanAttr		(const xmlChar * name)
                htmlDocPtr	htmlNewDoc		(const xmlChar * URI, 
                const xmlChar * ExternalID)
                @@ -41,7 +42,9 @@ A:link, A:visited, A:active { text-decoration: underline }

                Dump an HTML document to an open FILE.

                f:the FILE*
                cur:the document
                Returns:the number of byte written or -1 in case of failure.

                Function: htmlDocDumpMemory

                void	htmlDocDumpMemory		(xmlDocPtr cur, 
                xmlChar ** mem,
                int * size)

                Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.

                -
                cur:the document
                mem:OUT: the memory pointer
                size:OUT: the memory length

                Function: htmlGetMetaEncoding

                const xmlChar *	htmlGetMetaEncoding	(htmlDocPtr doc)
                +
                cur:the document
                mem:OUT: the memory pointer
                size:OUT: the memory length

                Function: htmlDocDumpMemoryFormat

                void	htmlDocDumpMemoryFormat		(xmlDocPtr cur, 
                xmlChar ** mem,
                int * size,
                int format)
                +

                Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory.

                +
                cur:the document
                mem:OUT: the memory pointer
                size:OUT: the memory length
                format:should formatting spaces been added

                Function: htmlGetMetaEncoding

                const xmlChar *	htmlGetMetaEncoding	(htmlDocPtr doc)

                Encoding definition lookup in the Meta tags

                doc:the document
                Returns:the current encoding as flagged in the HTML source

                Function: htmlIsBooleanAttr

                int	htmlIsBooleanAttr		(const xmlChar * name)

                Determine if a given attribute is a boolean attribute.

                diff --git a/doc/html/libxml-pattern.html b/doc/html/libxml-pattern.html index 2415881..ac1de26 100644 --- a/doc/html/libxml-pattern.html +++ b/doc/html/libxml-pattern.html @@ -30,6 +30,8 @@ The content of this structure is not made public by the API.
                int	xmlStreamPop			(xmlStreamCtxtPtr stream)
                int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
                const xmlChar * name,
                const xmlChar * ns)
                int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
                const xmlChar * name,
                const xmlChar * ns)
                +
                int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
                const xmlChar * name,
                const xmlChar * ns,
                int nodeType)
                +
                int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)

                Description

                Structure xmlPattern

                Structure xmlPattern
                struct _xmlPattern { The content of this structure is not made public by the API. @@ -64,7 +66,11 @@ The content of this structure is not made public by the API.
                pattern:the pattern to compile
                dict:an optional dictionary for interned strings
                flags:compilation flags, see xmlPatternFlags
                namespaces:the prefix definitions, array of [URI, prefix] or NULL
                Returns:the compiled form of the pattern or NULL in case of error

                Function: xmlStreamPop

                int	xmlStreamPop			(xmlStreamCtxtPtr stream)

                push one level from the stream.

                stream:the stream context
                Returns:-1 in case of error, 0 otherwise.

                Function: xmlStreamPush

                int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
                const xmlChar * name,
                const xmlChar * ns)
                -

                Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.

                +

                Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an element-node.

                stream:the stream context
                name:the current name
                ns:the namespace name
                Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

                Function: xmlStreamPushAttr

                int	xmlStreamPushAttr		(xmlStreamCtxtPtr stream, 
                const xmlChar * name,
                const xmlChar * ns)
                -

                Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.

                -
                stream:the stream context
                name:the current name
                ns:the namespace name
                Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

                Daniel Veillard

              +

              Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node.

              +
              stream:the stream context
              name:the current name
              ns:the namespace name
              Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

              Function: xmlStreamPushNode

              int	xmlStreamPushNode		(xmlStreamCtxtPtr stream, 
              const xmlChar * name,
              const xmlChar * ns,
              int nodeType)
              +

              Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Different from xmlStreamPush() this function can be fed with nodes of type: element-, attribute-, text-, cdata-section-, comment- and processing-instruction-node.

              +
              stream:the stream context
              name:the current name
              ns:the namespace name
              nodeType:the type of the node being pushed
              Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

              Function: xmlStreamWantsAnyNode

              int	xmlStreamWantsAnyNode		(xmlStreamCtxtPtr streamCtxt)
              +

              Query if the streaming pattern additionally needs to be fed with text-, cdata-section-, comment- and processing-instruction-nodes. If the result is 0 then only element-nodes and attribute-nodes need to be pushed.

              +
              streamCtxt:the stream context
              Returns:1 in case of need of nodes of the above described types, 0 otherwise. -1 on API errors.

              Daniel Veillard

              diff --git a/doc/html/libxml-relaxng.html b/doc/html/libxml-relaxng.html index 637f27f..fd95083 100644 --- a/doc/html/libxml-relaxng.html +++ b/doc/html/libxml-relaxng.html @@ -131,7 +131,7 @@ The content of this structure is not made public by the API.
              URL:the location of the schema
              Returns:the parser context or NULL in case of error

              Function: xmlRelaxNGNewValidCtxt

              xmlRelaxNGValidCtxtPtr	xmlRelaxNGNewValidCtxt	(xmlRelaxNGPtr schema)

              Create an XML RelaxNGs validation context based on the given schema

              schema:a precompiled XML RelaxNGs
              Returns:the validation context or NULL in case of error

              Function: xmlRelaxNGParse

              xmlRelaxNGPtr	xmlRelaxNGParse		(xmlRelaxNGParserCtxtPtr ctxt)
              -

              parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change

              +

              parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

              ctxt:a Relax-NG parser context
              Returns:the internal XML RelaxNG structure built from the resource or NULL in case of error

              Function: xmlRelaxNGSetParserErrors

              void	xmlRelaxNGSetParserErrors	(xmlRelaxNGParserCtxtPtr ctxt, 
              xmlRelaxNGValidityErrorFunc err,
              xmlRelaxNGValidityWarningFunc warn,
              void * ctx)

              Set the callback functions used to handle errors for a validation context

              ctxt:a Relax-NG validation context
              err:the error callback
              warn:the warning callback
              ctx:contextual data for the callbacks

              Function: xmlRelaxNGSetValidErrors

              void	xmlRelaxNGSetValidErrors	(xmlRelaxNGValidCtxtPtr ctxt, 
              xmlRelaxNGValidityErrorFunc err,
              xmlRelaxNGValidityWarningFunc warn,
              void * ctx)
              diff --git a/doc/html/libxml-schemasInternals.html b/doc/html/libxml-schemasInternals.html index 26b8df2..b25f070 100644 --- a/doc/html/libxml-schemasInternals.html +++ b/doc/html/libxml-schemasInternals.html @@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline } Module schemasInternals from libxml2
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              Module schemasInternals from libxml2

              API Menu
              API Indexes
              Related links

              internal interfaces for the XML Schemas handling and schema validity checking

              Table of Contents

              #define XML_SCHEMAS_ANYATTR_LAX
              #define XML_SCHEMAS_ANYATTR_SKIP
              #define XML_SCHEMAS_ANYATTR_STRICT
              #define XML_SCHEMAS_ANY_LAX
              #define XML_SCHEMAS_ANY_SKIP
              #define XML_SCHEMAS_ANY_STRICT
              #define XML_SCHEMAS_ATTRGROUP_GLOBAL
              #define XML_SCHEMAS_ATTRGROUP_MARKED
              #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
              #define XML_SCHEMAS_ATTR_FIXED
              #define XML_SCHEMAS_ATTR_GLOBAL
              #define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
              #define XML_SCHEMAS_ATTR_NSDEFAULT
              #define XML_SCHEMAS_ATTR_USE_OPTIONAL
              #define XML_SCHEMAS_ATTR_USE_PROHIBITED
              #define XML_SCHEMAS_ATTR_USE_REQUIRED
              #define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
              #define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION
              #define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION
              #define XML_SCHEMAS_ELEM_ABSTRACT
              #define XML_SCHEMAS_ELEM_BLOCK_ABSENT
              #define XML_SCHEMAS_ELEM_BLOCK_EXTENSION
              #define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION
              #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION
              #define XML_SCHEMAS_ELEM_CIRCULAR
              #define XML_SCHEMAS_ELEM_DEFAULT
              #define XML_SCHEMAS_ELEM_FINAL_ABSENT
              #define XML_SCHEMAS_ELEM_FINAL_EXTENSION
              #define XML_SCHEMAS_ELEM_FINAL_RESTRICTION
              #define XML_SCHEMAS_ELEM_FIXED
              #define XML_SCHEMAS_ELEM_GLOBAL
              #define XML_SCHEMAS_ELEM_INTERNAL_CHECKED
              #define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
              #define XML_SCHEMAS_ELEM_NILLABLE
              #define XML_SCHEMAS_ELEM_NSDEFAULT
              #define XML_SCHEMAS_ELEM_REF
              #define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD
              #define XML_SCHEMAS_ELEM_TOPLEVEL
              #define XML_SCHEMAS_FACET_COLLAPSE
              #define XML_SCHEMAS_FACET_PRESERVE
              #define XML_SCHEMAS_FACET_REPLACE
              #define XML_SCHEMAS_FACET_UNKNOWN
              #define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION
              #define XML_SCHEMAS_FINAL_DEFAULT_LIST
              #define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION
              #define XML_SCHEMAS_FINAL_DEFAULT_UNION
              #define XML_SCHEMAS_INCLUDING_CONVERT_NS
              #define XML_SCHEMAS_QUALIF_ATTR
              #define XML_SCHEMAS_QUALIF_ELEM
              #define XML_SCHEMAS_TYPE_ABSTRACT
              #define XML_SCHEMAS_TYPE_BLOCK_DEFAULT
              #define XML_SCHEMAS_TYPE_BLOCK_EXTENSION
              #define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION
              #define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
              #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
              #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
              #define XML_SCHEMAS_TYPE_FACETSNEEDVALUE
              #define XML_SCHEMAS_TYPE_FINAL_DEFAULT
              #define XML_SCHEMAS_TYPE_FINAL_EXTENSION
              #define XML_SCHEMAS_TYPE_FINAL_LIST
              #define XML_SCHEMAS_TYPE_FINAL_RESTRICTION
              #define XML_SCHEMAS_TYPE_FINAL_UNION
              #define XML_SCHEMAS_TYPE_FIXUP_1
              #define XML_SCHEMAS_TYPE_GLOBAL
              #define XML_SCHEMAS_TYPE_HAS_FACETS
              #define XML_SCHEMAS_TYPE_INTERNAL_INVALID
              #define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED
              #define XML_SCHEMAS_TYPE_MARKED
              #define XML_SCHEMAS_TYPE_MIXED
              #define XML_SCHEMAS_TYPE_NORMVALUENEEDED
              #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
              #define XML_SCHEMAS_TYPE_VARIETY_ABSENT
              #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC
              #define XML_SCHEMAS_TYPE_VARIETY_LIST
              #define XML_SCHEMAS_TYPE_VARIETY_UNION
              #define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE
              #define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE
              #define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE
              #define XML_SCHEMAS_WILDCARD_COMPLETE
              Structure xmlSchemaAnnot
              struct _xmlSchemaAnnot + Module schemasInternals from libxml2
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              Module schemasInternals from libxml2

              API Menu
              API Indexes
              Related links

              internal interfaces for the XML Schemas handling and schema validity checking The Schemas development is a Work In Progress. Some of those interfaces are not garanteed to be API or ABI stable !

              Table of Contents

              #define XML_SCHEMAS_ANYATTR_LAX
              #define XML_SCHEMAS_ANYATTR_SKIP
              #define XML_SCHEMAS_ANYATTR_STRICT
              #define XML_SCHEMAS_ANY_LAX
              #define XML_SCHEMAS_ANY_SKIP
              #define XML_SCHEMAS_ANY_STRICT
              #define XML_SCHEMAS_ATTRGROUP_GLOBAL
              #define XML_SCHEMAS_ATTRGROUP_HAS_REFS
              #define XML_SCHEMAS_ATTRGROUP_MARKED
              #define XML_SCHEMAS_ATTRGROUP_REDEFINED
              #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
              #define XML_SCHEMAS_ATTR_FIXED
              #define XML_SCHEMAS_ATTR_GLOBAL
              #define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
              #define XML_SCHEMAS_ATTR_NSDEFAULT
              #define XML_SCHEMAS_ATTR_USE_OPTIONAL
              #define XML_SCHEMAS_ATTR_USE_PROHIBITED
              #define XML_SCHEMAS_ATTR_USE_REQUIRED
              #define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
              #define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION
              #define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION
              #define XML_SCHEMAS_ELEM_ABSTRACT
              #define XML_SCHEMAS_ELEM_BLOCK_ABSENT
              #define XML_SCHEMAS_ELEM_BLOCK_EXTENSION
              #define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION
              #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION
              #define XML_SCHEMAS_ELEM_CIRCULAR
              #define XML_SCHEMAS_ELEM_DEFAULT
              #define XML_SCHEMAS_ELEM_FINAL_ABSENT
              #define XML_SCHEMAS_ELEM_FINAL_EXTENSION
              #define XML_SCHEMAS_ELEM_FINAL_RESTRICTION
              #define XML_SCHEMAS_ELEM_FIXED
              #define XML_SCHEMAS_ELEM_GLOBAL
              #define XML_SCHEMAS_ELEM_INTERNAL_CHECKED
              #define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
              #define XML_SCHEMAS_ELEM_NILLABLE
              #define XML_SCHEMAS_ELEM_NSDEFAULT
              #define XML_SCHEMAS_ELEM_REF
              #define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD
              #define XML_SCHEMAS_ELEM_TOPLEVEL
              #define XML_SCHEMAS_FACET_COLLAPSE
              #define XML_SCHEMAS_FACET_PRESERVE
              #define XML_SCHEMAS_FACET_REPLACE
              #define XML_SCHEMAS_FACET_UNKNOWN
              #define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION
              #define XML_SCHEMAS_FINAL_DEFAULT_LIST
              #define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION
              #define XML_SCHEMAS_FINAL_DEFAULT_UNION
              #define XML_SCHEMAS_INCLUDING_CONVERT_NS
              #define XML_SCHEMAS_QUALIF_ATTR
              #define XML_SCHEMAS_QUALIF_ELEM
              #define XML_SCHEMAS_TYPE_ABSTRACT
              #define XML_SCHEMAS_TYPE_BLOCK_DEFAULT
              #define XML_SCHEMAS_TYPE_BLOCK_EXTENSION
              #define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION
              #define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
              #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
              #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
              #define XML_SCHEMAS_TYPE_FACETSNEEDVALUE
              #define XML_SCHEMAS_TYPE_FINAL_DEFAULT
              #define XML_SCHEMAS_TYPE_FINAL_EXTENSION
              #define XML_SCHEMAS_TYPE_FINAL_LIST
              #define XML_SCHEMAS_TYPE_FINAL_RESTRICTION
              #define XML_SCHEMAS_TYPE_FINAL_UNION
              #define XML_SCHEMAS_TYPE_FIXUP_1
              #define XML_SCHEMAS_TYPE_GLOBAL
              #define XML_SCHEMAS_TYPE_HAS_FACETS
              #define XML_SCHEMAS_TYPE_INTERNAL_INVALID
              #define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED
              #define XML_SCHEMAS_TYPE_MARKED
              #define XML_SCHEMAS_TYPE_MIXED
              #define XML_SCHEMAS_TYPE_NORMVALUENEEDED
              #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
              #define XML_SCHEMAS_TYPE_REDEFINED
              #define XML_SCHEMAS_TYPE_VARIETY_ABSENT
              #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC
              #define XML_SCHEMAS_TYPE_VARIETY_LIST
              #define XML_SCHEMAS_TYPE_VARIETY_UNION
              #define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE
              #define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE
              #define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE
              #define XML_SCHEMAS_WILDCARD_COMPLETE
              Structure xmlSchemaAnnot
              struct _xmlSchemaAnnot
              Typedef xmlSchemaAnnot * xmlSchemaAnnotPtr
               
              Structure xmlSchemaAttribute
              struct _xmlSchemaAttribute
              Structure xmlSchemaAttributeGroup
              struct _xmlSchemaAttributeGroup @@ -50,7 +50,9 @@ The content of this structure is not made public by the API.

              Macro: XML_SCHEMAS_ANY_SKIP

              #define XML_SCHEMAS_ANY_SKIP

              Skip unknown attribute from validation

              Macro: XML_SCHEMAS_ANY_STRICT

              #define XML_SCHEMAS_ANY_STRICT

              Used by wildcards. Apply strict validation rules

              Macro: XML_SCHEMAS_ATTRGROUP_GLOBAL

              #define XML_SCHEMAS_ATTRGROUP_GLOBAL

              The attribute wildcard has been already builded.

              +

              Macro: XML_SCHEMAS_ATTRGROUP_HAS_REFS

              #define XML_SCHEMAS_ATTRGROUP_HAS_REFS

              Whether this attr. group contains attr. group references.

              Macro: XML_SCHEMAS_ATTRGROUP_MARKED

              #define XML_SCHEMAS_ATTRGROUP_MARKED

              Marks the attr group as marked; used for circular checks.

              +

              Macro: XML_SCHEMAS_ATTRGROUP_REDEFINED

              #define XML_SCHEMAS_ATTRGROUP_REDEFINED

              The attr group was redefined.

              Macro: XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED

              #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED

              The attribute wildcard has been already builded.

              Macro: XML_SCHEMAS_ATTR_FIXED

              #define XML_SCHEMAS_ATTR_FIXED

              the attribute has a fixed value

              Macro: XML_SCHEMAS_ATTR_GLOBAL

              #define XML_SCHEMAS_ATTR_GLOBAL

              allow elements in no namespace

              @@ -114,7 +116,8 @@ The content of this structure is not made public by the API.

              Macro: XML_SCHEMAS_TYPE_MIXED

              #define XML_SCHEMAS_TYPE_MIXED

              the element content type is mixed

              Macro: XML_SCHEMAS_TYPE_NORMVALUENEEDED

              #define XML_SCHEMAS_TYPE_NORMVALUENEEDED

              indicates if the facets (pattern) need a normalized value

              Macro: XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD

              #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD

              the complexType owns an attribute wildcard, i.e. it can be freed by the complexType

              -

              Macro: XML_SCHEMAS_TYPE_VARIETY_ABSENT

              #define XML_SCHEMAS_TYPE_VARIETY_ABSENT

              the simpleType has a variety of "absent".

              +

              Macro: XML_SCHEMAS_TYPE_REDEFINED

              #define XML_SCHEMAS_TYPE_REDEFINED

              The type was redefined.

              +

              Macro: XML_SCHEMAS_TYPE_VARIETY_ABSENT

              #define XML_SCHEMAS_TYPE_VARIETY_ABSENT

              the simpleType has a variety of "absent". TODO: Actually not necessary :-/, since if none of the variety flags occur then it's automatically absent.

              Macro: XML_SCHEMAS_TYPE_VARIETY_ATOMIC

              #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC

              the simpleType has a variety of "union".

              Macro: XML_SCHEMAS_TYPE_VARIETY_LIST

              #define XML_SCHEMAS_TYPE_VARIETY_LIST

              the simpleType has a variety of "list".

              Macro: XML_SCHEMAS_TYPE_VARIETY_UNION

              #define XML_SCHEMAS_TYPE_VARIETY_UNION

              the simpleType has a variety of "union".

              @@ -126,40 +129,41 @@ The content of this structure is not made public by the API. struct _xmlSchemaAnnot * next xmlNodePtr content : the annotation }

              Structure xmlSchemaAttribute

              Structure xmlSchemaAttribute
              struct _xmlSchemaAttribute { - xmlSchemaTypeType type : The kind of type - struct _xmlSchemaAttribute * next : the next attribute if in a group ... - const xmlChar * name : name of the declaration or empty if par - const xmlChar * id - const xmlChar * ref : the local name of the attribute decl. i - const xmlChar * refNs : the ns URI of the attribute decl. if a + xmlSchemaTypeType type + struct _xmlSchemaAttribute * next : the next attribute (not used?) + const xmlChar * name : the name of the declaration + const xmlChar * id : Deprecated; not used + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used const xmlChar * typeName : the local name of the type definition const xmlChar * typeNs : the ns URI of the type definition xmlSchemaAnnotPtr annot - xmlSchemaTypePtr base : obsolete, not used - int occurs - const xmlChar * defValue + xmlSchemaTypePtr base : Deprecated; not used + int occurs : Deprecated; not used + const xmlChar * defValue : The initial value of the value constrai xmlSchemaTypePtr subtypes : the type definition xmlNodePtr node const xmlChar * targetNamespace int flags - const xmlChar * refPrefix - xmlSchemaValPtr defVal - xmlSchemaAttributePtr refDecl + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaValPtr defVal : The compiled value constraint + xmlSchemaAttributePtr refDecl : Deprecated; not used }

              Structure xmlSchemaAttributeGroup

              Structure xmlSchemaAttributeGroup
              struct _xmlSchemaAttributeGroup { xmlSchemaTypeType type : The kind of type struct _xmlSchemaAttribute * next : the next attribute if in a group ... const xmlChar * name const xmlChar * id - const xmlChar * ref - const xmlChar * refNs + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used xmlSchemaAnnotPtr annot - xmlSchemaAttributePtr attributes + xmlSchemaAttributePtr attributes : Deprecated; not used xmlNodePtr node int flags xmlSchemaWildcardPtr attributeWildcard - const xmlChar * refPrefix - xmlSchemaAttributeGroupPtr refItem : The referenced attribute group - const xmlChar * targetNamespace : xmlSchemaAttributeGroupPtr redef Redefi + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaAttributeGroupPtr refItem : Deprecated; not used + const xmlChar * targetNamespace + void * attrUses }

              Structure xmlSchemaAttributeLink

              Structure xmlSchemaAttributeLink
              struct _xmlSchemaAttributeLink { struct _xmlSchemaAttributeLink * next : the next attribute link ... struct _xmlSchemaAttribute * attr : the linked attribute @@ -169,23 +173,23 @@ The content of this structure is not made public by the API. XML_SCHEMA_CONTENT_ELEMENTS = 2 XML_SCHEMA_CONTENT_MIXED = 3 XML_SCHEMA_CONTENT_SIMPLE = 4 - XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5 : obsolete, not used + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5 : Obsolete XML_SCHEMA_CONTENT_BASIC = 6 XML_SCHEMA_CONTENT_ANY = 7 }

              Structure xmlSchemaElement

              Structure xmlSchemaElement
              struct _xmlSchemaElement { xmlSchemaTypeType type : The kind of type - struct _xmlSchemaType * next : the next type if in a sequence ... + struct _xmlSchemaType * next : Not used? const xmlChar * name - const xmlChar * id - const xmlChar * ref : the local name of the element declarati - const xmlChar * refNs : the ns URI of the element declaration i + const xmlChar * id : Deprecated; not used + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used xmlSchemaAnnotPtr annot xmlSchemaTypePtr subtypes : the type definition xmlSchemaAttributePtr attributes xmlNodePtr node - int minOccurs - int maxOccurs + int minOccurs : Deprecated; not used + int maxOccurs : Deprecated; not used int flags const xmlChar * targetNamespace const xmlChar * namedType @@ -193,24 +197,24 @@ The content of this structure is not made public by the API. const xmlChar * substGroup const xmlChar * substGroupNs const xmlChar * scope - const xmlChar * value + const xmlChar * value : The original value of the value constra struct _xmlSchemaElement * refDecl : This will now be used for the substitut - xmlRegexpPtr contModel + xmlRegexpPtr contModel : Obsolete for WXS, maybe used for RelaxN xmlSchemaContentType contentType - const xmlChar * refPrefix - xmlSchemaValPtr defVal - void * idcs + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaValPtr defVal : The compiled value contraint. + void * idcs : The identity-constraint defs }

              Structure xmlSchemaFacet

              Structure xmlSchemaFacet
              struct _xmlSchemaFacet { xmlSchemaTypeType type : The kind of type struct _xmlSchemaFacet * next : the next type if in a sequence ... - const xmlChar * value - const xmlChar * id + const xmlChar * value : The original value + const xmlChar * id : Obsolete xmlSchemaAnnotPtr annot xmlNodePtr node - int fixed + int fixed : XML_SCHEMAS_FACET_PRESERVE, etc. int whitespace - xmlSchemaValPtr val - xmlRegexpPtr regexp + xmlSchemaValPtr val : The compiled value + xmlRegexpPtr regexp : The regex for patterns }

              Structure xmlSchemaFacetLink

              Structure xmlSchemaFacetLink
              struct _xmlSchemaFacetLink { struct _xmlSchemaFacetLink * next : the next facet link ... xmlSchemaFacetPtr facet : the linked facet @@ -224,35 +228,36 @@ The content of this structure is not made public by the API. xmlSchemaTypeType type : The kind of type struct _xmlSchemaType * next : the next type if in a sequence ... const xmlChar * name - const xmlChar * id - const xmlChar * ref - const xmlChar * refNs + const xmlChar * id : Deprecated; not used + const xmlChar * ref : Deprecated; not used + const xmlChar * refNs : Deprecated; not used xmlSchemaAnnotPtr annot xmlSchemaTypePtr subtypes - xmlSchemaAttributePtr attributes + xmlSchemaAttributePtr attributes : Deprecated; not used xmlNodePtr node - int minOccurs - int maxOccurs + int minOccurs : Deprecated; not used + int maxOccurs : Deprecated; not used int flags xmlSchemaContentType contentType - const xmlChar * base - const xmlChar * baseNs - xmlSchemaTypePtr baseType - xmlSchemaFacetPtr facets - struct _xmlSchemaType * redef : possible redefinitions for the type - int recurse - xmlSchemaAttributeLinkPtr attributeUses + const xmlChar * base : Base type's local name + const xmlChar * baseNs : Base type's target namespace + xmlSchemaTypePtr baseType : The base type component + xmlSchemaFacetPtr facets : Local facets + struct _xmlSchemaType * redef : Deprecated; not used + int recurse : Obsolete + xmlSchemaAttributeLinkPtr * attributeUses : Deprecated; not used xmlSchemaWildcardPtr attributeWildcard - int builtInType - xmlSchemaTypeLinkPtr memberTypes - xmlSchemaFacetLinkPtr facetSet - const xmlChar * refPrefix - xmlSchemaTypePtr contentTypeDef - xmlRegexpPtr contModel + int builtInType : Type of built-in types. + xmlSchemaTypeLinkPtr memberTypes : member-types if a union type. + xmlSchemaFacetLinkPtr facetSet : All facets (incl. inherited) + const xmlChar * refPrefix : Deprecated; not used + xmlSchemaTypePtr contentTypeDef : Used for the simple content of complex + xmlRegexpPtr contModel : Holds the automaton of the content mode const xmlChar * targetNamespace + void * attrUses }

              Structure xmlSchemaTypeLink

              Structure xmlSchemaTypeLink
              struct _xmlSchemaTypeLink { struct _xmlSchemaTypeLink * next : the next type link ... - xmlSchemaTypePtr type : the linked typ + xmlSchemaTypePtr type : the linked type }

              Enum xmlSchemaTypeType

              Enum xmlSchemaTypeType {
                   XML_SCHEMA_TYPE_BASIC = 1 : A built-in datatype
                   XML_SCHEMA_TYPE_ANY = 2
              @@ -279,6 +284,7 @@ The content of this structure is not made public by the API.
                   XML_SCHEMA_TYPE_IDC_KEY = 23
                   XML_SCHEMA_TYPE_IDC_KEYREF = 24
                   XML_SCHEMA_TYPE_PARTICLE = 25
              +    XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26
                   XML_SCHEMA_FACET_MININCLUSIVE = 1000
                   XML_SCHEMA_FACET_MINEXCLUSIVE = 1001
                   XML_SCHEMA_FACET_MAXINCLUSIVE = 1002
              @@ -292,6 +298,7 @@ The content of this structure is not made public by the API.
                   XML_SCHEMA_FACET_MAXLENGTH = 1010
                   XML_SCHEMA_FACET_MINLENGTH = 1011
                   XML_SCHEMA_EXTRA_QNAMEREF = 2000
              +    XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
               }
               

              Structure xmlSchemaVal

              Structure xmlSchemaVal
              struct _xmlSchemaVal { The content of this structure is not made public by the API. @@ -346,11 +353,11 @@ The content of this structure is not made public by the API. }

              Structure xmlSchemaWildcard

              Structure xmlSchemaWildcard
              struct _xmlSchemaWildcard { xmlSchemaTypeType type : The kind of type - const xmlChar * id + const xmlChar * id : Deprecated; not used xmlSchemaAnnotPtr annot xmlNodePtr node - int minOccurs - int maxOccurs + int minOccurs : Deprecated; not used + int maxOccurs : Deprecated; not used int processContents int any : Indicates if the ns constraint is of ## xmlSchemaWildcardNsPtr nsSet : The list of allowed namespaces diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html index 5a33b38..af8fefc 100644 --- a/doc/html/libxml-tree.html +++ b/doc/html/libxml-tree.html @@ -782,7 +782,7 @@ A:link, A:visited, A:active { text-decoration: underline }
              doc:the document
              content:the text content
              len:the text len.
              Returns:a pointer to the new node object.

              Function: xmlNewDtd

              xmlDtdPtr	xmlNewDtd		(xmlDocPtr doc, 
              const xmlChar * name,
              const xmlChar * ExternalID,
              const xmlChar * SystemID)

              Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset().

              doc:the document pointer
              name:the DTD name
              ExternalID:the external ID
              SystemID:the system ID
              Returns:a pointer to the new DTD structure

              Function: xmlNewGlobalNs

              xmlNsPtr	xmlNewGlobalNs		(xmlDocPtr doc, 
              const xmlChar * href,
              const xmlChar * prefix)
              -

              Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! It now create a namespace on the root element of the document if found.

              +

              Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!

              doc:the document carrying the namespace
              href:the URI associated
              prefix:the prefix for the namespace
              Returns:NULL this functionality had been removed

              Function: xmlNewNode

              xmlNodePtr	xmlNewNode		(xmlNsPtr ns, 
              const xmlChar * name)

              Creation of a new node element. @ns is optional (NULL).

              ns:namespace if any
              name:the node name
              Returns:a pointer to the new node object. Uses xmlStrdup() to make copy of @name.

              Function: xmlNewNodeEatName

              xmlNodePtr	xmlNewNodeEatName	(xmlNsPtr ns, 
              xmlChar * name)
              diff --git a/doc/html/libxml-valid.html b/doc/html/libxml-valid.html index 8ec2c68..631c49c 100644 --- a/doc/html/libxml-valid.html +++ b/doc/html/libxml-valid.html @@ -76,7 +76,7 @@ The content of this structure is not made public by the API.
              void	xmlSprintfElementContent	(char * buf, 
              xmlElementContentPtr content,
              int englob)
              int	xmlValidBuildContentModel	(xmlValidCtxtPtr ctxt, 
              xmlElementPtr elem)
              xmlChar *	xmlValidCtxtNormalizeAttributeValue	(xmlValidCtxtPtr ctxt, 
              xmlDocPtr doc,
              xmlNodePtr elem,
              const xmlChar * name,
              const xmlChar * value)
              -
              int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
              const xmlChar ** list,
              int * len,
              int max)
              +
              int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
              const xmlChar ** names,
              int * len,
              int max)
              int	xmlValidGetValidElements	(xmlNode * prev, 
              xmlNode * next,
              const xmlChar ** names,
              int max)
              xmlChar *	xmlValidNormalizeAttributeValue	(xmlDocPtr doc, 
              xmlNodePtr elem,
              const xmlChar * name,
              const xmlChar * value)
              int	xmlValidateAttributeDecl	(xmlValidCtxtPtr ctxt, 
              xmlDocPtr doc,
              xmlAttributePtr attr)
              @@ -232,9 +232,9 @@ The content of this structure is not made public by the API.

              (Re)Build the automata associated to the content model of this element

              ctxt:a validation context
              elem:an element declaration node
              Returns:1 in case of success, 0 in case of error

              Function: xmlValidCtxtNormalizeAttributeValue

              xmlChar *	xmlValidCtxtNormalizeAttributeValue	(xmlValidCtxtPtr ctxt, 
              xmlDocPtr doc,
              xmlNodePtr elem,
              const xmlChar * name,
              const xmlChar * value)

              Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly

              -
              ctxt:the validation context or NULL
              doc:the document
              elem:the parent
              name:the attribute name
              value:the attribute value
              Returns:a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.

              Function: xmlValidGetPotentialChildren

              int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
              const xmlChar ** list,
              int * len,
              int max)
              +
              ctxt:the validation context or NULL
              doc:the document
              elem:the parent
              name:the attribute name
              value:the attribute value
              Returns:a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.

              Function: xmlValidGetPotentialChildren

              int	xmlValidGetPotentialChildren	(xmlElementContent * ctree, 
              const xmlChar ** names,
              int * len,
              int max)

              Build/extend a list of potential children allowed by the content tree

              -
              ctree:an element content tree
              list:an array to store the list of child names
              len:a pointer to the number of element in the list
              max:the size of the array
              Returns:the number of element in the list, or -1 in case of error.

              Function: xmlValidGetValidElements

              int	xmlValidGetValidElements	(xmlNode * prev, 
              xmlNode * next,
              const xmlChar ** names,
              int max)
              +
              ctree:an element content tree
              names:an array to store the list of child names
              len:a pointer to the number of element in the list
              max:the size of the array
              Returns:the number of element in the list, or -1 in case of error.

              Function: xmlValidGetValidElements

              int	xmlValidGetValidElements	(xmlNode * prev, 
              xmlNode * next,
              const xmlChar ** names,
              int max)

              This function returns the list of authorized children to insert within an existing tree while respecting the validity constraints forced by the Dtd. The insertion point is defined using @prev and @next in the following ways: to insert before 'node': xmlValidGetValidElements(node->prev, node, ... to insert next 'node': xmlValidGetValidElements(node, node->next, ... to replace 'node': xmlValidGetValidElements(node->prev, node->next, ... to prepend a child to 'node': xmlValidGetValidElements(NULL, node->childs, to append a child to 'node': xmlValidGetValidElements(node->last, NULL, ... pointers to the element names are inserted at the beginning of the array and do not need to be freed.

              prev:an element to insert after
              next:an element to insert next
              names:an array to store the list of child names
              max:the size of the array
              Returns:the number of element in the list, or -1 in case of error. If the function returns the value @max the caller is invited to grow the receiving array and retry.

              Function: xmlValidNormalizeAttributeValue

              xmlChar *	xmlValidNormalizeAttributeValue	(xmlDocPtr doc, 
              xmlNodePtr elem,
              const xmlChar * name,
              const xmlChar * value)

              Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character.

              diff --git a/doc/html/libxml-xmlIO.html b/doc/html/libxml-xmlIO.html index 76b6dcd..2edd017 100644 --- a/doc/html/libxml-xmlIO.html +++ b/doc/html/libxml-xmlIO.html @@ -45,6 +45,7 @@ int xmlInputReadCallback (void * context, <
              xmlParserInputPtr	xmlNoNetExternalEntityLoader	(const char * URL, 
              const char * ID,
              xmlParserCtxtPtr ctxt)
              xmlChar *	xmlNormalizeWindowsPath	(const xmlChar * path)
              int	xmlOutputBufferClose		(xmlOutputBufferPtr out)
              +
              xmlOutputBufferPtr	xmlOutputBufferCreateBuffer	(xmlBufferPtr buffer, 
              xmlCharEncodingHandlerPtr encoder)
              xmlOutputBufferPtr	xmlOutputBufferCreateFd	(int fd, 
              xmlCharEncodingHandlerPtr encoder)
              xmlOutputBufferPtr	xmlOutputBufferCreateFile	(FILE * file, 
              xmlCharEncodingHandlerPtr encoder)
              xmlOutputBufferPtr	xmlOutputBufferCreateFilename	(const char * URI, 
              xmlCharEncodingHandlerPtr encoder,
              int compression)
              @@ -140,7 +141,9 @@ int xmlInputReadCallback (void * context,
              char * buffer,

              This function is obsolete. Please see xmlURIFromPath in uri.c for a better solution.

              path:the input file path
              Returns:a canonicalized version of the path

              Function: xmlOutputBufferClose

              int	xmlOutputBufferClose		(xmlOutputBufferPtr out)

              flushes and close the output I/O channel and free up all the associated resources

              -
              out:a buffered output
              Returns:the number of byte written or -1 in case of error.

              Function: xmlOutputBufferCreateFd

              xmlOutputBufferPtr	xmlOutputBufferCreateFd	(int fd, 
              xmlCharEncodingHandlerPtr encoder)
              +
              out:a buffered output
              Returns:the number of byte written or -1 in case of error.

              Function: xmlOutputBufferCreateBuffer

              xmlOutputBufferPtr	xmlOutputBufferCreateBuffer	(xmlBufferPtr buffer, 
              xmlCharEncodingHandlerPtr encoder)
              +

              Create a buffered output for the progressive saving to a xmlBuffer

              +
              buffer:a xmlBufferPtr
              encoder:the encoding converter or NULL
              Returns:the new parser output or NULL

              Function: xmlOutputBufferCreateFd

              xmlOutputBufferPtr	xmlOutputBufferCreateFd	(int fd, 
              xmlCharEncodingHandlerPtr encoder)

              Create a buffered output for the progressive saving to a file descriptor

              fd:a file descriptor number
              encoder:the encoding converter or NULL
              Returns:the new parser output or NULL

              Function: xmlOutputBufferCreateFile

              xmlOutputBufferPtr	xmlOutputBufferCreateFile	(FILE * file, 
              xmlCharEncodingHandlerPtr encoder)

              Create a buffered output for the progressive saving to a FILE * buffered C I/O

              diff --git a/doc/html/libxml-xmlerror.html b/doc/html/libxml-xmlerror.html index 8f96ae4..f8f0a90 100644 --- a/doc/html/libxml-xmlerror.html +++ b/doc/html/libxml-xmlerror.html @@ -761,6 +761,11 @@ void xmlStructuredErrorFunc (void * userD XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084 : 3084 XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085 : 3085 XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086 : 3085 + XML_SCHEMAP_AG_PROPS_CORRECT = 3087 : 3086 + XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088 : 3087 + XML_SCHEMAP_AU_PROPS_CORRECT = 3089 : 3088 + XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090 : 3089 + XML_SCHEMAP_COS_ALL_LIMITED = 3091 : 3090 XML_MODULE_OPEN = 4900 : 4900 XML_MODULE_CLOSE = 4901 : 4901 XML_CHECK_FOUND_ELEMENT = 5000 diff --git a/doc/html/libxml-xmlreader.html b/doc/html/libxml-xmlreader.html index 6036ccb..0ffa0a4 100644 --- a/doc/html/libxml-xmlreader.html +++ b/doc/html/libxml-xmlreader.html @@ -97,6 +97,7 @@ void xmlTextReaderErrorFunc (void * arg,
              int	xmlTextReaderRelaxNGSetSchema	(xmlTextReaderPtr reader, 
              xmlRelaxNGPtr schema)
              int	xmlTextReaderRelaxNGValidate	(xmlTextReaderPtr reader, 
              const char * rng)
              int	xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader, 
              const char * xsd)
              +
              int	xmlTextReaderSchemaValidateCtxt	(xmlTextReaderPtr reader, 
              xmlSchemaValidCtxtPtr ctxt,
              int options)
              void	xmlTextReaderSetErrorHandler	(xmlTextReaderPtr reader, 
              xmlTextReaderErrorFunc f,
              void * arg)
              int	xmlTextReaderSetParserProp	(xmlTextReaderPtr reader, 
              int prop,
              int value)
              int	xmlTextReaderSetSchema		(xmlTextReaderPtr reader, 
              xmlSchemaPtr schema)
              @@ -303,8 +304,10 @@ void xmlTextReaderErrorFunc (void * arg,
              const char * msg,
              reader:the xmlTextReaderPtr used
              schema:a precompiled RelaxNG schema
              Returns:0 in case the RelaxNG validation could be (des)activated and -1 in case of error.

              Function: xmlTextReaderRelaxNGValidate

              int	xmlTextReaderRelaxNGValidate	(xmlTextReaderPtr reader, 
              const char * rng)

              Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @rng is NULL, then RelaxNG validation is desactivated.

              reader:the xmlTextReaderPtr used
              rng:the path to a RelaxNG schema or NULL
              Returns:0 in case the RelaxNG validation could be (des)activated and -1 in case of error.

              Function: xmlTextReaderSchemaValidate

              int	xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader, 
              const char * xsd)
              -

              Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). if @xsd is NULL, then RelaxNG validation is desactivated.

              -
              reader:the xmlTextReaderPtr used
              xsd:the path to a W3C XSD schema or NULL
              Returns:0 in case the schemas validation could be (des)activated and -1 in case of error.

              Function: xmlTextReaderSetErrorHandler

              void	xmlTextReaderSetErrorHandler	(xmlTextReaderPtr reader, 
              xmlTextReaderErrorFunc f,
              void * arg)
              +

              Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is NULL, then XML Schema validation is deactivated.

              +
              reader:the xmlTextReaderPtr used
              xsd:the path to a W3C XSD schema or NULL
              Returns:0 in case the schemas validation could be (de)activated and -1 in case of error.

              Function: xmlTextReaderSchemaValidateCtxt

              int	xmlTextReaderSchemaValidateCtxt	(xmlTextReaderPtr reader, 
              xmlSchemaValidCtxtPtr ctxt,
              int options)
              +

              Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is NULL, then XML Schema validation is deactivated.

              +
              reader:the xmlTextReaderPtr used
              ctxt:the XML Schema validation context or NULL
              options:options (not used yet)
              Returns:0 in case the schemas validation could be (de)activated and -1 in case of error.

              Function: xmlTextReaderSetErrorHandler

              void	xmlTextReaderSetErrorHandler	(xmlTextReaderPtr reader, 
              xmlTextReaderErrorFunc f,
              void * arg)

              Register a callback function that will be called on error and warnings. If @f is NULL, the default error and warning handlers are restored.

              reader:the xmlTextReaderPtr used
              f:the callback function to call on error and warnings
              arg:a user argument to pass to the callback function

              Function: xmlTextReaderSetParserProp

              int	xmlTextReaderSetParserProp	(xmlTextReaderPtr reader, 
              int prop,
              int value)

              Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only be changed before any read has been done.

              diff --git a/doc/html/libxml-xmlregexp.html b/doc/html/libxml-xmlregexp.html index b507f34..b36155d 100644 --- a/doc/html/libxml-xmlregexp.html +++ b/doc/html/libxml-xmlregexp.html @@ -29,8 +29,8 @@ The content of this structure is not made public by the API.
              xmlExpNodePtr	xmlExpExpDerive		(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              xmlExpNodePtr sub)
              void	xmlExpFree			(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp)
              void	xmlExpFreeCtxt			(xmlExpCtxtPtr ctxt)
              -
              int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** list,
              int len)
              -
              int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** list,
              int len)
              +
              int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** langList,
              int len)
              +
              int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** tokList,
              int len)
              int	xmlExpIsNillable		(xmlExpNodePtr exp)
              int	xmlExpMaxToken			(xmlExpNodePtr expr)
              xmlExpNodePtr	xmlExpNewAtom		(xmlExpCtxtPtr ctxt, 
              const xmlChar * name,
              int len)
              @@ -89,11 +89,11 @@ The content of this structure is not made public by the API.

              Dereference the expression

              ctxt:the expression context
              exp:the expression

              Function: xmlExpFreeCtxt

              void	xmlExpFreeCtxt			(xmlExpCtxtPtr ctxt)

              Free an expression context

              -
              ctxt:an expression context

              Function: xmlExpGetLanguage

              int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** list,
              int len)
              +
              ctxt:an expression context

              Function: xmlExpGetLanguage

              int	xmlExpGetLanguage		(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** langList,
              int len)

              Find all the strings used in @exp and store them in @list

              -
              ctxt:the expression context
              exp:the expression
              list:where to store the tokens
              len:the allocated lenght of @list
              Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

              Function: xmlExpGetStart

              int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** list,
              int len)
              +
              ctxt:the expression context
              exp:the expression
              langList:where to store the tokens
              len:the allocated lenght of @list
              Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

              Function: xmlExpGetStart

              int	xmlExpGetStart			(xmlExpCtxtPtr ctxt, 
              xmlExpNodePtr exp,
              const xmlChar ** tokList,
              int len)

              Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]

              -
              ctxt:the expression context
              exp:the expression
              list:where to store the tokens
              len:the allocated lenght of @list
              Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

              Function: xmlExpIsNillable

              int	xmlExpIsNillable		(xmlExpNodePtr exp)
              +
              ctxt:the expression context
              exp:the expression
              tokList:where to store the tokens
              len:the allocated lenght of @list
              Returns:the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings

              Function: xmlExpIsNillable

              int	xmlExpIsNillable		(xmlExpNodePtr exp)

              Finds if the expression is nillable, i.e. if it accepts the empty sequqnce

              exp:the expression
              Returns:1 if nillable, 0 if not and -1 in case of error

              Function: xmlExpMaxToken

              int	xmlExpMaxToken			(xmlExpNodePtr expr)

              Indicate the maximum number of input a expression can accept

              diff --git a/doc/html/libxml-xmlsave.html b/doc/html/libxml-xmlsave.html index 6863beb..f0e10b0 100644 --- a/doc/html/libxml-xmlsave.html +++ b/doc/html/libxml-xmlsave.html @@ -19,6 +19,7 @@ The content of this structure is not made public by the API.
              int	xmlSaveFlush			(xmlSaveCtxtPtr ctxt)
              int	xmlSaveSetAttrEscape		(xmlSaveCtxtPtr ctxt, 
              xmlCharEncodingOutputFunc escape)
              int	xmlSaveSetEscape		(xmlSaveCtxtPtr ctxt, 
              xmlCharEncodingOutputFunc escape)
              +
              xmlSaveCtxtPtr	xmlSaveToBuffer		(xmlBufferPtr buffer, 
              const char * encoding,
              int options)
              xmlSaveCtxtPtr	xmlSaveToFd		(int fd, 
              const char * encoding,
              int options)
              xmlSaveCtxtPtr	xmlSaveToFilename	(const char * filename, 
              const char * encoding,
              int options)
              xmlSaveCtxtPtr	xmlSaveToIO		(xmlOutputWriteCallback iowrite, 
              xmlOutputCloseCallback ioclose,
              void * ioctx,
              const char * encoding,
              int options)
              @@ -42,7 +43,9 @@ The content of this structure is not made public by the API.

              Set a custom escaping function to be used for text in attribute content

              ctxt:a document saving context
              escape:the escaping function
              Returns:0 if successful or -1 in case of error.

              Function: xmlSaveSetEscape

              int	xmlSaveSetEscape		(xmlSaveCtxtPtr ctxt, 
              xmlCharEncodingOutputFunc escape)

              Set a custom escaping function to be used for text in element content

              -
              ctxt:a document saving context
              escape:the escaping function
              Returns:0 if successful or -1 in case of error.

              Function: xmlSaveToFd

              xmlSaveCtxtPtr	xmlSaveToFd		(int fd, 
              const char * encoding,
              int options)
              +
              ctxt:a document saving context
              escape:the escaping function
              Returns:0 if successful or -1 in case of error.

              Function: xmlSaveToBuffer

              xmlSaveCtxtPtr	xmlSaveToBuffer		(xmlBufferPtr buffer, 
              const char * encoding,
              int options)
              +

              Create a document saving context serializing to a buffer with the encoding and the options given

              +
              buffer:a buffer
              encoding:the encoding name to use or NULL
              options:a set of xmlSaveOptions
              Returns:a new serialization context or NULL in case of error.

              Function: xmlSaveToFd

              xmlSaveCtxtPtr	xmlSaveToFd		(int fd, 
              const char * encoding,
              int options)

              Create a document saving context serializing to a file descriptor with the encoding and the options given.

              fd:a file descriptor number
              encoding:the encoding name to use or NULL
              options:a set of xmlSaveOptions
              Returns:a new serialization context or NULL in case of error.

              Function: xmlSaveToFilename

              xmlSaveCtxtPtr	xmlSaveToFilename	(const char * filename, 
              const char * encoding,
              int options)

              Create a document saving context serializing to a filename or possibly to an URL (but this is less reliable) with the encoding and the options given.

              diff --git a/doc/html/libxml-xmlschemas.html b/doc/html/libxml-xmlschemas.html index 19afcec..d919fcc 100644 --- a/doc/html/libxml-xmlschemas.html +++ b/doc/html/libxml-xmlschemas.html @@ -38,11 +38,12 @@ The content of this structure is not made public by the API.
              xmlSchemaSAXPlugPtr	xmlSchemaSAXPlug	(xmlSchemaValidCtxtPtr ctxt, 
              xmlSAXHandlerPtr * sax,
              void ** user_data)
              int	xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug)
              void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)
              +
              void	xmlSchemaSetParserStructuredErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlStructuredErrorFunc serror,
              void * ctx)
              void	xmlSchemaSetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)
              int	xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt, 
              int options)
              void	xmlSchemaSetValidStructuredErrors	(xmlSchemaValidCtxtPtr ctxt, 
              xmlStructuredErrorFunc serror,
              void * ctx)
              int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)
              -
              int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
              xmlDocPtr doc)
              +
              int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
              xmlDocPtr instance)
              int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
              const char * filename,
              int options)
              int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
              xmlNodePtr elem)
              int	xmlSchemaValidateStream		(xmlSchemaValidCtxtPtr ctxt, 
              xmlParserInputBufferPtr input,
              xmlCharEncoding enc,
              xmlSAXHandlerPtr sax,
              void * user_data)
              @@ -57,7 +58,7 @@ void xmlSchemaValidityWarningFunc (v const xmlChar * name : schema name const xmlChar * targetNamespace : the target namespace const xmlChar * version - const xmlChar * id + const xmlChar * id : Obsolete xmlDocPtr doc xmlSchemaAnnotPtr annot int flags @@ -73,8 +74,8 @@ void xmlSchemaValidityWarningFunc (v void * includes : the includes, this is opaque for now int preserve : whether to free the document int counter : used to give ononymous components uniqu - xmlHashTablePtr idcDef - void * volatiles : Deprecated; not used anymore. + xmlHashTablePtr idcDef : All identity-constraint defs. + void * volatiles : Obsolete }

              Structure xmlSchemaParserCtxt

              Structure xmlSchemaParserCtxt
              struct _xmlSchemaParserCtxt { The content of this structure is not made public by the API. }

              Structure xmlSchemaSAXPlugStruct

              Structure xmlSchemaSAXPlugStruct
              struct _xmlSchemaSAXPlug { @@ -119,46 +120,48 @@ The content of this structure is not made public by the API.
              schema:a schema structure

              Function: xmlSchemaFreeParserCtxt

              void	xmlSchemaFreeParserCtxt		(xmlSchemaParserCtxtPtr ctxt)

              Free the resources associated to the schema parser context

              ctxt:the schema parser context

              Function: xmlSchemaFreeValidCtxt

              void	xmlSchemaFreeValidCtxt		(xmlSchemaValidCtxtPtr ctxt)
              -

              Free the resources associated to the schema validation context

              -
              ctxt:the schema validation context

              Function: xmlSchemaGetParserErrors

              int	xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc * err,
              xmlSchemaValidityWarningFunc * warn,
              void ** ctx)
              +

              +
              ctxt:

              Function: xmlSchemaGetParserErrors

              int	xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc * err,
              xmlSchemaValidityWarningFunc * warn,
              void ** ctx)

              Get the callback information used to handle errors for a parser context

              ctxt:a XMl-Schema parser 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: xmlSchemaGetValidErrors

              int	xmlSchemaGetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc * err,
              xmlSchemaValidityWarningFunc * warn,
              void ** ctx)
              -

              Get the error and warning callback informations

              -
              ctxt:a XML-Schema 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: xmlSchemaIsValid

              int	xmlSchemaIsValid		(xmlSchemaValidCtxtPtr ctxt)
              -

              Check if any error was detected during validation.

              -
              ctxt:the schema validation context
              Returns:1 if valid so far, 0 if errors were detected, and -1 in case of internal error.

              Function: xmlSchemaNewDocParserCtxt

              xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc)
              +

              +
              ctxt:
              err:
              warn:
              ctx:
              Returns:

              Function: xmlSchemaIsValid

              int	xmlSchemaIsValid		(xmlSchemaValidCtxtPtr ctxt)
              +

              +
              ctxt:
              Returns:

              Function: xmlSchemaNewDocParserCtxt

              xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc)

              Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.

              doc:a preparsed document tree
              Returns:the parser context or NULL in case of error

              Function: xmlSchemaNewMemParserCtxt

              xmlSchemaParserCtxtPtr	xmlSchemaNewMemParserCtxt	(const char * buffer, 
              int size)

              Create an XML Schemas parse context for that memory buffer expected to contain an XML Schemas file.

              buffer:a pointer to a char array containing the schemas
              size:the size of the array
              Returns:the parser context or NULL in case of error

              Function: xmlSchemaNewParserCtxt

              xmlSchemaParserCtxtPtr	xmlSchemaNewParserCtxt	(const char * URL)

              Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file.

              URL:the location of the schema
              Returns:the parser context or NULL in case of error

              Function: xmlSchemaNewValidCtxt

              xmlSchemaValidCtxtPtr	xmlSchemaNewValidCtxt	(xmlSchemaPtr schema)
              -

              Create an XML Schemas validation context based on the given schema.

              -
              schema:a precompiled XML Schemas
              Returns:the validation context or NULL in case of error

              Function: xmlSchemaParse

              xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt)
              -

              parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change

              +

              +
              schema:
              Returns:

              Function: xmlSchemaParse

              xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt)
              +

              parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

              ctxt:a schema validation context
              Returns:the internal XML Schema structure built from the resource or NULL in case of error

              Function: xmlSchemaSAXPlug

              xmlSchemaSAXPlugPtr	xmlSchemaSAXPlug	(xmlSchemaValidCtxtPtr ctxt, 
              xmlSAXHandlerPtr * sax,
              void ** user_data)
              -

              Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.

              -
              ctxt:a schema validation context
              sax:a pointer to the original xmlSAXHandlerPtr
              user_data:a pointer to the original SAX user data pointer
              Returns:a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.

              Function: xmlSchemaSAXUnplug

              int	xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug)
              -

              Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.

              -
              plug:a data structure returned by xmlSchemaSAXPlug
              Returns:0 in case of success and -1 in case of failure.

              Function: xmlSchemaSetParserErrors

              void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)
              +

              +
              ctxt:
              sax:
              user_data:
              Returns:

              Function: xmlSchemaSAXUnplug

              int	xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug)
              +

              +
              plug:
              Returns:

              Function: xmlSchemaSetParserErrors

              void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)

              Set the callback functions used to handle errors for a validation context

              -
              ctxt:a schema validation context
              err:the error callback
              warn:the warning callback
              ctx:contextual data for the callbacks

              Function: xmlSchemaSetValidErrors

              void	xmlSchemaSetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)
              -

              Set the error and warning callback informations

              -
              ctxt:a schema validation context
              err:the error function
              warn:the warning function
              ctx:the functions context

              Function: xmlSchemaSetValidOptions

              int	xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt, 
              int options)
              -

              Sets the options to be used during the validation.

              -
              ctxt:a schema validation context
              options:a combination of xmlSchemaValidOption
              Returns:0 in case of success, -1 in case of an API error.

              Function: xmlSchemaSetValidStructuredErrors

              void	xmlSchemaSetValidStructuredErrors	(xmlSchemaValidCtxtPtr ctxt, 
              xmlStructuredErrorFunc serror,
              void * ctx)
              +
              ctxt:a schema validation context
              err:the error callback
              warn:the warning callback
              ctx:contextual data for the callbacks

              Function: xmlSchemaSetParserStructuredErrors

              void	xmlSchemaSetParserStructuredErrors	(xmlSchemaParserCtxtPtr ctxt, 
              xmlStructuredErrorFunc serror,
              void * ctx)

              Set the structured error callback

              -
              ctxt:a schema validation context
              serror:the structured error function
              ctx:the functions context

              Function: xmlSchemaValidCtxtGetOptions

              int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)
              -

              Get the validation context options.

              -
              ctxt:a schema validation context
              Returns:the option combination or -1 on error.

              Function: xmlSchemaValidateDoc

              int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
              xmlDocPtr doc)
              -

              Validate a document tree in memory.

              -
              ctxt:a schema validation context
              doc:a parsed document tree
              Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.

              Function: xmlSchemaValidateFile

              int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
              const char * filename,
              int options)
              -

              Do a schemas validation of the given resource, it will use the SAX streamable validation internally.

              -
              ctxt:a schema validation context
              filename:the URI of the instance
              options:a future set of options, currently unused
              Returns:0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.

              Function: xmlSchemaValidateOneElement

              int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
              xmlNodePtr elem)
              -

              Validate a branch of a tree, starting with the given @elem.

              -
              ctxt:a schema validation context
              elem:an element node
              Returns:0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.

              Function: xmlSchemaValidateStream

              int	xmlSchemaValidateStream		(xmlSchemaValidCtxtPtr ctxt, 
              xmlParserInputBufferPtr input,
              xmlCharEncoding enc,
              xmlSAXHandlerPtr sax,
              void * user_data)
              -

              Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.

              -
              ctxt:a schema validation context
              input:the input to use for reading the data
              enc:an optional encoding information
              sax:a SAX handler for the resulting events
              user_data:the context to provide to the SAX handler.
              Returns:0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.

              Function type: xmlSchemaValidityErrorFunc

              Function type: xmlSchemaValidityErrorFunc
              +
              ctxt:a schema parser context
              serror:the structured error function
              ctx:the functions context

              Function: xmlSchemaSetValidErrors

              void	xmlSchemaSetValidErrors		(xmlSchemaValidCtxtPtr ctxt, 
              xmlSchemaValidityErrorFunc err,
              xmlSchemaValidityWarningFunc warn,
              void * ctx)
              +

              +
              ctxt:
              err:
              warn:
              ctx:

              Function: xmlSchemaSetValidOptions

              int	xmlSchemaSetValidOptions	(xmlSchemaValidCtxtPtr ctxt, 
              int options)
              +

              +
              ctxt:
              options:
              Returns:

              Function: xmlSchemaSetValidStructuredErrors

              void	xmlSchemaSetValidStructuredErrors	(xmlSchemaValidCtxtPtr ctxt, 
              xmlStructuredErrorFunc serror,
              void * ctx)
              +

              +
              ctxt:
              serror:
              ctx:

              Function: xmlSchemaValidCtxtGetOptions

              int	xmlSchemaValidCtxtGetOptions	(xmlSchemaValidCtxtPtr ctxt)
              +

              +
              ctxt:
              Returns:

              Function: xmlSchemaValidateDoc

              int	xmlSchemaValidateDoc		(xmlSchemaValidCtxtPtr ctxt, 
              xmlDocPtr instance)
              +

              +
              ctxt:
              instance:
              Returns:

              Function: xmlSchemaValidateFile

              int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
              const char * filename,
              int options)
              +

              +
              ctxt:
              filename:
              options:
              Returns:

              Function: xmlSchemaValidateOneElement

              int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
              xmlNodePtr elem)
              +

              +
              ctxt:
              elem:
              Returns:

              Function: xmlSchemaValidateStream

              int	xmlSchemaValidateStream		(xmlSchemaValidCtxtPtr ctxt, 
              xmlParserInputBufferPtr input,
              xmlCharEncoding enc,
              xmlSAXHandlerPtr sax,
              void * user_data)
              +

              +
              ctxt:
              input:
              enc:
              sax:
              user_data:
              Returns:

              Function type: xmlSchemaValidityErrorFunc

              Function type: xmlSchemaValidityErrorFunc
               void	xmlSchemaValidityErrorFunc	(void * ctx, 
              const char * msg,
              ... ...)

              ctx:
              msg:
              ...:

              Function type: xmlSchemaValidityWarningFunc

              Function type: xmlSchemaValidityWarningFunc
              diff --git a/doc/html/libxml-xmlstring.html b/doc/html/libxml-xmlstring.html
              index bbcc85f..537aaa5 100644
              --- a/doc/html/libxml-xmlstring.html
              +++ b/doc/html/libxml-xmlstring.html
              @@ -54,7 +54,7 @@ A:link, A:visited, A:active { text-decoration: underline }
               
              utf:Pointer to putative UTF-8 encoded string.
              Returns:value: true if @utf is valid.

              Function: xmlGetUTF8Char

              int	xmlGetUTF8Char			(const unsigned char * utf, 
              int * len)

              Read the first UTF8 character from @utf

              utf:a sequence of UTF-8 encoded bytes
              len:a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence.
              Returns:the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error)

              Function: xmlStrEqual

              int	xmlStrEqual			(const xmlChar * str1, 
              const xmlChar * str2)
              -

              Check if both string are equal of have same content Should be a bit more readable and faster than xmlStrEqual()

              +

              Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp()

              str1:the first xmlChar *
              str2:the second xmlChar *
              Returns:1 if they are equal, 0 if they are different

              Function: xmlStrPrintf

              int	xmlStrPrintf			(xmlChar * buf, 
              int len,
              const xmlChar * msg,
              ... ...)

              Formats @msg and places result into @buf.

              buf:the result buffer.
              len:the result buffer length.
              msg:the message with printf formatting.
              ...:extra parameters for the message.
              Returns:the number of characters written to @buf or -1 if an error occurs.

              Function: xmlStrQEqual

              int	xmlStrQEqual			(const xmlChar * pref, 
              const xmlChar * name,
              const xmlChar * str)
              @@ -78,10 +78,10 @@ A:link, A:visited, A:active { text-decoration: underline }
              str:the xmlChar * array
              Returns:the number of xmlChar contained in the ARRAY.

              Function: xmlStrncasecmp

              int	xmlStrncasecmp			(const xmlChar * str1, 
              const xmlChar * str2,
              int len)

              a strncasecmp for xmlChar's

              str1:the first xmlChar *
              str2:the second xmlChar *
              len:the max comparison length
              Returns:the integer result of the comparison

              Function: xmlStrncat

              xmlChar *	xmlStrncat		(xmlChar * cur, 
              const xmlChar * add,
              int len)
              -

              a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add.

              +

              a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned.

              cur:the original xmlChar * array
              add:the xmlChar * array added
              len:the length of @add
              Returns:a new xmlChar *, the original @cur is reallocated if needed and should not be freed

              Function: xmlStrncatNew

              xmlChar *	xmlStrncatNew		(const xmlChar * str1, 
              const xmlChar * str2,
              int len)
              -

              same as xmlStrncat, but creates a new string. The original two strings are not freed.

              -
              str1:first xmlChar string
              str2:second xmlChar string
              len:the len of @str2
              Returns:a new xmlChar * or NULL

              Function: xmlStrncmp

              int	xmlStrncmp			(const xmlChar * str1, 
              const xmlChar * str2,
              int len)
              +

              same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically.

              +
              str1:first xmlChar string
              str2:second xmlChar string
              len:the len of @str2 or < 0
              Returns:a new xmlChar * or NULL

              Function: xmlStrncmp

              int	xmlStrncmp			(const xmlChar * str1, 
              const xmlChar * str2,
              int len)

              a strncmp for xmlChar's

              str1:the first xmlChar *
              str2:the second xmlChar *
              len:the max comparison length
              Returns:the integer result of the comparison

              Function: xmlStrndup

              xmlChar *	xmlStrndup		(const xmlChar * cur, 
              int len)

              a strndup for array of xmlChar's

              diff --git a/doc/index.html b/doc/index.html index e5cdd04..b4cfbcb 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,7 +1,8 @@ - + + Introduction
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              The XML C parser and toolkit of Gnome

              Introduction

              Main Menu
              Related links

              This document describes libxml, the XML C parser and toolkit developed for the +Introduction
              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
              Made with Libxml2 Logo

              The XML C parser and toolkit of Gnome

              Introduction

              Main Menu
              Related links

              This document describes libxml, the XML C parser and toolkit developed for the Gnome project. XML is a standard for building tag-based structured documents/data.

              Here are some key points about libxml:

              • Libxml2 exports Push (progressive) and Pull (blocking) type parser interfaces for both XML and HTML.
              • diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 2522c21..088d0ae 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -110,9 +110,10 @@ - + + @@ -122,7 +123,7 @@ - + @@ -1003,11 +1004,13 @@ + + @@ -1093,7 +1096,7 @@ internal interfaces for XML Schemas - internal interfaces for the XML Schemas handling and schema validity checking + internal interfaces for the XML Schemas handling and schema validity checking The Schemas development is a Work In Progress. Some of those interfaces are not garanteed to be API or ABI stable ! Daniel Veillard @@ -1118,11 +1121,12 @@ - + + @@ -1142,7 +1146,9 @@ + + @@ -1151,7 +1157,7 @@ - + @@ -1160,7 +1166,7 @@ - + @@ -1223,6 +1229,7 @@ + @@ -1230,6 +1237,7 @@ + @@ -1853,9 +1861,10 @@ + - + @@ -1927,7 +1936,7 @@ - + @@ -2064,6 +2073,7 @@ + @@ -2083,6 +2093,7 @@ + @@ -2220,7 +2231,7 @@ - + @@ -2230,6 +2241,7 @@ + @@ -2333,6 +2345,7 @@ + @@ -2521,6 +2534,7 @@ + @@ -2864,6 +2878,7 @@ + @@ -2943,6 +2958,7 @@ + @@ -3014,6 +3030,7 @@ + @@ -4063,9 +4080,15 @@ The attribute wildcard has been already builded. + + Whether this attr. group contains attr. group references. + Marks the attr group as marked; used for circular checks. + + The attr group was redefined. + The attribute wildcard has been already builded. @@ -4255,8 +4278,11 @@ the complexType owns an attribute wildcard, i.e. it can be freed by the complexType + + The type was redefined. + - the simpleType has a variety of "absent". + the simpleType has a variety of "absent". TODO: Actually not necessary :-/, since if none of the variety flags occur then it's automatically absent. the simpleType has a variety of "union". @@ -5155,13 +5181,18 @@ + + + + + @@ -5505,9 +5536,10 @@ - + + @@ -5526,6 +5558,7 @@ + @@ -6343,7 +6376,7 @@ actually an xmlCharEncoding'/> - + @@ -6359,8 +6392,8 @@ actually an xmlCharEncoding'/> - - + + @@ -6368,41 +6401,42 @@ actually an xmlCharEncoding'/> - - - - - - + + + + + + - - - + + + - - - + + + - - + + - + - - - + + + + @@ -6414,17 +6448,17 @@ actually an xmlCharEncoding'/> - + - - - + + + - - + + @@ -6432,26 +6466,27 @@ actually an xmlCharEncoding'/> - - - + + + - - - + + + - - + + - + - - + + @@ -6476,36 +6511,38 @@ actually an xmlCharEncoding'/> - - - + + + - + - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + + - + @@ -6520,11 +6557,11 @@ actually an xmlCharEncoding'/> - + - - + + @@ -7288,6 +7325,15 @@ actually an xmlCharEncoding'/> + + defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) + Dump an HTML document in memory and return the xmlChar * and it's size. It's up to the caller to free the memory. + + + + + + defined(LIBXML_HTML_ENABLED) Checks whether an HTML element may be a direct child of a parent element. Note - doesn't check for deprecated elements @@ -9412,7 +9458,7 @@ actually an xmlCharEncoding'/> - + @@ -9421,7 +9467,7 @@ actually an xmlCharEncoding'/> - + @@ -11139,7 +11185,7 @@ actually an xmlCharEncoding'/> defined(LIBXML_LEGACY_ENABLED) - Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! It now create a namespace on the root element of the document if found. + Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! @@ -11467,6 +11513,13 @@ actually an xmlCharEncoding'/> + + defined(LIBXML_OUTPUT_ENABLED) + Create a buffered output for the progressive saving to a xmlBuffer + + + + defined(LIBXML_OUTPUT_ENABLED) Create a buffered output for the progressive saving to a file descriptor @@ -12611,7 +12664,7 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change + parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. @@ -13133,6 +13186,14 @@ actually an xmlCharEncoding'/> + + defined(LIBXML_OUTPUT_ENABLED) + Create a document saving context serializing to a buffer with the encoding and the options given + + + + + defined(LIBXML_OUTPUT_ENABLED) Create a document saving context serializing to a file descriptor with the encoding and the options given. @@ -13252,9 +13313,9 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Free the resources associated to the schema validation context + - + defined(LIBXML_SCHEMAS_ENABLED) @@ -13325,12 +13386,12 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Get the error and warning callback informations - - - - - + + + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13346,9 +13407,9 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Check if any error was detected during validation. - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13397,29 +13458,29 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Create an XML Schemas validation context based on the given schema. - - + + + defined(LIBXML_SCHEMAS_ENABLED) - parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change + parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. defined(LIBXML_SCHEMAS_ENABLED) - Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained. - - - - + + + + + defined(LIBXML_SCHEMAS_ENABLED) - Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored. - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13430,29 +13491,37 @@ actually an xmlCharEncoding'/> - + defined(LIBXML_SCHEMAS_ENABLED) - Set the error and warning callback informations + Set the structured error callback - - - + + + + defined(LIBXML_SCHEMAS_ENABLED) + + + + + + + defined(LIBXML_SCHEMAS_ENABLED) - Sets the options to be used during the validation. - - - + + + + defined(LIBXML_SCHEMAS_ENABLED) - Set the structured error callback + - - - + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13474,16 +13543,16 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Get the validation context options. - - + + + defined(LIBXML_SCHEMAS_ENABLED) - Validate a document tree in memory. - - - + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13507,11 +13576,11 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Do a schemas validation of the given resource, it will use the SAX streamable validation internally. - - - - + + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13545,10 +13614,10 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Validate a branch of a tree, starting with the given @elem. - - - + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13560,13 +13629,13 @@ actually an xmlCharEncoding'/> defined(LIBXML_SCHEMAS_ENABLED) - Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one. - - - - - - + + + + + + + defined(LIBXML_SCHEMAS_ENABLED) @@ -13971,7 +14040,7 @@ actually an xmlCharEncoding'/> - Check if both string are equal of have same content Should be a bit more readable and faster than xmlStrEqual() + Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp() @@ -14047,7 +14116,7 @@ actually an xmlCharEncoding'/> defined(LIBXML_PATTERN_ENABLED) - Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. + Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an element-node. @@ -14055,12 +14124,27 @@ actually an xmlCharEncoding'/> defined(LIBXML_PATTERN_ENABLED) - Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. + Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node. + + defined(LIBXML_PATTERN_ENABLED) + Push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Different from xmlStreamPush() this function can be fed with nodes of type: element-, attribute-, text-, cdata-section-, comment- and processing-instruction-node. + + + + + + + + defined(LIBXML_PATTERN_ENABLED) + Query if the streaming pattern additionally needs to be fed with text-, cdata-section-, comment- and processing-instruction-nodes. If the result is 0 then only element-nodes and attribute-nodes need to be pushed. + + + The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. @@ -14115,18 +14199,18 @@ actually an xmlCharEncoding'/> - a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. + a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned. - same as xmlStrncat, but creates a new string. The original two strings are not freed. + same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically. - + a strncmp for xmlChar's @@ -14546,13 +14630,13 @@ actually an xmlCharEncoding'/> - defined(LIBXML_READER_ENABLED) + defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) Reads the contents of the current node, including child nodes and markup. - defined(LIBXML_READER_ENABLED) + defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) Reads the contents of the current node, including child nodes and markup. @@ -14585,11 +14669,19 @@ actually an xmlCharEncoding'/> defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). if @xsd is NULL, then RelaxNG validation is desactivated. - + Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is NULL, then XML Schema validation is deactivated. + + + defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) + Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is NULL, then XML Schema validation is deactivated. + + + + + defined(LIBXML_READER_ENABLED) Register a callback function that will be called on error and warnings. If @f is NULL, the default error and warning handlers are restored. @@ -16436,7 +16528,7 @@ actually an xmlCharEncoding'/> Build/extend a list of potential children allowed by the content tree - + diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa index e09ad85..0b6082a 100644 --- a/doc/libxml2.xsa +++ b/doc/libxml2.xsa @@ -8,45 +8,21 @@ libxml2 - 2.6.21 - Sep 4 2005 + 2.6.22 + Sep 12 2005 http://xmlsoft.org/ - - build fixes: Cygwin portability fixes (Gerrit P. Haase), calling - convention problems on Windows (Marcus Boerger), cleanups based on - Linus' sparse tool, update of win32/configure.js (Rob Richards), - remove warnings on Windows(Marcus Boerger), compilation without SAX1, - detection of the Python binary, use $GCC inestad of $CC = 'gcc' (Andrew - W. Nosenko), compilation/link with threads and old gcc, compile - problem by C370 on Z/OS, - - bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8 - bug (Jiri Netolicky), XPath NaN compare bug (William Brack), - htmlParseScript potential bug, Schemas regexp handling of spaces, - Base64 Schemas comparisons NIST passes, automata build error xsd:all, - xmlGetNodePath for namespaced attributes (Alexander Pohoyda), - xmlSchemas foreign namespaces handling, XML Schemas facet comparison - (Kupriyanov Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier - Buchcik), xml: namespace ahndling in Schemas (Kasimier), empty model - group in Schemas (Kasimier), wilcard in Schemas (Kasimier), URI - composition (William), xs:anyType in Schemas (Kasimier), Python resolver - emmitting error messages directly, Python xmlAttr.parent (Jakub Piotr - Clapa), trying to fix the file path/URI conversion, - xmlTextReaderGetAttribute fix (Rob Richards), xmlSchemaFreeAnnot memleak - (Kasimier), HTML UTF-8 serialization, streaming XPath, Schemas determinism - detection problem, XInclude bug, Schemas context type (Dean Hill), - validation fix (Derek Poon), xmlTextReaderGetAttribute[Ns] namespaces - (Rob Richards), Schemas type fix (Kuba Nowakowski), UTF-8 parser bug, - error in encoding handling, xmlGetLineNo fixes, bug on entities handling, - entity name extraction in error handling with XInclude, text nodes - in HTML body tags (Gary Coady), xml:id and IDness at the treee level - fixes, XPath streaming patterns bugs. - - improvements: structured interfaces for schemas and RNG error reports - (Marcus Boerger), optimization of the char data inner loop parsing - (thanks to Behdad Esfahbod for the idea), schematron validation - though not finished yet, xmlSaveOption to omit XML declaration, - keyref match error reports (Kasimier), formal expression handling - code not plugged yet, more lax mode for the HTML parser, - parser XML_PARSE_COMPACT option for text nodes allocation. - - documentation: xmllint man page had --nonet duplicated + - build fixes: compile without schematron (Stéphane Bidoul) + - bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i, + CDATA push parser bug, xmlElemDump problem with XHTML1 doc, + XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some + output formatting for meta element (Rob Richards), script and style + XHTML1 serialization (David Madore), Attribute derivation fixups in XSD + (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik) + - improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add + XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for + derive (Kasimier Buchcik). + - documentation: generation of gtk-doc like docs, integration with + devhelp. diff --git a/doc/namespaces.html b/doc/namespaces.html index d2c9be3..b4936c7 100644 --- a/doc/namespaces.html +++ b/doc/namespaces.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Namespaces
                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                Made with Libxml2 Logo

                The XML C parser and toolkit of Gnome

                Namespaces

                Main Menu
                Related links

                The libxml2 library implements XML namespaces support by +Namespaces
                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                Made with Libxml2 Logo

                The XML C parser and toolkit of Gnome

                Namespaces

                Main Menu
                Related links

                The libxml2 library implements XML namespaces support by recognizing namespace constructs in the input, and does namespace lookup automatically when building the DOM tree. A namespace declaration is associated with an in-memory structure and all elements or attributes within diff --git a/doc/news.html b/doc/news.html index 8916d49..29af068 100644 --- a/doc/news.html +++ b/doc/news.html @@ -7,164 +7,202 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Releases
                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                Made with Libxml2 Logo

                The XML C parser and toolkit of Gnome

                Releases

                Main Menu
                Related links

                Items not finished and worked on, get in touch with the list if you want +Releases
                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                Made with Libxml2 Logo

                The XML C parser and toolkit of Gnome

                Releases

                Main Menu
                Related links

                Items not finished and worked on, get in touch with the list if you want to help those

                The change log describes the recents commits -to the CVS code base.

                There is the list of public releases:

                2.6.22: Sep 12 2005

                • build fixes: compile without schematron (Stéphane Bidoul)
                • +to the CVS code base.

                  There is the list of public releases:

                  2.6.23: Jan 5 2006

                  • portability fixes: Windows (Rob Richards), getaddrinfo on Windows + (Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas), + --with-minimum compilation fixes (William Brack), error case handling fix + on Solaris (Albert Chin), don't use 'list' as parameter name reported by + Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin), + MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick Jones), +
                  • +
                  • code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose + (Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring + parsing code (Bjorn Reese)
                  • +
                  • bug fixes: xmlBuildRelativeURI and empty path (William Brack), + combinatory explosion and performances in regexp code, leak in + xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo + Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik), + XPath pattern based evaluation bugs (DV & Kasimier), + xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in + xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of + vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF + split problem (William), issues with non-namespaced attributes in + xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards), + HTML parsing of script, Python must not output to stdout (Nic Ferrier), + exclusive C14N namespace visibility (Aleksey Sanin), XSD dataype + totalDigits bug (Kasimier Buchcik), error handling when writing to an + xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi + Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix + XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier), + fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml + (Gary Coady), regexp bug affecting schemas (Kasimier), configuration of + runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs + (Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair), + compilation and build fixes (Michael Day), removed dependancies on + xmlSchemaValidError (Kasimier), bug with <xml:foo/>, more XPath + pattern based evaluation fixes (Kasimier)
                  • +
                  • improvements: XSD Schemas redefinitions/restrictions (Kasimier + Buchcik), node copy checks and fix for attribute (Rob Richards), counted + transition bug in regexps, ctxt->standalone = -2 to indicate no + standalone attribute was found, add xmlSchemaSetParserStructuredErrors() + (Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API + (Kasimier), handle gzipped HTTP resources (Gary Coady), add + htmlDocDumpMemoryFormat. (Rob Richards),
                  • +
                  • documentation: typo (Michael Day), libxml man page (Albert Chin), save + function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik), +
                  • +

                  2.6.22: Sep 12 2005

                  • build fixes: compile without schematron (Stéphane Bidoul)
                  • bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i, - CDATA push parser bug, xmlElemDump problem with XHTML1 doc, - XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, - fix some output formatting for meta element (Rob Richards), - script and style XHTML1 serialization (David Madore), Attribute - derivation fixups in XSD (Kasimier Buchcik), better IDC error - reports (Kasimier Buchcik) -
                  • -
                  • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), - add XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements - preparing for derive (Kasimier Buchcik).
                  • + CDATA push parser bug, xmlElemDump problem with XHTML1 doc, + XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some + output formatting for meta element (Rob Richards), script and style + XHTML1 serialization (David Madore), Attribute derivation fixups in XSD + (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik) +
                  • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add + XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for + derive (Kasimier Buchcik).
                  • documentation: generation of gtk-doc like docs, integration with - devhelp.
                  • + devhelp.

                  2.6.21: Sep 4 2005

                  • build fixes: Cygwin portability fixes (Gerrit P. Haase), calling - convention problems on Windows (Marcus Boerger), cleanups based on - Linus' sparse tool, update of win32/configure.js (Rob Richards), - remove warnings on Windows(Marcus Boerger), compilation without SAX1, - detection of the Python binary, use $GCC inestad of $CC = 'gcc' (Andrew - W. Nosenko), compilation/link with threads and old gcc, compile - problem by C370 on Z/OS,
                  • + convention problems on Windows (Marcus Boerger), cleanups based on Linus' + sparse tool, update of win32/configure.js (Rob Richards), remove warnings + on Windows(Marcus Boerger), compilation without SAX1, detection of the + Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko), + compilation/link with threads and old gcc, compile problem by C370 on + Z/OS,
                  • bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8 - bug (Jiri Netolicky), XPath NaN compare bug (William Brack), - htmlParseScript potential bug, Schemas regexp handling of spaces, - Base64 Schemas comparisons NIST passes, automata build error xsd:all, - xmlGetNodePath for namespaced attributes (Alexander Pohoyda), - xmlSchemas foreign namespaces handling, XML Schemas facet comparison - (Kupriyanov Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier - Buchcik), xml: namespace ahndling in Schemas (Kasimier), empty model - group in Schemas (Kasimier), wilcard in Schemas (Kasimier), URI - composition (William), xs:anyType in Schemas (Kasimier), Python resolver - emmitting error messages directly, Python xmlAttr.parent (Jakub Piotr - Clapa), trying to fix the file path/URI conversion, - xmlTextReaderGetAttribute fix (Rob Richards), xmlSchemaFreeAnnot memleak - (Kasimier), HTML UTF-8 serialization, streaming XPath, Schemas determinism - detection problem, XInclude bug, Schemas context type (Dean Hill), - validation fix (Derek Poon), xmlTextReaderGetAttribute[Ns] namespaces - (Rob Richards), Schemas type fix (Kuba Nowakowski), UTF-8 parser bug, - error in encoding handling, xmlGetLineNo fixes, bug on entities handling, - entity name extraction in error handling with XInclude, text nodes - in HTML body tags (Gary Coady), xml:id and IDness at the treee level - fixes, XPath streaming patterns bugs.
                  • + bug (Jiri Netolicky), XPath NaN compare bug (William Brack), + htmlParseScript potential bug, Schemas regexp handling of spaces, Base64 + Schemas comparisons NIST passes, automata build error xsd:all, + xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas + foreign namespaces handling, XML Schemas facet comparison (Kupriyanov + Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml: + namespace ahndling in Schemas (Kasimier), empty model group in Schemas + (Kasimier), wilcard in Schemas (Kasimier), URI composition (William), + xs:anyType in Schemas (Kasimier), Python resolver emmitting error + messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to + fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob + Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8 + serialization, streaming XPath, Schemas determinism detection problem, + XInclude bug, Schemas context type (Dean Hill), validation fix (Derek + Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas + type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling, + xmlGetLineNo fixes, bug on entities handling, entity name extraction in + error handling with XInclude, text nodes in HTML body tags (Gary Coady), + xml:id and IDness at the treee level fixes, XPath streaming patterns + bugs.
                  • improvements: structured interfaces for schemas and RNG error reports - (Marcus Boerger), optimization of the char data inner loop parsing - (thanks to Behdad Esfahbod for the idea), schematron validation - though not finished yet, xmlSaveOption to omit XML declaration, - keyref match error reports (Kasimier), formal expression handling - code not plugged yet, more lax mode for the HTML parser, - parser XML_PARSE_COMPACT option for text nodes allocation.
                  • + (Marcus Boerger), optimization of the char data inner loop parsing + (thanks to Behdad Esfahbod for the idea), schematron validation though + not finished yet, xmlSaveOption to omit XML declaration, keyref match + error reports (Kasimier), formal expression handling code not plugged + yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option + for text nodes allocation.
                  • documentation: xmllint man page had --nonet duplicated
                  • -

                  2.6.20: Jul 10 2005

                  • build fixes: Windows build (Rob Richards), Mingw compilation (Igor - Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and - andriy@google.com), use gcc weak references to pthread to avoid the - pthread dependancy on Linux, compilation problem (Steve Nairn), - compiling of subset (Morten Welinder), IPv6/ss_family compilation - (William Brack), compilation when disabling parts of the library, - standalone test distribution. -
                  • -
                  • bug fixes: bug in lang(), memory cleanup on errors (William Brack), - HTTP query strings (Aron Stansvik), memory leak in DTD (William), - integer overflow in XPath (William), nanoftp buffer size, pattern - "." apth fixup (Kasimier), leak in tree reported by Malcolm Rowe, - replaceNode patch (Brent Hendricks), CDATA with NULL content - (Mark Vakoc), xml:base fixup on XInclude (William), pattern - fixes (William), attribute bug in exclusive c14n (Aleksey Sanin), - xml:space and xml:lang with SAX2 (Rob Richards), namespace - trouble in complex parsing (Malcolm Rowe), XSD type QNames fixes - (Kasimier), XPath streaming fixups (William), RelaxNG bug (Rob Richards), - Schemas for Schemas fixes (Kasimier), removal of ID (Rob Richards), - a small RelaxNG leak, HTML parsing in push mode bug (James Bursa), - failure to detect UTF-8 parsing bugs in CDATA sections, areBlanks() - heuristic failure, duplicate attributes in DTD bug (William). -
                  • -
                  • improvements: lot of work on Schemas by Kasimier Buchcik both on - conformance and streaming, Schemas validation messages (Kasimier - Buchcik, Matthew Burgess), namespace removal at the python level - (Brent Hendricks), Update to new Schemas regression tests from - W3C/Nist (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation - of xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), - standalone test framework and programs, new DOM import APIs - xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and - xmlDOMWrapRemoveNode(), extension of xmllint capabilities for - SAX and Schemas regression tests, xmlStopParser() available in - pull mode too, ienhancement to xmllint --shell namespaces support, - Windows port of the standalone testing tools (Kasimier and William), - xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() - SAX Schemas APIs, Schemas xmlReader support. -
                  • -

                  2.6.19: Apr 02 2005

                  • build fixes: drop .la from RPMs, --with-minimum build fix (William - Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with - AIX 5.3 compiler, fixed elfgcchack.h generation and PLT reduction - code on Linux/ELF/gcc4
                  • -
                  • bug fixes: schemas type decimal fixups (William Brack), xmmlint return - code (Gerry Murphy), small schemas fixes (Matthew Burgess and - GUY Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey - Sanin), segfault in Schemas (Kasimier Buchcik), Schemas attribute - validation (Kasimier), Prop related functions and xmlNewNodeEatName - (Rob Richards), HTML serialization of name attribute on a elements, - Python error handlers leaks and improvement (Brent Hendricks), - uninitialized variable in encoding code, Relax-NG validation bug, - potential crash if gnorableWhitespace is NULL, xmlSAXParseDoc and - xmlParseDoc signatures, switched back to assuming UTF-8 in case - no encoding is given at serialization time
                  • -
                  • improvements: lot of work on Schemas by Kasimier Buchcik on facets - checking and also mixed handling.
                  • +

                  2.6.20: Jul 10 2005

                  • build fixes: Windows build (Rob Richards), Mingw compilation (Igor + Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and + andriy@google.com), use gcc weak references to pthread to avoid the + pthread dependancy on Linux, compilation problem (Steve Nairn), compiling + of subset (Morten Welinder), IPv6/ss_family compilation (William Brack), + compilation when disabling parts of the library, standalone test + distribution.
                  • +
                  • bug fixes: bug in lang(), memory cleanup on errors (William Brack), + HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer + overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup + (Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch + (Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup + on XInclude (William), pattern fixes (William), attribute bug in + exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob + Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type + QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug + (Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob + Richards), a small RelaxNG leak, HTML parsing in push mode bug (James + Bursa), failure to detect UTF-8 parsing bugs in CDATA sections, + areBlanks() heuristic failure, duplicate attributes in DTD bug + (William).
                  • +
                  • improvements: lot of work on Schemas by Kasimier Buchcik both on + conformance and streaming, Schemas validation messages (Kasimier Buchcik, + Matthew Burgess), namespace removal at the python level (Brent + Hendricks), Update to new Schemas regression tests from W3C/Nist + (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of + xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), + standalone test framework and programs, new DOM import APIs + xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and + xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and + Schemas regression tests, xmlStopParser() available in pull mode too, + ienhancement to xmllint --shell namespaces support, Windows port of the + standalone testing tools (Kasimier and William), + xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX + Schemas APIs, Schemas xmlReader support.
                  • +

                  2.6.19: Apr 02 2005

                  • build fixes: drop .la from RPMs, --with-minimum build fix (William + Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX + 5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on + Linux/ELF/gcc4
                  • +
                  • bug fixes: schemas type decimal fixups (William Brack), xmmlint return + code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY + Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin), + segfault in Schemas (Kasimier Buchcik), Schemas attribute validation + (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards), + HTML serialization of name attribute on a elements, Python error handlers + leaks and improvement (Brent Hendricks), uninitialized variable in + encoding code, Relax-NG validation bug, potential crash if + gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures, + switched back to assuming UTF-8 in case no encoding is given at + serialization time
                  • +
                  • improvements: lot of work on Schemas by Kasimier Buchcik on facets + checking and also mixed handling.
                  • -

                  2.6.18: Mar 13 2005

                  • build fixes: warnings (Peter Breitenlohner), testapi.c generation, - Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), - some gcc4 fixes, HP-UX portability fixes (Rick Jones).
                  • -
                  • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and - xmlreader stopping on non-fatal errors, thread support for dictionnaries - reference counting (Gary Coady), internal subset and push problem, - URL saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python - paths fixup (Stephane Bidoul), xmlGetNodePath and namespaces, - xmlSetNsProp fix (Mike Hommey), warning should not count as error - (William Brack), xmlCreatePushParser empty chunk, XInclude parser - flags (William), cleanup FTP and HTTP code to reuse the uri parsing - and IPv6 (William), xmlTextWriterStartAttributeNS fix (Rob Richards), - XMLLINT_INDENT being empty (William), xmlWriter bugs (Rob Richards), - multithreading on Windows (Rich Salz), xmlSearchNsByHref fix (Kasimier), - Python binding leak (Brent Hendricks), aliasing bug exposed by gcc4 - on s390, xmlTextReaderNext bug (Rob Richards), Schemas decimal type - fixes (William Brack), xmlByteConsumed static buffer (Ben Maurer).
                  • -
                  • improvement: speedup parsing comments and DTDs, dictionnary support for - hash tables, Schemas Identity constraints (Kasimier), streaming XPath - subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical - values handling (Kasimier), add xmlTextReaderByteConsumed (Aron - Stansvik),
                  • -
                  • Documentation: Wiki support (Joel Reed) -

                  2.6.17: Jan 16 2005

                  • build fixes: Windows, warnings removal (William Brack), - maintainer-clean dependency(William), build in a different directory - (William), fixing --with-minimum configure build (William), BeOS - build (Marcin Konicki), Python-2.4 detection (William), compilation - on AIX (Dan McNichol)
                  • +

                  2.6.18: Mar 13 2005

                  • build fixes: warnings (Peter Breitenlohner), testapi.c generation, + Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), + some gcc4 fixes, HP-UX portability fixes (Rick Jones).
                  • +
                  • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and + xmlreader stopping on non-fatal errors, thread support for dictionnaries + reference counting (Gary Coady), internal subset and push problem, URL + saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths + fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix + (Mike Hommey), warning should not count as error (William Brack), + xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup + FTP and HTTP code to reuse the uri parsing and IPv6 (William), + xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being + empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows + (Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent + Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug + (Rob Richards), Schemas decimal type fixes (William Brack), + xmlByteConsumed static buffer (Ben Maurer).
                  • +
                  • improvement: speedup parsing comments and DTDs, dictionnary support for + hash tables, Schemas Identity constraints (Kasimier), streaming XPath + subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical + values handling (Kasimier), add xmlTextReaderByteConsumed (Aron + Stansvik),
                  • +
                  • Documentation: Wiki support (Joel Reed)
                  • +

                  2.6.17: Jan 16 2005

                  • build fixes: Windows, warnings removal (William Brack), + maintainer-clean dependency(William), build in a different directory + (William), fixing --with-minimum configure build (William), BeOS build + (Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan + McNichol)
                  • bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile() - to use the catalog(s), loop on output (William Brack), XPath memory leak, - ID deallocation problem (Steve Shepard), debugDumpNode crash (William), - warning not using error callback (William), xmlStopParser bug (William), - UTF-16 with BOM on DTDs (William), namespace bug on empty elements - in push mode (Rob Richards), line and col computations fixups (Aleksey - Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), - patterns with too many steps, bug in RNG choice optimization, line - number sometimes missing. -
                  • -
                  • improvements: XSD Schemas (Kasimier Buchcik), python generator (William), - xmlUTF8Strpos speedup (William), unicode Python strings (William), - XSD error reports (Kasimier Buchcik), Python __str__ call serialize(). -
                  • -
                  • new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber - for the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs - (mostly Joel Reed), error extraction API from regexps, new XMLSave - option for format (Phil Shafer)
                  • -
                  • documentation: site improvement (John Fleck), FAQ entries (William).
                  • + to use the catalog(s), loop on output (William Brack), XPath memory leak, + ID deallocation problem (Steve Shepard), debugDumpNode crash (William), + warning not using error callback (William), xmlStopParser bug (William), + UTF-16 with BOM on DTDs (William), namespace bug on empty elements in + push mode (Rob Richards), line and col computations fixups (Aleksey + Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), + patterns with too many steps, bug in RNG choice optimization, line number + sometimes missing. +
                  • improvements: XSD Schemas (Kasimier Buchcik), python generator + (William), xmlUTF8Strpos speedup (William), unicode Python strings + (William), XSD error reports (Kasimier Buchcik), Python __str__ call + serialize().
                  • +
                  • new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for + the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel + Reed), error extraction API from regexps, new XMLSave option for format + (Phil Shafer)
                  • +
                  • documentation: site improvement (John Fleck), FAQ entries + (William).

                  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)
                  • @@ -174,7 +212,7 @@ to the CVS code base.

                  • documentation: fix to xmllint man page, some API function descritpion were updated.
                  • improvements: DTD validation APIs provided at the Python level (Brent - Hendricks)
                  • + 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)
                  • diff --git a/doc/python.html b/doc/python.html index e16ca53..1659122 100644 --- a/doc/python.html +++ b/doc/python.html @@ -33,8 +33,9 @@ or libxslt wrappers or bindings:

                    • idom2, a DOM2 implementation for Kylix2/D5/D6 from Borland.
                    • -
                    • There is bindings for Ruby and - libxml2 bindings are also available in Ruby through the libgdome-ruby module +
                    • There is bindings + for Ruby and libxml2 bindings are also available in Ruby through the + libgdome-ruby module maintained by Tobias Peters.
                    • Steve Ball and contributors maintains libxml2 and libxslt bindings for Tcl.
                    • @@ -49,17 +50,15 @@ or libxslt wrappers or bindings:

                      • wxXml2 +
                      • Francesco Montorsi developped wxXml2 wrappers that interface libxml2, allowing wxWidgets applications to load/save/edit XML instances.

                      The distribution includes a set of Python bindings, which are guaranteed to be maintained as part of the library in the future, though the Python interface have not yet reached the completeness of the C API.

                      Note that some of the Python purist dislike the default set of Python -bindings, rather than complaining I suggest they have a look at -lxml the more pythonic bindings for libxml2 and libxslt and -help Martijn Faassen -complete those.

                      Stéphane Bidoul +bindings, rather than complaining I suggest they have a look at lxml the more pythonic bindings for libxml2 +and libxslt and help Martijn +Faassen complete those.

                      Stéphane Bidoul maintains a Windows port of the Python bindings.

                      Note to people interested in building bindings, the API is formalized as an XML API description file which allows to diff --git a/doc/site.xsl b/doc/site.xsl index 29e8aaf..8368a73 100644 --- a/doc/site.xsl +++ b/doc/site.xsl @@ -318,7 +318,7 @@

                      • Home
                      • -
                      • Wiki
                      • +
                      • Reference Manual
                      • diff --git a/doc/xml.html b/doc/xml.html index 638d1c9..6ecd81c 100644 --- a/doc/xml.html +++ b/doc/xml.html @@ -3,7 +3,7 @@ The XML C parser and toolkit of Gnome - + @@ -124,7 +124,6 @@ benchmark on sourceforge February 2004 (smaller is better):

                        alt="benchmark results for Expat Xerces libxml2 Oracle and Sun toolkits">

                        --------------> -

                        Logo designed by Marc Liyanage.

                        Introduction

                        @@ -315,41 +314,49 @@ libxml2

                        CFLAGS=`xml2-config --cflags`

                        LIBS=`xml2-config --libs`

                        -
                      • I want to install my own copy of libxml2 in my home directory and link - my programs against it, but it doesn't work +
                      • I want to install my own copy of libxml2 in my home directory and + link my programs against it, but it doesn't work

                        There are many different ways to accomplish this. Here is one way to - do this under Linux. Suppose your home directory is /home/user. - Then:

                        -
                        • Create a subdirectory, let's call it myxml
                        • + do this under Linux. Suppose your home directory is /home/user. + Then:

                          +
                            +
                          • Create a subdirectory, let's call it myxml
                          • unpack the libxml2 distribution into that subdirectory
                          • -
                          • chdir into the unpacked distribution (/home/user/myxml/libxml2 - )
                          • +
                          • chdir into the unpacked distribution + (/home/user/myxml/libxml2 )
                          • configure the library using the "--prefix" switch, - specifying an installation subdirectory in /home/user/myxml, - e.g. -

                            ./configure --prefix /home/user/myxml/xmlinst {other - configuration options}

                          • + specifying an installation subdirectory in + /home/user/myxml, e.g. +

                            ./configure --prefix /home/user/myxml/xmlinst {other + configuration options}

                            +
                          • now run make followed by make install
                          • At this point, the installation subdirectory contains the complete - "private" include files, library files and binary program files (e.g. - xmllint), located in -

                            /home/user/myxml/xmlinst/lib, /home/user/myxml/xmlinst/include - and /home/user/myxml/xmlinst/bin

                            - respectively.
                          • -
                          • In order to use this "private" library, you should first add it - to the beginning of your default PATH (so that your own private - program files such as xmllint will be used instead of the normal - system ones). To do this, the Bash command would be -

                            export PATH=/home/user/myxml/xmlinst/bin:$PATH

                          • + "private" include files, library files and binary program files (e.g. + xmllint), located in +

                            /home/user/myxml/xmlinst/lib, + /home/user/myxml/xmlinst/include and + /home/user/myxml/xmlinst/bin

                            + respectively. +
                          • In order to use this "private" library, you should first add it to + the beginning of your default PATH (so that your own private program + files such as xmllint will be used instead of the normal system + ones). To do this, the Bash command would be +

                            export PATH=/home/user/myxml/xmlinst/bin:$PATH

                            +
                          • Now suppose you have a program test1.c that you would - like to compile with your "private" library. Simply compile it - using the command

                            gcc `xml2-config --cflags --libs` -o test - test.c

                            Note that, because your PATH has been set with - /home/user/myxml/xmlinst/bin at the beginning, the - xml2-config program which you just installed will be used instead of - the system default one, and this will automatically get the - correct libraries linked with your program.
                          -

                          + like to compile with your "private" library. Simply compile it using + the command +

                          gcc `xml2-config --cflags --libs` -o test test.c

                          + Note that, because your PATH has been set with + /home/user/myxml/xmlinst/bin at the beginning, the xml2-config + program which you just installed will be used instead of the system + default one, and this will automatically get the correct + libraries linked with your program. +
                        +
                      • + +

                      • xmlDocDump() generates output on one line.

                        Libxml2 will not invent spaces in the content of a document since all spaces in the content of a document are @@ -663,14 +670,17 @@ href="http://xmlsoft.org/sources/win32/">win32 directory.

                        maintainer of the Windows port, he provides binaries.
                      • -
                      • Blastwave provides - Solaris binaries.
                      • +
                      • Blastwave provides Solaris + binaries.
                      • Steve Ball provides Mac Os X binaries.
                      • The HP-UX porting center provides HP-UX binaries
                      • -
                      • Bull provides precompiled RPMs for AIX as patr of their GNOME packages
                      • +
                      • Bull provides precompiled RPMs for AIX as + patr of their GNOME packages

                      If you know other supported binary ports, please CVS code base.

                      There is the list of public releases:

                      +

                      2.6.23: Jan 5 2006

                      +
                        +
                      • portability fixes: Windows (Rob Richards), getaddrinfo on Windows + (Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas), + --with-minimum compilation fixes (William Brack), error case handling fix + on Solaris (Albert Chin), don't use 'list' as parameter name reported by + Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin), + MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick Jones), +
                      • +
                      • code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose + (Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring + parsing code (Bjorn Reese)
                      • +
                      • bug fixes: xmlBuildRelativeURI and empty path (William Brack), + combinatory explosion and performances in regexp code, leak in + xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo + Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik), + XPath pattern based evaluation bugs (DV & Kasimier), + xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in + xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of + vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF + split problem (William), issues with non-namespaced attributes in + xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards), + HTML parsing of script, Python must not output to stdout (Nic Ferrier), + exclusive C14N namespace visibility (Aleksey Sanin), XSD dataype + totalDigits bug (Kasimier Buchcik), error handling when writing to an + xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi + Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix + XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier), + fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml + (Gary Coady), regexp bug affecting schemas (Kasimier), configuration of + runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs + (Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair), + compilation and build fixes (Michael Day), removed dependancies on + xmlSchemaValidError (Kasimier), bug with <xml:foo/>, more XPath + pattern based evaluation fixes (Kasimier)
                      • +
                      • improvements: XSD Schemas redefinitions/restrictions (Kasimier + Buchcik), node copy checks and fix for attribute (Rob Richards), counted + transition bug in regexps, ctxt->standalone = -2 to indicate no + standalone attribute was found, add xmlSchemaSetParserStructuredErrors() + (Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API + (Kasimier), handle gzipped HTTP resources (Gary Coady), add + htmlDocDumpMemoryFormat. (Rob Richards),
                      • +
                      • documentation: typo (Michael Day), libxml man page (Albert Chin), save + function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik), +
                      • +
                      +

                      2.6.22: Sep 12 2005

                      • build fixes: compile without schematron (Stéphane Bidoul)
                      • bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i, - CDATA push parser bug, xmlElemDump problem with XHTML1 doc, - XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, - fix some output formatting for meta element (Rob Richards), - script and style XHTML1 serialization (David Madore), Attribute - derivation fixups in XSD (Kasimier Buchcik), better IDC error - reports (Kasimier Buchcik) -
                      • -
                      • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), - add XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements - preparing for derive (Kasimier Buchcik).
                      • + CDATA push parser bug, xmlElemDump problem with XHTML1 doc, + XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some + output formatting for meta element (Rob Richards), script and style + XHTML1 serialization (David Madore), Attribute derivation fixups in XSD + (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik) +
                      • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add + XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for + derive (Kasimier Buchcik).
                      • documentation: generation of gtk-doc like docs, integration with - devhelp.
                      • + devhelp.
                      +

                      2.6.21: Sep 4 2005

                      • build fixes: Cygwin portability fixes (Gerrit P. Haase), calling - convention problems on Windows (Marcus Boerger), cleanups based on - Linus' sparse tool, update of win32/configure.js (Rob Richards), - remove warnings on Windows(Marcus Boerger), compilation without SAX1, - detection of the Python binary, use $GCC inestad of $CC = 'gcc' (Andrew - W. Nosenko), compilation/link with threads and old gcc, compile - problem by C370 on Z/OS,
                      • + convention problems on Windows (Marcus Boerger), cleanups based on Linus' + sparse tool, update of win32/configure.js (Rob Richards), remove warnings + on Windows(Marcus Boerger), compilation without SAX1, detection of the + Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko), + compilation/link with threads and old gcc, compile problem by C370 on + Z/OS,
                      • bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8 - bug (Jiri Netolicky), XPath NaN compare bug (William Brack), - htmlParseScript potential bug, Schemas regexp handling of spaces, - Base64 Schemas comparisons NIST passes, automata build error xsd:all, - xmlGetNodePath for namespaced attributes (Alexander Pohoyda), - xmlSchemas foreign namespaces handling, XML Schemas facet comparison - (Kupriyanov Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier - Buchcik), xml: namespace ahndling in Schemas (Kasimier), empty model - group in Schemas (Kasimier), wilcard in Schemas (Kasimier), URI - composition (William), xs:anyType in Schemas (Kasimier), Python resolver - emmitting error messages directly, Python xmlAttr.parent (Jakub Piotr - Clapa), trying to fix the file path/URI conversion, - xmlTextReaderGetAttribute fix (Rob Richards), xmlSchemaFreeAnnot memleak - (Kasimier), HTML UTF-8 serialization, streaming XPath, Schemas determinism - detection problem, XInclude bug, Schemas context type (Dean Hill), - validation fix (Derek Poon), xmlTextReaderGetAttribute[Ns] namespaces - (Rob Richards), Schemas type fix (Kuba Nowakowski), UTF-8 parser bug, - error in encoding handling, xmlGetLineNo fixes, bug on entities handling, - entity name extraction in error handling with XInclude, text nodes - in HTML body tags (Gary Coady), xml:id and IDness at the treee level - fixes, XPath streaming patterns bugs.
                      • + bug (Jiri Netolicky), XPath NaN compare bug (William Brack), + htmlParseScript potential bug, Schemas regexp handling of spaces, Base64 + Schemas comparisons NIST passes, automata build error xsd:all, + xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas + foreign namespaces handling, XML Schemas facet comparison (Kupriyanov + Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml: + namespace ahndling in Schemas (Kasimier), empty model group in Schemas + (Kasimier), wilcard in Schemas (Kasimier), URI composition (William), + xs:anyType in Schemas (Kasimier), Python resolver emmitting error + messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to + fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob + Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8 + serialization, streaming XPath, Schemas determinism detection problem, + XInclude bug, Schemas context type (Dean Hill), validation fix (Derek + Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas + type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling, + xmlGetLineNo fixes, bug on entities handling, entity name extraction in + error handling with XInclude, text nodes in HTML body tags (Gary Coady), + xml:id and IDness at the treee level fixes, XPath streaming patterns + bugs.
                      • improvements: structured interfaces for schemas and RNG error reports - (Marcus Boerger), optimization of the char data inner loop parsing - (thanks to Behdad Esfahbod for the idea), schematron validation - though not finished yet, xmlSaveOption to omit XML declaration, - keyref match error reports (Kasimier), formal expression handling - code not plugged yet, more lax mode for the HTML parser, - parser XML_PARSE_COMPACT option for text nodes allocation.
                      • + (Marcus Boerger), optimization of the char data inner loop parsing + (thanks to Behdad Esfahbod for the idea), schematron validation though + not finished yet, xmlSaveOption to omit XML declaration, keyref match + error reports (Kasimier), formal expression handling code not plugged + yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option + for text nodes allocation.
                      • documentation: xmllint man page had --nonet duplicated
                      +

                      2.6.20: Jul 10 2005

                        -
                      • build fixes: Windows build (Rob Richards), Mingw compilation (Igor - Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and - andriy@google.com), use gcc weak references to pthread to avoid the - pthread dependancy on Linux, compilation problem (Steve Nairn), - compiling of subset (Morten Welinder), IPv6/ss_family compilation - (William Brack), compilation when disabling parts of the library, - standalone test distribution. -
                      • -
                      • bug fixes: bug in lang(), memory cleanup on errors (William Brack), - HTTP query strings (Aron Stansvik), memory leak in DTD (William), - integer overflow in XPath (William), nanoftp buffer size, pattern - "." apth fixup (Kasimier), leak in tree reported by Malcolm Rowe, - replaceNode patch (Brent Hendricks), CDATA with NULL content - (Mark Vakoc), xml:base fixup on XInclude (William), pattern - fixes (William), attribute bug in exclusive c14n (Aleksey Sanin), - xml:space and xml:lang with SAX2 (Rob Richards), namespace - trouble in complex parsing (Malcolm Rowe), XSD type QNames fixes - (Kasimier), XPath streaming fixups (William), RelaxNG bug (Rob Richards), - Schemas for Schemas fixes (Kasimier), removal of ID (Rob Richards), - a small RelaxNG leak, HTML parsing in push mode bug (James Bursa), - failure to detect UTF-8 parsing bugs in CDATA sections, areBlanks() - heuristic failure, duplicate attributes in DTD bug (William). -
                      • -
                      • improvements: lot of work on Schemas by Kasimier Buchcik both on - conformance and streaming, Schemas validation messages (Kasimier - Buchcik, Matthew Burgess), namespace removal at the python level - (Brent Hendricks), Update to new Schemas regression tests from - W3C/Nist (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation - of xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), - standalone test framework and programs, new DOM import APIs - xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and - xmlDOMWrapRemoveNode(), extension of xmllint capabilities for - SAX and Schemas regression tests, xmlStopParser() available in - pull mode too, ienhancement to xmllint --shell namespaces support, - Windows port of the standalone testing tools (Kasimier and William), - xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() - SAX Schemas APIs, Schemas xmlReader support. -
                      • +
                      • build fixes: Windows build (Rob Richards), Mingw compilation (Igor + Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and + andriy@google.com), use gcc weak references to pthread to avoid the + pthread dependancy on Linux, compilation problem (Steve Nairn), compiling + of subset (Morten Welinder), IPv6/ss_family compilation (William Brack), + compilation when disabling parts of the library, standalone test + distribution.
                      • +
                      • bug fixes: bug in lang(), memory cleanup on errors (William Brack), + HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer + overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup + (Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch + (Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup + on XInclude (William), pattern fixes (William), attribute bug in + exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob + Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type + QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug + (Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob + Richards), a small RelaxNG leak, HTML parsing in push mode bug (James + Bursa), failure to detect UTF-8 parsing bugs in CDATA sections, + areBlanks() heuristic failure, duplicate attributes in DTD bug + (William).
                      • +
                      • improvements: lot of work on Schemas by Kasimier Buchcik both on + conformance and streaming, Schemas validation messages (Kasimier Buchcik, + Matthew Burgess), namespace removal at the python level (Brent + Hendricks), Update to new Schemas regression tests from W3C/Nist + (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of + xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), + standalone test framework and programs, new DOM import APIs + xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and + xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and + Schemas regression tests, xmlStopParser() available in pull mode too, + ienhancement to xmllint --shell namespaces support, Windows port of the + standalone testing tools (Kasimier and William), + xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX + Schemas APIs, Schemas xmlReader support.
                      +

                      2.6.19: Apr 02 2005

                        -
                      • build fixes: drop .la from RPMs, --with-minimum build fix (William - Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with - AIX 5.3 compiler, fixed elfgcchack.h generation and PLT reduction - code on Linux/ELF/gcc4
                      • -
                      • bug fixes: schemas type decimal fixups (William Brack), xmmlint return - code (Gerry Murphy), small schemas fixes (Matthew Burgess and - GUY Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey - Sanin), segfault in Schemas (Kasimier Buchcik), Schemas attribute - validation (Kasimier), Prop related functions and xmlNewNodeEatName - (Rob Richards), HTML serialization of name attribute on a elements, - Python error handlers leaks and improvement (Brent Hendricks), - uninitialized variable in encoding code, Relax-NG validation bug, - potential crash if gnorableWhitespace is NULL, xmlSAXParseDoc and - xmlParseDoc signatures, switched back to assuming UTF-8 in case - no encoding is given at serialization time
                      • -
                      • improvements: lot of work on Schemas by Kasimier Buchcik on facets - checking and also mixed handling.
                      • +
                      • build fixes: drop .la from RPMs, --with-minimum build fix (William + Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX + 5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on + Linux/ELF/gcc4
                      • +
                      • bug fixes: schemas type decimal fixups (William Brack), xmmlint return + code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY + Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin), + segfault in Schemas (Kasimier Buchcik), Schemas attribute validation + (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards), + HTML serialization of name attribute on a elements, Python error handlers + leaks and improvement (Brent Hendricks), uninitialized variable in + encoding code, Relax-NG validation bug, potential crash if + gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures, + switched back to assuming UTF-8 in case no encoding is given at + serialization time
                      • +
                      • improvements: lot of work on Schemas by Kasimier Buchcik on facets + checking and also mixed handling.
                      +

                      2.6.18: Mar 13 2005

                        -
                      • build fixes: warnings (Peter Breitenlohner), testapi.c generation, - Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), - some gcc4 fixes, HP-UX portability fixes (Rick Jones).
                      • -
                      • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and - xmlreader stopping on non-fatal errors, thread support for dictionnaries - reference counting (Gary Coady), internal subset and push problem, - URL saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python - paths fixup (Stephane Bidoul), xmlGetNodePath and namespaces, - xmlSetNsProp fix (Mike Hommey), warning should not count as error - (William Brack), xmlCreatePushParser empty chunk, XInclude parser - flags (William), cleanup FTP and HTTP code to reuse the uri parsing - and IPv6 (William), xmlTextWriterStartAttributeNS fix (Rob Richards), - XMLLINT_INDENT being empty (William), xmlWriter bugs (Rob Richards), - multithreading on Windows (Rich Salz), xmlSearchNsByHref fix (Kasimier), - Python binding leak (Brent Hendricks), aliasing bug exposed by gcc4 - on s390, xmlTextReaderNext bug (Rob Richards), Schemas decimal type - fixes (William Brack), xmlByteConsumed static buffer (Ben Maurer).
                      • -
                      • improvement: speedup parsing comments and DTDs, dictionnary support for - hash tables, Schemas Identity constraints (Kasimier), streaming XPath - subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical - values handling (Kasimier), add xmlTextReaderByteConsumed (Aron - Stansvik),
                      • -
                      • Documentation: Wiki support (Joel Reed) +
                      • build fixes: warnings (Peter Breitenlohner), testapi.c generation, + Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), + some gcc4 fixes, HP-UX portability fixes (Rick Jones).
                      • +
                      • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and + xmlreader stopping on non-fatal errors, thread support for dictionnaries + reference counting (Gary Coady), internal subset and push problem, URL + saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths + fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix + (Mike Hommey), warning should not count as error (William Brack), + xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup + FTP and HTTP code to reuse the uri parsing and IPv6 (William), + xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being + empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows + (Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent + Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug + (Rob Richards), Schemas decimal type fixes (William Brack), + xmlByteConsumed static buffer (Ben Maurer).
                      • +
                      • improvement: speedup parsing comments and DTDs, dictionnary support for + hash tables, Schemas Identity constraints (Kasimier), streaming XPath + subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical + values handling (Kasimier), add xmlTextReaderByteConsumed (Aron + Stansvik),
                      • +
                      • Documentation: Wiki support (Joel Reed)
                      +

                      2.6.17: Jan 16 2005

                        -
                      • build fixes: Windows, warnings removal (William Brack), - maintainer-clean dependency(William), build in a different directory - (William), fixing --with-minimum configure build (William), BeOS - build (Marcin Konicki), Python-2.4 detection (William), compilation - on AIX (Dan McNichol)
                      • +
                      • build fixes: Windows, warnings removal (William Brack), + maintainer-clean dependency(William), build in a different directory + (William), fixing --with-minimum configure build (William), BeOS build + (Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan + McNichol)
                      • bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile() - to use the catalog(s), loop on output (William Brack), XPath memory leak, - ID deallocation problem (Steve Shepard), debugDumpNode crash (William), - warning not using error callback (William), xmlStopParser bug (William), - UTF-16 with BOM on DTDs (William), namespace bug on empty elements - in push mode (Rob Richards), line and col computations fixups (Aleksey - Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), - patterns with too many steps, bug in RNG choice optimization, line - number sometimes missing. -
                      • -
                      • improvements: XSD Schemas (Kasimier Buchcik), python generator (William), - xmlUTF8Strpos speedup (William), unicode Python strings (William), - XSD error reports (Kasimier Buchcik), Python __str__ call serialize(). -
                      • -
                      • new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber - for the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs - (mostly Joel Reed), error extraction API from regexps, new XMLSave - option for format (Phil Shafer)
                      • -
                      • documentation: site improvement (John Fleck), FAQ entries (William).
                      • + to use the catalog(s), loop on output (William Brack), XPath memory leak, + ID deallocation problem (Steve Shepard), debugDumpNode crash (William), + warning not using error callback (William), xmlStopParser bug (William), + UTF-16 with BOM on DTDs (William), namespace bug on empty elements in + push mode (Rob Richards), line and col computations fixups (Aleksey + Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), + patterns with too many steps, bug in RNG choice optimization, line number + sometimes missing. +
                      • improvements: XSD Schemas (Kasimier Buchcik), python generator + (William), xmlUTF8Strpos speedup (William), unicode Python strings + (William), XSD error reports (Kasimier Buchcik), Python __str__ call + serialize().
                      • +
                      • new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for + the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel + Reed), error extraction API from regexps, new XMLSave option for format + (Phil Shafer)
                      • +
                      • documentation: site improvement (John Fleck), FAQ entries + (William).

                      2.6.16: Nov 10 2004

                      @@ -899,7 +956,7 @@ to the CVS code base.

                    • documentation: fix to xmllint man page, some API function descritpion were updated.
                    • improvements: DTD validation APIs provided at the Python level (Brent - Hendricks)
                    • + Hendricks)

                    2.6.15: Oct 27 2004

                    @@ -2443,10 +2500,9 @@ or libxslt wrappers or bindings:

                  • Uwe Fechner also provides idom2, a DOM2 implementation for Kylix2/D5/D6 from Borland.
                  • -
                  • There is bindings for Ruby and - libxml2 bindings are also available in Ruby through the libgdome-ruby module +
                  • There is bindings + for Ruby and libxml2 bindings are also available in Ruby through the + libgdome-ruby module maintained by Tobias Peters.
                  • Steve Ball and contributors maintains libxml2 and libxslt bindings for @@ -2457,14 +2513,15 @@ or libxslt wrappers or bindings:

                    libxslt as part of GNU ClasspathX project.
                  • Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for RexxXML.
                  • -
                  • Satimage +
                  • Satimage provides XMLLib osax. This is an osax for Mac OS X with a set of commands to implement in AppleScript the XML DOM, XPATH and XSLT. Also includes commands for Property-lists (Apple's fast lookup table XML format.)
                  • -
                  • Francesco Montorsi developped -wxXml2 +
                  • Francesco Montorsi developped wxXml2 wrappers that interface libxml2, allowing wxWidgets applications to load/save/edit XML instances.
                  @@ -2474,10 +2531,11 @@ to be maintained as part of the library in the future, though the Python interface have not yet reached the completeness of the C API.

                  Note that some of the Python purist dislike the default set of Python -bindings, rather than complaining I suggest they have a look at -lxml the more pythonic bindings for libxml2 and libxslt and -help Martijn Faassen -complete those.

                  +bindings, rather than complaining I suggest they have a look at lxml the more pythonic bindings for libxml2 +and libxslt and help Martijn +Faassen complete those.

                  Stéphane Bidoul maintains a Windows port @@ -3251,12 +3309,13 @@ of a number of things:

                  is I18N) , Unicode, characters and glyphs, I suggest you read a presentation by Tim Bray on Unicode and why you should care about it.

                  +

                  If you don't understand why it does not make sense to have a string -without knowing what encoding it uses, then as Joel Spolsky said -please do -not write another line of code until you finish reading that article.. -It is a prerequisite to understand this page, and avoid a lot of problems -with libxml2, XML or text processing in general.

                  +without knowing what encoding it uses, then as Joel Spolsky said please do not +write another line of code until you finish reading that article.. It is +a prerequisite to understand this page, and avoid a lot of problems with +libxml2, XML or text processing in general.

                  Table of Content:

                    @@ -3452,7 +3511,7 @@ encoding:

                    <très>là</très> ~/XML -> ./xmllint --encode UTF-8 isolat1 <?xml version="1.0" encoding="UTF-8"?> -<très>là  </très> +<très>là  </très> ~/XML ->

                    The same processing is applied (and reuse most of the code) for HTML I18N @@ -3482,6 +3541,14 @@ linux machine with glibc-2.1 the list of supported encodings and aliases fill 3 full pages, and include UCS-4, the full set of ISO-Latin encodings, and the various Japanese ones.

                    +

                    To convert from the UTF-8 values returned from the API to another encoding +then it is possible to use the function provided from the encoding module like UTF8Toisolat1, or use the +POSIX iconv() +API directly.

                    +

                    Encoding aliases

                    From 2.2.3, libxml2 has support to register encoding names aliases. The @@ -3666,19 +3733,19 @@ new output handler with the closing call deactivated:

                    the file:
                    xmlOutputBufferPtr
                     xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
                    -    xmlOutputBufferPtr ret;
                    -    
                    -    if (xmlOutputCallbackInitialized == 0)
                    -        xmlRegisterDefaultOutputCallbacks();
                    -
                    -    if (file == NULL) return(NULL);
                    -    ret = xmlAllocOutputBuffer(encoder);
                    -    if (ret != NULL) {
                    -        ret->context = file;
                    -        ret->writecallback = xmlFileWrite;
                    -        ret->closecallback = NULL;  /* No close callback */
                    -    }
                    -    return(ret);
                    +    xmlOutputBufferPtr ret;
                    +    
                    +    if (xmlOutputCallbackInitialized == 0)
                    +        xmlRegisterDefaultOutputCallbacks();
                    +
                    +    if (file == NULL) return(NULL);
                    +    ret = xmlAllocOutputBuffer(encoder);
                    +    if (ret != NULL) {
                    +        ret->context = file;
                    +        ret->writecallback = xmlFileWrite;
                    +        ret->closecallback = NULL;  /* No close callback */
                    +    }
                    +    return(ret);
                     } 
                  1. And then use it to save the document: @@ -4844,10 +4911,9 @@ Gnome CVS base under gnome-xml/example

                    XML Canonicalization and XML Digital Signature implementations for libxml2
                  2. -
                  3. Steve Ball - and contributors maintain tcl bindings for libxml2 and - libxslt, as well as Steve Ball and + contributors maintain tcl + bindings for libxml2 and libxslt, as well as tkxmllint a GUI for xmllint and tkxsltproc a GUI for xsltproc.
                  4. diff --git a/doc/xmldtd.html b/doc/xmldtd.html index 45eb249..2e0caf9 100644 --- a/doc/xmldtd.html +++ b/doc/xmldtd.html @@ -7,7 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Validation & DTDs
                    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                    Made with Libxml2 Logo

                    The XML C parser and toolkit of Gnome

                    Validation & DTDs

                    Main Menu
                    Related links

                    Table of Content:

                    1. General overview
                    2. +Validation & DTDs
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      Validation & DTDs

                      Main Menu
                      Related links

                      Table of Content:

                      1. General overview
                      2. The definition
                      3. Simple rules
                        1. How to reference a DTD from a document
                        2. diff --git a/doc/xmlreader.html b/doc/xmlreader.html index db711b8..b8382a8 100644 --- a/doc/xmlreader.html +++ b/doc/xmlreader.html @@ -466,9 +466,9 @@ affects the Read() ones, however usually once processed the full subtree is not useful anymore, and the Next() operation allows to skip it completely and process to the successor or return 0 if the document end is reached.

                          -

                          Daniel Veillard

                          +

                          Daniel Veillard

                          -

                          $Id: xmlreader.html,v 1.8 2003/11/05 04:15:16 jfleck Exp $

                          +

                          $Id: xmlreader.html,v 1.9 2005/10/18 19:11:54 veillard Exp $

                          diff --git a/elfgcchack.h b/elfgcchack.h index 44ab139..66e056c 100644 --- a/elfgcchack.h +++ b/elfgcchack.h @@ -301,6 +301,18 @@ extern __typeof (htmlDocDumpMemory) htmlDocDumpMemory__internal_alias __attribut #endif #endif +#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_HTMLtree +#undef htmlDocDumpMemoryFormat +extern __typeof (htmlDocDumpMemoryFormat) htmlDocDumpMemoryFormat __attribute((alias("htmlDocDumpMemoryFormat__internal_alias"))); +#else +#ifndef htmlDocDumpMemoryFormat +extern __typeof (htmlDocDumpMemoryFormat) htmlDocDumpMemoryFormat__internal_alias __attribute((visibility("hidden"))); +#define htmlDocDumpMemoryFormat htmlDocDumpMemoryFormat__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_HTML_ENABLED) #ifdef bottom_HTMLparser #undef htmlElementAllowedHere @@ -6571,6 +6583,18 @@ extern __typeof (xmlOutputBufferClose) xmlOutputBufferClose__internal_alias __at #endif #endif +#if defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_xmlIO +#undef xmlOutputBufferCreateBuffer +extern __typeof (xmlOutputBufferCreateBuffer) xmlOutputBufferCreateBuffer __attribute((alias("xmlOutputBufferCreateBuffer__internal_alias"))); +#else +#ifndef xmlOutputBufferCreateBuffer +extern __typeof (xmlOutputBufferCreateBuffer) xmlOutputBufferCreateBuffer__internal_alias __attribute((visibility("hidden"))); +#define xmlOutputBufferCreateBuffer xmlOutputBufferCreateBuffer__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_OUTPUT_ENABLED) #ifdef bottom_xmlIO #undef xmlOutputBufferCreateFd @@ -9153,6 +9177,18 @@ extern __typeof (xmlSaveSetEscape) xmlSaveSetEscape__internal_alias __attribute( #endif #endif +#if defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_xmlsave +#undef xmlSaveToBuffer +extern __typeof (xmlSaveToBuffer) xmlSaveToBuffer __attribute((alias("xmlSaveToBuffer__internal_alias"))); +#else +#ifndef xmlSaveToBuffer +extern __typeof (xmlSaveToBuffer) xmlSaveToBuffer__internal_alias __attribute((visibility("hidden"))); +#define xmlSaveToBuffer xmlSaveToBuffer__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_OUTPUT_ENABLED) #ifdef bottom_xmlsave #undef xmlSaveToFd @@ -9679,6 +9715,18 @@ extern __typeof (xmlSchemaSetParserErrors) xmlSchemaSetParserErrors__internal_al #endif #endif +#if defined(LIBXML_SCHEMAS_ENABLED) +#ifdef bottom_xmlschemas +#undef xmlSchemaSetParserStructuredErrors +extern __typeof (xmlSchemaSetParserStructuredErrors) xmlSchemaSetParserStructuredErrors __attribute((alias("xmlSchemaSetParserStructuredErrors__internal_alias"))); +#else +#ifndef xmlSchemaSetParserStructuredErrors +extern __typeof (xmlSchemaSetParserStructuredErrors) xmlSchemaSetParserStructuredErrors__internal_alias __attribute((visibility("hidden"))); +#define xmlSchemaSetParserStructuredErrors xmlSchemaSetParserStructuredErrors__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_SCHEMAS_ENABLED) #ifdef bottom_xmlschemas #undef xmlSchemaSetValidErrors @@ -11423,7 +11471,7 @@ extern __typeof (xmlTextReaderReadAttributeValue) xmlTextReaderReadAttributeValu #endif #endif -#if defined(LIBXML_READER_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) #ifdef bottom_xmlreader #undef xmlTextReaderReadInnerXml extern __typeof (xmlTextReaderReadInnerXml) xmlTextReaderReadInnerXml __attribute((alias("xmlTextReaderReadInnerXml__internal_alias"))); @@ -11435,7 +11483,7 @@ extern __typeof (xmlTextReaderReadInnerXml) xmlTextReaderReadInnerXml__internal_ #endif #endif -#if defined(LIBXML_READER_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) #ifdef bottom_xmlreader #undef xmlTextReaderReadOuterXml extern __typeof (xmlTextReaderReadOuterXml) xmlTextReaderReadOuterXml __attribute((alias("xmlTextReaderReadOuterXml__internal_alias"))); @@ -11507,6 +11555,18 @@ extern __typeof (xmlTextReaderSchemaValidate) xmlTextReaderSchemaValidate__inter #endif #endif +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +#ifdef bottom_xmlreader +#undef xmlTextReaderSchemaValidateCtxt +extern __typeof (xmlTextReaderSchemaValidateCtxt) xmlTextReaderSchemaValidateCtxt __attribute((alias("xmlTextReaderSchemaValidateCtxt__internal_alias"))); +#else +#ifndef xmlTextReaderSchemaValidateCtxt +extern __typeof (xmlTextReaderSchemaValidateCtxt) xmlTextReaderSchemaValidateCtxt__internal_alias __attribute((visibility("hidden"))); +#define xmlTextReaderSchemaValidateCtxt xmlTextReaderSchemaValidateCtxt__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_READER_ENABLED) #ifdef bottom_xmlreader #undef xmlTextReaderSetErrorHandler diff --git a/error.c b/error.c index ce63071..722ffbb 100644 --- a/error.c +++ b/error.c @@ -21,7 +21,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, ...); #define XML_GET_VAR_STR(msg, str) { \ - int size; \ + int size, prev_size = -1; \ int chars; \ char *larger; \ va_list ap; \ @@ -35,8 +35,13 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, va_start(ap, msg); \ chars = vsnprintf(str, size, msg, ap); \ va_end(ap); \ - if ((chars > -1) && (chars < size)) \ - break; \ + if ((chars > -1) && (chars < size)) { \ + if (prev_size == chars) { \ + break; \ + } else { \ + prev_size = chars; \ + } \ + } \ if (chars > -1) \ size += chars + 1; \ else \ @@ -293,8 +298,6 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, if (name != NULL) { channel(data, "element %s: ", name); } - if (code == XML_ERR_OK) - return; switch (domain) { case XML_FROM_PARSER: channel(data, "parser "); @@ -360,8 +363,6 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, default: break; } - if (code == XML_ERR_OK) - return; switch (level) { case XML_ERR_NONE: channel(data, ": "); @@ -376,8 +377,6 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, channel(data, "error : "); break; } - if (code == XML_ERR_OK) - return; if (str != NULL) { int len; len = xmlStrlen((const xmlChar *)str); @@ -388,8 +387,6 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, } else { channel(data, "%s\n", "out of memory error"); } - if (code == XML_ERR_OK) - return; if (ctxt != NULL) { xmlParserPrintFileContextInternal(input, channel, data); diff --git a/gentest.py b/gentest.py index af76b04..8c143af 100755 --- a/gentest.py +++ b/gentest.py @@ -46,6 +46,7 @@ modules_defines = { "DOCBparser" : "LIBXML_DOCB_ENABLED", "xmlmodule" : "LIBXML_MODULES_ENABLED", "pattern" : "LIBXML_PATTERN_ENABLED", + "schematron" : "LIBXML_SCHEMATRON_ENABLED", } # diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h index 50b8544..6ea8207 100644 --- a/include/libxml/HTMLtree.h +++ b/include/libxml/HTMLtree.h @@ -75,6 +75,11 @@ XMLPUBFUN void XMLCALL htmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); +XMLPUBFUN void XMLCALL + htmlDocDumpMemoryFormat (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); XMLPUBFUN int XMLCALL htmlDocDump (FILE *f, xmlDocPtr cur); diff --git a/include/libxml/pattern.h b/include/libxml/pattern.h index 1aa6704..97d2cd2 100644 --- a/include/libxml/pattern.h +++ b/include/libxml/pattern.h @@ -74,6 +74,11 @@ XMLPUBFUN xmlStreamCtxtPtr XMLCALL xmlPatternGetStreamCtxt (xmlPatternPtr comp); XMLPUBFUN void XMLCALL xmlFreeStreamCtxt (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamPushNode (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns, + int nodeType); XMLPUBFUN int XMLCALL xmlStreamPush (xmlStreamCtxtPtr stream, const xmlChar *name, @@ -84,6 +89,8 @@ XMLPUBFUN int XMLCALL const xmlChar *ns); XMLPUBFUN int XMLCALL xmlStreamPop (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream); #ifdef __cplusplus } #endif diff --git a/include/libxml/schemasInternals.h b/include/libxml/schemasInternals.h index 384758d..b68a6e1 100644 --- a/include/libxml/schemasInternals.h +++ b/include/libxml/schemasInternals.h @@ -2,6 +2,8 @@ * Summary: internal interfaces for XML Schemas * Description: internal interfaces for the XML Schemas handling * and schema validity checking + * The Schemas development is a Work In Progress. + * Some of those interfaces are not garanteed to be API or ABI stable ! * * Copy: See Copyright for the status of this software. * @@ -103,6 +105,7 @@ typedef enum { XML_SCHEMA_TYPE_IDC_KEY, XML_SCHEMA_TYPE_IDC_KEYREF, XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_TYPE_ATTRIBUTE_USE, XML_SCHEMA_FACET_MININCLUSIVE = 1000, XML_SCHEMA_FACET_MINEXCLUSIVE, XML_SCHEMA_FACET_MAXINCLUSIVE, @@ -115,7 +118,8 @@ typedef enum { XML_SCHEMA_FACET_LENGTH, XML_SCHEMA_FACET_MAXLENGTH, XML_SCHEMA_FACET_MINLENGTH, - XML_SCHEMA_EXTRA_QNAMEREF = 2000 + XML_SCHEMA_EXTRA_QNAMEREF = 2000, + XML_SCHEMA_EXTRA_ATTR_USE_PROHIB } xmlSchemaTypeType; typedef enum { @@ -124,7 +128,7 @@ typedef enum { XML_SCHEMA_CONTENT_ELEMENTS, XML_SCHEMA_CONTENT_MIXED, XML_SCHEMA_CONTENT_SIMPLE, - XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* obsolete, not used */ + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */ XML_SCHEMA_CONTENT_BASIC, XML_SCHEMA_CONTENT_ANY } xmlSchemaContentType; @@ -242,31 +246,32 @@ struct _xmlSchemaAnnot { typedef struct _xmlSchemaAttribute xmlSchemaAttribute; typedef xmlSchemaAttribute *xmlSchemaAttributePtr; struct _xmlSchemaAttribute { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ - const xmlChar *name; /* name of the declaration or empty if particle */ - const xmlChar *id; - const xmlChar *ref; /* the local name of the attribute decl. if a particle */ - const xmlChar *refNs; /* the ns URI of the attribute decl. if a particle */ + xmlSchemaTypeType type; + struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */ + const xmlChar *name; /* the name of the declaration */ + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ const xmlChar *typeName; /* the local name of the type definition */ const xmlChar *typeNs; /* the ns URI of the type definition */ xmlSchemaAnnotPtr annot; - xmlSchemaTypePtr base; /* obsolete, not used */ - int occurs; - const xmlChar *defValue; + xmlSchemaTypePtr base; /* Deprecated; not used */ + int occurs; /* Deprecated; not used */ + const xmlChar *defValue; /* The initial value of the value constraint */ xmlSchemaTypePtr subtypes; /* the type definition */ xmlNodePtr node; const xmlChar *targetNamespace; int flags; - const xmlChar *refPrefix; - xmlSchemaValPtr defVal; - xmlSchemaAttributePtr refDecl; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value constraint */ + xmlSchemaAttributePtr refDecl; /* Deprecated; not used */ }; /** * xmlSchemaAttributeLink: * Used to build a list of attribute uses on complexType definitions. + * WARNING: Deprecated; not used. */ typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink; typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr; @@ -301,11 +306,11 @@ typedef struct _xmlSchemaWildcard xmlSchemaWildcard; typedef xmlSchemaWildcard *xmlSchemaWildcardPtr; struct _xmlSchemaWildcard { xmlSchemaTypeType type; /* The kind of type */ - const xmlChar *id; + const xmlChar *id; /* Deprecated; not used */ xmlSchemaAnnotPtr annot; xmlNodePtr node; - int minOccurs; - int maxOccurs; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ int processContents; int any; /* Indicates if the ns constraint is of ##any */ xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */ @@ -332,6 +337,19 @@ struct _xmlSchemaWildcard { */ #define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2 +/** + * XML_SCHEMAS_ATTRGROUP_REDEFINED: + * + * The attr group was redefined. + */ +#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3 +/** + * XML_SCHEMAS_ATTRGROUP_HAS_REFS: + * + * Whether this attr. group contains attr. group references. + */ +#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4 + /** * An attribute group definition. * @@ -345,18 +363,18 @@ struct _xmlSchemaAttributeGroup { struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ const xmlChar *name; const xmlChar *id; - const xmlChar *ref; - const xmlChar *refNs; + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ xmlSchemaAnnotPtr annot; - xmlSchemaAttributePtr attributes; + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ xmlNodePtr node; int flags; xmlSchemaWildcardPtr attributeWildcard; - const xmlChar *refPrefix; - xmlSchemaAttributeGroupPtr refItem; /* The referenced attribute group */ + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */ const xmlChar *targetNamespace; - /* xmlSchemaAttributeGroupPtr redef;*/ /* Redefinitions */ + void *attrUses; }; /** @@ -368,7 +386,7 @@ typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink; typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr; struct _xmlSchemaTypeLink { struct _xmlSchemaTypeLink *next;/* the next type link ... */ - xmlSchemaTypePtr type;/* the linked type*/ + xmlSchemaTypePtr type;/* the linked type */ }; /** @@ -417,6 +435,9 @@ struct _xmlSchemaFacetLink { * XML_SCHEMAS_TYPE_VARIETY_ABSENT: * * the simpleType has a variety of "absent". + * TODO: Actually not necessary :-/, since if + * none of the variety flags occur then it's + * automatically absent. */ #define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5 /** @@ -560,42 +581,57 @@ struct _xmlSchemaFacetLink { */ #define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29 +/** + * XML_SCHEMAS_TYPE_REDEFINED: + * + * The type was redefined. + */ +#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30 +/** + * XML_SCHEMAS_TYPE_REDEFINING: + * + * The type redefines an other type. + */ +/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */ + /** * _xmlSchemaType: * * Schemas type definition. */ struct _xmlSchemaType { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaType *next;/* the next type if in a sequence ... */ + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* the next type if in a sequence ... */ const xmlChar *name; - const xmlChar *id; - const xmlChar *ref; - const xmlChar *refNs; + const xmlChar *id ; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ xmlSchemaAnnotPtr annot; xmlSchemaTypePtr subtypes; - xmlSchemaAttributePtr attributes; + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ xmlNodePtr node; - int minOccurs; - int maxOccurs; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ int flags; xmlSchemaContentType contentType; - const xmlChar *base; - const xmlChar *baseNs; - xmlSchemaTypePtr baseType; - xmlSchemaFacetPtr facets; - struct _xmlSchemaType *redef;/* possible redefinitions for the type */ - int recurse; - xmlSchemaAttributeLinkPtr attributeUses; + const xmlChar *base; /* Base type's local name */ + const xmlChar *baseNs; /* Base type's target namespace */ + xmlSchemaTypePtr baseType; /* The base type component */ + xmlSchemaFacetPtr facets; /* Local facets */ + struct _xmlSchemaType *redef; /* Deprecated; not used */ + int recurse; /* Obsolete */ + xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */ xmlSchemaWildcardPtr attributeWildcard; - int builtInType; - xmlSchemaTypeLinkPtr memberTypes; - xmlSchemaFacetLinkPtr facetSet; - const xmlChar *refPrefix; - xmlSchemaTypePtr contentTypeDef; - xmlRegexpPtr contModel; + int builtInType; /* Type of built-in types. */ + xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */ + xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */ + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types. + Could we use @subtypes for this? */ + xmlRegexpPtr contModel; /* Holds the automaton of the content model */ const xmlChar *targetNamespace; + void *attrUses; }; /* @@ -727,18 +763,18 @@ struct _xmlSchemaType { typedef struct _xmlSchemaElement xmlSchemaElement; typedef xmlSchemaElement *xmlSchemaElementPtr; struct _xmlSchemaElement { - xmlSchemaTypeType type; /* The kind of type */ - struct _xmlSchemaType *next;/* the next type if in a sequence ... */ + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* Not used? */ const xmlChar *name; - const xmlChar *id; - const xmlChar *ref; /* the local name of the element declaration if a particle */ - const xmlChar *refNs; /* the ns URI of the element declaration if a particle */ + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ xmlSchemaAnnotPtr annot; xmlSchemaTypePtr subtypes; /* the type definition */ xmlSchemaAttributePtr attributes; xmlNodePtr node; - int minOccurs; - int maxOccurs; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ int flags; const xmlChar *targetNamespace; @@ -747,13 +783,14 @@ struct _xmlSchemaElement { const xmlChar *substGroup; const xmlChar *substGroupNs; const xmlChar *scope; - const xmlChar *value; - struct _xmlSchemaElement *refDecl; /* This will now be used for the substitution group affiliation */ - xmlRegexpPtr contModel; + const xmlChar *value; /* The original value of the value constraint. */ + struct _xmlSchemaElement *refDecl; /* This will now be used for the + substitution group affiliation */ + xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */ xmlSchemaContentType contentType; - const xmlChar *refPrefix; - xmlSchemaValPtr defVal; - void *idcs; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value contraint. */ + void *idcs; /* The identity-constraint defs */ }; /* @@ -786,14 +823,14 @@ struct _xmlSchemaElement { struct _xmlSchemaFacet { xmlSchemaTypeType type; /* The kind of type */ struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */ - const xmlChar *value; - const xmlChar *id; + const xmlChar *value; /* The original value */ + const xmlChar *id; /* Obsolete */ xmlSchemaAnnotPtr annot; xmlNodePtr node; - int fixed; + int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */ int whitespace; - xmlSchemaValPtr val; - xmlRegexpPtr regexp; + xmlSchemaValPtr val; /* The compiled value */ + xmlRegexpPtr regexp; /* The regex for patterns */ }; /** @@ -802,7 +839,7 @@ struct _xmlSchemaFacet { typedef struct _xmlSchemaNotation xmlSchemaNotation; typedef xmlSchemaNotation *xmlSchemaNotationPtr; struct _xmlSchemaNotation { - xmlSchemaTypeType type; /* The kind of type */ + xmlSchemaTypeType type; /* The kind of type */ const xmlChar *name; xmlSchemaAnnotPtr annot; const xmlChar *identifier; @@ -810,7 +847,7 @@ struct _xmlSchemaNotation { }; /* -* Actually all those flags used for the schema should sit +* TODO: Actually all those flags used for the schema should sit * on the schema parser context, since they are used only * during parsing an XML schema document, and not available * on the component level as per spec. @@ -884,10 +921,10 @@ struct _xmlSchemaNotation { * A Schemas definition */ struct _xmlSchema { - const xmlChar *name; /* schema name */ - const xmlChar *targetNamespace; /* the target namespace */ + const xmlChar *name; /* schema name */ + const xmlChar *targetNamespace; /* the target namespace */ const xmlChar *version; - const xmlChar *id; + const xmlChar *id; /* Obsolete */ xmlDocPtr doc; xmlSchemaAnnotPtr annot; int flags; @@ -906,8 +943,8 @@ struct _xmlSchema { void *includes; /* the includes, this is opaque for now */ int preserve; /* whether to free the document */ int counter; /* used to give ononymous components unique names */ - xmlHashTablePtr idcDef; - void *volatiles; /* Deprecated; not used anymore. */ + xmlHashTablePtr idcDef; /* All identity-constraint defs. */ + void *volatiles; /* Obsolete */ }; XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); diff --git a/include/libxml/valid.h b/include/libxml/valid.h index d13e4eb..7492d28 100644 --- a/include/libxml/valid.h +++ b/include/libxml/valid.h @@ -410,7 +410,7 @@ XMLPUBFUN xmlElementPtr XMLCALL XMLPUBFUN int XMLCALL xmlValidGetPotentialChildren(xmlElementContent *ctree, - const xmlChar **list, + const xmlChar **names, int *len, int max); diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h index e67b6e5..eea9ed6 100644 --- a/include/libxml/xmlIO.h +++ b/include/libxml/xmlIO.h @@ -231,6 +231,10 @@ XMLPUBFUN xmlOutputBufferPtr XMLCALL xmlOutputBufferCreateFile (FILE *file, xmlCharEncodingHandlerPtr encoder); +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateBuffer (xmlBufferPtr buffer, + xmlCharEncodingHandlerPtr encoder); + XMLPUBFUN xmlOutputBufferPtr XMLCALL xmlOutputBufferCreateFd (int fd, xmlCharEncodingHandlerPtr encoder); diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h index bfe3c24..c83dc95 100644 --- a/include/libxml/xmlerror.h +++ b/include/libxml/xmlerror.h @@ -767,6 +767,11 @@ typedef enum { XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */ XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */ XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */ + XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */ + XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */ + XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */ + XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */ XML_MODULE_OPEN = 4900, /* 4900 */ XML_MODULE_CLOSE, /* 4901 */ XML_CHECK_FOUND_ELEMENT = 5000, diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h index f016546..1d12988 100644 --- a/include/libxml/xmlreader.h +++ b/include/libxml/xmlreader.h @@ -121,10 +121,15 @@ XMLPUBFUN void XMLCALL */ XMLPUBFUN int XMLCALL xmlTextReaderRead (xmlTextReaderPtr reader); + +#ifdef LIBXML_WRITER_ENABLED XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); + XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); +#endif + XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadString (xmlTextReaderPtr reader); XMLPUBFUN int XMLCALL @@ -279,6 +284,10 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, const char *xsd); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader, + xmlSchemaValidCtxtPtr ctxt, + int options); XMLPUBFUN int XMLCALL xmlTextReaderSetSchema (xmlTextReaderPtr reader, xmlSchemaPtr schema); diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h index a257bb4..022cd6a 100644 --- a/include/libxml/xmlregexp.h +++ b/include/libxml/xmlregexp.h @@ -183,12 +183,12 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlExpGetLanguage(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, - const xmlChar**list, + const xmlChar**langList, int len); XMLPUBFUN int XMLCALL xmlExpGetStart (xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, - const xmlChar**list, + const xmlChar**tokList, int len); XMLPUBFUN xmlExpNodePtr XMLCALL xmlExpStringDerive(xmlExpCtxtPtr ctxt, diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h index 766a2ac..c71c71a 100644 --- a/include/libxml/xmlsave.h +++ b/include/libxml/xmlsave.h @@ -45,14 +45,12 @@ XMLPUBFUN xmlSaveCtxtPtr XMLCALL xmlSaveToFilename (const char *filename, const char *encoding, int options); -/****** - Not yet implemented. XMLPUBFUN xmlSaveCtxtPtr XMLCALL xmlSaveToBuffer (xmlBufferPtr buffer, const char *encoding, int options); - ******/ + XMLPUBFUN xmlSaveCtxtPtr XMLCALL xmlSaveToIO (xmlOutputWriteCallback iowrite, xmlOutputCloseCallback ioclose, diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h index ab47091..15faef5 100644 --- a/include/libxml/xmlschemas.h +++ b/include/libxml/xmlschemas.h @@ -113,6 +113,10 @@ XMLPUBFUN void XMLCALL xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); XMLPUBFUN int XMLCALL xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, xmlSchemaValidityErrorFunc * err, @@ -140,7 +144,8 @@ XMLPUBFUN void XMLCALL void *ctx); XMLPUBFUN void XMLCALL xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, - xmlStructuredErrorFunc serror, void *ctx); + xmlStructuredErrorFunc serror, + void *ctx); XMLPUBFUN int XMLCALL xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, xmlSchemaValidityErrorFunc *err, diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h index 77d6659..867c94d 100644 --- a/include/libxml/xmlversion.h +++ b/include/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.6.22" +#define LIBXML_DOTTED_VERSION "2.6.23" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 1002003 */ -#define LIBXML_VERSION 20622 +#define LIBXML_VERSION 20623 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "1002003" */ -#define LIBXML_VERSION_STRING "20622" +#define LIBXML_VERSION_STRING "20623" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-CVS2634" +#define LIBXML_VERSION_EXTRA "-CVS2717" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20622); +#define LIBXML_TEST_VERSION xmlCheckVersion(20623); #ifndef VMS #if 0 diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index a628741..cf547dd 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -299,7 +299,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the runtime debugging is configured in */ -#if @WITH_MEM_DEBUG@ +#if @WITH_RUN_DEBUG@ #define LIBXML_DEBUG_RUNTIME #endif diff --git a/include/win32config.h b/include/win32config.h index 9c75afd..c61dfa9 100644 --- a/include/win32config.h +++ b/include/win32config.h @@ -84,10 +84,12 @@ static int isnan (double d) { #endif #endif /* _MSC_VER */ -#if defined(_MSC_VER) || defined(__MINGW32__) +#if defined(_MSC_VER) #define mkdir(p,m) _mkdir(p) #define snprintf _snprintf #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) +#elif defined(__MINGW32__) +#define mkdir(p,m) _mkdir(p) #endif /* Threading API to use should be specified here for compatibility reasons. diff --git a/include/wsockcompat.h b/include/wsockcompat.h index 690048c..a898b05 100644 --- a/include/wsockcompat.h +++ b/include/wsockcompat.h @@ -10,6 +10,18 @@ #else #undef HAVE_ERRNO_H #include +#include +/* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */ +#if defined(GetAddrInfo) +#define HAVE_GETADDRINFO +#endif +#endif + +#ifdef __MINGW32__ +/* Include here to ensure that it doesn't get included later + * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ +#include +#undef EWOULDBLOCK #endif #if !defined SOCKLEN_T diff --git a/legacy.c b/legacy.c index bbbd2c9..e75178a 100644 --- a/legacy.c +++ b/legacy.c @@ -673,7 +673,6 @@ xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, * * Creation of a Namespace, the old way using PI and without scoping * DEPRECATED !!! - * It now create a namespace on the root element of the document if found. * Returns NULL this functionality had been removed */ xmlNsPtr diff --git a/libxml.3 b/libxml.3 index d46756f..88d3eee 100644 --- a/libxml.3 +++ b/libxml.3 @@ -53,7 +53,7 @@ library exports Push and Pull type parser interfaces for both XML and static library .TP .B /depot/lib/libxml_2.0.0/libxml.so -shareable library +shared library .TP .B /depot/package/libxml_2.0.0/bin/xmllint binary application for parsing XML files diff --git a/libxml.spec.in b/libxml.spec.in index 16c9888..bf5dd5f 100644 --- a/libxml.spec.in +++ b/libxml.spec.in @@ -60,36 +60,6 @@ at parse time or later once the document has been modified. %setup -q %build -# -# try to use compiler profiling, based on Arjan van de Ven -# initial test spec. This really doesn't work okay for most tests done. -# -# Well except it's just broken most of the time. -#GCC_VERSION=`gcc --version | grep "^gcc" | awk '{ print $3 }' | sed 's+\([0-9]\)\.\([0-9]\)\..*+\1\2+'` -#if [ $GCC_VERSION -ge 34 ] -#then -# PROF_GEN='-fprofile-generate' -# PROF_USE='-fprofile-use' -#fi -# -#if [ "$PROF_GEN" != "" ] -#then -# # First generate a profiling version -# CFLAGS="${RPM_OPT_FLAGS} ${PROF_GEN}" %configure -# make -# # Run a few sampling -# make dba100000.xml -# ./xmllint --noout dba100000.xml -# ./xmllint --stream dba100000.xml -# ./xmllint --noout --valid test/valid/REC-xml-19980210.xml -# ./xmllint --stream --valid test/valid/REC-xml-19980210.xml -# # Then generate code based on profile -# CFLAGS="${RPM_OPT_FLAGS} ${PROF_USE}" %configure -# make -#else -# %configure -# make -#fi %configure make gzip -9 ChangeLog diff --git a/libxml2.spec b/libxml2.spec index f3256d6..1df9897 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,6 +1,6 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.6.22 +Version: 2.6.23 Release: 1 License: MIT Group: Development/Libraries @@ -60,36 +60,6 @@ at parse time or later once the document has been modified. %setup -q %build -# -# try to use compiler profiling, based on Arjan van de Ven -# initial test spec. This really doesn't work okay for most tests done. -# -# Well except it's just broken most of the time. -#GCC_VERSION=`gcc --version | grep "^gcc" | awk '{ print $3 }' | sed 's+\([0-9]\)\.\([0-9]\)\..*+\1\2+'` -#if [ $GCC_VERSION -ge 34 ] -#then -# PROF_GEN='-fprofile-generate' -# PROF_USE='-fprofile-use' -#fi -# -#if [ "$PROF_GEN" != "" ] -#then -# # First generate a profiling version -# CFLAGS="${RPM_OPT_FLAGS} ${PROF_GEN}" %configure -# make -# # Run a few sampling -# make dba100000.xml -# ./xmllint --noout dba100000.xml -# ./xmllint --stream dba100000.xml -# ./xmllint --noout --valid test/valid/REC-xml-19980210.xml -# ./xmllint --stream --valid test/valid/REC-xml-19980210.xml -# # Then generate code based on profile -# CFLAGS="${RPM_OPT_FLAGS} ${PROF_USE}" %configure -# make -#else -# %configure -# make -#fi %configure make gzip -9 ChangeLog @@ -157,8 +127,8 @@ rm -fr %{buildroot} %doc doc/python.html %changelog -* Mon Sep 12 2005 Daniel Veillard -- upstream release 2.6.22 see http://xmlsoft.org/news.html +* Thu Jan 5 2006 Daniel Veillard +- upstream release 2.6.23 see http://xmlsoft.org/news.html * Thu Jan 2 2003 Daniel Veillard - integrated drv_libxml2 xml.sax driver from Stéphane Bidoul diff --git a/macos/src/config-mac.h b/macos/src/config-mac.h index 7281426..e9a8f9d 100644 --- a/macos/src/config-mac.h +++ b/macos/src/config-mac.h @@ -177,15 +177,6 @@ /* Define if you have the header file. */ #undef HAVE_ZLIB_H -/* Define if you have the inet library (-linet). */ -#undef HAVE_LIBINET - -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Name of package */ #define PACKAGE diff --git a/nanohttp.c b/nanohttp.c index 1244fe7..ae7923f 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -11,9 +11,6 @@ * daniel@veillard.com */ -/* TODO add compression support, Send the Accept- , and decompress on the - fly with ZLIB if found at compile-time */ - #define NEED_SOCKETS #define IN_LIBXML #include "libxml.h" @@ -66,6 +63,10 @@ #ifdef SUPPORT_IP6 #include #endif +#ifdef HAVE_ZLIB_H +#include +#endif + #ifdef VMS #include @@ -152,6 +153,10 @@ typedef struct xmlNanoHTTPCtxt { char *authHeader; /* contents of {WWW,Proxy}-Authenticate header */ char *encoding; /* encoding extracted from the contentType */ char *mimeType; /* Mime-Type extracted from the contentType */ +#ifdef HAVE_ZLIB_H + z_stream *strm; /* Zlib stream object */ + int usesGzip; /* "Content-Encoding: gzip" was detected */ +#endif } xmlNanoHTTPCtxt, *xmlNanoHTTPCtxtPtr; static int initialized = 0; @@ -413,6 +418,13 @@ xmlNanoHTTPFreeCtxt(xmlNanoHTTPCtxtPtr ctxt) { if (ctxt->mimeType != NULL) xmlFree(ctxt->mimeType); if (ctxt->location != NULL) xmlFree(ctxt->location); if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); +#ifdef HAVE_ZLIB_H + if (ctxt->strm != NULL) { + inflateEnd(ctxt->strm); + xmlFree(ctxt->strm); + } +#endif + ctxt->state = XML_NANO_HTTP_NONE; if (ctxt->fd >= 0) closesocket(ctxt->fd); ctxt->fd = -1; @@ -752,6 +764,26 @@ xmlNanoHTTPScanAnswer(xmlNanoHTTPCtxtPtr ctxt, const char *line) { if (ctxt->authHeader != NULL) xmlFree(ctxt->authHeader); ctxt->authHeader = xmlMemStrdup(cur); +#ifdef HAVE_ZLIB_H + } else if ( !xmlStrncasecmp( BAD_CAST line, BAD_CAST"Content-Encoding:", 17) ) { + cur += 17; + while ((*cur == ' ') || (*cur == '\t')) cur++; + if ( !xmlStrncasecmp( BAD_CAST cur, BAD_CAST"gzip", 4) ) { + ctxt->usesGzip = 1; + + ctxt->strm = xmlMalloc(sizeof(z_stream)); + + if (ctxt->strm != NULL) { + ctxt->strm->zalloc = Z_NULL; + ctxt->strm->zfree = Z_NULL; + ctxt->strm->opaque = Z_NULL; + ctxt->strm->avail_in = 0; + ctxt->strm->next_in = Z_NULL; + + inflateInit2( ctxt->strm, 31 ); + } + } +#endif } else if ( !xmlStrncasecmp( BAD_CAST line, BAD_CAST"Content-Length:", 15) ) { cur += 15; ctxt->ContentLength = strtol( cur, NULL, 10 ); @@ -946,14 +978,21 @@ xmlNanoHTTPConnectHost(const char *host, int port) memset (&sockin, 0, sizeof(sockin)); #ifdef SUPPORT_IP6 memset (&sockin6, 0, sizeof(sockin6)); +#endif + +#if !defined(HAVE_GETADDRINFO) && defined(SUPPORT_IP6) && defined(RES_USE_INET6) if (have_ipv6 ()) -#if !defined(HAVE_GETADDRINFO) && defined(RES_USE_INET6) { if (!(_res.options & RES_INIT)) res_init(); _res.options |= RES_USE_INET6; } -#elif defined(HAVE_GETADDRINFO) +#endif + +#if defined(HAVE_GETADDRINFO) && defined(SUPPORT_IP6) && !defined(_WIN32) + if (have_ipv6 ()) +#endif +#if defined(HAVE_GETADDRINFO) && (defined(SUPPORT_IP6) || defined(_WIN32)) { int status; struct addrinfo hints, *res, *result; @@ -969,42 +1008,45 @@ xmlNanoHTTPConnectHost(const char *host, int port) } for (res = result; res; res = res->ai_next) { - if (res->ai_family == AF_INET || res->ai_family == AF_INET6) { - if (res->ai_family == AF_INET6) { - if (res->ai_addrlen > sizeof(sockin6)) { - __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); - freeaddrinfo (result); - return (-1); - } - memcpy (&sockin6, res->ai_addr, res->ai_addrlen); - sockin6.sin6_port = htons (port); - addr = (struct sockaddr *)&sockin6; - } - else { - if (res->ai_addrlen > sizeof(sockin)) { - __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); - freeaddrinfo (result); - return (-1); - } - memcpy (&sockin, res->ai_addr, res->ai_addrlen); - sockin.sin_port = htons (port); - addr = (struct sockaddr *)&sockin; + if (res->ai_family == AF_INET) { + if (res->ai_addrlen > sizeof(sockin)) { + __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); + freeaddrinfo (result); + return (-1); } - - s = xmlNanoHTTPConnectAttempt (addr); - if (s != -1) { + memcpy (&sockin, res->ai_addr, res->ai_addrlen); + sockin.sin_port = htons (port); + addr = (struct sockaddr *)&sockin; +#ifdef SUPPORT_IP6 + } else if (have_ipv6 () && (res->ai_family == AF_INET6)) { + if (res->ai_addrlen > sizeof(sockin6)) { + __xmlIOErr(XML_FROM_HTTP, 0, "address size mismatch\n"); freeaddrinfo (result); - return (s); + return (-1); } + memcpy (&sockin6, res->ai_addr, res->ai_addrlen); + sockin6.sin6_port = htons (port); + addr = (struct sockaddr *)&sockin6; +#endif + } else + continue; /* for */ + + s = xmlNanoHTTPConnectAttempt (addr); + if (s != -1) { + freeaddrinfo (result); + return (s); } } + if (result) freeaddrinfo (result); - return (-1); - } else + } #endif +#if defined(HAVE_GETADDRINFO) && defined(SUPPORT_IP6) && !defined(_WIN32) + else #endif - { +#if !defined(HAVE_GETADDRINFO) || !defined(_WIN32) + { h = gethostbyname (host); if (h == NULL) { @@ -1080,6 +1122,8 @@ xmlNanoHTTPConnectHost(const char *host, int port) return (s); } } +#endif + #ifdef DEBUG_HTTP xmlGenericError(xmlGenericErrorContext, "xmlNanoHTTPConnectHost: unable to connect to '%s'.\n", @@ -1144,11 +1188,38 @@ xmlNanoHTTPOpenRedir(const char *URL, char **contentType, char **redir) { int xmlNanoHTTPRead(void *ctx, void *dest, int len) { xmlNanoHTTPCtxtPtr ctxt = (xmlNanoHTTPCtxtPtr) ctx; +#ifdef HAVE_ZLIB_H + int bytes_read = 0; + int orig_avail_in; + int z_ret; +#endif if (ctx == NULL) return(-1); if (dest == NULL) return(-1); if (len <= 0) return(0); +#ifdef HAVE_ZLIB_H + if (ctxt->usesGzip == 1) { + if (ctxt->strm == NULL) return(0); + + ctxt->strm->next_out = dest; + ctxt->strm->avail_out = len; + + do { + orig_avail_in = ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr - bytes_read; + ctxt->strm->next_in = BAD_CAST (ctxt->inrptr + bytes_read); + + z_ret = inflate(ctxt->strm, Z_NO_FLUSH); + bytes_read += orig_avail_in - ctxt->strm->avail_in; + + if (z_ret != Z_OK) break; + } while (ctxt->strm->avail_out > 0 && xmlNanoHTTPRecv(ctxt) > 0); + + ctxt->inrptr += bytes_read; + return(len - ctxt->strm->avail_out); + } +#endif + while (ctxt->inptr - ctxt->inrptr < len) { if (xmlNanoHTTPRecv(ctxt) <= 0) break; } @@ -1263,6 +1334,9 @@ retry: if (ctxt->query != NULL) blen += strlen(ctxt->query) + 1; blen += strlen(method) + strlen(ctxt->path) + 24; +#ifdef HAVE_ZLIB_H + blen += 23; +#endif bp = (char*)xmlMallocAtomic(blen); if ( bp == NULL ) { xmlNanoHTTPFreeCtxt( ctxt ); @@ -1291,6 +1365,10 @@ retry: p += snprintf( p, blen - (p - bp), " HTTP/1.0\r\nHost: %s\r\n", ctxt->hostname); +#ifdef HAVE_ZLIB_H + p += snprintf(p, blen - (p - bp), "Accept-Encoding: gzip\r\n"); +#endif + if (contentType != NULL && *contentType) p += snprintf(p, blen - (p - bp), "Content-Type: %s\r\n", *contentType); diff --git a/parser.c b/parser.c index ce6e003..ec7fb53 100644 --- a/parser.c +++ b/parser.c @@ -2177,6 +2177,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, if (val != 0) { COPY_BUF(0,buffer,nbchars,val); } + if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { + growBuffer(buffer); + } } else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) { if (xmlParserDebugEntities) xmlGenericError(xmlGenericErrorContext, @@ -2187,6 +2190,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { if (ent->content != NULL) { COPY_BUF(0,buffer,nbchars,ent->content[0]); + if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) { + growBuffer(buffer); + } } else { xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR, "predefined entity has no content\n"); @@ -3449,12 +3455,10 @@ xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata) { get_more_space: while (*in == 0x20) in++; if (*in == 0xA) { - ctxt->input->line++; ctxt->input->col = 1; - in++; - while (*in == 0xA) { + do { ctxt->input->line++; ctxt->input->col = 1; in++; - } + } while (*in == 0xA); goto get_more_space; } if (*in == '<') { @@ -3490,12 +3494,10 @@ get_more: } ctxt->input->col = ccol; if (*in == 0xA) { - ctxt->input->line++; ctxt->input->col = 1; - in++; - while (*in == 0xA) { + do { ctxt->input->line++; ctxt->input->col = 1; in++; - } + } while (*in == 0xA); goto get_more; } if (*in == ']') { @@ -3537,12 +3539,16 @@ get_more: ctxt->input->cur = in; if (*in == 0xD) { in++; + if (!*in) /* if end of current chunk return */ + return; if (*in == 0xA) { ctxt->input->cur = in; in++; ctxt->input->line++; ctxt->input->col = 1; continue; /* while */ } + if (!*in) /* if end of current chunk return */ + return; in--; } if (*in == '<') { @@ -3856,12 +3862,10 @@ xmlParseComment(xmlParserCtxtPtr ctxt) { in = ctxt->input->cur; do { if (*in == 0xA) { - ctxt->input->line++; ctxt->input->col = 1; - in++; - while (*in == 0xA) { + do { ctxt->input->line++; ctxt->input->col = 1; in++; - } + } while (*in == 0xA); } get_more: ccol = ctxt->input->col; @@ -3873,12 +3877,10 @@ get_more: } ctxt->input->col = ccol; if (*in == 0xA) { - ctxt->input->line++; ctxt->input->col = 1; - in++; - while (*in == 0xA) { + do { ctxt->input->line++; ctxt->input->col = 1; in++; - } + } while (*in == 0xA); goto get_more; } nbchar = in - ctxt->input->cur; @@ -3929,6 +3931,8 @@ get_more: ctxt->input->line++; ctxt->input->col = 1; continue; /* while */ } + if (!*in) /* if end of current chunk return */ + return; in--; } SHRINK; @@ -8888,6 +8892,13 @@ void xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { xmlChar *version; + /* + * This value for standalone indicates that the document has an + * XML declaration but it does not have a standalone attribute. + * It will be overwritten later if a standalone attribute is found. + */ + ctxt->input->standalone = -2; + /* * We know that 'length == 0) || (input->buf == NULL)) { - /* - * When parsing a static memory array one must know the - * size to be able to convert the buffer. - */ - xmlErrInternal(ctxt, "switching encoding : no input\n", NULL); - return (-1); - } else { - int processed; - - /* - * Shrink the current input buffer. - * Move it as the raw buffer and create a new input buffer - */ - processed = input->cur - input->base; - - input->buf->raw = xmlBufferCreate(); - xmlBufferAdd(input->buf->raw, input->cur, - input->length - processed); - input->buf->buffer = xmlBufferCreate(); - - /* - * convert as much as possible of the raw input - * to the parser reading buffer. - */ - nbchars = xmlCharEncInFunc(input->buf->encoder, - input->buf->buffer, - input->buf->raw); - if (nbchars < 0) { - xmlErrInternal(ctxt, - "switching encoding: encoder error\n", - NULL); - return (-1); - } - - /* - * Conversion succeeded, get rid of the old buffer - */ - if ((input->free != NULL) && (input->base != NULL)) - input->free((xmlChar *) input->base); - input->base = input->cur = input->buf->buffer->content; - input->end = &input->base[input->buf->buffer->use]; - } + } else if (input->length == 0) { + /* + * When parsing a static memory array one must know the + * size to be able to convert the buffer. + */ + xmlErrInternal(ctxt, "switching encoding : no input\n", NULL); + return (-1); } return (0); } @@ -1492,8 +1455,13 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) { if (ctxt == NULL) return(NULL); buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE); if (buf == NULL) { - __xmlLoaderErr(ctxt, "failed to load external entity \"%s\"\n", - (const char *) filename); + if (filename == NULL) + __xmlLoaderErr(ctxt, + "failed to load external entity: NULL filename \n", + NULL); + else + __xmlLoaderErr(ctxt, "failed to load external entity \"%s\"\n", + (const char *) filename); return(NULL); } @@ -1912,7 +1880,7 @@ xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, int found = 0; if ((seq == NULL) || (node == NULL)) - return (-1); + return ((unsigned long) -1); /* Do a binary search for the key */ lower = 1; diff --git a/pattern.c b/pattern.c index a76a58c..7b3e508 100644 --- a/pattern.c +++ b/pattern.c @@ -46,26 +46,43 @@ #define XML_STREAM_STEP_FINAL 2 #define XML_STREAM_STEP_ROOT 4 #define XML_STREAM_STEP_ATTR 8 +#define XML_STREAM_STEP_NODE 16 +#define XML_STREAM_STEP_IN_SET 32 /* -* TODO: This is used on _xmlStreamCtxt, so don't use any values -* from xmlPatternFlags. +* NOTE: Those private flags (XML_STREAM_xxx) are used +* in _xmlStreamCtxt->flag. They extend the public +* xmlPatternFlags, so be carefull not to interfere with the +* reserved values for xmlPatternFlags. */ +#define XML_STREAM_FINAL_IS_ANY_NODE 1<<14 +#define XML_STREAM_FROM_ROOT 1<<15 #define XML_STREAM_DESC 1<<16 +/* +* XML_STREAM_ANY_NODE is used for comparison against +* xmlElementType enums, to indicate a node of any type. +*/ +#define XML_STREAM_ANY_NODE 100 + #define XML_PATTERN_NOTPATTERN (XML_PATTERN_XPATH | \ XML_PATTERN_XSSEL | \ XML_PATTERN_XSFIELD) -#define XML_STREAM_XS_IDC(item) (item->flags & \ +#define XML_STREAM_XS_IDC(c) ((c)->flags & \ (XML_PATTERN_XSSEL | XML_PATTERN_XSFIELD)) +#define XML_STREAM_XS_IDC_SEL(c) ((c)->flags & XML_PATTERN_XSSEL) + +#define XML_STREAM_XS_IDC_FIELD(c) ((c)->flags & XML_PATTERN_XSFIELD) + typedef struct _xmlStreamStep xmlStreamStep; typedef xmlStreamStep *xmlStreamStepPtr; struct _xmlStreamStep { int flags; /* properties of that step */ const xmlChar *name; /* first string value if NULL accept all */ const xmlChar *ns; /* second string value */ + int nodeType; /* type of node */ }; typedef struct _xmlStreamComp xmlStreamComp; @@ -690,6 +707,7 @@ rollback: #define CUR (*ctxt->cur) #define SKIP(val) ctxt->cur += (val) #define NXT(val) ctxt->cur[(val)] +#define PEEKPREV(val) ctxt->cur[-(val)] #define CUR_PTR ctxt->cur #define SKIP_BLANKS \ @@ -884,6 +902,7 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { xmlChar *name = NULL; xmlChar *URL = NULL; + SKIP_BLANKS; name = xmlPatScanNCName(ctxt); if (name == NULL) { if (CUR == '*') { @@ -901,6 +920,13 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { xmlChar *prefix = name; NEXT; + + if (IS_BLANK_CH(CUR)) { + ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL); + xmlFree(prefix); + ctxt->error = 1; + goto error; + } /* * This is a namespace match */ @@ -967,25 +993,39 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { xmlChar *token = NULL; xmlChar *name = NULL; xmlChar *URL = NULL; + int hasBlanks = 0; SKIP_BLANKS; if (CUR == '.') { + /* + * Context node. + */ NEXT; PUSH(XML_OP_ELEM, NULL, NULL); return; } + if (CUR == '@') { + /* + * Attribute test. + */ + if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { + ERROR5(NULL, NULL, NULL, + "Unexpected attribute axis in '%s'.\n", ctxt->base); + ctxt->error = 1; + return; + } + NEXT; + xmlCompileAttributeTest(ctxt); + if (ctxt->error != 0) + goto error; + return; + } name = xmlPatScanNCName(ctxt); if (name == NULL) { if (CUR == '*') { NEXT; PUSH(XML_OP_ALL, NULL, NULL); return; - } else if (CUR == '@') { - NEXT; - xmlCompileAttributeTest(ctxt); - if (ctxt->error != 0) - goto error; - return; } else { ERROR(NULL, NULL, NULL, "xmlCompileStepPattern : Name expected\n"); @@ -993,13 +1033,21 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { return; } } - SKIP_BLANKS; + if (IS_BLANK_CH(CUR)) { + hasBlanks = 1; + SKIP_BLANKS; + } if (CUR == ':') { NEXT; if (CUR != ':') { xmlChar *prefix = name; - int i; + int i; + if (hasBlanks || IS_BLANK_CH(CUR)) { + ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL); + ctxt->error = 1; + goto error; + } /* * This is a namespace match */ @@ -1060,6 +1108,11 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { int i; NEXT; + if (IS_BLANK_CH(CUR)) { + ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL); + ctxt->error = 1; + goto error; + } /* * This is a namespace match */ @@ -1104,13 +1157,19 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { } else if (xmlStrEqual(name, (const xmlChar *) "attribute")) { xmlFree(name); name = NULL; + if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { + ERROR5(NULL, NULL, NULL, + "Unexpected attribute axis in '%s'.\n", ctxt->base); + ctxt->error = 1; + goto error; + } xmlCompileAttributeTest(ctxt); if (ctxt->error != 0) goto error; return; } else { - ERROR(NULL, NULL, NULL, - "xmlCompileStepPattern : 'child' or 'attribute' expected\n"); + ERROR5(NULL, NULL, NULL, + "The 'element' or 'attribute' axis is expected.\n", NULL); ctxt->error = 1; goto error; } @@ -1167,20 +1226,41 @@ xmlCompilePathPattern(xmlPatParserContextPtr ctxt) { NEXT; NEXT; NEXT; + /* Check for incompleteness. */ + SKIP_BLANKS; + if (CUR == 0) { + ERROR5(NULL, NULL, NULL, + "Incomplete expression '%s'.\n", ctxt->base); + ctxt->error = 1; + goto error; + } } if (CUR == '@') { NEXT; xmlCompileAttributeTest(ctxt); SKIP_BLANKS; + /* TODO: check for incompleteness */ if (CUR != 0) { xmlCompileStepPattern(ctxt); + if (ctxt->error != 0) + goto error; } } else { if (CUR == '/') { PUSH(XML_OP_ROOT, NULL, NULL); NEXT; + /* Check for incompleteness. */ + SKIP_BLANKS; + if (CUR == 0) { + ERROR5(NULL, NULL, NULL, + "Incomplete expression '%s'.\n", ctxt->base); + ctxt->error = 1; + goto error; + } } xmlCompileStepPattern(ctxt); + if (ctxt->error != 0) + goto error; SKIP_BLANKS; while (CUR == '/') { if (NXT(1) == '/') { @@ -1189,13 +1269,21 @@ xmlCompilePathPattern(xmlPatParserContextPtr ctxt) { NEXT; SKIP_BLANKS; xmlCompileStepPattern(ctxt); + if (ctxt->error != 0) + goto error; } else { PUSH(XML_OP_PARENT, NULL, NULL); NEXT; SKIP_BLANKS; - if (CUR != 0) { - xmlCompileStepPattern(ctxt); + if (CUR == 0) { + ERROR5(NULL, NULL, NULL, + "Incomplete expression '%s'.\n", ctxt->base); + ctxt->error = 1; + goto error; } + xmlCompileStepPattern(ctxt); + if (ctxt->error != 0) + goto error; } } } @@ -1208,6 +1296,107 @@ error: return; } +/** + * xmlCompileIDCXPathPath: + * @ctxt: the compilation context + * + * Compile the Path Pattern and generates a precompiled + * form suitable for fast matching. + * + * [5] Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) + */ +static void +xmlCompileIDCXPathPath(xmlPatParserContextPtr ctxt) { + SKIP_BLANKS; + if (CUR == '/') { + ERROR5(NULL, NULL, NULL, + "Unexpected selection of the document root in '%s'.\n", + ctxt->base); + goto error; + } + ctxt->comp->flags |= PAT_FROM_CUR; + + if (CUR == '.') { + /* "." - "self::node()" */ + NEXT; + SKIP_BLANKS; + if (CUR == 0) { + /* + * Selection of the context node. + */ + PUSH(XML_OP_ELEM, NULL, NULL); + return; + } + if (CUR != '/') { + /* TODO: A more meaningful error message. */ + ERROR5(NULL, NULL, NULL, + "Unexpected token after '.' in '%s'.\n", ctxt->base); + goto error; + } + /* "./" - "self::node()/" */ + NEXT; + SKIP_BLANKS; + if (CUR == '/') { + if (IS_BLANK_CH(PEEKPREV(1))) { + /* + * Disallow "./ /" + */ + ERROR5(NULL, NULL, NULL, + "Unexpected '/' token in '%s'.\n", ctxt->base); + goto error; + } + /* ".//" - "self:node()/descendant-or-self::node()/" */ + PUSH(XML_OP_ANCESTOR, NULL, NULL); + NEXT; + SKIP_BLANKS; + } + if (CUR == 0) + goto error_unfinished; + } + /* + * Process steps. + */ + do { + xmlCompileStepPattern(ctxt); + if (ctxt->error != 0) + goto error; + SKIP_BLANKS; + if (CUR != '/') + break; + PUSH(XML_OP_PARENT, NULL, NULL); + NEXT; + SKIP_BLANKS; + if (CUR == '/') { + /* + * Disallow subsequent '//'. + */ + ERROR5(NULL, NULL, NULL, + "Unexpected subsequent '//' in '%s'.\n", + ctxt->base); + goto error; + } + if (CUR == 0) + goto error_unfinished; + + } while (CUR != 0); + + if (CUR != 0) { + ERROR5(NULL, NULL, NULL, + "Failed to compile expression '%s'.\n", ctxt->base); + ctxt->error = 1; + } + return; +error: + ctxt->error = 1; + return; + +error_unfinished: + ctxt->error = 1; + ERROR5(NULL, NULL, NULL, + "Unfinished expression '%s'.\n", ctxt->base); + return; +} + /************************************************************************ * * * The streaming code * @@ -1334,7 +1523,7 @@ xmlFreeStreamComp(xmlStreamCompPtr comp) { */ static int xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, - const xmlChar *ns, int flags) { + const xmlChar *ns, int nodeType, int flags) { xmlStreamStepPtr cur; if (comp->nbStep >= comp->maxStep) { @@ -1352,6 +1541,7 @@ xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, cur->flags = flags; cur->name = name; cur->ns = ns; + cur->nodeType = nodeType; return(comp->nbStep - 1); } @@ -1366,7 +1556,8 @@ xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, static int xmlStreamCompile(xmlPatternPtr comp) { xmlStreamCompPtr stream; - int i, s = 0, root = 0, flags = 0; + int i, s = 0, root = 0, flags = 0, prevs = -1; + xmlStepOp step; if ((comp == NULL) || (comp->steps == NULL)) return(-1); @@ -1380,6 +1571,8 @@ xmlStreamCompile(xmlPatternPtr comp) { stream = xmlNewStreamComp(0); if (stream == NULL) return(-1); + /* Note that the stream will have no steps in this case. */ + stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE; comp->stream = stream; return(0); } @@ -1392,19 +1585,13 @@ xmlStreamCompile(xmlPatternPtr comp) { xmlDictReference(stream->dict); } - /* - * Skip leading ./ on relative paths - */ - i = 0; - while ((comp->flags & PAT_FROM_CUR) && (comp->nbStep > i + 2) && - (comp->steps[i].op == XML_OP_ELEM) && - (comp->steps[i].value == NULL) && - (comp->steps[i].value2 == NULL) && - (comp->steps[i + 1].op == XML_OP_PARENT)) { - i += 2; - } + i = 0; + if (comp->flags & PAT_FROM_ROOT) + stream->flags |= XML_STREAM_FROM_ROOT; + for (;i < comp->nbStep;i++) { - switch (comp->steps[i].op) { + step = comp->steps[i]; + switch (step.op) { case XML_OP_END: break; case XML_OP_ROOT: @@ -1413,51 +1600,95 @@ xmlStreamCompile(xmlPatternPtr comp) { root = 1; break; case XML_OP_NS: - s = xmlStreamCompAddStep(stream, NULL, - comp->steps[i].value, flags); - flags = 0; + s = xmlStreamCompAddStep(stream, NULL, step.value, + XML_ELEMENT_NODE, flags); if (s < 0) goto error; + prevs = s; + flags = 0; break; case XML_OP_ATTR: flags |= XML_STREAM_STEP_ATTR; - s = xmlStreamCompAddStep(stream, comp->steps[i].value, - comp->steps[i].value2, flags); + prevs = -1; + s = xmlStreamCompAddStep(stream, + step.value, step.value2, XML_ATTRIBUTE_NODE, flags); flags = 0; if (s < 0) goto error; break; - case XML_OP_ELEM: - if ((comp->steps[i].value == NULL) && - (comp->steps[i].value2 == NULL) && - (comp->nbStep > i + 2) && - (comp->steps[i + 1].op == XML_OP_PARENT)) { - i++; - continue; - } + case XML_OP_ELEM: + if ((step.value == NULL) && (step.value2 == NULL)) { + /* + * We have a "." or "self::node()" here. + * Eliminate redundant self::node() tests like in "/./." + * or "//./" + * The only case we won't eliminate is "//.", i.e. if + * self::node() is the last node test and we had + * continuation somewhere beforehand. + */ + if ((comp->nbStep == i + 1) && + (flags & XML_STREAM_STEP_DESC)) { + /* + * Mark the special case where the expression resolves + * to any type of node. + */ + if (comp->nbStep == i + 1) { + stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE; + } + flags |= XML_STREAM_STEP_NODE; + s = xmlStreamCompAddStep(stream, NULL, NULL, + XML_STREAM_ANY_NODE, flags); + if (s < 0) + goto error; + flags = 0; + /* + * If there was a previous step, mark it to be added to + * the result node-set; this is needed since only + * the last step will be marked as "final" and only + * "final" nodes are added to the resulting set. + */ + if (prevs != -1) { + stream->steps[prevs].flags |= XML_STREAM_STEP_IN_SET; + prevs = -1; + } + break; + + } else { + /* Just skip this one. */ + continue; + } + } + /* An element node. */ + s = xmlStreamCompAddStep(stream, step.value, step.value2, + XML_ELEMENT_NODE, flags); + if (s < 0) + goto error; + prevs = s; + flags = 0; + break; case XML_OP_CHILD: - s = xmlStreamCompAddStep(stream, comp->steps[i].value, - comp->steps[i].value2, flags); - flags = 0; + /* An element node child. */ + s = xmlStreamCompAddStep(stream, step.value, step.value2, + XML_ELEMENT_NODE, flags); if (s < 0) goto error; + prevs = s; + flags = 0; break; case XML_OP_ALL: - s = xmlStreamCompAddStep(stream, NULL, NULL, flags); - flags = 0; + s = xmlStreamCompAddStep(stream, NULL, NULL, + XML_ELEMENT_NODE, flags); if (s < 0) goto error; + prevs = s; + flags = 0; break; - case XML_OP_PARENT: - if ((comp->nbStep > i + 1) && - (comp->steps[i + 1].op == XML_OP_ELEM) && - (comp->steps[i + 1].value == NULL) && - (comp->steps[i + 1].value2 == NULL)) { - i++; - continue; - } + case XML_OP_PARENT: break; case XML_OP_ANCESTOR: + /* Skip redundant continuations. */ + if (flags & XML_STREAM_STEP_DESC) + break; flags |= XML_STREAM_STEP_DESC; /* * Mark the expression as having "//". @@ -1481,6 +1712,8 @@ xmlStreamCompile(xmlPatternPtr comp) { stream->steps[0].flags |= XML_STREAM_STEP_DESC; } } + if (stream->nbStep <= s) + goto error; stream->steps[s].flags |= XML_STREAM_STEP_FINAL; if (root) stream->steps[0].flags |= XML_STREAM_STEP_ROOT; @@ -1603,7 +1836,7 @@ xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) { static int xmlStreamPushInternal(xmlStreamCtxtPtr stream, const xmlChar *name, const xmlChar *ns, - xmlElementType nodeType) { + int nodeType) { int ret = 0, err = 0, final = 0, tmp, i, m, match, step, desc; xmlStreamCompPtr comp; #ifdef DEBUG_STREAMING @@ -1615,16 +1848,34 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, while (stream != NULL) { comp = stream->comp; - if ((name == NULL) && (ns == NULL)) { + + if ((nodeType == XML_ELEMENT_NODE) && + (name == NULL) && (ns == NULL)) { + /* We have a document node here (or a reset). */ stream->nbState = 0; stream->level = 0; stream->blockLevel = -1; - if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) { - tmp = xmlStreamCtxtAddState(stream, 0, 0); - if (tmp < 0) - err++; - if (comp->nbStep == 0) + if (comp->flags & XML_STREAM_FROM_ROOT) { + if (comp->nbStep == 0) { + /* TODO: We have a "/." here? */ ret = 1; + } else { + if ((comp->nbStep == 1) && + (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) && + (comp->steps[0].flags & XML_STREAM_STEP_DESC)) + { + /* + * In the case of "//." the document node will match + * as well. + */ + ret = 1; + } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) { + /* TODO: Do we need this ? */ + tmp = xmlStreamCtxtAddState(stream, 0, 0); + if (tmp < 0) + err++; + } + } } stream = stream->next; continue; /* while */ @@ -1647,7 +1898,7 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, * or traditional XPath expressions, this will match if * we are at the first level only, otherwise on every level. */ - if ((nodeType == XML_ELEMENT_NODE) && + if ((nodeType != XML_ATTRIBUTE_NODE) && (((stream->flags & XML_PATTERN_NOTPATTERN) == 0) || (stream->level == 0))) { ret = 1; @@ -1662,6 +1913,19 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, stream->level++; goto stream_next; } + + if ((nodeType != XML_ELEMENT_NODE) && + (nodeType != XML_ATTRIBUTE_NODE) && + ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) { + /* + * No need to process nodes of other types if we don't + * resolve to those types. + * TODO: Do we need to block the context here? + */ + stream->level++; + goto stream_next; + } + /* * Check evolution of existing states */ @@ -1710,14 +1974,24 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, /* * Check for correct node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && - ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0)) - goto next_state; + if (comp->steps[step].nodeType != nodeType) { + if (comp->steps[step].nodeType == XML_ATTRIBUTE_NODE) { + /* + * Block this expression for deeper evaluation. + */ + if ((comp->flags & XML_STREAM_DESC) == 0) + stream->blockLevel = stream->level +1; + goto next_state; + } else if (comp->steps[step].nodeType != XML_STREAM_ANY_NODE) + goto next_state; + } /* * Compare local/namespace-name. */ match = 0; - if (comp->dict) { + if (comp->steps[step].nodeType == XML_STREAM_ANY_NODE) { + match = 1; + } else if (comp->dict) { if (comp->steps[step].name == NULL) { if (comp->steps[step].ns == NULL) match = 1; @@ -1756,7 +2030,15 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, stream->level + 1); } } - } + if ((ret != 1) && + (comp->steps[step].flags & XML_STREAM_STEP_IN_SET)) { + /* + * Check if we have a special case like "foo/bar//.", where + * "foo" is selected as well. + */ + ret = 1; + } + } if (((comp->flags & XML_STREAM_DESC) == 0) && ((! match) || final)) { /* @@ -1774,6 +2056,8 @@ next_state: /* * Re/enter the expression. + * Don't reenter if it's an absolute expression like "/foo", + * except "//foo". */ if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) goto stream_next; @@ -1816,14 +2100,19 @@ compare: /* * Check expected node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && - ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0)) - goto stream_next; + if (comp->steps[0].nodeType != nodeType) { + if (nodeType == XML_ATTRIBUTE_NODE) + goto stream_next; + else if (comp->steps[0].nodeType != XML_STREAM_ANY_NODE) + goto stream_next; + } /* * Compare local/namespace-name. */ match = 0; - if (comp->steps[0].name == NULL) { + if (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) { + match = 1; + } else if (comp->steps[0].name == NULL) { if (comp->steps[0].ns == NULL) match = 1; else { @@ -1840,12 +2129,20 @@ compare: match = ((xmlStrEqual(comp->steps[0].name, name)) && (xmlStrEqual(comp->steps[0].ns, ns))); } - if (match) { - final = comp->steps[0].flags & XML_STREAM_STEP_FINAL; + final = comp->steps[0].flags & XML_STREAM_STEP_FINAL; + if (match) { if (final) ret = 1; else xmlStreamCtxtAddState(stream, 1, stream->level); + if ((ret != 1) && + (comp->steps[0].flags & XML_STREAM_STEP_IN_SET)) { + /* + * Check if we have a special case like "foo//.", where + * "foo" is selected as well. + */ + ret = 1; + } } if (((comp->flags & XML_STREAM_DESC) == 0) && ((! match) || final)) { @@ -1855,7 +2152,7 @@ compare: */ stream->blockLevel = stream->level; } - + stream_next: stream = stream->next; } /* while stream != NULL */ @@ -1879,6 +2176,7 @@ stream_next: * to come from the dictionary. * Both @name and @ns being NULL means the / i.e. the root of the document. * This can also act as a reset. + * Otherwise the function will act as if it has been given an element-node. * * Returns: -1 in case of error, 1 if the current state in the stream is a * match and 0 otherwise. @@ -1886,7 +2184,35 @@ stream_next: int xmlStreamPush(xmlStreamCtxtPtr stream, const xmlChar *name, const xmlChar *ns) { - return (xmlStreamPushInternal(stream, name, ns, XML_ELEMENT_NODE)); + return (xmlStreamPushInternal(stream, name, ns, (int) XML_ELEMENT_NODE)); +} + +/** + * xmlStreamPushNode: + * @stream: the stream context + * @name: the current name + * @ns: the namespace name + * @nodeType: the type of the node being pushed + * + * Push new data onto the stream. NOTE: if the call xmlPatterncompile() + * indicated a dictionary, then strings for name and ns will be expected + * to come from the dictionary. + * Both @name and @ns being NULL means the / i.e. the root of the document. + * This can also act as a reset. + * Different from xmlStreamPush() this function can be fed with nodes of type: + * element-, attribute-, text-, cdata-section-, comment- and + * processing-instruction-node. + * + * Returns: -1 in case of error, 1 if the current state in the stream is a + * match and 0 otherwise. + */ +int +xmlStreamPushNode(xmlStreamCtxtPtr stream, + const xmlChar *name, const xmlChar *ns, + int nodeType) +{ + return (xmlStreamPushInternal(stream, name, ns, + nodeType)); } /** @@ -1900,6 +2226,7 @@ xmlStreamPush(xmlStreamCtxtPtr stream, * to come from the dictionary. * Both @name and @ns being NULL means the / i.e. the root of the document. * This can also act as a reset. +* Otherwise the function will act as if it has been given an attribute-node. * * Returns: -1 in case of error, 1 if the current state in the stream is a * match and 0 otherwise. @@ -1907,7 +2234,7 @@ xmlStreamPush(xmlStreamCtxtPtr stream, int xmlStreamPushAttr(xmlStreamCtxtPtr stream, const xmlChar *name, const xmlChar *ns) { - return (xmlStreamPushInternal(stream, name, ns, XML_ATTRIBUTE_NODE)); + return (xmlStreamPushInternal(stream, name, ns, (int) XML_ATTRIBUTE_NODE)); } /** @@ -1921,11 +2248,9 @@ xmlStreamPushAttr(xmlStreamCtxtPtr stream, int xmlStreamPop(xmlStreamCtxtPtr stream) { int i, lev; - int ret; - + if (stream == NULL) return(-1); - ret = 0; while (stream != NULL) { /* * Reset block-level. @@ -1935,7 +2260,7 @@ xmlStreamPop(xmlStreamCtxtPtr stream) { stream->level--; if (stream->level < 0) - ret = -1; + return(-1); /* * Check evolution of existing states */ @@ -1952,6 +2277,31 @@ xmlStreamPop(xmlStreamCtxtPtr stream) { return(0); } +/** + * xmlStreamWantsAnyNode: + * @streamCtxt: the stream context + * + * Query if the streaming pattern additionally needs to be fed with + * text-, cdata-section-, comment- and processing-instruction-nodes. + * If the result is 0 then only element-nodes and attribute-nodes + * need to be pushed. + * + * Returns: 1 in case of need of nodes of the above described types, + * 0 otherwise. -1 on API errors. + */ +int +xmlStreamWantsAnyNode(xmlStreamCtxtPtr streamCtxt) +{ + if (streamCtxt == NULL) + return(-1); + while (streamCtxt != NULL) { + if (streamCtxt->comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) + return(1); + streamCtxt = streamCtxt->next; + } + return(0); +} + /************************************************************************ * * * The public interfaces * @@ -2008,7 +2358,10 @@ xmlPatterncompile(const xmlChar *pattern, xmlDict *dict, int flags, cur->flags = flags; ctxt->comp = cur; - xmlCompilePathPattern(ctxt); + if (XML_STREAM_XS_IDC(cur)) + xmlCompileIDCXPathPath(ctxt); + else + xmlCompilePathPattern(ctxt); if (ctxt->error != 0) goto error; xmlFreePatParserContext(ctxt); diff --git a/python/libxml.py b/python/libxml.py index 86bdd92..0c2a19a 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -211,7 +211,8 @@ class SAXCallback: pass def warning(self, msg): - print msg + #print msg + pass def error(self, msg): raise parserError(msg) diff --git a/python/libxml2-py.c b/python/libxml2-py.c index b656d7f..b5bf52f 100644 --- a/python/libxml2-py.c +++ b/python/libxml2-py.c @@ -1497,15 +1497,15 @@ libxml_xmlSchemaValidateDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { int c_retval; xmlSchemaValidCtxtPtr ctxt; PyObject *pyobj_ctxt; - xmlDocPtr doc; - PyObject *pyobj_doc; + xmlDocPtr instance; + PyObject *pyobj_instance; - if (!PyArg_ParseTuple(args, (char *)"OO:xmlSchemaValidateDoc", &pyobj_ctxt, &pyobj_doc)) + if (!PyArg_ParseTuple(args, (char *)"OO:xmlSchemaValidateDoc", &pyobj_ctxt, &pyobj_instance)) return(NULL); ctxt = (xmlSchemaValidCtxtPtr) PySchemaValidCtxt_Get(pyobj_ctxt); - doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc); + instance = (xmlDocPtr) PyxmlNode_Get(pyobj_instance); - c_retval = xmlSchemaValidateDoc(ctxt, doc); + c_retval = xmlSchemaValidateDoc(ctxt, instance); py_retval = libxml_intWrap((int) c_retval); return(py_retval); } @@ -5874,6 +5874,21 @@ libxml_xmlUCSIsTibetan(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_UNICODE_ENABLED) */ +PyObject * +libxml_xmlUTF8Strndup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + xmlChar * c_retval; + xmlChar * utf; + int len; + + if (!PyArg_ParseTuple(args, (char *)"zi:xmlUTF8Strndup", &utf, &len)) + return(NULL); + + c_retval = xmlUTF8Strndup(utf, len); + py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); + return(py_retval); +} + #if defined(LIBXML_LEGACY_ENABLED) PyObject * libxml_xmlNewGlobalNs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -7689,6 +7704,28 @@ libxml_xmlReaderNewMemory(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_READER_ENABLED) */ +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +PyObject * +libxml_xmlTextReaderSchemaValidateCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + xmlTextReaderPtr reader; + PyObject *pyobj_reader; + xmlSchemaValidCtxtPtr ctxt; + PyObject *pyobj_ctxt; + int options; + + if (!PyArg_ParseTuple(args, (char *)"OOi:xmlTextReaderSchemaValidateCtxt", &pyobj_reader, &pyobj_ctxt, &options)) + return(NULL); + reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader); + ctxt = (xmlSchemaValidCtxtPtr) PySchemaValidCtxt_Get(pyobj_ctxt); + + c_retval = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); +} + +#endif /* defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) PyObject * libxml_xmlNewProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -7783,7 +7820,7 @@ libxml_htmlInitAutoClose(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBU } #endif /* defined(LIBXML_HTML_ENABLED) */ -#if defined(LIBXML_READER_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) PyObject * libxml_xmlTextReaderReadOuterXml(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -7800,7 +7837,7 @@ libxml_xmlTextReaderReadOuterXml(PyObject *self ATTRIBUTE_UNUSED, PyObject *args return(py_retval); } -#endif /* defined(LIBXML_READER_ENABLED) */ +#endif /* defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) */ #if defined(LIBXML_UNICODE_ENABLED) PyObject * libxml_xmlUCSIsTamil(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -10749,21 +10786,6 @@ libxml_xmlIsRef(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } -PyObject * -libxml_xmlUTF8Strndup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - xmlChar * c_retval; - xmlChar * utf; - int len; - - if (!PyArg_ParseTuple(args, (char *)"zi:xmlUTF8Strndup", &utf, &len)) - return(NULL); - - c_retval = xmlUTF8Strndup(utf, len); - py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); - return(py_retval); -} - #if defined(LIBXML_XPATH_ENABLED) PyObject * libxml_xmlXPathGetContextDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -12028,20 +12050,6 @@ libxml_xmlNodeSetContent(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(Py_None); } -PyObject * -libxml_xmlUnlinkNode(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - xmlNodePtr cur; - PyObject *pyobj_cur; - - if (!PyArg_ParseTuple(args, (char *)"O:xmlUnlinkNode", &pyobj_cur)) - return(NULL); - cur = (xmlNodePtr) PyxmlNode_Get(pyobj_cur); - - xmlUnlinkNode(cur); - Py_INCREF(Py_None); - return(Py_None); -} - #if defined(LIBXML_DEBUG_ENABLED) PyObject * libxml_xmlBoolToText(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -13675,7 +13683,7 @@ libxml_xmlDictCleanup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_ return(Py_None); } -#if defined(LIBXML_READER_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) PyObject * libxml_xmlTextReaderReadInnerXml(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -13692,7 +13700,7 @@ libxml_xmlTextReaderReadInnerXml(PyObject *self ATTRIBUTE_UNUSED, PyObject *args return(py_retval); } -#endif /* defined(LIBXML_READER_ENABLED) */ +#endif /* defined(LIBXML_READER_ENABLED) && defined(LIBXML_WRITER_ENABLED) */ PyObject * libxml_xmlThrDefKeepBlanksDefaultValue(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -14075,6 +14083,20 @@ libxml_xmlURISetUser(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(Py_None); } +PyObject * +libxml_xmlUnlinkNode(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + xmlNodePtr cur; + PyObject *pyobj_cur; + + if (!PyArg_ParseTuple(args, (char *)"O:xmlUnlinkNode", &pyobj_cur)) + return(NULL); + cur = (xmlNodePtr) PyxmlNode_Get(pyobj_cur); + + xmlUnlinkNode(cur); + Py_INCREF(Py_None); + return(Py_None); +} + PyObject * libxml_xmlCreateEntityParserCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; diff --git a/python/setup.py b/python/setup.py index ff06a9c..a41ab3f 100755 --- a/python/setup.py +++ b/python/setup.py @@ -226,7 +226,7 @@ else: setup (name = "libxml2-python", # On *nix, the version number is created from setup.py.in # On windows, it is set by configure.js - version = "2.6.22", + version = "2.6.23", description = descr, author = "Daniel Veillard", author_email = "veillard@redhat.com", diff --git a/relaxng.c b/relaxng.c index be5ee99..7e92057 100644 --- a/relaxng.c +++ b/relaxng.c @@ -7331,7 +7331,6 @@ xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, xmlDocPtr doc) * * parse a schema definition resource and build an internal * XML Shema struture which can be used to validate instances. - * *WARNING* this interface is highly subject to change * * Returns the internal XML RelaxNG structure built from the resource or * NULL in case of error diff --git a/result/HTML/53867.html b/result/HTML/53867.html new file mode 100644 index 0000000..acdad7c --- /dev/null +++ b/result/HTML/53867.html @@ -0,0 +1,66 @@ + + diff --git a/result/HTML/53867.html.err b/result/HTML/53867.html.err new file mode 100644 index 0000000..e69de29 diff --git a/result/HTML/53867.html.sax b/result/HTML/53867.html.sax new file mode 100644 index 0000000..81a9f15 --- /dev/null +++ b/result/HTML/53867.html.sax @@ -0,0 +1,26 @@ +SAX.setDocumentLocator() +SAX.startDocument() +SAX.startElement(html) +SAX.ignorableWhitespace( +, 1) +SAX.startElement(head) +SAX.ignorableWhitespace( +, 1) +SAX.startElement(style) +SAX.cdata( +....... +....................., 1000) +SAX.cdata(.............................., 1000) +SAX.cdata(.............................., 1000) +SAX.cdata(................ +............., 977) +SAX.endElement(style) +SAX.ignorableWhitespace( +, 1) +SAX.endElement(head) +SAX.ignorableWhitespace( +, 1) +SAX.endElement(html) +SAX.ignorableWhitespace( +, 1) +SAX.endDocument() diff --git a/result/XPath/tests/nodespat b/result/XPath/tests/nodespat new file mode 100644 index 0000000..1efd87f --- /dev/null +++ b/result/XPath/tests/nodespat @@ -0,0 +1,94 @@ + +======================== +Expression: /. +Object is a Node Set : +Set contains 1 nodes: +1 / + +======================== +Expression: //. +Object is a Node Set : +Set contains 12 nodes: +1 / +2 ELEMENT root +3 ELEMENT foo +4 TEXT + content=txt +5 COMMENT + content=hello +6 CDATA_SECTION + content=data +7 PI target + content=data +8 ELEMENT bar +9 TEXT + content=txt +10 COMMENT + content=hello +11 CDATA_SECTION + content=data +12 PI target + content=data + +======================== +Expression: /root//. +Object is a Node Set : +Set contains 11 nodes: +1 ELEMENT root +2 ELEMENT foo +3 TEXT + content=txt +4 COMMENT + content=hello +5 CDATA_SECTION + content=data +6 PI target + content=data +7 ELEMENT bar +8 TEXT + content=txt +9 COMMENT + content=hello +10 CDATA_SECTION + content=data +11 PI target + content=data + +======================== +Expression: //.//./././/. +Object is a Node Set : +Set contains 12 nodes: +1 / +2 ELEMENT root +3 ELEMENT foo +4 TEXT + content=txt +5 COMMENT + content=hello +6 CDATA_SECTION + content=data +7 PI target + content=data +8 ELEMENT bar +9 TEXT + content=txt +10 COMMENT + content=hello +11 CDATA_SECTION + content=data +12 PI target + content=data + +======================== +Expression: /root//././/bar//. +Object is a Node Set : +Set contains 5 nodes: +1 ELEMENT bar +2 TEXT + content=txt +3 COMMENT + content=hello +4 CDATA_SECTION + content=data +5 PI target + content=data diff --git a/result/c14n/exc-without-comments/test-2 b/result/c14n/exc-without-comments/test-2 new file mode 100644 index 0000000..0b8a0cb --- /dev/null +++ b/result/c14n/exc-without-comments/test-2 @@ -0,0 +1,11 @@ + + + + + + + + + sj1VXDB2VMCU5qmva2OtDw3kKOs= + + \ No newline at end of file diff --git a/result/noent/ns7 b/result/noent/ns7 new file mode 100644 index 0000000..b5089e1 --- /dev/null +++ b/result/noent/ns7 @@ -0,0 +1,2 @@ + + diff --git a/result/ns7 b/result/ns7 new file mode 100644 index 0000000..b5089e1 --- /dev/null +++ b/result/ns7 @@ -0,0 +1,2 @@ + + diff --git a/result/ns7.rde b/result/ns7.rde new file mode 100644 index 0000000..16f5351 --- /dev/null +++ b/result/ns7.rde @@ -0,0 +1 @@ +0 1 xml:test 1 0 diff --git a/result/ns7.rdr b/result/ns7.rdr new file mode 100644 index 0000000..16f5351 --- /dev/null +++ b/result/ns7.rdr @@ -0,0 +1 @@ +0 1 xml:test 1 0 diff --git a/result/ns7.sax b/result/ns7.sax new file mode 100644 index 0000000..6020be9 --- /dev/null +++ b/result/ns7.sax @@ -0,0 +1,5 @@ +SAX.setDocumentLocator() +SAX.startDocument() +SAX.startElement(xml:test) +SAX.endElement(xml:test) +SAX.endDocument() diff --git a/result/ns7.sax2 b/result/ns7.sax2 new file mode 100644 index 0000000..2a2c714 --- /dev/null +++ b/result/ns7.sax2 @@ -0,0 +1,5 @@ +SAX.setDocumentLocator() +SAX.startDocument() +SAX.startElementNs(test, xml, 'http://www.w3.org/XML/1998/namespace', 0, 0, 0) +SAX.endElementNs(test, xml, 'http://www.w3.org/XML/1998/namespace') +SAX.endDocument() diff --git a/result/regexp/* b/result/regexp/* deleted file mode 100644 index b730347..0000000 --- a/result/regexp/* +++ /dev/null @@ -1 +0,0 @@ -Ops: 0 nodes, 0 cons diff --git a/result/regexp/hard b/result/regexp/hard index f348c08..28d6164 100644 --- a/result/regexp/hard +++ b/result/regexp/hard @@ -5,3 +5,8 @@ aaabbbb: Ok a0b: Ok aa0aaa: Fail b0aaa: Ok +Regexp: (\d{1,3}\.){3}\d{1,3} +1.2.3.4: Ok +1.22.333.44: Ok +1.2.3: Fail +1..2.3: Fail diff --git a/result/schemas/bug303566_1_1.err b/result/schemas/bug303566_1_1.err index 43515ea..9156981 100644 --- a/result/schemas/bug303566_1_1.err +++ b/result/schemas/bug303566_1_1.err @@ -1 +1 @@ -./test/schemas/bug303566_1.xml:9: Schemas validity error : Element 'Part': No match found for key-sequence ['B'] of key reference 'PartRefCountryDummy'. +./test/schemas/bug303566_1.xml:9: Schemas validity error : Element 'Part': No match found for key-sequence ['B'] of keyref 'PartRefCountryDummy'. diff --git a/result/schemas/bug312957_1_0.err b/result/schemas/bug312957_1_0.err index 5ab33fb..5ea089b 100644 --- a/result/schemas/bug312957_1_0.err +++ b/result/schemas/bug312957_1_0.err @@ -1 +1 @@ -./test/schemas/bug312957_0.xml:11: Schemas validity error : Element 'sister': No match found for key-sequence ['annie'] of key reference 'sibling_key_ref'. +./test/schemas/bug312957_0.xml:11: Schemas validity error : Element 'sister': No match found for key-sequence ['annie'] of keyref 'sibling_key_ref'. diff --git a/result/schemas/bug321475_1_0 b/result/schemas/bug321475_1_0 new file mode 100644 index 0000000..f943041 --- /dev/null +++ b/result/schemas/bug321475_1_0 @@ -0,0 +1 @@ +./test/schemas/bug321475_0.xml validates diff --git a/result/schemas/bug321475_1_0.err b/result/schemas/bug321475_1_0.err new file mode 100644 index 0000000..e69de29 diff --git a/result/schemas/bug322411_1_0 b/result/schemas/bug322411_1_0 new file mode 100644 index 0000000..79560fb --- /dev/null +++ b/result/schemas/bug322411_1_0 @@ -0,0 +1 @@ +./test/schemas/bug322411_0.xml validates diff --git a/result/schemas/bug322411_1_0.err b/result/schemas/bug322411_1_0.err new file mode 100644 index 0000000..e69de29 diff --git a/result/schemas/bug323510_1_0 b/result/schemas/bug323510_1_0 new file mode 100644 index 0000000..c33d685 --- /dev/null +++ b/result/schemas/bug323510_1_0 @@ -0,0 +1 @@ +./test/schemas/bug323510_0.xml fails to validate diff --git a/result/schemas/bug323510_1_0.err b/result/schemas/bug323510_1_0.err new file mode 100644 index 0000000..1655070 --- /dev/null +++ b/result/schemas/bug323510_1_0.err @@ -0,0 +1 @@ +./test/schemas/bug323510_0.xml:2: element foo: Schemas validity error : Element 'foo': Missing child element(s). Expected is ( bar ). diff --git a/result/schemas/decimal-1_1_0 b/result/schemas/decimal-1_1_0 new file mode 100644 index 0000000..041b31d --- /dev/null +++ b/result/schemas/decimal-1_1_0 @@ -0,0 +1 @@ +./test/schemas/decimal-1_0.xml fails to validate diff --git a/result/schemas/decimal-1_1_0.err b/result/schemas/decimal-1_1_0.err new file mode 100644 index 0000000..7f4fa9c --- /dev/null +++ b/result/schemas/decimal-1_1_0.err @@ -0,0 +1,8 @@ +./test/schemas/decimal-1_0.xml:16: element val: Schemas validity error : Element 'val': '.' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:17: element val: Schemas validity error : Element 'val': '-' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:18: element val: Schemas validity error : Element 'val': '+' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:19: element val: Schemas validity error : Element 'val': '*' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:20: element val: Schemas validity error : Element 'val': '- 1' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:21: element val: Schemas validity error : Element 'val': '+ 1' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:22: element val: Schemas validity error : Element 'val': '+ 0' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-1_0.xml:23: element val: Schemas validity error : Element 'val': '- 0' is not a valid value of the atomic type 'myDecimal'. diff --git a/result/schemas/decimal-2_1_0 b/result/schemas/decimal-2_1_0 new file mode 100644 index 0000000..f68ca92 --- /dev/null +++ b/result/schemas/decimal-2_1_0 @@ -0,0 +1 @@ +./test/schemas/decimal-2_0.xml fails to validate diff --git a/result/schemas/decimal-2_1_0.err b/result/schemas/decimal-2_1_0.err new file mode 100644 index 0000000..fe663c2 --- /dev/null +++ b/result/schemas/decimal-2_1_0.err @@ -0,0 +1,4 @@ +./test/schemas/decimal-2_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-0.1' is less than the minimum value allowed ('0'). +./test/schemas/decimal-2_0.xml:12: element val: Schemas validity error : Element 'val': '-0.1' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-2_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-1' is less than the minimum value allowed ('0'). +./test/schemas/decimal-2_0.xml:13: element val: Schemas validity error : Element 'val': '-1' is not a valid value of the atomic type 'myDecimal'. diff --git a/result/schemas/decimal-3_1_0 b/result/schemas/decimal-3_1_0 new file mode 100644 index 0000000..5601535 --- /dev/null +++ b/result/schemas/decimal-3_1_0 @@ -0,0 +1 @@ +./test/schemas/decimal-3_0.xml fails to validate diff --git a/result/schemas/decimal-3_1_0.err b/result/schemas/decimal-3_1_0.err new file mode 100644 index 0000000..bba8cf9 --- /dev/null +++ b/result/schemas/decimal-3_1_0.err @@ -0,0 +1,8 @@ +./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.123' has more digits than are allowed ('2'). +./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': '0.123' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.023' has more digits than are allowed ('2'). +./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': '0.023' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '123' has more digits than are allowed ('2'). +./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': '123' is not a valid value of the atomic type 'myDecimal'. +./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '12.3' has more digits than are allowed ('2'). +./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': '12.3' is not a valid value of the atomic type 'myDecimal'. diff --git a/result/schemas/derivation-ok-extension-err_0_0.err b/result/schemas/derivation-ok-extension-err_0_0.err index 164c1f3..a0fba52 100644 --- a/result/schemas/derivation-ok-extension-err_0_0.err +++ b/result/schemas/derivation-ok-extension-err_0_0.err @@ -1 +1 @@ -./test/schemas/derivation-ok-extension-err_0.xsd:9: element attribute: Schemas parser error : local complex type, attribute decl. 'barA_1': Duplicate attribute use specified. +./test/schemas/derivation-ok-extension-err_0.xsd:6: element complexType: Schemas parser error : local complex type: Duplicate attribute use 'barA_1'. diff --git a/result/schemas/derivation-ok-extension_0_0.err b/result/schemas/derivation-ok-extension_0_0.err index e07739e..1314232 100644 --- a/result/schemas/derivation-ok-extension_0_0.err +++ b/result/schemas/derivation-ok-extension_0_0.err @@ -1 +1 @@ -./test/schemas/derivation-ok-extension_0.xsd:10: element attribute: Schemas parser warning : Element '{http://www.w3.org/2001/XMLSchema}attribute': Attribute use prohibitions are pointless when extending a type. +./test/schemas/derivation-ok-extension_0.xsd:10: element attribute: Schemas parser warning : Element '{http://www.w3.org/2001/XMLSchema}attribute': Skipping attribute use prohibition, since it is pointless when extending a type. diff --git a/result/schemas/derivation-ok-restriction-2-1-1_0_0.err b/result/schemas/derivation-ok-restriction-2-1-1_0_0.err index 49977e4..bd38dd2 100644 --- a/result/schemas/derivation-ok-restriction-2-1-1_0_0.err +++ b/result/schemas/derivation-ok-restriction-2-1-1_0_0.err @@ -1,6 +1,6 @@ -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type: A matching attribute use for the 'required' attribute use 'barB_3' of the base type is missing. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:16: element attribute: Schemas parser error : local complex type, attribute decl. 'barB_1': The 'optional' use is inconsistent with a matching 'required' use of the base type. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:23: element attribute: Schemas parser error : local complex type, attribute decl. 'barC_1': Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:25: element attribute: Schemas parser error : local complex type, attribute decl. 'barC_2': Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:30: element attribute: Schemas parser error : local complex type, attribute decl. 'barD_1': Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:32: element attribute: Schemas parser error : local complex type, attribute decl. 'barD_2': Neither a matching attribute use, nor a matching wildcard in the base type does exist. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type, attribute use 'barB_1': The 'optional' attribute use is inconsistent with the corresponding 'required' attribute use of the base complex type definition '{http://FOO}typeA'. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type, attribute use 'barC_1': Neither a matching attribute use, nor a matching wildcard exists in the base complex type definition '{http://FOO}typeA'. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type, attribute use 'barC_2': Neither a matching attribute use, nor a matching wildcard exists in the base complex type definition '{http://FOO}typeA'. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type, attribute use 'barD_1': Neither a matching attribute use, nor a matching wildcard exists in the base complex type definition '{http://FOO}typeA'. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type, attribute use 'barD_2': Neither a matching attribute use, nor a matching wildcard exists in the base complex type definition '{http://FOO}typeA'. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : local complex type: A matching attribute use for the 'required' attribute use 'barB_3' of the base complex type definition '{http://FOO}typeA' is missing. diff --git a/result/schemas/derivation-ok-restriction-4-1-err_0_0.err b/result/schemas/derivation-ok-restriction-4-1-err_0_0.err index 8cacb07..72283fb 100644 --- a/result/schemas/derivation-ok-restriction-4-1-err_0_0.err +++ b/result/schemas/derivation-ok-restriction-4-1-err_0_0.err @@ -1,3 +1,3 @@ -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:33: element complexType: Schemas parser error : complex type 'type.A': The type has an attribute wildcard, but the base type complex type 'base.type.A' does not have one. -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:45: element complexType: Schemas parser error : complex type 'type.B': The attribute wildcard is not a valid subset of the wildcard in the base type complex type 'base.type.B'. -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:57: element complexType: Schemas parser error : complex type 'type.C': The 'process contents' of the attribute wildcard is weaker than the one in the base type complex type 'base.type.C'. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:33: element complexType: Schemas parser error : complex type 'type.A': The complex type definition has an attribute wildcard, but the base complex type definition '{http://FOO}base.type.A' does not have one. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:45: element complexType: Schemas parser error : complex type 'type.B': The attribute wildcard is not a valid subset of the wildcard in the base complex type definition '{http://FOO}base.type.B'. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:65: element complexType: Schemas parser error : complex type 'base.type.C': The {process contents} of the attribute wildcard is weaker than the one in the base complex type definition '{http://FOO}base.type.C'. diff --git a/result/schemas/element-err_0_0.err b/result/schemas/element-err_0_0.err index 575102c..70524f6 100644 --- a/result/schemas/element-err_0_0.err +++ b/result/schemas/element-err_0_0.err @@ -1,20 +1,20 @@ ./test/schemas/element-err_0.xsd:8: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'name' is required but missing. -./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : element decl. '{http://FOO}foo': The attribute 'ref' is not allowed. -./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : element decl. '{http://FOO}foo': The attribute 'minOccurs' is not allowed. -./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : element decl. '{http://FOO}foo': The attribute 'maxOccurs' is not allowed. -./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : element decl. '{http://FOO}foo': The attribute 'form' is not allowed. +./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'ref' is not allowed. +./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'minOccurs' is not allowed. +./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'maxOccurs' is not allowed. +./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'form' is not allowed. ./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'final': The value 'fantasy' is not valid. Expected is '(#all | List of (extension | restriction))'. ./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'block': The value 'flute' is not valid. Expected is '(#all | List of (extension | restriction | substitution))'. -./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : element decl. '{http://FOO}foo': The attributes 'default' and 'fixed' are mutually exclusive. +./test/schemas/element-err_0.xsd:14: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attributes 'default' and 'fixed' are mutually exclusive. ./test/schemas/element-err_0.xsd:22: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'minOccurs': The value must not be greater than the value of 'maxOccurs'. ./test/schemas/element-err_0.xsd:22: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attributes 'ref' and 'name' are mutually exclusive. ./test/schemas/element-err_0.xsd:22: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'abstract': Only the attributes 'minOccurs', 'maxOccurs' and 'id' are allowed in addition to 'ref'. ./test/schemas/element-err_0.xsd:23: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The content is not valid. Expected is (annotation?). ./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'maxOccurs': The value must be greater than or equal to 1. -./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : element decl. '{http://FOO}myomy': The attribute 'abstract' is not allowed. -./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : element decl. '{http://FOO}myomy': The attribute 'substitutionGroup' is not allowed. -./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : element decl. '{http://FOO}myomy': The attribute 'final' is not allowed. +./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'abstract' is not allowed. +./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'substitutionGroup' is not allowed. +./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'final' is not allowed. ./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'block': The value 'flute' is not valid. Expected is '(#all | List of (extension | restriction | substitution))'. -./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : element decl. '{http://FOO}myomy': The attributes 'default' and 'fixed' are mutually exclusive. -./test/schemas/element-err_0.xsd:31: element complexType: Schemas parser error : element decl. '{http://FOO}myomy': The attribute 'type' and the child are mutually exclusive. -./test/schemas/element-err_0.xsd:32: element simpleType: Schemas parser error : element decl. '{http://FOO}myomy': The content is not valid. Expected is (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*)). +./test/schemas/element-err_0.xsd:30: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attributes 'default' and 'fixed' are mutually exclusive. +./test/schemas/element-err_0.xsd:31: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'type' and the child are mutually exclusive. +./test/schemas/element-err_0.xsd:32: element simpleType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The content is not valid. Expected is (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*)). diff --git a/result/schemas/idc-keyref-err1_1_0 b/result/schemas/idc-keyref-err1_1_0 new file mode 100644 index 0000000..d4333a9 --- /dev/null +++ b/result/schemas/idc-keyref-err1_1_0 @@ -0,0 +1 @@ +./test/schemas/idc-keyref-err1_0.xml fails to validate diff --git a/result/schemas/idc-keyref-err1_1_0.err b/result/schemas/idc-keyref-err1_1_0.err new file mode 100644 index 0000000..8e9cb20 --- /dev/null +++ b/result/schemas/idc-keyref-err1_1_0.err @@ -0,0 +1 @@ +./test/schemas/idc-keyref-err1_0.xml:12: Schemas validity error : Element '{urn:test:foo}Ref': No match found for key-sequence ['L4'] of keyref '{urn:test:foo}LinkKeyRef'. diff --git a/result/schemas/include3_0_0.err b/result/schemas/include3_0_0.err index 59d7d1d..27bb5d0 100644 --- a/result/schemas/include3_0_0.err +++ b/result/schemas/include3_0_0.err @@ -1 +1 @@ -./test/schemas/include3_0.xsd:7: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': A global element declaration with the name 'bar' does already exist. +test/schemas/include3_0.inc:4: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': A global element declaration '{http://FOO}bar' does already exist. diff --git a/result/schemas/restriction-attr1_0_0.err b/result/schemas/restriction-attr1_0_0.err index c08d41d..cdf003d 100644 --- a/result/schemas/restriction-attr1_0_0.err +++ b/result/schemas/restriction-attr1_0_0.err @@ -1 +1 @@ -./test/schemas/restriction-attr1_0.xsd:8: element attribute: Schemas parser error : local complex type, attribute decl. 'barA': The 'optional' use is inconsistent with a matching 'required' use of the base type. +./test/schemas/restriction-attr1_0.xsd:5: element complexType: Schemas parser error : local complex type, attribute use 'barA': The 'optional' attribute use is inconsistent with the corresponding 'required' attribute use of the base complex type definition '{http://FOO}typeA'. diff --git a/result/schemas/scc-no-xmlns_0_0.err b/result/schemas/scc-no-xmlns_0_0.err index fe882be..aad2b68 100644 --- a/result/schemas/scc-no-xmlns_0_0.err +++ b/result/schemas/scc-no-xmlns_0_0.err @@ -1 +1 @@ -./test/schemas/scc-no-xmlns_0.xsd:7: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'name': The value of type 'xs:NCName' must not match 'xmlns'. +./test/schemas/scc-no-xmlns_0.xsd:7: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'name': The value of the attribute must not match 'xmlns'. diff --git a/result/schemas/scc-no-xsi_0_0.err b/result/schemas/scc-no-xsi_0_0.err index a57132c..e04e3e4 100644 --- a/result/schemas/scc-no-xsi_0_0.err +++ b/result/schemas/scc-no-xsi_0_0.err @@ -1 +1 @@ -./test/schemas/scc-no-xsi_0.xsd:7: element attribute: Schemas parser error : attribute decl. '{http://www.w3.org/2001/XMLSchema-instance}bar': The target namespace must not match 'http://www.w3.org/2001/XMLSchema-instance'. +./test/schemas/scc-no-xsi_0.xsd:7: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The target namespace must not match 'http://www.w3.org/2001/XMLSchema-instance'. diff --git a/result/schemas/src-attribute1_0_0.err b/result/schemas/src-attribute1_0_0.err index ceafdbe..368d97c 100644 --- a/result/schemas/src-attribute1_0_0.err +++ b/result/schemas/src-attribute1_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute1_0.xsd:9: element attribute: Schemas parser error : attribute decl. 'bar': The attributes 'default' and 'fixed' are mutually exclusive. +./test/schemas/src-attribute1_0.xsd:9: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The attributes 'default' and 'fixed' are mutually exclusive. diff --git a/result/schemas/src-attribute2_0_0.err b/result/schemas/src-attribute2_0_0.err index 7206544..ac6df6f 100644 --- a/result/schemas/src-attribute2_0_0.err +++ b/result/schemas/src-attribute2_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute2_0.xsd:9: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'use': The value must be 'optional' if the attribute 'default' is present as well. +./test/schemas/src-attribute2_0.xsd:9: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The value of the attribute 'use' must be 'optional' if the attribute 'default' is present. diff --git a/result/schemas/src-attribute3-1_0_0.err b/result/schemas/src-attribute3-1_0_0.err index 6cf4404..3345b3c 100644 --- a/result/schemas/src-attribute3-1_0_0.err +++ b/result/schemas/src-attribute3-1_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute3-1_0.xsd:9: element attribute: Schemas parser error : attribute use '{http://foo}bar': The attributes 'ref' and 'name' are mutually exclusive. +./test/schemas/src-attribute3-1_0.xsd:9: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The attribute 'name' is not allowed. diff --git a/result/schemas/src-attribute3-2-form_0_0.err b/result/schemas/src-attribute3-2-form_0_0.err index 5b3c7db..ad3667b 100644 --- a/result/schemas/src-attribute3-2-form_0_0.err +++ b/result/schemas/src-attribute3-2-form_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute3-2-form_0.xsd:10: element attribute: Schemas parser error : attribute use '{http://foo}bar': The attribute 'form' is not allowed. +./test/schemas/src-attribute3-2-form_0.xsd:10: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The attribute 'form' is not allowed. diff --git a/result/schemas/src-attribute3-2-st_0_0.err b/result/schemas/src-attribute3-2-st_0_0.err index 797b8c1..ae85e0a 100644 --- a/result/schemas/src-attribute3-2-st_0_0.err +++ b/result/schemas/src-attribute3-2-st_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute3-2-st_0.xsd:11: element simpleType: Schemas parser error : attribute use '{http://foo}bar': The content is not valid. Expected is (annotation?). +./test/schemas/src-attribute3-2-st_0.xsd:11: element simpleType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The content is not valid. Expected is (annotation?). diff --git a/result/schemas/src-attribute3-2-type_0_0.err b/result/schemas/src-attribute3-2-type_0_0.err index 3a43d47..50016d8 100644 --- a/result/schemas/src-attribute3-2-type_0_0.err +++ b/result/schemas/src-attribute3-2-type_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute3-2-type_0.xsd:10: element attribute: Schemas parser error : attribute use '{http://foo}bar': The attribute 'type' is not allowed. +./test/schemas/src-attribute3-2-type_0.xsd:10: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The attribute 'type' is not allowed. diff --git a/result/schemas/src-attribute4_0_0.err b/result/schemas/src-attribute4_0_0.err index a401799..cac6718 100644 --- a/result/schemas/src-attribute4_0_0.err +++ b/result/schemas/src-attribute4_0_0.err @@ -1 +1 @@ -./test/schemas/src-attribute4_0.xsd:8: element simpleType: Schemas parser error : attribute decl. '{http://foo}bar': The attribute 'type' and the child are mutually exclusive. +./test/schemas/src-attribute4_0.xsd:8: element simpleType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute': The attribute 'type' and the child are mutually exclusive. diff --git a/result/schemas/src-element1_0_0.err b/result/schemas/src-element1_0_0.err index ab39e7a..9d8b198 100644 --- a/result/schemas/src-element1_0_0.err +++ b/result/schemas/src-element1_0_0.err @@ -1 +1 @@ -./test/schemas/src-element1_0.xsd:7: element element: Schemas parser error : element decl. '{http://foo}foo': The attributes 'default' and 'fixed' are mutually exclusive. +./test/schemas/src-element1_0.xsd:7: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attributes 'default' and 'fixed' are mutually exclusive. diff --git a/result/schemas/src-element3_0_0.err b/result/schemas/src-element3_0_0.err index fc60d9d..b8bd817 100644 --- a/result/schemas/src-element3_0_0.err +++ b/result/schemas/src-element3_0_0.err @@ -1,2 +1,2 @@ -./test/schemas/src-element3_0.xsd:8: element complexType: Schemas parser error : element decl. '{http://foo}foo': The attribute 'type' and the child are mutually exclusive. -./test/schemas/src-element3_0.xsd:16: element simpleType: Schemas parser error : element decl. '{http://foo}bar': The attribute 'type' and the child are mutually exclusive. +./test/schemas/src-element3_0.xsd:8: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'type' and the child are mutually exclusive. +./test/schemas/src-element3_0.xsd:16: element simpleType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': The attribute 'type' and the child are mutually exclusive. diff --git a/runsuite.c b/runsuite.c index aecd6ae..4e9858a 100644 --- a/runsuite.c +++ b/runsuite.c @@ -6,11 +6,16 @@ * daniel@veillard.com */ +#ifdef HAVE_CONFIG_H +#include "libxml.h" +#else +#include +#endif + #if !defined(_WIN32) || defined(__CYGWIN__) #include #endif #include -#include #include #include #include @@ -31,11 +36,16 @@ #define LOGFILE "runsuite.log" static FILE *logfile = NULL; -static int verbose = 0; - -#if defined(_WIN32) && !defined(__CYGWIN__) -#define vsnprintf _vsnprintf -#define snprintf _snprintf +static int verbose = 0; + + + +#if defined(_WIN32) && !defined(__CYGWIN__) + +#define vsnprintf _vsnprintf + +#define snprintf _snprintf + #endif /************************************************************************ @@ -83,7 +93,6 @@ static int nb_internals = 0; static int nb_schematas = 0; static int nb_unimplemented = 0; static int nb_leaks = 0; -static long libxmlMemoryAllocatedBase = 0; static int extraMemoryFromResolver = 0; static int @@ -225,7 +234,6 @@ initializeLibxml2(void) { xmlSchemaInitTypes(); xmlRelaxNGInitTypes(); #endif - libxmlMemoryAllocatedBase = xmlMemUsed(); } static xmlNodePtr @@ -931,9 +939,17 @@ xstcTestGroup(xmlNodePtr cur, const char *base) { } instance = getNext(cur, "./ts:instanceTest[1]"); while (instance != NULL) { - xstcTestInstance(instance, schemas, path, base); + if (schemas != NULL) { + xstcTestInstance(instance, schemas, path, base); + } else { + /* + * We'll automatically mark the instances as failed + * if the schema was broken. + */ + nb_errors++; + } instance = getNext(instance, - "following-sibling::ts:instanceTest[1]"); + "following-sibling::ts:instanceTest[1]"); } } else if (xmlStrEqual(validity, BAD_CAST "invalid")) { nb_schematas++; @@ -1033,7 +1049,7 @@ done: int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int res, ret = 0; + int ret = 0; int old_errors, old_tests, old_leaks; logfile = fopen(LOGFILE, "w"); @@ -1051,7 +1067,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; - res = xsdTest(); + xsdTest(); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests, no errors\n", nb_tests - old_tests); else @@ -1062,7 +1078,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; - res = rngTest1(); + rngTest1(); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests, no errors\n", nb_tests - old_tests); else @@ -1073,7 +1089,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; - res = rngTest2(); + rngTest2(); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests, no errors\n", nb_tests - old_tests); else @@ -1086,8 +1102,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_leaks = nb_leaks; nb_internals = 0; nb_schematas = 0; - res = xstcMetadata( - "xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet", + xstcMetadata("xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet", "xstc/Tests/Metadata/"); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests (%d schemata), no errors\n", @@ -1104,8 +1119,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_leaks = nb_leaks; nb_internals = 0; nb_schematas = 0; - res = xstcMetadata( - "xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet", + xstcMetadata("xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet", "xstc/Tests/"); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests (%d schemata), no errors\n", @@ -1122,8 +1136,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { old_leaks = nb_leaks; nb_internals = 0; nb_schematas = 0; - res = xstcMetadata( - "xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet", + xstcMetadata("xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet", "xstc/Tests/"); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests (%d schemata), no errors\n", diff --git a/runtest.c b/runtest.c index 897cb9b..02fc159 100644 --- a/runtest.c +++ b/runtest.c @@ -11,11 +11,16 @@ * daniel@veillard.com */ +#ifdef HAVE_CONFIG_H +#include "libxml.h" +#else +#include +#endif + #if !defined(_WIN32) || defined(__CYGWIN__) #include #endif #include -#include #include #include #include @@ -204,7 +209,6 @@ static void globfree(glob_t *pglob) { static int nb_tests = 0; static int nb_errors = 0; static int nb_leaks = 0; -static long libxmlMemoryAllocatedBase = 0; static int extraMemoryFromResolver = 0; static int @@ -536,7 +540,6 @@ initializeLibxml2(void) { xmlSchemaInitTypes(); xmlRelaxNGInitTypes(); #endif - libxmlMemoryAllocatedBase = xmlMemUsed(); } @@ -2926,14 +2929,15 @@ schemasOneTest(const char *sch, unlink(temp); free(temp); - if (err != NULL) { + if ((ret != 0) && (err != NULL)) { if (compareFileMem(err, testErrors, testErrorsSize)) { fprintf(stderr, "Error for %s on %s failed\n", filename, sch); ret = 1; + } else { + ret = 0; } } - xmlSchemaFreeValidCtxt(ctxt); xmlFreeDoc(doc); return(ret); @@ -3029,8 +3033,8 @@ schemasTest(const char *filename, nb_tests++; ret = schemasOneTest(filename, instance, result, err, options, schemas); - if (res != 0) - ret = res; + if (ret != 0) + res = ret; } } globfree(&globbuf); diff --git a/schematron.c b/schematron.c index 9cb5027..98184ac 100644 --- a/schematron.c +++ b/schematron.c @@ -562,7 +562,7 @@ xmlSchematronFree(xmlSchematronPtr schema) xmlFreeDoc(schema->doc); if (schema->namespaces != NULL) - xmlFree(schema->namespaces); + xmlFree((char **) schema->namespaces); xmlSchematronFreeRules(schema->rules); xmlSchematronFreePatterns(schema->patterns); @@ -709,7 +709,7 @@ xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt) xmlXPathFreeContext(ctxt->xctxt); } if (ctxt->namespaces != NULL) - xmlFree(ctxt->namespaces); + xmlFree((char **) ctxt->namespaces); xmlDictFree(ctxt->dict); xmlFree(ctxt); } @@ -809,7 +809,7 @@ xmlSchematronAddNamespace(xmlSchematronParserCtxtPtr ctxt, const xmlChar **tmp; tmp = (const xmlChar **) - xmlRealloc(ctxt->namespaces, ctxt->maxNamespaces * 4 * + xmlRealloc((xmlChar **) ctxt->namespaces, ctxt->maxNamespaces * 4 * sizeof(const xmlChar *)); if (tmp == NULL) { xmlSchematronPErrMemory(NULL, "allocating parser namespaces", diff --git a/test/HTML/53867.html b/test/HTML/53867.html new file mode 100644 index 0000000..ac27999 --- /dev/null +++ b/test/HTML/53867.html @@ -0,0 +1,69 @@ + + + + + diff --git a/test/XPath/docs/nodes b/test/XPath/docs/nodes new file mode 100644 index 0000000..a863df0 --- /dev/null +++ b/test/XPath/docs/nodes @@ -0,0 +1,2 @@ + +txttxt \ No newline at end of file diff --git a/test/XPath/tests/nodespat b/test/XPath/tests/nodespat new file mode 100644 index 0000000..c157a3e --- /dev/null +++ b/test/XPath/tests/nodespat @@ -0,0 +1,5 @@ +/. +//. +/root//. +//.//./././/. +/root//././/bar//. \ No newline at end of file diff --git a/test/c14n/exc-without-comments/test-2.xml b/test/c14n/exc-without-comments/test-2.xml new file mode 100644 index 0000000..83d15a7 --- /dev/null +++ b/test/c14n/exc-without-comments/test-2.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + sj1VXDB2VMCU5qmva2OtDw3kKOs= + + + ... + + + ... + + + diff --git a/test/c14n/exc-without-comments/test-2.xpath b/test/c14n/exc-without-comments/test-2.xpath new file mode 100644 index 0000000..e57652f --- /dev/null +++ b/test/c14n/exc-without-comments/test-2.xpath @@ -0,0 +1,6 @@ + +(//. | //@* | //namespace::*) +[ + ancestor-or-self::ds:SignedInfo +] + \ No newline at end of file diff --git a/test/ns7 b/test/ns7 new file mode 100644 index 0000000..d32b3b4 --- /dev/null +++ b/test/ns7 @@ -0,0 +1 @@ + diff --git a/test/regexp/hard b/test/regexp/hard index 40c6d2d..ddb4cfd 100644 --- a/test/regexp/hard +++ b/test/regexp/hard @@ -5,3 +5,8 @@ aaabbbb a0b aa0aaa b0aaa +=>(\d{1,3}\.){3}\d{1,3} +1.2.3.4 +1.22.333.44 +1.2.3 +1..2.3 diff --git a/test/schemas/bug321475_0.xml b/test/schemas/bug321475_0.xml new file mode 100644 index 0000000..6190231 --- /dev/null +++ b/test/schemas/bug321475_0.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/test/schemas/bug321475_1.xsd b/test/schemas/bug321475_1.xsd new file mode 100644 index 0000000..b714a0d --- /dev/null +++ b/test/schemas/bug321475_1.xsd @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/schemas/bug322411_0.xml b/test/schemas/bug322411_0.xml new file mode 100644 index 0000000..f883648 --- /dev/null +++ b/test/schemas/bug322411_0.xml @@ -0,0 +1,93 @@ + + + + + 1 + 2 + 3 + 4 + 5 + + dupl1 + dupl2 + dupl3 + dupl4 + dupl5 + dupl6 + dupl7 + dupl8 + dupl9 + dupl10 + dupl11 + + 6 + 7 + 8 + 9 + 10 + 11 + + 12 + 13 + 14 + 15 + + dupl1 + dupl2 + dupl3 + dupl4 + dupl5 + dupl6 + dupl7 + dupl8 + dupl9 + dupl10 + dupl11 + + 16 + 17 + 18 + 19 + 20 + 21 + + + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + + dupl1 + dupl2 + dupl3 + dupl4 + dupl5 + dupl6 + dupl7 + dupl8 + dupl9 + dupl10 + dupl11 + + + + 41 + + + diff --git a/test/schemas/bug322411_1.xsd b/test/schemas/bug322411_1.xsd new file mode 100644 index 0000000..383dee6 --- /dev/null +++ b/test/schemas/bug322411_1.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/bug323510_0.xml b/test/schemas/bug323510_0.xml new file mode 100644 index 0000000..ce7647d --- /dev/null +++ b/test/schemas/bug323510_0.xml @@ -0,0 +1,3 @@ + + + diff --git a/test/schemas/bug323510_1.xsd b/test/schemas/bug323510_1.xsd new file mode 100644 index 0000000..8b047ce --- /dev/null +++ b/test/schemas/bug323510_1.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/test/schemas/decimal-1.xml b/test/schemas/decimal-1.xml new file mode 100644 index 0000000..4568ff1 --- /dev/null +++ b/test/schemas/decimal-1.xml @@ -0,0 +1,37 @@ + + + + + 0. + .0 + .10 + 01. + 000 + 123456789012345678 + -123456789012345678 + 0.123456789012345678 + -0.123456789012345678 + + . + - + + + * + - 1 + + 1 + + 0 + - 0 + + diff --git a/test/schemas/decimal-1.xsd b/test/schemas/decimal-1.xsd new file mode 100644 index 0000000..830ca3e --- /dev/null +++ b/test/schemas/decimal-1.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/decimal-1_0.xml b/test/schemas/decimal-1_0.xml new file mode 100644 index 0000000..7bf3719 --- /dev/null +++ b/test/schemas/decimal-1_0.xml @@ -0,0 +1,24 @@ + + + + 0. + .0 + .10 + 01. + 000 + 123456789012345678 + -123456789012345678 + 0.123456789012345678 + -0.123456789012345678 + + . + - + + + * + - 1 + + 1 + + 0 + - 0 + diff --git a/test/schemas/decimal-1_1.xsd b/test/schemas/decimal-1_1.xsd new file mode 100644 index 0000000..f598c86 --- /dev/null +++ b/test/schemas/decimal-1_1.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/decimal-2_0.xml b/test/schemas/decimal-2_0.xml new file mode 100644 index 0000000..166f781 --- /dev/null +++ b/test/schemas/decimal-2_0.xml @@ -0,0 +1,14 @@ + + + + 0.1 + 0.001 + 0.0 + -0.0 + 1 + + -0.1 + -1 + diff --git a/test/schemas/decimal-2_1.xsd b/test/schemas/decimal-2_1.xsd new file mode 100644 index 0000000..cc71670 --- /dev/null +++ b/test/schemas/decimal-2_1.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/decimal-3_0.xml b/test/schemas/decimal-3_0.xml new file mode 100644 index 0000000..fec1ed3 --- /dev/null +++ b/test/schemas/decimal-3_0.xml @@ -0,0 +1,17 @@ + + + + 0.12 + 0.0 + 0.02 + 12 + 1.2 + + 0.123 + 0.023 + 123 + 12.3 + + diff --git a/test/schemas/decimal-3_1.xsd b/test/schemas/decimal-3_1.xsd new file mode 100644 index 0000000..23ae8f7 --- /dev/null +++ b/test/schemas/decimal-3_1.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/idc-keyref-err1_0.xml b/test/schemas/idc-keyref-err1_0.xml new file mode 100644 index 0000000..64a1d0b --- /dev/null +++ b/test/schemas/idc-keyref-err1_0.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/schemas/idc-keyref-err1_1.xsd b/test/schemas/idc-keyref-err1_1.xsd new file mode 100644 index 0000000..43c769f --- /dev/null +++ b/test/schemas/idc-keyref-err1_1.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testapi.c b/testapi.c index fe2d4c8..298a3f1 100644 --- a/testapi.c +++ b/testapi.c @@ -8,7 +8,12 @@ * daniel@veillard.com */ +#ifdef HAVE_CONFIG_H +#include "libxml.h" +#else #include +#endif + #include #include #include @@ -278,7 +283,7 @@ static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return('a'); if (no == 1) return(' '); - if (no == 2) return('ø'); + if (no == 2) return((xmlChar) 'ø'); return(0); } @@ -291,7 +296,7 @@ static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return(0); if (no == 1) return(1); if (no == 2) return(122); - return(-1); + return((unsigned int) -1); } static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -303,7 +308,7 @@ static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return(0); if (no == 1) return(1); if (no == 2) return(122); - return(-1); + return((unsigned long) -1); } static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -689,6 +694,24 @@ static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) { static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + +#define gen_nb_xmlExpCtxtPtr 1 +static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +#define gen_nb_xmlExpNodePtr 1 +static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +#endif + #define gen_nb_xmlHashDeallocator 2 static void test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) { @@ -2928,6 +2951,59 @@ test_htmlDocDumpMemory(void) { } +static int +test_htmlDocDumpMemoryFormat(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) + int mem_base; + xmlDocPtr cur; /* the document */ + int n_cur; + xmlChar ** mem; /* OUT: the memory pointer */ + int n_mem; + int * size; /* OUT: the memory length */ + int n_size; + int format; /* should formatting spaces been added */ + int n_format; + + for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { + for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { + for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { + for (n_format = 0;n_format < gen_nb_int;n_format++) { + mem_base = xmlMemBlocks(); + cur = gen_xmlDocPtr(n_cur, 0); + mem = gen_xmlChar_ptr_ptr(n_mem, 1); + size = gen_int_ptr(n_size, 2); + format = gen_int(n_format, 3); + + htmlDocDumpMemoryFormat(cur, mem, size, format); + call_tests++; + des_xmlDocPtr(n_cur, cur, 0); + des_xmlChar_ptr_ptr(n_mem, mem, 1); + des_int_ptr(n_size, size, 2); + des_int(n_format, format, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlDocDumpMemoryFormat", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_cur); + printf(" %d", n_mem); + printf(" %d", n_size); + printf(" %d", n_format); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + static int test_htmlGetMetaEncoding(void) { int test_ret = 0; @@ -3535,11 +3611,12 @@ static int test_HTMLtree(void) { int test_ret = 0; - if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n"); + if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n"); test_ret += test_htmlDocContentDumpFormatOutput(); test_ret += test_htmlDocContentDumpOutput(); test_ret += test_htmlDocDump(); test_ret += test_htmlDocDumpMemory(); + test_ret += test_htmlDocDumpMemoryFormat(); test_ret += test_htmlGetMetaEncoding(); test_ret += test_htmlIsBooleanAttr(); test_ret += test_htmlNewDoc(); @@ -16960,11 +17037,100 @@ test_xmlStreamPushAttr(void) { return(test_ret); } + +static int +test_xmlStreamPushNode(void) { + int test_ret = 0; + +#if defined(LIBXML_PATTERN_ENABLED) + int mem_base; + int ret_val; + xmlStreamCtxtPtr stream; /* the stream context */ + int n_stream; + xmlChar * name; /* the current name */ + int n_name; + xmlChar * ns; /* the namespace name */ + int n_ns; + int nodeType; /* the type of the node being pushed */ + int n_nodeType; + + for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { + for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { + for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { + for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) { + mem_base = xmlMemBlocks(); + stream = gen_xmlStreamCtxtPtr(n_stream, 0); + name = gen_const_xmlChar_ptr(n_name, 1); + ns = gen_const_xmlChar_ptr(n_ns, 2); + nodeType = gen_int(n_nodeType, 3); + + ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType); + desret_int(ret_val); + call_tests++; + des_xmlStreamCtxtPtr(n_stream, stream, 0); + des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); + des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); + des_int(n_nodeType, nodeType, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlStreamPushNode", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_stream); + printf(" %d", n_name); + printf(" %d", n_ns); + printf(" %d", n_nodeType); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlStreamWantsAnyNode(void) { + int test_ret = 0; + +#if defined(LIBXML_PATTERN_ENABLED) + int mem_base; + int ret_val; + xmlStreamCtxtPtr streamCtxt; /* the stream context */ + int n_streamCtxt; + + for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) { + mem_base = xmlMemBlocks(); + streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0); + + ret_val = xmlStreamWantsAnyNode(streamCtxt); + desret_int(ret_val); + call_tests++; + des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlStreamWantsAnyNode", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_streamCtxt); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + static int test_pattern(void) { int test_ret = 0; - if (quiet == 0) printf("Testing pattern : 8 of 13 functions ...\n"); + if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n"); test_ret += test_xmlPatternFromRoot(); test_ret += test_xmlPatternGetStreamCtxt(); test_ret += test_xmlPatternMatch(); @@ -16975,6 +17141,8 @@ test_pattern(void) { test_ret += test_xmlStreamPop(); test_ret += test_xmlStreamPush(); test_ret += test_xmlStreamPushAttr(); + test_ret += test_xmlStreamPushNode(); + test_ret += test_xmlStreamWantsAnyNode(); if (test_ret != 0) printf("Module pattern: %d errors\n", test_ret); @@ -17757,6 +17925,7 @@ test_xmlSchematronNewParserCtxt(void) { return(test_ret); } +#ifdef LIBXML_SCHEMATRON_ENABLED #define gen_nb_xmlSchematronPtr 1 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -17764,6 +17933,8 @@ static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATT } static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } +#endif + static int test_xmlSchematronNewValidCtxt(void) { @@ -17774,6 +17945,7 @@ test_xmlSchematronNewValidCtxt(void) { return(test_ret); } +#ifdef LIBXML_SCHEMATRON_ENABLED #define gen_nb_xmlSchematronParserCtxtPtr 1 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -17781,6 +17953,8 @@ static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUT } static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } +#endif + static int test_xmlSchematronParse(void) { @@ -17791,6 +17965,7 @@ test_xmlSchematronParse(void) { return(test_ret); } +#ifdef LIBXML_SCHEMATRON_ENABLED #define gen_nb_xmlSchematronValidCtxtPtr 1 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -17798,6 +17973,8 @@ static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_ } static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } +#endif + static int test_xmlSchematronValidateDoc(void) { @@ -25337,28 +25514,28 @@ test_xmlValidGetPotentialChildren(void) { int ret_val; xmlElementContent * ctree; /* an element content tree */ int n_ctree; - xmlChar ** list; /* an array to store the list of child names */ - int n_list; + xmlChar ** names; /* an array to store the list of child names */ + int n_names; int * len; /* a pointer to the number of element in the list */ int n_len; int max; /* the size of the array */ int n_max; for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) { - for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) { + for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { for (n_max = 0;n_max < gen_nb_int;n_max++) { mem_base = xmlMemBlocks(); ctree = gen_xmlElementContent_ptr(n_ctree, 0); - list = gen_const_xmlChar_ptr_ptr(n_list, 1); + names = gen_const_xmlChar_ptr_ptr(n_names, 1); len = gen_int_ptr(n_len, 2); max = gen_int(n_max, 3); - ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max); + ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max); desret_int(ret_val); call_tests++; des_xmlElementContent_ptr(n_ctree, ctree, 0); - des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1); + des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1); des_int_ptr(n_len, len, 2); des_int(n_max, max, 3); xmlResetLastError(); @@ -25367,7 +25544,7 @@ test_xmlValidGetPotentialChildren(void) { xmlMemBlocks() - mem_base); test_ret++; printf(" %d", n_ctree); - printf(" %d", n_list); + printf(" %d", n_names); printf(" %d", n_len); printf(" %d", n_max); printf("\n"); @@ -27507,6 +27684,47 @@ test_xmlNormalizeWindowsPath(void) { } +static int +test_xmlOutputBufferCreateBuffer(void) { + int test_ret = 0; + +#if defined(LIBXML_OUTPUT_ENABLED) + int mem_base; + xmlOutputBufferPtr ret_val; + xmlBufferPtr buffer; /* a xmlBufferPtr */ + int n_buffer; + xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ + int n_encoder; + + for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { + for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { + mem_base = xmlMemBlocks(); + buffer = gen_xmlBufferPtr(n_buffer, 0); + encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); + + ret_val = xmlOutputBufferCreateBuffer(buffer, encoder); + desret_xmlOutputBufferPtr(ret_val); + call_tests++; + des_xmlBufferPtr(n_buffer, buffer, 0); + des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_buffer); + printf(" %d", n_encoder); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + static int test_xmlOutputBufferCreateFd(void) { int test_ret = 0; @@ -28215,7 +28433,7 @@ static int test_xmlIO(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n"); + if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n"); test_ret += test_xmlAllocOutputBuffer(); test_ret += test_xmlAllocParserInputBuffer(); test_ret += test_xmlCheckFilename(); @@ -28236,6 +28454,7 @@ test_xmlIO(void) { test_ret += test_xmlIOHTTPRead(); test_ret += test_xmlNoNetExternalEntityLoader(); test_ret += test_xmlNormalizeWindowsPath(); + test_ret += test_xmlOutputBufferCreateBuffer(); test_ret += test_xmlOutputBufferCreateFd(); test_ret += test_xmlOutputBufferCreateFile(); test_ret += test_xmlOutputBufferCreateFilename(); @@ -31629,6 +31848,64 @@ test_xmlTextReaderSchemaValidate(void) { return(test_ret); } +#ifdef LIBXML_READER_ENABLED + +#define gen_nb_xmlSchemaValidCtxtPtr 1 +static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} +#endif + + +static int +test_xmlTextReaderSchemaValidateCtxt(void) { + int test_ret = 0; + +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) + int mem_base; + int ret_val; + xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ + int n_reader; + xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */ + int n_ctxt; + int options; /* options (not used yet) */ + int n_options; + + for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { + for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { + for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { + mem_base = xmlMemBlocks(); + reader = gen_xmlTextReaderPtr(n_reader, 0); + ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1); + options = gen_parseroptions(n_options, 2); + + ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options); + desret_int(ret_val); + call_tests++; + des_xmlTextReaderPtr(n_reader, reader, 0); + des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1); + des_parseroptions(n_options, options, 2); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_reader); + printf(" %d", n_ctxt); + printf(" %d", n_options); + printf("\n"); + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + static int test_xmlTextReaderSetErrorHandler(void) { @@ -31854,7 +32131,7 @@ static int test_xmlreader(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlreader : 73 of 83 functions ...\n"); + if (quiet == 0) printf("Testing xmlreader : 74 of 84 functions ...\n"); test_ret += test_xmlNewTextReader(); test_ret += test_xmlNewTextReaderFilename(); test_ret += test_xmlReaderForDoc(); @@ -31923,6 +32200,7 @@ test_xmlreader(void) { test_ret += test_xmlTextReaderRelaxNGSetSchema(); test_ret += test_xmlTextReaderRelaxNGValidate(); test_ret += test_xmlTextReaderSchemaValidate(); + test_ret += test_xmlTextReaderSchemaValidateCtxt(); test_ret += test_xmlTextReaderSetErrorHandler(); test_ret += test_xmlTextReaderSetParserProp(); test_ret += test_xmlTextReaderSetSchema(); @@ -31935,16 +32213,6 @@ test_xmlreader(void) { printf("Module xmlreader: %d errors\n", test_ret); return(test_ret); } -#ifdef LIBXML_REGEXP_ENABLED - -#define gen_nb_xmlExpCtxtPtr 1 -static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - static int test_xmlExpCtxtNbCons(void) { @@ -32013,16 +32281,6 @@ test_xmlExpCtxtNbNodes(void) { return(test_ret); } -#ifdef LIBXML_REGEXP_ENABLED - -#define gen_nb_xmlExpNodePtr 1 -static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - static int test_xmlExpDump(void) { @@ -32084,27 +32342,27 @@ test_xmlExpGetLanguage(void) { int n_ctxt; xmlExpNodePtr exp; /* the expression */ int n_exp; - xmlChar ** list; /* where to store the tokens */ - int n_list; + xmlChar ** langList; /* where to store the tokens */ + int n_langList; int len; /* the allocated lenght of @list */ int n_len; for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) { + for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) { for (n_len = 0;n_len < gen_nb_int;n_len++) { mem_base = xmlMemBlocks(); ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); exp = gen_xmlExpNodePtr(n_exp, 1); - list = gen_const_xmlChar_ptr_ptr(n_list, 2); + langList = gen_const_xmlChar_ptr_ptr(n_langList, 2); len = gen_int(n_len, 3); - ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)list, len); + ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len); desret_int(ret_val); call_tests++; des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); des_xmlExpNodePtr(n_exp, exp, 1); - des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2); + des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2); des_int(n_len, len, 3); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { @@ -32113,7 +32371,7 @@ test_xmlExpGetLanguage(void) { test_ret++; printf(" %d", n_ctxt); printf(" %d", n_exp); - printf(" %d", n_list); + printf(" %d", n_langList); printf(" %d", n_len); printf("\n"); } @@ -32139,27 +32397,27 @@ test_xmlExpGetStart(void) { int n_ctxt; xmlExpNodePtr exp; /* the expression */ int n_exp; - xmlChar ** list; /* where to store the tokens */ - int n_list; + xmlChar ** tokList; /* where to store the tokens */ + int n_tokList; int len; /* the allocated lenght of @list */ int n_len; for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) { + for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) { for (n_len = 0;n_len < gen_nb_int;n_len++) { mem_base = xmlMemBlocks(); ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); exp = gen_xmlExpNodePtr(n_exp, 1); - list = gen_const_xmlChar_ptr_ptr(n_list, 2); + tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2); len = gen_int(n_len, 3); - ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)list, len); + ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len); desret_int(ret_val); call_tests++; des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); des_xmlExpNodePtr(n_exp, exp, 1); - des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2); + des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2); des_int(n_len, len, 3); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { @@ -32168,7 +32426,7 @@ test_xmlExpGetStart(void) { test_ret++; printf(" %d", n_ctxt); printf(" %d", n_exp); - printf(" %d", n_list); + printf(" %d", n_tokList); printf(" %d", n_len); printf("\n"); } @@ -32964,6 +33222,16 @@ test_xmlSaveSetEscape(void) { } +static int +test_xmlSaveToBuffer(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + static int test_xmlSaveToFd(void) { int test_ret = 0; @@ -33028,12 +33296,13 @@ static int test_xmlsave(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n"); + if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n"); test_ret += test_xmlSaveClose(); test_ret += test_xmlSaveDoc(); test_ret += test_xmlSaveFlush(); test_ret += test_xmlSaveSetAttrEscape(); test_ret += test_xmlSaveSetEscape(); + test_ret += test_xmlSaveToBuffer(); test_ret += test_xmlSaveToFd(); test_ret += test_xmlSaveToFilename(); test_ret += test_xmlSaveTree(); @@ -33166,16 +33435,6 @@ test_xmlSchemaGetParserErrors(void) { return(test_ret); } -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaValidCtxtPtr 1 -static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - static int test_xmlSchemaGetValidErrors(void) { @@ -33184,13 +33443,13 @@ test_xmlSchemaGetValidErrors(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - xmlSchemaValidityErrorFunc * err; /* the error function result */ + xmlSchemaValidityErrorFunc * err; /* */ int n_err; - xmlSchemaValidityWarningFunc * warn; /* the warning function result */ + xmlSchemaValidityWarningFunc * warn; /* */ int n_warn; - void ** ctx; /* the functions context result */ + void ** ctx; /* */ int n_ctx; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33239,7 +33498,7 @@ test_xmlSchemaIsValid(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33432,7 +33691,7 @@ test_xmlSchemaSAXUnplug(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */ + xmlSchemaSAXPlugPtr plug; /* */ int n_plug; for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) { @@ -33469,6 +33728,16 @@ test_xmlSchemaSetParserErrors(void) { } +static int +test_xmlSchemaSetParserStructuredErrors(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + static int test_xmlSchemaSetValidErrors(void) { int test_ret = 0; @@ -33486,9 +33755,9 @@ test_xmlSchemaSetValidOptions(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - int options; /* a combination of xmlSchemaValidOption */ + int options; /* */ int n_options; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33537,7 +33806,7 @@ test_xmlSchemaValidCtxtGetOptions(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33571,29 +33840,29 @@ test_xmlSchemaValidateDoc(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - xmlDocPtr doc; /* a parsed document tree */ - int n_doc; + xmlDocPtr instance; /* */ + int n_instance; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { + for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) { mem_base = xmlMemBlocks(); ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); + instance = gen_xmlDocPtr(n_instance, 1); - ret_val = xmlSchemaValidateDoc(ctxt, doc); + ret_val = xmlSchemaValidateDoc(ctxt, instance); desret_int(ret_val); call_tests++; des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); + des_xmlDocPtr(n_instance, instance, 1); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlSchemaValidateDoc", xmlMemBlocks() - mem_base); test_ret++; printf(" %d", n_ctxt); - printf(" %d", n_doc); + printf(" %d", n_instance); printf("\n"); } } @@ -33612,11 +33881,11 @@ test_xmlSchemaValidateFile(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - const char * filename; /* the URI of the instance */ + const char * filename; /* */ int n_filename; - int options; /* a future set of options, currently unused */ + int options; /* */ int n_options; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33660,9 +33929,9 @@ test_xmlSchemaValidateOneElement(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - xmlNodePtr elem; /* an element node */ + xmlNodePtr elem; /* */ int n_elem; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33701,15 +33970,15 @@ test_xmlSchemaValidateStream(void) { #if defined(LIBXML_SCHEMAS_ENABLED) int mem_base; int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ + xmlSchemaValidCtxtPtr ctxt; /* */ int n_ctxt; - xmlParserInputBufferPtr input; /* the input to use for reading the data */ + xmlParserInputBufferPtr input; /* */ int n_input; - xmlCharEncoding enc; /* an optional encoding information */ + xmlCharEncoding enc; /* */ int n_enc; - xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */ + xmlSAXHandlerPtr sax; /* */ int n_sax; - void * user_data; /* the context to provide to the SAX handler. */ + void * user_data; /* */ int n_user_data; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { @@ -33759,7 +34028,7 @@ static int test_xmlschemas(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlschemas : 14 of 23 functions ...\n"); + if (quiet == 0) printf("Testing xmlschemas : 14 of 24 functions ...\n"); test_ret += test_xmlSchemaDump(); test_ret += test_xmlSchemaGetParserErrors(); test_ret += test_xmlSchemaGetValidErrors(); @@ -33772,6 +34041,7 @@ test_xmlschemas(void) { test_ret += test_xmlSchemaSAXPlug(); test_ret += test_xmlSchemaSAXUnplug(); test_ret += test_xmlSchemaSetParserErrors(); + test_ret += test_xmlSchemaSetParserStructuredErrors(); test_ret += test_xmlSchemaSetValidErrors(); test_ret += test_xmlSchemaSetValidOptions(); test_ret += test_xmlSchemaSetValidStructuredErrors(); @@ -35579,7 +35849,7 @@ test_xmlStrncatNew(void) { int n_str1; xmlChar * str2; /* second xmlChar string */ int n_str2; - int len; /* the len of @str2 */ + int len; /* the len of @str2 or < 0 */ int n_len; for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { diff --git a/tree.c b/tree.c index 3031d50..f607688 100644 --- a/tree.c +++ b/tree.c @@ -2012,6 +2012,8 @@ xmlRemoveProp(xmlAttrPtr cur) { tmp = cur->parent->properties; if (tmp == cur) { cur->parent->properties = cur->next; + if (cur->next != NULL) + cur->next->prev = NULL; xmlFreeProp(cur); return(0); } @@ -2831,6 +2833,14 @@ xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { return(NULL); } + if (cur == elem) { +#ifdef DEBUG_TREE + xmlGenericError(xmlGenericErrorContext, + "xmlAddNextSibling : cur == elem\n"); +#endif + return(NULL); + } + xmlUnlinkNode(elem); if (elem->type == XML_TEXT_NODE) { @@ -2854,12 +2864,16 @@ xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { /* check if an attribute with the same name exists */ xmlAttrPtr attr; + if (cur->type != XML_ATTRIBUTE_NODE) + return(NULL); if (elem->ns == NULL) - attr = xmlHasProp(cur->parent, elem->name); + attr = xmlHasNsProp(cur->parent, elem->name, NULL); else attr = xmlHasNsProp(cur->parent, elem->name, elem->ns->href); - if ((attr != NULL) && (attr != (xmlAttrPtr) elem)) { + /* elem has already been unlinked so can never be attr */ + if ((attr != NULL) && (attr->type != XML_ATTRIBUTE_DECL)) { /* different instance, destroy it (attributes must be unique) */ + xmlUnlinkNode((xmlNodePtr) attr); xmlFreeProp(attr); } } @@ -2911,6 +2925,14 @@ xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { return(NULL); } + if (cur == elem) { +#ifdef DEBUG_TREE + xmlGenericError(xmlGenericErrorContext, + "xmlAddPrevSibling : cur == elem\n"); +#endif + return(NULL); + } + xmlUnlinkNode(elem); if (elem->type == XML_TEXT_NODE) { @@ -2934,12 +2956,16 @@ xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { /* check if an attribute with the same name exists */ xmlAttrPtr attr; + if (cur->type != XML_ATTRIBUTE_NODE) + return(NULL); if (elem->ns == NULL) - attr = xmlHasProp(cur->parent, elem->name); + attr = xmlHasNsProp(cur->parent, elem->name, NULL); else attr = xmlHasNsProp(cur->parent, elem->name, elem->ns->href); - if ((attr != NULL) && (attr != (xmlAttrPtr) elem)) { + /* elem has already been unlinked so can never be attr */ + if ((attr != NULL) && (attr->type != XML_ATTRIBUTE_DECL)) { /* different instance, destroy it (attributes must be unique) */ + xmlUnlinkNode((xmlNodePtr) attr); xmlFreeProp(attr); } } @@ -3149,6 +3175,13 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { return(NULL); } + if (parent == cur) { +#ifdef DEBUG_TREE + xmlGenericError(xmlGenericErrorContext, + "xmlAddChild : parent == cur\n"); +#endif + return(NULL); + } /* * If cur is a TEXT node, merge its content with adjacent TEXT nodes * cur is then freed. @@ -3156,8 +3189,7 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { if (cur->type == XML_TEXT_NODE) { if ((parent->type == XML_TEXT_NODE) && (parent->content != NULL) && - (parent->name == cur->name) && - (parent != cur)) { + (parent->name == cur->name)) { xmlNodeAddContent(parent, cur->content); xmlFreeNode(cur); return(parent); @@ -3196,6 +3228,8 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { return(parent); } if (cur->type == XML_ATTRIBUTE_NODE) { + if (parent->type != XML_ELEMENT_NODE) + return(NULL); if (parent->properties == NULL) { parent->properties = (xmlAttrPtr) cur; } else { @@ -3203,13 +3237,16 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { xmlAttrPtr lastattr; if (cur->ns == NULL) - lastattr = xmlHasProp(parent, cur->name); + lastattr = xmlHasNsProp(parent, cur->name, NULL); else lastattr = xmlHasNsProp(parent, cur->name, cur->ns->href); - if ((lastattr != NULL) && (lastattr != (xmlAttrPtr) cur)) { + if ((lastattr != NULL) && (lastattr != (xmlAttrPtr) cur) && (lastattr->type != XML_ATTRIBUTE_DECL)) { /* different instance, destroy it (attributes must be unique) */ + xmlUnlinkNode((xmlNodePtr) lastattr); xmlFreeProp(lastattr); } + if (lastattr == (xmlAttrPtr) cur) + return(cur); /* find the end */ lastattr = parent->properties; while (lastattr->next != NULL) { @@ -3575,22 +3612,16 @@ xmlCopyNamespaceList(xmlNsPtr cur) { static xmlNodePtr xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent); -/** - * xmlCopyProp: - * @target: the element where the attribute will be grafted - * @cur: the attribute - * - * Do a copy of the attribute. - * - * Returns: a new #xmlAttrPtr, or NULL in case of error. - */ -xmlAttrPtr -xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { + +static xmlAttrPtr +xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { xmlAttrPtr ret; if (cur == NULL) return(NULL); if (target != NULL) ret = xmlNewDocProp(target->doc, cur->name, NULL); + else if (doc != NULL) + ret = xmlNewDocProp(doc, cur->name, NULL); else if (cur->parent != NULL) ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL); else if (cur->children != NULL) @@ -3678,6 +3709,20 @@ xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { return(ret); } +/** + * xmlCopyProp: + * @target: the element where the attribute will be grafted + * @cur: the attribute + * + * Do a copy of the attribute. + * + * Returns: a new #xmlAttrPtr, or NULL in case of error. + */ +xmlAttrPtr +xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { + return xmlCopyPropInternal(NULL, target, cur); +} + /** * xmlCopyPropList: * @target: the element where the attributes will be grafted @@ -3746,7 +3791,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent, case XML_XINCLUDE_END: break; case XML_ATTRIBUTE_NODE: - return((xmlNodePtr) xmlCopyProp(parent, (xmlAttrPtr) node)); + return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node)); case XML_NAMESPACE_DECL: return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node)); @@ -4861,8 +4906,8 @@ xmlNodeBufGetContent(xmlBufferPtr buffer, xmlNodePtr cur) xmlBufferCat(buffer, tmp->content); break; case XML_ENTITY_REF_NODE: - xmlNodeBufGetContent(buffer, tmp->children); - break; + xmlNodeBufGetContent(buffer, tmp); + break; default: break; } @@ -6258,7 +6303,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) { */ int xmlUnsetProp(xmlNodePtr node, const xmlChar *name) { - xmlAttrPtr prop, prev = NULL;; + xmlAttrPtr prop; if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL)) return(-1); @@ -6270,7 +6315,6 @@ xmlUnsetProp(xmlNodePtr node, const xmlChar *name) { xmlFreeProp(prop); return(0); } - prev = prop; prop = prop->next; } return(-1); @@ -6287,7 +6331,7 @@ xmlUnsetProp(xmlNodePtr node, const xmlChar *name) { */ int xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) { - xmlAttrPtr prop, prev = NULL;; + xmlAttrPtr prop; if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL)) return(-1); @@ -6303,7 +6347,6 @@ xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) { xmlFreeProp(prop); return(0); } - prev = prop; prop = prop->next; } return(-1); diff --git a/uri.c b/uri.c index a00415c..3722311 100644 --- a/uri.c +++ b/uri.c @@ -2130,9 +2130,11 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) int ix; int pos = 0; int nbslash = 0; + int len; xmlURIPtr ref = NULL; xmlURIPtr bas = NULL; xmlChar *bptr, *uptr, *vptr; + int remove_path = 0; if ((URI == NULL) || (*URI == 0)) return NULL; @@ -2173,63 +2175,101 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) * just return the URI */ if ((ref->scheme != NULL) && - ((bas->scheme == NULL) || - xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme) || - xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server))) { + ((bas->scheme == NULL) || + (xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) || + (xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)))) { val = xmlStrdup (URI); goto done; } + if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) { + val = xmlStrdup(BAD_CAST ""); + goto done; + } + if (bas->path == NULL) { + val = xmlStrdup((xmlChar *)ref->path); + goto done; + } + if (ref->path == NULL) { + ref->path = (char *) "/"; + remove_path = 1; + } /* * At this point (at last!) we can compare the two paths * - * First we compare the two strings and find where they first differ + * First we take care of the special case where either of the + * two path components may be missing (bug 316224) */ - bptr = (xmlChar *)bas->path; - if ((ref->path[pos] == '.') && (ref->path[pos+1] == '/')) - pos += 2; - if ((*bptr == '.') && (bptr[1] == '/')) - bptr += 2; - else if ((*bptr == '/') && (ref->path[pos] != '/')) - bptr++; - while ((bptr[pos] == ref->path[pos]) && (bptr[pos] != 0)) - pos++; - - if (bptr[pos] == ref->path[pos]) { - val = NULL; /* if no differences, return NULL */ - goto done; /* (I can't imagine why anyone would do this) */ - } - - /* - * In URI, "back up" to the last '/' encountered. This will be the - * beginning of the "unique" suffix of URI - */ - ix = pos; - if ((ref->path[ix] == '/') && (ix > 0)) - ix--; - for (; ix > 0; ix--) { - if (ref->path[ix] == '/') - break; + if (bas->path == NULL) { + if (ref->path != NULL) { + uptr = (xmlChar *) ref->path; + if (*uptr == '/') + uptr++; + val = xmlStrdup(uptr); + } + goto done; } - if (ix == 0) { - uptr = (xmlChar *)ref->path; + bptr = (xmlChar *)bas->path; + if (ref->path == NULL) { + for (ix = 0; bptr[ix] != 0; ix++) { + if (bptr[ix] == '/') + nbslash++; + } + uptr = NULL; + len = 1; /* this is for a string terminator only */ } else { - ix++; - uptr = (xmlChar *)&ref->path[ix]; - } - /* - * In base, count the number of '/' from the differing point + * Next we compare the two strings and find where they first differ */ - if (bptr[pos] != ref->path[pos]) { /* check for trivial URI == base */ - for (; bptr[ix] != 0; ix++) { - if (bptr[ix] == '/') - nbslash++; + if ((ref->path[pos] == '.') && (ref->path[pos+1] == '/')) + pos += 2; + if ((*bptr == '.') && (bptr[1] == '/')) + bptr += 2; + else if ((*bptr == '/') && (ref->path[pos] != '/')) + bptr++; + while ((bptr[pos] == ref->path[pos]) && (bptr[pos] != 0)) + pos++; + + if (bptr[pos] == ref->path[pos]) { + val = xmlStrdup(BAD_CAST ""); + goto done; /* (I can't imagine why anyone would do this) */ } - } + /* + * In URI, "back up" to the last '/' encountered. This will be the + * beginning of the "unique" suffix of URI + */ + ix = pos; + if ((ref->path[ix] == '/') && (ix > 0)) + ix--; + else if ((ref->path[ix] == 0) && (ix > 1) && (ref->path[ix - 1] == '/')) + ix -= 2; + for (; ix > 0; ix--) { + if (ref->path[ix] == '/') + break; + } + if (ix == 0) { + uptr = (xmlChar *)ref->path; + } else { + ix++; + uptr = (xmlChar *)&ref->path[ix]; + } + + /* + * In base, count the number of '/' from the differing point + */ + if (bptr[pos] != ref->path[pos]) {/* check for trivial URI == base */ + for (; bptr[ix] != 0; ix++) { + if (bptr[ix] == '/') + nbslash++; + } + } + len = xmlStrlen (uptr) + 1; + } + if (nbslash == 0) { - val = xmlStrdup (uptr); + if (uptr != NULL) + val = xmlStrdup (uptr); goto done; } @@ -2238,8 +2278,7 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) * length of the remainder of the URI, plus enough space * for the "../" groups, plus one for the terminator */ - ix = xmlStrlen (uptr) + 1; - val = (xmlChar *) xmlMalloc (ix + 3 * nbslash); + val = (xmlChar *) xmlMalloc (len + 3 * nbslash); if (val == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlBuildRelativeURI: out of memory\n"); @@ -2257,12 +2296,25 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) /* * Finish up with the end of the URI */ - memcpy (vptr, uptr, ix); + if (uptr != NULL) { + if ((vptr > val) && (len > 0) && + (uptr[0] == '/') && (vptr[-1] == '/')) { + memcpy (vptr, uptr + 1, len - 1); + vptr[len - 2] = 0; + } else { + memcpy (vptr, uptr, len); + vptr[len - 1] = 0; + } + } else { + vptr[len - 1] = 0; + } - done: +done: /* * Free the working variables */ + if (remove_path != 0) + ref->path = NULL; if (ref != NULL) xmlFreeURI (ref); if (bas != NULL) diff --git a/valid.c b/valid.c index 3ee5630..4fcf447 100644 --- a/valid.c +++ b/valid.c @@ -6760,7 +6760,7 @@ xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { /** * xmlValidGetPotentialChildren: * @ctree: an element content tree - * @list: an array to store the list of child names + * @names: an array to store the list of child names * @len: a pointer to the number of element in the list * @max: the size of the array * @@ -6770,32 +6770,33 @@ xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { */ int -xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list, +xmlValidGetPotentialChildren(xmlElementContent *ctree, + const xmlChar **names, int *len, int max) { int i; - if ((ctree == NULL) || (list == NULL) || (len == NULL)) + if ((ctree == NULL) || (names == NULL) || (len == NULL)) return(-1); if (*len >= max) return(*len); switch (ctree->type) { case XML_ELEMENT_CONTENT_PCDATA: for (i = 0; i < *len;i++) - if (xmlStrEqual(BAD_CAST "#PCDATA", list[i])) return(*len); - list[(*len)++] = BAD_CAST "#PCDATA"; + if (xmlStrEqual(BAD_CAST "#PCDATA", names[i])) return(*len); + names[(*len)++] = BAD_CAST "#PCDATA"; break; case XML_ELEMENT_CONTENT_ELEMENT: for (i = 0; i < *len;i++) - if (xmlStrEqual(ctree->name, list[i])) return(*len); - list[(*len)++] = ctree->name; + if (xmlStrEqual(ctree->name, names[i])) return(*len); + names[(*len)++] = ctree->name; break; case XML_ELEMENT_CONTENT_SEQ: - xmlValidGetPotentialChildren(ctree->c1, list, len, max); - xmlValidGetPotentialChildren(ctree->c2, list, len, max); + xmlValidGetPotentialChildren(ctree->c1, names, len, max); + xmlValidGetPotentialChildren(ctree->c2, names, len, max); break; case XML_ELEMENT_CONTENT_OR: - xmlValidGetPotentialChildren(ctree->c1, list, len, max); - xmlValidGetPotentialChildren(ctree->c2, list, len, max); + xmlValidGetPotentialChildren(ctree->c1, names, len, max); + xmlValidGetPotentialChildren(ctree->c2, names, len, max); break; } diff --git a/vms/config.vms b/vms/config.vms index b898bf1..6ecfa47 100755 --- a/vms/config.vms +++ b/vms/config.vms @@ -151,15 +151,6 @@ /* Define if you have the header file. */ #undef HAVE_ZLIB_H -/* Define if you have the inet library (-linet). */ -#undef HAVE_LIBINET - -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Name of package */ #undef PACKAGE diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw index 61d15ab..4c3d018 100644 --- a/win32/Makefile.mingw +++ b/win32/Makefile.mingw @@ -126,6 +126,7 @@ XML_OBJS = $(XML_INTDIR)/c14n.o\ $(XML_INTDIR)/relaxng.o\ $(XML_INTDIR)/SAX.o\ $(XML_INTDIR)/SAX2.o\ + $(XML_INTDIR)/schematron.o\ $(XML_INTDIR)/threads.o\ $(XML_INTDIR)/tree.o\ $(XML_INTDIR)/uri.o\ @@ -172,6 +173,7 @@ XML_OBJS_A = $(XML_INTDIR_A)/c14n.o\ $(XML_INTDIR_A)/relaxng.o\ $(XML_INTDIR_A)/SAX.o\ $(XML_INTDIR_A)/SAX2.o\ + $(XML_INTDIR_A)/schematron.o\ $(XML_INTDIR_A)/threads.o\ $(XML_INTDIR_A)/tree.o\ $(XML_INTDIR_A)/uri.o\ @@ -209,7 +211,7 @@ UTILS = $(BINDIR)/xmllint.exe\ $(BINDIR)/testSchemas.exe\ $(BINDIR)/testURI.exe\ $(BINDIR)/testXPath.exe\ - $(BINDIR)/runtest.exe\ + $(BINDIR)/runtest.exe\ $(BINDIR)/runsuite.exe ifeq ($(WITH_THREADS),yes) UTILS += $(BINDIR)/testThreadsWin32.exe diff --git a/win32/Makefile.mingw.orig b/win32/Makefile.mingw.orig new file mode 100644 index 0000000..61d15ab --- /dev/null +++ b/win32/Makefile.mingw.orig @@ -0,0 +1,336 @@ +# Makefile for libxml2, specific for Windows, GCC (mingw) and GNU make. +# +# Take a look at the beginning and modify the variables to suit your +# environment. Having done that, you can do a +# +# nmake [all] to build the libxml and the accompanying utilities. +# nmake clean to remove all compiler output files and return to a +# clean state. +# nmake rebuild to rebuild everything from scratch. This basically does +# a 'nmake clean' and then a 'nmake all'. +# nmake install to install the library and its header files. +# +# November 2002, Igor Zlatkovic + +# There should never be a need to modify anything below this line. +# ---------------------------------------------------------------- + +AUTOCONF = .\config.mingw +include $(AUTOCONF) + +# Names of various input and output components. +XML_NAME = xml2 +XML_BASENAME = lib$(XML_NAME) +XML_SO = $(XML_BASENAME).dll +XML_IMP = $(XML_BASENAME).lib +XML_A = $(XML_BASENAME).a + +# Place where we let the compiler put its output. +BINDIR = bin.mingw +XML_INTDIR = int.mingw +XML_INTDIR_A = int.a.mingw +UTILS_INTDIR = int.utils.mingw + +# The preprocessor and its options. +CPP = gcc.exe -E +CPPFLAGS += -I$(XML_SRCDIR)/include +ifeq ($(WITH_THREADS),1) +CPPFLAGS += -D_REENTRANT +endif + +# The compiler and its options. +CC = gcc.exe +CFLAGS += -DWIN32 -D_WINDOWS -D_MBCS +CFLAGS += -I$(XML_SRCDIR) -I$(XML_SRCDIR)/include -I$(INCPREFIX) +ifneq ($(WITH_THREADS),no) +CFLAGS += -D_REENTRANT +endif +ifeq ($(WITH_THREADS),yes) +CFLAGS += -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS +endif +ifeq ($(WITH_THREADS),ctls) +CFLAGS += -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS +endif +ifeq ($(WITH_THREADS),native) +CFLAGS += -DHAVE_WIN32_THREADS +endif +ifeq ($(WITH_THREADS),posix) +CFLAGS += -DHAVE_PTHREAD_H +endif +ifeq ($(WITH_ZLIB),1) +CFLAGS += -DHAVE_ZLIB_H +endif + +# The linker and its options. +LD = gcc.exe +LDFLAGS += -Wl,--major-image-version,$(LIBXML_MAJOR_VERSION) +LDFLAGS += -Wl,--minor-image-version,$(LIBXML_MINOR_VERSION) +LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX) +LIBS = +ifeq ($(WITH_FTP),1) +CFLAGS += -D_WINSOCKAPI_ +LIBS += -lwsock32 +endif +ifeq ($(WITH_HTTP),1) +CFLAGS += -D_WINSOCKAPI_ +LIBS += -lwsock32 +endif +ifeq ($(WITH_ICONV),1) +LIBS += -liconv +endif +ifeq ($(WITH_ZLIB),1) +LIBS += -lzdll +endif +ifeq ($(WITH_THREADS),posix) +LIBS += -lpthreadGC +endif +ifeq ($(WITH_MODULES),1) +LIBS += -lkernel32 +endif + +# The archiver and its options. +AR = ar.exe +ARFLAGS = -r + +# Optimisation and debug symbols. +ifeq ($(DEBUG),1) +CFLAGS += -D_DEBUG -g +LDFLAGS += +else +CFLAGS += -DNDEBUG -O2 +LDFLAGS += +endif + + +# Libxml object files. +XML_OBJS = $(XML_INTDIR)/c14n.o\ + $(XML_INTDIR)/catalog.o\ + $(XML_INTDIR)/chvalid.o\ + $(XML_INTDIR)/debugXML.o\ + $(XML_INTDIR)/dict.o\ + $(XML_INTDIR)/DOCBparser.o\ + $(XML_INTDIR)/encoding.o\ + $(XML_INTDIR)/entities.o\ + $(XML_INTDIR)/error.o\ + $(XML_INTDIR)/globals.o\ + $(XML_INTDIR)/hash.o\ + $(XML_INTDIR)/HTMLparser.o\ + $(XML_INTDIR)/HTMLtree.o\ + $(XML_INTDIR)/legacy.o\ + $(XML_INTDIR)/list.o\ + $(XML_INTDIR)/nanoftp.o\ + $(XML_INTDIR)/nanohttp.o\ + $(XML_INTDIR)/parser.o\ + $(XML_INTDIR)/parserInternals.o\ + $(XML_INTDIR)/pattern.o\ + $(XML_INTDIR)/relaxng.o\ + $(XML_INTDIR)/SAX.o\ + $(XML_INTDIR)/SAX2.o\ + $(XML_INTDIR)/threads.o\ + $(XML_INTDIR)/tree.o\ + $(XML_INTDIR)/uri.o\ + $(XML_INTDIR)/valid.o\ + $(XML_INTDIR)/xinclude.o\ + $(XML_INTDIR)/xlink.o\ + $(XML_INTDIR)/xmlIO.o\ + $(XML_INTDIR)/xmlmemory.o\ + $(XML_INTDIR)/xmlreader.o\ + $(XML_INTDIR)/xmlregexp.o\ + $(XML_INTDIR)/xmlmodule.o\ + $(XML_INTDIR)/xmlsave.o\ + $(XML_INTDIR)/xmlschemas.o\ + $(XML_INTDIR)/xmlschemastypes.o\ + $(XML_INTDIR)/xmlunicode.o\ + $(XML_INTDIR)/xmlwriter.o\ + $(XML_INTDIR)/xpath.o\ + $(XML_INTDIR)/xpointer.o\ + $(XML_INTDIR)/xmlstring.o + +XML_SRCS = $(subst .o,.c,$(subst $(XML_INTDIR)/,$(XML_SRCDIR)/,$(XML_OBJS))) + +# Static libxml object files. +XML_OBJS_A = $(XML_INTDIR_A)/c14n.o\ + $(XML_INTDIR_A)/catalog.o\ + $(XML_INTDIR_A)/chvalid.o\ + $(XML_INTDIR_A)/debugXML.o\ + $(XML_INTDIR_A)/dict.o\ + $(XML_INTDIR_A)/DOCBparser.o\ + $(XML_INTDIR_A)/encoding.o\ + $(XML_INTDIR_A)/entities.o\ + $(XML_INTDIR_A)/error.o\ + $(XML_INTDIR_A)/globals.o\ + $(XML_INTDIR_A)/hash.o\ + $(XML_INTDIR_A)/HTMLparser.o\ + $(XML_INTDIR_A)/HTMLtree.o\ + $(XML_INTDIR_A)/legacy.o\ + $(XML_INTDIR_A)/list.o\ + $(XML_INTDIR_A)/nanoftp.o\ + $(XML_INTDIR_A)/nanohttp.o\ + $(XML_INTDIR_A)/parser.o\ + $(XML_INTDIR_A)/parserInternals.o\ + $(XML_INTDIR_A)/pattern.o\ + $(XML_INTDIR_A)/relaxng.o\ + $(XML_INTDIR_A)/SAX.o\ + $(XML_INTDIR_A)/SAX2.o\ + $(XML_INTDIR_A)/threads.o\ + $(XML_INTDIR_A)/tree.o\ + $(XML_INTDIR_A)/uri.o\ + $(XML_INTDIR_A)/valid.o\ + $(XML_INTDIR_A)/xinclude.o\ + $(XML_INTDIR_A)/xlink.o\ + $(XML_INTDIR_A)/xmlIO.o\ + $(XML_INTDIR_A)/xmlmemory.o\ + $(XML_INTDIR_A)/xmlreader.o\ + $(XML_INTDIR_A)/xmlregexp.o\ + $(XML_INTDIR_A)/xmlmodule.o\ + $(XML_INTDIR_A)/xmlsave.o\ + $(XML_INTDIR_A)/xmlschemas.o\ + $(XML_INTDIR_A)/xmlschemastypes.o\ + $(XML_INTDIR_A)/xmlunicode.o\ + $(XML_INTDIR_A)/xmlwriter.o\ + $(XML_INTDIR_A)/xpath.o\ + $(XML_INTDIR_A)/xpointer.o\ + $(XML_INTDIR_A)/xmlstring.o + +XML_SRCS_A = $(subst .o,.c,$(subst $(XML_INTDIR_A)/,$(XML_SRCDIR)/,$(XML_OBJS_A))) + +# Xmllint and friends executables. +UTILS = $(BINDIR)/xmllint.exe\ + $(BINDIR)/xmlcatalog.exe\ + $(BINDIR)/testAutomata.exe\ + $(BINDIR)/testC14N.exe\ + $(BINDIR)/testDocbook.exe\ + $(BINDIR)/testHTML.exe\ + $(BINDIR)/testReader.exe\ + $(BINDIR)/testRegexp.exe\ + $(BINDIR)/testModule.exe\ + $(BINDIR)/testRelax.exe\ + $(BINDIR)/testSAX.exe\ + $(BINDIR)/testSchemas.exe\ + $(BINDIR)/testURI.exe\ + $(BINDIR)/testXPath.exe\ + $(BINDIR)/runtest.exe\ + $(BINDIR)/runsuite.exe +ifeq ($(WITH_THREADS),yes) +UTILS += $(BINDIR)/testThreadsWin32.exe +endif +ifeq ($(WITH_THREADS),ctls) +UTILS += $(BINDIR)/testThreadsWin32.exe +endif +ifeq ($(WITH_THREADS),native) +UTILS += $(BINDIR)/testThreadsWin32.exe +endif +ifeq ($(WITH_THREADS),posix) +UTILS += $(BINDIR)/testThreads.exe +endif + +all : dep libxml libxmla utils + +libxml : $(BINDIR)/$(XML_SO) + +libxmla : $(BINDIR)/$(XML_A) + +utils : $(UTILS) + +clean : + cmd.exe /C if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR) + cmd.exe /C if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A) + cmd.exe /C if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR) + cmd.exe /C if exist $(BINDIR) rmdir /S /Q $(BINDIR) + cmd.exe /C if exist depends.mingw del depends.mingw + +distclean : clean + cmd.exe /C if exist config.* del config.* + cmd.exe /C if exist Makefile del Makefile + +rebuild : clean all + +install-libs : all + cmd.exe /C if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml + cmd.exe /C if not exist $(BINPREFIX) mkdir $(BINPREFIX) + cmd.exe /C if not exist $(LIBPREFIX) mkdir $(LIBPREFIX) + cmd.exe /C copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml + cmd.exe /C copy $(BINDIR)\$(XML_SO) $(SOPREFIX) + cmd.exe /C copy $(BINDIR)\$(XML_A) $(LIBPREFIX) + cmd.exe /C copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX) + cmd.exe /C copy $(BINDIR)\xml*.exe $(BINPREFIX) + +install : install-libs + cmd.exe /C copy $(BINDIR)\*.exe $(BINPREFIX) + +install-dist : install-libs + cmd.exe /C copy $(BINDIR)\xml*.exe $(BINPREFIX) + +# This is a target for me, to make a binary distribution. Not for the public use, +# keep your hands off :-) +BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION) +BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32 +bindist : all + $(MAKE) PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)/bin install-dist + cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt + + +# Creates the dependency file +dep : + $(CC) $(CFLAGS) -M $(XML_SRCS) > depends.mingw + + +# Makes the output directory. +$(BINDIR) : + cmd.exe /C if not exist $(BINDIR) mkdir $(BINDIR) + + +# Makes the libxml intermediate directory. +$(XML_INTDIR) : + cmd.exe /C if not exist $(XML_INTDIR) mkdir $(XML_INTDIR) + +# Makes the static libxml intermediate directory. +$(XML_INTDIR_A) : + cmd.exe /C if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A) + +# An implicit rule for libxml compilation. +$(XML_INTDIR)/%.o : $(XML_SRCDIR)/%.c + $(CC) $(CFLAGS) -o $@ -c $< + +# An implicit rule for static libxml compilation. +$(XML_INTDIR_A)/%.o : $(XML_SRCDIR)/%.c + $(CC) $(CFLAGS) -DLIBXML_STATIC -o $@ -c $< + + +# Compiles libxml source. Uses the implicit rule for commands. +$(XML_OBJS) : $(XML_INTDIR) + +# Compiles static libxml source. Uses the implicit rule for commands. +$(XML_OBJS_A) : $(XML_INTDIR_A) + +# Creates the libxml shared object. +XMLSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(XML_IMP) +$(BINDIR)/$(XML_SO) : $(BINDIR) $(XML_OBJS) + $(LD) $(XMLSO_LDFLAGS) -o $(BINDIR)/$(XML_SO) $(XML_OBJS) $(LIBS) + +# Creates the libxml archive. +$(BINDIR)/$(XML_A) : $(BINDIR) $(XML_OBJS_A) + $(AR) $(ARFLAGS) $(BINDIR)\$(XML_A) $(XML_OBJS_A) + + +# Makes the utils intermediate directory. +$(UTILS_INTDIR) : + cmd.exe /C if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR) + +# An implicit rule for xmllint and friends. +ifeq ($(STATIC),1) +$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c + $(CC) -DLIBXML_STATIC $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$( 0) { + ret = write((int) (long) context, &buffer[0], len); + if (ret < 0) xmlIOErr(0, "write()"); + } return(ret); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -860,6 +862,28 @@ xmlFileFlush (void * context) { return(ret); } +#ifdef LIBXML_OUTPUT_ENABLED +/** + * xmlBufferWrite: + * @context: the xmlBuffer + * @buffer: the data to write + * @len: number of bytes to write + * + * Write @len bytes from @buffer to the xml buffer + * + * Returns the number of bytes written + */ +static int +xmlBufferWrite (void * context, const char * buffer, int len) { + int ret; + + ret = xmlBufferAdd((xmlBufferPtr) context, (const xmlChar *) buffer, len); + if (ret != 0) + return(-1); + return(len); +} +#endif + #ifdef HAVE_ZLIB_H /************************************************************************ * * @@ -2436,6 +2460,31 @@ xmlOutputBufferCreateFile(FILE *file, xmlCharEncodingHandlerPtr encoder) { return(ret); } + +/** + * xmlOutputBufferCreateBuffer: + * @buffer: a xmlBufferPtr + * @encoder: the encoding converter or NULL + * + * Create a buffered output for the progressive saving to a xmlBuffer + * + * Returns the new parser output or NULL + */ +xmlOutputBufferPtr +xmlOutputBufferCreateBuffer(xmlBufferPtr buffer, + xmlCharEncodingHandlerPtr encoder) { + xmlOutputBufferPtr ret; + + if (buffer == NULL) return(NULL); + + ret = xmlOutputBufferCreateIO((xmlOutputWriteCallback) + xmlBufferWrite, + (xmlOutputCloseCallback) + NULL, (void *) buffer, encoder); + + return(ret); +} + #endif /* LIBXML_OUTPUT_ENABLED */ /** diff --git a/xmlmodule.c b/xmlmodule.c index 6cc86ee..15bcf07 100644 --- a/xmlmodule.c +++ b/xmlmodule.c @@ -195,6 +195,10 @@ xmlModuleFree(xmlModulePtr module) #include #endif +#ifndef RTLD_GLOBAL /* For Tru64 UNIX 4.0 */ +#define RTLD_GLOBAL 0 +#endif + /** * xmlModulePlatformOpen: * @name: path to the module @@ -277,10 +281,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) int rc; errno = 0; - rc = shl_findsym(handle, name, TYPE_PROCEDURE, symbol); - if ((-1 == rc) && (0 == errno)) { - rc = shl_findsym(handle, name, TYPE_DATA, symbol); - } + rc = shl_findsym(&handle, name, TYPE_UNDEFINED, symbol); return rc; } diff --git a/xmlreader.c b/xmlreader.c index 7efa273..0bdf071 100644 --- a/xmlreader.c +++ b/xmlreader.c @@ -131,12 +131,13 @@ struct _xmlTextReader { /* Handling of RelaxNG validation */ xmlRelaxNGPtr rngSchemas; /* The Relax NG schemas */ xmlRelaxNGValidCtxtPtr rngValidCtxt;/* The Relax NG validation context */ - int rngValidErrors;/* The number of errors detected */ + int rngValidErrors;/* The number of errors detected */ xmlNodePtr rngFullNode; /* the node if RNG not progressive */ /* Handling of Schemas validation */ xmlSchemaPtr xsdSchemas; /* The Schemas schemas */ xmlSchemaValidCtxtPtr xsdValidCtxt;/* The Schemas validation context */ - int xsdValidErrors;/* The number of errors detected */ + int xsdPreserveCtxt; /* 1 if the context was provided by the user */ + int xsdValidErrors;/* The number of errors detected */ xmlSchemaSAXPlugPtr xsdPlug; /* the schemas plug in SAX pipeline */ #endif #ifdef LIBXML_XINCLUDE_ENABLED @@ -1200,8 +1201,14 @@ xmlTextReaderCollectSiblings(xmlNodePtr node) case XML_CDATA_SECTION_NODE: xmlBufferCat(buffer, node->content); break; - case XML_ELEMENT_NODE: - xmlBufferCat(buffer, xmlTextReaderCollectSiblings(node->children)); + case XML_ELEMENT_NODE: { + xmlChar *tmp; + + tmp = xmlTextReaderCollectSiblings(node->children); + xmlBufferCat(buffer, tmp); + xmlFree(tmp); + break; + } default: break; } @@ -1619,6 +1626,7 @@ xmlTextReaderNext(xmlTextReaderPtr reader) { return(xmlTextReaderRead(reader)); } +#ifdef LIBXML_WRITER_ENABLED /** * xmlTextReaderReadInnerXml: * @reader: the xmlTextReaderPtr used @@ -1657,9 +1665,14 @@ xmlTextReaderReadInnerXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) xmlBufferFree(buff2); } resbuf = buff->content; + buff->content = NULL; + + xmlBufferFree(buff); return resbuf; } +#endif +#ifdef LIBXML_WRITER_ENABLED /** * xmlTextReaderReadOuterXml: * @reader: the xmlTextReaderPtr used @@ -1698,6 +1711,7 @@ xmlTextReaderReadOuterXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) xmlBufferFree(buff); return resbuf; } +#endif /** * xmlTextReaderReadString: @@ -2141,7 +2155,8 @@ xmlFreeTextReader(xmlTextReaderPtr reader) { reader->xsdPlug = NULL; } if (reader->xsdValidCtxt != NULL) { - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); + if (! reader->xsdPreserveCtxt) + xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); reader->xsdValidCtxt = NULL; } if (reader->xsdSchemas != NULL) { @@ -4086,15 +4101,17 @@ xmlTextReaderSetSchema(xmlTextReaderPtr reader, xmlSchemaPtr schema) { reader->xsdPlug = NULL; } if (reader->xsdValidCtxt != NULL) { - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); - reader->xsdValidCtxt = NULL; + if (! reader->xsdPreserveCtxt) + xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); + reader->xsdValidCtxt = NULL; } + reader->xsdPreserveCtxt = 0; if (reader->xsdSchemas != NULL) { xmlSchemaFree(reader->xsdSchemas); reader->xsdSchemas = NULL; - } + } return(0); - } + } if (reader->mode != XML_TEXTREADER_MODE_INITIAL) return(-1); if (reader->xsdPlug != NULL) { @@ -4102,9 +4119,11 @@ xmlTextReaderSetSchema(xmlTextReaderPtr reader, xmlSchemaPtr schema) { reader->xsdPlug = NULL; } if (reader->xsdValidCtxt != NULL) { - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); + if (! reader->xsdPreserveCtxt) + xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); reader->xsdValidCtxt = NULL; } + reader->xsdPreserveCtxt = 0; if (reader->xsdSchemas != NULL) { xmlSchemaFree(reader->xsdSchemas); reader->xsdSchemas = NULL; @@ -4221,81 +4240,106 @@ xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng) { } /** - * xmlTextReaderSchemaValidate: + * xmlTextReaderSchemaValidateInternal: * @reader: the xmlTextReaderPtr used * @xsd: the path to a W3C XSD schema or NULL + * @ctxt: the XML Schema validation context or NULL + * @options: options (not used yet) * - * Use W3C XSD schema to validate the document as it is processed. + * Validate the document as it is processed using XML Schema. * Activation is only possible before the first Read(). - * if @xsd is NULL, then RelaxNG validation is desactivated. + * If both @xsd and @ctxt are NULL then XML Schema validation is deactivated. * - * Returns 0 in case the schemas validation could be (des)activated and + * Returns 0 in case the schemas validation could be (de)activated and * -1 in case of error. */ -int -xmlTextReaderSchemaValidate(xmlTextReaderPtr reader, const char *xsd) { - xmlSchemaParserCtxtPtr ctxt; - +static int +xmlTextReaderSchemaValidateInternal(xmlTextReaderPtr reader, + const char *xsd, + xmlSchemaValidCtxtPtr ctxt, + int options ATTRIBUTE_UNUSED) +{ if (reader == NULL) return(-1); - - if (xsd == NULL) { - if (reader->xsdPlug != NULL) { - xmlSchemaSAXUnplug(reader->xsdPlug); - reader->xsdPlug = NULL; - } - if (reader->xsdSchemas != NULL) { - xmlSchemaFree(reader->xsdSchemas); - reader->xsdSchemas = NULL; - } - if (reader->xsdValidCtxt != NULL) { - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); - reader->xsdValidCtxt = NULL; - } - return(0); - } - if ((reader->mode != XML_TEXTREADER_MODE_INITIAL) || - (reader->ctxt == NULL)) + + if ((xsd != NULL) && (ctxt != NULL)) + return(-1); + + if (((xsd != NULL) || (ctxt != NULL)) && + ((reader->mode != XML_TEXTREADER_MODE_INITIAL) || + (reader->ctxt == NULL))) return(-1); + + /* Cleanup previous validation stuff. */ if (reader->xsdPlug != NULL) { xmlSchemaSAXUnplug(reader->xsdPlug); reader->xsdPlug = NULL; } if (reader->xsdValidCtxt != NULL) { - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); + if (! reader->xsdPreserveCtxt) + xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); reader->xsdValidCtxt = NULL; } + reader->xsdPreserveCtxt = 0; if (reader->xsdSchemas != NULL) { xmlSchemaFree(reader->xsdSchemas); reader->xsdSchemas = NULL; + } + + if ((xsd == NULL) && (ctxt == NULL)) { + /* We just want to deactivate the validation, so get out. */ + return(0); + } + + if (xsd != NULL) { + xmlSchemaParserCtxtPtr pctxt; + /* Parse the schema and create validation environment. */ + pctxt = xmlSchemaNewParserCtxt(xsd); + if (reader->errorFunc != NULL) { + xmlSchemaSetParserErrors(pctxt, + xmlTextReaderValidityErrorRelay, + xmlTextReaderValidityWarningRelay, + reader); + } + reader->xsdSchemas = xmlSchemaParse(pctxt); + xmlSchemaFreeParserCtxt(pctxt); + if (reader->xsdSchemas == NULL) + return(-1); + reader->xsdValidCtxt = xmlSchemaNewValidCtxt(reader->xsdSchemas); + if (reader->xsdValidCtxt == NULL) { + xmlSchemaFree(reader->xsdSchemas); + reader->xsdSchemas = NULL; + return(-1); + } + reader->xsdPlug = xmlSchemaSAXPlug(reader->xsdValidCtxt, + &(reader->ctxt->sax), + &(reader->ctxt->userData)); + if (reader->xsdPlug == NULL) { + xmlSchemaFree(reader->xsdSchemas); + reader->xsdSchemas = NULL; + xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); + reader->xsdValidCtxt = NULL; + return(-1); + } + } else { + /* Use the given validation context. */ + reader->xsdValidCtxt = ctxt; + reader->xsdPreserveCtxt = 1; + reader->xsdPlug = xmlSchemaSAXPlug(reader->xsdValidCtxt, + &(reader->ctxt->sax), + &(reader->ctxt->userData)); + if (reader->xsdPlug == NULL) { + reader->xsdValidCtxt = NULL; + reader->xsdPreserveCtxt = 0; + return(-1); + } } - ctxt = xmlSchemaNewParserCtxt(xsd); - if (reader->errorFunc != NULL) { - xmlSchemaSetParserErrors(ctxt, - xmlTextReaderValidityErrorRelay, - xmlTextReaderValidityWarningRelay, - reader); - } - reader->xsdSchemas = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - if (reader->xsdSchemas == NULL) - return(-1); - reader->xsdValidCtxt = xmlSchemaNewValidCtxt(reader->xsdSchemas); - if (reader->xsdValidCtxt == NULL) { - xmlSchemaFree(reader->xsdSchemas); - reader->xsdSchemas = NULL; - return(-1); - } - reader->xsdPlug = xmlSchemaSAXPlug(reader->xsdValidCtxt, - &(reader->ctxt->sax), - &(reader->ctxt->userData)); - if (reader->xsdPlug == NULL) { - xmlSchemaFree(reader->xsdSchemas); - reader->xsdSchemas = NULL; - xmlSchemaFreeValidCtxt(reader->xsdValidCtxt); - reader->xsdValidCtxt = NULL; - return(-1); - } + /* + * Redirect the validation context's error channels to use + * the reader channels. + * TODO: In case the user provides the validation context we + * could make this redirection optional. + */ if (reader->errorFunc != NULL) { xmlSchemaSetValidErrors(reader->xsdValidCtxt, xmlTextReaderValidityErrorRelay, @@ -4311,6 +4355,45 @@ xmlTextReaderSchemaValidate(xmlTextReaderPtr reader, const char *xsd) { reader->validate = XML_TEXTREADER_VALIDATE_XSD; return(0); } + +/** + * xmlTextReaderSchemaValidateCtxt: + * @reader: the xmlTextReaderPtr used + * @ctxt: the XML Schema validation context or NULL + * @options: options (not used yet) + * + * Use W3C XSD schema context to validate the document as it is processed. + * Activation is only possible before the first Read(). + * If @ctxt is NULL, then XML Schema validation is deactivated. + * + * Returns 0 in case the schemas validation could be (de)activated and + * -1 in case of error. + */ +int +xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader, + xmlSchemaValidCtxtPtr ctxt, + int options) +{ + return(xmlTextReaderSchemaValidateInternal(reader, NULL, ctxt, options)); +} + +/** + * xmlTextReaderSchemaValidate: + * @reader: the xmlTextReaderPtr used + * @xsd: the path to a W3C XSD schema or NULL + * + * Use W3C XSD schema to validate the document as it is processed. + * Activation is only possible before the first Read(). + * If @xsd is NULL, then XML Schema validation is deactivated. + * + * Returns 0 in case the schemas validation could be (de)activated and + * -1 in case of error. + */ +int +xmlTextReaderSchemaValidate(xmlTextReaderPtr reader, const char *xsd) +{ + return(xmlTextReaderSchemaValidateInternal(reader, xsd, NULL, 0)); +} #endif /** diff --git a/xmlregexp.c b/xmlregexp.c index 45b917b..de581f0 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -42,6 +42,8 @@ /* #define DEBUG_PUSH */ /* #define DEBUG_COMPACTION */ +#define MAX_PUSH 10000000 + #define ERROR(str) \ ctxt->error = XML_REGEXP_COMPILE_ERROR; \ xmlRegexpErrCompile(ctxt, str); @@ -73,20 +75,20 @@ typedef enum { XML_REGEXP_EPSILON = 1, XML_REGEXP_CHARVAL, XML_REGEXP_RANGES, - XML_REGEXP_SUBREG, + XML_REGEXP_SUBREG, /* used for () sub regexps */ XML_REGEXP_STRING, XML_REGEXP_ANYCHAR, /* . */ XML_REGEXP_ANYSPACE, /* \s */ XML_REGEXP_NOTSPACE, /* \S */ XML_REGEXP_INITNAME, /* \l */ - XML_REGEXP_NOTINITNAME, /* \l */ + XML_REGEXP_NOTINITNAME, /* \L */ XML_REGEXP_NAMECHAR, /* \c */ XML_REGEXP_NOTNAMECHAR, /* \C */ XML_REGEXP_DECIMAL, /* \d */ - XML_REGEXP_NOTDECIMAL, /* \d */ + XML_REGEXP_NOTDECIMAL, /* \D */ XML_REGEXP_REALCHAR, /* \w */ - XML_REGEXP_NOTREALCHAR, /* \w */ - XML_REGEXP_LETTER, + XML_REGEXP_NOTREALCHAR, /* \W */ + XML_REGEXP_LETTER = 100, XML_REGEXP_LETTER_UPPERCASE, XML_REGEXP_LETTER_LOWERCASE, XML_REGEXP_LETTER_TITLECASE, @@ -201,6 +203,7 @@ struct _xmlRegTrans { int to; int counter; int count; + int nd; }; struct _xmlAutomataState { @@ -326,6 +329,7 @@ struct _xmlRegExecCtxt { xmlRegStatePtr errState; /* the error state */ xmlChar *errString; /* the string raising the error */ int *errCounts; /* counters at the error state */ + int nbPush; }; #define REGEXP_ALL_COUNTER 0x123456 @@ -335,6 +339,9 @@ static void xmlFAParseRegExp(xmlRegParserCtxtPtr ctxt, int top); static void xmlRegFreeState(xmlRegStatePtr state); static void xmlRegFreeAtom(xmlRegAtomPtr atom); static int xmlRegStrEqualWildcard(const xmlChar *expStr, const xmlChar *valStr); +static int xmlRegCheckCharacter(xmlRegAtomPtr atom, int codepoint); +static int xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, + int neg, int start, int end, const xmlChar *blockName); /************************************************************************ * * @@ -417,6 +424,9 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) { ret->nbCounters = ctxt->nbCounters; ret->counters = ctxt->counters; ret->determinist = ctxt->determinist; + if (ret->determinist == -1) { + xmlRegexpIsDeterminist(ret); + } if ((ret->determinist != 0) && (ret->nbCounters == 0) && @@ -569,7 +579,6 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) { i, j, trans->atom->no, trans->to, atomno, targetno); printf(" previous to is %d\n", prev); #endif - ret->determinist = 0; if (transdata != NULL) xmlFree(transdata); xmlFree(transitions); @@ -1016,6 +1025,12 @@ xmlRegPrintTrans(FILE *output, xmlRegTransPtr trans) { fprintf(output, "removed\n"); return; } + if (trans->nd != 0) { + if (trans->nd == 2) + fprintf(output, "last not determinist, "); + else + fprintf(output, "not determinist, "); + } if (trans->counter >= 0) { fprintf(output, "counted %d, ", trans->counter); } @@ -1235,7 +1250,7 @@ xmlRegStateAddTransTo(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr target, static void xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, xmlRegAtomPtr atom, xmlRegStatePtr target, - int counter, int count, int nchk) { + int counter, int count) { int nrtrans; @@ -1253,19 +1268,17 @@ xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, * so, silently ignore this request. */ - if (nchk == 0) { - for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) { - xmlRegTransPtr trans = &(state->trans[nrtrans]); - if ((trans->atom == atom) && - (trans->to == target->no) && - (trans->counter == counter) && - (trans->count == count)) { + for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) { + xmlRegTransPtr trans = &(state->trans[nrtrans]); + if ((trans->atom == atom) && + (trans->to == target->no) && + (trans->counter == counter) && + (trans->count == count)) { #ifdef DEBUG_REGEXP_GRAPH - printf("Ignoring duplicate transition from %d to %d\n", - state->no, target->no); + printf("Ignoring duplicate transition from %d to %d\n", + state->no, target->no); #endif - return; - } + return; } } @@ -1308,6 +1321,7 @@ xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, state->trans[state->nbTrans].to = target->no; state->trans[state->nbTrans].counter = counter; state->trans[state->nbTrans].count = count; + state->trans[state->nbTrans].nd = 0; state->nbTrans++; xmlRegStateAddTransTo(ctxt, target, state->no); } @@ -1359,9 +1373,9 @@ xmlFAGenerateAllTransition(xmlRegParserCtxtPtr ctxt, ctxt->state = to; } if (lax) - xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_LAX_COUNTER, 0); + xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_LAX_COUNTER); else - xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_COUNTER, 0); + xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_COUNTER); } /** @@ -1379,7 +1393,7 @@ xmlFAGenerateEpsilonTransition(xmlRegParserCtxtPtr ctxt, xmlRegStatePush(ctxt, to); ctxt->state = to; } - xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1, 0); + xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1); } /** @@ -1398,7 +1412,7 @@ xmlFAGenerateCountedEpsilonTransition(xmlRegParserCtxtPtr ctxt, xmlRegStatePush(ctxt, to); ctxt->state = to; } - xmlRegStateAddTrans(ctxt, from, NULL, to, counter, -1, 0); + xmlRegStateAddTrans(ctxt, from, NULL, to, counter, -1); } /** @@ -1417,7 +1431,7 @@ xmlFAGenerateCountedTransition(xmlRegParserCtxtPtr ctxt, xmlRegStatePush(ctxt, to); ctxt->state = to; } - xmlRegStateAddTrans(ctxt, from, NULL, to, -1, counter, 0); + xmlRegStateAddTrans(ctxt, from, NULL, to, -1, counter); } /** @@ -1450,6 +1464,14 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, * Generate an epsilon transition to link to the target */ xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to); +#ifdef DV + } else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) && + (atom->quant != XML_REGEXP_QUANT_ONCE)) { + to = xmlRegNewState(ctxt); + xmlRegStatePush(ctxt, to); + ctxt->state = to; + xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to); +#endif } switch (atom->quant) { case XML_REGEXP_QUANT_OPT: @@ -1504,8 +1526,8 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, } else { newstate = xmlRegNewState(ctxt); xmlRegStatePush(ctxt, newstate); - ctxt->state = newstate; } + ctxt->state = newstate; xmlFAGenerateCountedTransition(ctxt, atom->stop, newstate, counter); } @@ -1513,7 +1535,8 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, break; } return(0); - } else if ((atom->min == 0) && (atom->max == 0) && + } + if ((atom->min == 0) && (atom->max == 0) && (atom->quant == XML_REGEXP_QUANT_RANGE)) { /* * we can discard the atom and generate an epsilon transition instead @@ -1530,21 +1553,20 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, ctxt->state = to; xmlRegFreeAtom(atom); return(0); - } else { - if (to == NULL) { - to = xmlRegNewState(ctxt); - if (to != NULL) - xmlRegStatePush(ctxt, to); - else { - return(-1); - } - } - if (xmlRegAtomPush(ctxt, atom) < 0) { + } + if (to == NULL) { + to = xmlRegNewState(ctxt); + if (to != NULL) + xmlRegStatePush(ctxt, to); + else { return(-1); } - xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1, 0); - ctxt->state = to; } + if (xmlRegAtomPush(ctxt, atom) < 0) { + return(-1); + } + xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1); + ctxt->state = to; switch (atom->quant) { case XML_REGEXP_QUANT_OPT: atom->quant = XML_REGEXP_QUANT_ONCE; @@ -1553,11 +1575,11 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, case XML_REGEXP_QUANT_MULT: atom->quant = XML_REGEXP_QUANT_ONCE; xmlFAGenerateEpsilonTransition(ctxt, from, to); - xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1, 0); + xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1); break; case XML_REGEXP_QUANT_PLUS: atom->quant = XML_REGEXP_QUANT_ONCE; - xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1, 0); + xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1); break; default: break; @@ -1614,7 +1636,7 @@ xmlFAReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int fromnr, xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[newto], - -1, to->trans[transnr].count, 0); + -1, to->trans[transnr].count); } else { #ifdef DEBUG_REGEXP_GRAPH printf("Found epsilon trans %d from %d to %d\n", @@ -1637,10 +1659,10 @@ xmlFAReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int fromnr, if (to->trans[transnr].counter >= 0) { xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, ctxt->states[newto], - to->trans[transnr].counter, -1, 1); + to->trans[transnr].counter, -1); } else { xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, - ctxt->states[newto], counter, -1, 1); + ctxt->states[newto], counter, -1); } } } @@ -1869,12 +1891,175 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) { } +static int +xmlFACompareRanges(xmlRegRangePtr range1, xmlRegRangePtr range2) { + int ret = 0; + + if ((range1->type == XML_REGEXP_RANGES) || + (range2->type == XML_REGEXP_RANGES) || + (range2->type == XML_REGEXP_SUBREG) || + (range1->type == XML_REGEXP_SUBREG) || + (range1->type == XML_REGEXP_STRING) || + (range2->type == XML_REGEXP_STRING)) + return(-1); + + /* put them in order */ + if (range1->type > range2->type) { + xmlRegRangePtr tmp; + + tmp = range1; + range1 = range2; + range2 = tmp; + } + if ((range1->type == XML_REGEXP_ANYCHAR) || + (range2->type == XML_REGEXP_ANYCHAR)) { + ret = 1; + } else if ((range1->type == XML_REGEXP_EPSILON) || + (range2->type == XML_REGEXP_EPSILON)) { + return(0); + } else if (range1->type == range2->type) { + if ((range1->type != XML_REGEXP_CHARVAL) || + (range1->end < range2->start) || + (range2->end < range1->start)) + ret = 1; + else + ret = 0; + } else if (range1->type == XML_REGEXP_CHARVAL) { + int codepoint; + int neg = 0; + + /* + * just check all codepoints in the range for acceptance, + * this is usually way cheaper since done only once at + * compilation than testing over and over at runtime or + * pushing too many states when evaluating. + */ + if (((range1->neg == 0) && (range2->neg != 0)) || + ((range1->neg != 0) && (range2->neg == 0))) + neg = 1; + + for (codepoint = range1->start;codepoint <= range1->end ;codepoint++) { + ret = xmlRegCheckCharacterRange(range2->type, codepoint, + 0, range2->start, range2->end, + range2->blockName); + if (ret < 0) + return(-1); + if (((neg == 1) && (ret == 0)) || + ((neg == 0) && (ret == 1))) + return(1); + } + return(0); + } else if ((range1->type == XML_REGEXP_BLOCK_NAME) || + (range2->type == XML_REGEXP_BLOCK_NAME)) { + if (range1->type == range2->type) { + ret = xmlStrEqual(range1->blockName, range2->blockName); + } else { + /* + * comparing a block range with anything else is way + * too costly, and maintining the table is like too much + * memory too, so let's force the automata to save state + * here. + */ + return(1); + } + } else if ((range1->type < XML_REGEXP_LETTER) || + (range2->type < XML_REGEXP_LETTER)) { + if ((range1->type == XML_REGEXP_ANYSPACE) && + (range2->type == XML_REGEXP_NOTSPACE)) + ret = 0; + else if ((range1->type == XML_REGEXP_INITNAME) && + (range2->type == XML_REGEXP_NOTINITNAME)) + ret = 0; + else if ((range1->type == XML_REGEXP_NAMECHAR) && + (range2->type == XML_REGEXP_NOTNAMECHAR)) + ret = 0; + else if ((range1->type == XML_REGEXP_DECIMAL) && + (range2->type == XML_REGEXP_NOTDECIMAL)) + ret = 0; + else if ((range1->type == XML_REGEXP_REALCHAR) && + (range2->type == XML_REGEXP_NOTREALCHAR)) + ret = 0; + else { + /* same thing to limit complexity */ + return(1); + } + } else { + ret = 0; + /* range1->type < range2->type here */ + switch (range1->type) { + case XML_REGEXP_LETTER: + /* all disjoint except in the subgroups */ + if ((range2->type == XML_REGEXP_LETTER_UPPERCASE) || + (range2->type == XML_REGEXP_LETTER_LOWERCASE) || + (range2->type == XML_REGEXP_LETTER_TITLECASE) || + (range2->type == XML_REGEXP_LETTER_MODIFIER) || + (range2->type == XML_REGEXP_LETTER_OTHERS)) + ret = 1; + break; + case XML_REGEXP_MARK: + if ((range2->type == XML_REGEXP_MARK_NONSPACING) || + (range2->type == XML_REGEXP_MARK_SPACECOMBINING) || + (range2->type == XML_REGEXP_MARK_ENCLOSING)) + ret = 1; + break; + case XML_REGEXP_NUMBER: + if ((range2->type == XML_REGEXP_NUMBER_DECIMAL) || + (range2->type == XML_REGEXP_NUMBER_LETTER) || + (range2->type == XML_REGEXP_NUMBER_OTHERS)) + ret = 1; + break; + case XML_REGEXP_PUNCT: + if ((range2->type == XML_REGEXP_PUNCT_CONNECTOR) || + (range2->type == XML_REGEXP_PUNCT_DASH) || + (range2->type == XML_REGEXP_PUNCT_OPEN) || + (range2->type == XML_REGEXP_PUNCT_CLOSE) || + (range2->type == XML_REGEXP_PUNCT_INITQUOTE) || + (range2->type == XML_REGEXP_PUNCT_FINQUOTE) || + (range2->type == XML_REGEXP_PUNCT_OTHERS)) + ret = 1; + break; + case XML_REGEXP_SEPAR: + if ((range2->type == XML_REGEXP_SEPAR_SPACE) || + (range2->type == XML_REGEXP_SEPAR_LINE) || + (range2->type == XML_REGEXP_SEPAR_PARA)) + ret = 1; + break; + case XML_REGEXP_SYMBOL: + if ((range2->type == XML_REGEXP_SYMBOL_MATH) || + (range2->type == XML_REGEXP_SYMBOL_CURRENCY) || + (range2->type == XML_REGEXP_SYMBOL_MODIFIER) || + (range2->type == XML_REGEXP_SYMBOL_OTHERS)) + ret = 1; + break; + case XML_REGEXP_OTHER: + if ((range2->type == XML_REGEXP_OTHER_CONTROL) || + (range2->type == XML_REGEXP_OTHER_FORMAT) || + (range2->type == XML_REGEXP_OTHER_PRIVATE)) + ret = 1; + break; + default: + if ((range2->type >= XML_REGEXP_LETTER) && + (range2->type < XML_REGEXP_BLOCK_NAME)) + ret = 0; + else { + /* safety net ! */ + return(1); + } + } + } + if (((range1->neg == 0) && (range2->neg != 0)) || + ((range1->neg != 0) && (range2->neg == 0))) + ret = !ret; + return(1); +} + /** * xmlFACompareAtoms: * @atom1: an atom * @atom2: an atom * - * Compares two atoms to check whether they are equivalents + * Compares two atoms to check whether they intersect in some ways, + * this is used by xmlFAComputesDeterminism only * * Returns 1 if yes and 0 otherwise */ @@ -1887,28 +2072,65 @@ xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2) { if ((atom1 == NULL) || (atom2 == NULL)) return(0); - if (atom1->type != atom2->type) + if ((atom1->type == XML_REGEXP_RANGES) && + (atom2->type == XML_REGEXP_CHARVAL)) { + } else if ((atom1->type == XML_REGEXP_CHARVAL) && + (atom2->type == XML_REGEXP_RANGES)) { + xmlRegAtomPtr tmp; + tmp = atom1; + atom1 = atom2; + atom2 = tmp; + } else if (atom1->type != atom2->type) { return(0); + } switch (atom1->type) { case XML_REGEXP_STRING: ret = xmlRegStrEqualWildcard((xmlChar *)atom1->valuep, (xmlChar *)atom2->valuep); break; case XML_REGEXP_EPSILON: - return(1); + goto not_determinist; case XML_REGEXP_CHARVAL: - ret = atom1->codepoint == atom2->codepoint; + ret = (atom1->codepoint == atom2->codepoint); break; case XML_REGEXP_RANGES: - TODO; - return(0); + if (atom2->type == XML_REGEXP_CHARVAL) { + ret = xmlRegCheckCharacter(atom1, atom2->codepoint); + if (ret < 0) + return(-1); + break; + } else { + int i, j, res; + xmlRegRangePtr r1, r2; + + /* + * need to check that none of the ranges eventually matches + */ + for (i = 0;i < atom1->nbRanges;i++) { + for (j = 0;j < atom2->nbRanges;j++) { + r1 = atom1->ranges[i]; + r2 = atom2->ranges[j]; + res = xmlFACompareRanges(r1, r2); + if (res == 1) { + ret = 1; + goto done; + } + } + } + ret = 0; + } + break; default: - return(1); + goto not_determinist; } +done: if (atom1->neg != atom2->neg) { ret = !ret; } - return(ret); + if (ret == 0) + return(0); +not_determinist: + return(1); } /** @@ -1923,12 +2145,18 @@ static int xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, int to, xmlRegAtomPtr atom) { int ret = 1; - int transnr; + int res; + int transnr, nbTrans; xmlRegTransPtr t1; if (state == NULL) return(ret); - for (transnr = 0;transnr < state->nbTrans;transnr++) { + /* + * don't recurse on transitions potentially added in the course of + * the elimination. + */ + nbTrans = state->nbTrans; + for (transnr = 0;transnr < nbTrans;transnr++) { t1 = &(state->trans[transnr]); /* * check transitions conflicting with the one looked at @@ -1936,16 +2164,21 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, if (t1->atom == NULL) { if (t1->to == -1) continue; - ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to], + res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to], to, atom); - if (ret == 0) - return(0); + if (res == 0) { + ret = 0; + /* t1->nd = 1; */ + } continue; } if (t1->to != to) continue; - if (xmlFACompareAtoms(t1->atom, atom)) - return(0); + if (xmlFACompareAtoms(t1->atom, atom)) { + ret = 0; + /* mark the transition as non-deterministic */ + t1->nd = 1; + } } return(ret); } @@ -1962,7 +2195,7 @@ static int xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) { int statenr, transnr; xmlRegStatePtr state; - xmlRegTransPtr t1, t2; + xmlRegTransPtr t1, t2, last; int i; int ret = 1; @@ -1974,8 +2207,7 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) { return(ctxt->determinist); /* - * Check for all states that there aren't 2 transitions - * with the same atom and a different target. + * First cleanup the automata removing cancelled transitions */ for (statenr = 0;statenr < ctxt->nbStates;statenr++) { state = ctxt->states[statenr]; @@ -1989,8 +2221,10 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) { * Determinism checks in case of counted or all transitions * will have to be handled separately */ - if (t1->atom == NULL) + if (t1->atom == NULL) { + /* t1->nd = 1; */ continue; + } if (t1->to == -1) /* eliminated */ continue; for (i = 0;i < transnr;i++) { @@ -2001,10 +2235,46 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) { if (t1->to == t2->to) { if (xmlFACompareAtoms(t1->atom, t2->atom)) t2->to = -1; /* eliminated */ - } else { - /* not determinist ! */ - if (xmlFACompareAtoms(t1->atom, t2->atom)) - ret = 0; + } + } + } + } + } + + /* + * Check for all states that there aren't 2 transitions + * with the same atom and a different target. + */ + for (statenr = 0;statenr < ctxt->nbStates;statenr++) { + state = ctxt->states[statenr]; + if (state == NULL) + continue; + if (state->nbTrans < 2) + continue; + last = NULL; + for (transnr = 0;transnr < state->nbTrans;transnr++) { + t1 = &(state->trans[transnr]); + /* + * Determinism checks in case of counted or all transitions + * will have to be handled separately + */ + if (t1->atom == NULL) { + continue; + } + if (t1->to == -1) /* eliminated */ + continue; + for (i = 0;i < transnr;i++) { + t2 = &(state->trans[i]); + if (t2->to == -1) /* eliminated */ + continue; + if (t2->atom != NULL) { + /* not determinist ! */ + if (xmlFACompareAtoms(t1->atom, t2->atom)) { + ret = 0; + /* mark the transitions as non-deterministic ones */ + t1->nd = 1; + t2->nd = 1; + last = t1; } } else if (t1->to != -1) { /* @@ -2013,16 +2283,39 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) { */ ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to], t2->to, t2->atom); + /* don't shortcut the computation so all non deterministic + transition get marked down if (ret == 0) return(0); + */ + if (ret == 0) { + t1->nd = 1; + /* t2->nd = 1; */ + last = t1; + } } } + /* don't shortcut the computation so all non deterministic + transition get marked down if (ret == 0) - break; + break; */ + } + + /* + * mark specifically the last non-deterministic transition + * from a state since there is no need to set-up rollback + * from it + */ + if (last != NULL) { + last->nd = 2; } + + /* don't shortcut the computation so all non deterministic + transition get marked down if (ret == 0) - break; + break; */ } + ctxt->determinist = ret; return(ret); } @@ -2336,6 +2629,12 @@ xmlFARegExecSave(xmlRegExecCtxtPtr exec) { xmlFARegDebugExec(exec); exec->transno--; #endif +#ifdef MAX_PUSH + if (exec->nbPush > MAX_PUSH) { + return; + } + exec->nbPush++; +#endif if (exec->maxRollbacks == 0) { exec->maxRollbacks = 4; @@ -2422,10 +2721,11 @@ static int xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { xmlRegExecCtxt execval; xmlRegExecCtxtPtr exec = &execval; - int ret, codepoint = 0, len; + int ret, codepoint = 0, len, deter; exec->inputString = content; exec->index = 0; + exec->nbPush = 0; exec->determinist = 1; exec->maxRollbacks = 0; exec->nbRollbacks = 0; @@ -2482,6 +2782,7 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { continue; atom = trans->atom; ret = 0; + deter = 1; if (trans->count >= 0) { int count; xmlRegCounterPtr counter; @@ -2497,6 +2798,8 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { trans->count, count, counter->min, counter->max); #endif ret = ((count >= counter->min) && (count <= counter->max)); + if ((ret) && (counter->min != counter->max)) + deter = 0; } else if (atom == NULL) { fprintf(stderr, "epsilon transition left at runtime\n"); exec->status = -2; @@ -2509,7 +2812,15 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { /* * this is a multiple input sequence + * If there is a counter associated increment it now. + * before potentially saving and rollback */ + if (trans->counter >= 0) { +#ifdef DEBUG_REGEXP_EXEC + printf("Increasing count %d\n", trans->counter); +#endif + exec->counts[trans->counter]++; + } if (exec->state->nbTrans > exec->transno + 1) { xmlFARegExecSave(exec); } @@ -2559,6 +2870,12 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { if (ret == 0) { goto rollback; } + if (trans->counter >= 0) { +#ifdef DEBUG_REGEXP_EXEC + printf("Decreasing count %d\n", trans->counter); +#endif + exec->counts[trans->counter]--; + } } else if ((ret == 0) && (atom->min == 0) && (atom->max > 0)) { /* * we don't match on the codepoint, but minOccurs of 0 @@ -2576,7 +2893,17 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { ret = 1; } if (ret == 1) { - if (exec->state->nbTrans > exec->transno + 1) { + if ((trans->nd == 1) || + ((trans->count >= 0) && (deter == 0) && + (exec->state->nbTrans > exec->transno + 1))) { +#ifdef DEBUG_REGEXP_EXEC + if (trans->nd == 1) + printf("Saving on nd transition atom %d for %c at %d\n", + trans->atom->no, codepoint, exec->index); + else + printf("Saving on counted transition count %d for %c at %d\n", + trans->count, codepoint, exec->index); +#endif xmlFARegExecSave(exec); } if (trans->counter >= 0) { @@ -2613,6 +2940,10 @@ rollback: * Failed to find a way out */ exec->determinist = 0; +#ifdef DEBUG_REGEXP_EXEC + printf("rollback from state %d on %d:%c\n", exec->state->no, + codepoint,codepoint); +#endif xmlFARegExecRollBack(exec); } progress: @@ -2632,8 +2963,11 @@ progress: xmlFree(exec->counts); if (exec->status == 0) return(1); - if (exec->status == -1) + if (exec->status == -1) { + if (exec->nbPush > MAX_PUSH) + return(-1); return(0); + } return(exec->status); } @@ -2708,6 +3042,7 @@ xmlRegNewExecCtxt(xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data) { exec->inputStack = NULL; exec->errStateNo = -1; exec->errString = NULL; + exec->nbPush = 0; return(exec); } @@ -3344,7 +3679,7 @@ xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value, ret = xmlRegExecPushStringInternal(exec, str, data, 1); if (str != buf) - xmlFree(buf); + xmlFree(str); return(ret); } @@ -4784,11 +5119,11 @@ xmlNewAutomata(void) { /* initialize the parser */ ctxt->end = NULL; ctxt->start = ctxt->state = xmlRegNewState(ctxt); - ctxt->start->type = XML_REGEXP_START_STATE; if (ctxt->start == NULL) { xmlFreeAutomata(ctxt); return(NULL); } + ctxt->start->type = XML_REGEXP_START_STATE; if (xmlRegStatePush(ctxt, ctxt->start) < 0) { xmlRegFreeState(ctxt->start); xmlFreeAutomata(ctxt); @@ -5081,7 +5416,7 @@ xmlAutomataNewCountTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, to = xmlRegNewState(am); xmlRegStatePush(am, to); } - xmlRegStateAddTrans(am, from, atom, to, counter, -1, 0); + xmlRegStateAddTrans(am, from, atom, to, counter, -1); xmlRegAtomPush(am, atom); am->state = to; @@ -5147,7 +5482,7 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, to = xmlRegNewState(am); xmlRegStatePush(am, to); } - xmlRegStateAddTrans(am, from, atom, to, counter, -1, 0); + xmlRegStateAddTrans(am, from, atom, to, counter, -1); xmlRegAtomPush(am, atom); am->state = to; @@ -5236,7 +5571,7 @@ xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, to = xmlRegNewState(am); xmlRegStatePush(am, to); } - xmlRegStateAddTrans(am, from, atom, to, counter, -1, 0); + xmlRegStateAddTrans(am, from, atom, to, counter, -1); xmlRegAtomPush(am, atom); am->state = to; return(to); @@ -5298,7 +5633,7 @@ xmlAutomataNewOnceTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, to = xmlRegNewState(am); xmlRegStatePush(am, to); } - xmlRegStateAddTrans(am, from, atom, to, counter, -1, 0); + xmlRegStateAddTrans(am, from, atom, to, counter, -1); xmlRegAtomPush(am, atom); am->state = to; return(to); @@ -6134,7 +6469,7 @@ tail: * xmlExpGetLanguage: * @ctxt: the expression context * @exp: the expression - * @list: where to store the tokens + * @langList: where to store the tokens * @len: the allocated lenght of @list * * Find all the strings used in @exp and store them in @list @@ -6144,10 +6479,10 @@ tail: */ int xmlExpGetLanguage(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, - const xmlChar**list, int len) { - if ((ctxt == NULL) || (exp == NULL) || (list == NULL) || (len <= 0)) + const xmlChar**langList, int len) { + if ((ctxt == NULL) || (exp == NULL) || (langList == NULL) || (len <= 0)) return(-1); - return(xmlExpGetLanguageInt(ctxt, exp, list, len, 0)); + return(xmlExpGetLanguageInt(ctxt, exp, langList, len, 0)); } static int @@ -6200,7 +6535,7 @@ tail: * xmlExpGetStart: * @ctxt: the expression context * @exp: the expression - * @list: where to store the tokens + * @tokList: where to store the tokens * @len: the allocated lenght of @list * * Find all the strings that appears at the start of the languages @@ -6212,10 +6547,10 @@ tail: */ int xmlExpGetStart(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, - const xmlChar**list, int len) { - if ((ctxt == NULL) || (exp == NULL) || (list == NULL) || (len <= 0)) + const xmlChar**tokList, int len) { + if ((ctxt == NULL) || (exp == NULL) || (tokList == NULL) || (len <= 0)) return(-1); - return(xmlExpGetStartInt(ctxt, exp, list, len, 0)); + return(xmlExpGetStartInt(ctxt, exp, tokList, len, 0)); } /** @@ -6861,10 +7196,10 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { len = xmlExpGetStartInt(ctxt, sub, tab, ctxt->tabSize, 0); while (len < 0) { const xmlChar **temp; - temp = (const xmlChar **) xmlRealloc(tab, ctxt->tabSize * 2 * + temp = (const xmlChar **) xmlRealloc((xmlChar **) tab, ctxt->tabSize * 2 * sizeof(const xmlChar *)); if (temp == NULL) { - xmlFree(tab); + xmlFree((xmlChar **) tab); return(NULL); } tab = temp; @@ -6875,14 +7210,14 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { tmp = xmlExpStringDeriveInt(ctxt, exp, tab[i]); if ((tmp == NULL) || (tmp == forbiddenExp)) { xmlExpFree(ctxt, ret); - xmlFree(tab); + xmlFree((xmlChar **) tab); return(tmp); } tmp2 = xmlExpStringDeriveInt(ctxt, sub, tab[i]); if ((tmp2 == NULL) || (tmp2 == forbiddenExp)) { xmlExpFree(ctxt, tmp); xmlExpFree(ctxt, ret); - xmlFree(tab); + xmlFree((xmlChar **) tab); return(tmp); } tmp3 = xmlExpExpDeriveInt(ctxt, tmp, tmp2); @@ -6891,7 +7226,7 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { if ((tmp3 == NULL) || (tmp3 == forbiddenExp)) { xmlExpFree(ctxt, ret); - xmlFree(tab); + xmlFree((xmlChar **) tab); return(tmp3); } @@ -6900,12 +7235,12 @@ xmlExpExpDeriveInt(xmlExpCtxtPtr ctxt, xmlExpNodePtr exp, xmlExpNodePtr sub) { else { ret = xmlExpHashGetEntry(ctxt, XML_EXP_OR, ret, tmp3, NULL, 0, 0); if (ret == NULL) { - xmlFree(tab); + xmlFree((xmlChar **) tab); return(NULL); } } } - xmlFree(tab); + xmlFree((xmlChar **) tab); return(ret); } diff --git a/xmlsave.c b/xmlsave.c index ca1d876..ba35f32 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -344,9 +344,9 @@ xmlSaveCtxtInit(xmlSaveCtxtPtr ctxt) ctxt->indent[ctxt->indent_nr * ctxt->indent_size] = 0; } - if (xmlSaveNoEmptyTags) { - ctxt->options |= XML_SAVE_NO_EMPTY; - } + if (xmlSaveNoEmptyTags) { + ctxt->options |= XML_SAVE_NO_EMPTY; + } } /** @@ -400,10 +400,10 @@ xmlNewSaveCtxt(const char *encoding, int options) * Use the options */ - /* Re-check this option as it may already have been set */ - if ((ret->options & XML_SAVE_NO_EMPTY) && ! (options & XML_SAVE_NO_EMPTY)) { - options |= XML_SAVE_NO_EMPTY; - } + /* Re-check this option as it may already have been set */ + if ((ret->options & XML_SAVE_NO_EMPTY) && ! (options & XML_SAVE_NO_EMPTY)) { + options |= XML_SAVE_NO_EMPTY; + } ret->options = options; if (options & XML_SAVE_FORMAT) @@ -1111,6 +1111,10 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur); return; } + if (cur->type == XML_DOCUMENT_FRAG_NODE) { + xhtmlNodeListDumpOutput(ctxt, cur->children); + return; + } buf = ctxt->buf; if (cur->type == XML_ELEMENT_DECL) { xmlDumpElementDecl(buf->buffer, (xmlElementPtr) cur); @@ -1473,13 +1477,36 @@ xmlSaveToFilename(const char *filename, const char *encoding, int options) * with the encoding and the options given * * Returns a new serialization context or NULL in case of error. + */ + xmlSaveCtxtPtr xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options) { - TODO - return(NULL); + xmlSaveCtxtPtr ret; + xmlOutputBufferPtr out_buff; + xmlCharEncodingHandlerPtr handler; + + ret = xmlNewSaveCtxt(encoding, options); + if (ret == NULL) return(NULL); + + if (encoding != NULL) { + handler = xmlFindCharEncodingHandler(encoding); + if (handler == NULL) { + xmlFree(ret); + return(NULL); + } + } else + handler = NULL; + out_buff = xmlOutputBufferCreateBuffer(buffer, handler); + if (out_buff == NULL) { + xmlFree(ret); + if (handler) xmlCharEncCloseFunc(handler); + return(NULL); + } + + ret->buf = out_buff; + return(ret); } - */ /** * xmlSaveToIO: diff --git a/xmlschemas.c b/xmlschemas.c index abc4802..0da3564 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -17,10 +17,32 @@ * against their types. * - Eliminate item creation for: ?? * + * URGENT TODO: + * - For xsi-driven schema acquisition, augment the IDCs after every + * acquisition episode (xmlSchemaAugmentIDC). + * * NOTES: * - Elimated item creation for: , , * , , , * + * PROBLEMS: + * - http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0337.html + * IDC XPath expression and chameleon includes: the targetNamespace is changed, so + * XPath will have trouble to resolve to this namespace, since not known. + * + * + * CONSTRAINTS: + * + * Schema Component Constraint: + * All Group Limited (cos-all-limited) + * Status: complete + * (1.2) + * In xmlSchemaGroupDefReferenceTermFixup() and + * (2) + * In xmlSchemaParseModelGroup() + * TODO: Actually this should go to component-level checks, + * but is done here due to performance. Move it to an other layer + * is schema construction via an API is implemented. */ #define IN_LIBXML #include "libxml.h" @@ -58,20 +80,24 @@ /* #define DEBUG_AUTOMATA 1 */ -#define DEBUG_ATTR_VALIDATION 0 +/* #define DEBUG_IDC */ -/* #define DEBUG_IDC 1 */ +/* #define DEBUG_IDC_NODE_TABLE */ -/* #define DEBUG_INCLUDES 1 */ +#ifdef DEBUG_IDC + #ifndef DEBUG_IDC_NODE_TABLE + #define DEBUG_IDC_NODE_TABLE + #endif +#endif /* #define ENABLE_PARTICLE_RESTRICTION 1 */ -/* #define ENABLE_SCHEMA_SPACES */ - -/* #define ENABLE_REDEFINE */ +#define ENABLE_REDEFINE /* #define ENABLE_NAMED_LOCALS */ +/* #define ENABLE_IDC_NODE_TABLES_TEST */ + #define DUMP_CONTENT_MODEL #ifdef LIBXML_READER_ENABLED @@ -98,101 +124,160 @@ static const xmlChar *xmlSchemaInstanceNs = (const xmlChar *) static const xmlChar *xmlNamespaceNs = (const xmlChar *) "http://www.w3.org/2000/xmlns/"; -static const xmlChar *xmlSchemaElemDesElemDecl = (const xmlChar *) - "element decl."; -static const xmlChar *xmlSchemaElemDesAttrDecl = (const xmlChar *) - "attribute decl."; -static const xmlChar *xmlSchemaElemDesAttrRef = (const xmlChar *) - "attribute use"; -static const xmlChar *xmlSchemaElemModelGrDef = (const xmlChar *) - "model group"; - -#define IS_SCHEMA(node, type) \ - ((node != NULL) && (node->ns != NULL) && \ - (xmlStrEqual(node->name, (const xmlChar *) type)) && \ - (xmlStrEqual(node->ns->href, xmlSchemaNs))) +/* +* Come casting macros. +*/ +#define ACTXT_CAST (xmlSchemaAbstractCtxtPtr) +#define PCTXT_CAST (xmlSchemaParserCtxtPtr) +#define VCTXT_CAST (xmlSchemaValidCtxtPtr) +#define WXS_BASIC_CAST (xmlSchemaBasicItemPtr) +#define WXS_TREE_CAST (xmlSchemaTreeItemPtr) +#define WXS_PTC_CAST (xmlSchemaParticlePtr) +#define WXS_TYPE_CAST (xmlSchemaTypePtr) +#define WXS_ELEM_CAST (xmlSchemaElementPtr) +#define WXS_ATTR_GROUP_CAST (xmlSchemaAttributeGroupPtr) +#define WXS_ATTR_CAST (xmlSchemaAttributePtr) +#define WXS_ATTR_USE_CAST (xmlSchemaAttributeUsePtr) +#define WXS_ATTR_PROHIB_CAST (xmlSchemaAttributeUseProhibPtr) +#define WXS_MODEL_GROUPDEF_CAST (xmlSchemaModelGroupDefPtr) +#define WXS_MODEL_GROUP_CAST (xmlSchemaModelGroupPtr) +#define WXS_IDC_CAST (xmlSchemaIDCPtr) +#define WXS_QNAME_CAST (xmlSchemaQNameRefPtr) +#define WXS_LIST_CAST (xmlSchemaItemListPtr) -#define FREE_AND_NULL(str) \ - if (str != NULL) { \ - xmlFree((xmlChar *) str); \ - str = NULL; \ - } +/* +* Macros to query common properties of components. +*/ +#define WXS_ITEM_NODE(i) xmlSchemaGetComponentNode(WXS_BASIC_CAST (i)) -#define IS_ANYTYPE(item) \ - ((item->type == XML_SCHEMA_TYPE_BASIC) && \ - (item->builtInType == XML_SCHEMAS_ANYTYPE)) +#define WXS_ITEM_TYPE_NAME(i) xmlSchemaGetComponentTypeStr(WXS_BASIC_CAST (i)) +/* +* Macros for element declarations. +*/ +#define WXS_ELEM_TYPEDEF(e) (e)->subtypes -#define IS_COMPLEX_TYPE(item) \ - ((item->type == XML_SCHEMA_TYPE_COMPLEX) || \ - (item->builtInType == XML_SCHEMAS_ANYTYPE)) +#define WXS_SUBST_HEAD(item) (item)->refDecl +/* +* Macros for attribute declarations. +*/ +#define WXS_ATTR_TYPEDEF(a) (a)->subtypes +/* +* Macros for attribute uses. +*/ +#define WXS_ATTRUSE_DECL(au) WXS_ATTR_CAST (WXS_ATTR_USE_CAST (au))->attrDecl -#define IS_SIMPLE_TYPE(item) \ - ((item->type == XML_SCHEMA_TYPE_SIMPLE) || \ - ((item->type == XML_SCHEMA_TYPE_BASIC) && \ - (item->builtInType != XML_SCHEMAS_ANYTYPE))) +#define WXS_ATTRUSE_TYPEDEF(au) WXS_ATTR_TYPEDEF(WXS_ATTRUSE_DECL( WXS_ATTR_USE_CAST au)) -#define IS_ANY_SIMPLE_TYPE(item) \ - ((item->type == XML_SCHEMA_TYPE_BASIC) && \ - (item->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) +#define WXS_ATTRUSE_DECL_NAME(au) (WXS_ATTRUSE_DECL(au))->name -#define IS_NOT_TYPEFIXED(item) \ - ((item->type != XML_SCHEMA_TYPE_BASIC) && \ - ((item->flags & XML_SCHEMAS_TYPE_INTERNAL_RESOLVED) == 0)) +#define WXS_ATTRUSE_DECL_TNS(au) (WXS_ATTRUSE_DECL(au))->targetNamespace +/* +* Macros for attribute groups. +*/ +#define WXS_ATTR_GROUP_HAS_REFS(ag) ((WXS_ATTR_GROUP_CAST (ag))->flags & XML_SCHEMAS_ATTRGROUP_HAS_REFS) +#define WXS_ATTR_GROUP_EXPANDED(ag) ((WXS_ATTR_GROUP_CAST (ag))->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED) +/* +* Macros for particles. +*/ +#define WXS_PARTICLE(p) WXS_PTC_CAST (p) -#define TYPE_IS_NOT_FIXEDUP_1(item) \ - (((item)->type != XML_SCHEMA_TYPE_BASIC) && \ - (((item)->flags & XML_SCHEMAS_TYPE_FIXUP_1) == 0)) +#define WXS_PARTICLE_TERM(p) (WXS_PARTICLE(p))->children -#define HAS_COMPLEX_CONTENT(item) \ - ((item->contentType == XML_SCHEMA_CONTENT_MIXED) || \ - (item->contentType == XML_SCHEMA_CONTENT_EMPTY) || \ - (item->contentType == XML_SCHEMA_CONTENT_ELEMENTS)) +#define WXS_PARTICLE_MODEL(p) WXS_MODEL_GROUP_CAST WXS_PARTICLE(p)->children +/* +* Macros for model groups definitions. +*/ +#define WXS_MODELGROUPDEF_MODEL(mgd) (WXS_MODEL_GROUP_CAST (mgd))->children +/* +* Macros for model groups. +*/ +#define WXS_IS_MODEL_GROUP(i) \ + (((i)->type == XML_SCHEMA_TYPE_SEQUENCE) || \ + ((i)->type == XML_SCHEMA_TYPE_CHOICE) || \ + ((i)->type == XML_SCHEMA_TYPE_ALL)) -#define HAS_SIMPLE_CONTENT(item) \ - ((item->contentType == XML_SCHEMA_CONTENT_SIMPLE) || \ - (item->contentType == XML_SCHEMA_CONTENT_BASIC)) +#define WXS_MODELGROUP_PARTICLE(mg) WXS_PTC_CAST (mg)->children +/* +* Macros for schema buckets. +*/ +#define WXS_IS_BUCKET_INCREDEF(t) (((t) == XML_SCHEMA_SCHEMA_INCLUDE) || \ + ((t) == XML_SCHEMA_SCHEMA_REDEFINE)) -#define HAS_MIXED_CONTENT(item) (item->contentType == XML_SCHEMA_CONTENT_MIXED) +#define WXS_IS_BUCKET_IMPMAIN(t) (((t) == XML_SCHEMA_SCHEMA_MAIN) || \ + ((t) == XML_SCHEMA_SCHEMA_IMPORT)) + +#define WXS_IMPBUCKET(b) ((xmlSchemaImportPtr) (b)) + +#define WXS_INCBUCKET(b) ((xmlSchemaIncludePtr) (b)) +/* +* Macros for complex/simple types. +*/ +#define WXS_IS_ANYTYPE(i) \ + (( (i)->type == XML_SCHEMA_TYPE_BASIC) && \ + ( (WXS_TYPE_CAST (i))->builtInType == XML_SCHEMAS_ANYTYPE)) -#define IS_PARTICLE_EMPTIABLE(item) \ - (xmlSchemaIsParticleEmptiable((xmlSchemaParticlePtr) item->subtypes)) +#define WXS_IS_COMPLEX(i) \ + (((i)->type == XML_SCHEMA_TYPE_COMPLEX) || \ + ((i)->builtInType == XML_SCHEMAS_ANYTYPE)) -#define GET_NODE(item) xmlSchemaGetComponentNode((xmlSchemaBasicItemPtr) item) +#define WXS_IS_SIMPLE(item) \ + ((item->type == XML_SCHEMA_TYPE_SIMPLE) || \ + ((item->type == XML_SCHEMA_TYPE_BASIC) && \ + (item->builtInType != XML_SCHEMAS_ANYTYPE))) -#define GET_LIST_ITEM_TYPE(item) item->subtypes +#define WXS_IS_ANY_SIMPLE_TYPE(i) \ + (((i)->type == XML_SCHEMA_TYPE_BASIC) && \ + ((i)->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) -#define VARIETY_ATOMIC(item) (item->flags & XML_SCHEMAS_TYPE_VARIETY_ATOMIC) -#define VARIETY_LIST(item) (item->flags & XML_SCHEMAS_TYPE_VARIETY_LIST) -#define VARIETY_UNION(item) (item->flags & XML_SCHEMAS_TYPE_VARIETY_UNION) +#define WXS_IS_RESTRICTION(t) \ + ((t)->flags & XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION) -#define IS_MODEL_GROUP(item) \ - ((item->type == XML_SCHEMA_TYPE_SEQUENCE) || \ - (item->type == XML_SCHEMA_TYPE_CHOICE) || \ - (item->type == XML_SCHEMA_TYPE_ALL)) +#define WXS_IS_EXTENSION(t) \ + ((t)->flags & XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION) -#define INODE_NILLED(item) (item->flags & XML_SCHEMA_ELEM_INFO_NILLED) +#define WXS_IS_TYPE_NOT_FIXED(i) \ + (((i)->type != XML_SCHEMA_TYPE_BASIC) && \ + (((i)->flags & XML_SCHEMAS_TYPE_INTERNAL_RESOLVED) == 0)) -#define ELEM_TYPE(item) item->subtypes +#define WXS_IS_TYPE_NOT_FIXED_1(item) \ + (((item)->type != XML_SCHEMA_TYPE_BASIC) && \ + (((item)->flags & XML_SCHEMAS_TYPE_FIXUP_1) == 0)) +/* +* Macros for exclusively for complex types. +*/ +#define WXS_HAS_COMPLEX_CONTENT(item) \ + ((item->contentType == XML_SCHEMA_CONTENT_MIXED) || \ + (item->contentType == XML_SCHEMA_CONTENT_EMPTY) || \ + (item->contentType == XML_SCHEMA_CONTENT_ELEMENTS)) -#define GET_PARTICLE(item) (xmlSchemaParticlePtr) item->subtypes; +#define WXS_HAS_SIMPLE_CONTENT(item) \ + ((item->contentType == XML_SCHEMA_CONTENT_SIMPLE) || \ + (item->contentType == XML_SCHEMA_CONTENT_BASIC)) -#define SUBST_GROUP_AFF(item) (item)->refDecl +#define WXS_HAS_MIXED_CONTENT(item) \ + (item->contentType == XML_SCHEMA_CONTENT_MIXED) -#define ACTXT_CAST (xmlSchemaAbstractCtxtPtr) +#define WXS_EMPTIABLE(t) \ + (xmlSchemaIsParticleEmptiable(WXS_PTC_CAST (t)->subtypes)) -#if 0 -#define WXS_GET_NEXT(item) \ - xmlSchemaGetNextComponent((xmlSchemaBasicItemPtr) item) -#endif +#define WXS_TYPE_CONTENTTYPE(t) (t)->subtypes -#define CAN_PARSE_SCHEMA(b) (((b)->doc != NULL) && ((b)->parsed == 0)) +#define WXS_TYPE_PARTICLE(t) WXS_PTC_CAST (t)->subtypes -#define HFAILURE if (res == -1) goto exit_failure; +#define WXS_TYPE_PARTICLE_TERM(t) WXS_PARTICLE_TERM(WXS_TYPE_PARTICLE(t)) +/* +* Macros for exclusively for simple types. +*/ +#define WXS_LIST_ITEMTYPE(t) (t)->subtypes -#define HERROR if (res != 0) goto exit_error; +#define WXS_IS_ATOMIC(t) (t->flags & XML_SCHEMAS_TYPE_VARIETY_ATOMIC) -#define HSTOP(ctx) if ((ctx)->stop) goto exit; +#define WXS_IS_LIST(t) (t->flags & XML_SCHEMAS_TYPE_VARIETY_LIST) +#define WXS_IS_UNION(t) (t->flags & XML_SCHEMAS_TYPE_VARIETY_UNION) +/* +* Misc parser context macros. +*/ #define WXS_CONSTRUCTOR(ctx) (ctx)->constructor #define WXS_HAS_BUCKETS(ctx) \ @@ -201,47 +286,57 @@ static const xmlChar *xmlSchemaElemModelGrDef = (const xmlChar *) #define WXS_SUBST_GROUPS(ctx) WXS_CONSTRUCTOR((ctx))->substGroups -#define WXS_SCHEMA_BUCKET(ctx) WXS_CONSTRUCTOR((ctx))->bucket +#define WXS_BUCKET(ctx) WXS_CONSTRUCTOR((ctx))->bucket #define WXS_SCHEMA(ctx) (ctx)->schema -#define ADD_LOCAL_ITEM(ctx, item) \ - xmlSchemaAddItem(&(WXS_SCHEMA_BUCKET(ctx)->locals), item) - -#define ADD_GLOBAL_ITEM(ctx, item) \ - xmlSchemaAddItem(&(WXS_SCHEMA_BUCKET(ctx)->globals), item) +#define WXS_ADD_LOCAL(ctx, item) \ + xmlSchemaAddItemSize(&(WXS_BUCKET(ctx)->locals), 10, item) -#define WXS_ADD_PENDING_ITEM(ctx, item) \ - xmlSchemaAddItem(&((ctx)->constructor->pending), item) +#define WXS_ADD_GLOBAL(ctx, item) \ + xmlSchemaAddItemSize(&(WXS_BUCKET(ctx)->globals), 5, item) -#define WXS_IS_RESTRICTION(t) \ - ((t)->flags & XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION) +#define WXS_ADD_PENDING(ctx, item) \ + xmlSchemaAddItemSize(&((ctx)->constructor->pending), 10, item) +/* +* xmlSchemaItemList macros. +*/ +#define WXS_ILIST_IS_EMPTY(l) ((l == NULL) || ((l)->nbItems == 0)) +/* +* Misc macros. +*/ +#define IS_SCHEMA(node, type) \ + ((node != NULL) && (node->ns != NULL) && \ + (xmlStrEqual(node->name, (const xmlChar *) type)) && \ + (xmlStrEqual(node->ns->href, xmlSchemaNs))) -#define WXS_IS_EXTENSION(t) \ - ((t)->flags & XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION) +#define FREE_AND_NULL(str) if ((str) != NULL) { xmlFree((xmlChar *) (str)); str = NULL; } /* -* @b: The schema bucket +* Since we put the default/fixed values into the dict, we can +* use pointer comparison for those values. +* REMOVED: (xmlStrEqual((v1), (v2))) */ -#define WXS_IS_INCREDEF(t) (((t) == XML_SCHEMA_SCHEMA_INCLUDE) || \ - ((t) == XML_SCHEMA_SCHEMA_REDEFINE)) +#define WXS_ARE_DEFAULT_STR_EQUAL(v1, v2) ((v1) == (v2)) -#define WXS_IS_IMPMAIN(t) (((t) == XML_SCHEMA_SCHEMA_MAIN) || \ - ((t) == XML_SCHEMA_SCHEMA_IMPORT)) +#define INODE_NILLED(item) (item->flags & XML_SCHEMA_ELEM_INFO_NILLED) + +#define CAN_PARSE_SCHEMA(b) (((b)->doc != NULL) && ((b)->parsed == 0)) + +#define HFAILURE if (res == -1) goto exit_failure; -#define IMPBUCKET_CAST(b) ((xmlSchemaImportPtr) (b)) -#define INCBUCKET_CAST(b) ((xmlSchemaIncludePtr) (b)) +#define HERROR if (res != 0) goto exit_error; +#define HSTOP(ctx) if ((ctx)->stop) goto exit; +/* +* Some flags used for various schema constraints. +*/ #define SUBSET_RESTRICTION 1<<0 #define SUBSET_EXTENSION 1<<1 #define SUBSET_SUBSTITUTION 1<<2 #define SUBSET_LIST 1<<3 #define SUBSET_UNION 1<<4 -#define XML_SCHEMAS_PARSE_ERROR 1 - -#define SCHEMAS_PARSE_OPTIONS XML_PARSE_NOENT - typedef struct _xmlSchemaNodeInfo xmlSchemaNodeInfo; typedef xmlSchemaNodeInfo *xmlSchemaNodeInfoPtr; @@ -253,10 +348,13 @@ struct _xmlSchemaItemList { int sizeItems; /* used for dynamic addition of schemata */ }; +#define XML_SCHEMA_CTXT_PARSER 1 +#define XML_SCHEMA_CTXT_VALIDATOR 2 + typedef struct _xmlSchemaAbstractCtxt xmlSchemaAbstractCtxt; typedef xmlSchemaAbstractCtxt *xmlSchemaAbstractCtxtPtr; struct _xmlSchemaAbstractCtxt { - int type; + int type; /* E.g. XML_SCHEMA_CTXT_VALIDATOR */ }; typedef struct _xmlSchemaBucket xmlSchemaBucket; @@ -281,8 +379,12 @@ struct _xmlSchemaSchemaRelation { xmlSchemaBucketPtr bucket; }; +#define XML_SCHEMA_BUCKET_MARKED 1<<0 +#define XML_SCHEMA_BUCKET_COMPS_ADDED 1<<1 + struct _xmlSchemaBucket { int type; + int flags; const xmlChar *schemaLocation; const xmlChar *origTargetNamespace; const xmlChar *targetNamespace; @@ -308,6 +410,7 @@ typedef struct _xmlSchemaImport xmlSchemaImport; typedef xmlSchemaImport *xmlSchemaImportPtr; struct _xmlSchemaImport { int type; /* Main OR import OR include. */ + int flags; const xmlChar *schemaLocation; /* The URI of the schema document. */ /* For chameleon includes, @origTargetNamespace will be NULL */ const xmlChar *origTargetNamespace; @@ -336,6 +439,7 @@ typedef struct _xmlSchemaInclude xmlSchemaInclude; typedef xmlSchemaInclude *xmlSchemaIncludePtr; struct _xmlSchemaInclude { int type; + int flags; const xmlChar *schemaLocation; const xmlChar *origTargetNamespace; const xmlChar *targetNamespace; @@ -352,38 +456,142 @@ struct _xmlSchemaInclude { xmlSchemaImportPtr ownerImport; }; +/** + * xmlSchemaBasicItem: + * + * The abstract base type for schema components. + */ +typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem; +typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr; +struct _xmlSchemaBasicItem { + xmlSchemaTypeType type; +}; + +/** + * xmlSchemaAnnotItem: + * + * The abstract base type for annotated schema components. + * (Extends xmlSchemaBasicItem) + */ +typedef struct _xmlSchemaAnnotItem xmlSchemaAnnotItem; +typedef xmlSchemaAnnotItem *xmlSchemaAnnotItemPtr; +struct _xmlSchemaAnnotItem { + xmlSchemaTypeType type; + xmlSchemaAnnotPtr annot; +}; + +/** + * xmlSchemaTreeItem: + * + * The abstract base type for tree-like structured schema components. + * (Extends xmlSchemaAnnotItem) + */ +typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem; +typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr; +struct _xmlSchemaTreeItem { + xmlSchemaTypeType type; + xmlSchemaAnnotPtr annot; + xmlSchemaTreeItemPtr next; + xmlSchemaTreeItemPtr children; +}; + + +#define XML_SCHEMA_ATTR_USE_FIXED 1<<0 +/** + * xmlSchemaAttributeUsePtr: + * + * The abstract base type for tree-like structured schema components. + * (Extends xmlSchemaTreeItem) + */ +typedef struct _xmlSchemaAttributeUse xmlSchemaAttributeUse; +typedef xmlSchemaAttributeUse *xmlSchemaAttributeUsePtr; +struct _xmlSchemaAttributeUse { + xmlSchemaTypeType type; + xmlSchemaAnnotPtr annot; + xmlSchemaAttributeUsePtr next; /* The next attr. use. */ + /* + * The attr. decl. OR a QName-ref. to an attr. decl. OR + * a QName-ref. to an attribute group definition. + */ + xmlSchemaAttributePtr attrDecl; + + int flags; + xmlNodePtr node; + int occurs; /* required, optional */ + const xmlChar * defValue; + xmlSchemaValPtr defVal; +}; + +/** + * xmlSchemaAttributeUseProhibPtr: + * + * A helper component to reflect attribute prohibitions. + * (Extends xmlSchemaBasicItem) + */ +typedef struct _xmlSchemaAttributeUseProhib xmlSchemaAttributeUseProhib; +typedef xmlSchemaAttributeUseProhib *xmlSchemaAttributeUseProhibPtr; +struct _xmlSchemaAttributeUseProhib { + xmlSchemaTypeType type; /* == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB */ + xmlNodePtr node; + const xmlChar *name; + const xmlChar *targetNamespace; + int isRef; +}; + +/** + * xmlSchemaRedef: + */ +typedef struct _xmlSchemaRedef xmlSchemaRedef; +typedef xmlSchemaRedef *xmlSchemaRedefPtr; +struct _xmlSchemaRedef { + xmlSchemaRedefPtr next; + xmlSchemaBasicItemPtr item; /* The redefining component. */ + xmlSchemaBasicItemPtr reference; /* The referencing component. */ + xmlSchemaBasicItemPtr target; /* The to-be-redefined component. */ + const xmlChar *refName; /* The name of the to-be-redefined component. */ + const xmlChar *refTargetNs; /* The target namespace of the + to-be-redefined comp. */ + xmlSchemaBucketPtr targetBucket; /* The redefined schema. */ +}; + +/** + * xmlSchemaConstructionCtxt: + */ typedef struct _xmlSchemaConstructionCtxt xmlSchemaConstructionCtxt; typedef xmlSchemaConstructionCtxt *xmlSchemaConstructionCtxtPtr; struct _xmlSchemaConstructionCtxt { - xmlSchemaPtr schema; /* The main schema. */ + xmlSchemaPtr mainSchema; /* The main schema. */ + xmlSchemaBucketPtr mainBucket; /* The main schema bucket */ xmlDictPtr dict; xmlSchemaItemListPtr buckets; /* List of schema buckets. */ /* xmlSchemaItemListPtr relations; */ /* List of schema relations. */ - xmlSchemaBucketPtr bucket; /* The current schema bucket */ - /* All Components of all schemas that need to be fixed. */ - xmlSchemaItemListPtr pending; + xmlSchemaBucketPtr bucket; /* The current schema bucket */ + xmlSchemaItemListPtr pending; /* All Components of all schemas that + need to be fixed. */ xmlHashTablePtr substGroups; + xmlSchemaRedefPtr redefs; + xmlSchemaRedefPtr lastRedef; }; -#define XML_SCHEMA_CTXT_PARSER 1 -#define XML_SCHEMA_CTXT_VALIDATOR 2 +#define XML_SCHEMAS_PARSE_ERROR 1 +#define SCHEMAS_PARSE_OPTIONS XML_PARSE_NOENT struct _xmlSchemaParserCtxt { int type; - void *userData; /* user specific data block */ + void *errCtxt; /* user specific error context */ xmlSchemaValidityErrorFunc error; /* the callback in case of errors */ xmlSchemaValidityWarningFunc warning; /* the callback in case of warning */ - xmlSchemaValidError err; + int err; int nberrors; xmlStructuredErrorFunc serror; xmlSchemaConstructionCtxtPtr constructor; - int ownsConstructor; /* TODO: Move this to parser flags. */ + int ownsConstructor; /* TODO: Move this to parser *flags*. */ - /* xmlSchemaPtr topschema; The main schema */ - /* xmlHashTablePtr namespaces; Hash table of namespaces to schemas */ + /* xmlSchemaPtr topschema; */ + /* xmlHashTablePtr namespaces; */ - xmlSchemaPtr schema; /* The schema in use */ + xmlSchemaPtr schema; /* The main schema in use */ int counter; const xmlChar *URL; @@ -403,7 +611,6 @@ struct _xmlSchemaParserCtxt { xmlDictPtr dict; /* dictionnary for interned string names */ xmlSchemaTypePtr ctxtType; /* The current context simple/complex type */ - xmlSchemaTypePtr parentItem; /* The current parent schema item */ int options; xmlSchemaValidCtxtPtr vctxt; int isS4S; @@ -411,63 +618,11 @@ struct _xmlSchemaParserCtxt { int xsiAssemble; int stop; /* If the parser should stop; i.e. a critical error. */ const xmlChar *targetNamespace; -}; - -#define XML_SCHEMAS_ATTR_UNKNOWN 1 -#define XML_SCHEMAS_ATTR_ASSESSED 2 -#define XML_SCHEMAS_ATTR_PROHIBITED 3 -#define XML_SCHEMAS_ATTR_ERR_MISSING 4 -#define XML_SCHEMAS_ATTR_INVALID_VALUE 5 -#define XML_SCHEMAS_ATTR_ERR_NO_TYPE 6 -#define XML_SCHEMAS_ATTR_ERR_FIXED_VALUE 7 -#define XML_SCHEMAS_ATTR_DEFAULT 8 -#define XML_SCHEMAS_ATTR_VALIDATE_VALUE 9 -#define XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL 10 -#define XML_SCHEMAS_ATTR_HAS_ATTR_USE 11 -#define XML_SCHEMAS_ATTR_HAS_ATTR_DECL 12 -#define XML_SCHEMAS_ATTR_WILD_SKIP 13 -#define XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL 14 -#define XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID 15 -#define XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID 16 -#define XML_SCHEMAS_ATTR_META 17 - -/** - * xmlSchemaBasicItem: - * - * The abstract base type for schema components. - */ -typedef struct _xmlSchemaBasicItem xmlSchemaBasicItem; -typedef xmlSchemaBasicItem *xmlSchemaBasicItemPtr; -struct _xmlSchemaBasicItem { - xmlSchemaTypeType type; -}; - -/** - * xmlSchemaAnnotItem: - * - * The abstract base type for annotated schema components. - * (Extends xmlSchemaBasicItem) - */ -typedef struct _xmlSchemaAnnotItem xmlSchemaAnnotItem; -typedef xmlSchemaAnnotItem *xmlSchemaAnnotItemPtr; -struct _xmlSchemaAnnotItem { - xmlSchemaTypeType type; - xmlSchemaAnnotPtr annot; -}; + xmlSchemaBucketPtr redefined; /* The schema to be redefined. */ -/** - * xmlSchemaTreeItem: - * - * The abstract base type for tree-like structured schema components. - * (Extends xmlSchemaAnnotItem) - */ -typedef struct _xmlSchemaTreeItem xmlSchemaTreeItem; -typedef xmlSchemaTreeItem *xmlSchemaTreeItemPtr; -struct _xmlSchemaTreeItem { - xmlSchemaTypeType type; - xmlSchemaAnnotPtr annot; - xmlSchemaTreeItemPtr next; - xmlSchemaTreeItemPtr children; + xmlSchemaRedefPtr redef; /* Used for redefinitions. */ + int redefCounter; /* Used for redefinitions. */ + xmlSchemaItemListPtr attrProhibs; }; /** @@ -480,10 +635,11 @@ typedef struct _xmlSchemaQNameRef xmlSchemaQNameRef; typedef xmlSchemaQNameRef *xmlSchemaQNameRefPtr; struct _xmlSchemaQNameRef { xmlSchemaTypeType type; - xmlSchemaBasicItemPtr item; + xmlSchemaBasicItemPtr item; /* The resolved referenced item. */ xmlSchemaTypeType itemType; const xmlChar *name; const xmlChar *targetNamespace; + xmlNodePtr node; }; /** @@ -497,8 +653,10 @@ typedef xmlSchemaParticle *xmlSchemaParticlePtr; struct _xmlSchemaParticle { xmlSchemaTypeType type; xmlSchemaAnnotPtr annot; - xmlSchemaTreeItemPtr next; /* next particle (OR "element decl" OR "wildcard") */ - xmlSchemaTreeItemPtr children; /* the "term" ("model group" OR "group definition") */ + xmlSchemaTreeItemPtr next; /* next particle */ + xmlSchemaTreeItemPtr children; /* the "term" (e.g. a model group, + a group definition, a XML_SCHEMA_EXTRA_QNAMEREF (if a reference), + etc.) */ int minOccurs; int maxOccurs; xmlNodePtr node; @@ -521,6 +679,7 @@ struct _xmlSchemaModelGroup { }; #define XML_SCHEMA_MODEL_GROUP_DEF_MARKED 1<<0 +#define XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED 1<<1 /** * xmlSchemaModelGroupDef: * @@ -538,7 +697,6 @@ struct _xmlSchemaModelGroupDef { const xmlChar *targetNamespace; xmlNodePtr node; int flags; - xmlSchemaModelGroupDefPtr redef; /* Redefinitions. */ }; typedef struct _xmlSchemaIDC xmlSchemaIDC; @@ -590,7 +748,7 @@ typedef xmlSchemaIDCAug *xmlSchemaIDCAugPtr; struct _xmlSchemaIDCAug { xmlSchemaIDCAugPtr next; /* next in a list */ xmlSchemaIDCPtr def; /* the IDC definition */ - int bubbleDepth; /* the lowest tree level to which IDC + int keyrefDepth; /* the lowest tree level to which IDC tables need to be bubbled upwards */ }; @@ -634,11 +792,10 @@ struct _xmlSchemaPSVIIDCBinding { xmlSchemaPSVIIDCNodePtr *nodeTable; /* array of key-sequences */ int nbNodes; /* number of entries in the node table */ int sizeNodes; /* size of the node table */ - int nbDupls; /* number of already identified duplicates in the node - table */ - /* int nbKeys; number of keys in each key-sequence */ + xmlSchemaItemListPtr dupls; }; + #define XPATH_STATE_OBJ_TYPE_IDC_SELECTOR 1 #define XPATH_STATE_OBJ_TYPE_IDC_FIELD 2 @@ -673,17 +830,20 @@ struct _xmlSchemaIDCStateObj { /** * xmlSchemaIDCMatcher: * - * Used to IDC selectors (and fields) successively. + * Used to evaluate IDC selectors (and fields). */ struct _xmlSchemaIDCMatcher { int type; int depth; /* the tree depth at creation time */ xmlSchemaIDCMatcherPtr next; /* next in the list */ xmlSchemaIDCAugPtr aidc; /* the augmented IDC item */ + int idcType; xmlSchemaPSVIIDCKeyPtr **keySeqs; /* the key-sequences of the target elements */ int sizeKeySeqs; int targetDepth; + xmlSchemaItemListPtr targets; /* list of target-node + (xmlSchemaPSVIIDCNodePtr) entries */ }; /* @@ -733,9 +893,29 @@ struct _xmlSchemaNodeInfo { const xmlChar **nsBindings; /* Namespace bindings on this element */ int nbNsBindings; - int sizeNsBindings; + int sizeNsBindings; + + int hasKeyrefs; + int appliedXPath; /* Indicates that an XPath has been applied. */ }; +#define XML_SCHEMAS_ATTR_UNKNOWN 1 +#define XML_SCHEMAS_ATTR_ASSESSED 2 +#define XML_SCHEMAS_ATTR_PROHIBITED 3 +#define XML_SCHEMAS_ATTR_ERR_MISSING 4 +#define XML_SCHEMAS_ATTR_INVALID_VALUE 5 +#define XML_SCHEMAS_ATTR_ERR_NO_TYPE 6 +#define XML_SCHEMAS_ATTR_ERR_FIXED_VALUE 7 +#define XML_SCHEMAS_ATTR_DEFAULT 8 +#define XML_SCHEMAS_ATTR_VALIDATE_VALUE 9 +#define XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL 10 +#define XML_SCHEMAS_ATTR_HAS_ATTR_USE 11 +#define XML_SCHEMAS_ATTR_HAS_ATTR_DECL 12 +#define XML_SCHEMAS_ATTR_WILD_SKIP 13 +#define XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL 14 +#define XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID 15 +#define XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID 16 +#define XML_SCHEMAS_ATTR_META 17 /* * @metaType values of xmlSchemaAttrInfo. */ @@ -759,7 +939,7 @@ struct _xmlSchemaAttrInfo { int flags; /* combination of node info flags */ xmlSchemaAttributePtr decl; /* the attribute declaration */ - xmlSchemaAttributePtr use; /* the attribute use */ + xmlSchemaAttributeUsePtr use; /* the attribute use */ int state; int metaType; const xmlChar *vcValue; /* the value constraint value */ @@ -775,7 +955,7 @@ struct _xmlSchemaAttrInfo { */ struct _xmlSchemaValidCtxt { int type; - void *userData; /* user specific data block */ + void *errCtxt; /* user specific data block */ xmlSchemaValidityErrorFunc error; /* the callback in case of errors */ xmlSchemaValidityWarningFunc warning; /* the callback in case of warning */ xmlStructuredErrorFunc serror; @@ -786,7 +966,7 @@ struct _xmlSchemaValidCtxt { xmlCharEncoding enc; xmlSAXHandlerPtr sax; xmlParserCtxtPtr parserCtxt; - void *user_data; + void *user_data; /* TODO: What is this for? */ int err; int nberrors; @@ -836,6 +1016,9 @@ struct _xmlSchemaValidCtxt { int skipDepth; xmlSchemaItemListPtr nodeQNames; + int hasKeyrefs; + int createIDCNodeTables; + int psviExposeIDCNodeTables; }; /** @@ -864,7 +1047,7 @@ static int xmlSchemaParseRedefine(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node); static int xmlSchemaTypeFixup(xmlSchemaTypePtr type, - xmlSchemaParserCtxtPtr ctxt); + xmlSchemaAbstractCtxtPtr ctxt); static const xmlChar * xmlSchemaFacetTypeToString(xmlSchemaTypeType type); static int @@ -882,7 +1065,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlNodePtr node, xmlSchemaTypeType type, int withParticle); static const xmlChar * -xmlSchemaCompTypeToString(xmlSchemaTypeType type); +xmlSchemaGetComponentTypeStr(xmlSchemaBasicItemPtr item); static xmlSchemaTypeLinkPtr xmlSchemaGetUnionSimpleTypeMemberTypes(xmlSchemaTypePtr type); static void @@ -890,7 +1073,8 @@ xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt, const char *funcName, const char *message); static int -xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, +xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt, + xmlSchemaTypePtr type, xmlSchemaTypePtr baseType, int subset); static void @@ -898,6 +1082,10 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl, xmlSchemaParserCtxtPtr ctxt); static void xmlSchemaComponentListFree(xmlSchemaItemListPtr list); +static xmlSchemaQNameRefPtr +xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node); /************************************************************************ * * @@ -906,21 +1094,25 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list); ************************************************************************/ /** - * xmlSchemaCompTypeToString: + * xmlSchemaItemTypeToStr: * @type: the type of the schema item * * Returns the component name of a schema item. */ static const xmlChar * -xmlSchemaCompTypeToString(xmlSchemaTypeType type) +xmlSchemaItemTypeToStr(xmlSchemaTypeType type) { switch (type) { + case XML_SCHEMA_TYPE_BASIC: + return(BAD_CAST "simple type definition"); case XML_SCHEMA_TYPE_SIMPLE: return(BAD_CAST "simple type definition"); case XML_SCHEMA_TYPE_COMPLEX: return(BAD_CAST "complex type definition"); case XML_SCHEMA_TYPE_ELEMENT: return(BAD_CAST "element declaration"); + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + return(BAD_CAST "attribute use"); case XML_SCHEMA_TYPE_ATTRIBUTE: return(BAD_CAST "attribute declaration"); case XML_SCHEMA_TYPE_GROUP: @@ -950,14 +1142,36 @@ xmlSchemaCompTypeToString(xmlSchemaTypeType type) return(BAD_CAST "wildcard (any)"); case XML_SCHEMA_EXTRA_QNAMEREF: return(BAD_CAST "[helper component] QName reference"); + case XML_SCHEMA_EXTRA_ATTR_USE_PROHIB: + return(BAD_CAST "[helper component] attribute use prohibition"); default: return(BAD_CAST "Not a schema component"); } } /** - * xmlSchemaGetComponentNode: - * @item: a schema component + * xmlSchemaGetComponentTypeStr: + * @type: the type of the schema item + * + * Returns the component name of a schema item. + */ +static const xmlChar * +xmlSchemaGetComponentTypeStr(xmlSchemaBasicItemPtr item) +{ + switch (item->type) { + case XML_SCHEMA_TYPE_BASIC: + if (WXS_IS_COMPLEX(WXS_TYPE_CAST item)) + return(BAD_CAST "complex type definition"); + else + return(BAD_CAST "simple type definition"); + default: + return(xmlSchemaItemTypeToStr(item->type)); + } +} + +/** + * xmlSchemaGetComponentNode: + * @item: a schema component * * Returns node associated with the schema component. * NOTE that such a node need not be available; plus, a component's @@ -993,6 +1207,14 @@ xmlSchemaGetComponentNode(xmlSchemaBasicItemPtr item) case XML_SCHEMA_TYPE_IDC_KEY: case XML_SCHEMA_TYPE_IDC_KEYREF: return (((xmlSchemaIDCPtr) item)->node); + case XML_SCHEMA_EXTRA_QNAMEREF: + return(((xmlSchemaQNameRefPtr) item)->node); + /* TODO: What to do with NOTATIONs? + case XML_SCHEMA_TYPE_NOTATION: + return (((xmlSchemaNotationPtr) item)->node); + */ + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + return (((xmlSchemaAttributeUsePtr) item)->node); default: return (NULL); } @@ -1039,37 +1261,6 @@ xmlSchemaGetNextComponent(xmlSchemaBasicItemPtr item) } #endif -/** - * xmlSchemaGetAttrName: - * @attr: the attribute declaration/use - * - * Returns the name of the attribute; if the attribute - * is a reference, the name of the referenced global type will be returned. - */ -static const xmlChar * -xmlSchemaGetAttrName(xmlSchemaAttributePtr attr) -{ - if (attr->ref != NULL) - return(attr->ref); - else - return(attr->name); -} - -/** - * xmlSchemaGetAttrTargetNsURI: - * @type: the type (element or attribute) - * - * Returns the target namespace URI of the type; if the type is a reference, - * the target namespace of the referenced type will be returned. - */ -static const xmlChar * -xmlSchemaGetAttrTargetNsURI(xmlSchemaAttributePtr attr) -{ - if (attr->ref != NULL) - return (attr->refNs); - else - return(attr->targetNamespace); -} /** * xmlSchemaFormatQName: @@ -1089,14 +1280,18 @@ xmlSchemaFormatQName(xmlChar **buf, const xmlChar *localName) { FREE_AND_NULL(*buf) - if (namespaceName == NULL) - return(localName); - - *buf = xmlStrdup(BAD_CAST "{"); - *buf = xmlStrcat(*buf, namespaceName); - *buf = xmlStrcat(*buf, BAD_CAST "}"); - *buf = xmlStrcat(*buf, localName); - + if (namespaceName != NULL) { + *buf = xmlStrdup(BAD_CAST "{"); + *buf = xmlStrcat(*buf, namespaceName); + *buf = xmlStrcat(*buf, BAD_CAST "}"); + } + if (localName != NULL) { + if (namespaceName == NULL) + return(localName); + *buf = xmlStrcat(*buf, localName); + } else { + *buf = xmlStrcat(*buf, BAD_CAST "(NULL)"); + } return ((const xmlChar *) *buf); } @@ -1129,6 +1324,16 @@ xmlSchemaGetComponentName(xmlSchemaBasicItemPtr item) case XML_SCHEMA_TYPE_IDC_UNIQUE: case XML_SCHEMA_TYPE_IDC_KEYREF: return (((xmlSchemaIDCPtr) item)->name); + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + if (WXS_ATTRUSE_DECL(item) != NULL) { + return(xmlSchemaGetComponentName( + WXS_BASIC_CAST WXS_ATTRUSE_DECL(item))); + } else + return(NULL); + case XML_SCHEMA_EXTRA_QNAMEREF: + return (((xmlSchemaQNameRefPtr) item)->name); + case XML_SCHEMA_TYPE_NOTATION: + return (((xmlSchemaNotationPtr) item)->name); default: /* * Other components cannot have names. @@ -1138,6 +1343,22 @@ xmlSchemaGetComponentName(xmlSchemaBasicItemPtr item) return (NULL); } +#define xmlSchemaGetQNameRefName(r) (WXS_QNAME_CAST (r))->name +#define xmlSchemaGetQNameRefTargetNs(r) (WXS_QNAME_CAST (r))->targetNamespace +/* +static const xmlChar * +xmlSchemaGetQNameRefName(void *ref) +{ + return(((xmlSchemaQNameRefPtr) ref)->name); +} + +static const xmlChar * +xmlSchemaGetQNameRefTargetNs(void *ref) +{ + return(((xmlSchemaQNameRefPtr) ref)->targetNamespace); +} +*/ + static const xmlChar * xmlSchemaGetComponentTargetNs(xmlSchemaBasicItemPtr item) { @@ -1159,6 +1380,17 @@ xmlSchemaGetComponentTargetNs(xmlSchemaBasicItemPtr item) case XML_SCHEMA_TYPE_IDC_UNIQUE: case XML_SCHEMA_TYPE_IDC_KEYREF: return (((xmlSchemaIDCPtr) item)->targetNamespace); + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + if (WXS_ATTRUSE_DECL(item) != NULL) { + return(xmlSchemaGetComponentTargetNs( + WXS_BASIC_CAST WXS_ATTRUSE_DECL(item))); + } + /* TODO: Will returning NULL break something? */ + break; + case XML_SCHEMA_EXTRA_QNAMEREF: + return (((xmlSchemaQNameRefPtr) item)->targetNamespace); + case XML_SCHEMA_TYPE_NOTATION: + return (((xmlSchemaNotationPtr) item)->targetNamespace); default: /* * Other components cannot have names. @@ -1178,18 +1410,25 @@ xmlSchemaGetComponentQName(xmlChar **buf, } static const xmlChar* -xmlSchemaGetIDCDesignation(xmlChar **buf, xmlSchemaIDCPtr idc) +xmlSchemaGetComponentDesignation(xmlChar **buf, void *item) { xmlChar *str = NULL; - *buf = xmlStrcat(*buf, xmlSchemaCompTypeToString(idc->type)); + *buf = xmlStrcat(*buf, WXS_ITEM_TYPE_NAME(item)); *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, xmlSchemaGetComponentQName(&str, idc)); + *buf = xmlStrcat(*buf, xmlSchemaGetComponentQName(&str, + (xmlSchemaBasicItemPtr) item)); *buf = xmlStrcat(*buf, BAD_CAST "'"); FREE_AND_NULL(str); return(*buf); } +static const xmlChar* +xmlSchemaGetIDCDesignation(xmlChar **buf, xmlSchemaIDCPtr idc) +{ + return(xmlSchemaGetComponentDesignation(buf, idc)); +} + /** * xmlSchemaWildcardPCToString: * @pc: the type of processContents @@ -1316,7 +1555,7 @@ internal_error: static xmlChar* xmlSchemaFormatItemForReport(xmlChar **buf, const xmlChar *itemDes, - xmlSchemaTypePtr item, + xmlSchemaBasicItemPtr item, xmlNodePtr itemNode) { xmlChar *str = NULL; @@ -1331,84 +1570,99 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrdup(itemDes); } else if (item != NULL) { switch (item->type) { - case XML_SCHEMA_TYPE_BASIC: - if (VARIETY_ATOMIC(item)) + case XML_SCHEMA_TYPE_BASIC: { + xmlSchemaTypePtr type = WXS_TYPE_CAST item; + + if (WXS_IS_ATOMIC(type)) *buf = xmlStrdup(BAD_CAST "atomic type 'xs:"); - else if (VARIETY_LIST(item)) + else if (WXS_IS_LIST(type)) *buf = xmlStrdup(BAD_CAST "list type 'xs:"); - else if (VARIETY_UNION(item)) + else if (WXS_IS_UNION(type)) *buf = xmlStrdup(BAD_CAST "union type 'xs:"); else *buf = xmlStrdup(BAD_CAST "simple type 'xs:"); - *buf = xmlStrcat(*buf, item->name); + *buf = xmlStrcat(*buf, type->name); *buf = xmlStrcat(*buf, BAD_CAST "'"); + } break; - case XML_SCHEMA_TYPE_SIMPLE: - if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) { + case XML_SCHEMA_TYPE_SIMPLE: { + xmlSchemaTypePtr type = WXS_TYPE_CAST item; + + if (type->flags & XML_SCHEMAS_TYPE_GLOBAL) { *buf = xmlStrdup(BAD_CAST""); } else { *buf = xmlStrdup(BAD_CAST "local "); } - if (VARIETY_ATOMIC(item)) + if (WXS_IS_ATOMIC(type)) *buf = xmlStrcat(*buf, BAD_CAST "atomic type"); - else if (VARIETY_LIST(item)) + else if (WXS_IS_LIST(type)) *buf = xmlStrcat(*buf, BAD_CAST "list type"); - else if (VARIETY_UNION(item)) + else if (WXS_IS_UNION(type)) *buf = xmlStrcat(*buf, BAD_CAST "union type"); else *buf = xmlStrcat(*buf, BAD_CAST "simple type"); - if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) { + if (type->flags & XML_SCHEMAS_TYPE_GLOBAL) { *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, item->name); + *buf = xmlStrcat(*buf, type->name); *buf = xmlStrcat(*buf, BAD_CAST "'"); } + } break; - case XML_SCHEMA_TYPE_COMPLEX: - if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) + case XML_SCHEMA_TYPE_COMPLEX: { + xmlSchemaTypePtr type = WXS_TYPE_CAST item; + + if (type->flags & XML_SCHEMAS_TYPE_GLOBAL) *buf = xmlStrdup(BAD_CAST ""); else *buf = xmlStrdup(BAD_CAST "local "); *buf = xmlStrcat(*buf, BAD_CAST "complex type"); - if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) { + if (type->flags & XML_SCHEMAS_TYPE_GLOBAL) { *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, item->name); + *buf = xmlStrcat(*buf, type->name); *buf = xmlStrcat(*buf, BAD_CAST "'"); } + } break; - case XML_SCHEMA_TYPE_ATTRIBUTE: { - xmlSchemaAttributePtr attr; + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: { + xmlSchemaAttributeUsePtr ause; - attr = (xmlSchemaAttributePtr) item; - if ((attr->flags & XML_SCHEMAS_ATTR_GLOBAL) || - (attr->ref == NULL)) { - *buf = xmlStrdup(xmlSchemaElemDesAttrDecl); - *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, - attr->targetNamespace, attr->name)); - FREE_AND_NULL(str) + ause = WXS_ATTR_USE_CAST item; + *buf = xmlStrdup(BAD_CAST "attribute use "); + if (WXS_ATTRUSE_DECL(ause) != NULL) { *buf = xmlStrcat(*buf, BAD_CAST "'"); - } else { - *buf = xmlStrdup(xmlSchemaElemDesAttrRef); - *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, - attr->refNs, attr->ref)); + *buf = xmlStrcat(*buf, + xmlSchemaGetComponentQName(&str, WXS_ATTRUSE_DECL(ause))); FREE_AND_NULL(str) + *buf = xmlStrcat(*buf, BAD_CAST "'"); + } else { + *buf = xmlStrcat(*buf, BAD_CAST "(unknown)"); + } + } + break; + case XML_SCHEMA_TYPE_ATTRIBUTE: { + xmlSchemaAttributePtr attr; + + attr = (xmlSchemaAttributePtr) item; + *buf = xmlStrdup(BAD_CAST "attribute decl."); + *buf = xmlStrcat(*buf, BAD_CAST " '"); + *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, + attr->targetNamespace, attr->name)); + FREE_AND_NULL(str) *buf = xmlStrcat(*buf, BAD_CAST "'"); - } } break; + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + xmlSchemaGetComponentDesignation(buf, item); + break; case XML_SCHEMA_TYPE_ELEMENT: { xmlSchemaElementPtr elem; elem = (xmlSchemaElementPtr) item; - if ((elem->flags & XML_SCHEMAS_ELEM_GLOBAL) || - (elem->ref == NULL)) { - *buf = xmlStrdup(xmlSchemaElemDesElemDecl); - *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, - elem->targetNamespace, elem->name)); - *buf = xmlStrcat(*buf, BAD_CAST "'"); - } + *buf = xmlStrdup(BAD_CAST "element decl."); + *buf = xmlStrcat(*buf, BAD_CAST " '"); + *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, + elem->targetNamespace, elem->name)); + *buf = xmlStrcat(*buf, BAD_CAST "'"); } break; case XML_SCHEMA_TYPE_IDC_UNIQUE: @@ -1445,15 +1699,10 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, xmlSchemaFacetTypeToString(item->type)); *buf = xmlStrcat(*buf, BAD_CAST "'"); break; - case XML_SCHEMA_TYPE_NOTATION: - *buf = xmlStrdup(BAD_CAST "notation"); - break; case XML_SCHEMA_TYPE_GROUP: { - *buf = xmlStrdup(xmlSchemaElemModelGrDef); + *buf = xmlStrdup(BAD_CAST "model group def."); *buf = xmlStrcat(*buf, BAD_CAST " '"); - *buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str, - ((xmlSchemaModelGroupDefPtr) item)->targetNamespace, - ((xmlSchemaModelGroupDefPtr) item)->name)); + *buf = xmlStrcat(*buf, xmlSchemaGetComponentQName(&str, item)); *buf = xmlStrcat(*buf, BAD_CAST "'"); FREE_AND_NULL(str) } @@ -1462,8 +1711,15 @@ xmlSchemaFormatItemForReport(xmlChar **buf, case XML_SCHEMA_TYPE_CHOICE: case XML_SCHEMA_TYPE_ALL: case XML_SCHEMA_TYPE_PARTICLE: - *buf = xmlStrdup(xmlSchemaCompTypeToString(item->type)); - break; + *buf = xmlStrdup(WXS_ITEM_TYPE_NAME(item)); + break; + case XML_SCHEMA_TYPE_NOTATION: { + *buf = xmlStrdup(WXS_ITEM_TYPE_NAME(item)); + *buf = xmlStrcat(*buf, BAD_CAST " '"); + *buf = xmlStrcat(*buf, xmlSchemaGetComponentQName(&str, item)); + *buf = xmlStrcat(*buf, BAD_CAST "'"); + FREE_AND_NULL(str); + } default: named = 0; } @@ -1575,6 +1831,13 @@ xmlSchemaErrMemory(const char *msg) } #endif +static void +xmlSchemaPSimpleErr(const char *msg) +{ + __xmlSimpleError(XML_FROM_SCHEMASP, XML_ERR_NO_MEMORY, NULL, NULL, + msg); +} + /** * xmlSchemaPErrMemory: * @node: a context node @@ -1613,8 +1876,9 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, if (ctxt != NULL) { ctxt->nberrors++; + ctxt->err = error; channel = ctxt->error; - data = ctxt->userData; + data = ctxt->errCtxt; schannel = ctxt->serror; } __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP, @@ -1678,8 +1942,9 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, if (ctxt != NULL) { ctxt->nberrors++; + ctxt->err = error; channel = ctxt->error; - data = ctxt->userData; + data = ctxt->errCtxt; schannel = ctxt->serror; } __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP, @@ -1737,11 +2002,11 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node, * Handle a validation error */ static void -xmlSchemaErr3Line(xmlSchemaAbstractCtxtPtr ctxt, +xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt, xmlErrorLevel errorLevel, int error, xmlNodePtr node, int line, const char *msg, const xmlChar *str1, const xmlChar *str2, - const xmlChar *str3) + const xmlChar *str3, const xmlChar *str4) { xmlStructuredErrorFunc schannel = NULL; xmlGenericErrorFunc channel = NULL; @@ -1759,7 +2024,7 @@ xmlSchemaErr3Line(xmlSchemaAbstractCtxtPtr ctxt, channel = vctxt->warning; } schannel = vctxt->serror; - data = vctxt->userData; + data = vctxt->errCtxt; /* * Error node. If we specify a line number, then @@ -1799,7 +2064,7 @@ xmlSchemaErr3Line(xmlSchemaAbstractCtxtPtr ctxt, node, XML_FROM_SCHEMASV, error, errorLevel, file, line, (const char *) str1, (const char *) str2, - (const char *) str3, 0, 0, msg, str1, str2, str3); + (const char *) str3, 0, 0, msg, str1, str2, str3, str4); } else if (ctxt->type == XML_SCHEMA_CTXT_PARSER) { xmlSchemaParserCtxtPtr pctxt = (xmlSchemaParserCtxtPtr) ctxt; @@ -1811,12 +2076,12 @@ xmlSchemaErr3Line(xmlSchemaAbstractCtxtPtr ctxt, channel = pctxt->warning; } schannel = pctxt->serror; - data = pctxt->userData; + data = pctxt->errCtxt; __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP, error, errorLevel, NULL, 0, (const char *) str1, (const char *) str2, - (const char *) str3, 0, 0, msg, str1, str2, str3); + (const char *) str3, 0, 0, msg, str1, str2, str3, str4); } else { TODO } @@ -1840,8 +2105,18 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2, const xmlChar *str3) { - xmlSchemaErr3Line(actxt, XML_ERR_ERROR, error, node, 0, - msg, str1, str2, str3); + xmlSchemaErr4Line(actxt, XML_ERR_ERROR, error, node, 0, + msg, str1, str2, str3, NULL); +} + +static void +xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt, + int error, xmlNodePtr node, const char *msg, + const xmlChar *str1, const xmlChar *str2, + const xmlChar *str3, const xmlChar *str4) +{ + xmlSchemaErr4Line(actxt, XML_ERR_ERROR, error, node, 0, + msg, str1, str2, str3, str4); } static void @@ -1849,7 +2124,7 @@ xmlSchemaErr(xmlSchemaAbstractCtxtPtr actxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlSchemaErr3(actxt, error, node, msg, str1, str2, NULL); + xmlSchemaErr4(actxt, error, node, msg, str1, str2, NULL, NULL); } static xmlChar * @@ -1859,6 +2134,19 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, { xmlChar *str = NULL; + *msg = NULL; + if ((node != NULL) && + (node->type != XML_ELEMENT_NODE) && + (node->type != XML_ATTRIBUTE_NODE)) + { + /* + * Don't try to format other nodes than element and + * attribute nodes. + * Play save and return an empty string. + */ + *msg = xmlStrdup(BAD_CAST ""); + return(*msg); + } if (node != NULL) { /* * Work on tree nodes. @@ -1923,7 +2211,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, * VAL TODO: The output of the given schema component is currently * disabled. */ -#if 0 +#if 0 if ((type != NULL) && (xmlSchemaIsGlobalItem(type))) { *msg = xmlStrcat(*msg, BAD_CAST " ["); *msg = xmlStrcat(*msg, xmlSchemaFormatItemForReport(&str, @@ -1983,24 +2271,45 @@ xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt, #endif static void -xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, +xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, xmlNodePtr node, - xmlSchemaTypePtr type ATTRIBUTE_UNUSED, + xmlSchemaBasicItemPtr item, const char *message, - const xmlChar *str1, - const xmlChar *str2) + const xmlChar *str1, const xmlChar *str2, + const xmlChar *str3, const xmlChar *str4) { xmlChar *msg = NULL; - xmlSchemaFormatNodeForError(&msg, actxt, node); + if ((node == NULL) && (item != NULL) && + (actxt->type == XML_SCHEMA_CTXT_PARSER)) { + node = WXS_ITEM_NODE(item); + xmlSchemaFormatItemForReport(&msg, NULL, item, NULL); + msg = xmlStrcat(msg, BAD_CAST ": "); + } else + xmlSchemaFormatNodeForError(&msg, actxt, node); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); - xmlSchemaErr(actxt, error, node, - (const char *) msg, str1, str2); + xmlSchemaErr4(actxt, error, node, + (const char *) msg, str1, str2, str3, str4); FREE_AND_NULL(msg) } +static void +xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, + xmlParserErrors error, + xmlNodePtr node, + xmlSchemaBasicItemPtr item, + const char *message, + const xmlChar *str1, + const xmlChar *str2) +{ + xmlSchemaCustomErr4(actxt, error, node, item, + message, str1, str2, NULL, NULL); +} + + + static void xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt, xmlParserErrors error, @@ -2018,8 +2327,8 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt, msg = xmlStrcat(msg, BAD_CAST ".\n"); /* URGENT TODO: Set the error code to something sane. */ - xmlSchemaErr3Line(actxt, XML_ERR_WARNING, error, node, 0, - (const char *) msg, str1, str2, str3); + xmlSchemaErr4Line(actxt, XML_ERR_WARNING, error, node, 0, + (const char *) msg, str1, str2, str3, NULL); FREE_AND_NULL(msg) } @@ -2040,12 +2349,12 @@ xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt, msg = xmlStrdup(BAD_CAST "Element '%s': "); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); - xmlSchemaErr3Line(ACTXT_CAST vctxt, XML_ERR_ERROR, + xmlSchemaErr4Line(ACTXT_CAST vctxt, XML_ERR_ERROR, error, NULL, idcNode->nodeLine, (const char *) msg, xmlSchemaFormatQName(&qname, vctxt->nodeQNames->items[idcNode->nodeQNameID +1], vctxt->nodeQNames->items[idcNode->nodeQNameID]), - str1, str2); + str1, str2, NULL); FREE_AND_NULL(qname); FREE_AND_NULL(msg); } @@ -2114,11 +2423,11 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt, else msg = xmlStrcat(msg, BAD_CAST "the "); - if (VARIETY_ATOMIC(type)) + if (WXS_IS_ATOMIC(type)) msg = xmlStrcat(msg, BAD_CAST "atomic type"); - else if (VARIETY_LIST(type)) + else if (WXS_IS_LIST(type)) msg = xmlStrcat(msg, BAD_CAST "list type"); - else if (VARIETY_UNION(type)) + else if (WXS_IS_UNION(type)) msg = xmlStrcat(msg, BAD_CAST "union type"); if (xmlSchemaIsGlobalItem(type)) { @@ -2188,7 +2497,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, xmlChar *str = NULL, *msg = NULL; xmlChar *localName, *nsName; const xmlChar *cur, *end; - int i, is_not; + int i; xmlSchemaFormatNodeForError(&msg, actxt, node); msg = xmlStrcat(msg, (const xmlChar *) message); @@ -2211,11 +2520,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, continue; if ((cur[0] == 'n') && (cur[1] == 'o') && (cur[2] == 't') && (cur[3] == ' ')) { - is_not = 1; cur += 4; str = xmlStrcat(str, BAD_CAST "##other"); - } else { - is_not = 0; } /* * Get the local name. @@ -2366,12 +2672,12 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, xmlSchemaErr(actxt, error, node, (const char *) msg, value, facet->value); } else if (facetType == XML_SCHEMA_FACET_MINEXCLUSIVE) { - msg = xmlStrcat(msg, BAD_CAST "The value '%s' must be less than " + msg = xmlStrcat(msg, BAD_CAST "The value '%s' must be greater than " "'%s'.\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, value, facet->value); } else if (facetType == XML_SCHEMA_FACET_MAXEXCLUSIVE) { - msg = xmlStrcat(msg, BAD_CAST "The value '%s' must be more than " + msg = xmlStrcat(msg, BAD_CAST "The value '%s' must be less than " "'%s'.\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, value, facet->value); @@ -2427,7 +2733,7 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, static void xmlSchemaPMissingAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr ownerElem, const char *name, const char *message) @@ -2464,7 +2770,7 @@ xmlSchemaPMissingAttrErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPResCompAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr ownerElem, const char *name, const xmlChar *refName, @@ -2476,7 +2782,7 @@ xmlSchemaPResCompAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlSchemaFormatItemForReport(&des, NULL, ownerItem, ownerElem); if (refTypeStr == NULL) - refTypeStr = (const char *) xmlSchemaCompTypeToString(refType); + refTypeStr = (const char *) xmlSchemaItemTypeToStr(refType); xmlSchemaPErrExt(ctxt, ownerElem, error, NULL, NULL, NULL, "%s, attribute '%s': The QName value '%s' does not resolve to a(n) " @@ -2501,7 +2807,7 @@ static void xmlSchemaPCustomAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, const char *msg) { @@ -2534,49 +2840,18 @@ xmlSchemaPCustomAttrErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerComp ATTRIBUTE_UNUSED, xmlAttrPtr attr) { - xmlChar *des = NULL, *strA = NULL; + xmlChar *strA = NULL, *strB = NULL; - if (ownerDes == NULL) - xmlSchemaFormatItemForReport(&des, NULL, ownerItem, attr->parent); - else if (*ownerDes == NULL) { - xmlSchemaFormatItemForReport(ownerDes, NULL, ownerItem, attr->parent); - des = *ownerDes; - } else - des = *ownerDes; - xmlSchemaPErr(ctxt, (xmlNodePtr) attr, error, - "%s: The attribute '%s' is not allowed.\n", BAD_CAST des, - xmlSchemaFormatQNameNs(&strA, attr->ns, attr->name)); - if (ownerDes == NULL) - FREE_AND_NULL(des); + xmlSchemaFormatNodeForError(&strA, ACTXT_CAST ctxt, attr->parent); + xmlSchemaErr4(ACTXT_CAST ctxt, error, (xmlNodePtr) attr, + "%sThe attribute '%s' is not allowed.\n", BAD_CAST strA, + xmlSchemaFormatQNameNs(&strB, attr->ns, attr->name), + NULL, NULL); FREE_AND_NULL(strA); -} - -/** - * xmlSchemaPAquireDes: - * @des: the first designation - * @itemDes: the second designation - * @item: the schema item - * @itemElem: the node of the schema item - * - * Creates a designation for an item. - */ -static void -xmlSchemaPAquireDes(xmlChar **des, - xmlChar **itemDes, - xmlSchemaTypePtr item, - xmlNodePtr itemElem) -{ - if (itemDes == NULL) - xmlSchemaFormatItemForReport(des, NULL, item, itemElem); - else if (*itemDes == NULL) { - xmlSchemaFormatItemForReport(itemDes, NULL, item, itemElem); - *des = *itemDes; - } else - *des = *itemDes; + FREE_AND_NULL(strB); } /** @@ -2596,8 +2871,7 @@ xmlSchemaPAquireDes(xmlChar **des, static void xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **itemDes, - xmlSchemaTypePtr item, + xmlSchemaBasicItemPtr item, xmlNodePtr itemElem, const char *message, const xmlChar *str1, @@ -2606,16 +2880,15 @@ xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt, { xmlChar *des = NULL, *msg = NULL; - xmlSchemaPAquireDes(&des, itemDes, item, itemElem); + xmlSchemaFormatItemForReport(&des, NULL, item, itemElem); msg = xmlStrdup(BAD_CAST "%s: "); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); if ((itemElem == NULL) && (item != NULL)) - itemElem = item->node; + itemElem = WXS_ITEM_NODE(item); xmlSchemaPErrExt(ctxt, itemElem, error, NULL, NULL, NULL, (const char *) msg, BAD_CAST des, str1, str2, str3, NULL); - if (itemDes == NULL) - FREE_AND_NULL(des); + FREE_AND_NULL(des); FREE_AND_NULL(msg); } @@ -2634,13 +2907,12 @@ xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **itemDes, - xmlSchemaTypePtr item, + xmlSchemaBasicItemPtr item, xmlNodePtr itemElem, const char *message, const xmlChar *str1) { - xmlSchemaPCustomErrExt(ctxt, error, itemDes, item, itemElem, message, + xmlSchemaPCustomErrExt(ctxt, error, item, itemElem, message, str1, NULL, NULL); } @@ -2658,25 +2930,28 @@ xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt, * Reports an attribute use error during parsing. */ static void -xmlSchemaPAttrUseErr(xmlSchemaParserCtxtPtr ctxt, +xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlSchemaTypePtr item, - const xmlSchemaAttributePtr attr, + xmlNodePtr node, + xmlSchemaBasicItemPtr ownerItem, + const xmlSchemaAttributeUsePtr attruse, const char *message, - const xmlChar *str1) + const xmlChar *str1, const xmlChar *str2, + const xmlChar *str3,const xmlChar *str4) { xmlChar *str = NULL, *msg = NULL; - xmlSchemaFormatItemForReport(&msg, NULL, item, NULL); - msg = xmlStrcat(msg, BAD_CAST ", "); + + xmlSchemaFormatItemForReport(&msg, NULL, ownerItem, NULL); + msg = xmlStrcat(msg, BAD_CAST ", "); msg = xmlStrcat(msg, BAD_CAST xmlSchemaFormatItemForReport(&str, NULL, - (xmlSchemaTypePtr) attr, NULL)); + WXS_BASIC_CAST attruse, NULL)); FREE_AND_NULL(str); msg = xmlStrcat(msg, BAD_CAST ": "); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); - xmlSchemaPErr(ctxt, attr->node, error, - (const char *) msg, str1, NULL); + xmlSchemaErr4(ACTXT_CAST ctxt, error, node, + (const char *) msg, str1, str2, str3, str4); xmlFree(msg); } @@ -2684,9 +2959,8 @@ xmlSchemaPAttrUseErr(xmlSchemaParserCtxtPtr ctxt, * xmlSchemaPIllegalFacetAtomicErr: * @ctxt: the schema parser context * @error: the error code - * @itemDes: the designation of the type - * @item: the schema type - * @baseItem: the base type of type + * @type: the schema type + * @baseType: the base type of type * @facet: the illegal facet * * Reports an illegal facet for atomic simple types. @@ -2694,22 +2968,20 @@ xmlSchemaPAttrUseErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPIllegalFacetAtomicErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **itemDes, - xmlSchemaTypePtr item, - xmlSchemaTypePtr baseItem, + xmlSchemaTypePtr type, + xmlSchemaTypePtr baseType, xmlSchemaFacetPtr facet) { xmlChar *des = NULL, *strT = NULL; - xmlSchemaPAquireDes(&des, itemDes, item, item->node); - xmlSchemaPErrExt(ctxt, item->node, error, NULL, NULL, NULL, + xmlSchemaFormatItemForReport(&des, NULL, WXS_BASIC_CAST type, type->node); + xmlSchemaPErrExt(ctxt, type->node, error, NULL, NULL, NULL, "%s: The facet '%s' is not allowed on types derived from the " "type %s.\n", BAD_CAST des, xmlSchemaFacetTypeToString(facet->type), - xmlSchemaFormatItemForReport(&strT, NULL, baseItem, NULL), + xmlSchemaFormatItemForReport(&strT, NULL, WXS_BASIC_CAST baseType, NULL), NULL, NULL); - if (itemDes == NULL) - FREE_AND_NULL(des); + FREE_AND_NULL(des); FREE_AND_NULL(strT); } @@ -2726,18 +2998,17 @@ xmlSchemaPIllegalFacetAtomicErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPIllegalFacetListUnionErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **itemDes, - xmlSchemaTypePtr item, + xmlSchemaTypePtr type, xmlSchemaFacetPtr facet) { xmlChar *des = NULL, *strT = NULL; - xmlSchemaPAquireDes(&des, itemDes, item, item->node); - xmlSchemaPErr(ctxt, item->node, error, + xmlSchemaFormatItemForReport(&des, NULL, WXS_BASIC_CAST type, + type->node); + xmlSchemaPErr(ctxt, type->node, error, "%s: The facet '%s' is not allowed.\n", BAD_CAST des, xmlSchemaFacetTypeToString(facet->type)); - if (itemDes == NULL) - FREE_AND_NULL(des); + FREE_AND_NULL(des); FREE_AND_NULL(strT); } @@ -2754,26 +3025,18 @@ xmlSchemaPIllegalFacetListUnionErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, const char *name1, const char *name2) { xmlChar *des = NULL; - if (ownerDes == NULL) - xmlSchemaFormatItemForReport(&des, NULL, ownerItem, attr->parent); - else if (*ownerDes == NULL) { - xmlSchemaFormatItemForReport(ownerDes, NULL, ownerItem, attr->parent); - des = *ownerDes; - } else - des = *ownerDes; + xmlSchemaFormatItemForReport(&des, NULL, WXS_BASIC_CAST ownerItem, attr->parent); xmlSchemaPErrExt(ctxt, (xmlNodePtr) attr, error, NULL, NULL, NULL, "%s: The attributes '%s' and '%s' are mutually exclusive.\n", BAD_CAST des, BAD_CAST name1, BAD_CAST name2, NULL, NULL); - if (ownerDes == NULL) - FREE_AND_NULL(des) + FREE_AND_NULL(des); } /** @@ -2792,7 +3055,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlSchemaTypePtr ownerItem ATTRIBUTE_UNUSED, + xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED, xmlNodePtr node, xmlSchemaTypePtr type, const char *expected, @@ -2819,11 +3082,11 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, else msg = xmlStrcat(msg, BAD_CAST "the "); - if (VARIETY_ATOMIC(type)) + if (WXS_IS_ATOMIC(type)) msg = xmlStrcat(msg, BAD_CAST "atomic type"); - else if (VARIETY_LIST(type)) + else if (WXS_IS_LIST(type)) msg = xmlStrcat(msg, BAD_CAST "list type"); - else if (VARIETY_UNION(type)) + else if (WXS_IS_UNION(type)) msg = xmlStrcat(msg, BAD_CAST "union type"); if (xmlSchemaIsGlobalItem(type)) { @@ -2882,8 +3145,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, static void xmlSchemaPContentErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr ownerElem, xmlNodePtr child, const char *message, @@ -2891,13 +3153,7 @@ xmlSchemaPContentErr(xmlSchemaParserCtxtPtr ctxt, { xmlChar *des = NULL; - if (ownerDes == NULL) - xmlSchemaFormatItemForReport(&des, NULL, ownerItem, ownerElem); - else if (*ownerDes == NULL) { - xmlSchemaFormatItemForReport(ownerDes, NULL, ownerItem, ownerElem); - des = *ownerDes; - } else - des = *ownerDes; + xmlSchemaFormatItemForReport(&des, NULL, ownerItem, ownerElem); if (message != NULL) xmlSchemaPErr2(ctxt, ownerElem, child, error, "%s: %s.\n", @@ -2913,8 +3169,7 @@ xmlSchemaPContentErr(xmlSchemaParserCtxtPtr ctxt, BAD_CAST des, NULL); } } - if (ownerDes == NULL) - FREE_AND_NULL(des) + FREE_AND_NULL(des) } /************************************************************************ @@ -3056,76 +3311,207 @@ xmlSchemaItemListAdd(xmlSchemaItemListPtr list, void *item) return(-1); } } - /* ((xmlSchemaBasicItemPtr *) list->items)[list->nbItems++] = (void *) item; */ list->items[list->nbItems++] = item; return(0); } -/** - * xmlSchemaItemListFree: - * @annot: a schema type structure - * - * Deallocate a annotation structure - */ -static void -xmlSchemaItemListFree(xmlSchemaItemListPtr list) -{ - if (list == NULL) - return; - if (list->items != NULL) - xmlFree(list->items); - xmlFree(list); -} - -static void -xmlSchemaBucketFree(xmlSchemaBucketPtr bucket) +static int +xmlSchemaItemListAddSize(xmlSchemaItemListPtr list, + int initialSize, + void *item) { - if (bucket == NULL) - return; - if (bucket->globals != NULL) { - xmlSchemaComponentListFree(bucket->globals); - xmlSchemaItemListFree(bucket->globals); - } - if (bucket->locals != NULL) { - xmlSchemaComponentListFree(bucket->locals); - xmlSchemaItemListFree(bucket->locals); - } - if (bucket->relations != NULL) { - xmlSchemaSchemaRelationPtr prev, cur = bucket->relations; - do { - prev = cur; - cur = cur->next; - xmlFree(prev); - } while (cur != NULL); - } - if ((! bucket->preserveDoc) && (bucket->doc != NULL)) { - xmlFreeDoc(bucket->doc); - } - if (bucket->type == XML_SCHEMA_SCHEMA_IMPORT) { - if (IMPBUCKET_CAST(bucket)->schema != NULL) - xmlSchemaFree(IMPBUCKET_CAST(bucket)->schema); + if (list->items == NULL) { + if (initialSize <= 0) + initialSize = 1; + list->items = (void **) xmlMalloc( + initialSize * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "allocating new item list", NULL); + return(-1); + } + list->sizeItems = initialSize; + } else if (list->sizeItems <= list->nbItems) { + list->sizeItems *= 2; + list->items = (void **) xmlRealloc(list->items, + list->sizeItems * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "growing item list", NULL); + list->sizeItems = 0; + return(-1); + } } - xmlFree(bucket); + list->items[list->nbItems++] = item; + return(0); } -static xmlSchemaBucketPtr -xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, - int type, - const xmlChar *targetNamespace) -{ - xmlSchemaBucketPtr ret; - xmlSchemaConstructionCtxtPtr constr = pctxt->constructor; - int size; - xmlSchemaPtr mainSchema; +static int +xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx) +{ + if (list->items == NULL) { + list->items = (void **) xmlMalloc( + 20 * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "allocating new item list", NULL); + return(-1); + } + list->sizeItems = 20; + } else if (list->sizeItems <= list->nbItems) { + list->sizeItems *= 2; + list->items = (void **) xmlRealloc(list->items, + list->sizeItems * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "growing item list", NULL); + list->sizeItems = 0; + return(-1); + } + } + /* + * Just append if the index is greater/equal than the item count. + */ + if (idx >= list->nbItems) { + list->items[list->nbItems++] = item; + } else { + int i; + for (i = list->nbItems; i > idx; i--) + list->items[i] = list->items[i-1]; + list->items[idx] = item; + list->nbItems++; + } + return(0); +} + +#if 0 /* enable if ever needed */ +static int +xmlSchemaItemListInsertSize(xmlSchemaItemListPtr list, + int initialSize, + void *item, + int idx) +{ + if (list->items == NULL) { + if (initialSize <= 0) + initialSize = 1; + list->items = (void **) xmlMalloc( + initialSize * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "allocating new item list", NULL); + return(-1); + } + list->sizeItems = initialSize; + } else if (list->sizeItems <= list->nbItems) { + list->sizeItems *= 2; + list->items = (void **) xmlRealloc(list->items, + list->sizeItems * sizeof(void *)); + if (list->items == NULL) { + xmlSchemaPErrMemory(NULL, "growing item list", NULL); + list->sizeItems = 0; + return(-1); + } + } + /* + * Just append if the index is greater/equal than the item count. + */ + if (idx >= list->nbItems) { + list->items[list->nbItems++] = item; + } else { + int i; + for (i = list->nbItems; i > idx; i--) + list->items[i] = list->items[i-1]; + list->items[idx] = item; + list->nbItems++; + } + return(0); +} +#endif + +static int +xmlSchemaItemListRemove(xmlSchemaItemListPtr list, int idx) +{ + int i; + if ((list->items == NULL) || (idx >= list->nbItems)) { + xmlSchemaPSimpleErr("Internal error: xmlSchemaItemListRemove, " + "index error.\n"); + return(-1); + } + + if (list->nbItems == 1) { + /* TODO: Really free the list? */ + xmlFree(list->items); + list->items = NULL; + list->nbItems = 0; + list->sizeItems = 0; + } else if (list->nbItems -1 == idx) { + list->nbItems--; + } else { + for (i = idx; i < list->nbItems -1; i++) + list->items[i] = list->items[i+1]; + list->nbItems--; + } + return(0); +} + +/** + * xmlSchemaItemListFree: + * @annot: a schema type structure + * + * Deallocate a annotation structure + */ +static void +xmlSchemaItemListFree(xmlSchemaItemListPtr list) +{ + if (list == NULL) + return; + if (list->items != NULL) + xmlFree(list->items); + xmlFree(list); +} + +static void +xmlSchemaBucketFree(xmlSchemaBucketPtr bucket) +{ + if (bucket == NULL) + return; + if (bucket->globals != NULL) { + xmlSchemaComponentListFree(bucket->globals); + xmlSchemaItemListFree(bucket->globals); + } + if (bucket->locals != NULL) { + xmlSchemaComponentListFree(bucket->locals); + xmlSchemaItemListFree(bucket->locals); + } + if (bucket->relations != NULL) { + xmlSchemaSchemaRelationPtr prev, cur = bucket->relations; + do { + prev = cur; + cur = cur->next; + xmlFree(prev); + } while (cur != NULL); + } + if ((! bucket->preserveDoc) && (bucket->doc != NULL)) { + xmlFreeDoc(bucket->doc); + } + if (bucket->type == XML_SCHEMA_SCHEMA_IMPORT) { + if (WXS_IMPBUCKET(bucket)->schema != NULL) + xmlSchemaFree(WXS_IMPBUCKET(bucket)->schema); + } + xmlFree(bucket); +} + +static xmlSchemaBucketPtr +xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, + int type, const xmlChar *targetNamespace) +{ + xmlSchemaBucketPtr ret; + int size; + xmlSchemaPtr mainSchema; - if (constr->schema == NULL) { + if (WXS_CONSTRUCTOR(pctxt)->mainSchema == NULL) { PERROR_INT("xmlSchemaBucketCreate", "no main schema on constructor"); return(NULL); } - mainSchema = constr->schema; + mainSchema = WXS_CONSTRUCTOR(pctxt)->mainSchema; /* Create the schema bucket. */ - if (WXS_IS_INCREDEF(type)) + if (WXS_IS_BUCKET_INCREDEF(type)) size = sizeof(xmlSchemaInclude); else size = sizeof(xmlSchemaImport); @@ -3137,13 +3523,23 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, memset(ret, 0, size); ret->targetNamespace = targetNamespace; ret->type = type; + ret->globals = xmlSchemaItemListCreate(); + if (ret->globals == NULL) { + xmlFree(ret); + return(NULL); + } + ret->locals = xmlSchemaItemListCreate(); + if (ret->locals == NULL) { + xmlFree(ret); + return(NULL); + } /* * The following will assure that only the first bucket is marked as * XML_SCHEMA_SCHEMA_MAIN and it points to the *main* schema. * For each following import buckets an xmlSchema will be created. */ if (! WXS_HAS_BUCKETS(pctxt)) { - if (WXS_IS_INCREDEF(type)) { + if (WXS_IS_BUCKET_INCREDEF(type)) { PERROR_INT("xmlSchemaBucketCreate", "first bucket but it's an include or redefine"); xmlSchemaBucketFree(ret); @@ -3152,7 +3548,8 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, /* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */ ret->type = XML_SCHEMA_SCHEMA_MAIN; /* Point to the *main* schema. */ - IMPBUCKET_CAST(ret)->schema = mainSchema; + WXS_CONSTRUCTOR(pctxt)->mainBucket = ret; + WXS_IMPBUCKET(ret)->schema = mainSchema; } else { if (type == XML_SCHEMA_SCHEMA_MAIN) { PERROR_INT("xmlSchemaBucketCreate", @@ -3163,18 +3560,19 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, /* * Create a schema for imports. */ - IMPBUCKET_CAST(ret)->schema = xmlSchemaNewSchema(pctxt); - if (IMPBUCKET_CAST(ret)->schema == NULL) { + WXS_IMPBUCKET(ret)->schema = xmlSchemaNewSchema(pctxt); + if (WXS_IMPBUCKET(ret)->schema == NULL) { xmlSchemaBucketFree(ret); return(NULL); } } } - if (WXS_IS_IMPMAIN(type)) { + if (WXS_IS_BUCKET_IMPMAIN(type)) { int res; - /* Imports got into the "schemasImports" slot of the main *schema*. */ + /* Imports go into the "schemasImports" slot of the main *schema*. */ if (mainSchema->schemasImports == NULL) { - mainSchema->schemasImports = xmlHashCreateDict(5, constr->dict); + mainSchema->schemasImports = xmlHashCreateDict(5, + WXS_CONSTRUCTOR(pctxt)->dict); if (mainSchema->schemasImports == NULL) { xmlSchemaBucketFree(ret); return(NULL); @@ -3194,12 +3592,12 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, } } else { /* Set the @ownerImport of an include bucket. */ - if (WXS_IS_IMPMAIN(constr->bucket->type)) - INCBUCKET_CAST(ret)->ownerImport = - IMPBUCKET_CAST(constr->bucket); + if (WXS_IS_BUCKET_IMPMAIN(WXS_CONSTRUCTOR(pctxt)->bucket->type)) + WXS_INCBUCKET(ret)->ownerImport = + WXS_IMPBUCKET(WXS_CONSTRUCTOR(pctxt)->bucket); else - INCBUCKET_CAST(ret)->ownerImport = - INCBUCKET_CAST(constr->bucket)->ownerImport; + WXS_INCBUCKET(ret)->ownerImport = + WXS_INCBUCKET(WXS_CONSTRUCTOR(pctxt)->bucket)->ownerImport; /* Includes got into the "includes" slot of the *main* schema. */ if (mainSchema->includes == NULL) { @@ -3215,20 +3613,20 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt, * Add to list of all buckets; this is used for lookup * during schema construction time only. */ - if (xmlSchemaItemListAdd(constr->buckets, ret) == -1) + if (xmlSchemaItemListAdd(WXS_CONSTRUCTOR(pctxt)->buckets, ret) == -1) return(NULL); return(ret); } static int -xmlSchemaAddItem(xmlSchemaItemListPtr *list, void *item) +xmlSchemaAddItemSize(xmlSchemaItemListPtr *list, int initialSize, void *item) { if (*list == NULL) { *list = xmlSchemaItemListCreate(); if (*list == NULL) return(-1); } - xmlSchemaItemListAdd(*list, item); + xmlSchemaItemListAddSize(*list, initialSize, item); return(0); } @@ -3272,9 +3670,9 @@ xmlSchemaFreeNotation(xmlSchemaNotationPtr nota) /** * xmlSchemaFreeAttribute: - * @schema: a schema attribute structure + * @attr: an attribute declaration * - * Deallocate a Schema Attribute structure. + * Deallocates an attribute declaration structure. */ static void xmlSchemaFreeAttribute(xmlSchemaAttributePtr attr) @@ -3288,6 +3686,38 @@ xmlSchemaFreeAttribute(xmlSchemaAttributePtr attr) xmlFree(attr); } +/** + * xmlSchemaFreeAttributeUse: + * @use: an attribute use + * + * Deallocates an attribute use structure. + */ +static void +xmlSchemaFreeAttributeUse(xmlSchemaAttributeUsePtr use) +{ + if (use == NULL) + return; + if (use->annot != NULL) + xmlSchemaFreeAnnot(use->annot); + if (use->defVal != NULL) + xmlSchemaFreeValue(use->defVal); + xmlFree(use); +} + +/** + * xmlSchemaFreeAttributeUseProhib: + * @prohib: an attribute use prohibition + * + * Deallocates an attribute use structure. + */ +static void +xmlSchemaFreeAttributeUseProhib(xmlSchemaAttributeUseProhibPtr prohib) +{ + if (prohib == NULL) + return; + xmlFree(prohib); +} + /** * xmlSchemaFreeWildcardNsSet: * set: a schema wildcard namespace @@ -3333,31 +3763,15 @@ xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard) * Deallocate a Schema Attribute Group structure. */ static void -xmlSchemaFreeAttributeGroup(xmlSchemaAttributeGroupPtr attr) +xmlSchemaFreeAttributeGroup(xmlSchemaAttributeGroupPtr attrGr) { - if (attr == NULL) + if (attrGr == NULL) return; - if (attr->annot != NULL) - xmlSchemaFreeAnnot(attr->annot); - xmlFree(attr); -} - -/** - * xmlSchemaFreeAttributeUseList: - * @attrUse: an attribute link - * - * Deallocate a list of schema attribute uses. - */ -static void -xmlSchemaFreeAttributeUseList(xmlSchemaAttributeLinkPtr attrUse) -{ - xmlSchemaAttributeLinkPtr next; - - while (attrUse != NULL) { - next = attrUse->next; - xmlFree(attrUse); - attrUse = next; - } + if (attrGr->annot != NULL) + xmlSchemaFreeAnnot(attrGr->annot); + if (attrGr->attrUses != NULL) + xmlSchemaItemListFree(WXS_LIST_CAST attrGr->attrUses); + xmlFree(attrGr); } /** @@ -3503,13 +3917,8 @@ xmlSchemaFreeType(xmlSchemaTypePtr type) facet = next; } } - if (type->type != XML_SCHEMA_TYPE_BASIC) { - /* - * TODO: Why is this restricted to non built-in types? - */ - if (type->attributeUses != NULL) - xmlSchemaFreeAttributeUseList(type->attributeUses); - } + if (type->attrUses != NULL) + xmlSchemaItemListFree((xmlSchemaItemListPtr) type->attrUses); if (type->memberTypes != NULL) xmlSchemaFreeTypeLinkList(type->memberTypes); if (type->facetSet != NULL) { @@ -3555,24 +3964,6 @@ xmlSchemaFreeModelGroup(xmlSchemaModelGroupPtr item) xmlFree(item); } -/** - * xmlSchemaFreeTypeList: - * @type: a schema type structure - * - * Deallocate a Schema Type structure. - */ -static void -xmlSchemaFreeTypeList(xmlSchemaTypePtr type) -{ - xmlSchemaTypePtr next; - - while (type != NULL) { - next = type->redef; - xmlSchemaFreeType(type); - type = next; - } -} - static void xmlSchemaComponentListFree(xmlSchemaItemListPtr list) { @@ -3590,11 +3981,18 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list) switch (item->type) { case XML_SCHEMA_TYPE_SIMPLE: case XML_SCHEMA_TYPE_COMPLEX: - xmlSchemaFreeTypeList((xmlSchemaTypePtr) item); + xmlSchemaFreeType((xmlSchemaTypePtr) item); break; case XML_SCHEMA_TYPE_ATTRIBUTE: xmlSchemaFreeAttribute((xmlSchemaAttributePtr) item); - break; + break; + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + xmlSchemaFreeAttributeUse((xmlSchemaAttributeUsePtr) item); + break; + case XML_SCHEMA_EXTRA_ATTR_USE_PROHIB: + xmlSchemaFreeAttributeUseProhib( + (xmlSchemaAttributeUseProhibPtr) item); + break; case XML_SCHEMA_TYPE_ELEMENT: xmlSchemaFreeElement((xmlSchemaElementPtr) item); break; @@ -3636,8 +4034,7 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list) xmlSchemaPSimpleInternalErr(NULL, "Internal error: xmlSchemaComponentListFree, " "unexpected component type '%s'\n", - (const xmlChar *) - xmlSchemaCompTypeToString(item->type)); + (const xmlChar *) WXS_ITEM_TYPE_NAME(item)); } break; } @@ -3707,6 +4104,9 @@ xmlSchemaFree(xmlSchemaPtr schema) #ifdef LIBXML_OUTPUT_ENABLED +static void +xmlSchemaTypeDump(xmlSchemaTypePtr type, FILE * output); /* forward */ + /** * xmlSchemaElementDump: * @elem: an element @@ -3723,20 +4123,15 @@ xmlSchemaElementDump(xmlSchemaElementPtr elem, FILE * output, if (elem == NULL) return; - if (elem->flags & XML_SCHEMAS_ELEM_REF) { - fprintf(output, "Particle: %s", name); - fprintf(output, ", term element: %s", elem->ref); - if (elem->refNs != NULL) - fprintf(output, " ns %s", elem->refNs); - } else { - fprintf(output, "Element"); - if (elem->flags & XML_SCHEMAS_ELEM_GLOBAL) - fprintf(output, " (global)"); - fprintf(output, ": %s ", elem->name); - if (namespace != NULL) - fprintf(output, "ns %s", namespace); - } + + fprintf(output, "Element"); + if (elem->flags & XML_SCHEMAS_ELEM_GLOBAL) + fprintf(output, " (global)"); + fprintf(output, ": '%s' ", elem->name); + if (namespace != NULL) + fprintf(output, "ns '%s'", namespace); fprintf(output, "\n"); +#if 0 if ((elem->minOccurs != 1) || (elem->maxOccurs != 1)) { fprintf(output, " min %d ", elem->minOccurs); if (elem->maxOccurs >= UNBOUNDED) @@ -3746,14 +4141,14 @@ xmlSchemaElementDump(xmlSchemaElementPtr elem, FILE * output, else fprintf(output, "\n"); } +#endif /* * Misc other properties. */ if ((elem->flags & XML_SCHEMAS_ELEM_NILLABLE) || (elem->flags & XML_SCHEMAS_ELEM_ABSTRACT) || (elem->flags & XML_SCHEMAS_ELEM_FIXED) || - (elem->flags & XML_SCHEMAS_ELEM_DEFAULT) || - (elem->id != NULL)) { + (elem->flags & XML_SCHEMAS_ELEM_DEFAULT)) { fprintf(output, " props: "); if (elem->flags & XML_SCHEMAS_ELEM_FIXED) fprintf(output, "[fixed] "); @@ -3763,8 +4158,6 @@ xmlSchemaElementDump(xmlSchemaElementPtr elem, FILE * output, fprintf(output, "[abstract] "); if (elem->flags & XML_SCHEMAS_ELEM_NILLABLE) fprintf(output, "[nillable] "); - if (elem->id != NULL) - fprintf(output, "[id: '%s'] ", elem->id); fprintf(output, "\n"); } /* @@ -3776,19 +4169,24 @@ xmlSchemaElementDump(xmlSchemaElementPtr elem, FILE * output, * Type. */ if (elem->namedType != NULL) { - fprintf(output, " type: %s ", elem->namedType); + fprintf(output, " type: '%s' ", elem->namedType); if (elem->namedTypeNs != NULL) - fprintf(output, "ns %s\n", elem->namedTypeNs); + fprintf(output, "ns '%s'\n", elem->namedTypeNs); else fprintf(output, "\n"); + } else if (elem->subtypes != NULL) { + /* + * Dump local types. + */ + xmlSchemaTypeDump(elem->subtypes, output); } /* * Substitution group. */ if (elem->substGroup != NULL) { - fprintf(output, " substitutionGroup: %s ", elem->substGroup); + fprintf(output, " substitutionGroup: '%s' ", elem->substGroup); if (elem->substGroupNs != NULL) - fprintf(output, "ns %s\n", elem->substGroupNs); + fprintf(output, "ns '%s'\n", elem->substGroupNs); else fprintf(output, "\n"); } @@ -3818,9 +4216,10 @@ xmlSchemaAnnotDump(FILE * output, xmlSchemaAnnotPtr annot) } /** - * xmlSchemaTypeDump: - * @output: the file output - * @type: a type structure + * xmlSchemaContentModelDump: + * @particle: the schema particle + * @output: the file output + * @depth: the depth used for intentation * * Dump a SchemaType structure */ @@ -3843,27 +4242,32 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept return; } term = particle->children; - switch (term->type) { - case XML_SCHEMA_TYPE_ELEMENT: - fprintf(output, "ELEM '%s'", xmlSchemaFormatQName(&str, - ((xmlSchemaElementPtr)term)->targetNamespace, - ((xmlSchemaElementPtr)term)->name)); - break; - case XML_SCHEMA_TYPE_SEQUENCE: - fprintf(output, "SEQUENCE"); - break; - case XML_SCHEMA_TYPE_CHOICE: - fprintf(output, "CHOICE"); - break; - case XML_SCHEMA_TYPE_ALL: - fprintf(output, "ALL"); - break; - case XML_SCHEMA_TYPE_ANY: - fprintf(output, "ANY"); - break; - default: - fprintf(output, "UNKNOWN\n"); - return; + if (term == NULL) { + fprintf(output, "(NULL)"); + } else { + switch (term->type) { + case XML_SCHEMA_TYPE_ELEMENT: + fprintf(output, "ELEM '%s'", xmlSchemaFormatQName(&str, + ((xmlSchemaElementPtr)term)->targetNamespace, + ((xmlSchemaElementPtr)term)->name)); + FREE_AND_NULL(str); + break; + case XML_SCHEMA_TYPE_SEQUENCE: + fprintf(output, "SEQUENCE"); + break; + case XML_SCHEMA_TYPE_CHOICE: + fprintf(output, "CHOICE"); + break; + case XML_SCHEMA_TYPE_ALL: + fprintf(output, "ALL"); + break; + case XML_SCHEMA_TYPE_ANY: + fprintf(output, "ANY"); + break; + default: + fprintf(output, "UNKNOWN\n"); + return; + } } if (particle->minOccurs != 1) fprintf(output, " min: %d", particle->minOccurs); @@ -3872,10 +4276,11 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept else if (particle->maxOccurs != 1) fprintf(output, " max: %d", particle->maxOccurs); fprintf(output, "\n"); - if (((term->type == XML_SCHEMA_TYPE_SEQUENCE) || - (term->type == XML_SCHEMA_TYPE_CHOICE) || - (term->type == XML_SCHEMA_TYPE_ALL)) && - (term->children != NULL)) { + if (term && + ((term->type == XML_SCHEMA_TYPE_SEQUENCE) || + (term->type == XML_SCHEMA_TYPE_CHOICE) || + (term->type == XML_SCHEMA_TYPE_ALL)) && + (term->children != NULL)) { xmlSchemaContentModelDump((xmlSchemaParticlePtr) term->children, output, depth +1); } @@ -3883,6 +4288,51 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept xmlSchemaContentModelDump((xmlSchemaParticlePtr) particle->next, output, depth); } + +/** + * xmlSchemaAttrUsesDump: + * @uses: attribute uses list + * @output: the file output + * + * Dumps a list of attribute use components. + */ +static void +xmlSchemaAttrUsesDump(xmlSchemaItemListPtr uses, FILE * output) +{ + xmlSchemaAttributeUsePtr use; + xmlSchemaAttributeUseProhibPtr prohib; + xmlSchemaQNameRefPtr ref; + const xmlChar *name, *tns; + xmlChar *str = NULL; + int i; + + if ((uses == NULL) || (uses->nbItems == 0)) + return; + + fprintf(output, " attributes:\n"); + for (i = 0; i < uses->nbItems; i++) { + use = uses->items[i]; + if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) { + fprintf(output, " [prohibition] "); + prohib = (xmlSchemaAttributeUseProhibPtr) use; + name = prohib->name; + tns = prohib->targetNamespace; + } else if (use->type == XML_SCHEMA_EXTRA_QNAMEREF) { + fprintf(output, " [reference] "); + ref = (xmlSchemaQNameRefPtr) use; + name = ref->name; + tns = ref->targetNamespace; + } else { + fprintf(output, " [use] "); + name = WXS_ATTRUSE_DECL_NAME(use); + tns = WXS_ATTRUSE_DECL_TNS(use); + } + fprintf(output, "'%s'\n", + (const char *) xmlSchemaFormatQName(&str, tns, name)); + FREE_AND_NULL(str); + } +} + /** * xmlSchemaTypeDump: * @output: the file output @@ -3899,11 +4349,11 @@ xmlSchemaTypeDump(xmlSchemaTypePtr type, FILE * output) } fprintf(output, "Type: "); if (type->name != NULL) - fprintf(output, "%s ", type->name); + fprintf(output, "'%s' ", type->name); else - fprintf(output, "no name "); + fprintf(output, "(no name) "); if (type->targetNamespace != NULL) - fprintf(output, "ns %s ", type->targetNamespace); + fprintf(output, "ns '%s' ", type->targetNamespace); switch (type->type) { case XML_SCHEMA_TYPE_BASIC: fprintf(output, "[basic] "); @@ -3965,12 +4415,14 @@ xmlSchemaTypeDump(xmlSchemaTypePtr type, FILE * output) } fprintf(output, "\n"); if (type->base != NULL) { - fprintf(output, " base type: %s", type->base); + fprintf(output, " base type: '%s'", type->base); if (type->baseNs != NULL) - fprintf(output, " ns %s\n", type->baseNs); + fprintf(output, " ns '%s'\n", type->baseNs); else fprintf(output, "\n"); } + if (type->attrUses != NULL) + xmlSchemaAttrUsesDump(type->attrUses, output); if (type->annot != NULL) xmlSchemaAnnotDump(output, type->annot); #ifdef DUMP_CONTENT_MODEL @@ -4010,14 +4462,13 @@ xmlSchemaDump(FILE * output, xmlSchemaPtr schema) fprintf(output, "\n"); if (schema->annot != NULL) xmlSchemaAnnotDump(output, schema->annot); - xmlHashScan(schema->typeDecl, (xmlHashScanner) xmlSchemaTypeDump, output); xmlHashScanFull(schema->elemDecl, (xmlHashScannerFull) xmlSchemaElementDump, output); } -#ifdef DEBUG_IDC +#ifdef DEBUG_IDC_NODE_TABLE /** * xmlSchemaDebugDumpIDCTable: * @vctxt: the WXS validation context @@ -4030,21 +4481,22 @@ xmlSchemaDebugDumpIDCTable(FILE * output, const xmlChar *localName, xmlSchemaPSVIIDCBindingPtr bind) { - xmlChar *str = NULL, *value; + xmlChar *str = NULL; + const xmlChar *value; xmlSchemaPSVIIDCNodePtr tab; xmlSchemaPSVIIDCKeyPtr key; int i, j, res; - fprintf(output, "IDC: TABLES on %s\n", + fprintf(output, "IDC: TABLES on '%s'\n", xmlSchemaFormatQName(&str, namespaceName, localName)); FREE_AND_NULL(str) if (bind == NULL) return; do { - fprintf(output, "IDC: BINDING %s\n", - xmlSchemaFormatQName(&str, bind->definition->targetNamespace, - bind->definition->name)); + fprintf(output, "IDC: BINDING '%s' (%d)\n", + xmlSchemaGetComponentQName(&str, + bind->definition), bind->nbNodes); FREE_AND_NULL(str) for (i = 0; i < bind->nbNodes; i++) { tab = bind->nodeTable[i]; @@ -4054,7 +4506,7 @@ xmlSchemaDebugDumpIDCTable(FILE * output, if ((key != NULL) && (key->val != NULL)) { res = xmlSchemaGetCanonValue(key->val, &value); if (res >= 0) - fprintf(output, "\"%s\" ", value); + fprintf(output, "'%s' ", value); else fprintf(output, "CANON-VALUE-FAILED "); if (res == 0) @@ -4066,6 +4518,29 @@ xmlSchemaDebugDumpIDCTable(FILE * output, } fprintf(output, ")\n"); } + if (bind->dupls && bind->dupls->nbItems) { + fprintf(output, "IDC: dupls (%d):\n", bind->dupls->nbItems); + for (i = 0; i < bind->dupls->nbItems; i++) { + tab = bind->dupls->items[i]; + fprintf(output, " ( "); + for (j = 0; j < bind->definition->nbFields; j++) { + key = tab->keys[j]; + if ((key != NULL) && (key->val != NULL)) { + res = xmlSchemaGetCanonValue(key->val, &value); + if (res >= 0) + fprintf(output, "'%s' ", value); + else + fprintf(output, "CANON-VALUE-FAILED "); + if (res == 0) + FREE_AND_NULL(value) + } else if (key != NULL) + fprintf(output, "(no val), "); + else + fprintf(output, "(key missing), "); + } + fprintf(output, ")\n"); + } + } bind = bind->next; } while (bind != NULL); } @@ -4147,6 +4622,12 @@ xmlSchemaGetNodeContent(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node) return(ret); } +static const xmlChar * +xmlSchemaGetNodeContentNoDict(xmlNodePtr node) +{ + return((const xmlChar*) xmlNodeGetContent(node)); +} + /** * xmlSchemaGetProp: * @ctxt: the parser context @@ -4263,10 +4744,7 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name, WXS_FIND_GLOBAL_ITEM(typeDecl) } exit: - if ((ret != NULL) && (ret->redef != NULL)) { - /* Return the last redefinition. */ - ret = ret->redef; - } + #ifdef DEBUG if (ret == NULL) { if (nsName == NULL) @@ -4375,10 +4853,7 @@ xmlSchemaGetGroup(xmlSchemaPtr schema, const xmlChar * name, WXS_FIND_GLOBAL_ITEM(groupDecl) } exit: - if ((ret != NULL) && (ret->redef != NULL)) { - /* Return the last redefinition. */ - ret = ret->redef; - } + #ifdef DEBUG if (ret == NULL) { if (nsName == NULL) @@ -4491,19 +4966,94 @@ xmlSchemaIsBlank(xmlChar * str, int len) return (1); } -#define WXS_GET_GLOBAL_HASH(c, s, slot) \ -{ \ - if (WXS_IS_IMPMAIN((c)->type)) \ - table = &(IMPBUCKET_CAST((c))->schema->slot); \ - else \ - table = &(INCBUCKET_CAST((c))->ownerImport->schema->slot); \ -} \ - -#define WXS_INIT_GLOBAL_HASH(ctx, tbl) \ -if (*(tbl) == NULL) *(tbl) = xmlHashCreateDict(10, (ctx)->dict); \ -if (*(tbl) == NULL) { if (ret != NULL) xmlFree(ret); return (NULL); } - -/** +#define WXS_COMP_NAME(c, t) ((t) (c))->name +#define WXS_COMP_TNS(c, t) ((t) (c))->targetNamespace +/* +* xmlSchemaFindRedefCompInGraph: +* ATTENTION TODO: This uses pointer comp. for strings. +*/ +static xmlSchemaBasicItemPtr +xmlSchemaFindRedefCompInGraph(xmlSchemaBucketPtr bucket, + xmlSchemaTypeType type, + const xmlChar *name, + const xmlChar *nsName) +{ + xmlSchemaBasicItemPtr ret; + int i; + + if ((bucket == NULL) || (name == NULL)) + return(NULL); + if ((bucket->globals == NULL) || + (bucket->globals->nbItems == 0)) + goto subschemas; + /* + * Search in global components. + */ + for (i = 0; i < bucket->globals->nbItems; i++) { + ret = bucket->globals->items[i]; + if (ret->type == type) { + switch (type) { + case XML_SCHEMA_TYPE_COMPLEX: + case XML_SCHEMA_TYPE_SIMPLE: + if ((WXS_COMP_NAME(ret, xmlSchemaTypePtr) == name) && + (WXS_COMP_TNS(ret, xmlSchemaTypePtr) == + nsName)) + { + return(ret); + } + break; + case XML_SCHEMA_TYPE_GROUP: + if ((WXS_COMP_NAME(ret, + xmlSchemaModelGroupDefPtr) == name) && + (WXS_COMP_TNS(ret, + xmlSchemaModelGroupDefPtr) == nsName)) + { + return(ret); + } + break; + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + if ((WXS_COMP_NAME(ret, + xmlSchemaAttributeGroupPtr) == name) && + (WXS_COMP_TNS(ret, + xmlSchemaAttributeGroupPtr) == nsName)) + { + return(ret); + } + break; + default: + /* Should not be hit. */ + return(NULL); + } + } + } +subschemas: + /* + * Process imported/included schemas. + */ + if (bucket->relations != NULL) { + xmlSchemaSchemaRelationPtr rel = bucket->relations; + + /* + * TODO: Marking the bucket will not avoid multiple searches + * in the same schema, but avoids at least circularity. + */ + bucket->flags |= XML_SCHEMA_BUCKET_MARKED; + do { + if ((rel->bucket != NULL) && + ((rel->bucket->flags & XML_SCHEMA_BUCKET_MARKED) == 0)) { + ret = xmlSchemaFindRedefCompInGraph(rel->bucket, + type, name, nsName); + if (ret != NULL) + return(ret); + } + rel = rel->next; + } while (rel != NULL); + bucket->flags ^= XML_SCHEMA_BUCKET_MARKED; + } + return(NULL); +} + +/** * xmlSchemaAddNotation: * @ctxt: a schema parser context * @schema: the schema being built @@ -4516,18 +5066,14 @@ if (*(tbl) == NULL) { if (ret != NULL) xmlFree(ret); return (NULL); } */ static xmlSchemaNotationPtr xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - const xmlChar *name) + const xmlChar *name, const xmlChar *nsName, + xmlNodePtr node ATTRIBUTE_UNUSED) { xmlSchemaNotationPtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; if ((ctxt == NULL) || (schema == NULL) || (name == NULL)) return (NULL); - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, notaDecl) - - WXS_INIT_GLOBAL_HASH(ctxt, table) ret = (xmlSchemaNotationPtr) xmlMalloc(sizeof(xmlSchemaNotation)); if (ret == NULL) { xmlSchemaPErrMemory(ctxt, "add annotation", NULL); @@ -4535,18 +5081,11 @@ xmlSchemaAddNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } memset(ret, 0, sizeof(xmlSchemaNotation)); ret->type = XML_SCHEMA_TYPE_NOTATION; - ret->name = xmlDictLookup(ctxt->dict, name, -1); - - val = xmlHashAddEntry(*table, ret->name, ret); - if (val != 0) { - xmlSchemaPErr(ctxt, (xmlNodePtr) ctxt->doc, - XML_SCHEMAP_REDEFINED_NOTATION, - "A notation declaration with the name '%s' does already exist.\n", - name, NULL); - xmlFree(ret); - return (NULL); - } - ADD_GLOBAL_ITEM(ctxt, ret); + ret->name = name; + ret->targetNamespace = nsName; + /* TODO: do we need the node to be set? + * ret->node = node;*/ + WXS_ADD_GLOBAL(ctxt, ret); return (ret); } @@ -4568,8 +5107,6 @@ xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlNodePtr node, int topLevel) { xmlSchemaAttributePtr ret = NULL; - int val; - xmlHashTablePtr *table; if ((ctxt == NULL) || (schema == NULL)) return (NULL); @@ -4580,86 +5117,138 @@ xmlSchemaAddAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, return (NULL); } memset(ret, 0, sizeof(xmlSchemaAttribute)); - ret->name = xmlDictLookup(ctxt->dict, name, -1); + ret->type = XML_SCHEMA_TYPE_ATTRIBUTE; + ret->node = node; + ret->name = name; ret->targetNamespace = nsName; - if (topLevel) { - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, attrDecl) - WXS_INIT_GLOBAL_HASH(ctxt, table) - val = xmlHashAddEntry(*table, name, ret); - if (val != 0) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_REDEFINED_ATTR, - NULL, NULL, node, - "A global attribute declaration with the name '%s' does " - "already exist", name); - xmlFree(ret); - return (NULL); - } - ADD_GLOBAL_ITEM(ctxt, ret); - } else - ADD_LOCAL_ITEM(ctxt, ret); - WXS_ADD_PENDING_ITEM(ctxt, ret); + if (topLevel) + WXS_ADD_GLOBAL(ctxt, ret); + else + WXS_ADD_LOCAL(ctxt, ret); + WXS_ADD_PENDING(ctxt, ret); + return (ret); +} + +/** + * xmlSchemaAddAttributeUse: + * @ctxt: a schema parser context + * @schema: the schema being built + * @name: the item name + * @namespace: the namespace + * + * Add an XML schema Attrribute declaration + * *WARNING* this interface is highly subject to change + * + * Returns the new struture or NULL in case of error + */ +static xmlSchemaAttributeUsePtr +xmlSchemaAddAttributeUse(xmlSchemaParserCtxtPtr pctxt, + xmlNodePtr node) +{ + xmlSchemaAttributeUsePtr ret = NULL; + + if (pctxt == NULL) + return (NULL); + + ret = (xmlSchemaAttributeUsePtr) xmlMalloc(sizeof(xmlSchemaAttributeUse)); + if (ret == NULL) { + xmlSchemaPErrMemory(pctxt, "allocating attribute", NULL); + return (NULL); + } + memset(ret, 0, sizeof(xmlSchemaAttributeUse)); + ret->type = XML_SCHEMA_TYPE_ATTRIBUTE_USE; + ret->node = node; + + WXS_ADD_LOCAL(pctxt, ret); + return (ret); +} + +/* +* xmlSchemaAddRedef: +* +* Adds a redefinition information. This is used at a later stage to: +* resolve references to the redefined components and to check constraints. +*/ +static xmlSchemaRedefPtr +xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaBucketPtr targetBucket, + void *item, + const xmlChar *refName, + const xmlChar *refTargetNs) +{ + xmlSchemaRedefPtr ret; + + ret = (xmlSchemaRedefPtr) + xmlMalloc(sizeof(xmlSchemaRedef)); + if (ret == NULL) { + xmlSchemaPErrMemory(pctxt, + "allocating redefinition info", NULL); + return (NULL); + } + memset(ret, 0, sizeof(xmlSchemaRedef)); + ret->item = item; + ret->targetBucket = targetBucket; + ret->refName = refName; + ret->refTargetNs = refTargetNs; + if (WXS_CONSTRUCTOR(pctxt)->redefs == NULL) + WXS_CONSTRUCTOR(pctxt)->redefs = ret; + else + WXS_CONSTRUCTOR(pctxt)->lastRedef->next = ret; + WXS_CONSTRUCTOR(pctxt)->lastRedef = ret; + return (ret); } /** - * xmlSchemaAddAttributeGroup: + * xmlSchemaAddAttributeGroupDefinition: * @ctxt: a schema parser context * @schema: the schema being built * @name: the item name + * @nsName: the target namespace + * @node: the corresponding node * - * Add an XML schema Attrribute Group declaration + * Add an XML schema Attrribute Group definition. * * Returns the new struture or NULL in case of error */ static xmlSchemaAttributeGroupPtr -xmlSchemaAddAttributeGroup(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaPtr schema, - const xmlChar * name, - xmlNodePtr node, - int topLevel) +xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema ATTRIBUTE_UNUSED, + const xmlChar *name, + const xmlChar *nsName, + xmlNodePtr node) { xmlSchemaAttributeGroupPtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; - if ((ctxt == NULL) || (schema == NULL)) + if ((pctxt == NULL) || (name == NULL)) return (NULL); ret = (xmlSchemaAttributeGroupPtr) xmlMalloc(sizeof(xmlSchemaAttributeGroup)); if (ret == NULL) { - xmlSchemaPErrMemory(ctxt, "allocating attribute group", NULL); + xmlSchemaPErrMemory(pctxt, "allocating attribute group", NULL); return (NULL); } memset(ret, 0, sizeof(xmlSchemaAttributeGroup)); ret->type = XML_SCHEMA_TYPE_ATTRIBUTEGROUP; - ret->node = node; - - if (topLevel) { - ret->flags |= XML_SCHEMAS_ATTRGROUP_GLOBAL; - ret->name = xmlDictLookup(ctxt->dict, name, -1); - ret->targetNamespace = ctxt->targetNamespace; - - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, attrgrpDecl) - WXS_INIT_GLOBAL_HASH(ctxt, table) - - val = xmlHashAddEntry(*table, name, ret); - if (val != 0) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_REDEFINED_ATTRGROUP, - NULL, NULL, node, - "A global attribute group definition with the name '%s' " - "does already exist", name); + ret->name = name; + ret->targetNamespace = nsName; + ret->node = node; + + /* TODO: Remove the flag. */ + ret->flags |= XML_SCHEMAS_ATTRGROUP_GLOBAL; + if (pctxt->isRedefine) { + pctxt->redef = xmlSchemaAddRedef(pctxt, pctxt->redefined, + ret, name, nsName); + if (pctxt->redef == NULL) { xmlFree(ret); - return (NULL); - } - ADD_GLOBAL_ITEM(ctxt, ret); - } else - ADD_LOCAL_ITEM(ctxt, ret); - - WXS_ADD_PENDING_ITEM(ctxt, ret); + return(NULL); + } + pctxt->redefCounter = 0; + } + WXS_ADD_GLOBAL(pctxt, ret); + WXS_ADD_PENDING(pctxt, ret); return (ret); } @@ -4676,15 +5265,13 @@ xmlSchemaAddAttributeGroup(xmlSchemaParserCtxtPtr ctxt, * Returns the new struture or NULL in case of error */ static xmlSchemaElementPtr -xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, +xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, const xmlChar * name, const xmlChar * nsName, xmlNodePtr node, int topLevel) { xmlSchemaElementPtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; - if ((ctxt == NULL) || (schema == NULL) || (name == NULL)) + if ((ctxt == NULL) || (name == NULL)) return (NULL); ret = (xmlSchemaElementPtr) xmlMalloc(sizeof(xmlSchemaElement)); @@ -4693,26 +5280,16 @@ xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, return (NULL); } memset(ret, 0, sizeof(xmlSchemaElement)); - ret->name = xmlDictLookup(ctxt->dict, name, -1); + ret->type = XML_SCHEMA_TYPE_ELEMENT; + ret->name = name; ret->targetNamespace = nsName; + ret->node = node; - if (topLevel) { - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, elemDecl) - WXS_INIT_GLOBAL_HASH(ctxt, table) - val = xmlHashAddEntry(*table, name, ret); - if (val != 0) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_REDEFINED_ELEMENT, - NULL, NULL, node, - "A global element declaration with the name '%s' does " - "already exist", name); - xmlFree(ret); - return (NULL); - } - ADD_GLOBAL_ITEM(ctxt, ret); - } else - ADD_LOCAL_ITEM(ctxt, ret); - WXS_ADD_PENDING_ITEM(ctxt, ret); + if (topLevel) + WXS_ADD_GLOBAL(ctxt, ret); + else + WXS_ADD_LOCAL(ctxt, ret); + WXS_ADD_PENDING(ctxt, ret); return (ret); } @@ -4730,12 +5307,11 @@ xmlSchemaAddElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ static xmlSchemaTypePtr xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, + xmlSchemaTypeType type, const xmlChar * name, const xmlChar * nsName, xmlNodePtr node, int topLevel) { xmlSchemaTypePtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; if ((ctxt == NULL) || (schema == NULL)) return (NULL); @@ -4746,53 +5322,24 @@ xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, return (NULL); } memset(ret, 0, sizeof(xmlSchemaType)); - if (name != NULL) - ret->name = xmlDictLookup(ctxt->dict, name, -1); + ret->type = type; + ret->name = name; ret->targetNamespace = nsName; ret->node = node; - /* TODO: Get rid of occurences here. */ - ret->minOccurs = 1; - ret->maxOccurs = 1; - if (topLevel) { - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, typeDecl) - WXS_INIT_GLOBAL_HASH(ctxt, table) - val = xmlHashAddEntry(*table, name, ret); - if (val != 0) { - if (! ctxt->isRedefine) { - xmlChar *str = NULL; - - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_REDEFINED_TYPE, - NULL, NULL, node, - "A global type definition with the name '%s' does " - "already exist", - xmlSchemaFormatQName(&str, nsName, name)); - FREE_AND_NULL(str); - xmlFree(ret); - return (NULL); - } else { - xmlSchemaTypePtr prev; - - /* REDEFINE: Add a redefinition. */ - TODO - prev = xmlHashLookup(*table, name); - if (prev == NULL) { - PERROR_INT2("xmlSchemaAddType", "hash list did not " - "return a redefined type component, but should"); - xmlFree(ret); - return (NULL); - } - ret->redef = prev->redef; - prev->redef = ret; - /* TODO: Add to locals; dunno if this will make trouble. */ - ADD_LOCAL_ITEM(ctxt, ret); - } - } else - ADD_GLOBAL_ITEM(ctxt, ret); + if (ctxt->isRedefine) { + ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined, + ret, name, nsName); + if (ctxt->redef == NULL) { + xmlFree(ret); + return(NULL); + } + ctxt->redefCounter = 0; + } + WXS_ADD_GLOBAL(ctxt, ret); } else - ADD_LOCAL_ITEM(ctxt, ret); - WXS_ADD_PENDING_ITEM(ctxt, ret); + WXS_ADD_LOCAL(ctxt, ret); + WXS_ADD_PENDING(ctxt, ret); return (ret); } @@ -4811,6 +5358,7 @@ xmlSchemaNewQNameRef(xmlSchemaParserCtxtPtr pctxt, "allocating QName reference item", NULL); return (NULL); } + ret->node = NULL; ret->type = XML_SCHEMA_EXTRA_QNAMEREF; ret->name = refName; ret->targetNamespace = refNs; @@ -4819,10 +5367,29 @@ xmlSchemaNewQNameRef(xmlSchemaParserCtxtPtr pctxt, /* * Store the reference item in the schema. */ - ADD_LOCAL_ITEM(pctxt, ret); + WXS_ADD_LOCAL(pctxt, ret); return (ret); } +static xmlSchemaAttributeUseProhibPtr +xmlSchemaAddAttributeUseProhib(xmlSchemaParserCtxtPtr pctxt) +{ + xmlSchemaAttributeUseProhibPtr ret; + + ret = (xmlSchemaAttributeUseProhibPtr) + xmlMalloc(sizeof(xmlSchemaAttributeUseProhib)); + if (ret == NULL) { + xmlSchemaPErrMemory(pctxt, + "allocating attribute use prohibition", NULL); + return (NULL); + } + memset(ret, 0, sizeof(xmlSchemaAttributeUseProhib)); + ret->type = XML_SCHEMA_EXTRA_ATTR_USE_PROHIB; + WXS_ADD_LOCAL(pctxt, ret); + return (ret); +} + + /** * xmlSchemaAddModelGroup: * @ctxt: a schema parser context @@ -4856,7 +5423,10 @@ xmlSchemaAddModelGroup(xmlSchemaParserCtxtPtr ctxt, memset(ret, 0, sizeof(xmlSchemaModelGroup)); ret->type = type; ret->node = node; - ADD_LOCAL_ITEM(ctxt, ret); + WXS_ADD_LOCAL(ctxt, ret); + if ((type == XML_SCHEMA_TYPE_SEQUENCE) || + (type == XML_SCHEMA_TYPE_CHOICE)) + WXS_ADD_PENDING(ctxt, ret); return (ret); } @@ -4900,12 +5470,12 @@ xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, ret->next = NULL; ret->children = NULL; - ADD_LOCAL_ITEM(ctxt, ret); + WXS_ADD_LOCAL(ctxt, ret); /* * Note that addition to pending components will be done locally * to the specific parsing function, since the most particles * need not to be fixed up (i.e. the reference to be resolved). - * REMOVED: WXS_ADD_PENDING_ITEM(ctxt, ret); + * REMOVED: WXS_ADD_PENDING(ctxt, ret); */ return (ret); } @@ -4928,15 +5498,10 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node) { xmlSchemaModelGroupDefPtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; if ((ctxt == NULL) || (schema == NULL) || (name == NULL)) return (NULL); - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, groupDecl) - WXS_INIT_GLOBAL_HASH(ctxt, table) - ret = (xmlSchemaModelGroupDefPtr) xmlMalloc(sizeof(xmlSchemaModelGroupDef)); if (ret == NULL) { @@ -4944,23 +5509,22 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, return (NULL); } memset(ret, 0, sizeof(xmlSchemaModelGroupDef)); - ret->name = xmlDictLookup(ctxt->dict, name, -1); + ret->name = name; ret->type = XML_SCHEMA_TYPE_GROUP; ret->node = node; ret->targetNamespace = nsName; - val = xmlHashAddEntry(*table, ret->name, ret); - if (val != 0) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_REDEFINED_GROUP, - NULL, NULL, node, - "A global model group definition with the name '%s' does " - "already exist", name); - xmlFree(ret); - return (NULL); + if (ctxt->isRedefine) { + ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined, + ret, name, nsName); + if (ctxt->redef == NULL) { + xmlFree(ret); + return(NULL); + } + ctxt->redefCounter = 0; } - ADD_GLOBAL_ITEM(ctxt, ret); - WXS_ADD_PENDING_ITEM(ctxt, ret); + WXS_ADD_GLOBAL(ctxt, ret); + WXS_ADD_PENDING(ctxt, ret); return (ret); } @@ -4993,16 +5557,11 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, const xmlChar *name, const xmlChar *nsName, int category, xmlNodePtr node) { - xmlSchemaIDCPtr ret = NULL; - xmlHashTablePtr *table = NULL; - int val; + xmlSchemaIDCPtr ret = NULL; if ((ctxt == NULL) || (schema == NULL) || (name == NULL)) return (NULL); - WXS_GET_GLOBAL_HASH(WXS_SCHEMA_BUCKET(ctxt), schema, idcDef) - WXS_INIT_GLOBAL_HASH(ctxt, table) - ret = (xmlSchemaIDCPtr) xmlMalloc(sizeof(xmlSchemaIDC)); if (ret == NULL) { xmlSchemaPErrMemory(ctxt, @@ -5016,25 +5575,12 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, ret->type = category; ret->node = node; - val = xmlHashAddEntry(*table, ret->name, ret); - if (val != 0) { - xmlSchemaPCustomErrExt(ctxt, - /* TODO: Error code! */ - XML_SCHEMAP_REDEFINED_TYPE, - NULL, NULL, node, - "An identity-constraint definition with the name '%s' " - "and targetNamespace '%s' does already exist", - ret->name, ret->targetNamespace, NULL); - - xmlFree(ret); - return (NULL); - } - ADD_GLOBAL_ITEM(ctxt, ret); + WXS_ADD_GLOBAL(ctxt, ret); /* * Only keyrefs need to be fixup up. */ if (category == XML_SCHEMA_TYPE_IDC_KEYREF) - WXS_ADD_PENDING_ITEM(ctxt, ret); + WXS_ADD_PENDING(ctxt, ret); return (ret); } @@ -5064,11 +5610,8 @@ xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } memset(ret, 0, sizeof(xmlSchemaWildcard)); ret->type = type; - ret->node = node; - ret->minOccurs = 1; - ret->maxOccurs = 1; - - ADD_LOCAL_ITEM(ctxt, ret); + ret->node = node; + WXS_ADD_LOCAL(ctxt, ret); return (ret); } @@ -5187,8 +5730,7 @@ xmlSchemaAddElementSubstitutionMember(xmlSchemaParserCtxtPtr pctxt, static int xmlSchemaPValAttrNodeQNameValue(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlChar **ownerDes ATTRIBUTE_UNUSED, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, const xmlChar *value, const xmlChar **uri, @@ -5269,8 +5811,7 @@ xmlSchemaPValAttrNodeQNameValue(xmlSchemaParserCtxtPtr ctxt, static int xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, const xmlChar **uri, const xmlChar **local) @@ -5279,7 +5820,7 @@ xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt, value = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr); return (xmlSchemaPValAttrNodeQNameValue(ctxt, schema, - ownerDes, ownerItem, attr, value, uri, local)); + ownerItem, attr, value, uri, local)); } /** @@ -5301,8 +5842,7 @@ xmlSchemaPValAttrNodeQName(xmlSchemaParserCtxtPtr ctxt, static int xmlSchemaPValAttrQName(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr ownerElem, const char *name, const xmlChar **uri, @@ -5317,7 +5857,7 @@ xmlSchemaPValAttrQName(xmlSchemaParserCtxtPtr ctxt, return (0); } return (xmlSchemaPValAttrNodeQName(ctxt, schema, - ownerDes, ownerItem, attr, uri, local)); + ownerItem, attr, uri, local)); } /** @@ -5335,25 +5875,15 @@ xmlSchemaPValAttrQName(xmlSchemaParserCtxtPtr ctxt, * if not valid and -1 if an internal error occurs. */ static int -xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt, - xmlChar **ownerDes ATTRIBUTE_UNUSED, - xmlSchemaTypePtr ownerItem, - xmlNodePtr ownerElem, - const xmlChar *name) +xmlSchemaPValAttrNodeID(xmlSchemaParserCtxtPtr ctxt, xmlAttrPtr attr) { int ret; - xmlChar *value; - xmlAttrPtr attr; - - value = xmlGetNoNsProp(ownerElem, name); - if (value == NULL) - return (0); + const xmlChar *value; - attr = xmlSchemaGetPropNode(ownerElem, (const char *) name); if (attr == NULL) - return (-1); - - ret = xmlValidateNCName(BAD_CAST value, 1); + return(0); + value = xmlSchemaGetNodeContentNoDict((xmlNodePtr) attr); + ret = xmlValidateNCName(value, 1); if (ret == 0) { /* * NOTE: the IDness might have already be declared in the DTD @@ -5366,38 +5896,53 @@ xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt, * TODO: Use xmlSchemaStrip here; it's not exported at this * moment. */ - strip = xmlSchemaCollapseString(BAD_CAST value); - if (strip != NULL) + strip = xmlSchemaCollapseString(value); + if (strip != NULL) { + xmlFree((xmlChar *) value); value = strip; - res = xmlAddID(NULL, ownerElem->doc, BAD_CAST value, attr); + } + res = xmlAddID(NULL, attr->doc, value, attr); if (res == NULL) { ret = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE; xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - ownerItem, (xmlNodePtr) attr, + NULL, (xmlNodePtr) attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_ID), NULL, NULL, "Duplicate value '%s' of simple " - "type 'xs:ID'", BAD_CAST value, NULL); + "type 'xs:ID'", value, NULL); } else attr->atype = XML_ATTRIBUTE_ID; - if (strip != NULL) - xmlFree(strip); } } else if (ret > 0) { ret = XML_SCHEMAP_S4S_ATTR_INVALID_VALUE; xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - ownerItem, (xmlNodePtr) attr, + NULL, (xmlNodePtr) attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_ID), NULL, NULL, "The value '%s' of simple type 'xs:ID' is " "not a valid 'xs:NCName'", - BAD_CAST value, NULL); + value, NULL); } - xmlFree(value); + if (value != NULL) + xmlFree((xmlChar *)value); return (ret); } +static int +xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt, + xmlNodePtr ownerElem, + const xmlChar *name) +{ + xmlAttrPtr attr; + + attr = xmlSchemaGetPropNode(ownerElem, (const char *) name); + if (attr == NULL) + return(0); + return(xmlSchemaPValAttrNodeID(ctxt, attr)); + +} + /** * xmlGetMaxOccurs: * @ctxt: a schema validation context @@ -5528,8 +6073,7 @@ xmlGetMinOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, */ static int xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt, - xmlChar **ownerDes ATTRIBUTE_UNUSED, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr node) { xmlChar *value = NULL; @@ -5576,8 +6120,6 @@ xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt, */ static int xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt, - xmlChar **ownerDes ATTRIBUTE_UNUSED, - xmlSchemaTypePtr ownerItem, xmlNodePtr node, const char *name, int def) { @@ -5602,7 +6144,7 @@ xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt, else { xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_INVALID_BOOLEAN, - ownerItem, + NULL, (xmlNodePtr) xmlSchemaGetPropNode(node, name), xmlSchemaGetBuiltInType(XML_SCHEMAS_BOOLEAN), NULL, val, NULL, NULL, NULL); @@ -5629,15 +6171,12 @@ static xmlSchemaTypePtr xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr xmlSchemaPtr schema, xmlNodePtr node, xmlSchemaTypeType parentType); -static xmlSchemaAttributePtr xmlSchemaParseAttribute(xmlSchemaParserCtxtPtr - ctxt, - xmlSchemaPtr schema, - xmlNodePtr node, - int topLevel); -static xmlSchemaAttributeGroupPtr -xmlSchemaParseAttributeGroup(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaPtr schema, xmlNodePtr node, - int topLevel); +static xmlSchemaBasicItemPtr +xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node, + xmlSchemaItemListPtr uses, + int parentType); static xmlSchemaTypePtr xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlNodePtr node); @@ -5664,8 +6203,7 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, */ static int xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, - xmlChar **ownerDes ATTRIBUTE_UNUSED, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, const xmlChar *value, xmlSchemaTypePtr type) @@ -5695,7 +6233,8 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, break; default: { PERROR_INT("xmlSchemaPValAttrNodeValue", - "validation using the given type is not supported"); + "validation using the given type is not supported while " + "parsing a schema"); return (-1); } } @@ -5707,7 +6246,7 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, "failed to validate a schema attribute value"); return (-1); } else if (ret > 0) { - if (VARIETY_LIST(type)) + if (WXS_IS_LIST(type)) ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; @@ -5737,8 +6276,7 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, */ static int xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, + xmlSchemaBasicItemPtr ownerItem, xmlAttrPtr attr, xmlSchemaTypePtr type, const xmlChar **value) @@ -5752,7 +6290,7 @@ xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt, if (value != NULL) *value = val; - return (xmlSchemaPValAttrNodeValue(ctxt, ownerDes, ownerItem, attr, + return (xmlSchemaPValAttrNodeValue(ctxt, ownerItem, attr, val, type)); } @@ -5776,9 +6314,8 @@ xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt, * number otherwise and -1 in case of an internal or API error. */ static int -xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt, - xmlChar **ownerDes, - xmlSchemaTypePtr ownerItem, +xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt, + xmlSchemaBasicItemPtr ownerItem, xmlNodePtr ownerElem, const char *name, xmlSchemaTypePtr type, @@ -5807,7 +6344,7 @@ xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt, *value = NULL; return (0); } - return (xmlSchemaPValAttrNode(ctxt, ownerDes, ownerItem, attr, + return (xmlSchemaPValAttrNode(ctxt, ownerItem, attr, type, value)); } @@ -5815,87 +6352,90 @@ static int xmlSchemaCheckReference(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema ATTRIBUTE_UNUSED, xmlNodePtr node, - xmlSchemaBasicItemPtr item, + xmlAttrPtr attr, const xmlChar *namespaceName) { /* TODO: Pointer comparison instead? */ if (xmlStrEqual(pctxt->targetNamespace, namespaceName)) - return (1); + return (0); if (xmlStrEqual(xmlSchemaNs, namespaceName)) - return (1); + return (0); /* * Check if the referenced namespace was ed. */ - if (WXS_SCHEMA_BUCKET(pctxt)->relations != NULL) { + if (WXS_BUCKET(pctxt)->relations != NULL) { xmlSchemaSchemaRelationPtr rel; - rel = WXS_SCHEMA_BUCKET(pctxt)->relations; + rel = WXS_BUCKET(pctxt)->relations; do { - if (WXS_IS_IMPMAIN(rel->type) && + if (WXS_IS_BUCKET_IMPMAIN(rel->type) && xmlStrEqual(namespaceName, rel->importNamespace)) - return (1); + return (0); rel = rel->next; } while (rel != NULL); } /* * No matching ed namespace found. */ - if (namespaceName == NULL) - xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_RESOLVE, - NULL, (xmlSchemaTypePtr) item, node, - "References from this schema to components in no " - "namespace are not valid, since not indicated by an import " - "statement", NULL); - else - xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_RESOLVE, - NULL, (xmlSchemaTypePtr) item, node, - "References from this schema to components in the " - "namespace '%s' are not valid, since not indicated by an import " - "statement", namespaceName); - return (0); + { + xmlNodePtr n = (attr != NULL) ? (xmlNodePtr) attr : node; + + if (namespaceName == NULL) + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_SRC_RESOLVE, n, NULL, + "References from this schema to components in no " + "namespace are not allowed, since not indicated by an " + "import statement", NULL, NULL); + else + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_SRC_RESOLVE, n, NULL, + "References from this schema to components in the " + "namespace '%s' are not allowed, since not indicated by an " + "import statement", namespaceName, NULL); + } + return (XML_SCHEMAP_SRC_RESOLVE); } /** - * xmlSchemaParseAttrDecls: + * xmlSchemaParseLocalAttributes: * @ctxt: a schema validation context * @schema: the schema being built * @node: a subtree containing XML Schema informations * @type: the hosting type where the attributes will be anchored * - * parse a XML schema attrDecls declaration corresponding to - * + * Parses attribute uses and attribute declarations and + * attribute group references. */ -static xmlNodePtr -xmlSchemaParseAttrDecls(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlNodePtr child, xmlSchemaTypePtr type) -{ - xmlSchemaAttributePtr lastattr = NULL, attr; - - while ((IS_SCHEMA(child, "attribute")) || - (IS_SCHEMA(child, "attributeGroup"))) { - attr = NULL; - if (IS_SCHEMA(child, "attribute")) { - attr = xmlSchemaParseAttribute(ctxt, schema, child, 0); - } else if (IS_SCHEMA(child, "attributeGroup")) { - attr = (xmlSchemaAttributePtr) - xmlSchemaParseAttributeGroup(ctxt, schema, child, 0); - } - if (attr != NULL) { - if (lastattr == NULL) { - if (type->type == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) - ((xmlSchemaAttributeGroupPtr) type)->attributes = attr; - else - type->attributes = attr; - lastattr = attr; - } else { - lastattr->next = attr; - lastattr = attr; - } +static int +xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, + xmlNodePtr *child, xmlSchemaItemListPtr *list, + int parentType, int *hasRefs) +{ + void *item; + + while ((IS_SCHEMA((*child), "attribute")) || + (IS_SCHEMA((*child), "attributeGroup"))) { + if (IS_SCHEMA((*child), "attribute")) { + item = xmlSchemaParseLocalAttribute(ctxt, schema, *child, + *list, parentType); + } else { + item = xmlSchemaParseAttributeGroupRef(ctxt, schema, *child); + if ((item != NULL) && (hasRefs != NULL)) + *hasRefs = 1; } - child = child->next; + if (item != NULL) { + if (*list == NULL) { + /* TODO: Customize grow factor. */ + *list = xmlSchemaItemListCreate(); + if (*list == NULL) + return(-1); + } + if (xmlSchemaItemListAddSize(*list, 2, item) == -1) + return(-1); + } + *child = (*child)->next; } - return (child); + return (0); } /** @@ -5912,7 +6452,7 @@ xmlSchemaParseAttrDecls(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ static xmlSchemaAnnotPtr xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlNodePtr node) + xmlNodePtr node, int needed) { xmlSchemaAnnotPtr ret; xmlNodePtr child = NULL; @@ -5929,7 +6469,10 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) return (NULL); - ret = xmlSchemaNewAnnot(ctxt, node); + if (needed) + ret = xmlSchemaNewAnnot(ctxt, node); + else + ret = NULL; attr = node->properties; while (attr != NULL) { if (((attr->ns == NULL) && @@ -5938,12 +6481,11 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlStrEqual(attr->ns->href, xmlSchemaNs))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... */ @@ -5964,12 +6506,11 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlStrEqual(attr->ns->href, xmlSchemaNs))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttr(ctxt, NULL, NULL, child, "source", + xmlSchemaPValAttr(ctxt, NULL, child, "source", xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI), NULL); child = child->next; } else if (IS_SCHEMA(child, "documentation")) { @@ -5984,8 +6525,7 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (attr->ns == NULL) { if (!xmlStrEqual(attr->name, BAD_CAST "source")) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else { if (xmlStrEqual(attr->ns->href, xmlSchemaNs) || @@ -5993,8 +6533,7 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, (!xmlStrEqual(attr->ns->href, XML_XML_NAMESPACE)))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } attr = attr->next; @@ -6004,14 +6543,14 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ attr = xmlSchemaGetPropNodeNs(child, (const char *) XML_XML_NAMESPACE, "lang"); if (attr != NULL) - xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr, + xmlSchemaPValAttrNode(ctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_LANGUAGE), NULL); child = child->next; } else { if (!barked) xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, "(appinfo | documentation)*"); + NULL, node, child, NULL, "(appinfo | documentation)*"); barked = 1; child = child->next; } @@ -6085,8 +6624,7 @@ xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlSchemaFreeFacet(facet); return (NULL); } - xmlSchemaPValAttrID(ctxt, NULL, - (xmlSchemaTypePtr) facet, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); facet->value = value; if ((facet->type != XML_SCHEMA_FACET_PATTERN) && (facet->type != XML_SCHEMA_FACET_ENUMERATION)) { @@ -6101,7 +6639,7 @@ xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, child = node->children; if (IS_SCHEMA(child, "annotation")) { - facet->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + facet->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child != NULL) { @@ -6199,7 +6737,7 @@ xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt, /* * Validate the item (anyURI). */ - xmlSchemaPValAttrNodeValue(ctxt, NULL, NULL, attr, + xmlSchemaPValAttrNodeValue(ctxt, NULL, attr, nsItem, xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI)); dictnsItem = xmlDictLookup(ctxt->dict, nsItem, -1); } @@ -6317,17 +6855,15 @@ xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, (!xmlStrEqual(attr->name, BAD_CAST "namespace")) && (!xmlStrEqual(attr->name, BAD_CAST "processContents"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * minOccurs/maxOccurs. */ @@ -6348,13 +6884,13 @@ xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - annot = xmlSchemaParseAnnotation(ctxt, schema, child); + annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?)"); } /* @@ -6371,8 +6907,6 @@ xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (particle == NULL) return (NULL); particle->annot = annot; - wild->minOccurs = min; - wild->maxOccurs = max; particle->children = (xmlSchemaTreeItemPtr) wild; return (particle); @@ -6404,29 +6938,26 @@ xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, "Notation has no name\n", NULL, NULL); return (NULL); } - ret = xmlSchemaAddNotation(ctxt, schema, name); - if (ret == NULL) { + ret = xmlSchemaAddNotation(ctxt, schema, name, + ctxt->targetNamespace, node); + if (ret == NULL) return (NULL); - } - ret->targetNamespace = ctxt->targetNamespace; - - xmlSchemaPValAttrID(ctxt, NULL, (xmlSchemaTypePtr) ret, - node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); if (IS_SCHEMA(child, "annotation")) { - ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } child = node->children; if (IS_SCHEMA(child, "annotation")) { - ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?)"); } @@ -6470,18 +7001,15 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, (!xmlStrEqual(attr->name, BAD_CAST "namespace")) && (!xmlStrEqual(attr->name, BAD_CAST "processContents"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, (xmlSchemaTypePtr) ret, - node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Parse the namespace list. */ @@ -6492,13 +7020,13 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?)"); } @@ -6517,466 +7045,765 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt, * * Returns the attribute declaration. */ -static xmlSchemaAttributePtr -xmlSchemaParseAttribute(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlNodePtr node, int topLevel) +static xmlSchemaBasicItemPtr +xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node, + xmlSchemaItemListPtr uses, + int parentType) { - const xmlChar *name, *attrValue; - xmlChar *repName = NULL; /* The reported designation. */ - xmlSchemaAttributePtr ret; + const xmlChar *attrValue, *name = NULL, *ns = NULL; + xmlSchemaAttributeUsePtr use = NULL; xmlNodePtr child = NULL; - xmlAttrPtr attr, nameAttr; - int isRef = 0; + xmlAttrPtr attr; + const xmlChar *tmpNs = NULL, *tmpName = NULL, *defValue = NULL; + int isRef = 0, occurs = XML_SCHEMAS_ATTR_USE_OPTIONAL; + int nberrors, hasForm = 0, defValueType = 0; + +#define WXS_ATTR_DEF_VAL_DEFAULT 1 +#define WXS_ATTR_DEF_VAL_FIXED 2 /* - * Note that the w3c spec assumes the schema to be validated with schema - * for schemas beforehand. - * * 3.2.3 Constraints on XML Representations of Attribute Declarations */ - if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) + if ((pctxt == NULL) || (schema == NULL) || (node == NULL)) return (NULL); attr = xmlSchemaGetPropNode(node, "ref"); - nameAttr = xmlSchemaGetPropNode(node, "name"); - - if ((attr == NULL) && (nameAttr == NULL)) { - /* - * 3.2.3 : 3.1 - * One of ref or name must be present, but not both - */ - xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_3_1, - NULL, node, NULL, - "One of the attributes 'ref' or 'name' must be present"); - return (NULL); - } - if ((topLevel) || (attr == NULL)) { - if (nameAttr == NULL) { - xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, - NULL, node, "name", NULL); + if (attr != NULL) { + if (xmlSchemaPValAttrNodeQName(pctxt, schema, + NULL, attr, &tmpNs, &tmpName) != 0) { return (NULL); } - } else + if (xmlSchemaCheckReference(pctxt, schema, node, attr, tmpNs) != 0) + return(NULL); isRef = 1; - - if (isRef) { -#ifdef ENABLE_NAMED_LOCALS - char buf[50]; -#endif - const xmlChar *refNs = NULL, *ref = NULL; - - /* - * Parse as attribute reference. - */ - if (xmlSchemaPValAttrNodeQName(ctxt, schema, - (xmlChar **) &xmlSchemaElemDesAttrRef, NULL, attr, &refNs, - &ref) != 0) { - return (NULL); - } -#ifdef ENABLE_NAMED_LOCALS - snprintf(buf, 49, "#aRef%d", ctxt->counter++ + 1); - name = (const xmlChar *) buf; - ret = xmlSchemaAddAttribute(ctxt, schema, name, NULL, node, 0); -#else - ret = xmlSchemaAddAttribute(ctxt, schema, NULL, NULL, node, 0); -#endif - - if (ret == NULL) { - if (repName != NULL) - xmlFree(repName); - return (NULL); - } - ret->type = XML_SCHEMA_TYPE_ATTRIBUTE; - ret->node = node; - ret->refNs = refNs; - ret->ref = ref; - xmlSchemaCheckReference(ctxt, schema, node, (xmlSchemaBasicItemPtr) ret, - refNs); - /* - xmlSchemaFormatTypeRep(&repName, (xmlSchemaTypePtr) ret, NULL, NULL); - */ - if (nameAttr != NULL) - xmlSchemaPMutualExclAttrErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_3_1, - &repName, (xmlSchemaTypePtr) ret, nameAttr, - "ref", "name"); - /* - * Check for illegal attributes. - */ - attr = node->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - if (xmlStrEqual(attr->name, BAD_CAST "type") || - xmlStrEqual(attr->name, BAD_CAST "form")) { + } + nberrors = pctxt->nberrors; + /* + * Check for illegal attributes. + */ + attr = node->properties; + while (attr != NULL) { + if (attr->ns == NULL) { + if (isRef) { + if (xmlStrEqual(attr->name, BAD_CAST "id")) { + xmlSchemaPValAttrNodeID(pctxt, attr); + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "ref")) { + goto attr_next; + } + } else { + if (xmlStrEqual(attr->name, BAD_CAST "name")) { + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "id")) { + xmlSchemaPValAttrNodeID(pctxt, attr); + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "type")) { + xmlSchemaPValAttrNodeQName(pctxt, schema, NULL, + attr, &tmpNs, &tmpName); + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "form")) { /* - * 3.2.3 : 3.2 - * If ref is present, then all of , - * form and type must be absent. + * Evaluate the target namespace */ - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_SRC_ATTRIBUTE_3_2, &repName, - (xmlSchemaTypePtr) ret, attr); - } else if ((!xmlStrEqual(attr->name, BAD_CAST "ref")) && - (!xmlStrEqual(attr->name, BAD_CAST "use")) && - (!xmlStrEqual(attr->name, BAD_CAST "id")) && - (!xmlStrEqual(attr->name, BAD_CAST "name")) && - (!xmlStrEqual(attr->name, BAD_CAST "fixed")) && - (!xmlStrEqual(attr->name, BAD_CAST "default"))) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, attr); + hasForm = 1; + attrValue = xmlSchemaGetNodeContent(pctxt, + (xmlNodePtr) attr); + if (xmlStrEqual(attrValue, BAD_CAST "qualified")) { + ns = pctxt->targetNamespace; + } else if (!xmlStrEqual(attrValue, BAD_CAST "unqualified")) + { + xmlSchemaPSimpleTypeErr(pctxt, + XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, + NULL, (xmlNodePtr) attr, + NULL, "(qualified | unqualified)", + attrValue, NULL, NULL, NULL); + } + goto attr_next; } - } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, attr); } - attr = attr->next; - } - } else { - const xmlChar *ns = NULL; + if (xmlStrEqual(attr->name, BAD_CAST "use")) { + + attrValue = xmlSchemaGetNodeContent(pctxt, (xmlNodePtr) attr); + /* TODO: Maybe we need to normalize the value beforehand. */ + if (xmlStrEqual(attrValue, BAD_CAST "optional")) + occurs = XML_SCHEMAS_ATTR_USE_OPTIONAL; + else if (xmlStrEqual(attrValue, BAD_CAST "prohibited")) + occurs = XML_SCHEMAS_ATTR_USE_PROHIBITED; + else if (xmlStrEqual(attrValue, BAD_CAST "required")) + occurs = XML_SCHEMAS_ATTR_USE_REQUIRED; + else { + xmlSchemaPSimpleTypeErr(pctxt, + XML_SCHEMAP_INVALID_ATTR_USE, + NULL, (xmlNodePtr) attr, + NULL, "(optional | prohibited | required)", + attrValue, NULL, NULL, NULL); + } + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "default")) { + /* + * 3.2.3 : 1 + * default and fixed must not both be present. + */ + if (defValue) { + xmlSchemaPMutualExclAttrErr(pctxt, + XML_SCHEMAP_SRC_ATTRIBUTE_1, + NULL, attr, "default", "fixed"); + } else { + defValue = xmlSchemaGetNodeContent(pctxt, (xmlNodePtr) attr); + defValueType = WXS_ATTR_DEF_VAL_DEFAULT; + } + goto attr_next; + } else if (xmlStrEqual(attr->name, BAD_CAST "fixed")) { + /* + * 3.2.3 : 1 + * default and fixed must not both be present. + */ + if (defValue) { + xmlSchemaPMutualExclAttrErr(pctxt, + XML_SCHEMAP_SRC_ATTRIBUTE_1, + NULL, attr, "default", "fixed"); + } else { + defValue = xmlSchemaGetNodeContent(pctxt, (xmlNodePtr) attr); + defValueType = WXS_ATTR_DEF_VAL_FIXED; + } + goto attr_next; + } + } else if (! xmlStrEqual(attr->ns->href, xmlSchemaNs)) + goto attr_next; + + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); + +attr_next: + attr = attr->next; + } + /* + * 3.2.3 : 2 + * If default and use are both present, use must have + * the actual value optional. + */ + if ((defValueType == WXS_ATTR_DEF_VAL_DEFAULT) && + (occurs != XML_SCHEMAS_ATTR_USE_OPTIONAL)) { + xmlSchemaPSimpleTypeErr(pctxt, + XML_SCHEMAP_SRC_ATTRIBUTE_2, + NULL, node, NULL, + "(optional | prohibited | required)", NULL, + "The value of the attribute 'use' must be 'optional' " + "if the attribute 'default' is present", + NULL, NULL); + } + /* + * We want correct attributes. + */ + if (nberrors != pctxt->nberrors) + return(NULL); + if (! isRef) { + xmlSchemaAttributePtr attrDecl; + /* TODO: move XML_SCHEMAS_QUALIF_ATTR to the parser. */ + if ((! hasForm) && (schema->flags & XML_SCHEMAS_QUALIF_ATTR)) + ns = pctxt->targetNamespace; /* - * Parse as attribute declaration. + * 3.2.6 Schema Component Constraint: xsi: Not Allowed + * TODO: Move this to the component layer. */ - if (xmlSchemaPValAttrNode(ctxt, - (xmlChar **) &xmlSchemaElemDesAttrDecl, NULL, nameAttr, + if (xmlStrEqual(ns, xmlSchemaInstanceNs)) { + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_NO_XSI, + node, NULL, + "The target namespace must not match '%s'", + xmlSchemaInstanceNs, NULL); + } + attr = xmlSchemaGetPropNode(node, "name"); + if (attr == NULL) { + xmlSchemaPMissingAttrErr(pctxt, XML_SCHEMAP_S4S_ATTR_MISSING, + NULL, node, "name", NULL); + return (NULL); + } + if (xmlSchemaPValAttrNode(pctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { return (NULL); } /* - xmlSchemaFormatTypeRep(&repName, NULL, xmlSchemaElemDesAttrDecl, name); - */ - /* * 3.2.6 Schema Component Constraint: xmlns Not Allowed * TODO: Move this to the component layer. */ if (xmlStrEqual(name, BAD_CAST "xmlns")) { - xmlSchemaPSimpleTypeErr(ctxt, + xmlSchemaPSimpleTypeErr(pctxt, XML_SCHEMAP_NO_XMLNS, - NULL, (xmlNodePtr) nameAttr, + NULL, (xmlNodePtr) attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), NULL, NULL, - "The value of type 'xs:NCName' must not match 'xmlns'", + "The value of the attribute must not match 'xmlns'", NULL, NULL); - if (repName != NULL) - xmlFree(repName); return (NULL); } + if (occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) + goto check_children; /* - * Evaluate the target namespace + * Create the attribute use component. */ - if (topLevel) { - ns = ctxt->targetNamespace; - } else { - attr = xmlSchemaGetPropNode(node, "form"); - if (attr != NULL) { - attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr); - if (xmlStrEqual(attrValue, BAD_CAST "qualified")) { - ns = ctxt->targetNamespace; - } else if (!xmlStrEqual(attrValue, BAD_CAST "unqualified")) { - xmlSchemaPSimpleTypeErr(ctxt, - XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - NULL, (xmlNodePtr) attr, - NULL, "(qualified | unqualified)", - attrValue, NULL, NULL, NULL); - } - } else if (schema->flags & XML_SCHEMAS_QUALIF_ATTR) - /* TODO: move XML_SCHEMAS_QUALIF_ATTR to the parser. */ - ns = ctxt->targetNamespace; - } - ret = xmlSchemaAddAttribute(ctxt, schema, name, ns, node, topLevel); - if (ret == NULL) { - if (repName != NULL) - xmlFree(repName); + use = xmlSchemaAddAttributeUse(pctxt, node); + if (use == NULL) + return(NULL); + use->occurs = occurs; + /* + * Create the attribute declaration. + */ + attrDecl = xmlSchemaAddAttribute(pctxt, schema, name, ns, node, 0); + if (attrDecl == NULL) return (NULL); + if (tmpName != NULL) { + attrDecl->typeName = tmpName; + attrDecl->typeNs = tmpNs; } - ret->type = XML_SCHEMA_TYPE_ATTRIBUTE; - ret->node = node; - if (topLevel) - ret->flags |= XML_SCHEMAS_ATTR_GLOBAL; + use->attrDecl = attrDecl; /* - * 3.2.6 Schema Component Constraint: xsi: Not Allowed - * TODO: Move this to the component layer. - */ - if (xmlStrEqual(ret->targetNamespace, xmlSchemaInstanceNs)) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_NO_XSI, - &repName, (xmlSchemaTypePtr) ret, node, - "The target namespace must not match '%s'", - xmlSchemaInstanceNs); + * Value constraint. + */ + if (defValue != NULL) { + attrDecl->defValue = defValue; + if (defValueType == WXS_ATTR_DEF_VAL_FIXED) + attrDecl->flags |= XML_SCHEMAS_ATTR_FIXED; } + } else if (occurs != XML_SCHEMAS_ATTR_USE_PROHIBITED) { + xmlSchemaQNameRefPtr ref; + /* - * Check for illegal attributes. + * Create the attribute use component. */ - attr = node->properties; - while (attr != NULL) { - if (attr->ns == NULL) { - if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && - (!xmlStrEqual(attr->name, BAD_CAST "default")) && - (!xmlStrEqual(attr->name, BAD_CAST "fixed")) && - (!xmlStrEqual(attr->name, BAD_CAST "name")) && - (!xmlStrEqual(attr->name, BAD_CAST "type"))) { - if ((topLevel) || - ((!xmlStrEqual(attr->name, BAD_CAST "form")) && - (!xmlStrEqual(attr->name, BAD_CAST "use")))) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, attr); - } - } - } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { - xmlSchemaPIllegalAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, attr); - } - attr = attr->next; - } - xmlSchemaPValAttrQName(ctxt, schema, &repName, (xmlSchemaTypePtr) ret, - node, "type", &ret->typeNs, &ret->typeName); - } - xmlSchemaPValAttrID(ctxt, NULL, (xmlSchemaTypePtr) ret, - node, BAD_CAST "id"); - /* - * Attribute "fixed". - */ - ret->defValue = xmlSchemaGetProp(ctxt, node, "fixed"); - if (ret->defValue != NULL) - ret->flags |= XML_SCHEMAS_ATTR_FIXED; - /* - * Attribute "default". - */ - attr = xmlSchemaGetPropNode(node, "default"); - if (attr != NULL) { + use = xmlSchemaAddAttributeUse(pctxt, node); + if (use == NULL) + return(NULL); /* - * 3.2.3 : 1 - * default and fixed must not both be present. + * We need to resolve the reference at later stage. */ - if (ret->flags & XML_SCHEMAS_ATTR_FIXED) { - xmlSchemaPMutualExclAttrErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_1, - &repName, (xmlSchemaTypePtr) ret, attr, "default", "fixed"); - } else - ret->defValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr); - } - if (topLevel == 0) { + WXS_ADD_PENDING(pctxt, use); + use->occurs = occurs; /* - * Attribute "use". + * Create a QName reference to the attribute declaration. */ - attr = xmlSchemaGetPropNode(node, "use"); - if (attr != NULL) { - attrValue = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr); - if (xmlStrEqual(attrValue, BAD_CAST "optional")) - ret->occurs = XML_SCHEMAS_ATTR_USE_OPTIONAL; - else if (xmlStrEqual(attrValue, BAD_CAST "prohibited")) - ret->occurs = XML_SCHEMAS_ATTR_USE_PROHIBITED; - else if (xmlStrEqual(attrValue, BAD_CAST "required")) - ret->occurs = XML_SCHEMAS_ATTR_USE_REQUIRED; - else - xmlSchemaPSimpleTypeErr(ctxt, - XML_SCHEMAP_INVALID_ATTR_USE, - (xmlSchemaTypePtr) ret, (xmlNodePtr) attr, - NULL, "(optional | prohibited | required)", - attrValue, NULL, NULL, NULL); - } else - ret->occurs = XML_SCHEMAS_ATTR_USE_OPTIONAL; + ref = xmlSchemaNewQNameRef(pctxt, XML_SCHEMA_TYPE_ATTRIBUTE, + tmpName, tmpNs); + if (ref == NULL) + return(NULL); /* - * 3.2.3 : 2 - * If default and use are both present, use must have - * the actual value optional. + * Assign the reference. This will be substituted for the + * referenced attribute declaration when the QName is resolved. */ - if ((ret->occurs != XML_SCHEMAS_ATTR_USE_OPTIONAL) && - (ret->defValue != NULL) && - ((ret->flags & XML_SCHEMAS_ATTR_FIXED) == 0)) { - xmlSchemaPSimpleTypeErr(ctxt, - XML_SCHEMAP_SRC_ATTRIBUTE_2, - (xmlSchemaTypePtr) ret, (xmlNodePtr) attr, - NULL, "(optional | prohibited | required)", NULL, - "The value must be 'optional' if the attribute " - "'default' is present as well", NULL, NULL); - } + use->attrDecl = WXS_ATTR_CAST ref; + /* + * Value constraint. + */ + if (defValue != NULL) + use->defValue = defValue; + if (defValueType == WXS_ATTR_DEF_VAL_FIXED) + use->flags |= XML_SCHEMA_ATTR_USE_FIXED; } + +check_children: /* * And now for the children... */ child = node->children; - if (IS_SCHEMA(child, "annotation")) { - ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child); - child = child->next; - } - if (isRef) { - if (child != NULL) { - if (IS_SCHEMA(child, "simpleType")) - /* - * 3.2.3 : 3.2 - * If ref is present, then all of , - * form and type must be absent. - */ - xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_3_2, - &repName, (xmlSchemaTypePtr) ret, node, child, NULL, - "(annotation?)"); - else - xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, node, child, NULL, - "(annotation?)"); - } - } else { - if (IS_SCHEMA(child, "simpleType")) { - if (ret->typeName != NULL) { - /* - * 3.2.3 : 4 - * type and must not both be present. - */ - xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_4, - &repName, (xmlSchemaTypePtr) ret, node, child, - "The attribute 'type' and the child " - "are mutually exclusive", NULL); - } else - ret->subtypes = xmlSchemaParseSimpleType(ctxt, schema, child, 0); + if (occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) { + xmlSchemaAttributeUseProhibPtr prohib; + + if (IS_SCHEMA(child, "annotation")) { + xmlSchemaParseAnnotation(pctxt, schema, child, 0); child = child->next; } - if (child != NULL) - xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - &repName, (xmlSchemaTypePtr) ret, node, child, NULL, - "(annotation?, simpleType?)"); - } - /* - * Cleanup. - */ - if (repName != NULL) - xmlFree(repName); - return (ret); -} - -/** - * xmlSchemaParseAttributeGroup: - * @ctxt: a schema validation context - * @schema: the schema being built - * @node: a subtree containing XML Schema informations - * - * parse a XML schema Attribute Group declaration - * *WARNING* this interface is highly subject to change - * - * Returns the attribute group or NULL in case of error. - */ -static xmlSchemaAttributeGroupPtr -xmlSchemaParseAttributeGroup(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaPtr schema, xmlNodePtr node, - int topLevel) -{ - const xmlChar *name; - xmlSchemaAttributeGroupPtr ret; - xmlNodePtr child = NULL; - xmlAttrPtr attr, nameAttr; - - if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) - return (NULL); - - nameAttr = xmlSchemaGetPropNode(node, "name"); - attr = xmlSchemaGetPropNode(node, "ref"); - if ((topLevel) || (attr == NULL)) { + if (child != NULL) { + xmlSchemaPContentErr(pctxt, + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, + NULL, node, child, NULL, + "(annotation?)"); + } /* - * Parse as an attribute group definition. - * Note that those are allowed at top level only. + * Check for pointlessness of attribute prohibitions. */ - if (nameAttr == NULL) { - xmlSchemaPMissingAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_MISSING, - NULL, node, "name", NULL); - return (NULL); + if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) { + xmlSchemaCustomWarning(ACTXT_CAST pctxt, + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, + node, NULL, + "Skipping attribute use prohibition, since it is " + "pointless inside an ", + NULL, NULL, NULL); + return(NULL); + } else if (parentType == XML_SCHEMA_TYPE_EXTENSION) { + xmlSchemaCustomWarning(ACTXT_CAST pctxt, + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, + node, NULL, + "Skipping attribute use prohibition, since it is " + "pointless when extending a type", + NULL, NULL, NULL); + return(NULL); + } + if (! isRef) { + tmpName = name; + tmpNs = ns; } - /* REDUNDANT: name = xmlSchemaGetNodeContent(ctxt, - * (xmlNodePtr) nameAttr); - */ /* - * The name is crucial, exit if invalid. + * Check for duplicate attribute prohibitions. */ - if (xmlSchemaPValAttrNode(ctxt, - NULL, NULL, nameAttr, - xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { - return (NULL); + if (uses) { + int i; + + for (i = 0; i < uses->nbItems; i++) { + use = uses->items[i]; + if ((use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) && + (tmpName == (WXS_ATTR_PROHIB_CAST use)->name) && + (tmpNs == (WXS_ATTR_PROHIB_CAST use)->targetNamespace)) + { + xmlChar *str = NULL; + + xmlSchemaCustomWarning(ACTXT_CAST pctxt, + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, + node, NULL, + "Skipping duplicate attribute use prohibition '%s'", + xmlSchemaFormatQName(&str, tmpNs, tmpName), + NULL, NULL); + FREE_AND_NULL(str) + return(NULL); + } + } } - ret = xmlSchemaAddAttributeGroup(ctxt, schema, name, node, 1); - if (ret == NULL) - return (NULL); - } else { -#ifdef ENABLE_NAMED_LOCALS - char buf[50]; -#endif - const xmlChar *refNs = NULL, *ref = NULL; - /* - * Parse as an attribute group definition reference. + * Create the attribute prohibition helper component. */ - if (attr == NULL) { - xmlSchemaPMissingAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_MISSING, - NULL, node, "ref", NULL); + prohib = xmlSchemaAddAttributeUseProhib(pctxt); + if (prohib == NULL) + return(NULL); + prohib->node = node; + prohib->name = tmpName; + prohib->targetNamespace = tmpNs; + if (isRef) { + /* + * We need at least to resolve to the attribute declaration. + */ + WXS_ADD_PENDING(pctxt, prohib); } - xmlSchemaPValAttrNodeQName(ctxt, schema, - NULL, NULL, attr, &refNs,&ref); -#ifdef ENABLE_NAMED_LOCALS - snprintf(buf, 49, "#agRef%d", ctxt->counter++ + 1); - name = (const xmlChar *) buf; - if (name == NULL) { - xmlSchemaPErrMemory(ctxt, "creating internal name for an " - "attribute group definition reference", node); - return (NULL); - } - ret = xmlSchemaAddAttributeGroup(ctxt, schema, name, node, 0); -#else - ret = xmlSchemaAddAttributeGroup(ctxt, schema, NULL, node, 0); -#endif - if (ret == NULL) - return (NULL); - ret->ref = ref; - ret->refNs = refNs; - xmlSchemaCheckReference(ctxt, schema, node, - (xmlSchemaBasicItemPtr) ret, refNs); + return(WXS_BASIC_CAST prohib); + } else { + if (IS_SCHEMA(child, "annotation")) { + /* + * TODO: Should this go into the attr decl? + */ + use->annot = xmlSchemaParseAnnotation(pctxt, schema, child, 1); + child = child->next; + } + if (isRef) { + if (child != NULL) { + if (IS_SCHEMA(child, "simpleType")) + /* + * 3.2.3 : 3.2 + * If ref is present, then all of , + * form and type must be absent. + */ + xmlSchemaPContentErr(pctxt, + XML_SCHEMAP_SRC_ATTRIBUTE_3_2, + NULL, node, child, NULL, + "(annotation?)"); + else + xmlSchemaPContentErr(pctxt, + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, + NULL, node, child, NULL, + "(annotation?)"); + } + } else { + if (IS_SCHEMA(child, "simpleType")) { + if (WXS_ATTRUSE_DECL(use)->typeName != NULL) { + /* + * 3.2.3 : 4 + * type and must not both be present. + */ + xmlSchemaPContentErr(pctxt, XML_SCHEMAP_SRC_ATTRIBUTE_4, + NULL, node, child, + "The attribute 'type' and the child " + "are mutually exclusive", NULL); + } else + WXS_ATTRUSE_TYPEDEF(use) = + xmlSchemaParseSimpleType(pctxt, schema, child, 0); + child = child->next; + } + if (child != NULL) + xmlSchemaPContentErr(pctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, + NULL, node, child, NULL, + "(annotation?, simpleType?)"); + } + } + return (WXS_BASIC_CAST use); +} + + +static xmlSchemaAttributePtr +xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node) +{ + const xmlChar *attrValue; + xmlSchemaAttributePtr ret; + xmlNodePtr child = NULL; + xmlAttrPtr attr; + + /* + * Note that the w3c spec assumes the schema to be validated with schema + * for schemas beforehand. + * + * 3.2.3 Constraints on XML Representations of Attribute Declarations + */ + if ((pctxt == NULL) || (schema == NULL) || (node == NULL)) + return (NULL); + /* + * 3.2.3 : 3.1 + * One of ref or name must be present, but not both + */ + attr = xmlSchemaGetPropNode(node, "name"); + if (attr == NULL) { + xmlSchemaPMissingAttrErr(pctxt, XML_SCHEMAP_S4S_ATTR_MISSING, + NULL, node, "name", NULL); + return (NULL); + } + if (xmlSchemaPValAttrNode(pctxt, NULL, attr, + xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &attrValue) != 0) { + return (NULL); + } + /* + * 3.2.6 Schema Component Constraint: xmlns Not Allowed + * TODO: Move this to the component layer. + */ + if (xmlStrEqual(attrValue, BAD_CAST "xmlns")) { + xmlSchemaPSimpleTypeErr(pctxt, + XML_SCHEMAP_NO_XMLNS, + NULL, (xmlNodePtr) attr, + xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), NULL, NULL, + "The value of the attribute must not match 'xmlns'", + NULL, NULL); + return (NULL); + } + /* + * 3.2.6 Schema Component Constraint: xsi: Not Allowed + * TODO: Move this to the component layer. + * Or better leave it here and add it to the component layer + * if we have a schema construction API. + */ + if (xmlStrEqual(pctxt->targetNamespace, xmlSchemaInstanceNs)) { + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_NO_XSI, node, NULL, + "The target namespace must not match '%s'", + xmlSchemaInstanceNs, NULL); + } + + ret = xmlSchemaAddAttribute(pctxt, schema, attrValue, + pctxt->targetNamespace, node, 1); + if (ret == NULL) + return (NULL); + ret->flags |= XML_SCHEMAS_ATTR_GLOBAL; + + /* + * Check for illegal attributes. + */ + attr = node->properties; + while (attr != NULL) { + if (attr->ns == NULL) { + if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && + (!xmlStrEqual(attr->name, BAD_CAST "default")) && + (!xmlStrEqual(attr->name, BAD_CAST "fixed")) && + (!xmlStrEqual(attr->name, BAD_CAST "name")) && + (!xmlStrEqual(attr->name, BAD_CAST "type"))) + { + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); + } + } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); + } + attr = attr->next; + } + xmlSchemaPValAttrQName(pctxt, schema, NULL, + node, "type", &ret->typeNs, &ret->typeName); + + xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id"); + /* + * Attribute "fixed". + */ + ret->defValue = xmlSchemaGetProp(pctxt, node, "fixed"); + if (ret->defValue != NULL) + ret->flags |= XML_SCHEMAS_ATTR_FIXED; + /* + * Attribute "default". + */ + attr = xmlSchemaGetPropNode(node, "default"); + if (attr != NULL) { + /* + * 3.2.3 : 1 + * default and fixed must not both be present. + */ + if (ret->flags & XML_SCHEMAS_ATTR_FIXED) { + xmlSchemaPMutualExclAttrErr(pctxt, XML_SCHEMAP_SRC_ATTRIBUTE_1, + WXS_BASIC_CAST ret, attr, "default", "fixed"); + } else + ret->defValue = xmlSchemaGetNodeContent(pctxt, (xmlNodePtr) attr); + } + /* + * And now for the children... + */ + child = node->children; + if (IS_SCHEMA(child, "annotation")) { + ret->annot = xmlSchemaParseAnnotation(pctxt, schema, child, 1); + child = child->next; + } + if (IS_SCHEMA(child, "simpleType")) { + if (ret->typeName != NULL) { + /* + * 3.2.3 : 4 + * type and must not both be present. + */ + xmlSchemaPContentErr(pctxt, XML_SCHEMAP_SRC_ATTRIBUTE_4, + NULL, node, child, + "The attribute 'type' and the child " + "are mutually exclusive", NULL); + } else + ret->subtypes = xmlSchemaParseSimpleType(pctxt, schema, child, 0); + child = child->next; } + if (child != NULL) + xmlSchemaPContentErr(pctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, + NULL, node, child, NULL, + "(annotation?, simpleType?)"); + + return (ret); +} + +/** + * xmlSchemaParseAttributeGroupRef: + * @ctxt: a schema validation context + * @schema: the schema being built + * @node: a subtree containing XML Schema informations + * + * Parse an attribute group definition reference. + * Note that a reference to an attribute group does not + * correspond to any component at all. + * *WARNING* this interface is highly subject to change + * + * Returns the attribute group or NULL in case of error. + */ +static xmlSchemaQNameRefPtr +xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node) +{ + xmlSchemaQNameRefPtr ret; + xmlNodePtr child = NULL; + xmlAttrPtr attr; + const xmlChar *refNs = NULL, *ref = NULL; + + if ((pctxt == NULL) || (schema == NULL) || (node == NULL)) + return (NULL); + + attr = xmlSchemaGetPropNode(node, "ref"); + if (attr == NULL) { + xmlSchemaPMissingAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_MISSING, + NULL, node, "ref", NULL); + return (NULL); + } + xmlSchemaPValAttrNodeQName(pctxt, schema, + NULL, attr, &refNs, &ref); + if (xmlSchemaCheckReference(pctxt, schema, node, attr, refNs) != 0) + return(NULL); + /* * Check for illegal attributes. */ attr = node->properties; while (attr != NULL) { if (attr->ns == NULL) { - if ((((topLevel == 0) && - (!xmlStrEqual(attr->name, BAD_CAST "ref"))) || - (topLevel && (!xmlStrEqual(attr->name, BAD_CAST "name")))) && + if ((!xmlStrEqual(attr->name, BAD_CAST "ref")) && (!xmlStrEqual(attr->name, BAD_CAST "id"))) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } /* Attribute ID */ - xmlSchemaPValAttrID(ctxt, NULL, (xmlSchemaTypePtr) ret, - node, BAD_CAST "id"); + xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id"); + /* * And now for the children... */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - ret->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + /* + * TODO: We do not have a place to store the annotation, do we? + */ + xmlSchemaParseAnnotation(pctxt, schema, child, 0); child = child->next; } - if (topLevel) { - child = xmlSchemaParseAttrDecls(ctxt, schema, child, - (xmlSchemaTypePtr) ret); - if (IS_SCHEMA(child, "anyAttribute")) { - ret->attributeWildcard = xmlSchemaParseAnyAttribute(ctxt, - schema, child); - child = child->next; + if (child != NULL) { + xmlSchemaPContentErr(pctxt, + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, + NULL, node, child, NULL, + "(annotation?)"); + } + + /* + * Handle attribute group redefinitions. + */ + if (pctxt->isRedefine && pctxt->redef && + (pctxt->redef->item->type == + XML_SCHEMA_TYPE_ATTRIBUTEGROUP) && + (ref == pctxt->redef->refName) && + (refNs == pctxt->redef->refTargetNs)) + { + /* + * SPEC src-redefine: + * (7.1) "If it has an among its contents + * the ·actual value· of whose ref [attribute] is the same + * as the ·actual value· of its own name attribute plus + * target namespace, then it must have exactly one such group." + */ + if (pctxt->redefCounter != 0) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_SRC_REDEFINE, node, NULL, + "The redefining attribute group definition " + "'%s' must not contain more than one " + "reference to the redefined definition", + xmlSchemaFormatQName(&str, refNs, ref), NULL); + FREE_AND_NULL(str); + return(NULL); + } + pctxt->redefCounter++; + /* + * URGENT TODO: How to ensure that the reference will not be + * handled by the normal component resolution mechanism? + */ + ret = xmlSchemaNewQNameRef(pctxt, + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, ref, refNs); + if (ret == NULL) + return(NULL); + ret->node = node; + pctxt->redef->reference = WXS_BASIC_CAST ret; + } else { + /* + * Create a QName-reference helper component. We will substitute this + * component for the attribute uses of the referenced attribute group + * definition. + */ + ret = xmlSchemaNewQNameRef(pctxt, + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, ref, refNs); + if (ret == NULL) + return(NULL); + ret->node = node; + /* Add to pending items, to be able to resolve the reference. */ + WXS_ADD_PENDING(pctxt, ret); + } + return (ret); +} + +/** + * xmlSchemaParseAttributeGroupDefinition: + * @pctxt: a schema validation context + * @schema: the schema being built + * @node: a subtree containing XML Schema informations + * + * parse a XML schema Attribute Group declaration + * *WARNING* this interface is highly subject to change + * + * Returns the attribute group definition or NULL in case of error. + */ +static xmlSchemaAttributeGroupPtr +xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaPtr schema, + xmlNodePtr node) +{ + const xmlChar *name; + xmlSchemaAttributeGroupPtr ret; + xmlNodePtr child = NULL; + xmlAttrPtr attr; + int hasRefs = 0; + + if ((pctxt == NULL) || (schema == NULL) || (node == NULL)) + return (NULL); + + attr = xmlSchemaGetPropNode(node, "name"); + if (attr == NULL) { + xmlSchemaPMissingAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_MISSING, + NULL, node, "name", NULL); + return (NULL); + } + /* + * The name is crucial, exit if invalid. + */ + if (xmlSchemaPValAttrNode(pctxt, + NULL, attr, + xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { + return (NULL); + } + ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema, + name, pctxt->targetNamespace, node); + if (ret == NULL) + return (NULL); + /* + * Check for illegal attributes. + */ + attr = node->properties; + while (attr != NULL) { + if (attr->ns == NULL) { + if ((!xmlStrEqual(attr->name, BAD_CAST "name")) && + (!xmlStrEqual(attr->name, BAD_CAST "id"))) + { + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); + } + } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { + xmlSchemaPIllegalAttrErr(pctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } + attr = attr->next; + } + /* Attribute ID */ + xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id"); + /* + * And now for the children... + */ + child = node->children; + if (IS_SCHEMA(child, "annotation")) { + ret->annot = xmlSchemaParseAnnotation(pctxt, schema, child, 1); + child = child->next; + } + /* + * Parse contained attribute decls/refs. + */ + if (xmlSchemaParseLocalAttributes(pctxt, schema, &child, + (xmlSchemaItemListPtr *) &(ret->attrUses), + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, &hasRefs) == -1) + return(NULL); + if (hasRefs) + ret->flags |= XML_SCHEMAS_ATTRGROUP_HAS_REFS; + /* + * Parse the attribute wildcard. + */ + if (IS_SCHEMA(child, "anyAttribute")) { + ret->attributeWildcard = xmlSchemaParseAnyAttribute(pctxt, + schema, child); + child = child->next; } if (child != NULL) { - xmlSchemaPContentErr(ctxt, + xmlSchemaPContentErr(pctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, - "(annotation?)"); + NULL, node, child, NULL, + "(annotation?, ((attribute | attributeGroup)*, anyAttribute?))"); } return (ret); } @@ -7139,7 +7966,7 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPCustomErr(ctxt, /* TODO: Adjust error code. */ XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - NULL, NULL, node, + NULL, node, "The XPath expression of the selector is not valid", NULL); return (XML_SCHEMAP_S4S_ATTR_INVALID_VALUE); } else { @@ -7159,7 +7986,6 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt, */ if (nsList != NULL) { int i, count = 0; - xmlNsPtr ns; for (i = 0; nsList[i] != NULL; i++) count++; @@ -7169,10 +7995,10 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt, if (nsArray == NULL) { xmlSchemaPErrMemory(ctxt, "allocating a namespace array", NULL); + xmlFree(nsList); return (-1); } for (i = 0; i < count; i++) { - ns = nsList[i]; nsArray[2 * i] = nsList[i]->href; nsArray[2 * i + 1] = nsList[i]->prefix; } @@ -7195,7 +8021,7 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPCustomErr(ctxt, /* TODO: Adjust error code? */ XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - NULL, NULL, node, + NULL, node, "The XPath expression '%s' could not be " "compiled", selector->xpath); return (XML_SCHEMAP_S4S_ATTR_INVALID_VALUE); @@ -7304,7 +8130,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem, default: xmlSchemaPCustomErr(NULL, XML_SCHEMAP_INTERNAL, - NULL, NULL, NULL, + NULL, NULL, "Internal error: xmlSchemaAddAnnotation, " "The item is not a annotated schema component", NULL); break; @@ -7343,13 +8169,11 @@ xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "xpath"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -7390,7 +8214,7 @@ xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, } } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... */ @@ -7400,13 +8224,13 @@ xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt, * Add the annotation to the parent IDC. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) idc, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?)"); } @@ -7447,13 +8271,11 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, ((idcCategory != XML_SCHEMA_TYPE_IDC_KEYREF) || (!xmlStrEqual(attr->name, BAD_CAST "refer")))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -7468,7 +8290,7 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, "name", NULL); return (NULL); } else if (xmlSchemaPValAttrNode(ctxt, - NULL, NULL, attr, + NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { return (NULL); } @@ -7478,8 +8300,7 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, if (item == NULL) return(NULL); - xmlSchemaPValAttrID(ctxt, NULL, (xmlSchemaTypePtr) item, - node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); if (idcCategory == XML_SCHEMA_TYPE_IDC_KEYREF) { /* * Attribute "refer" (mandatory). @@ -7499,11 +8320,10 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, if (item->ref == NULL) return (NULL); xmlSchemaPValAttrNodeQName(ctxt, schema, - NULL, NULL, attr, + NULL, attr, &(item->ref->targetNamespace), &(item->ref->name)); - xmlSchemaCheckReference(ctxt, schema, node, - (xmlSchemaBasicItemPtr) item, + xmlSchemaCheckReference(ctxt, schema, node, attr, item->ref->targetNamespace); } } @@ -7512,13 +8332,13 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - item->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + item->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, NULL, node, child, + NULL, node, child, "A child element is missing", "(annotation?, (selector, field+))"); } @@ -7550,14 +8370,14 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, } else { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?, (selector, field+))"); } } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?, (selector, field+))"); } @@ -7579,7 +8399,7 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt, */ static xmlSchemaBasicItemPtr xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, - xmlNodePtr node, int topLevel) + xmlNodePtr node, int *isElemRef, int topLevel) { xmlSchemaElementPtr decl = NULL; xmlSchemaParticlePtr particle = NULL; @@ -7594,6 +8414,9 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) return (NULL); + + if (isElemRef != NULL) + *isElemRef = 0; /* * If we get a "ref" attribute on a local we will assume it's * a reference - even if there's a "name" attribute; this seems to be more @@ -7611,10 +8434,10 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } else isRef = 1; - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); child = node->children; if (IS_SCHEMA(child, "annotation")) { - annot = xmlSchemaParseAnnotation(ctxt, schema, child); + annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } /* @@ -7640,16 +8463,18 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * The reference part ============================================= */ + if (isElemRef != NULL) + *isElemRef = 1; + xmlSchemaPValAttrNodeQName(ctxt, schema, - NULL, NULL, attr, &refNs, &ref); - xmlSchemaCheckReference(ctxt, schema, node, NULL, refNs); + NULL, attr, &refNs, &ref); + xmlSchemaCheckReference(ctxt, schema, node, attr, refNs); /* * SPEC (3.3.3 : 2.1) "One of ref or name must be present, but not both" */ if (nameAttr != NULL) { xmlSchemaPMutualExclAttrErr(ctxt, - XML_SCHEMAP_SRC_ELEMENT_2_1, - NULL, NULL, nameAttr, "ref", "name"); + XML_SCHEMAP_SRC_ELEMENT_2_1, NULL, nameAttr, "ref", "name"); } /* * Check for illegal attributes. @@ -7676,8 +8501,7 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -7686,12 +8510,12 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, "(annotation?)"); + NULL, node, child, NULL, "(annotation?)"); } if ((min == 0) && (max == 0)) goto return_null; /* - * Create the reference item. + * Create the reference item and attach it to the particle. */ refer = xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_ELEMENT, ref, refNs); @@ -7703,7 +8527,7 @@ xmlSchemaParseElement(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Add the particle to pending components, since the reference * need to be resolved. */ - WXS_ADD_PENDING_ITEM(ctxt, particle); + WXS_ADD_PENDING(ctxt, particle); return ((xmlSchemaBasicItemPtr) particle); } /* @@ -7714,7 +8538,7 @@ declaration_part: const xmlChar *ns = NULL, *fixed, *name, *attrValue; xmlSchemaIDCPtr curIDC = NULL, lastIDC = NULL; - if (xmlSchemaPValAttrNode(ctxt, NULL, NULL, nameAttr, + if (xmlSchemaPValAttrNode(ctxt, NULL, nameAttr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) goto return_null; /* @@ -7738,13 +8562,10 @@ declaration_part: } else if (schema->flags & XML_SCHEMAS_QUALIF_ELEM) ns = ctxt->targetNamespace; } - decl = xmlSchemaAddElement(ctxt, schema, name, ns, node, topLevel); + decl = xmlSchemaAddElement(ctxt, name, ns, node, topLevel); if (decl == NULL) { goto return_null; } - decl->type = XML_SCHEMA_TYPE_ELEMENT; - decl->node = node; - decl->targetNamespace = ns; /* * Check for illegal attributes. */ @@ -7765,23 +8586,20 @@ declaration_part: (!xmlStrEqual(attr->name, BAD_CAST "form"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, (xmlSchemaTypePtr) decl, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if ((!xmlStrEqual(attr->name, BAD_CAST "final")) && (!xmlStrEqual(attr->name, BAD_CAST "abstract")) && (!xmlStrEqual(attr->name, BAD_CAST "substitutionGroup"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, (xmlSchemaTypePtr) decl, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, (xmlSchemaTypePtr) decl, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -7794,11 +8612,10 @@ declaration_part: */ decl->flags |= XML_SCHEMAS_ELEM_GLOBAL; decl->flags |= XML_SCHEMAS_ELEM_TOPLEVEL; - xmlSchemaPValAttrQName(ctxt, schema, NULL, - (xmlSchemaTypePtr) decl, node, "substitutionGroup", + xmlSchemaPValAttrQName(ctxt, schema, + NULL, node, "substitutionGroup", &(decl->substGroupNs), &(decl->substGroup)); - if (xmlGetBooleanProp(ctxt, NULL, (xmlSchemaTypePtr) decl, - node, "abstract", 0)) + if (xmlGetBooleanProp(ctxt, node, "abstract", 0)) decl->flags |= XML_SCHEMAS_ELEM_ABSTRACT; /* * Attribute "final". @@ -7817,7 +8634,7 @@ declaration_part: XML_SCHEMAS_ELEM_FINAL_RESTRICTION, -1, -1, -1) != 0) { xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - (xmlSchemaTypePtr) decl, (xmlNodePtr) attr, + NULL, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction))", attrValue, NULL, NULL, NULL); } @@ -7846,23 +8663,22 @@ declaration_part: XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION, -1, -1) != 0) { xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - (xmlSchemaTypePtr) decl, (xmlNodePtr) attr, + NULL, (xmlNodePtr) attr, NULL, "(#all | List of (extension | " "restriction | substitution))", attrValue, NULL, NULL, NULL); } } - if (xmlGetBooleanProp(ctxt, NULL, (xmlSchemaTypePtr) decl, - node, "nillable", 0)) + if (xmlGetBooleanProp(ctxt, node, "nillable", 0)) decl->flags |= XML_SCHEMAS_ELEM_NILLABLE; attr = xmlSchemaGetPropNode(node, "type"); if (attr != NULL) { xmlSchemaPValAttrNodeQName(ctxt, schema, - NULL, (xmlSchemaTypePtr) decl, attr, + NULL, attr, &(decl->namedTypeNs), &(decl->namedType)); xmlSchemaCheckReference(ctxt, schema, node, - (xmlSchemaBasicItemPtr) decl, decl->namedTypeNs); + attr, decl->namedTypeNs); } decl->value = xmlSchemaGetProp(ctxt, node, "default"); attr = xmlSchemaGetPropNode(node, "fixed"); @@ -7875,8 +8691,7 @@ declaration_part: */ xmlSchemaPMutualExclAttrErr(ctxt, XML_SCHEMAP_SRC_ELEMENT_1, - NULL, (xmlSchemaTypePtr) decl, attr, - "default", "fixed"); + NULL, attr, "default", "fixed"); } else { decl->flags |= XML_SCHEMAS_ELEM_FIXED; decl->value = fixed; @@ -7894,11 +8709,11 @@ declaration_part: if (decl->namedType != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_ELEMENT_3, - NULL, (xmlSchemaTypePtr) decl, node, child, + NULL, node, child, "The attribute 'type' and the child are " "mutually exclusive", NULL); } else - ELEM_TYPE(decl) = xmlSchemaParseComplexType(ctxt, schema, child, 0); + WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseComplexType(ctxt, schema, child, 0); child = child->next; } else if (IS_SCHEMA(child, "simpleType")) { /* @@ -7909,11 +8724,11 @@ declaration_part: if (decl->namedType != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_ELEMENT_3, - NULL, (xmlSchemaTypePtr) decl, node, child, + NULL, node, child, "The attribute 'type' and the child are " "mutually exclusive", NULL); } else - ELEM_TYPE(decl) = xmlSchemaParseSimpleType(ctxt, schema, child, 0); + WXS_ELEM_TYPEDEF(decl) = xmlSchemaParseSimpleType(ctxt, schema, child, 0); child = child->next; } while ((IS_SCHEMA(child, "unique")) || @@ -7938,7 +8753,7 @@ declaration_part: if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, (xmlSchemaTypePtr) decl, node, child, + NULL, node, child, NULL, "(annotation?, ((simpleType | complexType)?, " "(unique | key | keyref)*))"); } @@ -8011,17 +8826,15 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "memberTypes"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Attribute "memberTypes". This is a list of QNames. * TODO: Check the value to contain anything. @@ -8035,7 +8848,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlSchemaQNameRefPtr ref; cur = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr); - type->ref = cur; + type->base = cur; do { while (IS_BLANK_CH(*cur)) cur++; @@ -8045,7 +8858,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (end == cur) break; tmp = xmlStrndup(cur, end - cur); - if (xmlSchemaPValAttrNodeQNameValue(ctxt, schema, NULL, + if (xmlSchemaPValAttrNodeQNameValue(ctxt, schema, NULL, attr, BAD_CAST tmp, &nsName, &localName) == 0) { /* * Create the member type link. @@ -8093,7 +8906,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Add the annotation to the simple type ancestor. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (IS_SCHEMA(child, "simpleType")) { @@ -8122,7 +8935,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, "(annotation?, simpleType*)"); + NULL, node, child, NULL, "(annotation?, simpleType*)"); } if ((attr == NULL) && (type->subtypes == NULL)) { /* @@ -8132,7 +8945,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, - NULL, NULL, node, + NULL, node, "Either the attribute 'memberTypes' or " "at least one child must be present", NULL); } @@ -8181,32 +8994,33 @@ xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "itemType"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Attribute "itemType". NOTE that we will use the "ref" and "refNs" * fields for holding the reference to the itemType. + * + * REVAMP TODO: Use the "base" and "baseNs" fields, since we will remove + * the "ref" fields. */ - xmlSchemaPValAttrQName(ctxt, schema, NULL, NULL, - node, "itemType", &(type->refNs), &(type->ref)); + xmlSchemaPValAttrQName(ctxt, schema, NULL, + node, "itemType", &(type->baseNs), &(type->base)); /* * And now for the children... */ child = node->children; if (IS_SCHEMA(child, "annotation")) { xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (IS_SCHEMA(child, "simpleType")) { @@ -8215,34 +9029,34 @@ xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Either the itemType [attribute] or the [child] of * the element must be present, but not both. */ - if (type->ref != NULL) { + if (type->base != NULL) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_SIMPLE_TYPE_1, - NULL, NULL, node, + NULL, node, "The attribute 'itemType' and the child " "are mutually exclusive", NULL); } else { type->subtypes = xmlSchemaParseSimpleType(ctxt, schema, child, 0); } child = child->next; - } else if (type->ref == NULL) { + } else if (type->base == NULL) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_SIMPLE_TYPE_1, - NULL, NULL, node, + NULL, node, "Either the attribute 'itemType' or the child " "must be present", NULL); } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, "(annotation?, simpleType?)"); + NULL, node, child, NULL, "(annotation?, simpleType?)"); } - if ((type->ref == NULL) && + if ((type->base == NULL) && (type->subtypes == NULL) && (xmlSchemaGetPropNode(node, "itemType") == NULL)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_SIMPLE_TYPE_1, - NULL, NULL, node, + NULL, node, "Either the attribute 'itemType' or the child " "must be present", NULL); } @@ -8265,7 +9079,7 @@ static xmlSchemaTypePtr xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlNodePtr node, int topLevel) { - xmlSchemaTypePtr type, oldCtxtType, oldParentItem; + xmlSchemaTypePtr type, oldCtxtType; xmlNodePtr child = NULL; const xmlChar *attrValue = NULL; xmlAttrPtr attr; @@ -8284,7 +9098,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, return (NULL); } else { if (xmlSchemaPValAttrNode(ctxt, - NULL, NULL, attr, + NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &attrValue) != 0) return (NULL); /* @@ -8300,7 +9114,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * about this case. */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE, - NULL, NULL, node, + NULL, node, "Redefinition of built-in simple types is not " "supported", NULL); return(NULL); @@ -8326,11 +9140,14 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ #ifdef ENABLE_NAMED_LOCALS snprintf(buf, 39, "#ST%d", ctxt->counter++ + 1); - type = xmlSchemaAddType(ctxt, schema, (const xmlChar *)buf, + type = xmlSchemaAddType(ctxt, schema, + XML_SCHEMA_TYPE_SIMPLE, + xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1), ctxt->targetNamespace, node, 0); #else - type = xmlSchemaAddType(ctxt, schema, NULL, - ctxt->targetNamespace, node, 0); + type = xmlSchemaAddType(ctxt, schema, + XML_SCHEMA_TYPE_SIMPLE, + NULL, ctxt->targetNamespace, node, 0); #endif if (type == NULL) return (NULL); @@ -8344,13 +9161,11 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (attr->ns == NULL) { if (!xmlStrEqual(attr->name, BAD_CAST "id")) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -8360,8 +9175,8 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * * Note that attrValue is the value of the attribute "name" here. */ - type = xmlSchemaAddType(ctxt, schema, attrValue, - ctxt->targetNamespace, node, 1); + type = xmlSchemaAddType(ctxt, schema, XML_SCHEMA_TYPE_SIMPLE, + attrValue, ctxt->targetNamespace, node, 1); if (type == NULL) return (NULL); type->type = XML_SCHEMA_TYPE_SIMPLE; @@ -8377,13 +9192,11 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, (!xmlStrEqual(attr->name, BAD_CAST "name")) && (!xmlStrEqual(attr->name, BAD_CAST "final"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -8407,29 +9220,29 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - type, (xmlNodePtr) attr, + WXS_BASIC_CAST type, (xmlNodePtr) attr, NULL, "(#all | List of (list | union | restriction)", attrValue, NULL, NULL, NULL); } } } type->targetNamespace = ctxt->targetNamespace; - xmlSchemaPValAttrID(ctxt, NULL, type, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... */ oldCtxtType = ctxt->ctxtType; - oldParentItem = ctxt->parentItem; + ctxt->ctxtType = type; - ctxt->parentItem = type; + child = node->children; if (IS_SCHEMA(child, "annotation")) { - type->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + type->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, type, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (restriction | list | union))"); } else if (IS_SCHEMA(child, "restriction")) { xmlSchemaParseRestriction(ctxt, schema, child, @@ -8445,7 +9258,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, type, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (restriction | list | union))"); } /* @@ -8457,26 +9270,24 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ if (topLevel && ctxt->isRedefine && (! hasRestriction)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE, - NULL, NULL, node, "This is a redefinition, thus the " + NULL, node, "This is a redefinition, thus the " " must have a child", NULL); } - - ctxt->parentItem = oldParentItem; + ctxt->ctxtType = oldCtxtType; return (type); } /** * xmlSchemaParseModelGroupDefRef: - * @ctxt: a schema validation context - * @schema: the schema being built - * @node: a subtree containing XML Schema informations + * @ctxt: the parser context + * @schema: the schema being built + * @node: the node * - * Parses a XML schema particle (reference to a model group definition). - * *WARNING* this interface is highly subject to change + * Parses a reference to a model group definition. * - * Returns -1 in case of error, 0 if the declaration is improper and - * 1 in case of success. + * We will return a particle component with a qname-component or + * NULL in case of an error. */ static xmlSchemaTreeItemPtr xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, @@ -8496,13 +9307,13 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, if (attr == NULL) { xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, - NULL, node, - "ref", NULL); + NULL, node, "ref", NULL); return (NULL); - } else if (xmlSchemaPValAttrNodeQName(ctxt, schema, NULL, NULL, + } else if (xmlSchemaPValAttrNodeQName(ctxt, schema, NULL, attr, &refNs, &ref) != 0) { return (NULL); } + xmlSchemaCheckReference(ctxt, schema, node, attr, refNs); min = xmlGetMinOccurs(ctxt, node, 0, -1, 1, "xs:nonNegativeInteger"); max = xmlGetMaxOccurs(ctxt, node, 0, UNBOUNDED, 1, "(xs:nonNegativeInteger | unbounded)"); @@ -8517,29 +9328,24 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, (!xmlStrEqual(attr->name, BAD_CAST "minOccurs")) && (!xmlStrEqual(attr->name, BAD_CAST "maxOccurs"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); item = xmlSchemaAddParticle(ctxt, schema, node, min, max); if (item == NULL) - return (NULL); - /* Add to pending components; the reference needs to be resolved. */ - WXS_ADD_PENDING_ITEM(ctxt, item); + return (NULL); /* - * Create a reference item as the term; it will be substituted for - * the model group after the reference has been resolved. + * Create a qname-reference and set as the term; it will be substituted + * for the model group after the reference has been resolved. */ item->children = (xmlSchemaTreeItemPtr) - xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs); - xmlSchemaCheckReference(ctxt, schema, node, (xmlSchemaBasicItemPtr) item, refNs); + xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs); xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max); /* * And now for the children... @@ -8550,13 +9356,13 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, /* * TODO: What to do exactly with the annotation? */ - item->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + item->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?)"); } /* @@ -8575,6 +9381,11 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt, * @node: a subtree containing XML Schema informations * * Parses a XML schema model group definition. + * + * Note that the contraint src-redefine (6.2) can't be applied until + * references have been resolved. So we will do this at the + * component fixup level. + * * *WARNING* this interface is highly subject to change * * Returns -1 in case of error, 0 if the declaration is improper and @@ -8600,8 +9411,7 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, NULL, node, "name", NULL); return (NULL); - } else if (xmlSchemaPValAttrNode(ctxt, - NULL, NULL, attr, + } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { return (NULL); } @@ -8618,23 +9428,21 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, if ((!xmlStrEqual(attr->name, BAD_CAST "name")) && (!xmlStrEqual(attr->name, BAD_CAST "id"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - item->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + item->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (IS_SCHEMA(child, "all")) { @@ -8650,13 +9458,15 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, XML_SCHEMA_TYPE_SEQUENCE, 0); child = child->next; } + + + if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (all | choice | sequence)?)"); } - return (item); } @@ -8776,7 +9586,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt, * since they are not visible at the component level. I.e. * they are used if processing schema *documents* only. */ - res = xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + res = xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); HFAILURE; /* @@ -8793,7 +9603,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt, */ attr = xmlSchemaGetPropNode(node, "targetNamespace"); if (attr != NULL) { - res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr, + res = xmlSchemaPValAttrNode(ctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI), NULL); HFAILURE; if (res != 0) { @@ -8897,7 +9707,7 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt, (IS_SCHEMA(child, "redefine")) || (IS_SCHEMA(child, "annotation"))) { if (IS_SCHEMA(child, "annotation")) { - annot = xmlSchemaParseAnnotation(ctxt, schema, child); + annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); if (schema->annot == NULL) schema->annot = annot; else @@ -8938,13 +9748,13 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt, xmlSchemaParseSimpleType(ctxt, schema, child, 1); child = child->next; } else if (IS_SCHEMA(child, "element")) { - xmlSchemaParseElement(ctxt, schema, child, 1); + xmlSchemaParseElement(ctxt, schema, child, NULL, 1); child = child->next; } else if (IS_SCHEMA(child, "attribute")) { - xmlSchemaParseAttribute(ctxt, schema, child, 1); + xmlSchemaParseGlobalAttribute(ctxt, schema, child); child = child->next; } else if (IS_SCHEMA(child, "attributeGroup")) { - xmlSchemaParseAttributeGroup(ctxt, schema, child, 1); + xmlSchemaParseAttributeGroupDefinition(ctxt, schema, child); child = child->next; } else if (IS_SCHEMA(child, "group")) { xmlSchemaParseModelGroupDefinition(ctxt, schema, child); @@ -8955,14 +9765,17 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt, } else { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, child->parent, child, + NULL, child->parent, child, NULL, "((include | import | redefine | annotation)*, " "(((simpleType | complexType | group | attributeGroup) " "| element | attribute | notation), annotation*)*)"); child = child->next; } while (IS_SCHEMA(child, "annotation")) { - annot = xmlSchemaParseAnnotation(ctxt, schema, child); + /* + * TODO: We should add all annotations. + */ + annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); if (schema->annot == NULL) schema->annot = annot; else @@ -8971,7 +9784,6 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt, } } exit: - ctxt->parentItem = NULL; ctxt->ctxtType = NULL; if (oldErrs != ctxt->nberrors) res = ctxt->err; @@ -9003,6 +9815,18 @@ xmlSchemaSchemaRelationFree(xmlSchemaSchemaRelationPtr rel) } #endif +static void +xmlSchemaRedefListFree(xmlSchemaRedefPtr redef) +{ + xmlSchemaRedefPtr prev; + + while (redef != NULL) { + prev = redef; + redef = redef->next; + xmlFree(prev); + } +} + static void xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con) { @@ -9019,6 +9843,8 @@ xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con) if (con->substGroups != NULL) xmlHashFree(con->substGroups, (xmlHashDeallocator) xmlSchemaSubstGroupFree); + if (con->redefs != NULL) + xmlSchemaRedefListFree(con->redefs); if (con->dict != NULL) xmlDictFree(con->dict); xmlFree(con); @@ -9070,6 +9896,11 @@ xmlSchemaParserCtxtCreate(void) } memset(ret, 0, sizeof(xmlSchemaParserCtxt)); ret->type = XML_SCHEMA_CTXT_PARSER; + ret->attrProhibs = xmlSchemaItemListCreate(); + if (ret->attrProhibs == NULL) { + xmlFree(ret); + return(NULL); + } return(ret); } @@ -9114,7 +9945,9 @@ xmlSchemaCreatePCtxtOnVCtxt(xmlSchemaValidCtxtPtr vctxt) } /* TODO: Pass user data. */ xmlSchemaSetParserErrors(vctxt->pctxt, vctxt->error, - vctxt->warning, vctxt->userData); + vctxt->warning, vctxt->errCtxt); + xmlSchemaSetParserStructuredErrors(vctxt->pctxt, vctxt->serror, + vctxt->errCtxt); } return (0); } @@ -9312,7 +10145,9 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt, */ newpctxt->schema = schema; xmlSchemaSetParserErrors(newpctxt, pctxt->error, pctxt->warning, - pctxt->userData); + pctxt->errCtxt); + xmlSchemaSetParserStructuredErrors(newpctxt, pctxt->serror, + pctxt->errCtxt); newpctxt->counter = pctxt->counter; @@ -9459,7 +10294,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, /* * Save the namespace import information. */ - if (WXS_IS_IMPMAIN(type)) { + if (WXS_IS_BUCKET_IMPMAIN(type)) { relation->importNamespace = importNamespace; if (schemaLocation == NULL) { /* @@ -9475,7 +10310,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, /* Did we already fetch the doc? */ if (bkt != NULL) { /* TODO: The following nasty cases will produce an error. */ - if ((WXS_IS_IMPMAIN(type)) && (! bkt->imported)) { + if ((WXS_IS_BUCKET_IMPMAIN(type)) && (! bkt->imported)) { /* We included/redefined and then try to import a schema. */ xmlSchemaCustomErr(ACTXT_CAST pctxt, err, invokingNode, NULL, @@ -9483,7 +10318,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, "it was already included or redefined", schemaLocation, NULL); goto exit; - } else if ((! WXS_IS_IMPMAIN(type)) && (bkt->imported)) { + } else if ((! WXS_IS_BUCKET_IMPMAIN(type)) && (bkt->imported)) { /* We imported and then try to include/redefine a schema. */ xmlSchemaCustomErr(ACTXT_CAST pctxt, err, invokingNode, NULL, @@ -9494,7 +10329,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt, } } - if (WXS_IS_IMPMAIN(type)) { + if (WXS_IS_BUCKET_IMPMAIN(type)) { /* * Given that the schemaLocation [attribute] is only a hint, it is open * to applications to ignore all but the first for a given @@ -9751,7 +10586,7 @@ doc_load: if (preserveDoc) bkt->preserveDoc = 1; } - if (WXS_IS_IMPMAIN(type)) + if (WXS_IS_BUCKET_IMPMAIN(type)) bkt->imported++; /* * Add it to the graph of schemas. @@ -9803,8 +10638,8 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, xmlNodePtr node) { xmlNodePtr child; - const xmlChar *namespaceName = NULL; - const xmlChar *schemaLocation = NULL; + const xmlChar *namespaceName = NULL, *schemaLocation = NULL; + const xmlChar *thisTargetNamespace; xmlAttrPtr attr; int ret = 0; xmlSchemaBucketPtr bucket = NULL; @@ -9822,20 +10657,18 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, (!xmlStrEqual(attr->name, BAD_CAST "namespace")) && (!xmlStrEqual(attr->name, BAD_CAST "schemaLocation"))) { xmlSchemaPIllegalAttrErr(pctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(pctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } /* * Extract and validate attributes. */ - if (xmlSchemaPValAttr(pctxt, NULL, NULL, node, + if (xmlSchemaPValAttr(pctxt, NULL, node, "namespace", xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI), &namespaceName) != 0) { xmlSchemaPSimpleTypeErr(pctxt, @@ -9846,7 +10679,7 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, return (pctxt->err); } - if (xmlSchemaPValAttr(pctxt, NULL, NULL, node, + if (xmlSchemaPValAttr(pctxt, NULL, node, "schemaLocation", xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI), &schemaLocation) != 0) { xmlSchemaPSimpleTypeErr(pctxt, @@ -9870,25 +10703,31 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, if (child != NULL) { xmlSchemaPContentErr(pctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?)"); } /* * Apply additional constraints. + * + * Note that it is important to use the original @targetNamespace + * (or none at all), to rule out imports of schemas _with_ a + * @targetNamespace if the importing schema is a chameleon schema + * (with no @targetNamespace). */ + thisTargetNamespace = WXS_BUCKET(pctxt)->origTargetNamespace; if (namespaceName != NULL) { /* * 1.1 If the namespace [attribute] is present, then its ·actual value· * must not match the ·actual value· of the enclosing 's * targetNamespace [attribute]. */ - if (xmlStrEqual(pctxt->targetNamespace, namespaceName)) { + if (xmlStrEqual(thisTargetNamespace, namespaceName)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_IMPORT_1_1, - NULL, NULL, node, + NULL, node, "The value of the attribute 'namespace' must not match " "the target namespace '%s' of the importing schema", - pctxt->targetNamespace); + thisTargetNamespace); return (pctxt->err); } } else { @@ -9896,10 +10735,10 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, * 1.2 If the namespace [attribute] is not present, then the enclosing * must have a targetNamespace [attribute]. */ - if (pctxt->targetNamespace == NULL) { + if (thisTargetNamespace == NULL) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_IMPORT_1_2, - NULL, NULL, node, + NULL, node, "The attribute 'namespace' must be existent if " "the importing schema has no target namespace", NULL); @@ -9907,13 +10746,13 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, } } /* - * Locate and aquire the schema document. + * Locate and acquire the schema document. */ if (schemaLocation != NULL) schemaLocation = xmlSchemaBuildAbsoluteURI(pctxt->dict, schemaLocation, node); ret = xmlSchemaAddSchemaDoc(pctxt, XML_SCHEMA_SCHEMA_IMPORT, - schemaLocation, NULL, NULL, 0, node, pctxt->targetNamespace, + schemaLocation, NULL, NULL, 0, node, thisTargetNamespace, namespaceName, &bucket); if (ret != 0) @@ -9965,17 +10804,15 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "schemaLocation"))) { xmlSchemaPIllegalAttrErr(pctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(pctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(pctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id"); /* * Preliminary step, extract the URI-Reference and make an URI * from the base. @@ -9988,7 +10825,7 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt, xmlChar *base = NULL; xmlChar *uri = NULL; - if (xmlSchemaPValAttrNode(pctxt, NULL, NULL, attr, + if (xmlSchemaPValAttrNode(pctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI), (const xmlChar **) schemaLocation) != 0) goto exit_error; @@ -10019,13 +10856,13 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt, if (type == XML_SCHEMA_SCHEMA_REDEFINE) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_REDEFINE, - NULL, NULL, node, + NULL, node, "The schema document '%s' cannot redefine itself.", *schemaLocation); } else { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_INCLUDE, - NULL, NULL, node, + NULL, node, "The schema document '%s' cannot include itself.", *schemaLocation); } @@ -10047,7 +10884,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, { xmlNodePtr child = NULL; const xmlChar *schemaLocation = NULL; - int res = 0, /* docRes = 0, located = 0, */ hasRedefinitions = 0; + int res = 0; /* hasRedefinitions = 0 */ int isChameleon = 0, wasChameleon = 0; xmlSchemaBucketPtr bucket = NULL; @@ -10070,12 +10907,10 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, if (res != 0) return(res); /* - if (bucket == NULL) { - PERROR_INT("xmlSchemaParseIncludeOrRedefine", - "no schema bucket aquired"); - return(-1); - } - */ + * If we get no schema bucket back, then this means that the schema + * document could not be located or was broken XML or was not + * a schema document. + */ if ((bucket == NULL) || (bucket->doc == NULL)) { if (type == XML_SCHEMA_SCHEMA_INCLUDE) { /* @@ -10139,7 +10974,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, /* TODO: Change error function. */ xmlSchemaPCustomErrExt(pctxt, XML_SCHEMAP_SRC_INCLUDE, - NULL, NULL, node, + NULL, node, "The target namespace '%s' of the included/redefined " "schema '%s' differs from '%s' of the " "including/redefining schema", @@ -10186,11 +11021,11 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, * And now for the children... */ child = node->children; - if (type == XML_SCHEMA_SCHEMA_REDEFINE) { - + if (type == XML_SCHEMA_SCHEMA_REDEFINE) { /* * Parse (simpleType | complexType | group | attributeGroup))* */ + pctxt->redefined = bucket; /* * How to proceed if the redefined schema was not located? */ @@ -10204,30 +11039,23 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, /* * TODO: discard or not? */ - } else if (bucket && bucket->parsed) { - /* - * TODO: Not nice: we won't parse the stuff if the redefined - * document was not parsed or not located. - */ - if (IS_SCHEMA(child, "simpleType")) { - xmlSchemaParseSimpleType(pctxt, schema, child, 1); - } else if (IS_SCHEMA(child, "complexType")) { - xmlSchemaParseComplexType(pctxt, schema, child, 1); - hasRedefinitions = 1; - } else if (IS_SCHEMA(child, "group")) { - TODO - hasRedefinitions = 1; - /* xmlSchemaParseModelGroupDefinition(pctxt, - schema, child); */ - } else if (IS_SCHEMA(child, "attributeGroup")) { - TODO - hasRedefinitions = 1; - /* xmlSchemaParseAttributeGroup(pctxt, schema, - child, 1); */ - } + } else if (IS_SCHEMA(child, "simpleType")) { + xmlSchemaParseSimpleType(pctxt, schema, child, 1); + } else if (IS_SCHEMA(child, "complexType")) { + xmlSchemaParseComplexType(pctxt, schema, child, 1); + /* hasRedefinitions = 1; */ + } else if (IS_SCHEMA(child, "group")) { + /* hasRedefinitions = 1; */ + xmlSchemaParseModelGroupDefinition(pctxt, + schema, child); + } else if (IS_SCHEMA(child, "attributeGroup")) { + /* hasRedefinitions = 1; */ + xmlSchemaParseAttributeGroupDefinition(pctxt, schema, + child); } child = child->next; } + pctxt->redefined = NULL; pctxt->isRedefine = 0; } else { if (IS_SCHEMA(child, "annotation")) { @@ -10241,11 +11069,11 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt, res = XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED; if (type == XML_SCHEMA_SCHEMA_REDEFINE) { xmlSchemaPContentErr(pctxt, res, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation | (simpleType | complexType | group | attributeGroup))*"); } else { xmlSchemaPContentErr(pctxt, res, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?)"); } } @@ -10292,7 +11120,18 @@ xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema, * @type: the "compositor" type * @particleNeeded: if a a model group with a particle * - * parse a XML schema Sequence definition + * parse a XML schema Sequence definition. + * Applies parts of: + * Schema Representation Constraint: + * Redefinition Constraints and Semantics (src-redefine) + * (6.1), (6.1.1), (6.1.2) + * + * Schema Component Constraint: + * All Group Limited (cos-all-limited) (2) + * TODO: Actually this should go to component-level checks, + * but is done here due to performance. Move it to an other layer + * is schema construction via an API is implemented. + * * *WARNING* this interface is highly subject to change * * Returns -1 in case of error, 0 if the declaration is improper and @@ -10307,7 +11146,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlSchemaParticlePtr particle = NULL; xmlNodePtr child = NULL; xmlAttrPtr attr; - int min = 0, max = 0; + int min = 1, max = 1, isElemRef, hasRefs = 0; if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) return (NULL); @@ -10346,13 +11185,11 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, (!xmlStrEqual(attr->name, BAD_CAST "maxOccurs")) && (!xmlStrEqual(attr->name, BAD_CAST "minOccurs"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -10365,29 +11202,26 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (attr->ns == NULL) { if (!xmlStrEqual(attr->name, BAD_CAST "id")) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - } /* * Extract and validate attributes. */ - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - item->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + item->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } if (type == XML_SCHEMA_TYPE_ALL) { @@ -10395,17 +11229,33 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, while (IS_SCHEMA(child, "element")) { part = (xmlSchemaParticlePtr) xmlSchemaParseElement(ctxt, - schema, child, 0); + schema, child, &isElemRef, 0); + /* + * SPEC cos-all-limited (2) + * "The {max occurs} of all the particles in the {particles} + * of the ('all') group must be 0 or 1. + */ if (part != NULL) { - if (part->minOccurs > 1) - xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INVALID_MINOCCURS, - NULL, NULL, child, - "Invalid value for minOccurs (must be 0 or 1)", NULL); - if (part->maxOccurs > 1) - xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INVALID_MAXOCCURS, - NULL, NULL, child, + if (isElemRef) + hasRefs++; + if (part->minOccurs > 1) { + xmlSchemaPCustomErr(ctxt, + XML_SCHEMAP_COS_ALL_LIMITED, + NULL, child, + "Invalid value for minOccurs (must be 0 or 1)", + NULL); + /* Reset to 1. */ + part->minOccurs = 1; + } + if (part->maxOccurs > 1) { + xmlSchemaPCustomErr(ctxt, + XML_SCHEMAP_COS_ALL_LIMITED, + NULL, child, "Invalid value for maxOccurs (must be 0 or 1)", NULL); + /* Reset to 1. */ + part->maxOccurs = 1; + } if (last == NULL) item->children = (xmlSchemaTreeItemPtr) part; else @@ -10417,7 +11267,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (annotation?, element*)"); } } else { @@ -10432,10 +11282,76 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (IS_SCHEMA(child, "element")) { part = (xmlSchemaTreeItemPtr) - xmlSchemaParseElement(ctxt, schema, child, 0); + xmlSchemaParseElement(ctxt, schema, child, &isElemRef, 0); + if (part && isElemRef) + hasRefs++; } else if (IS_SCHEMA(child, "group")) { part = xmlSchemaParseModelGroupDefRef(ctxt, schema, child); + if (part != NULL) + hasRefs++; + /* + * Handle redefinitions. + */ + if (ctxt->isRedefine && ctxt->redef && + (ctxt->redef->item->type == XML_SCHEMA_TYPE_GROUP) && + part && part->children) + { + if ((xmlSchemaGetQNameRefName(part->children) == + ctxt->redef->refName) && + (xmlSchemaGetQNameRefTargetNs(part->children) == + ctxt->redef->refTargetNs)) + { + /* + * SPEC src-redefine: + * (6.1) "If it has a among its contents at + * some level the ·actual value· of whose ref + * [attribute] is the same as the ·actual value· of + * its own name attribute plus target namespace, then + * all of the following must be true:" + * (6.1.1) "It must have exactly one such group." + */ + if (ctxt->redefCounter != 0) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_SRC_REDEFINE, child, NULL, + "The redefining model group definition " + "'%s' must not contain more than one " + "reference to the redefined definition", + xmlSchemaFormatQName(&str, + ctxt->redef->refTargetNs, + ctxt->redef->refName), + NULL); + FREE_AND_NULL(str) + part = NULL; + } else if (((WXS_PARTICLE(part))->minOccurs != 1) || + ((WXS_PARTICLE(part))->maxOccurs != 1)) + { + xmlChar *str = NULL; + /* + * SPEC src-redefine: + * (6.1.2) "The ·actual value· of both that + * group's minOccurs and maxOccurs [attribute] + * must be 1 (or ·absent·). + */ + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_SRC_REDEFINE, child, NULL, + "The redefining model group definition " + "'%s' must not contain a reference to the " + "redefined definition with a " + "maxOccurs/minOccurs other than 1", + xmlSchemaFormatQName(&str, + ctxt->redef->refTargetNs, + ctxt->redef->refName), + NULL); + FREE_AND_NULL(str) + part = NULL; + } + ctxt->redef->reference = WXS_BASIC_CAST part; + ctxt->redefCounter++; + } + } } else if (IS_SCHEMA(child, "any")) { part = (xmlSchemaTreeItemPtr) xmlSchemaParseAny(ctxt, schema, child); @@ -10458,16 +11374,21 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (element | group | choice | sequence | any)*)"); } } - if (withParticle) { - if ((min == 0) && (max == 0)) - return (NULL); - else - return ((xmlSchemaTreeItemPtr) particle); - } else + if ((max == 0) && (min == 0)) + return (NULL); + if (hasRefs) { + /* + * We need to resolve references. + */ + WXS_ADD_PENDING(ctxt, item); + } + if (withParticle) + return ((xmlSchemaTreeItemPtr) particle); + else return ((xmlSchemaTreeItemPtr) item); } @@ -10505,20 +11426,18 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "base"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } /* * Extract and validate attributes. */ - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Attribute */ @@ -10531,21 +11450,20 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * the {content type} of the type definition ·resolved· to by * the ·actual value· of the base [attribute]" */ - if (xmlSchemaPValAttrQName(ctxt, schema, - NULL, NULL, node, "base", + if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base", &(type->baseNs), &(type->base)) == 0) { if ((type->base == NULL) && (type->type == XML_SCHEMA_TYPE_COMPLEX)) { xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, - type, node, "base", NULL); + NULL, node, "base", NULL); } else if ((ctxt->isRedefine) && (type->flags & XML_SCHEMAS_TYPE_GLOBAL)) { if (type->base == NULL) { xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, - type, node, "base", NULL); + NULL, node, "base", NULL); } else if ((! xmlStrEqual(type->base, type->name)) || (! xmlStrEqual(type->baseNs, type->targetNamespace))) { @@ -10558,7 +11476,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * of its own name attribute plus target namespace;" */ xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE, - NULL, NULL, node, "This is a redefinition, but the QName " + NULL, node, "This is a redefinition, but the QName " "value '%s' of the 'base' attribute does not match the " "type's designation '%s'", xmlSchemaFormatQName(&str1, type->baseNs, type->base), @@ -10566,6 +11484,9 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, type->name), NULL); FREE_AND_NULL(str1); FREE_AND_NULL(str2); + /* Avoid confusion and erase the values. */ + type->base = NULL; + type->baseNs = NULL; } } } @@ -10578,7 +11499,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Add the annotation to the simple type ancestor. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (parentType == XML_SCHEMA_TYPE_SIMPLE) { @@ -10594,7 +11515,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, - NULL, NULL, node, child, + NULL, node, child, "The attribute 'base' and the child are " "mutually exclusive", NULL); } else { @@ -10605,7 +11526,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } else if (type->base == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, - NULL, NULL, node, child, + NULL, node, child, "Either the attribute 'base' or a child " "must be present", NULL); } @@ -10634,9 +11555,13 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Model group reference . */ - } else if (IS_SCHEMA(child, "group")) { + } else if (IS_SCHEMA(child, "group")) { type->subtypes = (xmlSchemaTypePtr) xmlSchemaParseModelGroupDefRef(ctxt, schema, child); + /* + * Note that the reference will be resolved in + * xmlSchemaResolveTypeReferences(); + */ child = child->next; } } else if (parentType == XML_SCHEMA_TYPE_SIMPLE_CONTENT) { @@ -10728,7 +11653,10 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Attribute uses/declarations. */ - child = xmlSchemaParseAttrDecls(ctxt, schema, child, type); + if (xmlSchemaParseLocalAttributes(ctxt, schema, &child, + (xmlSchemaItemListPtr *) &(type->attrUses), + XML_SCHEMA_TYPE_RESTRICTION, NULL) == -1) + return(NULL); /* * Attribute wildcard. */ @@ -10742,13 +11670,13 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (parentType == XML_SCHEMA_TYPE_COMPLEX_CONTENT) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "annotation?, (group | all | choice | sequence)?, " "((attribute | attributeGroup)*, anyAttribute?))"); } else if (parentType == XML_SCHEMA_TYPE_SIMPLE_CONTENT) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (simpleType?, (minExclusive | minInclusive | " "maxExclusive | maxInclusive | totalDigits | fractionDigits | " "length | minLength | maxLength | enumeration | whiteSpace | " @@ -10757,7 +11685,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* Simple type */ xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (simpleType?, (minExclusive | minInclusive | " "maxExclusive | maxInclusive | totalDigits | fractionDigits | " "length | minLength | maxLength | enumeration | whiteSpace | " @@ -10802,24 +11730,22 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if ((!xmlStrEqual(attr->name, BAD_CAST "id")) && (!xmlStrEqual(attr->name, BAD_CAST "base"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Attribute "base" - mandatory. */ - if ((xmlSchemaPValAttrQName(ctxt, schema, - NULL, NULL, node, "base", &(type->baseNs), &(type->base)) == 0) && + if ((xmlSchemaPValAttrQName(ctxt, schema, NULL, node, + "base", &(type->baseNs), &(type->base)) == 0) && (type->base == NULL)) { xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, @@ -10834,7 +11760,7 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, * Add the annotation to the type ancestor. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (parentType == XML_SCHEMA_TYPE_COMPLEX_CONTENT) { @@ -10861,6 +11787,10 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } else if (IS_SCHEMA(child, "group")) { type->subtypes = (xmlSchemaTypePtr) xmlSchemaParseModelGroupDefRef(ctxt, schema, child); + /* + * Note that the reference will be resolved in + * xmlSchemaResolveTypeReferences(); + */ child = child->next; } } @@ -10868,7 +11798,10 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Attribute uses/declarations. */ - child = xmlSchemaParseAttrDecls(ctxt, schema, child, type); + if (xmlSchemaParseLocalAttributes(ctxt, schema, &child, + (xmlSchemaItemListPtr *) &(type->attrUses), + XML_SCHEMA_TYPE_EXTENSION, NULL) == -1) + return(NULL); /* * Attribute wildcard. */ @@ -10883,14 +11816,14 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* Complex content extension. */ xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, ((group | all | choice | sequence)?, " "((attribute | attributeGroup)*, anyAttribute?)))"); } else { /* Simple content extension. */ xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, ((attribute | attributeGroup)*, " "anyAttribute?))"); } @@ -10933,18 +11866,16 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt, if (attr->ns == NULL) { if ((!xmlStrEqual(attr->name, BAD_CAST "id"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * And now for the children... @@ -10955,19 +11886,19 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt, * Add the annotation to the complex type ancestor. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, NULL, node, NULL, NULL, + NULL, node, NULL, NULL, "(annotation?, (restriction | extension))"); } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, NULL, node, NULL, NULL, + NULL, node, NULL, NULL, "(annotation?, (restriction | extension))"); } if (IS_SCHEMA(child, "restriction")) { @@ -10984,7 +11915,7 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, NULL, + NULL, node, child, NULL, "(annotation?, (restriction | extension))"); } return (0); @@ -11026,23 +11957,21 @@ xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt, (!xmlStrEqual(attr->name, BAD_CAST "mixed"))) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, NULL, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } - xmlSchemaPValAttrID(ctxt, NULL, NULL, node, BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); /* * Set the 'mixed' on the complex type ancestor. */ - if (xmlGetBooleanProp(ctxt, NULL, NULL, node, "mixed", 0)) { + if (xmlGetBooleanProp(ctxt, node, "mixed", 0)) { if ((type->flags & XML_SCHEMAS_TYPE_MIXED) == 0) type->flags |= XML_SCHEMAS_TYPE_MIXED; } @@ -11052,19 +11981,19 @@ xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt, * Add the annotation to the complex type ancestor. */ xmlSchemaAddAnnotation((xmlSchemaAnnotItemPtr) type, - xmlSchemaParseAnnotation(ctxt, schema, child)); + xmlSchemaParseAnnotation(ctxt, schema, child, 1)); child = child->next; } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, NULL, node, NULL, + NULL, node, NULL, NULL, "(annotation?, (restriction | extension))"); } if (child == NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING, - NULL, NULL, node, NULL, + NULL, node, NULL, NULL, "(annotation?, (restriction | extension))"); } if (IS_SCHEMA(child, "restriction")) { @@ -11081,7 +12010,7 @@ xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, NULL, node, child, + NULL, node, child, NULL, "(annotation?, (restriction | extension))"); } return (0); @@ -11124,8 +12053,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlSchemaPMissingAttrErr(ctxt, XML_SCHEMAP_S4S_ATTR_MISSING, NULL, node, "name", NULL); return (NULL); - } else if (xmlSchemaPValAttrNode(ctxt, - NULL, NULL, attr, + } else if (xmlSchemaPValAttrNode(ctxt, NULL, attr, xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) { return (NULL); } @@ -11137,11 +12065,14 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ #ifdef ENABLE_NAMED_LOCALS snprintf(buf, 39, "#CT%d", ctxt->counter++ + 1); - type = xmlSchemaAddType(ctxt, schema, (const xmlChar *)buf, + type = xmlSchemaAddType(ctxt, schema, + XML_SCHEMA_TYPE_COMPLEX, + xmlDictLookup(ctxt->dict, (const xmlChar *)buf, -1), ctxt->targetNamespace, node, 0); #else - type = xmlSchemaAddType(ctxt, schema, NULL, - ctxt->targetNamespace, node, 0); + type = xmlSchemaAddType(ctxt, schema, + XML_SCHEMA_TYPE_COMPLEX, + NULL, ctxt->targetNamespace, node, 0); #endif if (type == NULL) return (NULL); @@ -11155,8 +12086,9 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Parse as global complex type definition. */ - type = xmlSchemaAddType(ctxt, schema, name, ctxt->targetNamespace, - node, 1); + type = xmlSchemaAddType(ctxt, schema, + XML_SCHEMA_TYPE_COMPLEX, + name, ctxt->targetNamespace, node, 1); if (type == NULL) return (NULL); type->node = node; @@ -11174,14 +12106,13 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Attribute "id". */ - xmlSchemaPValAttrID(ctxt, NULL, type, node, - BAD_CAST "id"); + xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id"); } else if (xmlStrEqual(attr->name, BAD_CAST "mixed")) { /* * Attribute "mixed". */ - if (xmlSchemaPGetBoolNodeValue(ctxt, NULL, type, - (xmlNodePtr) attr)) + if (xmlSchemaPGetBoolNodeValue(ctxt, + NULL, (xmlNodePtr) attr)) type->flags |= XML_SCHEMAS_TYPE_MIXED; } else if (topLevel) { /* @@ -11193,8 +12124,8 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, /* * Attribute "abstract". */ - if (xmlSchemaPGetBoolNodeValue(ctxt, NULL, type, - (xmlNodePtr) attr)) + if (xmlSchemaPGetBoolNodeValue(ctxt, + NULL, (xmlNodePtr) attr)) type->flags |= XML_SCHEMAS_TYPE_ABSTRACT; } else if (xmlStrEqual(attr->name, BAD_CAST "final")) { /* @@ -11211,7 +12142,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, { xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - type, (xmlNodePtr) attr, NULL, + NULL, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction))", attrValue, NULL, NULL, NULL); } else @@ -11229,25 +12160,22 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, -1, -1, -1) != 0) { xmlSchemaPSimpleTypeErr(ctxt, XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, - type, (xmlNodePtr) attr, NULL, + NULL, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction)) ", attrValue, NULL, NULL, NULL); } else block = 1; } else { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else { xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } } else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) { - xmlSchemaPIllegalAttrErr(ctxt, - XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, - NULL, type, attr); + xmlSchemaPIllegalAttrErr(ctxt, + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr); } attr = attr->next; } @@ -11274,7 +12202,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ child = node->children; if (IS_SCHEMA(child, "annotation")) { - type->annot = xmlSchemaParseAnnotation(ctxt, schema, child); + type->annot = xmlSchemaParseAnnotation(ctxt, schema, child, 1); child = child->next; } ctxt->ctxtType = type; @@ -11331,12 +12259,19 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, } else if (IS_SCHEMA(child, "group")) { type->subtypes = (xmlSchemaTypePtr) xmlSchemaParseModelGroupDefRef(ctxt, schema, child); + /* + * Note that the reference will be resolved in + * xmlSchemaResolveTypeReferences(); + */ child = child->next; } /* * Parse attribute decls/refs. */ - child = xmlSchemaParseAttrDecls(ctxt, schema, child, type); + if (xmlSchemaParseLocalAttributes(ctxt, schema, &child, + (xmlSchemaItemListPtr *) &(type->attrUses), + XML_SCHEMA_TYPE_RESTRICTION, NULL) == -1) + return(NULL); /* * Parse attribute wildcard. */ @@ -11348,7 +12283,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (child != NULL) { xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, - NULL, type, node, child, + NULL, node, child, NULL, "(annotation?, (simpleContent | complexContent | " "((group | all | choice | sequence)?, ((attribute | " "attributeGroup)*, anyAttribute?))))"); @@ -11358,7 +12293,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, */ if (topLevel && ctxt->isRedefine && (! hasRestrictionOrExtension)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_REDEFINE, - NULL, NULL, node, "This is a redefinition, thus the " + NULL, node, "This is a redefinition, thus the " " must have a or " "grand-child", NULL); } @@ -11527,6 +12462,8 @@ xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt) ctxt->constructor = NULL; ctxt->ownsConstructor = 0; } + if (ctxt->attrProhibs != NULL) + xmlSchemaItemListFree(ctxt->attrProhibs); xmlDictFree(ctxt->dict); xmlFree(ctxt); } @@ -11555,7 +12492,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt, end = xmlAutomataNewState(pctxt->am); substGroup = xmlSchemaSubstGroupGet(pctxt, elemDecl); if (substGroup == NULL) { - xmlSchemaPErr(pctxt, GET_NODE(particle), + xmlSchemaPErr(pctxt, WXS_ITEM_NODE(particle), XML_SCHEMAP_INTERNAL, "Internal error: xmlSchemaBuildContentModelForSubstGroup, " "declaration is marked having a subst. group but none " @@ -11658,10 +12595,11 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt, } else if ((particle->maxOccurs >= UNBOUNDED) && (particle->minOccurs < 2)) { /* Special case. */ - start = ctxt->state; + start = ctxt->state; ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL, - elemDecl->name, elemDecl->targetNamespace, elemDecl); - xmlAutomataNewEpsilon(ctxt->am, ctxt->state, start); + elemDecl->name, elemDecl->targetNamespace, elemDecl); + ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state, + elemDecl->name, elemDecl->targetNamespace, elemDecl); } else { int counter; int maxOccurs = particle->maxOccurs == UNBOUNDED ? @@ -11688,7 +12626,8 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt, * @particle: the particle component * @name: the complex type's name whose content is being built * - * Generate the automata sequence needed for that type + * Create the automaton for the {content type} of a complex type. + * */ static void xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, @@ -11699,7 +12638,10 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, return; } if (particle->children == NULL) { - PERROR_INT("xmlSchemaBuildAContentModel", "no term on particle"); + /* + * Just return in this case. A missing "term" of the particle + * might arise due to an invalid "term" component. + */ return; } @@ -12037,7 +12979,7 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt, xmlSchemaInternalErr2(ACTXT_CAST pctxt, "xmlSchemaBuildAContentModel", "found unexpected term of type '%s' in content model", - xmlSchemaCompTypeToString(particle->children->type), NULL); + WXS_ITEM_TYPE_NAME(particle->children), NULL); return; } } @@ -12054,8 +12996,6 @@ static void xmlSchemaBuildContentModel(xmlSchemaTypePtr type, xmlSchemaParserCtxtPtr ctxt) { - xmlAutomataStatePtr start; - if ((type->type != XML_SCHEMA_TYPE_COMPLEX) || (type->contModel != NULL) || ((type->contentType != XML_SCHEMA_CONTENT_ELEMENTS) && @@ -12066,27 +13006,30 @@ xmlSchemaBuildContentModel(xmlSchemaTypePtr type, xmlGenericError(xmlGenericErrorContext, "Building content model for %s\n", name); #endif - + ctxt->am = NULL; ctxt->am = xmlNewAutomata(); if (ctxt->am == NULL) { xmlGenericError(xmlGenericErrorContext, "Cannot create automata for complex type %s\n", type->name); return; } - start = ctxt->state = xmlAutomataGetInitState(ctxt->am); - xmlSchemaBuildAContentModel(ctxt, (xmlSchemaParticlePtr) type->subtypes); + ctxt->state = xmlAutomataGetInitState(ctxt->am); + /* + * Build the automaton. + */ + xmlSchemaBuildAContentModel(ctxt, WXS_TYPE_PARTICLE(type)); xmlAutomataSetFinalState(ctxt->am, ctxt->state); type->contModel = xmlAutomataCompile(ctxt->am); if (type->contModel == NULL) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INTERNAL, - NULL, type, type->node, + WXS_BASIC_CAST type, type->node, "Failed to compile the content model", NULL); } else if (xmlRegexpIsDeterminist(type->contModel) != 1) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_NOT_DETERMINISTIC, /* XML_SCHEMAS_ERR_NOTDETERMINIST, */ - NULL, type, type->node, + WXS_BASIC_CAST type, type->node, "The content model is not determinist", NULL); } else { #ifdef DEBUG_CONTENT_REGEXP @@ -12130,7 +13073,7 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl, if (type == NULL) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) elemDecl, elemDecl->node, + WXS_BASIC_CAST elemDecl, elemDecl->node, "type", elemDecl->namedType, elemDecl->namedTypeNs, XML_SCHEMA_TYPE_BASIC, "type definition"); } else @@ -12148,7 +13091,7 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl, if (substHead == NULL) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) elemDecl, NULL, + WXS_BASIC_CAST elemDecl, NULL, "substitutionGroup", elemDecl->substGroup, elemDecl->substGroupNs, XML_SCHEMA_TYPE_ELEMENT, NULL); } else { @@ -12157,7 +13100,7 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl, * Set the "substitution group affiliation". * NOTE that now we use the "refDecl" field for this. */ - SUBST_GROUP_AFF(elemDecl) = substHead; + WXS_SUBST_HEAD(elemDecl) = substHead; /* * The type definitions is set to: * SPEC "...the {type definition} of the element @@ -12216,9 +13159,9 @@ xmlSchemaResolveUnionMemberTypes(xmlSchemaParserCtxtPtr ctxt, nsName = ((xmlSchemaQNameRefPtr) link->type)->targetNamespace; memberType = xmlSchemaGetType(ctxt->schema, name, nsName); - if ((memberType == NULL) || (! IS_SIMPLE_TYPE(memberType))) { + if ((memberType == NULL) || (! WXS_IS_SIMPLE(memberType))) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - type, type->node, "memberTypes", + WXS_BASIC_CAST type, type->node, "memberTypes", name, nsName, XML_SCHEMA_TYPE_SIMPLE, NULL); /* * Remove the member type link. @@ -12273,7 +13216,7 @@ xmlSchemaIsDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType) { if (type == NULL) return (0); - if (IS_COMPLEX_TYPE(type)) + if (WXS_IS_COMPLEX(type)) return (0); if (type->type == XML_SCHEMA_TYPE_BASIC) { if (type->builtInType == valType) @@ -12282,10 +13225,8 @@ xmlSchemaIsDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType) (type->builtInType == XML_SCHEMAS_ANYTYPE)) return (0); return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType)); - } else - return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType)); - - return (0); + } + return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType)); } #if 0 @@ -12304,7 +13245,7 @@ xmlSchemaIsUserDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType) { if (type == NULL) return (0); - if (IS_COMPLEX_TYPE(type)) + if (WXS_IS_COMPLEX(type)) return (0); if (type->type == XML_SCHEMA_TYPE_BASIC) { if (type->builtInType == valType) @@ -12322,14 +13263,11 @@ xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type) { if (type == NULL) return (NULL); - if (IS_COMPLEX_TYPE(type)) + if (WXS_IS_COMPLEX(type)) return (NULL); if (type->type == XML_SCHEMA_TYPE_BASIC) - return(type); - else - return(xmlSchemaQueryBuiltInType(type->subtypes)); - - return (NULL); + return(type); + return(xmlSchemaQueryBuiltInType(type->subtypes)); } /** @@ -12368,7 +13306,7 @@ xmlSchemaGetPrimitiveType(xmlSchemaTypePtr type) static xmlSchemaTypePtr xmlSchemaGetBuiltInTypeAncestor(xmlSchemaTypePtr type) { - if (VARIETY_LIST(type) || VARIETY_UNION(type)) + if (WXS_IS_LIST(type) || WXS_IS_UNION(type)) return (0); while (type != NULL) { if (type->type == XML_SCHEMA_TYPE_BASIC) @@ -12380,73 +13318,6 @@ xmlSchemaGetBuiltInTypeAncestor(xmlSchemaTypePtr type) } #endif -/** - * xmlSchemaBuildAttributeUsesOwned: - * @ctxt: the schema parser context - * @type: the complex type definition - * @cur: the attribute declaration list - * @lastUse: the top of the attribute use list - * - * Builds the attribute uses list on the given complex type. - * This one is supposed to be called by - * xmlSchemaBuildAttributeValidation only. - */ -static int -xmlSchemaBuildAttributeUsesOwned(xmlSchemaParserCtxtPtr ctxt, - int isRestriction, - xmlSchemaAttributePtr cur, - xmlSchemaAttributeLinkPtr *uses, - xmlSchemaAttributeLinkPtr *lastUse, - int *hasProhibitions) -{ - xmlSchemaAttributeLinkPtr tmp; - while (cur != NULL) { - if (cur->type == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) { - /* - * W3C: "2 The {attribute uses} of the attribute groups ·resolved· - * to by the ·actual value·s of the ref [attribute] of the - * [children], if any." - */ - if (xmlSchemaBuildAttributeUsesOwned(ctxt, isRestriction, - ((xmlSchemaAttributeGroupPtr) cur)->attributes, uses, - lastUse, hasProhibitions) == -1) { - return (-1); - } - } else if ((! isRestriction) && - (cur->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED)) { - /* - * Warn about pointless prohibitions when extending. - */ - xmlSchemaCustomWarning(ACTXT_CAST ctxt, - XML_SCHEMAP_WARN_ATTR_REDECL_PROH, - cur->node, NULL, - "Attribute use prohibitions are pointless when " - "extending a type", NULL, NULL, NULL); - } else { - /* W3C: "1 The set of attribute uses corresponding to the - * [children], if any." - */ - tmp = (xmlSchemaAttributeLinkPtr) - xmlMalloc(sizeof(xmlSchemaAttributeLink)); - if (tmp == NULL) { - xmlSchemaPErrMemory(ctxt, "building attribute uses", NULL); - return (-1); - } - tmp->attr = cur; - tmp->next = NULL; - if (*uses == NULL) - *uses = tmp; - else - (*lastUse)->next = tmp; - *lastUse = tmp; - if (cur->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) - (*hasProhibitions)++; - } - cur = cur->next; - } - return (0); -} - /** * xmlSchemaCloneWildcardNsConstraints: * @ctxt: the schema parser context @@ -12459,14 +13330,14 @@ xmlSchemaBuildAttributeUsesOwned(xmlSchemaParserCtxtPtr ctxt, */ static int xmlSchemaCloneWildcardNsConstraints(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaWildcardPtr *dest, + xmlSchemaWildcardPtr dest, xmlSchemaWildcardPtr source) { xmlSchemaWildcardNsPtr cur, tmp, last; - if ((source == NULL) || (*dest == NULL)) + if ((source == NULL) || (dest == NULL)) return(-1); - (*dest)->any = source->any; + dest->any = source->any; cur = source->nsSet; last = NULL; while (cur != NULL) { @@ -12475,21 +13346,21 @@ xmlSchemaCloneWildcardNsConstraints(xmlSchemaParserCtxtPtr ctxt, return(-1); tmp->value = cur->value; if (last == NULL) - (*dest)->nsSet = tmp; + dest->nsSet = tmp; else last->next = tmp; last = tmp; cur = cur->next; } - if ((*dest)->negNsSet != NULL) - xmlSchemaFreeWildcardNsSet((*dest)->negNsSet); + if (dest->negNsSet != NULL) + xmlSchemaFreeWildcardNsSet(dest->negNsSet); if (source->negNsSet != NULL) { - (*dest)->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt); - if ((*dest)->negNsSet == NULL) + dest->negNsSet = xmlSchemaNewWildcardNsConstraint(ctxt); + if (dest->negNsSet == NULL) return(-1); - (*dest)->negNsSet->value = source->negNsSet->value; + dest->negNsSet->value = source->negNsSet->value; } else - (*dest)->negNsSet = NULL; + dest->negNsSet = NULL; return(0); } @@ -12813,7 +13684,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt, * 2 If either O1 or O2 is any, then the other must be the value. */ if ((completeWild->any != curWild->any) && (completeWild->any)) { - if (xmlSchemaCloneWildcardNsConstraints(ctxt, &completeWild, curWild) == -1) + if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1) return(-1); return(0); } @@ -12829,7 +13700,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt, if (completeWild->nsSet == NULL) { neg = completeWild->negNsSet->value; - if (xmlSchemaCloneWildcardNsConstraints(ctxt, &completeWild, curWild) == -1) + if (xmlSchemaCloneWildcardNsConstraints(ctxt, completeWild, curWild) == -1) return(-1); } else neg = curWild->negNsSet->value; @@ -13005,85 +13876,8 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub, return (1); } -/** - * xmlSchemaBuildCompleteAttributeWildcard: - * @ctxt: the schema parser context - * @attrs: the attribute list - * @completeWild: the resulting complete wildcard - * - * Returns -1 in case of an internal error, 0 otherwise. - */ static int -xmlSchemaBuildCompleteAttributeWildcard(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaAttributePtr attrs, - xmlSchemaWildcardPtr *completeWild) -{ - while (attrs != NULL) { - if (attrs->type == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) { - xmlSchemaAttributeGroupPtr group; - - group = (xmlSchemaAttributeGroupPtr) attrs; - /* - * Handle attribute group references. - */ - if (group->ref != NULL) { - if (group->refItem == NULL) { - /* - * TODO: Should we raise a warning here? - */ - /* - * The referenced attribute group definition could not - * be resolved beforehand, so skip. - */ - attrs = attrs->next; - continue; - } else - group = group->refItem; - } - /* - * For every attribute group definition, an intersected wildcard - * will be created (assumed that a wildcard exists on the - * particular attr. gr. def. or on any contained attr. gr. def - * at all). - * The flag XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED ensures - * that the intersection will be performed only once. - */ - if ((group->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED) == 0) { - if (group->attributes != NULL) { - if (xmlSchemaBuildCompleteAttributeWildcard(ctxt, - group->attributes, &group->attributeWildcard) == -1) - return (-1); - } - group->flags |= XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED; - } - if (group->attributeWildcard != NULL) { - if (*completeWild == NULL) { - /* - * Copy the first encountered wildcard as context, except for the annotation. - * - * Although the complete wildcard might not correspond to any - * node in the schema, we will save this context node. - */ - *completeWild = xmlSchemaAddWildcard(ctxt, ctxt->schema, - XML_SCHEMA_TYPE_ANY_ATTRIBUTE, - group->attributeWildcard->node); - if (xmlSchemaCloneWildcardNsConstraints(ctxt, - completeWild, group->attributeWildcard) == -1) - return (-1); - (*completeWild)->processContents = group->attributeWildcard->processContents; - (*completeWild)->node = group->attributeWildcard->node; - } else if (xmlSchemaIntersectWildcards(ctxt, *completeWild, group->attributeWildcard) == -1) - return (-1); - } - } - attrs = attrs->next; - } - - return (0); -} - -static int -xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributePtr item, +xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributeUsePtr attruse, int *fixed, const xmlChar **value, xmlSchemaValPtr *val) @@ -13093,21 +13887,23 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributePtr item, if (val != 0) *val = NULL; - if (item->defValue == NULL) - item = item->refDecl; - - if (item == NULL) - return (0); - - if (item->defValue != NULL) { - *value = item->defValue; - if (val != 0) - *val = item->defVal; - if (item->flags & XML_SCHEMAS_ATTR_FIXED) + if (attruse->defValue != NULL) { + *value = attruse->defValue; + if (val != NULL) + *val = attruse->defVal; + if (attruse->flags & XML_SCHEMA_ATTR_USE_FIXED) *fixed = 1; - return (1); + return(1); + } else if ((attruse->attrDecl != NULL) && + (attruse->attrDecl->defValue != NULL)) { + *value = attruse->attrDecl->defValue; + if (val != NULL) + *val = attruse->attrDecl->defVal; + if (attruse->attrDecl->flags & XML_SCHEMAS_ATTR_FIXED) + *fixed = 1; + return(1); } - return (0); + return(0); } /** * xmlSchemaCheckCVCWildcardNamespace: @@ -13117,9 +13913,8 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributePtr item, * Validation Rule: Wildcard allows Namespace Name * (cvc-wildcard-namespace) * - * - * Returns 1 if the given namespace matches the wildcard, - * 0 otherwise. + * Returns 0 if the given namespace matches the wildcard, + * 1 otherwise and -1 on API errors. */ static int xmlSchemaCheckCVCWildcardNamespace(xmlSchemaWildcardPtr wild, @@ -13129,659 +13924,527 @@ xmlSchemaCheckCVCWildcardNamespace(xmlSchemaWildcardPtr wild, return(-1); if (wild->any) - return(1); + return(0); else if (wild->nsSet != NULL) { xmlSchemaWildcardNsPtr cur; cur = wild->nsSet; while (cur != NULL) { if (xmlStrEqual(cur->value, ns)) - return(1); + return(0); cur = cur->next; } } else if ((wild->negNsSet != NULL) && (ns != NULL) && (!xmlStrEqual(wild->negNsSet->value, ns))) - return(1); + return(0); - return(0); + return(1); } -/** - * xmlSchemaBuildAttributeValidation: - * @ctxt: the schema parser context - * @type: the complex type definition - * - * - * Builds the wildcard and the attribute uses on the given complex type. - * Returns -1 if an internal error occurs, 0 otherwise. - */ -static int -xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, - xmlSchemaTypePtr type) -{ - xmlSchemaTypePtr baseType = NULL; - xmlSchemaAttributeLinkPtr cur, base, tmp, id = NULL, - prev = NULL, localUses = NULL, lastUse = NULL, lastBaseUse = NULL; - xmlSchemaAttributePtr attrs; - xmlSchemaTypePtr anyType; - xmlChar *str = NULL; - int err = 0, hasProhibitions = 0; +#define XML_SCHEMA_ACTION_DERIVE 0 +#define XML_SCHEMA_ACTION_REDEFINE 1 - anyType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE); - /* - * Complex Type Definition with complex content Schema Component. - * - * Attribute uses. - * TODO: Add checks for absent referenced attribute declarations and - * simple types. - */ - if (type->attributeUses != NULL) { - PERROR_INT("xmlSchemaBuildAttributeValidation", - "attribute uses already builded"); - return (-1); - } - if (type->baseType == NULL) { - PERROR_INT("xmlSchemaBuildAttributeValidation", - "no base type"); - return (-1); - } - baseType = type->baseType; - /* - * Gather attribute uses defined by this type. - */ - attrs = type->attributes; - if (attrs != NULL) { - if (xmlSchemaBuildAttributeUsesOwned(pctxt, - WXS_IS_RESTRICTION(type) ? 1 : 0, - attrs, - &localUses, &lastUse, &hasProhibitions) == -1) { - return (-1); - } - /* - * Handle attribute wildcards. - */ - err = xmlSchemaBuildCompleteAttributeWildcard(pctxt, - attrs, &type->attributeWildcard); - /* - * NOTE: During the parse time, the wildcard is created - * on the complexType directly, if encountered in a - * or element. - */ - if (err == -1) { - PERROR_INT("xmlSchemaBuildAttributeValidation", - "failed to build an intersected attribute wildcard"); - return (-1); - } - } - - if (hasProhibitions) { - xmlSchemaAttributeLinkPtr tmpPrev = NULL; - /* - * Handle annoying pointless prohibitions. - * Note that this will be done for restrictions only, since - * prohibitions are not gathered for extensions. - */ - cur = localUses; +#define WXS_ACTION_STR(a) \ +((a) == XML_SCHEMA_ACTION_DERIVE) ? (const xmlChar *) "base" : (const xmlChar *) "redefined" -pointless_prohib_next: - while (cur != NULL) { - tmp = cur->next; - tmpPrev = cur; - while (tmp != NULL) { - if ( ((cur->attr->occurs != XML_SCHEMAS_ATTR_USE_PROHIBITED) && - (tmp->attr->occurs != XML_SCHEMAS_ATTR_USE_PROHIBITED)) || - (xmlSchemaGetAttrName(cur->attr) != - xmlSchemaGetAttrName(tmp->attr)) || - (xmlSchemaGetAttrTargetNsURI(cur->attr) != - xmlSchemaGetAttrTargetNsURI(tmp->attr))) +/* +* Schema Component Constraint: +* Derivation Valid (Restriction, Complex) +* derivation-ok-restriction (2) - (4) +* +* ATTENTION: +* In XML Schema 1.1 this will be: +* Validation Rule: +* Checking complex type subsumption (practicalSubsumption) (1, 2 and 3) +* +*/ +static int +xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt, + int action, + xmlSchemaBasicItemPtr item, + xmlSchemaBasicItemPtr baseItem, + xmlSchemaItemListPtr uses, + xmlSchemaItemListPtr baseUses, + xmlSchemaWildcardPtr wild, + xmlSchemaWildcardPtr baseWild) +{ + xmlSchemaAttributeUsePtr cur = NULL, bcur; + int i, j, found; /* err = 0; */ + const xmlChar *bEffValue; + int effFixed; + + if (uses != NULL) { + for (i = 0; i < uses->nbItems; i++) { + cur = uses->items[i]; + found = 0; + if (baseUses == NULL) + goto not_found; + for (j = 0; j < baseUses->nbItems; j++) { + bcur = baseUses->items[j]; + if ((WXS_ATTRUSE_DECL_NAME(cur) == + WXS_ATTRUSE_DECL_NAME(bcur)) && + (WXS_ATTRUSE_DECL_TNS(cur) == + WXS_ATTRUSE_DECL_TNS(bcur))) { - tmpPrev = tmp; - tmp = tmp->next; - continue; - } - if (cur->attr->occurs == tmp->attr->occurs) { - xmlSchemaAttributeLinkPtr tmpFree; - /* - * Warn about duplicate prohibitions. - */ - xmlSchemaCustomWarning(ACTXT_CAST pctxt, - XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, - tmp->attr->node, NULL, - "Skipping duplicate prohibition " - "of attribute use '%s'", - xmlSchemaFormatQName(&str, - xmlSchemaGetAttrTargetNsURI(tmp->attr), - xmlSchemaGetAttrName(tmp->attr)), - NULL, NULL); - FREE_AND_NULL(str) - /* - * Remove the duplicate prohibition. - */ - tmpFree = tmp; - tmpPrev->next = tmp->next; - tmp = tmp->next; - xmlFree(tmpFree); - hasProhibitions--; - continue; - } else { - xmlSchemaAttributeLinkPtr tmpFree; - xmlSchemaAttributePtr reattr; - /* - * Annoying case: - * This is the case when we prohibited - * the base attribute decl in the previous - * step; i.e. when we prohibit and declare the - * same attribute in the same . - */ - if (cur->attr->occurs == - XML_SCHEMAS_ATTR_USE_PROHIBITED) - reattr = cur->attr; - else - reattr = tmp->attr; - xmlSchemaCustomWarning(ACTXT_CAST pctxt, - XML_SCHEMAP_WARN_ATTR_REDECL_PROH, - reattr->node, NULL, - "Skipping pointless prohibition of " - "attribute use '%s', since a corresponding " - "attribute was explicitely declared as well", - xmlSchemaFormatQName(&str, - xmlSchemaGetAttrTargetNsURI(reattr), - xmlSchemaGetAttrName(reattr)), - NULL, NULL); - FREE_AND_NULL(str); /* - * Remove the prohibition. + * (2.1) "If there is an attribute use in the {attribute + * uses} of the {base type definition} (call this B) whose + * {attribute declaration} has the same {name} and {target + * namespace}, then all of the following must be true:" */ - if (reattr == cur->attr) { - tmpFree = cur; - if (prev != NULL) - prev->next = cur->next; - else - localUses = cur->next; - cur = cur->next; - xmlFree(tmpFree); - hasProhibitions--; - goto pointless_prohib_next; + found = 1; + + if ((cur->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) && + (bcur->occurs == XML_SCHEMAS_ATTR_USE_REQUIRED)) + { + xmlChar *str = NULL; + /* + * (2.1.1) "one of the following must be true:" + * (2.1.1.1) "B's {required} is false." + * (2.1.1.2) "R's {required} is true." + */ + xmlSchemaPAttrUseErr4(pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, + WXS_ITEM_NODE(item), item, cur, + "The 'optional' attribute use is inconsistent " + "with the corresponding 'required' attribute use of " + "the %s %s", + WXS_ACTION_STR(action), + xmlSchemaGetComponentDesignation(&str, baseItem), + NULL, NULL); + FREE_AND_NULL(str); + /* err = pctxt->err; */ + } else if (xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST pctxt, + WXS_ATTRUSE_TYPEDEF(cur), + WXS_ATTRUSE_TYPEDEF(bcur), 0) != 0) + { + xmlChar *strA = NULL, *strB = NULL, *strC = NULL; + + /* + * SPEC (2.1.2) "R's {attribute declaration}'s + * {type definition} must be validly derived from + * B's {type definition} given the empty set as + * defined in Type Derivation OK (Simple) (§3.14.6)." + */ + xmlSchemaPAttrUseErr4(pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, + WXS_ITEM_NODE(item), item, cur, + "The attribute declaration's %s " + "is not validly derived from " + "the corresponding %s of the " + "attribute declaration in the %s %s", + xmlSchemaGetComponentDesignation(&strA, + WXS_ATTRUSE_TYPEDEF(cur)), + xmlSchemaGetComponentDesignation(&strB, + WXS_ATTRUSE_TYPEDEF(bcur)), + WXS_ACTION_STR(action), + xmlSchemaGetComponentDesignation(&strC, baseItem)); + /* xmlSchemaGetComponentDesignation(&str, baseItem), */ + FREE_AND_NULL(strA); + FREE_AND_NULL(strB); + FREE_AND_NULL(strC); + /* err = pctxt->err; */ } else { - tmpFree = tmp; - tmpPrev->next = tmp->next; - tmp = tmp->next; - xmlFree(tmpFree); - hasProhibitions--; - continue; + /* + * 2.1.3 [Definition:] Let the effective value + * constraint of an attribute use be its {value + * constraint}, if present, otherwise its {attribute + * declaration}'s {value constraint} . + */ + xmlSchemaGetEffectiveValueConstraint(bcur, + &effFixed, &bEffValue, NULL); + /* + * 2.1.3 ... one of the following must be true + * + * 2.1.3.1 B's ·effective value constraint· is + * ·absent· or default. + */ + if ((bEffValue != NULL) && + (effFixed == 1)) { + const xmlChar *rEffValue = NULL; + + xmlSchemaGetEffectiveValueConstraint(bcur, + &effFixed, &rEffValue, NULL); + /* + * 2.1.3.2 R's ·effective value constraint· is + * fixed with the same string as B's. + * MAYBE TODO: Compare the computed values. + * Hmm, it says "same string" so + * string-equality might really be sufficient. + */ + if ((effFixed == 0) || + (! WXS_ARE_DEFAULT_STR_EQUAL(rEffValue, bEffValue))) + { + xmlChar *str = NULL; + + xmlSchemaPAttrUseErr4(pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, + WXS_ITEM_NODE(item), item, cur, + "The effective value constraint of the " + "attribute use is inconsistent with " + "its correspondent in the %s %s", + WXS_ACTION_STR(action), + xmlSchemaGetComponentDesignation(&str, + baseItem), + NULL, NULL); + FREE_AND_NULL(str); + /* err = pctxt->err; */ + } + } } + break; + } + } +not_found: + if (!found) { + /* + * (2.2) "otherwise the {base type definition} must have an + * {attribute wildcard} and the {target namespace} of the + * R's {attribute declaration} must be ·valid· with respect + * to that wildcard, as defined in Wildcard allows Namespace + * Name (§3.10.4)." + */ + if ((baseWild == NULL) || + (xmlSchemaCheckCVCWildcardNamespace(baseWild, + (WXS_ATTRUSE_DECL(cur))->targetNamespace) != 0)) + { + xmlChar *str = NULL; + + xmlSchemaPAttrUseErr4(pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, + WXS_ITEM_NODE(item), item, cur, + "Neither a matching attribute use, " + "nor a matching wildcard exists in the %s %s", + WXS_ACTION_STR(action), + xmlSchemaGetComponentDesignation(&str, baseItem), + NULL, NULL); + FREE_AND_NULL(str); + /* err = pctxt->err; */ } - tmpPrev = tmp; - tmp = tmp->next; } - prev = cur; - cur = cur->next; } } - - /* 3.4.6 -> Complex Type Definition Properties Correct 4. - * "Two distinct attribute declarations in the {attribute uses} must - * not have identical {name}s and {target namespace}s." - * - * This is done here for s. We will compare only the - * attr uses of the current type. - * For s this is done further down. + /* + * SPEC derivation-ok-restriction (3): + * (3) "For each attribute use in the {attribute uses} of the {base type + * definition} whose {required} is true, there must be an attribute + * use with an {attribute declaration} with the same {name} and + * {target namespace} as its {attribute declaration} in the {attribute + * uses} of the complex type definition itself whose {required} is true. */ - if ((localUses != NULL) && (localUses->next != NULL) && - (WXS_IS_RESTRICTION(type))) { - cur = localUses; - while (cur != NULL) { - if (cur->attr->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) { - cur = cur->next; + if (baseUses != NULL) { + for (j = 0; j < baseUses->nbItems; j++) { + bcur = baseUses->items[j]; + if (bcur->occurs != XML_SCHEMAS_ATTR_USE_REQUIRED) continue; - } - tmp = cur->next; - while (tmp != NULL) { - if (tmp->attr->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) { - tmp = tmp->next; - continue; - } - if ((xmlStrEqual(xmlSchemaGetAttrName(cur->attr), - xmlSchemaGetAttrName(tmp->attr))) && - (xmlStrEqual(xmlSchemaGetAttrTargetNsURI(cur->attr), - xmlSchemaGetAttrTargetNsURI(tmp->attr)))) { - /* - * Duplicate attr uses. - */ - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_CT_PROPS_CORRECT_4, - type, cur->attr, - "Duplicate attribute use '%s' specified", - xmlSchemaFormatQName(&str, - xmlSchemaGetAttrTargetNsURI(tmp->attr), - xmlSchemaGetAttrName(tmp->attr))); - FREE_AND_NULL(str) - break; + found = 0; + if (uses != NULL) { + for (i = 0; i < uses->nbItems; i++) { + cur = uses->items[i]; + if ((WXS_ATTRUSE_DECL_NAME(cur) == + WXS_ATTRUSE_DECL_NAME(bcur)) && + (WXS_ATTRUSE_DECL_TNS(cur) == + WXS_ATTRUSE_DECL_TNS(bcur))) { + found = 1; + break; + } } - tmp = tmp->next; } - cur = cur->next; + if (!found) { + xmlChar *strA = NULL, *strB = NULL; + + xmlSchemaCustomErr4(ACTXT_CAST pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, + NULL, item, + "A matching attribute use for the " + "'required' %s of the %s %s is missing", + xmlSchemaGetComponentDesignation(&strA, bcur), + WXS_ACTION_STR(action), + xmlSchemaGetComponentDesignation(&strB, baseItem), + NULL); + FREE_AND_NULL(strA); + FREE_AND_NULL(strB); + } } } - /* - * Inherit the attribute uses of the base type, but leave out - * prohibited ones. - * NOTE: It is allowed to "extend" the anyType complex type. - */ - if (baseType->attributeUses != NULL) { - base = baseType->attributeUses; -inherit_start: - while (base != NULL) { - /* - * Check if prohibited. - */ - if (hasProhibitions) { - cur = localUses; - while (cur != NULL) { - if ((cur->attr->occurs == - XML_SCHEMAS_ATTR_USE_PROHIBITED) && - xmlStrEqual(xmlSchemaGetAttrName(cur->attr), - xmlSchemaGetAttrName(base->attr)) && - xmlStrEqual(xmlSchemaGetAttrTargetNsURI(cur->attr), - xmlSchemaGetAttrTargetNsURI(base->attr))) - { - /* - * Don't inherit prohibited attr uses. - */ - if (base->attr->occurs == - XML_SCHEMAS_ATTR_USE_REQUIRED) { - /* - * derivation-ok-restriction 3 - * There won't be an attr use left if - * prohibiting the inherited one, so this - * will automatically violate required - * attr uses. - */ - xmlSchemaPCustomErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, - NULL, type, NULL, - "A matching attribute use for the " - "'required' attribute use '%s' of the " - "base type is missing", - xmlSchemaFormatQName(&str, - xmlSchemaGetAttrTargetNsURI(base->attr), - xmlSchemaGetAttrName(base->attr))); - FREE_AND_NULL(str) - } - base = base->next; - goto inherit_start; - } - cur = cur->next; - } - } - tmp = (xmlSchemaAttributeLinkPtr) - xmlMalloc(sizeof(xmlSchemaAttributeLink)); - if (tmp == NULL) { - xmlSchemaPErrMemory(pctxt, - "allocating attribute uses", NULL); - return (-1); - } - tmp->attr = base->attr; - tmp->next = NULL; - if (type->attributeUses == NULL) { - type->attributeUses = tmp; - } else - lastBaseUse->next = tmp; - lastBaseUse = tmp; - /* next */ - base = base->next; - } - } + * derivation-ok-restriction (4) + */ + if (wild != NULL) { + /* + * (4) "If there is an {attribute wildcard}, all of the + * following must be true:" + */ + if (baseWild == NULL) { + xmlChar *str = NULL; - if ((WXS_IS_EXTENSION(type)) && - ((IS_ANYTYPE(baseType)) || - ((baseType != NULL) && - (baseType->type == XML_SCHEMA_TYPE_COMPLEX) && - (baseType->attributeWildcard != NULL)))) { - if (type->attributeWildcard != NULL) { /* - * Union the complete wildcard with the base wildcard. - */ - if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard, - baseType->attributeWildcard) == -1) - return (-1); - } else { + * (4.1) "The {base type definition} must also have one." + */ + xmlSchemaCustomErr4(ACTXT_CAST pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, + NULL, item, + "The %s has an attribute wildcard, " + "but the %s %s '%s' does not have one", + WXS_ITEM_TYPE_NAME(item), + WXS_ACTION_STR(action), + WXS_ITEM_TYPE_NAME(baseItem), + xmlSchemaGetComponentQName(&str, baseItem)); + FREE_AND_NULL(str); + return(pctxt->err); + } else if ((baseWild->any == 0) && + xmlSchemaCheckCOSNSSubset(wild, baseWild)) + { + xmlChar *str = NULL; /* - * Just inherit the wildcard. + * (4.2) "The complex type definition's {attribute wildcard}'s + * {namespace constraint} must be a subset of the {base type + * definition}'s {attribute wildcard}'s {namespace constraint}, + * as defined by Wildcard Subset (§3.10.6)." */ - /* - * NOTE: This is the only case where an attribute - * wildcard is shared. - */ - type->attributeWildcard = baseType->attributeWildcard; + xmlSchemaCustomErr4(ACTXT_CAST pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, + NULL, item, + "The attribute wildcard is not a valid " + "subset of the wildcard in the %s %s '%s'", + WXS_ACTION_STR(action), + WXS_ITEM_TYPE_NAME(baseItem), + xmlSchemaGetComponentQName(&str, baseItem), + NULL); + FREE_AND_NULL(str); + return(pctxt->err); + } + /* 4.3 Unless the {base type definition} is the ·ur-type + * definition·, the complex type definition's {attribute + * wildcard}'s {process contents} must be identical to or + * stronger than the {base type definition}'s {attribute + * wildcard}'s {process contents}, where strict is stronger + * than lax is stronger than skip. + */ + if ((! WXS_IS_ANYTYPE(baseItem)) && + (wild->processContents < baseWild->processContents)) { + xmlChar *str = NULL; + xmlSchemaCustomErr4(ACTXT_CAST pctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, + NULL, baseItem, + "The {process contents} of the attribute wildcard is " + "weaker than the one in the %s %s '%s'", + WXS_ACTION_STR(action), + WXS_ITEM_TYPE_NAME(baseItem), + xmlSchemaGetComponentQName(&str, baseItem), + NULL); + FREE_AND_NULL(str) + return(pctxt->err); } } + return(0); +} - if (WXS_IS_RESTRICTION(type)) { - if (type->attributeWildcard != NULL) { + +static int +xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaBasicItemPtr item, + xmlSchemaWildcardPtr *completeWild, + xmlSchemaItemListPtr list, + xmlSchemaItemListPtr prohibs); +/** + * xmlSchemaFixupTypeAttributeUses: + * @ctxt: the schema parser context + * @type: the complex type definition + * + * + * Builds the wildcard and the attribute uses on the given complex type. + * Returns -1 if an internal error occurs, 0 otherwise. + * + * ATTENTION TODO: Experimantally this uses pointer comparisons for + * strings, so recheck this if we start to hardcode some schemata, since + * they might not be in the same dict. + * NOTE: It is allowed to "extend" the xs:anyType type. + */ +static int +xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaTypePtr type) +{ + xmlSchemaTypePtr baseType = NULL; + xmlSchemaAttributeUsePtr use; + xmlSchemaItemListPtr uses, baseUses, prohibs = NULL; + + if (type->baseType == NULL) { + PERROR_INT("xmlSchemaFixupTypeAttributeUses", + "no base type"); + return (-1); + } + baseType = type->baseType; + if (WXS_IS_TYPE_NOT_FIXED(baseType)) + if (xmlSchemaTypeFixup(baseType, ACTXT_CAST pctxt) == -1) + return(-1); + + uses = type->attrUses; + baseUses = baseType->attrUses; + /* + * Expand attribute group references. And build the 'complete' + * wildcard, i.e. intersect multiple wildcards. + * Move attribute prohibitions into a separate list. + */ + if (uses != NULL) { + if (WXS_IS_RESTRICTION(type)) { /* - * Derivation Valid (Restriction, Complex) - * 4.1 The {base type definition} must also have one. + * This one will transfer all attr. prohibitions + * into pctxt->attrProhibs. */ - if (baseType->attributeWildcard == NULL) { - xmlSchemaPCustomErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, - NULL, type, NULL, - "The type has an attribute wildcard, " - "but the base type %s does not have one", - xmlSchemaFormatItemForReport(&str, NULL, baseType, NULL)); - FREE_AND_NULL(str) - return (1); - } else if (xmlSchemaCheckCOSNSSubset( - type->attributeWildcard, baseType->attributeWildcard)) { - /* 4.2 */ - xmlSchemaPCustomErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, - NULL, type, NULL, - "The attribute wildcard is not a valid " - "subset of the wildcard in the base type %s", - xmlSchemaFormatItemForReport(&str, NULL, baseType, NULL)); - FREE_AND_NULL(str) - return (1); - } - /* 4.3 Unless the {base type definition} is the ·ur-type - * definition·, the complex type definition's {attribute - * wildcard}'s {process contents} must be identical to or - * stronger than the {base type definition}'s {attribute - * wildcard}'s {process contents}, where strict is stronger - * than lax is stronger than skip. - */ - if ((! IS_ANYTYPE(baseType)) && - (type->attributeWildcard->processContents < - baseType->attributeWildcard->processContents)) { - xmlSchemaPCustomErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, - NULL, type, NULL, - "The 'process contents' of the attribute wildcard is " - "weaker than the one in the base type %s", - xmlSchemaFormatItemForReport(&str, NULL, baseType, NULL)); - FREE_AND_NULL(str) - return (1); + if (xmlSchemaExpandAttributeGroupRefs(pctxt, + WXS_BASIC_CAST type, &(type->attributeWildcard), uses, + pctxt->attrProhibs) == -1) + { + PERROR_INT("xmlSchemaFixupTypeAttributeUses", + "failed to expand attributes"); } - } - } else if (WXS_IS_EXTENSION(type)) { - /* - * Derivation Valid (Extension) - * At this point the type and the base have both, either - * no wildcard or a wildcard. - */ - if ((baseType->attributeWildcard != NULL) && - (baseType->attributeWildcard != type->attributeWildcard)) { - /* 1.3 */ - if (xmlSchemaCheckCOSNSSubset( - baseType->attributeWildcard, type->attributeWildcard)) { - xmlSchemaPCustomErr(pctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_3, - NULL, type, NULL, - "The attribute wildcard is not a valid " - "superset of the one in the base type %s", - xmlSchemaFormatItemForReport(&str, NULL, baseType, NULL)); - FREE_AND_NULL(str) - return (1); + if (pctxt->attrProhibs->nbItems != 0) + prohibs = pctxt->attrProhibs; + } else { + if (xmlSchemaExpandAttributeGroupRefs(pctxt, + WXS_BASIC_CAST type, &(type->attributeWildcard), uses, + NULL) == -1) + { + PERROR_INT("xmlSchemaFixupTypeAttributeUses", + "failed to expand attributes"); } } } - - if (localUses == NULL) { - /* PASS */ - } else if (WXS_IS_RESTRICTION(type)) { - /* - * Derive by restriction. At this point prohibited uses are already - * filtered out. - */ - if (IS_ANYTYPE(baseType)) { - type->attributeUses = localUses; - } else { - int found, valid; - const xmlChar *bEffValue; - int effFixed; + /* + * Inherit the attribute uses of the base type. + */ + if (baseUses != NULL) { + int i, j; + xmlSchemaAttributeUseProhibPtr pro; - cur = localUses; - while (cur != NULL) { - if (cur->attr->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) { - prev = cur; - cur = cur->next; - continue; - } - found = 0; - valid = 1; - base = type->attributeUses; - while (base != NULL) { - if (xmlStrEqual(xmlSchemaGetAttrName(cur->attr), - xmlSchemaGetAttrName(base->attr)) && - xmlStrEqual(xmlSchemaGetAttrTargetNsURI(cur->attr), - xmlSchemaGetAttrTargetNsURI(base->attr))) { + if (WXS_IS_RESTRICTION(type)) { + int usesCount; + xmlSchemaAttributeUsePtr tmp; - found = 1; - - if ((cur->attr->occurs == - XML_SCHEMAS_ATTR_USE_OPTIONAL) && - (base->attr->occurs == - XML_SCHEMAS_ATTR_USE_REQUIRED)) { - /* - * derivation-ok-restriction 2.1.1 - */ - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, - type, cur->attr, - "The 'optional' use is inconsistent with a " - "matching 'required' use of the base type", - NULL); - } else if (xmlSchemaCheckCOSSTDerivedOK( - cur->attr->subtypes, base->attr->subtypes, 0) != 0) { - - /* - * SPEC (2.1.2) "R's {attribute declaration}'s - * {type definition} must be validly derived from - * B's {type definition} given the empty set as - * defined in Type Derivation OK (Simple) (§3.14.6)." - */ - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, - type, cur->attr, - "The attribute declaration's type " - "definition is not validly derived from " - "the corresponding definition in the " - "base type", NULL); - } else { - /* - * 2.1.3 [Definition:] Let the effective value - * constraint of an attribute use be its {value - * constraint}, if present, otherwise its {attribute - * declaration}'s {value constraint} . - */ - xmlSchemaGetEffectiveValueConstraint(base->attr, - &effFixed, &bEffValue, NULL); - /* - * 2.1.3 ... one of the following must be true - * - * 2.1.3.1 B's ·effective value constraint· is - * ·absent· or default. - */ - if ((bEffValue != NULL) && - (effFixed == 1)) { - const xmlChar *rEffValue = NULL; - - xmlSchemaGetEffectiveValueConstraint(base->attr, - &effFixed, &rEffValue, NULL); - /* - * 2.1.3.2 R's ·effective value constraint· is - * fixed with the same string as B's. - * TODO: Compare the computed values. - */ - if ((effFixed == 0) || - (! xmlStrEqual(rEffValue, bEffValue))) { - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, - type, cur->attr, - "The effective value constraint of the " - "attribute use is inconsistent with " - "its correspondent of the base type", - NULL); - } else { - /* - * Override the attribute use. - */ - base->attr = cur->attr; - } - } else - base->attr = cur->attr; - } + if (uses != NULL) + usesCount = uses->nbItems; + else + usesCount = 0; - break; + /* Restriction. */ + for (i = 0; i < baseUses->nbItems; i++) { + use = baseUses->items[i]; + if (prohibs) { + /* + * Filter out prohibited uses. + */ + for (j = 0; j < prohibs->nbItems; j++) { + pro = prohibs->items[j]; + if ((WXS_ATTRUSE_DECL_NAME(use) == pro->name) && + (WXS_ATTRUSE_DECL_TNS(use) == + pro->targetNamespace)) + { + goto inherit_next; + } } - base = base->next; } - - if (!found) { + if (usesCount) { /* - * derivation-ok-restriction 2.2 + * Filter out existing uses. */ - if ((baseType->attributeWildcard == NULL) || - (xmlSchemaCheckCVCWildcardNamespace( - baseType->attributeWildcard, - cur->attr->targetNamespace) != 1)) { - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, - type, cur->attr, - "Neither a matching attribute use, " - "nor a matching wildcard in the base type does exist", - NULL); - } else { - /* - * Add the attribute use. - * - * Note that this may lead to funny derivation error reports, if - * multiple equal attribute uses exist; but this is not - * allowed anyway, and it will be reported beforehand. - */ - tmp = cur; - if (prev != NULL) - prev->next = cur->next; - else - localUses = cur->next; - cur = cur->next; - tmp->next = NULL; - if (type->attributeUses == NULL) { - type->attributeUses = tmp; - } else - lastBaseUse->next = tmp; - lastBaseUse = tmp; - - continue; + for (j = 0; j < usesCount; j++) { + tmp = uses->items[j]; + if ((WXS_ATTRUSE_DECL_NAME(use) == + WXS_ATTRUSE_DECL_NAME(tmp)) && + (WXS_ATTRUSE_DECL_TNS(use) == + WXS_ATTRUSE_DECL_TNS(tmp))) + { + goto inherit_next; + } } } - prev = cur; - cur = cur->next; + if (uses == NULL) { + type->attrUses = xmlSchemaItemListCreate(); + if (type->attrUses == NULL) + goto exit_failure; + uses = type->attrUses; + } + xmlSchemaItemListAddSize(uses, 2, use); +inherit_next: {} + } + } else { + /* Extension. */ + for (i = 0; i < baseUses->nbItems; i++) { + use = baseUses->items[i]; + if (uses == NULL) { + type->attrUses = xmlSchemaItemListCreate(); + if (type->attrUses == NULL) + goto exit_failure; + uses = type->attrUses; + } + xmlSchemaItemListAddSize(uses, baseUses->nbItems, use); } - if (localUses != NULL) - xmlSchemaFreeAttributeUseList(localUses); - } - } else if (WXS_IS_EXTENSION(type)) { - /* - * The spec allows only appending, and not other kinds of extensions. - * - * This ensures: Schema Component Constraint: Derivation Valid (Extension) : 1.2 - */ - if (localUses != NULL) { - if (type->attributeUses == NULL) { - type->attributeUses = localUses; - } else - lastBaseUse->next = localUses; } - } else { - PERROR_INT("xmlSchemaBuildAttributeValidation", - "no derivation method"); - return (-1); } /* - * 3.4.6 -> Complex Type Definition Properties Correct - */ - if (type->attributeUses != NULL) { - cur = type->attributeUses; - prev = NULL; - while (cur != NULL) { - if (cur->attr->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) { - /* - * Remove "prohibited" attribute uses. The reason this is - * done at this late stage is to be able to catch - * dublicate attribute uses. So we had to keep prohibited - * uses in the list as well. - */ - tmp = cur; - if (prev == NULL) - type->attributeUses = cur->next; - else - prev->next = cur->next; - cur = cur->next; - xmlFree(tmp); - continue; - } + * Shrink attr. uses. + */ + if (uses) { + if (uses->nbItems == 0) { + xmlSchemaItemListFree(uses); + type->attrUses = NULL; + } + /* + * TODO: We could shrink the size of the array + * to fit the actual number of items. + */ + } + /* + * Compute the complete wildcard. + */ + if (WXS_IS_EXTENSION(type)) { + if (baseType->attributeWildcard != NULL) { /* - * 4. Two distinct attribute declarations in the {attribute uses} must - * not have identical {name}s and {target namespace}s. - * - * Note that this was already done for "restriction" and types derived from - * the ur-type. + * (3.2.2.1) "If the ·base wildcard· is non-·absent·, then + * the appropriate case among the following:" */ - if (WXS_IS_EXTENSION(type)) { - tmp = cur->next; - while (tmp != NULL) { - if ((xmlStrEqual(xmlSchemaGetAttrName(cur->attr), - xmlSchemaGetAttrName(tmp->attr))) && - (xmlStrEqual(xmlSchemaGetAttrTargetNsURI(cur->attr ), - xmlSchemaGetAttrTargetNsURI(tmp->attr)))) { - - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_CT_PROPS_CORRECT_4, - type, tmp->attr, - "Duplicate attribute use specified", NULL); - break; - } - tmp = tmp->next; - } - } - + if (type->attributeWildcard != NULL) { + /* + * Union the complete wildcard with the base wildcard. + * SPEC {attribute wildcard} + * (3.2.2.1.2) "otherwise a wildcard whose {process contents} + * and {annotation} are those of the ·complete wildcard·, + * and whose {namespace constraint} is the intensional union + * of the {namespace constraint} of the ·complete wildcard· + * and of the ·base wildcard·, as defined in Attribute + * Wildcard Union (§3.10.6)." + */ + if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard, + baseType->attributeWildcard) == -1) + goto exit_failure; + } else { + /* + * (3.2.2.1.1) "If the ·complete wildcard· is ·absent·, + * then the ·base wildcard·." + */ + type->attributeWildcard = baseType->attributeWildcard; + } + } else { /* - * 5. Two distinct attribute declarations in the - * {attribute uses} must not have {type definition}s which - * are or are derived from ID. + * (3.2.2.2) "otherwise (the ·base wildcard· is ·absent·) the + * ·complete wildcard" + * NOOP */ - if ((cur->attr->subtypes != NULL) && - (xmlSchemaIsDerivedFromBuiltInType(cur->attr->subtypes, - XML_SCHEMAS_ID))) { - if (id != NULL) { - xmlSchemaPAttrUseErr(pctxt, - XML_SCHEMAP_CT_PROPS_CORRECT_5, - type, cur->attr, - "There must not exist more than one attribute " - "use, declared of type 'ID' or derived from it", - NULL); - FREE_AND_NULL(str) - } - id = cur; - } - prev = cur; - cur = cur->next; } + } else { + /* + * SPEC {attribute wildcard} + * (3.1) "If the alternative is chosen, then the + * ·complete wildcard·;" + * NOOP + */ } - /* - * TODO: This check should be removed if we are 100% sure of - * the base type attribute uses already being built. - */ - if ((baseType != NULL) && (! IS_ANYTYPE(baseType)) && - (baseType->type == XML_SCHEMA_TYPE_COMPLEX) && - (IS_NOT_TYPEFIXED(baseType))) { - PERROR_INT("xmlSchemaBuildAttributeValidation", - "attribute uses not builded on base type"); - } + return (0); + +exit_failure: + return(-1); } /** @@ -13963,7 +14626,7 @@ xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle) * SPEC (2) "Its {term} is a group and the minimum part of the * effective total range of that group, [...] is 0." */ - if (IS_MODEL_GROUP(particle->children)) { + if (WXS_IS_MODEL_GROUP(particle->children)) { if (xmlSchemaGetParticleTotalRangeMin(particle) == 0) return (1); } @@ -13972,8 +14635,10 @@ xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle) /** * xmlSchemaCheckCOSSTDerivedOK: + * @actxt: a context * @type: the derived simple type definition * @baseType: the base type definition + * @subset: the subset of ('restriction', ect.) * * Schema Component Constraint: * Type Derivation OK (Simple) (cos-st-derived-OK) @@ -13984,7 +14649,8 @@ xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle) * Returns 0 on success, an positive error code otherwise. */ static int -xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, +xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt, + xmlSchemaTypePtr type, xmlSchemaTypePtr baseType, int subset) { @@ -13997,7 +14663,18 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, /* * 2.1 restriction is not in the subset, or in the {final} * of its own {base type definition}; + * + * NOTE that this will be used also via "xsi:type". + * + * TODO: Revise this, it looks strange. How can the "type" + * not be fixed or *in* fixing? */ + if (WXS_IS_TYPE_NOT_FIXED(type)) + if (xmlSchemaTypeFixup(type, actxt) == -1) + return(-1); + if (WXS_IS_TYPE_NOT_FIXED(baseType)) + if (xmlSchemaTypeFixup(baseType, actxt) == -1) + return(-1); if ((subset & SUBSET_RESTRICTION) || (xmlSchemaTypeFinalContains(type->baseType, XML_SCHEMAS_TYPE_FINAL_RESTRICTION))) { @@ -14015,8 +14692,8 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, * and is validly derived from B given the subset, as defined by this * constraint. */ - if ((! IS_ANYTYPE(type->baseType)) && - (xmlSchemaCheckCOSSTDerivedOK(type->baseType, + if ((! WXS_IS_ANYTYPE(type->baseType)) && + (xmlSchemaCheckCOSSTDerivedOK(actxt, type->baseType, baseType, subset) == 0)) { return (0); } @@ -14024,8 +14701,8 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, * 2.2.3 D's {variety} is list or union and B is the ·simple ur-type * definition·. */ - if (IS_ANY_SIMPLE_TYPE(baseType) && - (VARIETY_LIST(type) || VARIETY_UNION(type))) { + if (WXS_IS_ANY_SIMPLE_TYPE(baseType) && + (WXS_IS_LIST(type) || WXS_IS_UNION(type))) { return (0); } /* @@ -14036,17 +14713,26 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaTypePtr type, * NOTE: This seems not to involve built-in types, since there is no * built-in Union Simple Type. */ - if (VARIETY_UNION(baseType)) { + if (WXS_IS_UNION(baseType)) { xmlSchemaTypeLinkPtr cur; cur = baseType->memberTypes; while (cur != NULL) { - if (xmlSchemaCheckCOSSTDerivedOK(type, cur->type, subset) == 0) + if (WXS_IS_TYPE_NOT_FIXED(cur->type)) + if (xmlSchemaTypeFixup(cur->type, actxt) == -1) + return(-1); + if (xmlSchemaCheckCOSSTDerivedOK(actxt, + type, cur->type, subset) == 0) + { + /* + * It just has to be validly derived from at least one + * member-type. + */ return (0); + } cur = cur->next; } } - return (XML_SCHEMAP_COS_ST_DERIVED_OK_2_2); } @@ -14075,7 +14761,7 @@ xmlSchemaCheckTypeDefCircularInternal(xmlSchemaParserCtxtPtr pctxt, if (ctxtType == ancestor) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_ST_PROPS_CORRECT_2, - NULL, ctxtType, GET_NODE(ctxtType), + WXS_BASIC_CAST ctxtType, WXS_ITEM_NODE(ctxtType), "The definition is circular", NULL); return (XML_SCHEMAP_ST_PROPS_CORRECT_2); } @@ -14105,17 +14791,11 @@ xmlSchemaCheckTypeDefCircular(xmlSchemaTypePtr item, xmlSchemaParserCtxtPtr ctxt) { if ((item == NULL) || - ((item->type != XML_SCHEMA_TYPE_COMPLEX) && - (item->type != XML_SCHEMA_TYPE_SIMPLE))) + (item->type == XML_SCHEMA_TYPE_BASIC) || + (item->baseType == NULL)) return; - if (item->redef != NULL) { - xmlSchemaTypePtr cur = item; - do { - xmlSchemaCheckTypeDefCircularInternal(ctxt, cur, cur->baseType); - cur = cur->redef; - } while (cur != NULL); - } else - xmlSchemaCheckTypeDefCircularInternal(ctxt, item, item->baseType); + xmlSchemaCheckTypeDefCircularInternal(ctxt, item, + item->baseType); } /* @@ -14147,11 +14827,11 @@ xmlSchemaCheckUnionTypeDefCircularRecur(xmlSchemaParserCtxtPtr pctxt, if (memberType == ctxType) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_SRC_SIMPLE_TYPE_4, - NULL, ctxType, NULL, + WXS_BASIC_CAST ctxType, NULL, "The union type definition is circular", NULL); return (XML_SCHEMAP_SRC_SIMPLE_TYPE_4); } - if ((VARIETY_UNION(memberType)) && + if ((WXS_IS_UNION(memberType)) && ((memberType->flags & XML_SCHEMAS_TYPE_MARKED) == 0)) { int res; @@ -14174,7 +14854,7 @@ static int xmlSchemaCheckUnionTypeDefCircular(xmlSchemaParserCtxtPtr pctxt, xmlSchemaTypePtr type) { - if (! VARIETY_UNION(type)) + if (! WXS_IS_UNION(type)) return(0); return(xmlSchemaCheckUnionTypeDefCircularRecur(pctxt, type, type->memberTypes)); @@ -14190,8 +14870,7 @@ xmlSchemaCheckUnionTypeDefCircular(xmlSchemaParserCtxtPtr pctxt, */ static void xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef, - xmlSchemaParserCtxtPtr ctxt, - const xmlChar * name ATTRIBUTE_UNUSED) + xmlSchemaParserCtxtPtr ctxt) { if (typeDef == NULL) return; @@ -14205,38 +14884,103 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef, if (typeDef->baseType == NULL) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - typeDef, typeDef->node, + WXS_BASIC_CAST typeDef, typeDef->node, "base", typeDef->base, typeDef->baseNs, XML_SCHEMA_TYPE_SIMPLE, NULL); return; } } - if (IS_SIMPLE_TYPE(typeDef)) { - if (VARIETY_UNION(typeDef)) { + if (WXS_IS_SIMPLE(typeDef)) { + if (WXS_IS_UNION(typeDef)) { /* * Resolve the memberTypes. */ xmlSchemaResolveUnionMemberTypes(ctxt, typeDef); return; - } else if (VARIETY_LIST(typeDef)) { + } else if (WXS_IS_LIST(typeDef)) { /* * Resolve the itemType. */ - if ((typeDef->subtypes == NULL) && (typeDef->ref != NULL)) { + if ((typeDef->subtypes == NULL) && (typeDef->base != NULL)) { + typeDef->subtypes = xmlSchemaGetType(ctxt->schema, - typeDef->ref, typeDef->refNs); + typeDef->base, typeDef->baseNs); + if ((typeDef->subtypes == NULL) || - (! IS_SIMPLE_TYPE(typeDef->subtypes))) { + (! WXS_IS_SIMPLE(typeDef->subtypes))) + { typeDef->subtypes = NULL; xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - typeDef, typeDef->node, - "itemType", typeDef->ref, typeDef->refNs, + WXS_BASIC_CAST typeDef, typeDef->node, + "itemType", typeDef->base, typeDef->baseNs, XML_SCHEMA_TYPE_SIMPLE, NULL); } } return; } + } + /* + * The ball of letters below means, that if we have a particle + * which has a QName-helper component as its {term}, we want + * to resolve it... + */ + else if ((WXS_TYPE_CONTENTTYPE(typeDef) != NULL) && + ((WXS_TYPE_CONTENTTYPE(typeDef))->type == + XML_SCHEMA_TYPE_PARTICLE) && + (WXS_TYPE_PARTICLE_TERM(typeDef) != NULL) && + ((WXS_TYPE_PARTICLE_TERM(typeDef))->type == + XML_SCHEMA_EXTRA_QNAMEREF)) + { + xmlSchemaQNameRefPtr ref = + WXS_QNAME_CAST WXS_TYPE_PARTICLE_TERM(typeDef); + xmlSchemaModelGroupDefPtr groupDef; + + /* + * URGENT TODO: Test this. + */ + WXS_TYPE_PARTICLE_TERM(typeDef) = NULL; + /* + * Resolve the MG definition reference. + */ + groupDef = + WXS_MODEL_GROUPDEF_CAST xmlSchemaGetNamedComponent(ctxt->schema, + ref->itemType, ref->name, ref->targetNamespace); + if (groupDef == NULL) { + xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, + NULL, WXS_ITEM_NODE(WXS_TYPE_PARTICLE(typeDef)), + "ref", ref->name, ref->targetNamespace, ref->itemType, + NULL); + /* Remove the particle. */ + WXS_TYPE_CONTENTTYPE(typeDef) = NULL; + } else if (WXS_MODELGROUPDEF_MODEL(groupDef) == NULL) + /* Remove the particle. */ + WXS_TYPE_CONTENTTYPE(typeDef) = NULL; + else { + /* + * Assign the MG definition's {model group} to the + * particle's {term}. + */ + WXS_TYPE_PARTICLE_TERM(typeDef) = WXS_MODELGROUPDEF_MODEL(groupDef); + + if (WXS_MODELGROUPDEF_MODEL(groupDef)->type == XML_SCHEMA_TYPE_ALL) { + /* + * SPEC cos-all-limited (1.2) + * "1.2 the {term} property of a particle with + * {max occurs}=1 which is part of a pair which constitutes + * the {content type} of a complex type definition." + */ + if ((WXS_TYPE_PARTICLE(typeDef))->maxOccurs != 1) { + xmlSchemaCustomErr(ACTXT_CAST ctxt, + /* TODO: error code */ + XML_SCHEMAP_COS_ALL_LIMITED, + WXS_ITEM_NODE(WXS_TYPE_PARTICLE(typeDef)), NULL, + "The particle's {max occurs} must be 1, since the " + "reference resolves to an 'all' model group", + NULL, NULL); + } + } + } } } @@ -14278,26 +15022,26 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "No base type existent", NULL); return (XML_SCHEMAP_ST_PROPS_CORRECT_1); } - if (! IS_SIMPLE_TYPE(baseType)) { + if (! WXS_IS_SIMPLE(baseType)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The base type '%s' is not a simple type", xmlSchemaGetComponentQName(&str, baseType)); FREE_AND_NULL(str) return (XML_SCHEMAP_ST_PROPS_CORRECT_1); } - if ( (VARIETY_LIST(type) || VARIETY_UNION(type)) && + if ( (WXS_IS_LIST(type) || WXS_IS_UNION(type)) && (WXS_IS_RESTRICTION(type) == 0) && - (! IS_ANY_SIMPLE_TYPE(baseType))) { + (! WXS_IS_ANY_SIMPLE_TYPE(baseType))) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "A type, derived by list or union, must have" "the simple ur-type definition as base type, not '%s'", xmlSchemaGetComponentQName(&str, baseType)); @@ -14307,11 +15051,11 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt, /* * Variety: One of {atomic, list, union}. */ - if ((! VARIETY_ATOMIC(type)) && (! VARIETY_UNION(type)) && - (! VARIETY_LIST(type))) { + if ((! WXS_IS_ATOMIC(type)) && (! WXS_IS_UNION(type)) && + (! WXS_IS_LIST(type))) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The variety is absent", NULL); return (XML_SCHEMAP_ST_PROPS_CORRECT_1); } @@ -14324,7 +15068,7 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt, XML_SCHEMAS_TYPE_FINAL_RESTRICTION)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_3, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of its base type '%s' must not contain " "'restriction'", xmlSchemaGetComponentQName(&str, baseType)); @@ -14369,16 +15113,16 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, return (-1); } - if (VARIETY_ATOMIC(type)) { + if (WXS_IS_ATOMIC(type)) { xmlSchemaTypePtr primitive; /* * 1.1 The {base type definition} must be an atomic simple * type definition or a built-in primitive datatype. */ - if (! VARIETY_ATOMIC(type->baseType)) { + if (! WXS_IS_ATOMIC(type->baseType)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The base type '%s' is not an atomic simple type", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14392,7 +15136,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMAS_TYPE_FINAL_RESTRICTION)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_1_2, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The final of its base type '%s' must not contain 'restriction'", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14420,7 +15164,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, ok = 0; xmlSchemaPIllegalFacetAtomicErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, - NULL, type, primitive, facet); + type, primitive, facet); } facet = facet->next; } while (facet != NULL); @@ -14436,40 +15180,40 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, * NOTE (1.3.2) Facet derivation constraints are currently handled in * xmlSchemaDeriveAndValidateFacets() */ - } else if (VARIETY_LIST(type)) { + } else if (WXS_IS_LIST(type)) { xmlSchemaTypePtr itemType = NULL; itemType = type->subtypes; - if ((itemType == NULL) || (! IS_SIMPLE_TYPE(itemType))) { + if ((itemType == NULL) || (! WXS_IS_SIMPLE(itemType))) { PERROR_INT("xmlSchemaCheckCOSSTRestricts", "failed to evaluate the item type"); return (-1); } - if (IS_NOT_TYPEFIXED(itemType)) - xmlSchemaTypeFixup(itemType, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(itemType)) + xmlSchemaTypeFixup(itemType, ACTXT_CAST pctxt); /* * 2.1 The {item type definition} must have a {variety} of atomic or * union (in which case all the {member type definitions} * must be atomic). */ - if ((! VARIETY_ATOMIC(itemType)) && - (! VARIETY_UNION(itemType))) { + if ((! WXS_IS_ATOMIC(itemType)) && + (! WXS_IS_UNION(itemType))) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The item type '%s' does not have a variety of atomic or union", xmlSchemaGetComponentQName(&str, itemType)); FREE_AND_NULL(str) return (XML_SCHEMAP_COS_ST_RESTRICTS_2_1); - } else if (VARIETY_UNION(itemType)) { + } else if (WXS_IS_UNION(itemType)) { xmlSchemaTypeLinkPtr member; member = itemType->memberTypes; while (member != NULL) { - if (! VARIETY_ATOMIC(member->type)) { + if (! WXS_IS_ATOMIC(member->type)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The item type is a union type, but the " "member type '%s' of this item type is not atomic", xmlSchemaGetComponentQName(&str, member->type)); @@ -14480,7 +15224,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, } } - if (IS_ANY_SIMPLE_TYPE(type->baseType)) { + if (WXS_IS_ANY_SIMPLE_TYPE(type->baseType)) { xmlSchemaFacetPtr facet; /* * This is the case if we have: type != XML_SCHEMA_FACET_WHITESPACE) { xmlSchemaPIllegalFacetListUnionErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, - NULL, type, facet); + type, facet); return (XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2); } facet = facet->next; @@ -14534,10 +15278,10 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, * 2.3.2 * 2.3.2.1 The {base type definition} must have a {variety} of list. */ - if (! VARIETY_LIST(type->baseType)) { + if (! WXS_IS_LIST(type->baseType)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The base type '%s' must be a list type", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14551,7 +15295,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMAS_TYPE_FINAL_RESTRICTION)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of the base type '%s' must not contain 'restriction'", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14566,18 +15310,18 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, xmlSchemaTypePtr baseItemType; baseItemType = type->baseType->subtypes; - if ((baseItemType == NULL) || (! IS_SIMPLE_TYPE(baseItemType))) { + if ((baseItemType == NULL) || (! WXS_IS_SIMPLE(baseItemType))) { PERROR_INT("xmlSchemaCheckCOSSTRestricts", "failed to eval the item type of a base type"); return (-1); } if ((itemType != baseItemType) && - (xmlSchemaCheckCOSSTDerivedOK(itemType, + (xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST pctxt, itemType, baseItemType, 0) != 0)) { xmlChar *strBIT = NULL, *strBT = NULL; xmlSchemaPCustomErrExt(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The item type '%s' is not validly derived from " "the item type '%s' of the base type '%s'", xmlSchemaGetComponentQName(&str, itemType), @@ -14615,7 +15359,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, default: { xmlSchemaPIllegalFacetListUnionErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, - NULL, type, facet); + type, facet); /* * We could return, but it's nicer to report all * invalid facets. @@ -14635,7 +15379,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, */ } } - } else if (VARIETY_UNION(type)) { + } else if (WXS_IS_UNION(type)) { /* * 3.1 The {member type definitions} must all have {variety} of * atomic or list. @@ -14644,14 +15388,14 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, member = type->memberTypes; while (member != NULL) { - if (IS_NOT_TYPEFIXED(member->type)) - xmlSchemaTypeFixup(member->type, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(member->type)) + xmlSchemaTypeFixup(member->type, ACTXT_CAST pctxt); - if ((! VARIETY_ATOMIC(member->type)) && - (! VARIETY_LIST(member->type))) { + if ((! WXS_IS_ATOMIC(member->type)) && + (! WXS_IS_LIST(member->type))) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The member type '%s' is neither an atomic, nor a list type", xmlSchemaGetComponentQName(&str, member->type)); FREE_AND_NULL(str) @@ -14674,7 +15418,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMAS_TYPE_FINAL_UNION)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of member type '%s' contains 'union'", xmlSchemaGetComponentQName(&str, member->type)); FREE_AND_NULL(str) @@ -14688,7 +15432,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, if (type->facetSet != NULL) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "No facets allowed", NULL); return (XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2); } @@ -14697,10 +15441,10 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, * 3.3.2.1 The {base type definition} must have a {variety} of union. * I.e. the variety of "list" is inherited. */ - if (! VARIETY_UNION(type->baseType)) { + if (! WXS_IS_UNION(type->baseType)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The base type '%s' is not a union type", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14713,7 +15457,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMAS_TYPE_FINAL_RESTRICTION)) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of its base type '%s' must not contain 'restriction'", xmlSchemaGetComponentQName(&str, type->baseType)); FREE_AND_NULL(str) @@ -14753,13 +15497,13 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, "different number of member types in base"); } if ((member->type != baseMember->type) && - (xmlSchemaCheckCOSSTDerivedOK( + (xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST pctxt, member->type, baseMember->type, 0) != 0)) { xmlChar *strBMT = NULL, *strBT = NULL; xmlSchemaPCustomErrExt(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The member type %s is not validly " "derived from its corresponding member " "type %s of the base type %s", @@ -14790,7 +15534,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt, (facet->type != XML_SCHEMA_FACET_ENUMERATION)) { xmlSchemaPIllegalFacetListUnionErr(pctxt, XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, - NULL, type, facet); + type, facet); ok = 0; } facet = facet->next; @@ -14842,14 +15586,14 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt, /* * */ - } else if (VARIETY_LIST(type)) { + } else if (WXS_IS_LIST(type)) { /* src-simple-type.3 "If the alternative is chosen, either it must have * an itemType [attribute] or a among its [children], * but not both." * * NOTE: This is checked in the parse function of . */ - } else if (VARIETY_UNION(type)) { + } else if (WXS_IS_UNION(type)) { /* * src-simple-type.4 is checked in xmlSchemaCheckUnionTypeDefCircular(). */ @@ -14873,7 +15617,9 @@ xmlSchemaCreateVCtxtOnPCtxt(xmlSchemaParserCtxtPtr ctxt) } /* TODO: Pass user data. */ xmlSchemaSetValidErrors(ctxt->vctxt, - ctxt->error, ctxt->warning, ctxt->userData); + ctxt->error, ctxt->warning, ctxt->errCtxt); + xmlSchemaSetValidStructuredErrors(ctxt->vctxt, + ctxt->serror, ctxt->errCtxt); } return (0); } @@ -14919,7 +15665,7 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt, * For a string to be a valid default with respect to a type * definition the appropriate case among the following must be true: */ - if IS_COMPLEX_TYPE(type) { + if WXS_IS_COMPLEX(type) { /* * Complex type. * @@ -14929,12 +15675,12 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt, * type}'s particle must be ·emptiable· as defined by * Particle Emptiable (§3.9.6)." */ - if ((! HAS_SIMPLE_CONTENT(type)) && - ((! HAS_MIXED_CONTENT(type)) || (! IS_PARTICLE_EMPTIABLE(type)))) { + if ((! WXS_HAS_SIMPLE_CONTENT(type)) && + ((! WXS_HAS_MIXED_CONTENT(type)) || (! WXS_EMPTIABLE(type)))) { /* NOTE that this covers (2.2.2) as well. */ xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_COS_VALID_DEFAULT_2_1, - NULL, type, type->node, + WXS_BASIC_CAST type, type->node, "For a string to be a valid default, the type definition " "must be a simple type or a complex type with mixed content " "and a particle emptiable", NULL); @@ -14952,10 +15698,10 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt, * string must be ·valid· with respect to that simple type definition * as defined by String Valid (§3.14.4). */ - if (IS_SIMPLE_TYPE(type)) + if (WXS_IS_SIMPLE(type)) ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, node, type, value, val, 1, 1, 0); - else if (HAS_SIMPLE_CONTENT(type)) + else if (WXS_HAS_SIMPLE_CONTENT(type)) ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, node, type->contentTypeDef, value, val, 1, 1, 0); else @@ -14995,17 +15741,17 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * Sub-components (§5.3)." */ if ((type->baseType != NULL) && - (IS_SIMPLE_TYPE(type->baseType)) && + (WXS_IS_SIMPLE(type->baseType)) && (WXS_IS_EXTENSION(type) == 0)) { /* * SPEC (2) "If the {base type definition} is a simple type definition, * the {derivation method} must be extension." */ - xmlSchemaPCustomErr(pctxt, + xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, NULL, + NULL, WXS_BASIC_CAST type, "If the base type is a simple type, the derivation method must be " - "'extension'", NULL); + "'extension'", NULL, NULL); return (XML_SCHEMAP_SRC_CT_1); } /* @@ -15014,15 +15760,91 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * definition by repeatedly following the {base type definition}." * * NOTE (3) is done in xmlSchemaCheckTypeDefCircular(). - * - * SPEC (4) "Two distinct attribute declarations in the {attribute uses} - * must not have identical {name}s and {target namespace}s." - * SPEC (5) "Two distinct attribute declarations in the {attribute uses} - * must not have {type definition}s which are or are derived from ID." - * - * NOTE (4) and (5) are done in xmlSchemaBuildAttributeValidation(). */ + /* + * NOTE that (4) and (5) need the following: + * - attribute uses need to be already inherited (apply attr. prohibitions) + * - attribute group references need to be expanded already + * - simple types need to be typefixed already + */ + if (type->attrUses && + (((xmlSchemaItemListPtr) type->attrUses)->nbItems > 1)) + { + xmlSchemaItemListPtr uses = (xmlSchemaItemListPtr) type->attrUses; + xmlSchemaAttributeUsePtr use, tmp; + int i, j, hasId = 0; + + for (i = uses->nbItems -1; i >= 0; i--) { + use = uses->items[i]; + + /* + * SPEC ct-props-correct + * (4) "Two distinct attribute declarations in the + * {attribute uses} must not have identical {name}s and + * {target namespace}s." + */ + if (i > 0) { + for (j = i -1; j >= 0; j--) { + tmp = uses->items[j]; + if ((WXS_ATTRUSE_DECL_NAME(use) == + WXS_ATTRUSE_DECL_NAME(tmp)) && + (WXS_ATTRUSE_DECL_TNS(use) == + WXS_ATTRUSE_DECL_TNS(tmp))) + { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_AG_PROPS_CORRECT, + NULL, WXS_BASIC_CAST type, + "Duplicate %s", + xmlSchemaGetComponentDesignation(&str, use), + NULL); + FREE_AND_NULL(str); + /* + * Remove the duplicate. + */ + if (xmlSchemaItemListRemove(uses, i) == -1) + goto exit_failure; + goto next_use; + } + } + } + /* + * SPEC ct-props-correct + * (5) "Two distinct attribute declarations in the + * {attribute uses} must not have {type definition}s which + * are or are derived from ID." + */ + if (WXS_ATTRUSE_TYPEDEF(use) != NULL) { + if (xmlSchemaIsDerivedFromBuiltInType( + WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID)) + { + if (hasId) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_AG_PROPS_CORRECT, + NULL, WXS_BASIC_CAST type, + "There must not exist more than one attribute " + "declaration of type 'xs:ID' " + "(or derived from 'xs:ID'). The %s violates this " + "constraint", + xmlSchemaGetComponentDesignation(&str, use), + NULL); + FREE_AND_NULL(str); + if (xmlSchemaItemListRemove(uses, i) == -1) + goto exit_failure; + } + + hasId = 1; + } + } +next_use: {} + } + } return (0); +exit_failure: + return(-1); } static int @@ -15054,7 +15876,8 @@ xmlSchemaAreEqualTypes(xmlSchemaTypePtr typeA, * if not. */ static int -xmlSchemaCheckCOSCTDerivedOK(xmlSchemaTypePtr type, +xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt, + xmlSchemaTypePtr type, xmlSchemaTypePtr baseType, int set) { @@ -15089,16 +15912,16 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaTypePtr type, * SPEC (2.3.1) "D's {base type definition} must not be the ·ur-type * definition·." */ - if (IS_ANYTYPE(type->baseType)) + if (WXS_IS_ANYTYPE(type->baseType)) return (1); - if (IS_COMPLEX_TYPE(type->baseType)) { + if (WXS_IS_COMPLEX(type->baseType)) { /* * SPEC (2.3.2.1) "If D's {base type definition} is complex, then it * must be validly derived from B given the subset as defined by this * constraint." */ - return (xmlSchemaCheckCOSCTDerivedOK(type->baseType, + return (xmlSchemaCheckCOSCTDerivedOK(actxt, type->baseType, baseType, set)); } else { /* @@ -15106,7 +15929,8 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaTypePtr type, * must be validly derived from B given the subset as defined in Type * Derivation OK (Simple) (§3.14.6). */ - return (xmlSchemaCheckCOSSTDerivedOK(type->baseType, baseType, set)); + return (xmlSchemaCheckCOSSTDerivedOK(actxt, type->baseType, + baseType, set)); } } @@ -15123,14 +15947,15 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaTypePtr type, * Returns 0 on success, an positive error code otherwise. */ static int -xmlSchemaCheckCOSDerivedOK(xmlSchemaTypePtr type, +xmlSchemaCheckCOSDerivedOK(xmlSchemaAbstractCtxtPtr actxt, + xmlSchemaTypePtr type, xmlSchemaTypePtr baseType, int set) { - if (IS_SIMPLE_TYPE(type)) - return (xmlSchemaCheckCOSSTDerivedOK(type, baseType, set)); + if (WXS_IS_SIMPLE(type)) + return (xmlSchemaCheckCOSSTDerivedOK(actxt, type, baseType, set)); else - return (xmlSchemaCheckCOSCTDerivedOK(type, baseType, set)); + return (xmlSchemaCheckCOSCTDerivedOK(actxt, type, baseType, set)); } /** @@ -15145,7 +15970,7 @@ xmlSchemaCheckCOSDerivedOK(xmlSchemaTypePtr type, * STATUS: * missing: * (1.5) - * (1.4.3.2.2.2) "Particle Valid (Extension)", which is not really needed. + * (1.4.3.2.2.2) "Particle Valid (Extension)" * * Returns 0 if the constraints are satisfied, a positive * error code if not and -1 if an internal error occured. @@ -15163,7 +15988,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * SPEC (1) "If the {base type definition} is a complex type definition, * then all of the following must be true:" */ - if (IS_COMPLEX_TYPE(base)) { + if (WXS_IS_COMPLEX(base)) { /* * SPEC (1.1) "The {final} of the {base type definition} must not * contain extension." @@ -15171,11 +15996,20 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, if (base->flags & XML_SCHEMAS_TYPE_FINAL_EXTENSION) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of the base type definition " "contains 'extension'", NULL); return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); } + + /* + * ATTENTION: The constrains (1.2) and (1.3) are not applied, + * since they are automatically satisfied through the + * inheriting mechanism. + * Note that even if redefining components, the inheriting mechanism + * is used. + */ +#if 0 /* * SPEC (1.2) "Its {attribute uses} must be a subset of the {attribute * uses} @@ -15185,22 +16019,89 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * type definition itself whose {attribute declaration} has the same * {name}, {target namespace} and {type definition} as its attribute * declaration" - * - * NOTE (1.2): This will be already satisfied by the way the attribute - * uses are extended in xmlSchemaBuildAttributeValidation(); thus this - * check is not needed. */ + if (base->attrUses != NULL) { + int i, j, found; + xmlSchemaAttributeUsePtr use, buse; + for (i = 0; i < (WXS_LIST_CAST base->attrUses)->nbItems; i ++) { + buse = (WXS_LIST_CAST base->attrUses)->items[i]; + found = 0; + if (type->attrUses != NULL) { + use = (WXS_LIST_CAST type->attrUses)->items[j]; + for (j = 0; j < (WXS_LIST_CAST type->attrUses)->nbItems; j ++) + { + if ((WXS_ATTRUSE_DECL_NAME(use) == + WXS_ATTRUSE_DECL_NAME(buse)) && + (WXS_ATTRUSE_DECL_TNS(use) == + WXS_ATTRUSE_DECL_TNS(buse)) && + (WXS_ATTRUSE_TYPEDEF(use) == + WXS_ATTRUSE_TYPEDEF(buse)) + { + found = 1; + break; + } + } + } + if (! found) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_COS_CT_EXTENDS_1_2, + NULL, WXS_BASIC_CAST type, + /* + * TODO: The report does not indicate that also the + * type needs to be the same. + */ + "This type is missing a matching correspondent " + "for its {base type}'s %s in its {attribute uses}", + xmlSchemaGetComponentDesignation(&str, + buse->children), + NULL); + FREE_AND_NULL(str) + } + } + } /* * SPEC (1.3) "If it has an {attribute wildcard}, the complex type * definition must also have one, and the base type definition's * {attribute wildcard}'s {namespace constraint} must be a subset * of the complex type definition's {attribute wildcard}'s {namespace * constraint}, as defined by Wildcard Subset (§3.10.6)." - * - * NOTE (1.3) This is already checked in - * xmlSchemaBuildAttributeValidation; thus this check is not needed. - * + */ + + /* + * MAYBE TODO: Enable if ever needed. But this will be needed only + * if created the type via a schema construction API. + */ + if (base->attributeWildcard != NULL) { + if (type->attributeWilcard == NULL) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_COS_CT_EXTENDS_1_3, + NULL, type, + "The base %s has an attribute wildcard, " + "but this type is missing an attribute wildcard", + xmlSchemaGetComponentDesignation(&str, base)); + FREE_AND_NULL(str) + + } else if (xmlSchemaCheckCOSNSSubset( + base->attributeWildcard, type->attributeWildcard)) + { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_COS_CT_EXTENDS_1_3, + NULL, type, + "The attribute wildcard is not a valid " + "superset of the one in the base %s", + xmlSchemaGetComponentDesignation(&str, base)); + FREE_AND_NULL(str) + } + } +#endif + /* * SPEC (1.4) "One of the following must be true:" */ if ((type->contentTypeDef != NULL) && @@ -15230,7 +16131,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The content type must specify a particle", NULL); return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); } @@ -15256,13 +16157,13 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The content type of both, the type and its base " "type, must either 'mixed' or 'element-only'", NULL); return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); } /* - * FUTURE TODO SPEC (1.4.3.2.2.2) "The particle of the + * URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the * complex type definition must be a ·valid extension· * of the {base type definition}'s particle, as defined * in Particle Valid (Extension) (§3.9.6)." @@ -15271,10 +16172,11 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * since it is ensured by the derivation process in * xmlSchemaTypeFixup(). We need to implement this when heading * for a construction API + * TODO: !! This is needed to be checked if redefining a type !! */ } /* - * TODO (1.5) + * URGENT TODO (1.5) */ } } else { @@ -15289,7 +16191,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The content type must be the simple base type", NULL); return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); } @@ -15301,7 +16203,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "The 'final' of the base type definition " "contains 'extension'", NULL); return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); @@ -15321,7 +16223,11 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt, * * STATUS: * missing: - * (5.4.2), (5.2.2.1) + * (5.4.2) ??? + * + * ATTENTION: + * In XML Schema 1.1 this will be: + * Validation Rule: Checking complex type subsumption * * Returns 0 if the constraints are satisfied, a positive * error code if not and -1 if an internal error occured. @@ -15333,25 +16239,45 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaTypePtr base; /* - * TODO: Correct the error code; XML_SCHEMAP_COS_CT_EXTENDS_1_1 is used + * TODO: Correct the error code; XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1 is used * temporarily only. */ base = type->baseType; + if (! WXS_IS_COMPLEX(base)) { + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + type->node, WXS_BASIC_CAST type, + "The base type must be a complex type", NULL, NULL); + return(ctxt->err); + } if (base->flags & XML_SCHEMAS_TYPE_FINAL_RESTRICTION) { /* * SPEC (1) "The {base type definition} must be a complex type * definition whose {final} does not contain restriction." */ - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + type->node, WXS_BASIC_CAST type, "The 'final' of the base type definition " - "contains 'restriction'", NULL); - return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); + "contains 'restriction'", NULL, NULL); + return (ctxt->err); + } + /* + * SPEC (2), (3) and (4) + * Those are handled in a separate function, since the + * same constraints are needed for redefinition of + * attribute groups as well. + */ + if (xmlSchemaCheckDerivationOKRestriction2to4(ctxt, + XML_SCHEMA_ACTION_DERIVE, + WXS_BASIC_CAST type, WXS_BASIC_CAST base, + type->attrUses, base->attrUses, + type->attributeWildcard, + base->attributeWildcard) == -1) + { + return(-1); } /* - * NOTE (3) and (4) are done in xmlSchemaBuildAttributeValidation(). - * * SPEC (5) "One of the following must be true:" */ if (base->builtInType == XML_SCHEMAS_ANYTYPE) { @@ -15369,14 +16295,39 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, * SPEC (5.2.2) "One of the following must be true:" */ if ((base->contentType == XML_SCHEMA_CONTENT_SIMPLE) || - (base->contentType == XML_SCHEMA_CONTENT_BASIC)) { + (base->contentType == XML_SCHEMA_CONTENT_BASIC)) + { + int err; /* * SPEC (5.2.2.1) "The {content type} of the {base type * definition} must be a simple type definition from which * the {content type} is validly derived given the empty * set as defined in Type Derivation OK (Simple) (§3.14.6)." - * URGENT TODO + * + * ATTENTION TODO: This seems not needed if the type implicitely + * derived from the base type. + * */ + err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt, + type->contentTypeDef, base->contentTypeDef, 0); + if (err != 0) { + xmlChar *strA = NULL, *strB = NULL; + + if (err == -1) + return(-1); + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + NULL, WXS_BASIC_CAST type, + "The {content type} %s is not validly derived from the " + "base type's {content type} %s", + xmlSchemaGetComponentDesignation(&strA, + type->contentTypeDef), + xmlSchemaGetComponentDesignation(&strB, + base->contentTypeDef)); + FREE_AND_NULL(strA); + FREE_AND_NULL(strB); + return(ctxt->err); + } } else if ((base->contentType == XML_SCHEMA_CONTENT_MIXED) && (xmlSchemaIsParticleEmptiable( (xmlSchemaParticlePtr) base->subtypes))) { @@ -15388,11 +16339,11 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, */ } else { xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + WXS_BASIC_CAST type, NULL, "The content type of the base type must be either " "a simple type or 'mixed' and an emptiable particle", NULL); - return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); + return (ctxt->err); } } else if (type->contentType == XML_SCHEMA_CONTENT_EMPTY) { /* @@ -15417,31 +16368,31 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, */ } else { xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + WXS_BASIC_CAST type, NULL, "The content type of the base type must be either " "empty or 'mixed' (or 'elements-only') and an emptiable " "particle", NULL); - return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); + return (ctxt->err); } } else if ((type->contentType == XML_SCHEMA_CONTENT_ELEMENTS) || - HAS_MIXED_CONTENT(type)) { + WXS_HAS_MIXED_CONTENT(type)) { /* * SPEC (5.4.1.1) "The {content type} of the complex type definition * itself must be element-only" */ - if (HAS_MIXED_CONTENT(type) && (! HAS_MIXED_CONTENT(base))) { + if (WXS_HAS_MIXED_CONTENT(type) && (! WXS_HAS_MIXED_CONTENT(base))) { /* * SPEC (5.4.1.2) "The {content type} of the complex type * definition itself and of the {base type definition} must be * mixed" */ xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + WXS_BASIC_CAST type, NULL, "If the content type is 'mixed', then the content type of the " "base type must also be 'mixed'", NULL); - return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); + return (ctxt->err); } /* * SPEC (5.4.2) "The particle of the complex type definition itself @@ -15453,10 +16404,10 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, */ } else { xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_COS_CT_EXTENDS_1_1, - NULL, type, NULL, + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, + WXS_BASIC_CAST type, NULL, "The type is not a valid restriction of its base type", NULL); - return (XML_SCHEMAP_COS_CT_EXTENDS_1_1); + return (ctxt->err); } return (0); } @@ -15513,17 +16464,17 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, * XML_SCHEMAP_SRC_CT_1 only yet. */ base = type->baseType; - if (! HAS_SIMPLE_CONTENT(type)) { + if (! WXS_HAS_SIMPLE_CONTENT(type)) { /* * 1 If the alternative is chosen, the type definition * ·resolved· to by the ·actual value· of the base [attribute] * must be a complex type definition; */ - if (! IS_COMPLEX_TYPE(base)) { + if (! WXS_IS_COMPLEX(base)) { xmlChar *str = NULL; xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, type->node, + WXS_BASIC_CAST type, type->node, "If using , the base type is expected to be " "a complex type. The base type '%s' is a simple type", xmlSchemaFormatQName(&str, base->targetNamespace, @@ -15539,7 +16490,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, * 2.1 The type definition ·resolved· to by the ·actual value· of the * base [attribute] must be one of the following: */ - if (IS_SIMPLE_TYPE(base)) { + if (WXS_IS_SIMPLE(base)) { if (WXS_IS_EXTENSION(type) == 0) { xmlChar *str = NULL; /* @@ -15549,7 +16500,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, /* TODO: Change error code to ..._SRC_CT_2_1_3. */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "If using and , the base " "type must be a complex type. The base type '%s' is " "a simple type", @@ -15569,7 +16520,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, */ if (base->contentTypeDef == NULL) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_INTERNAL, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "Internal error: xmlSchemaCheckSRCCT, " "'%s', base type has no content type", type->name); @@ -15601,7 +16552,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, /* TODO: Change error code to ..._SRC_CT_2_2. */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "A is expected among the children " "of , if is used and " "the base type '%s' is a complex type", @@ -15619,7 +16570,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, if (WXS_IS_RESTRICTION(type)) { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "If and is used, the " "base type must be a simple type or a complex type with " "mixed content and particle emptiable. The base type " @@ -15629,7 +16580,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, } else { xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_CT_1, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "If and is used, the " "base type must be a simple type. The base type '%s' " "is a complex type", @@ -15650,7 +16601,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, * above for {attribute wildcard} is satisfied, the intensional * intersection must be expressible, as defined in Attribute Wildcard * Intersection (§3.10.6). - * NOTE (4) is done in xmlSchemaBuildAttributeValidation(). + * NOTE (4) is done in xmlSchemaFixupTypeAttributeUses(). */ return (ret); } @@ -15782,7 +16733,7 @@ xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt, set |= SUBSET_EXTENSION; set |= SUBSET_LIST; set |= SUBSET_UNION; - if (xmlSchemaCheckCOSDerivedOK(elemR->subtypes, + if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST ctxt, elemR->subtypes, elemB->subtypes, set) != 0) return (1); } @@ -15932,8 +16883,8 @@ xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt, { int ret = 0; - /*part = GET_PARTICLE(type); - basePart = GET_PARTICLE(base); + /*part = WXS_TYPE_PARTICLE(type); + basePart = WXS_TYPE_PARTICLE(base); */ TODO @@ -16049,7 +17000,7 @@ xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt, #define FACET_RESTR_MUTUAL_ERR(fac1, fac2) \ xmlSchemaPCustomErrExt(pctxt, \ XML_SCHEMAP_INVALID_FACET_VALUE, \ - NULL, (xmlSchemaTypePtr) fac1, fac1->node, \ + WXS_BASIC_CAST fac1, fac1->node, \ "It is an error for both '%s' and '%s' to be specified on the "\ "same type definition", \ BAD_CAST xmlSchemaFacetTypeToString(fac1->type), \ @@ -16058,13 +17009,13 @@ xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt, #define FACET_RESTR_ERR(fac1, msg) \ xmlSchemaPCustomErr(pctxt, \ XML_SCHEMAP_INVALID_FACET_VALUE, \ - NULL, (xmlSchemaTypePtr) fac1, fac1->node, \ + WXS_BASIC_CAST fac1, fac1->node, \ msg, NULL); #define FACET_RESTR_FIXED_ERR(fac) \ xmlSchemaPCustomErr(pctxt, \ XML_SCHEMAP_INVALID_FACET_VALUE, \ - NULL, (xmlSchemaTypePtr) fac, fac->node, \ + WXS_BASIC_CAST fac, fac->node, \ "The base type's facet is 'fixed', thus the value must not " \ "differ", NULL); @@ -16099,7 +17050,7 @@ xmlSchemaDeriveFacetErr(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_INVALID_FACET_VALUE, - NULL, (xmlSchemaTypePtr) facet1, facet1->node, + WXS_BASIC_CAST facet1, NULL, (const char *) msg, NULL); if (msg != NULL) @@ -16127,7 +17078,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, bfmaxlen = NULL, bfminlen = NULL, /* facets of the base type */ bfmininc = NULL, bfmaxinc = NULL, bfminexc = NULL, bfmaxexc = NULL; - int res, err = 0, fixedErr; + int res; /* err = 0, fixedErr; */ /* * SPEC st-restrict-facets 1: @@ -16211,7 +17162,6 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, break; } } - err = 0; /* * length and minLength or maxLength (2.2) + (3.2) */ @@ -16593,8 +17543,8 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt, * Search for a duplicate facet in the current type. */ link = type->facetSet; - err = 0; - fixedErr = 0; + /* err = 0; */ + /* fixedErr = 0; */ while (link != NULL) { facet = link->facet; if (facet->type == bfacet->type) { @@ -16661,14 +17611,18 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt, * The actual value is then formed by replacing any union type * definition in the ·explicit members· with the members of their * {member type definitions}, in order. + * + * TODO: There's a bug entry at + * "http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0287.html" + * which indicates that we'll keep the union types the future. */ link = type->memberTypes; while (link != NULL) { - if (IS_NOT_TYPEFIXED(link->type)) - xmlSchemaTypeFixup(link->type, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(link->type)) + xmlSchemaTypeFixup(link->type, ACTXT_CAST pctxt); - if (VARIETY_UNION(link->type)) { + if (WXS_IS_UNION(link->type)) { subLink = xmlSchemaGetUnionSimpleTypeMemberTypes(link->type); if (subLink != NULL) { link->type = subLink->type; @@ -16740,7 +17694,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) if (has) type->flags |= XML_SCHEMAS_TYPE_HAS_FACETS; - if (has && (! needVal) && VARIETY_ATOMIC(type)) { + if (has && (! needVal) && WXS_IS_ATOMIC(type)) { xmlSchemaTypePtr prim = xmlSchemaGetPrimitiveType(type); /* * OPTIMIZE VAL TODO: Some facets need a computed value. @@ -16760,10 +17714,10 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type) /* * Evaluate the whitespace-facet value. */ - if (VARIETY_LIST(type)) { + if (WXS_IS_LIST(type)) { type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE; return (0); - } else if (VARIETY_UNION(type)) + } else if (WXS_IS_UNION(type)) return (0); if (type->facetSet != NULL) { @@ -16813,7 +17767,6 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type) break; } } - return (0); } return (0); } @@ -16824,11 +17777,11 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, { if (type->type != XML_SCHEMA_TYPE_SIMPLE) return(0); - if (! TYPE_IS_NOT_FIXEDUP_1(type)) + if (! WXS_IS_TYPE_NOT_FIXED_1(type)) return(0); type->flags |= XML_SCHEMAS_TYPE_FIXUP_1; - if (VARIETY_LIST(type)) { + if (WXS_IS_LIST(type)) { /* * Corresponds to ... */ @@ -16840,7 +17793,7 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, "list type has no item-type assigned"); return(-1); } - } else if (VARIETY_UNION(type)) { + } else if (WXS_IS_UNION(type)) { /* * Corresponds to ... */ @@ -16861,7 +17814,7 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, "type has no base-type assigned"); return(-1); } - if (TYPE_IS_NOT_FIXEDUP_1(type->baseType)) + if (WXS_IS_TYPE_NOT_FIXED_1(type->baseType)) if (xmlSchemaFixupSimpleTypeStageOne(pctxt, type->baseType) == -1) return(-1); /* @@ -16869,15 +17822,15 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt, * If the alternative is chosen, then the * {variety} of the {base type definition}. */ - if (VARIETY_ATOMIC(type->baseType)) + if (WXS_IS_ATOMIC(type->baseType)) type->flags |= XML_SCHEMAS_TYPE_VARIETY_ATOMIC; - else if (VARIETY_LIST(type->baseType)) { + else if (WXS_IS_LIST(type->baseType)) { type->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST; /* * Inherit the itemType. */ type->subtypes = type->baseType->subtypes; - } else if (VARIETY_UNION(type->baseType)) { + } else if (WXS_IS_UNION(type->baseType)) { type->flags |= XML_SCHEMAS_TYPE_VARIETY_UNION; /* * NOTE that we won't assign the memberTypes of the base, @@ -16902,7 +17855,7 @@ xmlSchemaDebugFixedType(xmlSchemaParserCtxtPtr pctxt, } else { xmlGenericError(xmlGenericErrorContext, "Type of %s :", name); } - if ((IS_SIMPLE_TYPE(type)) || (IS_COMPLEX_TYPE(type))) { + if ((WXS_IS_SIMPLE(type)) || (WXS_IS_COMPLEX(type))) { switch (type->contentType) { case XML_SCHEMA_CONTENT_SIMPLE: xmlGenericError(xmlGenericErrorContext, "simple\n"); @@ -16954,7 +17907,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, if (type->type != XML_SCHEMA_TYPE_SIMPLE) return(-1); - if (! IS_NOT_TYPEFIXED(type)) + if (! WXS_IS_TYPE_NOT_FIXED(type)) return(0); type->flags |= XML_SCHEMAS_TYPE_INTERNAL_RESOLVED; @@ -16965,11 +17918,13 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt, "missing baseType"); goto exit_failure; } - if (IS_NOT_TYPEFIXED(type->baseType)) - xmlSchemaTypeFixup(type->baseType, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(type->baseType)) + xmlSchemaTypeFixup(type->baseType, ACTXT_CAST pctxt); /* * If a member type of a union is a union itself, we need to substitute * that member type for its member types. + * NOTE that this might change in WXS 1.1; i.e. we will keep the union + * types in WXS 1.1. */ if ((type->memberTypes != NULL) && (xmlSchemaFinishMemberTypeDefinitionsProperty(pctxt, type) == -1)) @@ -17043,19 +17998,19 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, int res = 0, olderrs = pctxt->nberrors; xmlSchemaTypePtr baseType = type->baseType; - if (! IS_NOT_TYPEFIXED(type)) + if (! WXS_IS_TYPE_NOT_FIXED(type)) return(0); type->flags |= XML_SCHEMAS_TYPE_INTERNAL_RESOLVED; if (baseType == NULL) { - PERROR_INT("xmlSchemaFixupSimpleTypeStageTwo", + PERROR_INT("xmlSchemaFixupComplexType", "missing baseType"); goto exit_failure; } /* * Fixup the base type. */ - if (IS_NOT_TYPEFIXED(baseType)) - xmlSchemaTypeFixup(baseType, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(baseType)) + xmlSchemaTypeFixup(baseType, ACTXT_CAST pctxt); if (baseType->flags & XML_SCHEMAS_TYPE_INTERNAL_INVALID) { /* * Skip fixup if the base type is invalid. @@ -17075,7 +18030,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, /* * Corresponds to ... */ - if ((IS_COMPLEX_TYPE(baseType)) && + if ((WXS_IS_COMPLEX(baseType)) && (baseType->contentTypeDef != NULL) && (WXS_IS_RESTRICTION(type))) { xmlSchemaTypePtr contentBase, content; @@ -17117,12 +18072,12 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, #ifdef ENABLE_NAMED_LOCALS snprintf(buf, 29, "#scST%d", ++(pctxt->counter)); tmpname = xmlDictLookup(pctxt->dict, BAD_CAST buf, -1); - content = xmlSchemaAddType(pctxt, - pctxt->schema, tmpname, type->targetNamespace, + content = xmlSchemaAddType(pctxt, pctxt->schema, + XML_SCHEMA_TYPE_SIMPLE, tmpname, type->targetNamespace, type->node, 0); #else - content = xmlSchemaAddType(pctxt, - pctxt->schema, NULL, type->targetNamespace, + content = xmlSchemaAddType(pctxt, pctxt->schema, + XML_SCHEMA_TYPE_SIMPLE, NULL, type->targetNamespace, type->node, 0); #endif if (content == NULL) @@ -17143,8 +18098,8 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, type->facetSet = NULL; type->contentTypeDef = content; - if (IS_NOT_TYPEFIXED(contentBase)) - xmlSchemaTypeFixup(contentBase, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(contentBase)) + xmlSchemaTypeFixup(contentBase, ACTXT_CAST pctxt); /* * Fixup the newly created type. We don't need to check * for circularity here. @@ -17154,7 +18109,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, res = xmlSchemaFixupSimpleTypeStageTwo(pctxt, content); HFAILURE HERROR - } else if ((IS_COMPLEX_TYPE(baseType)) && + } else if ((WXS_IS_COMPLEX(baseType)) && (baseType->contentType == XML_SCHEMA_CONTENT_MIXED) && (WXS_IS_RESTRICTION(type))) { /* @@ -17169,14 +18124,14 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, */ xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_INTERNAL, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "Internal error: xmlSchemaTypeFixup, " "complex type '%s': the " "is missing a child, but was not catched " "by xmlSchemaCheckSRCCT()", type->name); goto exit_failure; } - } else if ((IS_COMPLEX_TYPE(baseType)) && WXS_IS_EXTENSION(type)) { + } else if ((WXS_IS_COMPLEX(baseType)) && WXS_IS_EXTENSION(type)) { /* * SPEC (3) If + base is with * content, "...then the {content type} of that @@ -17189,7 +18144,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, */ xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_INTERNAL, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "Internal error: xmlSchemaTypeFixup, " "complex type '%s': the ed base type is " "a complex type with no simple content type", @@ -17197,7 +18152,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, goto exit_failure; } type->contentTypeDef = baseType->contentTypeDef; - } else if ((IS_SIMPLE_TYPE(baseType)) && WXS_IS_EXTENSION(type)) { + } else if ((WXS_IS_SIMPLE(baseType)) && WXS_IS_EXTENSION(type)) { /* * SPEC (4) + base is * "... then that simple type definition" @@ -17209,7 +18164,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, */ xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_INTERNAL, - NULL, type, NULL, + WXS_BASIC_CAST type, NULL, "Internal error: xmlSchemaTypeFixup, " "complex type '%s' with : unhandled " "derivation case", type->name); @@ -17257,7 +18212,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, goto exit_failure; /* * Create the model group. - */ + */ /* URGENT TODO: avoid adding to pending items. */ particle->children = (xmlSchemaTreeItemPtr) xmlSchemaAddModelGroup(pctxt, pctxt->schema, XML_SCHEMA_TYPE_SEQUENCE, type->node); @@ -17322,7 +18277,47 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, * "A model group whose {compositor} is sequence and whose * {particles} are..." */ - if (! dummySequence) { + if ((WXS_TYPE_PARTICLE(type) != NULL) && + (WXS_TYPE_PARTICLE_TERM(type) != NULL) && + ((WXS_TYPE_PARTICLE_TERM(type))->type == + XML_SCHEMA_TYPE_ALL)) + { + /* + * SPEC cos-all-limited (1) + */ + xmlSchemaCustomErr(ACTXT_CAST pctxt, + /* TODO: error code */ + XML_SCHEMAP_COS_ALL_LIMITED, + WXS_ITEM_NODE(type), NULL, + "The type has an 'all' model group in its " + "{content type} and thus cannot be derived from " + "a non-empty type, since this would produce a " + "'sequence' model group containing the 'all' " + "model group; 'all' model groups are not " + "allowed to appear inside other model groups", + NULL, NULL); + + } else if ((WXS_TYPE_PARTICLE(baseType) != NULL) && + (WXS_TYPE_PARTICLE_TERM(baseType) != NULL) && + ((WXS_TYPE_PARTICLE_TERM(baseType))->type == + XML_SCHEMA_TYPE_ALL)) + { + /* + * SPEC cos-all-limited (1) + */ + xmlSchemaCustomErr(ACTXT_CAST pctxt, + /* TODO: error code */ + XML_SCHEMAP_COS_ALL_LIMITED, + WXS_ITEM_NODE(type), NULL, + "A type cannot be derived by extension from a type " + "which has an 'all' model group in its " + "{content type}, since this would produce a " + "'sequence' model group containing the 'all' " + "model group; 'all' model groups are not " + "allowed to appear inside other model groups", + NULL, NULL); + + } else if (! dummySequence) { xmlSchemaTreeItemPtr effectiveContent = (xmlSchemaTreeItemPtr) type->subtypes; /* @@ -17340,7 +18335,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, XML_SCHEMA_TYPE_SEQUENCE, type->node); if (particle->children == NULL) goto exit_failure; - type->subtypes = (xmlSchemaTypePtr) particle; + WXS_TYPE_CONTENTTYPE(type) = (xmlSchemaTypePtr) particle; /* * SPEC "the particle of the {content type} of * the ... base ..." @@ -17362,6 +18357,16 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, * SPEC "followed by the ·effective content·." */ particle->next = effectiveContent; + /* + * This all will result in: + * new-particle + * --> new-sequence( + * new-particle + * --> base-model, + * this-particle + * --> this-model + * ) + */ } else { /* * This is the case when there is already an empty @@ -17379,16 +18384,21 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, } } /* - * Apply the complex type component constraints; this will not - * check attributes, since this is done in - * xmlSchemaBuildAttributeValidation(). + * Now fixup attribute uses: + * - expand attr. group references + * - intersect attribute wildcards + * - inherit attribute uses of the base type + * - inherit or union attr. wildcards if extending + * - apply attr. use prohibitions if restricting */ - res = xmlSchemaCheckCTComponent(pctxt, type); + res = xmlSchemaFixupTypeAttributeUses(pctxt, type); HFAILURE HERROR /* - * Inherit & check constraints for attributes. + * Apply the complex type component constraints; this will not + * check attributes, since this is done in + * xmlSchemaFixupTypeAttributeUses(). */ - res = xmlSchemaBuildAttributeValidation(pctxt, type); + res = xmlSchemaCheckCTComponent(pctxt, type); HFAILURE HERROR #ifdef DEBUG_TYPE @@ -17425,16 +18435,21 @@ exit_failure: */ static int xmlSchemaTypeFixup(xmlSchemaTypePtr type, - xmlSchemaParserCtxtPtr pctxt) + xmlSchemaAbstractCtxtPtr actxt) { if (type == NULL) return(0); - if (! IS_NOT_TYPEFIXED(type)) + if (actxt->type != XML_SCHEMA_CTXT_PARSER) { + AERROR_INT("xmlSchemaTypeFixup", + "this function needs a parser context"); + return(-1); + } + if (! WXS_IS_TYPE_NOT_FIXED(type)) return(0); if (type->type == XML_SCHEMA_TYPE_COMPLEX) - return(xmlSchemaFixupComplexType(pctxt, type)); + return(xmlSchemaFixupComplexType(PCTXT_CAST actxt, type)); else if (type->type == XML_SCHEMA_TYPE_SIMPLE) - return(xmlSchemaFixupSimpleTypeStageTwo(pctxt, type)); + return(xmlSchemaFixupSimpleTypeStageTwo(PCTXT_CAST actxt, type)); return(0); } @@ -17546,7 +18561,7 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, xmlChar *str = NULL; xmlSchemaCustomErr(ACTXT_CAST pctxt, - ret, facet->node, (xmlSchemaTypePtr) facet, + ret, facet->node, WXS_BASIC_CAST facet, "The value '%s' of the facet does not validate " "against the base type '%s'", facet->value, @@ -17571,7 +18586,7 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, /* No error message for RelaxNG. */ if (ctxtGiven) { xmlSchemaCustomErr(ACTXT_CAST pctxt, - ret, facet->node, typeDecl, + ret, facet->node, WXS_BASIC_CAST typeDecl, "The value '%s' of the facet 'pattern' is not a " "valid regular expression", facet->value, NULL); @@ -17582,33 +18597,43 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, case XML_SCHEMA_FACET_FRACTIONDIGITS: case XML_SCHEMA_FACET_LENGTH: case XML_SCHEMA_FACET_MAXLENGTH: - case XML_SCHEMA_FACET_MINLENGTH:{ + case XML_SCHEMA_FACET_MINLENGTH: + + if (facet->type == XML_SCHEMA_FACET_TOTALDIGITS) { + ret = xmlSchemaValidatePredefinedType( + xmlSchemaGetBuiltInType(XML_SCHEMAS_PINTEGER), + facet->value, &(facet->val)); + } else { ret = xmlSchemaValidatePredefinedType( xmlSchemaGetBuiltInType(XML_SCHEMAS_NNINTEGER), facet->value, &(facet->val)); - if (ret != 0) { - if (ret < 0) { - /* No error message for RelaxNG. */ - if (ctxtGiven) { - PERROR_INT("xmlSchemaCheckFacet", - "validating facet value"); - } - goto internal_error; - } - ret = XML_SCHEMAP_INVALID_FACET_VALUE; + } + if (ret != 0) { + if (ret < 0) { /* No error message for RelaxNG. */ if (ctxtGiven) { - /* error code */ - xmlSchemaCustomErr(ACTXT_CAST pctxt, - ret, facet->node, typeDecl, - "The value '%s' of the facet '%s' is not a valid " - "'nonNegativeInteger'", - facet->value, - xmlSchemaFacetTypeToString(facet->type)); - } - } - break; - } + PERROR_INT("xmlSchemaCheckFacet", + "validating facet value"); + } + goto internal_error; + } + ret = XML_SCHEMAP_INVALID_FACET_VALUE; + /* No error message for RelaxNG. */ + if (ctxtGiven) { + /* error code */ + xmlSchemaCustomErr4(ACTXT_CAST pctxt, + ret, facet->node, WXS_BASIC_CAST typeDecl, + "The value '%s' of the facet '%s' is not a valid '%s'", + facet->value, + xmlSchemaFacetTypeToString(facet->type), + (facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ? + BAD_CAST "nonNegativeInteger" : + BAD_CAST "positiveInteger", + NULL); + } + } + break; + case XML_SCHEMA_FACET_WHITESPACE:{ if (xmlStrEqual(facet->value, BAD_CAST "preserve")) { facet->whitespace = XML_SCHEMAS_FACET_PRESERVE; @@ -17622,7 +18647,7 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, if (ctxtGiven) { /* error was previously: XML_SCHEMAP_INVALID_WHITE_SPACE */ xmlSchemaCustomErr(ACTXT_CAST pctxt, - ret, facet->node, typeDecl, + ret, facet->node, WXS_BASIC_CAST typeDecl, "The value '%s' of the facet 'whitespace' is not " "valid", facet->value, NULL); } @@ -17779,7 +18804,7 @@ xmlSchemaCheckGroupDefCircular(xmlSchemaModelGroupDefPtr item, */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_MG_PROPS_CORRECT_2, - NULL, NULL, GET_NODE(circ), + NULL, WXS_ITEM_NODE(circ), "Circular reference to the model group definition '%s' " "defined", xmlSchemaFormatQName(&str, item->targetNamespace, item->name)); @@ -17794,114 +18819,115 @@ xmlSchemaCheckGroupDefCircular(xmlSchemaModelGroupDefPtr item, } /** - * xmlSchemaGroupDefReferenceTermFixup: - * @item: the particle with a model group definition as term + * xmlSchemaModelGroupToModelGroupDefFixup: * @ctxt: the parser context - * @name: the name - * - * Checks cos-all-limited. + * @mg: the model group * * Assigns the model group of model group definitions to the "term" * of the referencing particle. - * In xmlSchemaResolveParticleReferences the model group definitions was assigned - * to the "term", since needed for the circularity check. + * In xmlSchemaResolveModelGroupParticleReferences the model group + * definitions were assigned to the "term", since needed for the + * circularity check. + * + * Schema Component Constraint: + * All Group Limited (cos-all-limited) (1.2) */ static void -xmlSchemaGroupDefReferenceTermFixup(xmlSchemaParticlePtr item, - xmlSchemaParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED) +xmlSchemaModelGroupToModelGroupDefFixup( + xmlSchemaParserCtxtPtr ctxt ATTRIBUTE_UNUSED, + xmlSchemaModelGroupPtr mg) { - if ((item == NULL) || - (item->type != XML_SCHEMA_TYPE_PARTICLE) || - (item->children == NULL) || - (item->children->type != XML_SCHEMA_TYPE_GROUP) || - (item->children->children == NULL)) - return; - item->children = item->children->children; - /* - * TODO: Not nice, but we will anchor cos-all-limited here. - */ - if ((item->children->type == XML_SCHEMA_TYPE_ALL) && - (item->maxOccurs != 1)) { + xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg); + + while (particle != NULL) { + if ((WXS_PARTICLE_TERM(particle) == NULL) || + ((WXS_PARTICLE_TERM(particle))->type != + XML_SCHEMA_TYPE_GROUP)) + { + particle = WXS_PTC_CAST particle->next; + continue; + } + if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) { + /* + * TODO: Remove the particle. + */ + WXS_PARTICLE_TERM(particle) = NULL; + particle = WXS_PTC_CAST particle->next; + continue; + } /* - * SPEC (1.2) "the {term} property of a particle with - * {max occurs}=1which is part of a pair which constitutes the - * {content type} of a complex type definition." + * Assign the model group to the {term} of the particle. */ - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, - NULL, (xmlSchemaTypePtr) item, item->node, - "The particle's 'maxOccurs' must be 1, since an xs:all model " - "group is its term", NULL); + WXS_PARTICLE_TERM(particle) = + WXS_TREE_CAST WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)); + + particle = WXS_PTC_CAST particle->next; } } /** - * xmlSchemaGetCircAttrGrRef: + * xmlSchemaCheckAttrGroupCircularRecur: * @ctxtGr: the searched attribute group * @attr: the current attribute list to be processed * * This one is intended to be used by - * xmlSchemaCheckSRCAttributeGroupCircular only. + * xmlSchemaCheckAttrGroupCircular only. * * Returns the circular attribute grou reference, otherwise NULL. */ -static xmlSchemaAttributeGroupPtr -xmlSchemaGetCircAttrGrRef(xmlSchemaAttributeGroupPtr ctxtGr, - xmlSchemaAttributePtr attr) +static xmlSchemaQNameRefPtr +xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr, + xmlSchemaItemListPtr list) { - xmlSchemaAttributeGroupPtr circ = NULL, gr; - int marked; + xmlSchemaAttributeGroupPtr gr; + xmlSchemaQNameRefPtr ref, circ; + int i; /* * We will search for an attribute group reference which * references the context attribute group. */ - while (attr != NULL) { - marked = 0; - if (attr->type == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) { - gr = (xmlSchemaAttributeGroupPtr) attr; - if (gr->refItem != NULL) { - if (gr->refItem == ctxtGr) - return (gr); - else if (gr->refItem->flags & - XML_SCHEMAS_ATTRGROUP_MARKED) { - attr = attr->next; - continue; - } else { - /* - * Mark as visited to avoid infinite recursion on - * circular references not yet examined. - */ - gr->refItem->flags |= XML_SCHEMAS_ATTRGROUP_MARKED; - marked = 1; - } - } - if (gr->attributes != NULL) - circ = xmlSchemaGetCircAttrGrRef(ctxtGr, gr->attributes); + for (i = 0; i < list->nbItems; i++) { + ref = list->items[i]; + if ((ref->type == XML_SCHEMA_EXTRA_QNAMEREF) && + (ref->itemType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) && + (ref->item != NULL)) + { + gr = WXS_ATTR_GROUP_CAST ref->item; + if (gr == ctxtGr) + return(ref); + if (gr->flags & XML_SCHEMAS_ATTRGROUP_MARKED) + continue; /* - * Unmark the visited group's attributes. + * Mark as visited to avoid infinite recursion on + * circular references not yet examined. */ - if (marked) - gr->refItem->flags ^= XML_SCHEMAS_ATTRGROUP_MARKED; - if (circ != NULL) - return (circ); + if ((gr->attrUses) && + (gr->flags & XML_SCHEMAS_ATTRGROUP_HAS_REFS)) + { + gr->flags |= XML_SCHEMAS_ATTRGROUP_MARKED; + circ = xmlSchemaCheckAttrGroupCircularRecur(ctxtGr, + (xmlSchemaItemListPtr) gr->attrUses); + gr->flags ^= XML_SCHEMAS_ATTRGROUP_MARKED; + if (circ != NULL) + return (circ); + } + } - attr = attr->next; } return (NULL); } /** - * xmlSchemaCheckSRCAttributeGroupCircular: + * xmlSchemaCheckAttrGroupCircular: * attrGr: the attribute group definition * @ctxt: the parser context * @name: the name * * Checks for circular references of attribute groups. */ -static void +static int xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr, - xmlSchemaParserCtxtPtr ctxt) + xmlSchemaParserCtxtPtr ctxt) { /* * Schema Representation Constraint: @@ -17917,34 +18943,341 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr, * it must not be the case that a ·QName· is encountered at any depth * which resolves to the component corresponding to this . */ - /* - * Only global components can be referenced. - */ - if (((attrGr->flags & XML_SCHEMAS_ATTRGROUP_GLOBAL) == 0) || - (attrGr->attributes == NULL)) - return; + if (attrGr->attrUses == NULL) + return(0); + else if ((attrGr->flags & XML_SCHEMAS_ATTRGROUP_HAS_REFS) == 0) + return(0); else { - xmlSchemaAttributeGroupPtr circ; - - circ = xmlSchemaGetCircAttrGrRef(attrGr, attrGr->attributes); + xmlSchemaQNameRefPtr circ; + + circ = xmlSchemaCheckAttrGroupCircularRecur(attrGr, + (xmlSchemaItemListPtr) attrGr->attrUses); if (circ != NULL) { + xmlChar *str = NULL; /* * TODO: Report the referenced attr group as QName. */ xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, - NULL, NULL, circ->node, + NULL, WXS_ITEM_NODE(WXS_BASIC_CAST circ), "Circular reference to the attribute group '%s' " - "defined", attrGr->name); + "defined", xmlSchemaGetComponentQName(&str, attrGr)); + FREE_AND_NULL(str); /* * NOTE: We will cut the reference to avoid further * confusion of the processor. - * BADSPEC: The spec should define how to process in this case. + * BADSPEC TODO: The spec should define how to process in this case. + */ + circ->item = NULL; + return(ctxt->err); + } + } + return(0); +} + +static int +xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaAttributeGroupPtr attrGr); + +/** + * xmlSchemaExpandAttributeGroupRefs: + * @pctxt: the parser context + * @node: the node of the component holding the attribute uses + * @completeWild: the intersected wildcard to be returned + * @list: the attribute uses + * + * Substitutes contained attribute group references + * for their attribute uses. Wilcards are intersected. + * Attribute use prohibitions are removed from the list + * and returned via the @prohibs list. + * Pointlessness of attr. prohibs, if a matching attr. decl + * is existent a well, are checked. + */ +static int +xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaBasicItemPtr item, + xmlSchemaWildcardPtr *completeWild, + xmlSchemaItemListPtr list, + xmlSchemaItemListPtr prohibs) +{ + xmlSchemaAttributeGroupPtr gr; + xmlSchemaAttributeUsePtr use; + xmlSchemaItemListPtr sublist; + int i, j; + int created = (*completeWild == NULL) ? 0 : 1; + + if (prohibs) + prohibs->nbItems = 0; + + for (i = 0; i < list->nbItems; i++) { + use = list->items[i]; + + if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) { + if (prohibs == NULL) { + PERROR_INT("xmlSchemaExpandAttributeGroupRefs", + "unexpected attr prohibition found"); + return(-1); + } + /* + * Remove from attribute uses. + */ + if (xmlSchemaItemListRemove(list, i) == -1) + return(-1); + i--; + /* + * Note that duplicate prohibitions were already + * handled at parsing time. + */ + /* + * Add to list of prohibitions. + */ + xmlSchemaItemListAddSize(prohibs, 2, use); + continue; + } + if ((use->type == XML_SCHEMA_EXTRA_QNAMEREF) && + ((WXS_QNAME_CAST use)->itemType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP)) + { + if ((WXS_QNAME_CAST use)->item == NULL) + return(-1); + gr = WXS_ATTR_GROUP_CAST (WXS_QNAME_CAST use)->item; + /* + * Expand the referenced attr. group. + * TODO: remove this, this is done in a previous step, so + * already done here. + */ + if ((gr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED) == 0) { + if (xmlSchemaAttributeGroupExpandRefs(pctxt, gr) == -1) + return(-1); + } + /* + * Build the 'complete' wildcard; i.e. intersect multiple + * wildcards. + */ + if (gr->attributeWildcard != NULL) { + if (*completeWild == NULL) { + *completeWild = gr->attributeWildcard; + } else { + if (! created) { + xmlSchemaWildcardPtr tmpWild; + + /* + * Copy the first encountered wildcard as context, + * except for the annotation. + * + * Although the complete wildcard might not correspond + * to any node in the schema, we will anchor it on + * the node of the owner component. + */ + tmpWild = xmlSchemaAddWildcard(pctxt, pctxt->schema, + XML_SCHEMA_TYPE_ANY_ATTRIBUTE, + WXS_ITEM_NODE(item)); + if (tmpWild == NULL) + return(-1); + if (xmlSchemaCloneWildcardNsConstraints(pctxt, + tmpWild, *completeWild) == -1) + return (-1); + tmpWild->processContents = (*completeWild)->processContents; + *completeWild = tmpWild; + created = 1; + } + + if (xmlSchemaIntersectWildcards(pctxt, *completeWild, + gr->attributeWildcard) == -1) + return(-1); + } + } + /* + * Just remove the reference if the referenced group does not + * contain any attribute uses. + */ + if (gr->attrUses == NULL) { + if (xmlSchemaItemListRemove(list, i) == -1) + return(-1); + i--; + continue; + } + /* + * Add the attribute uses. + */ + sublist = ((xmlSchemaItemListPtr) gr->attrUses); + if (sublist->nbItems != 0) { + list->items[i] = sublist->items[0]; + if (sublist->nbItems != 1) { + for (j = 1; j < sublist->nbItems; j++) { + i++; + if (xmlSchemaItemListInsert(list, + sublist->items[j], i) == -1) + return(-1); + } + } + } + } + + } + /* + * Handle pointless prohibitions of declared attributes. + */ + if (prohibs && (prohibs->nbItems != 0) && (list->nbItems != 0)) { + xmlSchemaAttributeUseProhibPtr prohib; + + for (i = prohibs->nbItems -1; i >= 0; i--) { + prohib = prohibs->items[i]; + for (j = 0; j < list->nbItems; j++) { + use = list->items[j]; + + if ((prohib->name == WXS_ATTRUSE_DECL_NAME(use)) && + (prohib->targetNamespace == WXS_ATTRUSE_DECL_TNS(use))) + { + xmlChar *str = NULL; + + xmlSchemaCustomWarning(ACTXT_CAST pctxt, + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, + prohib->node, NULL, + "Skipping pointless attribute use prohibition " + "'%s', since a corresponding attribute use " + "exists already in the type definition", + xmlSchemaFormatQName(&str, + prohib->targetNamespace, prohib->name), + NULL, NULL); + FREE_AND_NULL(str); + /* + * Remove the prohibition. + */ + if (xmlSchemaItemListRemove(prohibs, i) == -1) + return(-1); + break; + } + } + } + } + return(0); +} + +/** + * xmlSchemaAttributeGroupExpandRefs: + * @pctxt: the parser context + * @attrGr: the attribute group definition + * + * Computation of: + * {attribute uses} property + * {attribute wildcard} property + * + * Substitutes contained attribute group references + * for their attribute uses. Wilcards are intersected. + */ +static int +xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaAttributeGroupPtr attrGr) +{ + if ((attrGr->attrUses == NULL) || + (attrGr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED)) + return(0); + + attrGr->flags |= XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED; + if (xmlSchemaExpandAttributeGroupRefs(pctxt, WXS_BASIC_CAST attrGr, + &(attrGr->attributeWildcard), attrGr->attrUses, NULL) == -1) + return(-1); + return(0); +} + +/** + * xmlSchemaAttributeGroupExpandRefs: + * @pctxt: the parser context + * @attrGr: the attribute group definition + * + * Substitutes contained attribute group references + * for their attribute uses. Wilcards are intersected. + * + * Schema Component Constraint: + * Attribute Group Definition Properties Correct (ag-props-correct) + */ +static int +xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaAttributeGroupPtr attrGr) +{ + /* + * SPEC ag-props-correct + * (1) "The values of the properties of an attribute group definition + * must be as described in the property tableau in The Attribute + * Group Definition Schema Component (§3.6.1), modulo the impact of + * Missing Sub-components (§5.3);" + */ + + if ((attrGr->attrUses != NULL) && + (WXS_LIST_CAST attrGr->attrUses)->nbItems > 1) + { + xmlSchemaItemListPtr uses = WXS_LIST_CAST attrGr->attrUses; + xmlSchemaAttributeUsePtr use, tmp; + int i, j, hasId = 0; + + for (i = uses->nbItems -1; i >= 0; i--) { + use = uses->items[i]; + /* + * SPEC ag-props-correct + * (2) "Two distinct members of the {attribute uses} must not have + * {attribute declaration}s both of whose {name}s match and whose + * {target namespace}s are identical." + */ + if (i > 0) { + for (j = i -1; j >= 0; j--) { + tmp = uses->items[j]; + if ((WXS_ATTRUSE_DECL_NAME(use) == + WXS_ATTRUSE_DECL_NAME(tmp)) && + (WXS_ATTRUSE_DECL_TNS(use) == + WXS_ATTRUSE_DECL_TNS(tmp))) + { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_AG_PROPS_CORRECT, + attrGr->node, WXS_BASIC_CAST attrGr, + "Duplicate %s", + xmlSchemaGetComponentDesignation(&str, use), + NULL); + FREE_AND_NULL(str); + /* + * Remove the duplicate. + */ + if (xmlSchemaItemListRemove(uses, i) == -1) + return(-1); + goto next_use; + } + } + } + /* + * SPEC ag-props-correct + * (3) "Two distinct members of the {attribute uses} must not have + * {attribute declaration}s both of whose {type definition}s are or + * are derived from ID." + * TODO: Does 'derived' include member-types of unions? */ - circ->attributes = NULL; - circ->refItem = NULL; + if (WXS_ATTRUSE_TYPEDEF(use) != NULL) { + if (xmlSchemaIsDerivedFromBuiltInType( + WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID)) + { + if (hasId) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_AG_PROPS_CORRECT, + attrGr->node, WXS_BASIC_CAST attrGr, + "There must not exist more than one attribute " + "declaration of type 'xs:ID' " + "(or derived from 'xs:ID'). The %s violates this " + "constraint", + xmlSchemaGetComponentDesignation(&str, use), + NULL); + FREE_AND_NULL(str); + if (xmlSchemaItemListRemove(uses, i) == -1) + return(-1); + } + hasId = 1; + } + } +next_use: {} } } + return(0); } /** @@ -17953,88 +19286,108 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr, * @ctxt: the schema parser context * @name: the attribute name * - * Fixes finish doing the computations on the attributes definitions + * Resolves references to attribute group definitions. */ -static void -xmlSchemaResolveAttrGroupReferences(xmlSchemaAttributeGroupPtr attrgrp, - xmlSchemaParserCtxtPtr ctxt, const xmlChar * name) +static int +xmlSchemaResolveAttrGroupReferences(xmlSchemaQNameRefPtr ref, + xmlSchemaParserCtxtPtr ctxt) { - if (name == NULL) - name = attrgrp->name; - if (attrgrp->attributes != NULL) - return; - if (attrgrp->ref != NULL) { - xmlSchemaAttributeGroupPtr ref; + xmlSchemaAttributeGroupPtr group; - ref = xmlSchemaGetAttributeGroup(ctxt->schema, attrgrp->ref, - attrgrp->refNs); - if (ref == NULL) { - xmlSchemaPResCompAttrErr(ctxt, - XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) attrgrp, attrgrp->node, - "ref", attrgrp->ref, attrgrp->refNs, - XML_SCHEMA_TYPE_ATTRIBUTEGROUP, NULL); - return; - } - attrgrp->refItem = ref; - /* - * URGENT TODO: Do we need to resolve refs of the - * referenced attr. group itself first? I don't think so. - * If we need this, then check for circularity first! - * REMOVED: xmlSchemaResolveAttrGroupReferences(ref, ctxt, NULL); - */ - attrgrp->attributes = ref->attributes; - attrgrp->attributeWildcard = ref->attributeWildcard; - } + if (ref->item != NULL) + return(0); + group = xmlSchemaGetAttributeGroup(ctxt->schema, + ref->name, + ref->targetNamespace); + if (group == NULL) { + xmlSchemaPResCompAttrErr(ctxt, + XML_SCHEMAP_SRC_RESOLVE, + NULL, ref->node, + "ref", ref->name, ref->targetNamespace, + ref->itemType, NULL); + return(ctxt->err); + } + ref->item = WXS_BASIC_CAST group; + return(0); } /** - * xmlSchemaAttrCheckValConstr: + * xmlSchemaCheckAttrPropsCorrect: * @item: an schema attribute declaration/use * @ctxt: a schema parser context * @name: the name of the attribute * * - * Schema Component Constraint: Attribute Declaration Properties Correct - * (a-props-correct) - * Validates the value constraints of an attribute declaration/use. + * Schema Component Constraint: + * Attribute Declaration Properties Correct (a-props-correct) * - * Fixes finish doing the computations on the attributes definitions + * Validates the value constraints of an attribute declaration/use. + * NOTE that this needs the simle type definitions to be already + * builded and checked. */ -static void -xmlSchemaCheckAttrValConstr(xmlSchemaAttributePtr item, - xmlSchemaParserCtxtPtr pctxt) +static int +xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaAttributePtr attr) { /* - * 2 if there is a {value constraint}, the canonical lexical - * representation of its value must be ·valid· with respect - * to the {type definition} as defined in String Valid (§3.14.4). + * SPEC a-props-correct (1) + * "The values of the properties of an attribute declaration must + * be as described in the property tableau in The Attribute + * Declaration Schema Component (§3.2.1), modulo the impact of + * Missing Sub-components (§5.3)." */ - if (item->defValue != NULL) { + + if (WXS_ATTR_TYPEDEF(attr) == NULL) + return(0); + + if (attr->defValue != NULL) { int ret; - if (item->subtypes == NULL) { - PERROR_INT("xmlSchemaCheckAttrValConstr", - "type is missing"); - return; + /* + * SPEC a-props-correct (3) + * "If the {type definition} is or is derived from ID then there + * must not be a {value constraint}." + */ + if (xmlSchemaIsDerivedFromBuiltInType( + WXS_ATTR_TYPEDEF(attr), XML_SCHEMAS_ID)) + { + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_A_PROPS_CORRECT_3, + NULL, WXS_BASIC_CAST attr, + "Value constraints are not allowed if the type definition " + "is or is derived from xs:ID", + NULL, NULL); + return(pctxt->err); } + /* + * SPEC a-props-correct (2) + * "if there is a {value constraint}, the canonical lexical + * representation of its value must be ·valid· with respect + * to the {type definition} as defined in String Valid (§3.14.4)." + * TODO: Don't care about the *cononical* stuff here, this requirement + * will be removed in WXS 1.1 anyway. + */ ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, - item->node, item->subtypes, item->defValue, &(item->defVal), + attr->node, WXS_ATTR_TYPEDEF(attr), + attr->defValue, &(attr->defVal), 1, 1, 0); if (ret != 0) { if (ret < 0) { - PERROR_INT("xmlSchemaAttrCheckValConstr", + PERROR_INT("xmlSchemaCheckAttrPropsCorrect", "calling xmlSchemaVCheckCVCSimpleType()"); - return; + return(-1); } - ret = XML_SCHEMAP_A_PROPS_CORRECT_2; xmlSchemaCustomErr(ACTXT_CAST pctxt, - ret, item->node, (xmlSchemaTypePtr) item, - "The value of the value constraint is not valid", NULL, NULL); - return; + XML_SCHEMAP_A_PROPS_CORRECT_2, + NULL, WXS_BASIC_CAST attr, + "The value of the value constraint is not valid", + NULL, NULL); + return(pctxt->err); } } + + return(0); } static xmlSchemaElementPtr @@ -18043,17 +19396,17 @@ xmlSchemaCheckSubstGroupCircular(xmlSchemaElementPtr elemDecl, { xmlSchemaElementPtr ret; - if (SUBST_GROUP_AFF(ancestor) == NULL) + if (WXS_SUBST_HEAD(ancestor) == NULL) return (NULL); - if (SUBST_GROUP_AFF(ancestor) == elemDecl) + if (WXS_SUBST_HEAD(ancestor) == elemDecl) return (ancestor); - if (SUBST_GROUP_AFF(ancestor)->flags & XML_SCHEMAS_ELEM_CIRCULAR) + if (WXS_SUBST_HEAD(ancestor)->flags & XML_SCHEMAS_ELEM_CIRCULAR) return (NULL); - SUBST_GROUP_AFF(ancestor)->flags |= XML_SCHEMAS_ELEM_CIRCULAR; + WXS_SUBST_HEAD(ancestor)->flags |= XML_SCHEMAS_ELEM_CIRCULAR; ret = xmlSchemaCheckSubstGroupCircular(elemDecl, - SUBST_GROUP_AFF(ancestor)); - SUBST_GROUP_AFF(ancestor)->flags ^= XML_SCHEMAS_ELEM_CIRCULAR; + WXS_SUBST_HEAD(ancestor)); + WXS_SUBST_HEAD(ancestor)->flags ^= XML_SCHEMAS_ELEM_CIRCULAR; return (ret); } @@ -18075,15 +19428,15 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, xmlSchemaElementPtr elemDecl) { int ret = 0; - xmlSchemaTypePtr typeDef = ELEM_TYPE(elemDecl); + xmlSchemaTypePtr typeDef = WXS_ELEM_TYPEDEF(elemDecl); /* * SPEC (1) "The values of the properties of an element declaration * must be as described in the property tableau in The Element * Declaration Schema Component (§3.3.1), modulo the impact of Missing * Sub-components (§5.3)." */ - if (SUBST_GROUP_AFF(elemDecl) != NULL) { - xmlSchemaElementPtr head = SUBST_GROUP_AFF(elemDecl), circ; + if (WXS_SUBST_HEAD(elemDecl) != NULL) { + xmlSchemaElementPtr head = WXS_SUBST_HEAD(elemDecl), circ; xmlSchemaCheckElementDeclComponent(head, pctxt); /* @@ -18093,7 +19446,7 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, if ((elemDecl->flags & XML_SCHEMAS_ELEM_GLOBAL) == 0) { xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_E_PROPS_CORRECT_3, - NULL, (xmlSchemaTypePtr) elemDecl, elemDecl->node, + WXS_BASIC_CAST elemDecl, NULL, "Only global element declarations can have a " "substitution group affiliation", NULL); ret = XML_SCHEMAP_E_PROPS_CORRECT_3; @@ -18106,7 +19459,7 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, */ if (head == elemDecl) circ = head; - else if (SUBST_GROUP_AFF(head) != NULL) + else if (WXS_SUBST_HEAD(head) != NULL) circ = xmlSchemaCheckSubstGroupCircular(head, head); else circ = NULL; @@ -18115,7 +19468,7 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPCustomErrExt(pctxt, XML_SCHEMAP_E_PROPS_CORRECT_6, - NULL, (xmlSchemaTypePtr) circ, circ->node, + WXS_BASIC_CAST circ, NULL, "The element declaration '%s' defines a circular " "substitution group to element declaration '%s'", xmlSchemaGetComponentQName(&strA, circ), @@ -18140,7 +19493,7 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * attribute "final". */ - if (typeDef != ELEM_TYPE(SUBST_GROUP_AFF(elemDecl))) { + if (typeDef != WXS_ELEM_TYPEDEF(WXS_SUBST_HEAD(elemDecl))) { int set = 0; if (head->flags & XML_SCHEMAS_ELEM_FINAL_EXTENSION) @@ -18148,21 +19501,21 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, if (head->flags & XML_SCHEMAS_ELEM_FINAL_RESTRICTION) set |= SUBSET_RESTRICTION; - if (xmlSchemaCheckCOSDerivedOK(typeDef, - ELEM_TYPE(head), set) != 0) { + if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST pctxt, typeDef, + WXS_ELEM_TYPEDEF(head), set) != 0) { xmlChar *strA = NULL, *strB = NULL, *strC = NULL; ret = XML_SCHEMAP_E_PROPS_CORRECT_4; xmlSchemaPCustomErrExt(pctxt, XML_SCHEMAP_E_PROPS_CORRECT_4, - NULL, (xmlSchemaTypePtr) elemDecl, elemDecl->node, + WXS_BASIC_CAST elemDecl, NULL, "The type definition '%s' was " "either rejected by the substitution group " "affiliation '%s', or not validly derived from its type " "definition '%s'", xmlSchemaGetComponentQName(&strA, typeDef), xmlSchemaGetComponentQName(&strB, head), - xmlSchemaGetComponentQName(&strC, ELEM_TYPE(head))); + xmlSchemaGetComponentQName(&strC, WXS_ELEM_TYPEDEF(head))); FREE_AND_NULL(strA) FREE_AND_NULL(strB) FREE_AND_NULL(strC) @@ -18177,17 +19530,17 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt, * XML 1.0, and should be avoided if backwards compatibility is desired" */ if ((elemDecl->value != NULL) && - ((IS_SIMPLE_TYPE(typeDef) && + ((WXS_IS_SIMPLE(typeDef) && xmlSchemaIsDerivedFromBuiltInType(typeDef, XML_SCHEMAS_ID)) || - (IS_COMPLEX_TYPE(typeDef) && - HAS_SIMPLE_CONTENT(typeDef) && + (WXS_IS_COMPLEX(typeDef) && + WXS_HAS_SIMPLE_CONTENT(typeDef) && xmlSchemaIsDerivedFromBuiltInType(typeDef->contentTypeDef, XML_SCHEMAS_ID)))) { ret = XML_SCHEMAP_E_PROPS_CORRECT_5; xmlSchemaPCustomErr(pctxt, XML_SCHEMAP_E_PROPS_CORRECT_5, - NULL, (xmlSchemaTypePtr) elemDecl, elemDecl->node, + WXS_BASIC_CAST elemDecl, NULL, "The type definition (or type definition's content type) is or " "is derived from ID; value constraints are not allowed in " "conjunction with such a type definition", NULL); @@ -18256,7 +19609,7 @@ static void xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaElementPtr elemDecl) { - if ((SUBST_GROUP_AFF(elemDecl) == NULL) || + if ((WXS_SUBST_HEAD(elemDecl) == NULL) || /* SPEC (1) "Its {abstract} is false." */ (elemDecl->flags & XML_SCHEMAS_ELEM_ABSTRACT)) return; @@ -18269,8 +19622,8 @@ xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt, * {disallowed substitutions} as the blocking constraint, as defined in * Substitution Group OK (Transitive) (§3.3.6)." */ - for (head = SUBST_GROUP_AFF(elemDecl); head != NULL; - head = SUBST_GROUP_AFF(head)) { + for (head = WXS_SUBST_HEAD(elemDecl); head != NULL; + head = WXS_SUBST_HEAD(head)) { set = 0; methSet = 0; /* @@ -18321,7 +19674,7 @@ xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt, */ type = elemDecl->subtypes->baseType; while (type != NULL) { - if (IS_COMPLEX_TYPE(type)) { + if (WXS_IS_COMPLEX(type)) { if ((type->flags & XML_SCHEMAS_TYPE_BLOCK_EXTENSION) && ((set & XML_SCHEMAS_TYPE_BLOCK_EXTENSION) == 0)) @@ -18375,47 +19728,92 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl, } /** - * xmlSchemaResolveParticleReferences: - * @item: an schema component - * @ctxt: a schema parser context - * @name: the internal name of the component + * xmlSchemaResolveModelGroupParticleReferences: + * @particle: a particle component + * @ctxt: a parser context * - * Resolves references of misc. schema components. + * Resolves references of a model group's {particles} to + * model group definitions and to element declarations. */ static void -xmlSchemaResolveParticleReferences(xmlSchemaTreeItemPtr item, - xmlSchemaParserCtxtPtr ctxt, - const xmlChar * name ATTRIBUTE_UNUSED) +xmlSchemaResolveModelGroupParticleReferences( + xmlSchemaParserCtxtPtr ctxt, + xmlSchemaModelGroupPtr mg) { - if (item->type != XML_SCHEMA_TYPE_PARTICLE) - return; - if ((item->children != NULL) && - (item->children->type == XML_SCHEMA_EXTRA_QNAMEREF)) { - xmlSchemaQNameRefPtr ref = (xmlSchemaQNameRefPtr) item->children; - xmlSchemaBasicItemPtr refItem; + xmlSchemaParticlePtr particle = WXS_MODELGROUP_PARTICLE(mg); + xmlSchemaQNameRefPtr ref; + xmlSchemaBasicItemPtr refItem; + + /* + * URGENT TODO: Test this. + */ + while (particle != NULL) { + if ((WXS_PARTICLE_TERM(particle) == NULL) || + ((WXS_PARTICLE_TERM(particle))->type != + XML_SCHEMA_EXTRA_QNAMEREF)) + { + goto next_particle; + } + ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle); /* * Resolve the reference. + * NULL the {term} by default. */ - item->children = NULL; + particle->children = NULL; + refItem = xmlSchemaGetNamedComponent(ctxt->schema, ref->itemType, ref->name, ref->targetNamespace); if (refItem == NULL) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - NULL, GET_NODE(item), "ref", ref->name, + NULL, WXS_ITEM_NODE(particle), "ref", ref->name, ref->targetNamespace, ref->itemType, NULL); - } else { - if (refItem->type == XML_SCHEMA_TYPE_GROUP) { + /* TODO: remove the particle. */ + goto next_particle; + } + if (refItem->type == XML_SCHEMA_TYPE_GROUP) { + if (WXS_MODELGROUPDEF_MODEL(refItem) == NULL) + /* TODO: remove the particle. */ + goto next_particle; + /* + * NOTE that we will assign the model group definition + * itself to the "term" of the particle. This will ease + * the check for circular model group definitions. After + * that the "term" will be assigned the model group of the + * model group definition. + */ + if ((WXS_MODELGROUPDEF_MODEL(refItem))->type == + XML_SCHEMA_TYPE_ALL) { /* - * NOTE that we will assign the model group definition - * itself to the "term" of the particle. This will ease - * the check for circular model group definitions. After - * that the "term" will be assigned the model group of the - * model group definition. + * SPEC cos-all-limited (1) + * SPEC cos-all-limited (1.2) + * "It appears only as the value of one or both of the + * following properties:" + * (1.1) "the {model group} property of a model group + * definition." + * (1.2) "the {term} property of a particle [... of] the " + * {content type} of a complex type definition." */ - item->children = (xmlSchemaTreeItemPtr) refItem; - } else - item->children = (xmlSchemaTreeItemPtr) refItem; + xmlSchemaCustomErr(ACTXT_CAST ctxt, + /* TODO: error code */ + XML_SCHEMAP_COS_ALL_LIMITED, + WXS_ITEM_NODE(particle), NULL, + "A model group definition is referenced, but " + "it contains an 'all' model group, which " + "cannot be contained by model groups", + NULL, NULL); + /* TODO: remove the particle. */ + goto next_particle; + } + particle->children = (xmlSchemaTreeItemPtr) refItem; + } else { + /* + * TODO: Are referenced element declarations the only + * other components we expect here? + */ + particle->children = (xmlSchemaTreeItemPtr) refItem; } +next_particle: + particle = WXS_PTC_CAST particle->next; } } @@ -18448,7 +19846,7 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x, * string comparison for string based types. */ if ((ptx->builtInType == XML_SCHEMAS_STRING) || - IS_ANY_SIMPLE_TYPE(ptx)) { + WXS_IS_ANY_SIMPLE_TYPE(ptx)) { if (! xmlStrEqual( xmlSchemaValueGetAsString(x), xmlSchemaValueGetAsString(y))) @@ -18463,38 +19861,181 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x, return(0); } /* - * Lists. + * Lists. + */ + x = xmlSchemaValueGetNext(x); + if (x != NULL) { + y = xmlSchemaValueGetNext(y); + if (y == NULL) + return (0); + } else if (xmlSchemaValueGetNext(y) != NULL) + return (0); + else + return (1); + } + return (0); +} + +/** + * xmlSchemaResolveAttrUseReferences: + * @item: an attribute use + * @ctxt: a parser context + * + * Resolves the referenced attribute declaration. + */ +static int +xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause, + xmlSchemaParserCtxtPtr ctxt) +{ + if ((ctxt == NULL) || (ause == NULL)) + return(-1); + if ((ause->attrDecl == NULL) || + (ause->attrDecl->type != XML_SCHEMA_EXTRA_QNAMEREF)) + return(0); + + { + xmlSchemaQNameRefPtr ref = WXS_QNAME_CAST ause->attrDecl; + + /* + * TODO: Evaluate, what errors could occur if the declaration is not + * found. + */ + ause->attrDecl = xmlSchemaGetAttributeDecl(ctxt->schema, + ref->name, ref->targetNamespace); + if (ause->attrDecl == NULL) { + xmlSchemaPResCompAttrErr(ctxt, + XML_SCHEMAP_SRC_RESOLVE, + WXS_BASIC_CAST ause, ause->node, + "ref", ref->name, ref->targetNamespace, + XML_SCHEMA_TYPE_ATTRIBUTE, NULL); + return(ctxt->err);; + } + } + return(0); +} + +/** + * xmlSchemaCheckAttrUsePropsCorrect: + * @ctxt: a parser context + * @use: an attribute use + * + * Schema Component Constraint: + * Attribute Use Correct (au-props-correct) + * + */ +static int +xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt, + xmlSchemaAttributeUsePtr use) +{ + if ((ctxt == NULL) || (use == NULL)) + return(-1); + if ((use->defValue == NULL) || (WXS_ATTRUSE_DECL(use) == NULL) || + ((WXS_ATTRUSE_DECL(use))->type != XML_SCHEMA_TYPE_ATTRIBUTE)) + return(0); + + /* + * SPEC au-props-correct (1) + * "The values of the properties of an attribute use must be as + * described in the property tableau in The Attribute Use Schema + * Component (§3.5.1), modulo the impact of Missing + * Sub-components (§5.3)." + */ + + if (((WXS_ATTRUSE_DECL(use))->defValue != NULL) && + ((WXS_ATTRUSE_DECL(use))->flags & XML_SCHEMAS_ATTR_FIXED) && + ((use->flags & XML_SCHEMA_ATTR_USE_FIXED) == 0)) + { + xmlSchemaPCustomErr(ctxt, + XML_SCHEMAP_AU_PROPS_CORRECT_2, + WXS_BASIC_CAST use, NULL, + "The attribute declaration has a 'fixed' value constraint " + ", thus the attribute use must also have a 'fixed' value " + "constraint", + NULL); + return(ctxt->err); + } + /* + * Compute and check the value constraint's value. + */ + if ((use->defVal != NULL) && (WXS_ATTRUSE_TYPEDEF(use) != NULL)) { + int ret; + /* + * TODO: The spec seems to be missing a check of the + * value constraint of the attribute use. We will do it here. */ - x = xmlSchemaValueGetNext(x); - if (x != NULL) { - y = xmlSchemaValueGetNext(y); - if (y == NULL) - return (0); - } else if (xmlSchemaValueGetNext(y) != NULL) - return (0); - else - return (1); + /* + * SPEC a-props-correct (3) + */ + if (xmlSchemaIsDerivedFromBuiltInType( + WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID)) + { + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_AU_PROPS_CORRECT, + NULL, WXS_BASIC_CAST use, + "Value constraints are not allowed if the type definition " + "is or is derived from xs:ID", + NULL, NULL); + return(ctxt->err); + } + + ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt, + use->node, WXS_ATTRUSE_TYPEDEF(use), + use->defValue, &(use->defVal), + 1, 1, 0); + if (ret != 0) { + if (ret < 0) { + PERROR_INT2("xmlSchemaCheckAttrUsePropsCorrect", + "calling xmlSchemaVCheckCVCSimpleType()"); + return(-1); + } + xmlSchemaCustomErr(ACTXT_CAST ctxt, + XML_SCHEMAP_AU_PROPS_CORRECT, + NULL, WXS_BASIC_CAST use, + "The value of the value constraint is not valid", + NULL, NULL); + return(ctxt->err); + } } - return (0); + /* + * SPEC au-props-correct (2) + * "If the {attribute declaration} has a fixed + * {value constraint}, then if the attribute use itself has a + * {value constraint}, it must also be fixed and its value must match + * that of the {attribute declaration}'s {value constraint}." + */ + if (((WXS_ATTRUSE_DECL(use))->defVal != NULL) && + (((WXS_ATTRUSE_DECL(use))->flags & XML_SCHEMA_ATTR_USE_FIXED) == 0)) + { + if (! xmlSchemaAreValuesEqual(use->defVal, + (WXS_ATTRUSE_DECL(use))->defVal)) + { + xmlSchemaPCustomErr(ctxt, + XML_SCHEMAP_AU_PROPS_CORRECT_2, + WXS_BASIC_CAST use, NULL, + "The 'fixed' value constraint of the attribute use " + "must match the attribute declaration's value " + "constraint '%s'", + (WXS_ATTRUSE_DECL(use))->defValue); + } + return(ctxt->err); + } + return(0); } + + + /** - * xmlSchemaResolveAttrReferences: - * @item: an schema attribute declaration/use. - * @ctxt: a schema parser context - * @name: the name of the attribute + * xmlSchemaResolveAttrTypeReferences: + * @item: an attribute declaration + * @ctxt: a parser context * - * Fixes finish doing the computations on attribute declarations/uses. + * Resolves the referenced type definition component. */ -static void -xmlSchemaResolveAttrReferences(xmlSchemaAttributePtr item, - xmlSchemaParserCtxtPtr ctxt, - const xmlChar * name ATTRIBUTE_UNUSED) +static int +xmlSchemaResolveAttrTypeReferences(xmlSchemaAttributePtr item, + xmlSchemaParserCtxtPtr ctxt) { - /* - * TODO: If including this is done twice (!) for every attribute. - * -> Hmm, check if this is still done. - */ /* * The simple type definition corresponding to the element * information item in the [children], if present, otherwise the simple @@ -18502,85 +20043,32 @@ xmlSchemaResolveAttrReferences(xmlSchemaAttributePtr item, * [attribute], if present, otherwise the ·simple ur-type definition·. */ if (item->flags & XML_SCHEMAS_ATTR_INTERNAL_RESOLVED) - return; + return(0); item->flags |= XML_SCHEMAS_ATTR_INTERNAL_RESOLVED; if (item->subtypes != NULL) - return; + return(0); if (item->typeName != NULL) { xmlSchemaTypePtr type; type = xmlSchemaGetType(ctxt->schema, item->typeName, item->typeNs); - if ((type == NULL) || (! IS_SIMPLE_TYPE(type))) { + if ((type == NULL) || (! WXS_IS_SIMPLE(type))) { xmlSchemaPResCompAttrErr(ctxt, XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) item, item->node, + WXS_BASIC_CAST item, item->node, "type", item->typeName, item->typeNs, XML_SCHEMA_TYPE_SIMPLE, NULL); + return(ctxt->err); } else item->subtypes = type; - } else if (item->ref != NULL) { - xmlSchemaAttributePtr decl; - - /* - * We have an attribute use here; assign the referenced - * attribute declaration. - */ + } else { /* - * TODO: Evaluate, what errors could occur if the declaration is not - * found. It might be possible that the "typefixup" might crash if - * no ref declaration was found. + * The type defaults to the xs:anySimpleType. */ - decl = xmlSchemaGetAttributeDecl(ctxt->schema, item->ref, item->refNs); - if (decl == NULL) { - xmlSchemaPResCompAttrErr(ctxt, - XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) item, item->node, - "ref", item->ref, item->refNs, - XML_SCHEMA_TYPE_ATTRIBUTE, NULL); - return; - } - item->refDecl = decl; - xmlSchemaResolveAttrReferences(decl, ctxt, NULL); - item->subtypes = decl->subtypes; - /* - * Attribute Use Correct - * au-props-correct.2: If the {attribute declaration} has a fixed - * {value constraint}, then if the attribute use itself has a - * {value constraint}, it must also be fixed and its value must match - * that of the {attribute declaration}'s {value constraint}. - */ - if ((decl->flags & XML_SCHEMAS_ATTR_FIXED) && - (item->defValue != NULL)) { - if ((item->flags & XML_SCHEMAS_ATTR_FIXED) == 0) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_AU_PROPS_CORRECT_2, - NULL, NULL, item->node, - "The attribute declaration has a 'fixed' value constraint " - ", thus it must be 'fixed' in attribute use as well", - NULL); - } else { - if (! xmlSchemaAreValuesEqual(item->defVal, decl->defVal)) { - xmlSchemaPCustomErr(ctxt, - XML_SCHEMAP_AU_PROPS_CORRECT_2, - NULL, NULL, item->node, - "The 'fixed' value constraint of the attribute use " - "must match the attribute declaration's value " - "constraint '%s'", - decl->defValue); - } - } - /* - * FUTURE: One should change the values of the attr. use - * if ever validation should be attempted even if the - * schema itself was not fully valid. - */ - } - } else { - /* The type of this attribute is the xs:anySimpleType. */ item->subtypes = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE); } + return(0); } /** @@ -18590,14 +20078,15 @@ xmlSchemaResolveAttrReferences(xmlSchemaAttributePtr item, * @name: the attribute name * * Resolve keyRef references to key/unique IDCs. + * Schema Component Constraint: + * Identity-constraint Definition Properties Correct (c-props-correct) */ -static void +static int xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc, - xmlSchemaParserCtxtPtr pctxt, - const xmlChar * name ATTRIBUTE_UNUSED) + xmlSchemaParserCtxtPtr pctxt) { if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) - return; + return(0); if (idc->ref->name != NULL) { idc->ref->item = (xmlSchemaBasicItemPtr) xmlSchemaGetIDC(pctxt->schema, idc->ref->name, @@ -18609,11 +20098,22 @@ xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc, */ xmlSchemaPResCompAttrErr(pctxt, XML_SCHEMAP_SRC_RESOLVE, - (xmlSchemaTypePtr) idc, idc->node, + WXS_BASIC_CAST idc, idc->node, "refer", idc->ref->name, idc->ref->targetNamespace, XML_SCHEMA_TYPE_IDC_KEY, NULL); - return; + return(pctxt->err); + } else if (idc->ref->item->type == XML_SCHEMA_TYPE_IDC_KEYREF) { + /* + * SPEC c-props-correct (1) + */ + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_C_PROPS_CORRECT, + NULL, WXS_BASIC_CAST idc, + "The keyref references a keyref", + NULL, NULL); + idc->ref->item = NULL; + return(pctxt->err); } else { if (idc->nbFields != ((xmlSchemaIDCPtr) idc->ref->item)->nbFields) { @@ -18627,20 +20127,417 @@ xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc, * the cardinality of the {fields} must equal that of * the {fields} of the {referenced key}. */ - xmlSchemaPCustomErr(pctxt, + xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_C_PROPS_CORRECT, - NULL, (xmlSchemaTypePtr) idc, idc->node, + NULL, WXS_BASIC_CAST idc, "The cardinality of the keyref differs from the " - "cardinality of the referenced key '%s'", + "cardinality of the referenced key/unique '%s'", xmlSchemaFormatQName(&str, refer->targetNamespace, - refer->name) - ); + refer->name), + NULL); FREE_AND_NULL(str) + return(pctxt->err); } } } + return(0); +} + +static int +xmlSchemaResolveAttrUseProhibReferences(xmlSchemaAttributeUseProhibPtr prohib, + xmlSchemaParserCtxtPtr pctxt) +{ + if (xmlSchemaGetAttributeDecl(pctxt->schema, prohib->name, + prohib->targetNamespace) == NULL) { + + xmlSchemaPResCompAttrErr(pctxt, + XML_SCHEMAP_SRC_RESOLVE, + NULL, prohib->node, + "ref", prohib->name, prohib->targetNamespace, + XML_SCHEMA_TYPE_ATTRIBUTE, NULL); + return(XML_SCHEMAP_SRC_RESOLVE); + } + return(0); +} + +#define WXS_REDEFINED_TYPE(c) \ +(((xmlSchemaTypePtr) item)->flags & XML_SCHEMAS_TYPE_REDEFINED) + +#define WXS_REDEFINED_MODEL_GROUP_DEF(c) \ +(((xmlSchemaModelGroupDefPtr) item)->flags & XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED) + +#define WXS_REDEFINED_ATTR_GROUP(c) \ +(((xmlSchemaAttributeGroupPtr) item)->flags & XML_SCHEMAS_ATTRGROUP_REDEFINED) + +static int +xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) +{ + int err = 0; + xmlSchemaRedefPtr redef = WXS_CONSTRUCTOR(pctxt)->redefs; + xmlSchemaBasicItemPtr prev, item; + int wasRedefined; + + if (redef == NULL) + return(0); + + do { + item = redef->item; + /* + * First try to locate the redefined component in the + * schema graph starting with the redefined schema. + * NOTE: According to this schema bug entry: + * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005OctDec/0019.html + * it's not clear if the referenced component needs to originate + * from the d schema _document_ or the schema; the latter + * would include all imported and included sub-schemas of the + * d schema. Currenlty we latter approach is used. + * SUPPLEMENT: It seems that the WG moves towards the latter + * approach, so we are doing it right. + * + */ + prev = xmlSchemaFindRedefCompInGraph( + redef->targetBucket, item->type, + redef->refName, redef->refTargetNs); + if (prev == NULL) { + xmlChar *str = NULL; + xmlNodePtr node; + + /* + * SPEC src-redefine: + * (6.2.1) "The ·actual value· of its own name attribute plus + * target namespace must successfully ·resolve· to a model + * group definition in I." + * (7.2.1) "The ·actual value· of its own name attribute plus + * target namespace must successfully ·resolve· to an attribute + * group definition in I." + + * + * Note that, if we are redefining with the use of references + * to components, the spec assumes the src-resolve to be used; + * but this won't assure that we search only *inside* the + * redefined schema. + */ + if (redef->reference) + node = WXS_ITEM_NODE(redef->reference); + else + node = WXS_ITEM_NODE(item); + xmlSchemaCustomErr(ACTXT_CAST pctxt, + /* + * TODO: error code. + * Probably XML_SCHEMAP_SRC_RESOLVE, if this is using the + * reference kind. + */ + XML_SCHEMAP_SRC_REDEFINE, node, NULL, + "The %s '%s' to be redefined could not be found in " + "the redefined schema", + WXS_ITEM_TYPE_NAME(item), + xmlSchemaFormatQName(&str, redef->refTargetNs, + redef->refName)); + FREE_AND_NULL(str); + err = pctxt->err; + redef = redef->next; + continue; + } + /* + * TODO: Obtaining and setting the redefinition state is really + * clumsy. + */ + wasRedefined = 0; + switch (item->type) { + case XML_SCHEMA_TYPE_COMPLEX: + case XML_SCHEMA_TYPE_SIMPLE: + if ((WXS_TYPE_CAST prev)->flags & + XML_SCHEMAS_TYPE_REDEFINED) + { + wasRedefined = 1; + break; + } + /* Mark it as redefined. */ + (WXS_TYPE_CAST prev)->flags |= XML_SCHEMAS_TYPE_REDEFINED; + /* + * Assign the redefined type to the + * base type of the redefining type. + * TODO: How + */ + ((xmlSchemaTypePtr) item)->baseType = + (xmlSchemaTypePtr) prev; + break; + case XML_SCHEMA_TYPE_GROUP: + if ((WXS_MODEL_GROUPDEF_CAST prev)->flags & + XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED) + { + wasRedefined = 1; + break; + } + /* Mark it as redefined. */ + (WXS_MODEL_GROUPDEF_CAST prev)->flags |= + XML_SCHEMA_MODEL_GROUP_DEF_REDEFINED; + if (redef->reference != NULL) { + /* + * Overwrite the QName-reference with the + * referenced model group def. + */ + (WXS_PTC_CAST redef->reference)->children = + WXS_TREE_CAST prev; + } + redef->target = prev; + break; + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + if ((WXS_ATTR_GROUP_CAST prev)->flags & + XML_SCHEMAS_ATTRGROUP_REDEFINED) + { + wasRedefined = 1; + break; + } + (WXS_ATTR_GROUP_CAST prev)->flags |= + XML_SCHEMAS_ATTRGROUP_REDEFINED; + if (redef->reference != NULL) { + /* + * Assign the redefined attribute group to the + * QName-reference component. + * This is the easy case, since we will just + * expand the redefined group. + */ + (WXS_QNAME_CAST redef->reference)->item = prev; + redef->target = NULL; + } else { + /* + * This is the complicated case: we need + * to apply src-redefine (7.2.2) at a later + * stage, i.e. when attribute group references + * have beed expanded and simple types have + * beed fixed. + */ + redef->target = prev; + } + break; + default: + PERROR_INT("xmlSchemaResolveRedefReferences", + "Unexpected redefined component type"); + return(-1); + } + if (wasRedefined) { + xmlChar *str = NULL; + xmlNodePtr node; + + if (redef->reference) + node = WXS_ITEM_NODE(redef->reference); + else + node = WXS_ITEM_NODE(redef->item); + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + /* TODO: error code. */ + XML_SCHEMAP_SRC_REDEFINE, + node, NULL, + "The referenced %s was already redefined. Multiple " + "redefinition of the same component is not supported", + xmlSchemaGetComponentDesignation(&str, prev), + NULL); + FREE_AND_NULL(str) + err = pctxt->err; + redef = redef->next; + continue; + } + redef = redef->next; + } while (redef != NULL); + + return(err); +} + +static int +xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt) +{ + int err = 0; + xmlSchemaRedefPtr redef = WXS_CONSTRUCTOR(pctxt)->redefs; + xmlSchemaBasicItemPtr item; + + if (redef == NULL) + return(0); + + do { + if (redef->target == NULL) { + redef = redef->next; + continue; + } + item = redef->item; + + switch (item->type) { + case XML_SCHEMA_TYPE_SIMPLE: + case XML_SCHEMA_TYPE_COMPLEX: + /* + * Since the spec wants the {name} of the redefined + * type to be 'absent', we'll NULL it. + */ + (WXS_TYPE_CAST redef->target)->name = NULL; + + /* + * TODO: Seems like there's nothing more to do. The normal + * inheritance mechanism is used. But not 100% sure. + */ + break; + case XML_SCHEMA_TYPE_GROUP: + /* + * URGENT TODO: + * SPEC src-redefine: + * (6.2.2) "The {model group} of the model group definition + * which corresponds to it per XML Representation of Model + * Group Definition Schema Components (§3.7.2) must be a + * ·valid restriction· of the {model group} of that model + * group definition in I, as defined in Particle Valid + * (Restriction) (§3.9.6)." + */ + break; + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + /* + * SPEC src-redefine: + * (7.2.2) "The {attribute uses} and {attribute wildcard} of + * the attribute group definition which corresponds to it + * per XML Representation of Attribute Group Definition Schema + * Components (§3.6.2) must be ·valid restrictions· of the + * {attribute uses} and {attribute wildcard} of that attribute + * group definition in I, as defined in clause 2, clause 3 and + * clause 4 of Derivation Valid (Restriction, Complex) + * (§3.4.6) (where references to the base type definition are + * understood as references to the attribute group definition + * in I)." + */ + err = xmlSchemaCheckDerivationOKRestriction2to4(pctxt, + XML_SCHEMA_ACTION_REDEFINE, + item, redef->target, + (WXS_ATTR_GROUP_CAST item)->attrUses, + (WXS_ATTR_GROUP_CAST redef->target)->attrUses, + (WXS_ATTR_GROUP_CAST item)->attributeWildcard, + (WXS_ATTR_GROUP_CAST redef->target)->attributeWildcard); + if (err == -1) + return(-1); + break; + default: + break; + } + redef = redef->next; + } while (redef != NULL); + return(0); } + + +static int +xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaBucketPtr bucket) +{ + xmlSchemaBasicItemPtr item; + int err; + xmlHashTablePtr *table; + const xmlChar *name; + int i; + +#define WXS_GET_GLOBAL_HASH(c, s, slot) { \ + if (WXS_IS_BUCKET_IMPMAIN((c)->type)) \ + table = &(WXS_IMPBUCKET((c))->schema->slot); \ + else \ + table = &(WXS_INCBUCKET((c))->ownerImport->schema->slot); } + /* + * Add global components to the schema's hash tables. + * This is the place where duplicate components will be + * detected. + * TODO: I think normally we should support imports of the + * same namespace from multiple locations. We don't do currently, + * but if we do then according to: + * http://www.w3.org/Bugs/Public/show_bug.cgi?id=2224 + * we would need, if imported directly, to import redefined + * components as well to be able to catch clashing components. + * (I hope I'll still know what this means after some months :-() + */ + if (bucket == NULL) + return(-1); + if (bucket->flags & XML_SCHEMA_BUCKET_COMPS_ADDED) + return(0); + bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED; + + for (i = 0; i < bucket->globals->nbItems; i++) { + item = bucket->globals->items[i]; + table = NULL; + switch (item->type) { + case XML_SCHEMA_TYPE_COMPLEX: + case XML_SCHEMA_TYPE_SIMPLE: + if (WXS_REDEFINED_TYPE(item)) + continue; + name = (WXS_TYPE_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, typeDecl) + break; + case XML_SCHEMA_TYPE_ELEMENT: + name = (WXS_ELEM_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, elemDecl) + break; + case XML_SCHEMA_TYPE_ATTRIBUTE: + name = (WXS_ATTR_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, attrDecl) + break; + case XML_SCHEMA_TYPE_GROUP: + if (WXS_REDEFINED_MODEL_GROUP_DEF(item)) + continue; + name = (WXS_MODEL_GROUPDEF_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, groupDecl) + break; + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + if (WXS_REDEFINED_ATTR_GROUP(item)) + continue; + name = (WXS_ATTR_GROUP_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, attrgrpDecl) + break; + case XML_SCHEMA_TYPE_IDC_KEY: + case XML_SCHEMA_TYPE_IDC_UNIQUE: + case XML_SCHEMA_TYPE_IDC_KEYREF: + name = (WXS_IDC_CAST item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, idcDef) + break; + case XML_SCHEMA_TYPE_NOTATION: + name = ((xmlSchemaNotationPtr) item)->name; + WXS_GET_GLOBAL_HASH(bucket, schema, notaDecl) + break; + default: + PERROR_INT("xmlSchemaAddComponents", + "Unexpected global component type"); + continue; + } + if (*table == NULL) { + *table = xmlHashCreateDict(10, pctxt->dict); + if (*table == NULL) { + PERROR_INT("xmlSchemaAddComponents", + "failed to create a component hash table"); + return(-1); + } + } + err = xmlHashAddEntry(*table, name, item); + if (err != 0) { + xmlChar *str = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + XML_SCHEMAP_REDEFINED_TYPE, + WXS_ITEM_NODE(item), + WXS_BASIC_CAST item, + "A global %s '%s' does already exist", + WXS_ITEM_TYPE_NAME(item), + xmlSchemaGetComponentQName(&str, item)); + FREE_AND_NULL(str); + } + } + /* + * Process imported/included schemas. + */ + if (bucket->relations != NULL) { + xmlSchemaSchemaRelationPtr rel = bucket->relations; + do { + if ((rel->bucket != NULL) && + ((rel->bucket->flags & XML_SCHEMA_BUCKET_COMPS_ADDED) == 0)) { + if (xmlSchemaAddComponents(pctxt, rel->bucket) == -1) + return(-1); + } + rel = rel->next; + } while (rel != NULL); + } + return(0); +} static int xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) @@ -18653,10 +20550,27 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) if ((con->pending == NULL) || (con->pending->nbItems == 0)) - return(0); + return(0); + + /* TODO: + * SPEC (src-redefine): + * (6.2) "If it has no such self-reference, then all of the + * following must be true:" + + * (6.2.2) The {model group} of the model group definition which + * corresponds to it per XML Representation of Model Group + * Definition Schema Components (§3.7.2) must be a ·valid + * restriction· of the {model group} of that model group definition + * in I, as defined in Particle Valid (Restriction) (§3.9.6)." + */ + xmlSchemaCheckSRCRedefineFirst(pctxt); + + /* + * Add global components to the schemata's hash tables. + */ + xmlSchemaAddComponents(pctxt, WXS_CONSTRUCTOR(pctxt)->mainBucket); pctxt->ctxtType = NULL; - pctxt->parentItem = NULL; items = (xmlSchemaTreeItemPtr *) con->pending->items; nbItems = con->pending->nbItems; /* @@ -18683,6 +20597,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) * - the term of the particle (e.g. a model group) * 6. IDC key-references: * - the referenced IDC 'key' or 'unique' definition + * 7. Attribute prohibitions which had a "ref" attribute. */ for (i = 0; i < nbItems; i++) { item = items[i]; @@ -18695,29 +20610,49 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) case XML_SCHEMA_TYPE_COMPLEX: case XML_SCHEMA_TYPE_SIMPLE: xmlSchemaResolveTypeReferences( - (xmlSchemaTypePtr) item, pctxt, NULL); + (xmlSchemaTypePtr) item, pctxt); FIXHFAILURE; break; case XML_SCHEMA_TYPE_ATTRIBUTE: - xmlSchemaResolveAttrReferences( - (xmlSchemaAttributePtr) item, pctxt, NULL); + xmlSchemaResolveAttrTypeReferences( + (xmlSchemaAttributePtr) item, pctxt); FIXHFAILURE; break; - case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: - xmlSchemaResolveAttrGroupReferences( - (xmlSchemaAttributeGroupPtr) item, pctxt, NULL); + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + xmlSchemaResolveAttrUseReferences( + (xmlSchemaAttributeUsePtr) item, pctxt); + FIXHFAILURE; + break; + case XML_SCHEMA_EXTRA_QNAMEREF: + if ((WXS_QNAME_CAST item)->itemType == + XML_SCHEMA_TYPE_ATTRIBUTEGROUP) + { + xmlSchemaResolveAttrGroupReferences( + WXS_QNAME_CAST item, pctxt); + } FIXHFAILURE; break; - case XML_SCHEMA_TYPE_PARTICLE: - xmlSchemaResolveParticleReferences( - (xmlSchemaTreeItemPtr) item, pctxt, NULL); + case XML_SCHEMA_TYPE_SEQUENCE: + case XML_SCHEMA_TYPE_CHOICE: + case XML_SCHEMA_TYPE_ALL: + xmlSchemaResolveModelGroupParticleReferences(pctxt, + WXS_MODEL_GROUP_CAST item); FIXHFAILURE; break; case XML_SCHEMA_TYPE_IDC_KEY: case XML_SCHEMA_TYPE_IDC_UNIQUE: case XML_SCHEMA_TYPE_IDC_KEYREF: xmlSchemaResolveIDCKeyReferences( - (xmlSchemaIDCPtr) item, pctxt, NULL); + (xmlSchemaIDCPtr) item, pctxt); + FIXHFAILURE; + break; + case XML_SCHEMA_EXTRA_ATTR_USE_PROHIB: + /* + * Handle attribue prohibition which had a + * "ref" attribute. + */ + xmlSchemaResolveAttrUseProhibReferences( + WXS_ATTR_PROHIB_CAST item, pctxt); FIXHFAILURE; break; default: @@ -18767,6 +20702,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) break; } } + if (pctxt->nberrors != 0) + goto exit_error; /* * Model group definition references: * Such a reference is reflected by a particle at the component @@ -18777,26 +20714,39 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) */ for (i = 0; i < nbItems; i++) { item = items[i]; - if ((item->type == XML_SCHEMA_TYPE_PARTICLE) && - (item->children != NULL) && - (item->children->type == XML_SCHEMA_TYPE_GROUP)) { - xmlSchemaGroupDefReferenceTermFixup( - (xmlSchemaParticlePtr) item, pctxt, NULL); - FIXHFAILURE; + switch (item->type) { + case XML_SCHEMA_TYPE_SEQUENCE: + case XML_SCHEMA_TYPE_CHOICE: + xmlSchemaModelGroupToModelGroupDefFixup(pctxt, + WXS_MODEL_GROUP_CAST item); + break; + default: + break; } } if (pctxt->nberrors != 0) goto exit_error; /* - * Now that all references are resolved, no circularity occured - * and the 'term's of particles was fixed we can: - * 1. finish computation of properties of types - * 2. restrict type definitions and check those restrictions - * 3. extend type definitions and check those extensions - * - * This is the most complex part during schema construction. - * TODO: Maybe it would be better to stop at the first error here. + * Expand attribute group references of attribute group definitions. */ + for (i = 0; i < nbItems; i++) { + item = items[i]; + switch (item->type) { + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + if ((! WXS_ATTR_GROUP_EXPANDED(item)) && + WXS_ATTR_GROUP_HAS_REFS(item)) + { + xmlSchemaAttributeGroupExpandRefs(pctxt, + WXS_ATTR_GROUP_CAST item); + FIXHFAILURE; + } + break; + default: + break; + } + } + if (pctxt->nberrors != 0) + goto exit_error; /* * First compute the variety of simple types. This is needed as * a seperate step, since otherwise we won't be able to detect @@ -18806,7 +20756,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) item = items[i]; switch (item->type) { case XML_SCHEMA_TYPE_SIMPLE: - if (TYPE_IS_NOT_FIXEDUP_1((xmlSchemaTypePtr) item)) { + if (WXS_IS_TYPE_NOT_FIXED_1((xmlSchemaTypePtr) item)) { xmlSchemaFixupSimpleTypeStageOne(pctxt, (xmlSchemaTypePtr) item); FIXHFAILURE; @@ -18816,6 +20766,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) break; } } + if (pctxt->nberrors != 0) + goto exit_error; /* * Detect circular union types. Note that this needs the variety to * be already computed. @@ -18836,14 +20788,56 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) } if (pctxt->nberrors != 0) goto exit_error; - /* Now do the complete type fixup. */ + + /* + * Do the complete type fixup for simple types. + */ for (i = 0; i < nbItems; i++) { item = items[i]; switch (item->type) { case XML_SCHEMA_TYPE_SIMPLE: - case XML_SCHEMA_TYPE_COMPLEX: - xmlSchemaTypeFixup((xmlSchemaTypePtr) item, pctxt); + if (WXS_IS_TYPE_NOT_FIXED(WXS_TYPE_CAST item)) { + xmlSchemaFixupSimpleTypeStageTwo(pctxt, WXS_TYPE_CAST item); + FIXHFAILURE; + } + break; + default: + break; + } + } + if (pctxt->nberrors != 0) + goto exit_error; + /* + * At this point we need all simple types to be builded and checked. + */ + /* + * Apply contraints for attribute declarations. + */ + for (i = 0; i < nbItems; i++) { + item = items[i]; + switch (item->type) { + case XML_SCHEMA_TYPE_ATTRIBUTE: + xmlSchemaCheckAttrPropsCorrect(pctxt, WXS_ATTR_CAST item); FIXHFAILURE; + break; + default: + break; + } + } + if (pctxt->nberrors != 0) + goto exit_error; + /* + * Apply constraints for attribute uses. + */ + for (i = 0; i < nbItems; i++) { + item = items[i]; + switch (item->type) { + case XML_SCHEMA_TYPE_ATTRIBUTE_USE: + if (((xmlSchemaAttributeUsePtr)item)->defValue != NULL) { + xmlSchemaCheckAttrUsePropsCorrect(pctxt, + WXS_ATTR_USE_CAST item); + FIXHFAILURE; + } break; default: break; @@ -18851,24 +20845,73 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) } if (pctxt->nberrors != 0) goto exit_error; - + /* - * Now that we are sure the type definitions are finally constructed, - * we can: - * 1. check value contraint values of attribute declarations - * 2. apply various constraints to element declarations + * Apply constraints for attribute group definitions. */ for (i = 0; i < nbItems; i++) { item = items[i]; switch (item->type) { - case XML_SCHEMA_TYPE_ATTRIBUTE: - if (((xmlSchemaAttributePtr)item)->defValue != NULL) { - xmlSchemaCheckAttrValConstr( - (xmlSchemaAttributePtr) item, pctxt); + case XML_SCHEMA_TYPE_ATTRIBUTEGROUP: + if (( (WXS_ATTR_GROUP_CAST item)->attrUses != NULL) && + ( (WXS_LIST_CAST (WXS_ATTR_GROUP_CAST item)->attrUses)->nbItems > 1)) + { + xmlSchemaCheckAGPropsCorrect(pctxt, WXS_ATTR_GROUP_CAST item); + FIXHFAILURE; + } + break; + default: + break; + } + } + if (pctxt->nberrors != 0) + goto exit_error; + + /* + * Apply constraints for redefinitions. + */ + if (WXS_CONSTRUCTOR(pctxt)->redefs != NULL) + xmlSchemaCheckSRCRedefineSecond(pctxt); + if (pctxt->nberrors != 0) + goto exit_error; + + /* + * Fixup complex types. + */ + for (i = 0; i < nbItems; i++) { + item = con->pending->items[i]; + switch (item->type) { + case XML_SCHEMA_TYPE_COMPLEX: + if (WXS_IS_TYPE_NOT_FIXED(WXS_TYPE_CAST item)) { + xmlSchemaFixupComplexType(pctxt, WXS_TYPE_CAST item); FIXHFAILURE; } break; + default: + break; + } + } + if (pctxt->nberrors != 0) + goto exit_error; + + /* + * The list could have changed, since xmlSchemaFixupComplexType() + * will create particles and model groups in some cases. + */ + items = (xmlSchemaTreeItemPtr *) con->pending->items; + nbItems = con->pending->nbItems; + + /* + * At this point all complex types need to be builded and checked. + */ + /* + * Apply some constraints for element declarations. + */ + for (i = 0; i < nbItems; i++) { + item = items[i]; + switch (item->type) { case XML_SCHEMA_TYPE_ELEMENT: + if ((((xmlSchemaElementPtr) item)->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0) { xmlSchemaCheckElementDeclComponent( @@ -18886,12 +20929,13 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) * Finally we can build the automaton from the content model of * complex types. */ + for (i = 0; i < nbItems; i++) { item = items[i]; switch (item->type) { case XML_SCHEMA_TYPE_COMPLEX: xmlSchemaBuildContentModel((xmlSchemaTypePtr) item, pctxt); - FIXHFAILURE; + /* FIXHFAILURE; */ break; default: break; @@ -18899,9 +20943,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt) } if (pctxt->nberrors != 0) goto exit_error; - /* - * URGENT TODO: cos-element-consistent, cos-all-limited + * URGENT TODO: cos-element-consistent */ con->pending->nbItems = 0; return(0); @@ -18918,7 +20961,6 @@ exit_failure: * * parse a schema definition resource and build an internal * XML Shema struture which can be used to validate instances. - * *WARNING* this interface is highly subject to change * * Returns the internal XML Schema structure built from the resource or * NULL in case of error @@ -18959,7 +21001,7 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt) /* Take ownership of the constructor to be able to free it. */ ctxt->ownsConstructor = 1; } - ctxt->constructor->schema = schema; + ctxt->constructor->mainSchema = schema; /* * Locate and add the schema document. */ @@ -18969,7 +21011,7 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt) if (res == -1) goto exit_failure; if (res != 0) - goto exit; + goto exit; if (bucket == NULL) { /* TODO: Error code, actually we failed to *locate* the schema. */ @@ -19060,7 +21102,30 @@ xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt, return; ctxt->error = err; ctxt->warning = warn; - ctxt->userData = ctx; + ctxt->errCtxt = ctx; + if (ctxt->vctxt != NULL) + xmlSchemaSetValidErrors(ctxt->vctxt, err, warn, ctx); +} + +/** + * xmlSchemaSetParserStructuredErrors: + * @ctxt: a schema parser context + * @serror: the structured error function + * @ctx: the functions context + * + * Set the structured error callback + */ +void +xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx) +{ + if (ctxt == NULL) + return; + ctxt->serror = serror; + ctxt->errCtxt = ctx; + if (ctxt->vctxt != NULL) + xmlSchemaSetValidStructuredErrors(ctxt->vctxt, serror, ctx); } /** @@ -19076,8 +21141,8 @@ xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt, */ int xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, - xmlSchemaValidityErrorFunc * err, - xmlSchemaValidityWarningFunc * warn, void **ctx) + xmlSchemaValidityErrorFunc * err, + xmlSchemaValidityWarningFunc * warn, void **ctx) { if (ctxt == NULL) return(-1); @@ -19086,7 +21151,7 @@ xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, if (warn != NULL) *warn = ctxt->warning; if (ctx != NULL) - *ctx = ctxt->userData; + *ctx = ctxt->errCtxt; return(0); } @@ -19158,14 +21223,14 @@ xmlSchemaGetWhiteSpaceFacetValue(xmlSchemaTypePtr type) */ return(XML_SCHEMA_WHITESPACE_COLLAPSE); } - } else if (VARIETY_LIST(type)) { + } else if (WXS_IS_LIST(type)) { /* * For list types the facet "whiteSpace" is fixed to "collapse". */ return (XML_SCHEMA_WHITESPACE_COLLAPSE); - } else if (VARIETY_UNION(type)) { + } else if (WXS_IS_UNION(type)) { return (XML_SCHEMA_WHITESPACE_UNKNOWN); - } else if (VARIETY_ATOMIC(type)) { + } else if (WXS_IS_ATOMIC(type)) { if (type->flags & XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE) return (XML_SCHEMA_WHITESPACE_PRESERVE); else if (type->flags & XML_SCHEMAS_TYPE_WHITESPACE_REPLACE) @@ -19245,7 +21310,7 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt, return(ret); if (bucket == NULL) { PERROR_INT("xmlSchemaAssembleByLocation", - "no schema bucket aquired"); + "no schema bucket acquired"); return(-1); } /* @@ -19283,6 +21348,13 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt, * no error yet. */ xmlSchemaFixupComponents(pctxt); + ret = pctxt->err; + /* + * Not nice, but we need somehow to channel the schema parser + * error to the validation context. + */ + if ((ret != 0) && (vctxt->err == 0)) + vctxt->err = ret; vctxt->nberrors += pctxt->nberrors; } else { /* Add to validation error sum. */ @@ -19339,11 +21411,15 @@ xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt) /* * Parse the value; we will assume an even number of values * to be given (this is how Xerces and XSV work). + * + * URGENT TODO: !! This needs to work for both + * @noNamespaceSchemaLocation AND @schemaLocation on the same + * element !! */ iattr = xmlSchemaGetMetaAttrInfo(vctxt, XML_SCHEMA_ATTR_INFO_META_XSI_SCHEMA_LOC); if (iattr == NULL) - xmlSchemaGetMetaAttrInfo(vctxt, + iattr = xmlSchemaGetMetaAttrInfo(vctxt, XML_SCHEMA_ATTR_INFO_META_XSI_NO_NS_SCHEMA_LOC); if (iattr == NULL) return (0); @@ -19572,7 +21648,7 @@ xmlSchemaAugmentIDC(xmlSchemaIDCPtr idcDef, NULL); return; } - aidc->bubbleDepth = -1; + aidc->keyrefDepth = -1; aidc->def = idcDef; aidc->next = NULL; if (vctxt->aidcs == NULL) @@ -19581,6 +21657,12 @@ xmlSchemaAugmentIDC(xmlSchemaIDCPtr idcDef, aidc->next = vctxt->aidcs; vctxt->aidcs = aidc; } + /* + * Save if we have keyrefs at all. + */ + if ((vctxt->hasKeyrefs == 0) && + (idcDef->type == XML_SCHEMA_TYPE_IDC_KEYREF)) + vctxt->hasKeyrefs = 1; } /** @@ -19589,7 +21671,7 @@ xmlSchemaAugmentIDC(xmlSchemaIDCPtr idcDef, * * Creates a new IDC binding. * - * Returns the new binding in case of succeeded, NULL on internal errors. + * Returns the new IDC binding, NULL on internal errors. */ static xmlSchemaPSVIIDCBindingPtr xmlSchemaIDCNewBinding(xmlSchemaIDCPtr idcDef) @@ -19613,7 +21695,7 @@ xmlSchemaIDCNewBinding(xmlSchemaIDCPtr idcDef) * @vctxt: the WXS validation context * @item: the IDC node table item * - * The validation context is used to store an IDC node table items. + * The validation context is used to store IDC node table items. * They are stored to avoid copying them if IDC node-tables are merged * with corresponding parent IDC node-tables (bubbling). * @@ -19730,7 +21812,7 @@ xmlSchemaIDCAppendNodeTableItem(xmlSchemaPSVIIDCBindingPtr bind, } /** - * xmlSchemaIDCAquireBinding: + * xmlSchemaIDCAcquireBinding: * @vctxt: the WXS validation context * @matcher: the IDC matcher * @@ -19741,22 +21823,22 @@ xmlSchemaIDCAppendNodeTableItem(xmlSchemaPSVIIDCBindingPtr bind, * Returns an IDC binding or NULL on internal errors. */ static xmlSchemaPSVIIDCBindingPtr -xmlSchemaIDCAquireBinding(xmlSchemaValidCtxtPtr vctxt, +xmlSchemaIDCAcquireBinding(xmlSchemaValidCtxtPtr vctxt, xmlSchemaIDCMatcherPtr matcher) { - xmlSchemaNodeInfoPtr info; + xmlSchemaNodeInfoPtr ielem; - info = vctxt->elemInfos[matcher->depth]; + ielem = vctxt->elemInfos[matcher->depth]; - if (info->idcTable == NULL) { - info->idcTable = xmlSchemaIDCNewBinding(matcher->aidc->def); - if (info->idcTable == NULL) + if (ielem->idcTable == NULL) { + ielem->idcTable = xmlSchemaIDCNewBinding(matcher->aidc->def); + if (ielem->idcTable == NULL) return (NULL); - return(info->idcTable); + return(ielem->idcTable); } else { xmlSchemaPSVIIDCBindingPtr bind = NULL; - bind = info->idcTable; + bind = ielem->idcTable; do { if (bind->definition == matcher->aidc->def) return(bind); @@ -19772,6 +21854,15 @@ xmlSchemaIDCAquireBinding(xmlSchemaValidCtxtPtr vctxt, return (NULL); } +static xmlSchemaItemListPtr +xmlSchemaIDCAcquireTargetList(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED, + xmlSchemaIDCMatcherPtr matcher) +{ + if (matcher->targets == NULL) + matcher->targets = xmlSchemaItemListCreate(); + return(matcher->targets); +} + /** * xmlSchemaIDCFreeKey: * @key: the IDC key @@ -19795,21 +21886,10 @@ xmlSchemaIDCFreeKey(xmlSchemaPSVIIDCKeyPtr key) static void xmlSchemaIDCFreeBinding(xmlSchemaPSVIIDCBindingPtr bind) { - if (bind->nodeTable != NULL) { - if (bind->definition->type == XML_SCHEMA_TYPE_IDC_KEYREF) { - int i; - /* - * Node-table items for keyrefs are not stored globally - * to the validation context, since they are not bubbled. - * We need to free them here. - */ - for (i = 0; i < bind->nbNodes; i++) { - xmlFree(bind->nodeTable[i]->keys); - xmlFree(bind->nodeTable[i]); - } - } + if (bind->nodeTable != NULL) xmlFree(bind->nodeTable); - } + if (bind->dupls != NULL) + xmlSchemaItemListFree(bind->dupls); xmlFree(bind); } @@ -19849,7 +21929,25 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher) for (i = 0; i < matcher->sizeKeySeqs; i++) if (matcher->keySeqs[i] != NULL) xmlFree(matcher->keySeqs[i]); - xmlFree(matcher->keySeqs); + xmlFree(matcher->keySeqs); + } + if (matcher->targets != NULL) { + if (matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) { + int i; + xmlSchemaPSVIIDCNodePtr idcNode; + /* + * Node-table items for keyrefs are not stored globally + * to the validation context, since they are not bubbled. + * We need to free them here. + */ + for (i = 0; i < matcher->targets->nbItems; i++) { + idcNode = + (xmlSchemaPSVIIDCNodePtr) matcher->targets->items[i]; + xmlFree(idcNode->keys); + xmlFree(idcNode); + } + } + xmlSchemaItemListFree(matcher->targets); } xmlFree(matcher); matcher = next; @@ -19926,7 +22024,7 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, sto->sel = sel; sto->nbHistory = 0; -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: STO push '%s'\n", sto->sel->xpath); #endif @@ -19955,7 +22053,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, if (nodeType == XML_ATTRIBUTE_NODE) depth++; -#if DEBUG_IDC +#ifdef DEBUG_IDC { xmlChar *str = NULL; xmlGenericError(xmlGenericErrorContext, @@ -19971,7 +22069,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, first = vctxt->xpathStates; sto = first; while (sto != head) { -#if DEBUG_IDC +#ifdef DEBUG_IDC if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n", sto->matcher->aidc->def->name, sto->sel->xpath); @@ -19996,7 +22094,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, /* * Full match. */ -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: " "MATCH\n"); #endif @@ -20034,7 +22132,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, * Activate state objects for the IDC fields of * the IDC selector. */ -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: " "activating field states\n"); #endif @@ -20049,7 +22147,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, /* * An IDC key node was found by the IDC field. */ -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: key found\n"); #endif @@ -20084,15 +22182,16 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt, int count) { int i, res; - const xmlChar *value = NULL; + xmlChar *value = NULL; *buf = xmlStrdup(BAD_CAST "["); for (i = 0; i < count; i++) { *buf = xmlStrcat(*buf, BAD_CAST "'"); - res = xmlSchemaGetCanonValueWhtsp(seq[i]->val, &value, - xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type)); + res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val, + xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type), + &value); if (res == 0) - *buf = xmlStrcat(*buf, value); + *buf = xmlStrcat(*buf, BAD_CAST value); else { VERROR_INT("xmlSchemaFormatIDCKeySequence", "failed to compute a canonical value"); @@ -20103,7 +22202,7 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt, else *buf = xmlStrcat(*buf, BAD_CAST "'"); if (value != NULL) { - xmlFree((xmlChar *) value); + xmlFree(value); value = NULL; } } @@ -20156,13 +22255,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, xmlSchemaIDCStateObjPtr sto, nextsto; int res, matchDepth; xmlSchemaPSVIIDCKeyPtr key = NULL; - xmlSchemaTypePtr type = vctxt->inode->typeDef; + xmlSchemaTypePtr type = vctxt->inode->typeDef, simpleType = NULL; if (vctxt->xpathStates == NULL) return (0); sto = vctxt->xpathStates; -#if DEBUG_IDC +#ifdef DEBUG_IDC { xmlChar *str = NULL; xmlGenericError(xmlGenericErrorContext, @@ -20182,7 +22281,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, "calling xmlStreamPop()"); return (-1); } -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: stream pop '%s'\n", sto->sel->xpath); #endif @@ -20199,16 +22298,39 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, continue; } if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_FIELD) { - if (! IS_SIMPLE_TYPE(type)) { + /* + * NOTE: According to + * http://www.w3.org/Bugs/Public/show_bug.cgi?id=2198 + * ... the simple-content of complex types is also allowed. + */ + + if (WXS_IS_COMPLEX(type)) { + if (WXS_HAS_SIMPLE_CONTENT(type)) { + /* + * Sanity check for complex types with simple content. + */ + simpleType = type->contentTypeDef; + if (simpleType == NULL) { + VERROR_INT("xmlSchemaXPathProcessHistory", + "field resolves to a CT with simple content " + "but the CT is missing the ST definition"); + return (-1); + } + } else + simpleType = NULL; + } else + simpleType = type; + if (simpleType == NULL) { xmlChar *str = NULL; + /* * Not qualified if the field resolves to a node of non * simple type. */ xmlSchemaCustomErr(ACTXT_CAST vctxt, XML_SCHEMAV_CVC_IDC, NULL, - (xmlSchemaTypePtr) sto->matcher->aidc->def, - "The field '%s' of %s does evaluate to a node of " + WXS_BASIC_CAST sto->matcher->aidc->def, + "The XPath '%s' of a field of %s does evaluate to a node of " "non-simple type", sto->sel->xpath, xmlSchemaGetIDCDesignation(&str, sto->matcher->aidc->def)); @@ -20216,13 +22338,14 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, sto->nbHistory--; goto deregister_check; } + if ((key == NULL) && (vctxt->inode->val == NULL)) { /* * Failed to provide the normalized value; maybe * the value was invalid. */ VERROR(XML_SCHEMAV_CVC_IDC, - (xmlSchemaTypePtr) sto->matcher->aidc->def, + WXS_BASIC_CAST sto->matcher->aidc->def, "Warning: No precomputed value available, the value " "was either invalid or something strange happend"); sto->nbHistory--; @@ -20237,6 +22360,18 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * key-sequences. The position in this list is determined * by the target node's depth relative to the matcher's * depth of creation (i.e. the depth of the scope element). + * + * Element Depth Pos List-entries + * 0 NULL + * 1 NULL + * 2 2 target + * + * + * + * The size of the list is only dependant on the depth of + * the tree. + * An entry will be NULLed in selector_leave, i.e. when + * we hit the target's */ pos = sto->depth - matcher->depth; idx = sto->sel->index; @@ -20289,33 +22424,30 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, keySeq = matcher->keySeqs[pos]; if (keySeq == NULL) { goto create_sequence; - } else { - if (keySeq[idx] != NULL) { - xmlChar *str = NULL; - /* - * cvc-identity-constraint: - * 3 For each node in the ·target node set· all - * of the {fields}, with that node as the context - * node, evaluate to either an empty node-set or - * a node-set with exactly one member, which must - * have a simple type. - * - * The key was already set; report an error. - */ - xmlSchemaCustomErr(ACTXT_CAST vctxt, - XML_SCHEMAV_CVC_IDC, NULL, - (xmlSchemaTypePtr) matcher->aidc->def, - "The field '%s' of %s evaluates to a node-set " - "with more than one member", - sto->sel->xpath, - xmlSchemaGetIDCDesignation(&str, matcher->aidc->def)); - FREE_AND_NULL(str); - sto->nbHistory--; - goto deregister_check; - } else { - goto create_key; - } - } + } else if (keySeq[idx] != NULL) { + xmlChar *str = NULL; + /* + * cvc-identity-constraint: + * 3 For each node in the ·target node set· all + * of the {fields}, with that node as the context + * node, evaluate to either an empty node-set or + * a node-set with exactly one member, which must + * have a simple type. + * + * The key was already set; report an error. + */ + xmlSchemaCustomErr(ACTXT_CAST vctxt, + XML_SCHEMAV_CVC_IDC, NULL, + WXS_BASIC_CAST matcher->aidc->def, + "The XPath '%s' of a field of %s evaluates to a " + "node-set with more than one member", + sto->sel->xpath, + xmlSchemaGetIDCDesignation(&str, matcher->aidc->def)); + FREE_AND_NULL(str); + sto->nbHistory--; + goto deregister_check; + } else + goto create_key; create_sequence: /* @@ -20334,7 +22466,7 @@ create_sequence: matcher->keySeqs[pos] = keySeq; create_key: /* - * Created a key once per node only. + * Create a key once per node only. */ if (key == NULL) { key = (xmlSchemaPSVIIDCKeyPtr) xmlMalloc( @@ -20349,7 +22481,7 @@ create_key: /* * Consume the compiled value. */ - key->type = type; + key->type = simpleType; key->val = vctxt->inode->val; vctxt->inode->val = NULL; /* @@ -20365,10 +22497,11 @@ create_key: } else if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) { xmlSchemaPSVIIDCKeyPtr **keySeq = NULL; - xmlSchemaPSVIIDCBindingPtr bind; + /* xmlSchemaPSVIIDCBindingPtr bind; */ xmlSchemaPSVIIDCNodePtr ntItem; xmlSchemaIDCMatcherPtr matcher; xmlSchemaIDCPtr idc; + xmlSchemaItemListPtr targets; int pos, i, j, nbKeys; /* * Here we have the following scenario: @@ -20432,9 +22565,12 @@ create_key: * Get the IDC binding from the matcher and check for * duplicate key-sequences. */ - bind = xmlSchemaIDCAquireBinding(vctxt, matcher); +#if 0 + bind = xmlSchemaIDCAcquireBinding(vctxt, matcher); +#endif + targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher); if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) && - (bind->nbNodes != 0)) { + (targets->nbItems != 0)) { xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq; i = 0; @@ -20443,32 +22579,38 @@ create_key: * Compare the key-sequences, key by key. */ do { - bkeySeq = bind->nodeTable[i]->keys; + bkeySeq = + ((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys; for (j = 0; j < nbKeys; j++) { ckey = (*keySeq)[j]; bkey = bkeySeq[j]; res = xmlSchemaAreValuesEqual(ckey->val, bkey->val); if (res == -1) { return (-1); - } else if (res == 0) + } else if (res == 0) { + /* + * One of the keys differs, so the key-sequence + * won't be equal; get out. + */ break; + } } if (res == 1) { /* - * Duplicate found. + * Duplicate key-sequence found. */ break; } i++; - } while (i < bind->nbNodes); - if (i != bind->nbNodes) { + } while (i < targets->nbItems); + if (i != targets->nbItems) { xmlChar *str = NULL, *strB = NULL; /* * TODO: Try to report the key-sequence. */ xmlSchemaCustomErr(ACTXT_CAST vctxt, XML_SCHEMAV_CVC_IDC, NULL, - (xmlSchemaTypePtr) idc, + WXS_BASIC_CAST idc, "Duplicate key-sequence %s in %s", xmlSchemaFormatIDCKeySequence(vctxt, &str, (*keySeq), nbKeys), @@ -20493,7 +22635,7 @@ create_key: memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode)); /* - * Store the node-table item on global list. + * Store the node-table item in a global list. */ if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) { if (xmlSchemaIDCStoreNodeTableItem(vctxt, ntItem) == -1) { @@ -20525,7 +22667,10 @@ create_key: ntItem->nodeLine = vctxt->inode->nodeLine; ntItem->keys = *keySeq; *keySeq = NULL; - if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) { +#if 0 + if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) { +#endif + if (xmlSchemaItemListAdd(targets, ntItem) == -1) { if (idc->type == XML_SCHEMA_TYPE_IDC_KEYREF) { /* * Free the item, since keyref items won't be @@ -20549,7 +22694,7 @@ selector_key_error: */ xmlSchemaCustomErr(ACTXT_CAST vctxt, XML_SCHEMAV_CVC_IDC, NULL, - (xmlSchemaTypePtr) idc, + WXS_BASIC_CAST idc, "Not all fields of %s evaluate to a node", xmlSchemaGetIDCDesignation(&str, idc), NULL); FREE_AND_NULL(str); @@ -20571,7 +22716,7 @@ deregister_check: * Deregister state objects if they reach the depth of creation. */ if ((sto->nbHistory == 0) && (sto->depth == depth)) { -#if DEBUG_IDC +#ifdef DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: STO pop '%s'\n", sto->sel->xpath); #endif @@ -20619,7 +22764,7 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, if (idc == NULL) return (0); -#if DEBUG_IDC +#ifdef DEBUG_IDC { xmlChar *str = NULL; xmlGenericError(xmlGenericErrorContext, @@ -20640,13 +22785,17 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, * Since IDCs bubbles are expensive we need to know the * depth at which the bubbles should stop; this will be * the depth of the top-most keyref IDC. If no keyref - * references a key/unique IDC, the bubbleDepth will + * references a key/unique IDC, the keyrefDepth will * be -1, indicating that no bubbles are needed. */ refIdc = (xmlSchemaIDCPtr) idc->ref->item; if (refIdc != NULL) { /* - * Lookup the augmented IDC. + * Remember that we have keyrefs on this node. + */ + vctxt->inode->hasKeyrefs = 1; + /* + * Lookup the referenced augmented IDC info. */ aidc = vctxt->aidcs; while (aidc != NULL) { @@ -20660,9 +22809,9 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, "definition"); return (-1); } - if ((aidc->bubbleDepth == -1) || - (vctxt->depth < aidc->bubbleDepth)) - aidc->bubbleDepth = vctxt->depth; + if ((aidc->keyrefDepth == -1) || + (vctxt->depth < aidc->keyrefDepth)) + aidc->keyrefDepth = vctxt->depth; } } /* @@ -20696,22 +22845,208 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, last->next = matcher; last = matcher; - matcher->type = IDC_MATCHER; - matcher->depth = vctxt->depth; - matcher->aidc = aidc; -#if DEBUG_IDC - xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n"); -#endif - /* - * Init the automaton state object. - */ - if (xmlSchemaIDCAddStateObject(vctxt, matcher, - idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1) - return (-1); + matcher->type = IDC_MATCHER; + matcher->depth = vctxt->depth; + matcher->aidc = aidc; + matcher->idcType = aidc->def->type; +#ifdef DEBUG_IDC + xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n"); +#endif + /* + * Init the automaton state object. + */ + if (xmlSchemaIDCAddStateObject(vctxt, matcher, + idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1) + return (-1); + + idc = idc->next; + } while (idc != NULL); + return (0); +} + +static int +xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt, + xmlSchemaNodeInfoPtr ielem) +{ + xmlSchemaPSVIIDCBindingPtr bind; + int res, i, j, k, nbTargets, nbFields, nbDupls, nbNodeTable; + xmlSchemaPSVIIDCKeyPtr *keys, *ntkeys; + xmlSchemaPSVIIDCNodePtr *targets, *dupls; + + xmlSchemaIDCMatcherPtr matcher = ielem->idcMatchers; + /* vctxt->createIDCNodeTables */ + while (matcher != NULL) { + /* + * Skip keyref IDCs and empty IDC target-lists. + */ + if ((matcher->aidc->def->type == XML_SCHEMA_TYPE_IDC_KEYREF) || + WXS_ILIST_IS_EMPTY(matcher->targets)) + { + matcher = matcher->next; + continue; + } + /* + * If we _want_ the IDC node-table to be created in any case + * then do so. Otherwise create them only if keyrefs need them. + */ + if ((! vctxt->createIDCNodeTables) && + ((matcher->aidc->keyrefDepth == -1) || + (matcher->aidc->keyrefDepth > vctxt->depth))) + { + matcher = matcher->next; + continue; + } + /* + * Get/create the IDC binding on this element for the IDC definition. + */ + bind = xmlSchemaIDCAcquireBinding(vctxt, matcher); + + if (! WXS_ILIST_IS_EMPTY(bind->dupls)) { + dupls = (xmlSchemaPSVIIDCNodePtr *) bind->dupls->items; + nbDupls = bind->dupls->nbItems; + } else { + dupls = NULL; + nbDupls = 0; + } + if (bind->nodeTable != NULL) { + nbNodeTable = bind->nbNodes; + } else { + nbNodeTable = 0; + } + + if ((nbNodeTable == 0) && (nbDupls == 0)) { + /* + * Transfer all IDC target-nodes to the IDC node-table. + */ + bind->nodeTable = + (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items; + bind->sizeNodes = matcher->targets->sizeItems; + bind->nbNodes = matcher->targets->nbItems; + + matcher->targets->items = NULL; + matcher->targets->sizeItems = 0; + matcher->targets->nbItems = 0; + } else { + /* + * Compare the key-sequences and add to the IDC node-table. + */ + nbTargets = matcher->targets->nbItems; + targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items; + nbFields = matcher->aidc->def->nbFields; + i = 0; + do { + keys = targets[i]->keys; + if (nbDupls) { + /* + * Search in already found duplicates first. + */ + j = 0; + do { + if (nbFields == 1) { + res = xmlSchemaAreValuesEqual(keys[0]->val, + dupls[j]->keys[0]->val); + if (res == -1) + goto internal_error; + if (res == 1) { + /* + * Equal key-sequence. + */ + goto next_target; + } + } else { + res = 0; + ntkeys = dupls[j]->keys; + for (k = 0; k < nbFields; k++) { + res = xmlSchemaAreValuesEqual(keys[k]->val, + ntkeys[k]->val); + if (res == -1) + goto internal_error; + if (res == 0) { + /* + * One of the keys differs. + */ + break; + } + } + if (res == 1) { + /* + * Equal key-sequence found. + */ + goto next_target; + } + } + j++; + } while (j < nbDupls); + } + if (nbNodeTable) { + j = 0; + do { + if (nbFields == 1) { + res = xmlSchemaAreValuesEqual(keys[0]->val, + bind->nodeTable[j]->keys[0]->val); + if (res == -1) + goto internal_error; + if (res == 0) { + /* + * The key-sequence differs. + */ + goto next_node_table_entry; + } + } else { + res = 0; + ntkeys = bind->nodeTable[j]->keys; + for (k = 0; k < nbFields; k++) { + res = xmlSchemaAreValuesEqual(keys[k]->val, + ntkeys[k]->val); + if (res == -1) + goto internal_error; + if (res == 0) { + /* + * One of the keys differs. + */ + goto next_node_table_entry; + } + } + } + /* + * Add the duplicate to the list of duplicates. + */ + if (bind->dupls == NULL) { + bind->dupls = xmlSchemaItemListCreate(); + if (bind->dupls == NULL) + goto internal_error; + } + if (xmlSchemaItemListAdd(bind->dupls, bind->nodeTable[j]) == -1) + goto internal_error; + /* + * Remove the duplicate entry from the IDC node-table. + */ + bind->nodeTable[j] = bind->nodeTable[bind->nbNodes -1]; + bind->nbNodes--; + + goto next_target; - idc = idc->next; - } while (idc != NULL); - return (0); +next_node_table_entry: + j++; + } while (j < nbNodeTable); + } + /* + * If everything is fine, then add the IDC target-node to + * the IDC node-table. + */ + if (xmlSchemaIDCAppendNodeTableItem(bind, targets[i]) == -1) + goto internal_error; + +next_target: + i++; + } while (i < nbTargets); + } + matcher = matcher->next; + } + return(0); + +internal_error: + return(-1); } /** @@ -20729,26 +23064,11 @@ static int xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) { xmlSchemaPSVIIDCBindingPtr bind; /* IDC bindings of the current node. */ - xmlSchemaPSVIIDCBindingPtr *parTable, parBind = NULL, lastParBind = NULL; /* parent IDC bindings. */ - xmlSchemaPSVIIDCNodePtr node, parNode = NULL; /* node-table entries. */ - xmlSchemaPSVIIDCKeyPtr key, parKey; /* keys of in a key-sequence. */ + xmlSchemaPSVIIDCBindingPtr *parTable, parBind = NULL; /* parent IDC bindings. */ + xmlSchemaPSVIIDCNodePtr node, parNode = NULL, *dupls, *parNodes; /* node-table entries. */ xmlSchemaIDCAugPtr aidc; - int i, j, k, ret = 0, oldNum, newDupls; - int duplTop; + int i, j, k, ret = 0, nbFields, oldNum, oldDupls; - /* - * The node table has the following sections: - * - * O --> old node-table entries (first) - * O - * + --> new node-table entries - * + - * % --> new duplicate node-table entries - * % - * # --> old duplicate node-table entries - * # (last) - * - */ bind = vctxt->inode->idcTable; if (bind == NULL) { /* Fine, no table, no bubbles. */ @@ -20760,136 +23080,160 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) * Walk all bindings; create new or add to existing bindings. * Remove duplicate key-sequences. */ -start_binding: while (bind != NULL) { - /* - * Skip keyref IDCs. - */ - if (bind->definition->type == XML_SCHEMA_TYPE_IDC_KEYREF) { - bind = bind->next; - continue; - } + + if ((bind->nbNodes == 0) && WXS_ILIST_IS_EMPTY(bind->dupls)) + goto next_binding; /* * Check if the key/unique IDC table needs to be bubbled. */ - aidc = vctxt->aidcs; - do { - if (aidc->def == bind->definition) { - if ((aidc->bubbleDepth == -1) || - (aidc->bubbleDepth >= vctxt->depth)) { - bind = bind->next; - goto start_binding; + if (! vctxt->createIDCNodeTables) { + aidc = vctxt->aidcs; + do { + if (aidc->def == bind->definition) { + if ((aidc->keyrefDepth == -1) || + (aidc->keyrefDepth >= vctxt->depth)) { + goto next_binding; + } + break; } - break; - } - aidc = aidc->next; - } while (aidc != NULL); + aidc = aidc->next; + } while (aidc != NULL); + } if (parTable != NULL) parBind = *parTable; - while (parBind != NULL) { + /* + * Search a matching parent binding for the + * IDC definition. + */ + while (parBind != NULL) { + if (parBind->definition == bind->definition) + break; + parBind = parBind->next; + } + + if (parBind != NULL) { /* - * Search a matching parent binding for the - * IDC definition. + * Compare every node-table entry of the child node, + * i.e. the key-sequence within, ... */ - if (parBind->definition == bind->definition) { + oldNum = parBind->nbNodes; /* Skip newly added items. */ + if (! WXS_ILIST_IS_EMPTY(parBind->dupls)) { + oldDupls = parBind->dupls->nbItems; + dupls = (xmlSchemaPSVIIDCNodePtr *) parBind->dupls->items; + } else { + dupls = NULL; + oldDupls = 0; + } + + parNodes = parBind->nodeTable; + nbFields = bind->definition->nbFields; + + for (i = 0; i < bind->nbNodes; i++) { + node = bind->nodeTable[i]; + if (node == NULL) + continue; /* - * Compare every node-table entry of the child node, - * i.e. the key-sequence within, ... + * ...with every key-sequence of the parent node, already + * evaluated to be a duplicate key-sequence. */ - oldNum = parBind->nbNodes; /* Skip newly added items. */ - duplTop = oldNum + parBind->nbDupls; - newDupls = 0; - - for (i = 0; i < bind->nbNodes; i++) { - node = bind->nodeTable[i]; - if (node == NULL) - continue; - /* - * ...with every key-sequence of the parent node, already - * evaluated to be a duplicate key-sequence. - */ - if (parBind->nbDupls != 0) { - j = bind->nbNodes + newDupls; - while (j < duplTop) { - parNode = parBind->nodeTable[j]; - for (k = 0; k < bind->definition->nbFields; k++) { - key = node->keys[k]; - parKey = parNode->keys[k]; - ret = xmlSchemaAreValuesEqual(key->val, - parKey->val); - if (ret == -1) { - /* TODO: Internal error */ - return(-1); - } else if (ret == 0) + if (oldDupls) { + j = 0; + while (j < oldDupls) { + if (nbFields == 1) { + ret = xmlSchemaAreValuesEqual( + node->keys[0]->val, + dupls[j]->keys[0]->val); + if (ret == -1) + goto internal_error; + if (ret == 0) { + j++; + continue; + } + } else { + parNode = dupls[j]; + for (k = 0; k < nbFields; k++) { + ret = xmlSchemaAreValuesEqual( + node->keys[k]->val, + parNode->keys[k]->val); + if (ret == -1) + goto internal_error; + if (ret == 0) break; - } - if (ret == 1) - /* Duplicate found. */ - break; - j++; } - if (j != duplTop) { + if (ret == 1) /* Duplicate found. */ - continue; - } - } - /* - * ... and with every key-sequence of the parent node. - */ - j = 0; + break; + j++; + } + if (j != oldDupls) { + /* Duplicate found. Skip this entry. */ + continue; + } + } + /* + * ... and with every key-sequence of the parent node. + */ + if (oldNum) { + j = 0; while (j < oldNum) { - parNode = parBind->nodeTable[j]; - /* - * Compare key by key. - */ - for (k = 0; k < parBind->definition->nbFields; k++) { - key = node->keys[k]; - parKey = parNode->keys[k]; - - ret = xmlSchemaAreValuesEqual(key->val, - parKey->val); - if (ret == -1) { - /* TODO: Internal error */ - } else if (ret == 0) - break; - + parNode = parNodes[j]; + if (nbFields == 1) { + ret = xmlSchemaAreValuesEqual( + node->keys[0]->val, + parNode->keys[0]->val); + if (ret == -1) + goto internal_error; + if (ret == 0) { + j++; + continue; + } + } else { + for (k = 0; k < nbFields; k++) { + ret = xmlSchemaAreValuesEqual( + node->keys[k]->val, + parNode->keys[k]->val); + if (ret == -1) + goto internal_error; + if (ret == 0) + break; + } } if (ret == 1) - /* - * The key-sequences are equal. - */ + /* Duplicate found. */ break; j++; } if (j != oldNum) { /* - * Handle duplicates. - */ - newDupls++; + * Handle duplicates. Move the duplicate in + * the parent's node-table to the list of + * duplicates. + */ oldNum--; parBind->nbNodes--; /* * Move last old item to pos of duplicate. */ - parBind->nodeTable[j] = - parBind->nodeTable[oldNum]; + parNodes[j] = parNodes[oldNum]; if (parBind->nbNodes != oldNum) { /* * If new items exist, move last new item to * last of old items. */ - parBind->nodeTable[oldNum] = - parBind->nodeTable[parBind->nbNodes]; + parNodes[oldNum] = + parNodes[parBind->nbNodes]; } - /* - * Move duplicate to last pos of new/old items. - */ - parBind->nodeTable[parBind->nbNodes] = parNode; - + if (parBind->dupls == NULL) { + parBind->dupls = xmlSchemaItemListCreate(); + if (parBind->dupls == NULL) + goto internal_error; + } + xmlSchemaItemListAdd(parBind->dupls, parNode); } else { /* * Add the node-table entry (node and key-sequence) of @@ -20901,10 +23245,10 @@ start_binding: if (parBind->nodeTable == NULL) { xmlSchemaVErrMemory(NULL, "allocating IDC list of node-table items", NULL); - return(-1); + goto internal_error; } parBind->sizeNodes = 1; - } else if (duplTop >= parBind->sizeNodes) { + } else if (parBind->nbNodes >= parBind->sizeNodes) { parBind->sizeNodes *= 2; parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) xmlRealloc(parBind->nodeTable, parBind->sizeNodes * @@ -20912,71 +23256,94 @@ start_binding: if (parBind->nodeTable == NULL) { xmlSchemaVErrMemory(NULL, "re-allocating IDC list of node-table items", NULL); - return(-1); - } - } - - /* - * Move first old duplicate to last position - * of old duplicates +1. - */ - if (parBind->nbDupls != 0) { - parBind->nodeTable[duplTop] = - parBind->nodeTable[parBind->nbNodes + newDupls]; - } - /* - * Move first new duplicate to last position of - * new duplicates +1. - */ - if (newDupls != 0) { - parBind->nodeTable[parBind->nbNodes + newDupls] = - parBind->nodeTable[parBind->nbNodes]; + goto internal_error; + } } + parNodes = parBind->nodeTable; /* * Append the new node-table entry to the 'new node-table * entries' section. */ - parBind->nodeTable[parBind->nbNodes] = node; - parBind->nbNodes++; - duplTop++; + parNodes[parBind->nbNodes++] = node; } - } - parBind->nbDupls += newDupls; - break; - } - if (parBind->next == NULL) - lastParBind = parBind; - parBind = parBind->next; - } - if ((parBind == NULL) && (bind->nbNodes != 0)) { + + } + + } + } else { /* * No binding for the IDC was found: create a new one and * copy all node-tables. */ parBind = xmlSchemaIDCNewBinding(bind->definition); if (parBind == NULL) - return(-1); - - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) - xmlMalloc(bind->nbNodes * sizeof(xmlSchemaPSVIIDCNodePtr)); - if (parBind->nodeTable == NULL) { - xmlSchemaVErrMemory(NULL, - "allocating an array of IDC node-table items", NULL); - xmlSchemaIDCFreeBinding(parBind); - return(-1); + goto internal_error; + + /* + * TODO: Hmm, how to optimize the initial number of + * allocated entries? + */ + if (bind->nbNodes != 0) { + /* + * Add all IDC node-table entries. + */ + if (! vctxt->psviExposeIDCNodeTables) { + /* + * Just move the entries. + * NOTE: this is quite save here, since + * all the keyref lookups have already been + * performed. + */ + parBind->nodeTable = bind->nodeTable; + bind->nodeTable = NULL; + parBind->sizeNodes = bind->sizeNodes; + bind->sizeNodes = 0; + parBind->nbNodes = bind->nbNodes; + bind->nbNodes = 0; + } else { + /* + * Copy the entries. + */ + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) + xmlMalloc(bind->nbNodes * + sizeof(xmlSchemaPSVIIDCNodePtr)); + if (parBind->nodeTable == NULL) { + xmlSchemaVErrMemory(NULL, + "allocating an array of IDC node-table " + "items", NULL); + xmlSchemaIDCFreeBinding(parBind); + goto internal_error; + } + parBind->sizeNodes = bind->nbNodes; + parBind->nbNodes = bind->nbNodes; + memcpy(parBind->nodeTable, bind->nodeTable, + bind->nbNodes * sizeof(xmlSchemaPSVIIDCNodePtr)); + } + } + if (bind->dupls) { + /* + * Move the duplicates. + */ + if (parBind->dupls != NULL) + xmlSchemaItemListFree(parBind->dupls); + parBind->dupls = bind->dupls; + bind->dupls = NULL; } - parBind->sizeNodes = bind->nbNodes; - parBind->nbNodes = bind->nbNodes; - memcpy(parBind->nodeTable, bind->nodeTable, - bind->nbNodes * sizeof(xmlSchemaPSVIIDCNodePtr)); if (*parTable == NULL) *parTable = parBind; - else - lastParBind->next = parBind; - } + else { + parBind->next = *parTable; + *parTable = parBind; + } + } + +next_binding: bind = bind->next; - } + } return (0); + +internal_error: + return(-1); } /** @@ -20989,45 +23356,48 @@ start_binding: static int xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) { - xmlSchemaPSVIIDCBindingPtr refbind, bind; - - refbind = vctxt->inode->idcTable; + xmlSchemaIDCMatcherPtr matcher; + xmlSchemaPSVIIDCBindingPtr bind; + + matcher = vctxt->inode->idcMatchers; /* * Find a keyref. */ - while (refbind != NULL) { - if (refbind->definition->type == XML_SCHEMA_TYPE_IDC_KEYREF) { - int i, j, k, res; + while (matcher != NULL) { + if ((matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) && + matcher->targets && + matcher->targets->nbItems) + { + int i, j, k, res, nbFields, hasDupls; xmlSchemaPSVIIDCKeyPtr *refKeys, *keys; - xmlSchemaPSVIIDCKeyPtr refKey, key; xmlSchemaPSVIIDCNodePtr refNode = NULL; + nbFields = matcher->aidc->def->nbFields; + /* - * Find the referred key/unique. + * Find the IDC node-table for the referenced IDC key/unique. */ bind = vctxt->inode->idcTable; - do { - if ((xmlSchemaIDCPtr) refbind->definition->ref->item == + while (bind != NULL) { + if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item == bind->definition) break; bind = bind->next; - } while (bind != NULL); - + } + hasDupls = (bind && bind->dupls && bind->dupls->nbItems) ? 1 : 0; /* * Search for a matching key-sequences. */ - for (i = 0; i < refbind->nbNodes; i++) { + for (i = 0; i < matcher->targets->nbItems; i++) { res = 0; - refNode = refbind->nodeTable[i]; + refNode = matcher->targets->items[i]; if (bind != NULL) { refKeys = refNode->keys; for (j = 0; j < bind->nbNodes; j++) { keys = bind->nodeTable[j]->keys; - for (k = 0; k < bind->definition->nbFields; k++) { - refKey = refKeys[k]; - key = keys[k]; - res = xmlSchemaAreValuesEqual(key->val, - refKey->val); + for (k = 0; k < nbFields; k++) { + res = xmlSchemaAreValuesEqual(keys[k]->val, + refKeys[k]->val); if (res == 0) break; else if (res == -1) { @@ -21041,27 +23411,61 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) break; } } + if ((res == 0) && hasDupls) { + /* + * Search in duplicates + */ + for (j = 0; j < bind->dupls->nbItems; j++) { + keys = ((xmlSchemaPSVIIDCNodePtr) + bind->dupls->items[j])->keys; + for (k = 0; k < nbFields; k++) { + res = xmlSchemaAreValuesEqual(keys[k]->val, + refKeys[k]->val); + if (res == 0) + break; + else if (res == -1) { + return (-1); + } + } + if (res == 1) { + /* + * Match in duplicates found. + */ + xmlChar *str = NULL, *strB = NULL; + xmlSchemaKeyrefErr(vctxt, + XML_SCHEMAV_CVC_IDC, refNode, + (xmlSchemaTypePtr) matcher->aidc->def, + "More than one match found for " + "key-sequence %s of keyref '%s'", + xmlSchemaFormatIDCKeySequence(vctxt, &str, + refNode->keys, nbFields), + xmlSchemaGetComponentQName(&strB, + matcher->aidc->def)); + FREE_AND_NULL(str); + FREE_AND_NULL(strB); + break; + } + } + } } + if (res == 0) { xmlChar *str = NULL, *strB = NULL; xmlSchemaKeyrefErr(vctxt, XML_SCHEMAV_CVC_IDC, refNode, - (xmlSchemaTypePtr) refbind->definition, - "No match found for key-sequence %s of key " - "reference '%s'", + (xmlSchemaTypePtr) matcher->aidc->def, + "No match found for key-sequence %s of keyref '%s'", xmlSchemaFormatIDCKeySequence(vctxt, &str, - refbind->nodeTable[i]->keys, - refbind->definition->nbFields), - xmlSchemaFormatQName(&strB, - refbind->definition->targetNamespace, - refbind->definition->name)); + refNode->keys, nbFields), + xmlSchemaGetComponentQName(&strB, matcher->aidc->def)); FREE_AND_NULL(str); FREE_AND_NULL(strB); } } } - refbind = refbind->next; + matcher = matcher->next; } + /* TODO: Return an error if any error encountered. */ return (0); } @@ -21183,6 +23587,8 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, static void xmlSchemaClearElemInfo(xmlSchemaNodeInfoPtr ielem) { + ielem->hasKeyrefs = 0; + ielem->appliedXPath = 0; if (ielem->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_NAMES) { FREE_AND_NULL(ielem->localName); FREE_AND_NULL(ielem->nsName); @@ -21196,14 +23602,24 @@ xmlSchemaClearElemInfo(xmlSchemaNodeInfoPtr ielem) ielem->value = NULL; } if (ielem->val != NULL) { + /* + * PSVI TODO: Be careful not to free it when the value is + * exposed via PSVI. + */ xmlSchemaFreeValue(ielem->val); ielem->val = NULL; } if (ielem->idcMatchers != NULL) { + /* + * URGENT OPTIMIZE TODO: Use a pool of IDC matchers. + */ xmlSchemaIDCFreeMatcherList(ielem->idcMatchers); ielem->idcMatchers = NULL; } if (ielem->idcTable != NULL) { + /* + * OPTIMIZE TODO: Use a pool of IDC tables??. + */ xmlSchemaIDCFreeIDCTable(ielem->idcTable); ielem->idcTable = NULL; } @@ -21328,9 +23744,9 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, if (type->facetSet == NULL) goto pattern_and_enum; - if (! VARIETY_ATOMIC(type)) { - if (VARIETY_LIST(type)) - goto variety_list; + if (! WXS_IS_ATOMIC(type)) { + if (WXS_IS_LIST(type)) + goto WXS_IS_LIST; else goto pattern_and_enum; } @@ -21340,7 +23756,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, */ tmpType = xmlSchemaGetPrimitiveType(type); if ((tmpType->builtInType == XML_SCHEMAS_STRING) || - IS_ANY_SIMPLE_TYPE(tmpType)) { + WXS_IS_ANY_SIMPLE_TYPE(tmpType)) { ws = xmlSchemaGetWhiteSpaceFacetValue(type); } else ws = XML_SCHEMA_WHITESPACE_COLLAPSE; @@ -21393,8 +23809,8 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, ret = 0; } -variety_list: - if (! VARIETY_LIST(type)) +WXS_IS_LIST: + if (! WXS_IS_LIST(type)) goto pattern_and_enum; /* * "length", "minLength" and "maxLength" of list types. @@ -21579,7 +23995,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt, if (nsName == NULL) { ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; xmlSchemaCustomErr(ACTXT_CAST vctxt, ret, NULL, - xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), + WXS_BASIC_CAST xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), "The QName value '%s' has no " "corresponding namespace declaration in " "scope", value, NULL); @@ -21615,7 +24031,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, { int ret = 0, valNeeded = (retVal) ? 1 : 0; xmlSchemaValPtr val = NULL; - xmlSchemaWhitespaceValueType ws; + /* xmlSchemaWhitespaceValueType ws; */ xmlChar *normValue = NULL; #define NORMALIZE(atype) \ @@ -21657,7 +24073,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, valNeeded = 1; if (value == NULL) value = BAD_CAST ""; - if (IS_ANY_SIMPLE_TYPE(type) || VARIETY_ATOMIC(type)) { + if (WXS_IS_ANY_SIMPLE_TYPE(type) || WXS_IS_ATOMIC(type)) { xmlSchemaTypePtr biType; /* The built-in type. */ /* * SPEC (1.2.1) "if {variety} is ·atomic· then the string must ·match· @@ -21700,7 +24116,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, value, &val, valNeeded); break; default: - ws = xmlSchemaGetWhiteSpaceFacetValue(type); + /* ws = xmlSchemaGetWhiteSpaceFacetValue(type); */ if (valNeeded) ret = xmlSchemaValPredefTypeNodeNoNorm(biType, value, &val, NULL); @@ -21717,7 +24133,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, value, &val, valNeeded); break; default: - ws = xmlSchemaGetWhiteSpaceFacetValue(type); + /* ws = xmlSchemaGetWhiteSpaceFacetValue(type); */ if (valNeeded) ret = xmlSchemaValPredefTypeNodeNoNorm(biType, value, &val, node); @@ -21739,7 +24155,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "validating against a built-in type"); goto internal_error; } - if (VARIETY_LIST(type)) + if (WXS_IS_LIST(type)) ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; @@ -21757,7 +24173,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "validating facets of atomic simple type"); goto internal_error; } - if (VARIETY_LIST(type)) + if (WXS_IS_LIST(type)) ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; @@ -21765,7 +24181,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, } if (fireErrors && (ret > 0)) xmlSchemaSimpleTypeErr(actxt, ret, node, value, type, 1); - } else if (VARIETY_LIST(type)) { + } else if (WXS_IS_LIST(type)) { xmlSchemaTypePtr itemType; const xmlChar *cur, *end; @@ -21785,7 +24201,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * VAL TODO: Optimize validation of empty values. * VAL TODO: We do not have computed values for lists. */ - itemType = GET_LIST_ITEM_TYPE(type); + itemType = WXS_LIST_ITEMTYPE(type); cur = value; do { while (IS_BLANK_CH(*cur)) @@ -21852,7 +24268,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, NORMALIZE(type); xmlSchemaSimpleTypeErr(actxt, ret, node, value, type, 1); } - } else if (VARIETY_UNION(type)) { + } else if (WXS_IS_UNION(type)) { xmlSchemaTypeLinkPtr memberLink; /* * TODO: For all datatypes ·derived· by ·union· whiteSpace does @@ -21993,7 +24409,7 @@ xmlSchemaVExpandQName(xmlSchemaValidCtxtPtr vctxt, if (*nsName == NULL) { xmlSchemaCustomErr(ACTXT_CAST vctxt, XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, NULL, - xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), + WXS_BASIC_CAST xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), "The QName value '%s' has no " "corresponding namespace declaration in scope", value, NULL); @@ -22055,7 +24471,7 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt, xmlSchemaCustomErr(ACTXT_CAST vctxt, XML_SCHEMAV_CVC_ELT_4_2, NULL, - xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), + WXS_BASIC_CAST xmlSchemaGetBuiltInType(XML_SCHEMAS_QNAME), "The QName value '%s' of the xsi:type attribute does not " "resolve to a type definition", xmlSchemaFormatQName(&str, nsName, local), NULL); @@ -22081,6 +24497,11 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt, * {disallowed substitutions}: the "block" on the element decl. * {prohibited substitutions}: the "block" on the type def. */ + /* + * OPTIMIZE TODO: We could map types already evaluated + * to be validly derived from other types to avoid checking + * this over and over for the same types. + */ if ((elemDecl->flags & XML_SCHEMAS_ELEM_BLOCK_EXTENSION) || (elemDecl->subtypes->flags & XML_SCHEMAS_TYPE_BLOCK_EXTENSION)) @@ -22091,7 +24512,18 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt, XML_SCHEMAS_TYPE_BLOCK_RESTRICTION)) set |= SUBSET_RESTRICTION; - if (xmlSchemaCheckCOSDerivedOK(*localType, + /* + * REMOVED and CHANGED since this produced a parser context + * which adds to the string dict of the schema. So this would + * change the schema and we don't want this. We don't need + * the parser context anymore. + * + * if ((vctxt->pctxt == NULL) && + * (xmlSchemaCreatePCtxtOnVCtxt(vctxt) == -1)) + * return (-1); + */ + + if (xmlSchemaCheckCOSDerivedOK(ACTXT_CAST vctxt, *localType, elemDecl->subtypes, set) != 0) { xmlChar *str = NULL; @@ -22122,7 +24554,7 @@ static int xmlSchemaValidateElemDecl(xmlSchemaValidCtxtPtr vctxt) { xmlSchemaElementPtr elemDecl = vctxt->inode->decl; - xmlSchemaTypePtr actualType = ELEM_TYPE(elemDecl); + xmlSchemaTypePtr actualType = WXS_ELEM_TYPEDEF(elemDecl); /* * cvc-elt (3.3.4) : 1 @@ -22318,11 +24750,12 @@ xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt) static int xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) { - xmlSchemaTypePtr type = vctxt->inode->typeDef; - xmlSchemaAttributeLinkPtr attrUseLink; - xmlSchemaAttributePtr attrUse = NULL, attrDecl = NULL; - xmlSchemaAttrInfoPtr attr, tmpAttr; - int i, found, nbAttrs; + xmlSchemaTypePtr type = vctxt->inode->typeDef; + xmlSchemaItemListPtr attrUseList; + xmlSchemaAttributeUsePtr attrUse = NULL; + xmlSchemaAttributePtr attrDecl = NULL; + xmlSchemaAttrInfoPtr iattr, tmpiattr; + int i, j, found, nbAttrs, nbUses; int xpathRes = 0, res, wildIDs = 0, fixed; /* @@ -22343,33 +24776,33 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * noNamespaceSchemaLocation, the appropriate case among the following * must be true: * - */ + */ + attrUseList = (xmlSchemaItemListPtr) type->attrUses; + /* + * @nbAttrs is the number of attributes present in the instance. + */ nbAttrs = vctxt->nbAttrInfos; - for (attrUseLink = type->attributeUses; attrUseLink != NULL; - attrUseLink = attrUseLink->next) { - + if (attrUseList != NULL) + nbUses = attrUseList->nbItems; + else + nbUses = 0; + for (i = 0; i < nbUses; i++) { found = 0; - attrUse = attrUseLink->attr; - /* - * VAL TODO: Implement a real "attribute use" component. - */ - if (attrUse->refDecl != NULL) - attrDecl = attrUse->refDecl; - else - attrDecl = attrUse; - for (i = 0; i < nbAttrs; i++) { - attr = vctxt->attrInfos[i]; + attrUse = attrUseList->items[i]; + attrDecl = WXS_ATTRUSE_DECL(attrUse); + for (j = 0; j < nbAttrs; j++) { + iattr = vctxt->attrInfos[j]; /* * SPEC (cvc-complex-type) (3) * Skip meta attributes. */ - if (attr->metaType) + if (iattr->metaType) continue; - if (attr->localName[0] != attrDecl->name[0]) + if (iattr->localName[0] != attrDecl->name[0]) continue; - if (!xmlStrEqual(attr->localName, attrDecl->name)) + if (!xmlStrEqual(iattr->localName, attrDecl->name)) continue; - if (!xmlStrEqual(attr->nsName, attrDecl->targetNamespace)) + if (!xmlStrEqual(iattr->nsName, attrDecl->targetNamespace)) continue; found = 1; /* @@ -22388,13 +24821,13 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * Assessment (Attribute) (§3.2.4) and * Assessment Outcome (Attribute) (§3.2.5). */ - attr->state = XML_SCHEMAS_ATTR_ASSESSED; - attr->use = attrUse; + iattr->state = XML_SCHEMAS_ATTR_ASSESSED; + iattr->use = attrUse; /* * Context-determined declaration. */ - attr->decl = attrDecl; - attr->typeDef = attrDecl->subtypes; + iattr->decl = attrDecl; + iattr->typeDef = attrDecl->subtypes; break; } @@ -22411,39 +24844,41 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * of the attribute information items in the element information * item's [attributes] as per clause 3.1 above." */ - tmpAttr = xmlSchemaGetFreshAttrInfo(vctxt); - if (tmpAttr == NULL) { + tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt); + if (tmpiattr == NULL) { VERROR_INT( "xmlSchemaVAttributesComplex", "calling xmlSchemaGetFreshAttrInfo()"); return (-1); } - tmpAttr->state = XML_SCHEMAS_ATTR_ERR_MISSING; - tmpAttr->use = attrUse; - tmpAttr->decl = attrDecl; + tmpiattr->state = XML_SCHEMAS_ATTR_ERR_MISSING; + tmpiattr->use = attrUse; + tmpiattr->decl = attrDecl; } else if ((attrUse->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) && ((attrUse->defValue != NULL) || (attrDecl->defValue != NULL))) { /* * Handle non-existent, optional, default/fixed attributes. */ - tmpAttr = xmlSchemaGetFreshAttrInfo(vctxt); - if (tmpAttr == NULL) { + tmpiattr = xmlSchemaGetFreshAttrInfo(vctxt); + if (tmpiattr == NULL) { VERROR_INT( "xmlSchemaVAttributesComplex", "calling xmlSchemaGetFreshAttrInfo()"); return (-1); } - tmpAttr->state = XML_SCHEMAS_ATTR_DEFAULT; - tmpAttr->use = attrUse; - tmpAttr->decl = attrDecl; - tmpAttr->typeDef = attrDecl->subtypes; - tmpAttr->localName = attrDecl->name; - tmpAttr->nsName = attrDecl->targetNamespace; + tmpiattr->state = XML_SCHEMAS_ATTR_DEFAULT; + tmpiattr->use = attrUse; + tmpiattr->decl = attrDecl; + tmpiattr->typeDef = attrDecl->subtypes; + tmpiattr->localName = attrDecl->name; + tmpiattr->nsName = attrDecl->targetNamespace; } } + if (vctxt->nbAttrInfos == 0) return (0); + nbUses = vctxt->nbAttrInfos; /* * Validate against the wildcard. */ @@ -22453,12 +24888,12 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * (3.2.1) "There must be an {attribute wildcard}." */ for (i = 0; i < nbAttrs; i++) { - attr = vctxt->attrInfos[i]; + iattr = vctxt->attrInfos[i]; /* * SPEC (cvc-complex-type) (3) * Skip meta attributes. */ - if (attr->state != XML_SCHEMAS_ATTR_UNKNOWN) + if (iattr->state != XML_SCHEMAS_ATTR_UNKNOWN) continue; /* * SPEC (cvc-complex-type) @@ -22471,7 +24906,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * Namespace Name (§3.10.4)." */ if (xmlSchemaCheckCVCWildcardNamespace(type->attributeWildcard, - attr->nsName)) { + iattr->nsName) == 0) { /* * Handle processContents. * @@ -22490,16 +24925,16 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * [validity] = "notKnown" * [validation attempted] = "none" */ - attr->state = XML_SCHEMAS_ATTR_WILD_SKIP; + iattr->state = XML_SCHEMAS_ATTR_WILD_SKIP; continue; } /* * Find an attribute declaration. */ - attr->decl = xmlSchemaGetAttributeDecl(vctxt->schema, - attr->localName, attr->nsName); - if (attr->decl != NULL) { - attr->state = XML_SCHEMAS_ATTR_ASSESSED; + iattr->decl = xmlSchemaGetAttributeDecl(vctxt->schema, + iattr->localName, iattr->nsName); + if (iattr->decl != NULL) { + iattr->state = XML_SCHEMAS_ATTR_ASSESSED; /* * SPEC (cvc-complex-type) * (5) "Let [Definition:] the wild IDs be the set of @@ -22513,16 +24948,16 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * or is derived from ID. Then all of the following * must be true:" */ - attr->typeDef = attr->decl->subtypes; + iattr->typeDef = WXS_ATTR_TYPEDEF(iattr->decl); if (xmlSchemaIsDerivedFromBuiltInType( - attr->typeDef, XML_SCHEMAS_ID)) { + iattr->typeDef, XML_SCHEMAS_ID)) { /* * SPEC (5.1) "There must be no more than one * item in ·wild IDs·." */ if (wildIDs != 0) { /* VAL TODO */ - attr->state = XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID; + iattr->state = XML_SCHEMAS_ATTR_ERR_WILD_DUPLICATE_ID; TODO continue; } @@ -22534,34 +24969,32 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * whose {attribute declaration}'s {type definition} * is or is derived from ID." */ - for (attrUseLink = type->attributeUses; - attrUseLink != NULL; - attrUseLink = attrUseLink->next) { + for (j = 0; j < attrUseList->nbItems; j++) { if (xmlSchemaIsDerivedFromBuiltInType( - attrUseLink->attr->subtypes, + WXS_ATTRUSE_TYPEDEF(attrUseList->items[j]), XML_SCHEMAS_ID)) { - /* VAL TODO */ - attr->state = XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID; + /* URGENT VAL TODO: implement */ + iattr->state = XML_SCHEMAS_ATTR_ERR_WILD_AND_USE_ID; TODO + break; } } } } else if (type->attributeWildcard->processContents == XML_SCHEMAS_ANY_LAX) { - attr->state = XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL; + iattr->state = XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL; /* * SPEC PSVI Assessment Outcome (Attribute) * [validity] = "notKnown" * [validation attempted] = "none" */ } else { - attr->state = XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL; + iattr->state = XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL; } } } } - if (vctxt->nbAttrInfos == 0) return (0); @@ -22569,24 +25002,24 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * Validate values, create default attributes, evaluate IDCs. */ for (i = 0; i < vctxt->nbAttrInfos; i++) { - attr = vctxt->attrInfos[i]; + iattr = vctxt->attrInfos[i]; /* * VAL TODO: Note that we won't try to resolve IDCs to * "lax" and "skip" validated attributes. Check what to * do in this case. */ - if ((attr->state != XML_SCHEMAS_ATTR_ASSESSED) && - (attr->state != XML_SCHEMAS_ATTR_DEFAULT)) + if ((iattr->state != XML_SCHEMAS_ATTR_ASSESSED) && + (iattr->state != XML_SCHEMAS_ATTR_DEFAULT)) continue; /* * VAL TODO: What to do if the type definition is missing? */ - if (attr->typeDef == NULL) { - attr->state = XML_SCHEMAS_ATTR_ERR_NO_TYPE; + if (iattr->typeDef == NULL) { + iattr->state = XML_SCHEMAS_ATTR_ERR_NO_TYPE; continue; } - ACTIVATE_ATTRIBUTE(attr); + ACTIVATE_ATTRIBUTE(iattr); fixed = 0; xpathRes = 0; @@ -22603,30 +25036,30 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) } } - if (attr->state == XML_SCHEMAS_ATTR_DEFAULT) { + if (iattr->state == XML_SCHEMAS_ATTR_DEFAULT) { /* * Default/fixed attributes. */ if (xpathRes) { - if (attr->use->defValue == NULL) { - attr->value = (xmlChar *) attr->use->defValue; - attr->val = attr->use->defVal; + if (iattr->use->defValue != NULL) { + iattr->value = (xmlChar *) iattr->use->defValue; + iattr->val = iattr->use->defVal; } else { - attr->value = (xmlChar *) attr->decl->defValue; - attr->val = attr->decl->defVal; + iattr->value = (xmlChar *) iattr->decl->defValue; + iattr->val = iattr->decl->defVal; } /* * IDCs will consume the precomputed default value, * so we need to clone it. */ - if (attr->val == NULL) { + if (iattr->val == NULL) { VERROR_INT("xmlSchemaVAttributesComplex", "default/fixed value on an attribute use was " "not precomputed"); goto internal_error; } - attr->val = xmlSchemaCopyValue(attr->val); - if (attr->val == NULL) { + iattr->val = xmlSchemaCopyValue(iattr->val); + if (iattr->val == NULL) { VERROR_INT("xmlSchemaVAttributesComplex", "calling xmlSchemaCopyValue()"); goto internal_error; @@ -22638,22 +25071,22 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * uses the *initial* value. */ if ((vctxt->options & XML_SCHEMA_VAL_VC_I_CREATE) && - (attr->node != NULL) && (attr->node->doc != NULL)) { + (iattr->node != NULL) && (iattr->node->doc != NULL)) { xmlChar *normValue; const xmlChar *value; - value = attr->value; + value = iattr->value; /* * Normalize the value. */ - normValue = xmlSchemaNormalizeValue(attr->typeDef, - attr->value); + normValue = xmlSchemaNormalizeValue(iattr->typeDef, + iattr->value); if (normValue != NULL) value = BAD_CAST normValue; - if (attr->nsName == NULL) { - if (xmlNewProp(attr->node->parent, - attr->localName, value) == NULL) { + if (iattr->nsName == NULL) { + if (xmlNewProp(iattr->node->parent, + iattr->localName, value) == NULL) { VERROR_INT("xmlSchemaVAttributesComplex", "callling xmlNewProp()"); if (normValue != NULL) @@ -22663,8 +25096,8 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) } else { xmlNsPtr ns; - ns = xmlSearchNsByHref(attr->node->doc, - attr->node->parent, attr->nsName); + ns = xmlSearchNsByHref(iattr->node->doc, + iattr->node->parent, iattr->nsName); if (ns == NULL) { xmlChar prefix[12]; int counter = 0; @@ -22675,8 +25108,8 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) */ do { snprintf((char *) prefix, 12, "p%d", counter++); - ns = xmlSearchNs(attr->node->doc, - attr->node->parent, BAD_CAST prefix); + ns = xmlSearchNs(iattr->node->doc, + iattr->node->parent, BAD_CAST prefix); if (counter > 1000) { VERROR_INT( "xmlSchemaVAttributesComplex", @@ -22688,10 +25121,16 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) } } while (ns != NULL); ns = xmlNewNs(vctxt->validationRoot, - attr->nsName, BAD_CAST prefix); + iattr->nsName, BAD_CAST prefix); } - xmlNewNsProp(attr->node->parent, ns, - attr->localName, value); + /* + * TODO: + * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005JulSep/0406.html + * If we have QNames: do we need to ensure there's a + * prefix defined for the QName? + */ + xmlNewNsProp(iattr->node->parent, ns, + iattr->localName, value); } if (normValue != NULL) xmlFree(normValue); @@ -22715,9 +25154,9 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * Note that the attribute *use* can be unavailable, if * the attribute was a wild attribute. */ - if ((attr->decl->flags & XML_SCHEMAS_ATTR_FIXED) || - ((attr->use != NULL) && - (attr->use->flags & XML_SCHEMAS_ATTR_FIXED))) + if ((iattr->decl->flags & XML_SCHEMAS_ATTR_FIXED) || + ((iattr->use != NULL) && + (iattr->use->flags & XML_SCHEMAS_ATTR_FIXED))) fixed = 1; else fixed = 0; @@ -22731,18 +25170,18 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * "normalized attribute value" here? */ if (xpathRes || fixed) { - attr->flags |= XML_SCHEMA_NODE_INFO_VALUE_NEEDED; + iattr->flags |= XML_SCHEMA_NODE_INFO_VALUE_NEEDED; /* * Request a computed value. */ res = xmlSchemaVCheckCVCSimpleType( ACTXT_CAST vctxt, - attr->node, attr->typeDef, attr->value, &(attr->val), + iattr->node, iattr->typeDef, iattr->value, &(iattr->val), 1, 1, 0); } else { res = xmlSchemaVCheckCVCSimpleType( ACTXT_CAST vctxt, - attr->node, attr->typeDef, attr->value, NULL, + iattr->node, iattr->typeDef, iattr->value, NULL, 1, 0, 0); } @@ -22752,7 +25191,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) "calling xmlSchemaStreamValidateSimpleTypeValue()"); goto internal_error; } - attr->state = XML_SCHEMAS_ATTR_INVALID_VALUE; + iattr->state = XML_SCHEMAS_ATTR_INVALID_VALUE; /* * SPEC PSVI Assessment Outcome (Attribute) * [validity] = "invalid" @@ -22760,8 +25199,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) goto eval_idcs; } - if (fixed) { - int ws; + if (fixed) { /* * SPEC Attribute Locally Valid (Use) (cvc-au) * "For an attribute information item to be·valid· @@ -22778,43 +25216,42 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * (4) "The item's *actual* value· must match the *value* of * the {value constraint}, if it is present and fixed." */ - ws = xmlSchemaGetWhiteSpaceFacetValue(attr->typeDef); - if (attr->val == NULL) { + if (iattr->val == NULL) { /* VAL TODO: A value was not precomputed. */ TODO goto eval_idcs; } - if ((attr->use != NULL) && - (attr->use->defValue != NULL)) { - if (attr->use->defVal == NULL) { + if ((iattr->use != NULL) && + (iattr->use->defValue != NULL)) { + if (iattr->use->defVal == NULL) { /* VAL TODO: A default value was not precomputed. */ TODO goto eval_idcs; } - attr->vcValue = attr->use->defValue; + iattr->vcValue = iattr->use->defValue; /* if (xmlSchemaCompareValuesWhtsp(attr->val, (xmlSchemaWhitespaceValueType) ws, attr->use->defVal, (xmlSchemaWhitespaceValueType) ws) != 0) { */ - if (! xmlSchemaAreValuesEqual(attr->val, attr->use->defVal)) - attr->state = XML_SCHEMAS_ATTR_ERR_FIXED_VALUE; + if (! xmlSchemaAreValuesEqual(iattr->val, iattr->use->defVal)) + iattr->state = XML_SCHEMAS_ATTR_ERR_FIXED_VALUE; } else { - if (attr->decl->defVal == NULL) { + if (iattr->decl->defVal == NULL) { /* VAL TODO: A default value was not precomputed. */ TODO goto eval_idcs; } - attr->vcValue = attr->decl->defValue; + iattr->vcValue = iattr->decl->defValue; /* if (xmlSchemaCompareValuesWhtsp(attr->val, (xmlSchemaWhitespaceValueType) ws, attrDecl->defVal, (xmlSchemaWhitespaceValueType) ws) != 0) { */ - if (! xmlSchemaAreValuesEqual(attr->val, attr->decl->defVal)) - attr->state = XML_SCHEMAS_ATTR_ERR_FIXED_VALUE; + if (! xmlSchemaAreValuesEqual(iattr->val, iattr->decl->defVal)) + iattr->state = XML_SCHEMAS_ATTR_ERR_FIXED_VALUE; } /* * [validity] = "valid" @@ -22839,14 +25276,14 @@ eval_idcs: * Report errors. */ for (i = 0; i < vctxt->nbAttrInfos; i++) { - attr = vctxt->attrInfos[i]; - if ((attr->state == XML_SCHEMAS_ATTR_META) || - (attr->state == XML_SCHEMAS_ATTR_ASSESSED) || - (attr->state == XML_SCHEMAS_ATTR_WILD_SKIP) || - (attr->state == XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL)) + iattr = vctxt->attrInfos[i]; + if ((iattr->state == XML_SCHEMAS_ATTR_META) || + (iattr->state == XML_SCHEMAS_ATTR_ASSESSED) || + (iattr->state == XML_SCHEMAS_ATTR_WILD_SKIP) || + (iattr->state == XML_SCHEMAS_ATTR_WILD_LAX_NO_DECL)) continue; - ACTIVATE_ATTRIBUTE(attr); - switch (attr->state) { + ACTIVATE_ATTRIBUTE(iattr); + switch (iattr->state) { case XML_SCHEMAS_ATTR_ERR_MISSING: { xmlChar *str = NULL; ACTIVATE_ELEM; @@ -22854,8 +25291,8 @@ eval_idcs: XML_SCHEMAV_CVC_COMPLEX_TYPE_4, NULL, NULL, "The attribute '%s' is required but missing", xmlSchemaFormatQName(&str, - attr->decl->targetNamespace, - attr->decl->name), + iattr->decl->targetNamespace, + iattr->decl->name), NULL); FREE_AND_NULL(str) break; @@ -22869,7 +25306,7 @@ eval_idcs: XML_SCHEMAV_CVC_AU, NULL, NULL, "The value '%s' does not match the fixed " "value constraint '%s'", - attr->value, attr->vcValue); + iattr->value, iattr->vcValue); break; case XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL: VERROR(XML_SCHEMAV_CVC_WILDCARD, NULL, @@ -22877,7 +25314,7 @@ eval_idcs: "demanded by the strict wildcard"); break; case XML_SCHEMAS_ATTR_UNKNOWN: - if (attr->metaType) + if (iattr->metaType) break; /* * MAYBE VAL TODO: One might report different error messages @@ -22885,10 +25322,10 @@ eval_idcs: */ if (type->attributeWildcard == NULL) { xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt, - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, attr, NULL); + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, iattr, NULL); } else { xmlSchemaIllegalAttrErr(ACTXT_CAST vctxt, - XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, attr, NULL); + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, iattr, NULL); } break; default: @@ -22939,7 +25376,7 @@ xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt, } if (wild->processContents == XML_SCHEMAS_ANY_STRICT) { /* VAL TODO: Change to proper error code. */ - VERROR(XML_SCHEMAV_CVC_ELT_1, (xmlSchemaTypePtr) wild, + VERROR(XML_SCHEMAV_CVC_ELT_1, NULL, /* WXS_BASIC_CAST wild */ "No matching global element declaration available, but " "demanded by the strict wildcard"); return (vctxt->err); @@ -22999,7 +25436,7 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, * For a string to be a valid default with respect to a type * definition the appropriate case among the following must be true: */ - if IS_COMPLEX_TYPE(inode->typeDef) { + if WXS_IS_COMPLEX(inode->typeDef) { /* * Complex type. * @@ -23009,9 +25446,9 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, * type}'s particle must be ·emptiable· as defined by * Particle Emptiable (§3.9.6)." */ - if ((! HAS_SIMPLE_CONTENT(inode->typeDef)) && - ((! HAS_MIXED_CONTENT(inode->typeDef)) || - (! IS_PARTICLE_EMPTIABLE(inode->typeDef)))) { + if ((! WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) && + ((! WXS_HAS_MIXED_CONTENT(inode->typeDef)) || + (! WXS_EMPTIABLE(inode->typeDef)))) { ret = XML_SCHEMAP_COS_VALID_DEFAULT_2_1; /* NOTE that this covers (2.2.2) as well. */ VERROR(ret, NULL, @@ -23032,12 +25469,12 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, * string must be ·valid· with respect to that simple type definition * as defined by String Valid (§3.14.4). */ - if (IS_SIMPLE_TYPE(inode->typeDef)) { + if (WXS_IS_SIMPLE(inode->typeDef)) { ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt, NULL, inode->typeDef, value, val, 1, 1, 0); - } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { + } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) { ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt, NULL, inode->typeDef->contentTypeDef, value, val, 1, 1, 0); @@ -23224,10 +25661,10 @@ character_content: /* * Speedup if no declaration exists. */ - if (IS_SIMPLE_TYPE(inode->typeDef)) { + if (WXS_IS_SIMPLE(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->value); - } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { + } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef->contentTypeDef, inode->value); @@ -23260,7 +25697,7 @@ character_content: * defined in Element Default Valid (Immediate) (§3.3.6). */ /* - * NOTE: 'local' above means types aquired by xsi:type. + * NOTE: 'local' above means types acquired by xsi:type. * NOTE: Although the *canonical* value is stated, it is not * relevant if canonical or not. Additionally XML Schema 1.1 * will removed this requirement as well. @@ -23291,10 +25728,10 @@ character_content: * ·actual type definition· as defined by Element Locally Valid (Type) * (§3.3.4). */ - if (IS_SIMPLE_TYPE(inode->typeDef)) { + if (WXS_IS_SIMPLE(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->decl->value); - } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { + } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef->contentTypeDef, inode->decl->value); @@ -23340,7 +25777,7 @@ default_psvi: * to the ·actual type definition· as defined by Element Locally * Valid (Type) (§3.3.4). */ - if (IS_SIMPLE_TYPE(inode->typeDef)) { + if (WXS_IS_SIMPLE(inode->typeDef)) { /* * SPEC (cvc-type) (3.1) * "If the type definition is a simple type definition, ..." @@ -23351,7 +25788,7 @@ default_psvi: */ ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->value); - } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { + } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) { /* * SPEC (cvc-type) (3.2) "If the type definition is a complex type * definition, then the element information item must be @@ -23402,7 +25839,7 @@ default_psvi: * 5.2.2.2 The appropriate case among the following must * be true: */ - if (HAS_MIXED_CONTENT(inode->typeDef)) { + if (WXS_HAS_MIXED_CONTENT(inode->typeDef)) { /* * 5.2.2.2.1 If the {content type} of the ·actual type * definition· is mixed, then the *initial value* of the @@ -23427,7 +25864,7 @@ default_psvi: inode->value, inode->decl->value); goto end_elem; } - } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { + } else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) { /* * 5.2.2.2.2 If the {content type} of the ·actual type * definition· is a simple type definition, then the @@ -23466,29 +25903,50 @@ end_elem: /* * Evaluate the history of XPath state objects. */ - if (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1) + if (inode->appliedXPath && + (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1)) goto internal_error; /* - * TODO: 6 The element information item must be ·valid· with respect to each of - * the {identity-constraint definitions} as per Identity-constraint - * Satisfied (§3.11.4). + * MAYBE TODO: + * SPEC (6) "The element information item must be ·valid· with + * respect to each of the {identity-constraint definitions} as per + * Identity-constraint Satisfied (§3.11.4)." + */ + /* + * PSVI TODO: If we expose IDC node-tables via PSVI then the tables + * need to be built in any case. + * We will currently build IDC node-tables and bubble them only if + * keyrefs do exist. + */ + + /* + * Add the current IDC target-nodes to the IDC node-tables. */ + if ((inode->idcMatchers != NULL) && + (vctxt->hasKeyrefs || vctxt->createIDCNodeTables)) + { + if (xmlSchemaIDCFillNodeTables(vctxt, inode) == -1) + goto internal_error; + } /* * Validate IDC keyrefs. */ - if (xmlSchemaCheckCVCIDCKeyRef(vctxt) == -1) - goto internal_error; + if (vctxt->inode->hasKeyrefs) + if (xmlSchemaCheckCVCIDCKeyRef(vctxt) == -1) + goto internal_error; /* * Merge/free the IDC table. */ if (inode->idcTable != NULL) { -#ifdef DEBUG_IDC +#ifdef DEBUG_IDC_NODE_TABLE xmlSchemaDebugDumpIDCTable(stdout, inode->nsName, inode->localName, inode->idcTable); #endif - if (vctxt->depth > 0) { + if ((vctxt->depth > 0) && + (vctxt->hasKeyrefs || vctxt->createIDCNodeTables)) + { /* * Merge the IDC node table with the table of the parent node. */ @@ -23511,18 +25969,18 @@ end_elem: return (0); } /* - * Reset the bubbleDepth if needed. + * Reset the keyrefDepth if needed. */ if (vctxt->aidcs != NULL) { xmlSchemaIDCAugPtr aidc = vctxt->aidcs; do { - if (aidc->bubbleDepth == vctxt->depth) { + if (aidc->keyrefDepth == vctxt->depth) { /* - * A bubbleDepth of a key/unique IDC matches the current + * A 'keyrefDepth' of a key/unique IDC matches the current * depth, this means that we are leaving the scope of the - * top-most keyref IDC. + * top-most keyref IDC which refers to this IDC. */ - aidc->bubbleDepth = -1; + aidc->keyrefDepth = -1; } aidc = aidc->next; } while (aidc != NULL); @@ -23727,7 +26185,7 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt) case XML_SCHEMA_CONTENT_SIMPLE: case XML_SCHEMA_CONTENT_BASIC: ACTIVATE_PARENT_ELEM - if (IS_COMPLEX_TYPE(ptype)) { + if (WXS_IS_COMPLEX(ptype)) { /* * SPEC (cvc-complex-type) (2.2) * "If the {content type} is a simple type definition, then @@ -23879,7 +26337,9 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, default: break; } - } else { + } else { + if (len < 0) + len = xmlStrlen(value); /* * Concat the value. */ @@ -23909,11 +26369,22 @@ xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt) } if (vctxt->xsiAssemble) { /* - * URGENT TODO: Better to fully stop validation - * if there was an error during dynamic schema construction. + * We will stop validation if there was an error during + * dynamic schema construction. + * Note that we simply set @skipDepth to 0, this could + * mean that a streaming document via SAX would be + * still read to the end but it won't be validated any more. + * TODO: If we are sure how to stop the validation at once + * for all input scenarios, then this should be changed to + * instantly stop the validation. */ - if (xmlSchemaAssembleByXSI(vctxt) == -1) - goto internal_error; + ret = xmlSchemaAssembleByXSI(vctxt); + if (ret != 0) { + if (ret == -1) + goto internal_error; + vctxt->skipDepth = 0; + return(ret); + } } if (vctxt->depth > 0) { /* @@ -24025,6 +26496,7 @@ type_validation: */ if (vctxt->xpathStates != NULL) { ret = xmlSchemaXPathEvaluate(vctxt, XML_ELEMENT_NODE); + vctxt->inode->appliedXPath = 1; if (ret == -1) { VERROR_INT("xmlSchemaValidateElem", "calling xmlSchemaXPathEvaluate()"); @@ -24034,9 +26506,9 @@ type_validation: /* * Validate attributes. */ - if (IS_COMPLEX_TYPE(vctxt->inode->typeDef)) { + if (WXS_IS_COMPLEX(vctxt->inode->typeDef)) { if ((vctxt->nbAttrInfos != 0) || - (vctxt->inode->typeDef->attributeUses != NULL)) { + (vctxt->inode->typeDef->attrUses != NULL)) { ret = xmlSchemaVAttributesComplex(vctxt); } @@ -24558,12 +27030,19 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) if (vctxt == NULL) return; + /* + * TODO: Should we clear the flags? + * Might be problematic if one reuses the context + * and assumes that the options remain the same. + */ vctxt->flags = 0; vctxt->validationRoot = NULL; vctxt->doc = NULL; #ifdef LIBXML_READER_ENABLED vctxt->reader = NULL; #endif + vctxt->hasKeyrefs = 0; + if (vctxt->value != NULL) { xmlSchemaFreeValue(vctxt->value); vctxt->value = NULL; @@ -24622,6 +27101,10 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) xmlSchemaItemListClear(vctxt->nodeQNames); /* Recreate the dict. */ xmlDictFree(vctxt->dict); + /* + * TODO: Is is save to recreate it? Do we have a scenario + * where the user provides the dict? + */ vctxt->dict = xmlDictCreate(); } @@ -24742,7 +27225,7 @@ xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt, return; ctxt->error = err; ctxt->warning = warn; - ctxt->userData = ctx; + ctxt->errCtxt = ctx; if (ctxt->pctxt != NULL) xmlSchemaSetParserErrors(ctxt->pctxt, err, warn, ctx); } @@ -24757,14 +27240,16 @@ xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt, */ void xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, - xmlStructuredErrorFunc serror, void *ctx) + xmlStructuredErrorFunc serror, void *ctx) { if (ctxt == NULL) return; ctxt->serror = serror; ctxt->error = NULL; ctxt->warning = NULL; - ctxt->userData = ctx; + ctxt->errCtxt = ctx; + if (ctxt->pctxt != NULL) + xmlSchemaSetParserStructuredErrors(ctxt->pctxt, serror, ctx); } /** @@ -24780,8 +27265,8 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, */ int xmlSchemaGetValidErrors(xmlSchemaValidCtxtPtr ctxt, - xmlSchemaValidityErrorFunc * err, - xmlSchemaValidityWarningFunc * warn, void **ctx) + xmlSchemaValidityErrorFunc * err, + xmlSchemaValidityWarningFunc * warn, void **ctx) { if (ctxt == NULL) return (-1); @@ -24790,7 +27275,7 @@ xmlSchemaGetValidErrors(xmlSchemaValidCtxtPtr ctxt, if (warn != NULL) *warn = ctxt->warning; if (ctx != NULL) - *ctx = ctxt->userData; + *ctx = ctxt->errCtxt; return (0); } @@ -25009,12 +27494,18 @@ static int xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { /* * Some initialization. - */ + */ vctxt->err = 0; vctxt->nberrors = 0; vctxt->depth = -1; vctxt->skipDepth = -1; vctxt->xsiAssemble = 0; + vctxt->hasKeyrefs = 0; +#ifdef ENABLE_IDC_NODE_TABLES_TEST + vctxt->createIDCNodeTables = 1; +#else + vctxt->createIDCNodeTables = 0; +#endif /* * Create a schema + parser if necessary. */ @@ -25045,7 +27536,7 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { pctxt->constructor = xmlSchemaConstructionCtxtCreate(pctxt->dict); if (pctxt->constructor == NULL) return(-1); - pctxt->constructor->schema = vctxt->schema; + pctxt->constructor->mainSchema = vctxt->schema; /* * Take ownership of the constructor to be able to free it. */ diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 9d99bbb..ffb2505 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -434,9 +434,7 @@ xmlSchemaInitTypes(void) } memset(wild, 0, sizeof(xmlSchemaWildcard)); wild->type = XML_SCHEMA_TYPE_ANY; - wild->any = 1; - wild->minOccurs = 1; - wild->maxOccurs = 1; + wild->any = 1; wild->processContents = XML_SCHEMAS_ANY_LAX; particle->children = (xmlSchemaTreeItemPtr) wild; /* @@ -450,9 +448,7 @@ xmlSchemaInitTypes(void) } memset(wild, 0, sizeof(xmlSchemaWildcard)); wild->any = 1; - wild->processContents = XML_SCHEMAS_ANY_LAX; - wild->minOccurs = 1; - wild->maxOccurs = 1; + wild->processContents = XML_SCHEMAS_ANY_LAX; xmlSchemaTypeAnyTypeDef->attributeWildcard = wild; } xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType", @@ -1700,7 +1696,7 @@ xmlSchemaValidateDates (xmlSchemaValType type, ret = _xmlSchemaParseTimeZone(&(dt->value.date), &cur); if (collapse) while IS_WSP_BLANK_CH(*cur) cur++; - if ((ret != 0) || (*cur != 0) || !VALID_DATETIME((&(dt->value.date)))) + if ((ret != 0) || (*cur != 0) || (!(VALID_DATETIME((&(dt->value.date)))))) goto error; @@ -2248,100 +2244,122 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, } case XML_SCHEMAS_DECIMAL:{ const xmlChar *cur = value; - unsigned int len, neg = 0; + unsigned int len, neg, integ, hasLeadingZeroes; xmlChar cval[25]; - xmlChar *cptr = cval; - unsigned int dec = ~0u; + xmlChar *cptr = cval; - if (cur == NULL) + if ((cur == NULL) || (*cur == 0)) goto return1; + /* + * xs:decimal has a whitespace-facet value of 'collapse'. + */ if (normOnTheFly) while IS_WSP_BLANK_CH(*cur) cur++; - /* First we handle an optional sign */ - if (*cur == '+') + /* + * First we handle an optional sign. + */ + neg = 0; + if (*cur == '-') { + neg = 1; cur++; - else if (*cur == '-') { - neg = 1; + } else if (*cur == '+') cur++; - } + /* + * Disallow: "", "-", "- " + */ + if (*cur == 0) + goto return1; /* * Next we "pre-parse" the number, in preparation for calling * the common routine xmlSchemaParseUInt. We get rid of any * leading zeroes (because we have reserved only 25 chars), - * and note the position of any decimal point. + * and note the position of a decimal point. */ len = 0; + integ = ~0u; + hasLeadingZeroes = 0; /* * Skip leading zeroes. */ - while (*cur == '0') + while (*cur == '0') { cur++; + hasLeadingZeroes = 1; + } if (*cur != 0) { - while (len < 24) { + do { if ((*cur >= '0') && (*cur <= '9')) { *cptr++ = *cur++; len++; } else if (*cur == '.') { - if (len == 0) - len++; - if (dec != ~0u) - goto return1; /* multiple decimal points */ cur++; - if ((*cur == 0) && (cur -1 == value)) + integ = len; + do { + if ((*cur >= '0') && (*cur <= '9')) { + *cptr++ = *cur++; + len++; + } else + break; + } while (len < 24); + /* + * Disallow "." but allow "00." + */ + if ((len == 0) && (!hasLeadingZeroes)) goto return1; - - dec = len; - while ((len < 24) && (*cur >= '0') && - (*cur <= '9')) { - *cptr++ = *cur++; - len++; - } break; } else break; - } + } while (len < 24); } if (normOnTheFly) while IS_WSP_BLANK_CH(*cur) cur++; if (*cur != 0) - goto return1; /* error if any extraneous chars */ + goto return1; /* error if any extraneous chars */ if (val != NULL) { v = xmlSchemaNewValue(XML_SCHEMAS_DECIMAL); if (v != NULL) { /* - * If a mixed decimal, get rid of trailing zeroes + * Now evaluate the significant digits of the number */ - if (dec != ~0u) { - while ((len > dec) && (cptr > cval) && - (*(cptr-1) == '0')) { - cptr--; - len--; + if (len != 0) { + + if (integ != ~0u) { + /* + * Get rid of trailing zeroes in the + * fractional part. + */ + while ((len != integ) && (*(cptr-1) == '0')) { + cptr--; + len--; + } + } + /* + * Terminate the (preparsed) string. + */ + if (len != 0) { + *cptr = 0; + cptr = cval; + + xmlSchemaParseUInt((const xmlChar **)&cptr, + &v->value.decimal.lo, + &v->value.decimal.mi, + &v->value.decimal.hi); } } - *cptr = 0; /* Terminate our (preparsed) string */ - cptr = cval; - /* - * Now evaluate the significant digits of the number - */ - if (*cptr != 0) - xmlSchemaParseUInt((const xmlChar **)&cptr, - &v->value.decimal.lo, - &v->value.decimal.mi, - &v->value.decimal.hi); /* * Set the total digits to 1 if a zero value. */ - if (len == 0) - len++; v->value.decimal.sign = neg; - if (dec == ~0u) { - v->value.decimal.frac = 0; - v->value.decimal.total = len; + if (len == 0) { + /* Speedup for zero values. */ + v->value.decimal.total = 1; } else { - v->value.decimal.frac = len - dec; v->value.decimal.total = len; + if (integ == ~0u) + v->value.decimal.frac = 0; + else + v->value.decimal.frac = len - integ; } *val = v; } @@ -3406,10 +3424,42 @@ xmlSchemaCompareDecimals(xmlSchemaValPtr x, xmlSchemaValPtr y) */ integx = x->value.decimal.total - x->value.decimal.frac; integy = y->value.decimal.total - y->value.decimal.frac; + /* + * NOTE: We changed the "total" for values like "0.1" + * (or "-0.1" or ".1") to be 1, which was 2 previously. + * Therefore the special case, when such values are + * compared with 0, needs to be handled separately; + * otherwise a zero would be recognized incorrectly as + * greater than those values. This has the nice side effect + * that we gain an overall optimized comparison with zeroes. + * Note that a "0" has a "total" of 1 already. + */ + if (integx == 1) { + if (x->value.decimal.lo == 0) { + if (integy != 1) + return -order; + else if (y->value.decimal.lo != 0) + return -order; + else + return(0); + } + } + if (integy == 1) { + if (y->value.decimal.lo == 0) { + if (integx != 1) + return order; + else if (x->value.decimal.lo != 0) + return order; + else + return(0); + } + } + if (integx > integy) return order; else if (integy > integx) return -order; + /* * If the number of integral digits is the same for both numbers, * then things get a little more complicated. We need to "normalize" @@ -3763,8 +3813,8 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) while (1) { if (tempdays < 1) { - long tmon = (long) MODULO_RANGE(r->mon-1, 1, 13); - long tyr = r->year + (long)FQUOTIENT_RANGE(r->mon-1, 1, 13); + long tmon = (long) MODULO_RANGE((int)r->mon-1, 1, 13); + long tyr = r->year + (long)FQUOTIENT_RANGE((int)r->mon-1, 1, 13); if (tyr == 0) tyr--; tempdays += MAX_DAYINMONTH(tyr, tmon); @@ -5377,7 +5427,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, case XML_SCHEMA_FACET_FRACTIONDIGITS: if ((facet->val == NULL) || - ((facet->val->type != XML_SCHEMAS_DECIMAL) && + ((facet->val->type != XML_SCHEMAS_PINTEGER) && (facet->val->type != XML_SCHEMAS_NNINTEGER)) || (facet->val->value.decimal.frac != 0)) { return(-1); diff --git a/xmlstring.c b/xmlstring.c index 67a20b9..4f3b373 100644 --- a/xmlstring.c +++ b/xmlstring.c @@ -147,8 +147,8 @@ xmlStrcmp(const xmlChar *str1, const xmlChar *str2) { * @str1: the first xmlChar * * @str2: the second xmlChar * * - * Check if both string are equal of have same content - * Should be a bit more readable and faster than xmlStrEqual() + * Check if both strings are equal of have same content. + * Should be a bit more readable and faster than xmlStrcmp() * * Returns 1 if they are equal, 0 if they are different */ @@ -437,7 +437,8 @@ xmlStrlen(const xmlChar *str) { * @len: the length of @add * * a strncat for array of xmlChar's, it will extend @cur with the len - * first bytes of @add. + * first bytes of @add. Note that if @len < 0 then this is an API error + * and NULL will be returned. * * Returns a new xmlChar *, the original @cur is reallocated if needed * and should not be freed @@ -450,6 +451,8 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) { if ((add == NULL) || (len == 0)) return(cur); + if (len < 0) + return(NULL); if (cur == NULL) return(xmlStrndup(add, len)); @@ -468,10 +471,11 @@ xmlStrncat(xmlChar *cur, const xmlChar *add, int len) { * xmlStrncatNew: * @str1: first xmlChar string * @str2: second xmlChar string - * @len: the len of @str2 + * @len: the len of @str2 or < 0 * * same as xmlStrncat, but creates a new string. The original - * two strings are not freed. + * two strings are not freed. If @len is < 0 then the length + * will be calculated automatically. * * Returns a new xmlChar * or NULL */ diff --git a/xmlwriter.c b/xmlwriter.c index 6227398..37b7945 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -24,6 +24,25 @@ #define B64LINELEN 72 #define B64CRLF "\r\n" +/* + * The following VA_COPY was coded following an example in + * the Samba project. It may not be sufficient for some + * esoteric implementations of va_list (i.e. it may need + * something involving a memcpy) but (hopefully) will be + * sufficient for libxml2. + */ +#ifndef VA_COPY + #ifdef HAVE_VA_COPY + #define VA_COPY(dest, src) va_copy(dest, src) + #else + #ifdef HAVE___VA_COPY + #define VA_COPY(dest,src) __va_copy(dest, src) + #else + #define VA_COPY(dest,src) (dest) = (src) + #endif + #endif +#endif + /* * Types are kept private */ @@ -80,9 +99,6 @@ static int xmlCmpTextWriterStackEntry(const void *data0, static void xmlFreeTextWriterNsStackEntry(xmlLinkPtr lk); static int xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1); -static int xmlTextWriterWriteMemCallback(void *context, - const xmlChar * str, int len); -static int xmlTextWriterCloseMemCallback(void *context); static int xmlTextWriterWriteDocCallback(void *context, const xmlChar * str, int len); static int xmlTextWriterCloseDocCallback(void *context); @@ -256,11 +272,8 @@ xmlNewTextWriterMemory(xmlBufferPtr buf, int compression ATTRIBUTE_UNUSED) xmlOutputBufferPtr out; /*::todo handle compression */ - out = xmlOutputBufferCreateIO((xmlOutputWriteCallback) - xmlTextWriterWriteMemCallback, - (xmlOutputCloseCallback) - xmlTextWriterCloseMemCallback, - (void *) buf, NULL); + out = xmlOutputBufferCreateBuffer(buf, NULL); + if (out == NULL) { xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY, "xmlNewTextWriterMemory : out of memory!\n"); @@ -2842,8 +2855,11 @@ xmlTextWriterStartDTD(xmlTextWriterPtr writer, if (count < 0) return -1; sum += count; - } else if (writer->indent) { + } else { + if (writer->indent) count = xmlOutputBufferWriteString(writer->out, "\n "); + else + count = xmlOutputBufferWrite(writer->out, 1, " "); if (count < 0) return -1; sum += count; @@ -4274,40 +4290,6 @@ xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1) return rc; } -/** - * xmlTextWriterWriteMemCallback: - * @context: the xmlBufferPtr - * @str: the data to write - * @len: the length of the data - * - * Write callback for the xmlOutputBuffer with target xmlBuffer - * - * Returns -1, 0, 1 - */ -static int -xmlTextWriterWriteMemCallback(void *context, const xmlChar * str, int len) -{ - xmlBufferPtr buf = (xmlBufferPtr) context; - - xmlBufferAdd(buf, str, len); - - return len; -} - -/** - * xmlTextWriterCloseMemCallback: - * @context: the xmlBufferPtr - * - * Close callback for the xmlOutputBuffer with target xmlBuffer - * - * Returns -1, 0, 1 - */ -static int -xmlTextWriterCloseMemCallback(void *context ATTRIBUTE_UNUSED) -{ - return 0; -} - /** * xmlTextWriterWriteDocCallback: * @context: the xmlBufferPtr @@ -4373,6 +4355,7 @@ xmlTextWriterVSprintf(const char *format, va_list argptr) int size; int count; xmlChar *buf; + va_list locarg; size = BUFSIZ; buf = (xmlChar *) xmlMalloc(size); @@ -4382,8 +4365,10 @@ xmlTextWriterVSprintf(const char *format, va_list argptr) return NULL; } - while (((count = vsnprintf((char *) buf, size, format, argptr)) < 0) + VA_COPY(locarg, argptr); + while (((count = vsnprintf((char *) buf, size, format, locarg)) < 0) || (count == size - 1) || (count == size) || (count > size)) { + va_end(locarg); xmlFree(buf); size += BUFSIZ; buf = (xmlChar *) xmlMalloc(size); @@ -4392,7 +4377,9 @@ xmlTextWriterVSprintf(const char *format, va_list argptr) "xmlTextWriterVSprintf : out of memory!\n"); return NULL; } + VA_COPY(locarg, argptr); } + va_end(locarg); return buf; } diff --git a/xpath.c b/xpath.c index f57ba8c..f01b94d 100644 --- a/xpath.c +++ b/xpath.c @@ -64,13 +64,24 @@ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); +/* +* XP_PATTERN_TO_ANY_NODE_ENABLED: when an XPath expression can be +* evaluated using the streaming mode (pattern.c) then this is used to +* enable resolution to nodes of type text-node, cdata-section-node, +* comment-node and pi-node. The only known scenario where this is +* needed is an expression like "foo//.", "//.", etc.; i.e. an expression +* where the final node to be selected can be of any type. +* Disabling this #define will result in an incorrect evaluation to +* only element-nodes and the document node. +*/ +#define XP_PATTERN_TO_ANY_NODE_ENABLED /* * TODO: * There are a few spots where some tests are done which depend upon ascii * data. These should be enhanced for full UTF8 support (see particularly * any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT) */ - + #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) /************************************************************************ * * @@ -808,7 +819,8 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) { shift[2 * i] = shift[2 * i + 1] = ' '; shift[2 * i] = shift[2 * i + 1] = 0; - fprintf(output, shift); + + fprintf(output, shift); if (cur == NULL) { fprintf(output, "Object is empty (NULL)\n"); @@ -10998,13 +11010,16 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) static xmlXPathObjectPtr xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { int max_depth, min_depth; - int from_root; + int from_root; int ret, depth; +#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED + int eval_all_nodes; +#endif xmlNodePtr cur = NULL, limit = NULL; xmlXPathObjectPtr retval; xmlStreamCtxtPtr patstream; - - int nb_nodes = 0; + + int nb_nodes = 0; if ((ctxt == NULL) || (comp == NULL)) return(NULL); @@ -11082,6 +11097,10 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { return(retval); } +#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED + eval_all_nodes = xmlStreamWantsAnyNode(patstream); +#endif + if (from_root) { ret = xmlStreamPush(patstream, NULL, NULL); if (ret < 0) { @@ -11089,34 +11108,53 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { xmlXPathNodeSetAddUnique(retval->nodesetval, cur); } } - depth = 0; goto scan_children; do { next_node: nb_nodes++; - if (cur->type == XML_ELEMENT_NODE) { - ret = xmlStreamPush(patstream, cur->name, + + switch (cur->type) { + case XML_ELEMENT_NODE: +#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_COMMENT_NODE: + case XML_PI_NODE: +#endif + if (cur->type == XML_ELEMENT_NODE) { + ret = xmlStreamPush(patstream, cur->name, (cur->ns ? cur->ns->href : NULL)); - if (ret < 0) { - } else if (ret == 1) { - xmlXPathNodeSetAddUnique(retval->nodesetval, cur); - } - if ((cur->children == NULL) || (depth >= max_depth)) { - ret = xmlStreamPop(patstream); - while (cur->next != NULL) { - cur = cur->next; - if ((cur->type != XML_ENTITY_DECL) && - (cur->type != XML_DTD_NODE)) - goto next_node; } - } - } +#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED + else if (eval_all_nodes) + ret = xmlStreamPushNode(patstream, NULL, NULL, cur->type); + else + break; +#endif + + if (ret < 0) { + /* NOP. */ + } else if (ret == 1) { + xmlXPathNodeSetAddUnique(retval->nodesetval, cur); + } + if ((cur->children == NULL) || (depth >= max_depth)) { + ret = xmlStreamPop(patstream); + while (cur->next != NULL) { + cur = cur->next; + if ((cur->type != XML_ENTITY_DECL) && + (cur->type != XML_DTD_NODE)) + goto next_node; + } + } + default: + break; + } scan_children: if ((cur->children != NULL) && (depth < max_depth)) { /* - * Do not descend on entities declarations + * Do not descend on entities declarations */ if (cur->children->type != XML_ENTITY_DECL) { cur = cur->children; @@ -11144,8 +11182,19 @@ scan_children: depth--; if ((cur == NULL) || (cur == limit)) goto done; - if (cur->type == XML_ELEMENT_NODE) - ret = xmlStreamPop(patstream); + if (cur->type == XML_ELEMENT_NODE) { + ret = xmlStreamPop(patstream); + } +#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED + else if ((eval_all_nodes) && + ((cur->type == XML_TEXT_NODE) || + (cur->type == XML_CDATA_SECTION_NODE) || + (cur->type == XML_COMMENT_NODE) || + (cur->type == XML_PI_NODE))) + { + ret = xmlStreamPop(patstream); + } +#endif if (cur->next != NULL) { cur = cur->next; break; -- cgit v1.2.3 From 968041a8b2ec86c39b5074024ce97d136ecd9a95 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 26 Oct 2006 11:17:37 +0200 Subject: Load /tmp/libxml2-2.6.27 into libxml2/branches/upstream/current. --- ChangeLog | 442 +++ HTMLparser.c | 245 +- HTMLtree.c | 10 +- Makefile.in | 3 + NEWS | 68 + SAX2.c | 15 +- aclocal.m4 | 15 +- configure | 185 +- configure.in | 8 +- doc/APIchunk0.html | 4 +- doc/APIchunk1.html | 4 +- doc/APIchunk10.html | 9 +- doc/APIchunk11.html | 3 +- doc/APIchunk12.html | 32 +- doc/APIchunk13.html | 3 +- doc/APIchunk14.html | 10 +- doc/APIchunk15.html | 6 + doc/APIchunk16.html | 1 + doc/APIchunk17.html | 11 +- doc/APIchunk18.html | 6 +- doc/APIchunk19.html | 2 +- doc/APIchunk2.html | 1 + doc/APIchunk20.html | 13 +- doc/APIchunk21.html | 4 +- doc/APIchunk22.html | 2 + doc/APIchunk23.html | 5 +- doc/APIchunk24.html | 6 +- doc/APIchunk25.html | 8 +- doc/APIchunk26.html | 2 +- doc/APIchunk27.html | 5 +- doc/APIchunk28.html | 10 +- doc/APIchunk3.html | 3 +- doc/APIchunk4.html | 32 +- doc/APIchunk5.html | 1 - doc/APIchunk7.html | 1 - doc/APIchunk8.html | 1 + doc/APIchunk9.html | 10 +- doc/APIconstructors.html | 3 + doc/APIfiles.html | 7 + doc/APIfunctions.html | 10 +- doc/APIsymbols.html | 7 + doc/DOM.html | 16 +- doc/FAQ.html | 333 +-- doc/Makefile.in | 3 + doc/XMLinfo.html | 33 +- doc/XSLT.html | 9 +- doc/apibuild.py | 1 + doc/architecture.html | 7 +- doc/bugs.html | 118 +- doc/catalog.html | 324 +-- doc/contribs.html | 53 +- doc/devhelp/Makefile.in | 3 + doc/devhelp/libxml2-HTMLparser.html | 5 + doc/devhelp/libxml2-parser.html | 5 +- doc/devhelp/libxml2-tree.html | 22 +- doc/devhelp/libxml2-uri.html | 5 + doc/devhelp/libxml2-xinclude.html | 5 + doc/devhelp/libxml2-xmlsave.html | 2 +- doc/devhelp/libxml2-xmlversion.html | 9 +- doc/devhelp/libxml2-xpath.html | 11 +- doc/devhelp/libxml2.devhelp | 7 + doc/docs.html | 35 +- doc/downloads.html | 42 +- doc/encoding.html | 312 +-- doc/entities.html | 74 +- doc/example.html | 70 +- doc/examples/Makefile.am | 1 + doc/examples/Makefile.in | 4 + doc/help.html | 26 +- doc/html/index.html | 13 - doc/html/libxml-HTMLparser.html | 5 +- doc/html/libxml-parser.html | 5 +- doc/html/libxml-tree.html | 25 +- doc/html/libxml-uri.html | 5 +- doc/html/libxml-xinclude.html | 5 +- doc/html/libxml-xmlsave.html | 2 +- doc/html/libxml-xmlversion.html | 7 +- doc/html/libxml-xpath.html | 7 +- doc/index.html | 109 +- doc/interface.html | 35 +- doc/intro.html | 40 +- doc/library.html | 137 +- doc/libxml2-api.xml | 90 +- doc/libxml2.xsa | 17 +- doc/namespaces.html | 70 +- doc/news.html | 1730 ++++++------ doc/python.html | 247 +- doc/threads.html | 23 +- doc/tree.html | 32 +- doc/upgrade.html | 188 +- doc/xml.html | 5046 ++++++++++++++++++----------------- doc/xmlcatalog.1 | 62 +- doc/xmlcatalog_man.xml | 79 +- doc/xmldtd.html | 154 +- doc/xmlio.html | 123 +- doc/xmllint.1 | 89 +- doc/xmllint.xml | 116 +- doc/xmlmem.html | 166 +- encoding.c | 6 + entities.c | 11 +- example/Makefile.in | 3 + include/Makefile.in | 3 + include/libxml/HTMLparser.h | 3 + include/libxml/Makefile.in | 3 + include/libxml/entities.h | 1 + include/libxml/parser.h | 5 +- include/libxml/tree.h | 51 +- include/libxml/uri.h | 2 + include/libxml/xinclude.h | 4 + include/libxml/xmlversion.h | 23 +- include/libxml/xmlversion.h.in | 13 +- include/libxml/xpath.h | 6 +- libxml-2.0.pc.in | 3 +- libxml2.spec | 6 +- ltmain.sh | 162 +- parser.c | 197 +- parserInternals.c | 1 + python/Makefile.am | 2 +- python/Makefile.in | 5 +- python/generator.py | 2 +- python/libxml.c | 36 + python/libxml.py | 30 +- python/libxml2-py.c | 38 +- python/setup.py | 2 +- python/tests/Makefile.am | 3 +- python/tests/Makefile.in | 6 +- python/tests/compareNodes.py | 50 + python/types.c | 112 + relaxng.c | 2 + runtest.c | 21 +- testapi.c | 170 +- threads.c | 4 +- tree.c | 668 +++-- uri.c | 58 +- valid.c | 22 +- xinclude.c | 30 +- xmlIO.c | 494 ++-- xmllint.c | 121 +- xmlmemory.c | 6 +- xmlregexp.c | 7 +- xmlsave.c | 112 +- xmlschemas.c | 313 ++- xmlschemastypes.c | 14 +- xmlwriter.c | 11 +- xpath.c | 2298 +++++++++------- xstc/Makefile.am | 22 +- xstc/Makefile.in | 25 +- 147 files changed, 9627 insertions(+), 6935 deletions(-) delete mode 100644 doc/html/index.html create mode 100755 python/tests/compareNodes.py (limited to 'doc/devhelp/libxml2-xmlsave.html') diff --git a/ChangeLog b/ChangeLog index f6b31ef..11098d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,445 @@ +Fri Oct 20 14:55:47 CEST 2006 Daniel Veillard + + * tree.c: fix comment for xmlDocSetRootElement c.f. #351981 + * xmllint.c: order XPath elements when using --shell + +Tue Oct 17 23:23:26 CEST 2006 Daniel Veillard + + * xmlregexp.c: applied fix from Christopher Boumenot for bug + #362714 on regexps missing ']' + +Tue Oct 17 22:32:42 CEST 2006 Daniel Veillard + + * parserInternals.c: applied patch from Marius Konitzer to avoid + leaking in xmlNewInputFromFile() in case of HTTP redirection + +Tue Oct 17 22:19:02 CEST 2006 Daniel Veillard + + * HTMLparser.c: fix one problem found in htmlCtxtUseOptions() + and pointed in #340591 + +Tue Oct 17 22:04:31 CEST 2006 Daniel Veillard + + * HTMLparser.c: fixed teh 2 stupid bugs affecting htmlReadDoc() and + htmlReadIO() this should fix #340322 + +Tue Oct 17 21:39:23 CEST 2006 Daniel Veillard + + * xpath.c: applied patch from Olaf Walkowiak which should fix #334104 + +Tue Oct 17 18:12:34 CEST 2006 Daniel Veillard + + * HTMLparser.c: fixing HTML minimized attribute values to be generated + internally if not present, fixes bug #332124 + * result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax + result/HTML/wired.html.sax: this affects the SAX event strem for + a few test cases + +Tue Oct 17 17:56:31 CEST 2006 Daniel Veillard + + * HTMLparser.c: fixing HTML entities in attributes parsing bug #362552 + * result/HTML/entities2.html* test/HTML/entities2.html: added to + the regression suite + +Tue Oct 17 01:21:37 CEST 2006 Daniel Veillard + + * xmllint.c: started to switch xmllint to use xmlSaveDoc to test + #342556 + * xmlsave.c: fixed #342556 easy and a whole set of problems with + encodings, BOM and xmlSaveDoc() + +Mon Oct 16 15:14:53 CEST 2006 Daniel Veillard + + * HTMLparser.c: fix #348252 if the document clains to be in a + different encoding in the meta tag and it's obviously wrong, + don't screw up the end of the content. + +Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard + + * HTMLparser.c: fix a chunking and script bug #347708 + +Mon Oct 16 09:51:05 CEST 2006 Daniel Veillard + + * HTMLparser.c: remove a warning + * encoding.c: check with uppercase for AIX iconv() should fix #352644 + * doc/examples/Makefile.am: partially handle one bug report + +Sun Oct 15 22:31:42 CEST 2006 Daniel Veillard + + * parser.c: fix the patch for unreproductable #343000 but + also fix a line/column keeping error + * result/errors/attr1.xml.err result/errors/attr2.xml.err + result/errors/name.xml.err result/errors/name2.xml.err + result/schemas/anyAttr-processContents-err1_0_0.err + result/schemas/bug312957_1_0.err: affected lines in error output + of the regression tests + +Sat Oct 14 10:46:46 CEST 2006 Daniel Veillard + + * tree.c: fixing bug #344390 with xmlReconciliateNs + +Sat Oct 14 00:31:49 CEST 2006 Daniel Veillard + + * xmllint.c: added --html --memory to test htmlReadMemory to + test #321632 + * HTMLparser.c: added various initialization calls which may help + #321632 but not conclusive + * testapi.c tree.c include/libxml/tree.h: fixed compilation with + --with-minimum --with-sax1 and --with-minimum --with-schemas + fixing #326442 + +Fri Oct 13 18:30:55 CEST 2006 Daniel Veillard + + * relaxng.c: fix a Relax-NG bug related to element content processing, + fixes bug #302836 + * test/relaxng/302836.rng test/relaxng/302836_0.xml + result/relaxng/302836*: added to regression tests + +Fri Oct 13 14:42:44 CEST 2006 Daniel Veillard + + * parser.c: fix a problem in xmlSplitQName resulting in bug #334669 + +Fri Oct 13 12:27:22 CEST 2006 Daniel Veillard + + * parser.c: fixed xmlIOParseDTD handling of @input in error case, + Should fix #335085 + * testapi.c: reset the http_proxy env variable to not waste time + on regression tests + +Thu Oct 12 23:07:43 CEST 2006 Rob Richards + + * xmlIO.c: fix Windows compile - missing xmlWrapOpen. + +Thu Oct 12 18:21:18 CEST 2006 Daniel Veillard + + * parser.c: fixed the heuristic used when trying to detect mixed-content + elememts if the parser wants to treat ignorable whitespaces + in a non-standard way, should fix bug #300263 + +Thu Oct 12 14:52:38 CEST 2006 Daniel Veillard + + * parser.c: fix a first arg error in SAX callback pointed out by + Mike Hommey, and another one still hanging around. Should fix #342737 + +Wed Oct 11 23:11:58 CEST 2006 Daniel Veillard + + * include/libxml/xmlversion.h.in: fix comment on versions + * xmlmemory.c: do not spend too much time digging in dumped memory + +Wed Oct 11 18:40:00 CEST 2006 Daniel Veillard + + * valid.c: fixed a weird error where validity context whould not + show up if warnings were disabled pointed out by Bob Stayton + * xmlIO.c doc/generator.py: cleanup and fix to regenerate the docs + * doc//* testapi.c: rebuilt the docs + +Wed Oct 11 14:32:00 CEST 2006 Daniel Veillard + + * libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate + library flags for shared and static builds, fixes #344594. If this + bites you, use xml2-config. + +Wed Oct 11 11:27:37 CEST 2006 Daniel Veillard + + * python/Makefile.am: remove the build path recorded in the python + shared module as Peter Breitenlohner pointed out, should fix #346022 + +Wed Oct 11 11:14:51 CEST 2006 Daniel Veillard + + * xmlIO.c: applied patch from Mikhail Zabaluev fixing the conditions + of unescaping from URL to filepath, should fix #344588. + +Wed Oct 11 10:24:58 CEST 2006 Daniel Veillard + + * configure.in xstc/Makefile.am: applied patch from Peter Breitenlohner + for wget detection and fix of a Python path problem, should fix + #340993 + +Tue Oct 10 22:02:29 CEST 2006 Daniel Veillard + + * include/libxml/entities.h entities.c SAX2.c parser.c: trying to + fix entities behaviour when using SAX, had to extend entities + content and hack on the entities processing code, but that should + fix the long standing bug #159219 + +Tue Oct 10 14:36:18 CEST 2006 Daniel Veillard + + * uri.c include/libxml/uri.h: add a new function xmlPathToUri() + to provide a clean conversion when setting up a base + * SAX2.c tree.c: use said function when setting up doc->URL + or using the xmlSetBase function. Should fix #346261 + +Tue Oct 10 11:05:59 CEST 2006 Daniel Veillard + + * xmlIO.c: applied a portability patch from Emelyanov Alexey + +Tue Oct 10 10:52:01 CEST 2006 Daniel Veillard + + * parser.c: applied and slightly modified a patch from Michael Day to + keep _private in the parser context when parsing external entities + +Tue Oct 10 10:33:43 CEST 2006 Daniel Veillard + + * python/libxml.py python/types.c: applied patch from Ross Reedstrom, + Brian West and Stefan Anca to add XPointer suport to the Python bindings + +Fri Sep 29 11:13:59 CEST 2006 Daniel Veillard + + * xmlsave.c: fixed a comment + * xinclude.c include/libxml/xinclude.h: applied a patch from Michael Day + to add a new function providing the _private field for the generated + parser contexts xmlXIncludeProcessFlagsData() + +Thu Sep 21 10:36:11 CEST 2006 Daniel Veillard + + * xmlIO.c: applied patch from Michael Day doing some refactoring + for the catalog entity loaders. + +Thu Sep 21 08:53:06 CEST 2006 Daniel Veillard + + * HTMLparser.c include/libxml/HTMLparser.h: exports htmlNewParserCtxt() + as Michael Day pointed out this is needed to use htmlCtxtRead*() + +Tue Sep 19 14:42:59 CEST 2006 Daniel Veillard + + * parser.c: applied patch from Ben Darnell on #321545, I could not + reproduce the problem but 1/ this is safe 2/ it's better to be safe. + +Sat Sep 16 16:02:23 CEST 2006 Rob Richards + + * tree.c: xmlTextConcat works with comments and PI nodes (bug #355962). + * parser.c: fix resulting tree corruption when using XML namespace + with existing doc in xmlParseBalancedChunkMemoryRecover. + +Fri Sep 1 11:52:55 CEST 2006 Daniel Veillard + + * xmlIO.c: another patch from Emelyanov Alexey to clean up a few things + in the previous patch. + +Wed Aug 30 15:10:09 CEST 2006 Daniel Veillard + + * xmlIO.c: applied patch from Roland Schwingel to fix the problem + with file names in UTF-8 on Windows, and compat on older win9x + versions. + +Tue Aug 22 16:51:22 CEST 2006 Daniel Veillard + + * valid.c: fixed a bug #203125 in Red hat bugzilla, crashing PHP4 + on validation errors, the heuristic to guess is a vctxt user + pointer is the parsing context was insufficient. + +Mon Aug 21 10:40:10 CEST 2006 Daniel Veillard + + * doc/xmlcatalog.1 doc/xmlcatalog_man.xml doc/xmllint.1 doc/xmllint.xml: + applied patch to man pages from Daniel Leidert and regenerated + +Thu Aug 17 00:48:31 CEST 2006 Rob Richards + + * xmlwriter.c: Add a document to the xmlwriter structure and + pass document when writing attribute content for encoding support. + +Wed Aug 16 01:15:12 CEST 2006 Rob Richards + + * HTMLtree.c xmlsave.c: Add linefeeds to error messages allowing + for consistant handling. + +Tue Aug 15 15:02:18 CEST 2006 Kasimier Buchcik + + * xpath.c: Applied the proposed fix for the documentation + of xmlXPathCastToString(); see bug #346202. + +Tue Aug 15 14:49:18 CEST 2006 Kasimier Buchcik + + * xmlschemas.c: While investigating bug #350247, I noticed + that xmlSchemaIDCMatcher structs are massively recreated + although only a maximum of 3 structs is used at the same + time; added a cache for those structures to the + validation context. + +Sat Aug 12 16:12:53 CEST 2006 Daniel Veillard + + * xmlschemas.c: applied patch from Marton Illes to fix an allocation + bug in xmlSchemaXPathEvaluate should close #351032 + +Mon Aug 7 13:08:46 CEST 2006 Daniel Veillard + + * xmlschemas.c: applied patch from Bertrand Fritsch to fix a bug in + xmlSchemaClearValidCtxt + +Fri Aug 4 14:50:41 CEST 2006 Daniel Veillard + + * python/generator.py: fixed the conversion of long parameters + +Thu Jul 13 15:03:11 CEST 2006 Kasimier Buchcik + + * xmlsave.c: Removed the automatic generation of CDATA sections + for the content of the "script" and "style" elements when + serializing XHTML. The issue was reported by Vincent Lefevre, + bug #345147. + * result/xhtml1 result/noent/xhtml1: Adjusted regression test + results due to the serialization change described above. + +Thu Jul 13 08:32:21 CEST 2006 Daniel Veillard + + * configure.in parser.c xmllint.c include/libxml/parser.h + include/libxml/xmlversion.h.in: applied patch from Andrew W. Nosenko + to expose if zlib support was compiled in, in the header, in the + feature API and in the xmllint --version output. + +Thu Jul 13 08:24:14 CEST 2006 Daniel Veillard + + * SAX2.c: refactor to use normal warnings for entities problem + and not straight SAX callbacks. + +Wed Jul 12 17:13:03 CEST 2006 Kasimier Buchcik + + * xmlschemas.c: Fixed bug #347316, reported by David Belius: + The simple type, which was the content type definition + of a complex type, which in turn was the base type of a + extending complex type, was missed to be set on this + extending complex type in the derivation machinery. + +Mon Jul 3 13:36:43 CEST 2006 Kasimier Buchcik + + * xpath.c: Changed xmlXPathCollectAndTest() to use + xmlXPathNodeSetAddNs() when adding a ns-node in case of + NODE_TEST_TYPE (the ns-node was previously added plainly + to the list). Since for NODE_TEST_ALL and NODE_TEST_NAME + this specialized ns-addition function was already used, + I assume it was missed to be used with NODE_TEST_TYPE. + +Mon Jul 3 10:57:33 CEST 2006 Daniel Veillard + + * HTMLparser.c: applied const'ification of strings patch from + Matthias Clasen + +Thu Jun 29 13:51:12 CEST 2006 Daniel Veillard + + * threads.c: patch from Andrew W. Nosenko, xmlFreeRMutex forgot to + destroy the condition associated to the mutex. + +Thu Jun 29 12:48:00 CEST 2006 Kasimier Buchcik + + * xpath.c: Fixed a double-free in xmlXPathCompOpEvalToBoolean(), + revealed by a Libxslt regression test. + +Thu Jun 29 12:28:07 CEST 2006 Kasimier Buchcik + + * xpath.c: Enhanced xmlXPathCompOpEvalToBoolean() to be also + usable outside predicate evaluation; the intention is to + use it via xmlXPathCompiledEvalToBoolean() for XSLT tests, + like in . + +Wed Jun 28 19:11:16 CEST 2006 Kasimier Buchcik + + * xpath.c: Fix a memory leak which occurred when using + xmlXPathCompiledEvalToBoolean(). + +Mon Jun 26 17:24:28 UTC 2006 William Brack + + * python/libxml.c, python/libxml.py, python/tests/compareNodes.py, + python/tests/Makefile.am: + Added code submitted by Andreas Pakulat to provide node + equality, inequality and hash functions, plus a single + test program to check the functions (bugs 345779 + 345961). + +Mon Jun 26 18:38:51 CEST 2006 Kasimier Buchcik + + * xpath.c: Added xmlXPathCompiledEvalToBoolean() to the API and + adjusted/added xmlXPathRunEval(), xmlXPathRunStreamEval(), + xmlXPathCompOpEvalToBoolean(), xmlXPathNodeCollectAndTest() + to be aware of a boolean result request. The new function + is now used to evaluate predicates. + +Mon Jun 26 16:22:50 CEST 2006 Kasimier Buchcik + + * xpath.c: Fixed an bug in xmlXPathCompExprAdd(): the newly + introduced field @rewriteType on xmlXPathStepOp was not + initialized to zero here; this could lead to the activation + of the axis rewrite code in xmlXPathNodeCollectAndTest() when + @rewriteType is randomly set to the value 1. A test + (hardcoding the intial value to 1) revealed that the + resulting incorrect behaviour is similar to the behaviour + as described by Arnold Hendriks on the mailing list; so I + hope that will fix the issue. + +Fri Jun 23 18:26:08 CEST 2006 Kasimier Buchcik + + * xpath.c: Fixed an error in xmlXPathEvalExpr(), which + was introduced with the addition of the d-o-s rewrite + and made xpath.c unable to compile if XPATH_STREAMING + was not defined (reported by Kupriyanov Anatolij - + #345752). Fixed the check for d-o-s rewrite + to work on the correct XPath string, which is ctxt->base + and not comp->expr in this case. + +Mon Jun 19 12:23:41 CEST 2006 Kasimier Buchcik + + * xpath.c: Added optimization for positional predicates + (only short-hand form "[n]"), which have a preceding + predicate: "/foo[descendant::bar][3]". + +Sun Jun 18 20:59:02 EDT 2006 Daniel Veillard + + * parser.c: try to fix the crash raised by the parser in + recover mode as pointed by Ryan Phillips + +Sun Jun 18 18:44:56 EDT 2006 Daniel Veillard + + * python/types.c: patch from Nic Ferrier to provide a better type + mapping from XPath to python + +Sun Jun 18 18:35:50 EDT 2006 Daniel Veillard + + * runtest.c: applied patch from Boz for VMS and reporting + Schemas errors. + +Sun Jun 18 18:22:25 EDT 2006 Daniel Veillard + + * testapi.c: applied patch from Felipe Contreras when compiling + with --with-minimum + +Fri Jun 16 21:37:44 CEST 2006 Kasimier Buchcik + + * tree.c include/libxml/tree.h: Fixed a bug in + xmlDOMWrapAdoptNode(); the tree traversal stopped if the + very first given node had an attribute node :-( This was due + to a missed check in the traversal mechanism. + Expanded the xmlDOMWrapCtxt: it now holds the namespace map + used in xmlDOMWrapAdoptNode() and xmlDOMWrapCloneNode() for + reusal; so the map-items don't need to be created for every + cloning/adoption. Added a callback function to it for + retrieval of xmlNsPtr to be set on node->ns; this is needed + for my custom handling of ns-references in my DOM wrapper. + Substituted code which created the XML namespace decl on + the doc for a call to xmlTreeEnsureXMLDecl(). Removed + those nastly "warnigns" from the docs of the clone/adopt + functions; they work fine on my side. + +Mon Jun 12 13:23:11 CEST 2006 Kasimier Buchcik + + * result/pattern/namespaces: Adjusted the result of a + regression test, since the fix of xmlGetNodePath() revealed a + bug in this test result. + +Mon Jun 12 13:06:03 CEST 2006 Kasimier Buchcik + + * tree.c: Got rid of a compiler warning in xmlGetNodePath(). + +Mon Jun 12 12:54:25 CEST 2006 Kasimier Buchcik + + * tree.c: Fixed xmlGetNodePath() to generate the node test "*" + for elements in the default namespace, rather than generating + an unprefixed named node test and loosing the namespace + information. + +Fri Jun 9 21:45:02 CEST 2006 Kasimier Buchcik + + * include/libxml/parser.h: Clarified in the docs that the tree + must not be tried to be modified if using the parser flag + XML_PARSE_COMPACT as suggested by Stefan Behnel + (#344390). + Tue Jun 6 17:50:43 CEST 2006 Daniel Veillard * configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.26 diff --git a/HTMLparser.c b/HTMLparser.c index 2e646ad..5e23ad7 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -493,11 +493,11 @@ htmlSkipBlankChars(xmlParserCtxtPtr ctxt) { #define EMPTY NULL -static const char* html_flow[] = { FLOW, NULL } ; -static const char* html_inline[] = { INLINE, NULL } ; +static const char* const html_flow[] = { FLOW, NULL } ; +static const char* const html_inline[] = { INLINE, NULL } ; /* placeholders: elts with content but no subelements */ -static const char* html_pcdata[] = { NULL } ; +static const char* const html_pcdata[] = { NULL } ; #define html_cdata html_pcdata @@ -516,103 +516,104 @@ static const char* html_pcdata[] = { NULL } ; #define CELLVALIGN "valign" #define NB_CELLVALIGN 1 -static const char* html_attrs[] = { ATTRS, NULL } ; -static const char* core_i18n_attrs[] = { COREATTRS, I18N, NULL } ; -static const char* core_attrs[] = { COREATTRS, NULL } ; -static const char* i18n_attrs[] = { I18N, NULL } ; +static const char* const html_attrs[] = { ATTRS, NULL } ; +static const char* const core_i18n_attrs[] = { COREATTRS, I18N, NULL } ; +static const char* const core_attrs[] = { COREATTRS, NULL } ; +static const char* const i18n_attrs[] = { I18N, NULL } ; /* Other declarations that should go inline ... */ -static const char* a_attrs[] = { ATTRS, "charset", "type", "name", +static const char* const a_attrs[] = { ATTRS, "charset", "type", "name", "href", "hreflang", "rel", "rev", "accesskey", "shape", "coords", "tabindex", "onfocus", "onblur", NULL } ; -static const char* target_attr[] = { "target", NULL } ; -static const char* rows_cols_attr[] = { "rows", "cols", NULL } ; -static const char* alt_attr[] = { "alt", NULL } ; -static const char* src_alt_attrs[] = { "src", "alt", NULL } ; -static const char* href_attrs[] = { "href", NULL } ; -static const char* clear_attrs[] = { "clear", NULL } ; -static const char* inline_p[] = { INLINE, "p", NULL } ; -static const char* flow_param[] = { FLOW, "param", NULL } ; -static const char* applet_attrs[] = { COREATTRS , "codebase", +static const char* const target_attr[] = { "target", NULL } ; +static const char* const rows_cols_attr[] = { "rows", "cols", NULL } ; +static const char* const alt_attr[] = { "alt", NULL } ; +static const char* const src_alt_attrs[] = { "src", "alt", NULL } ; +static const char* const href_attrs[] = { "href", NULL } ; +static const char* const clear_attrs[] = { "clear", NULL } ; +static const char* const inline_p[] = { INLINE, "p", NULL } ; + +static const char* const flow_param[] = { FLOW, "param", NULL } ; +static const char* const applet_attrs[] = { COREATTRS , "codebase", "archive", "alt", "name", "height", "width", "align", "hspace", "vspace", NULL } ; -static const char* area_attrs[] = { "shape", "coords", "href", "nohref", +static const char* const area_attrs[] = { "shape", "coords", "href", "nohref", "tabindex", "accesskey", "onfocus", "onblur", NULL } ; -static const char* basefont_attrs[] = +static const char* const basefont_attrs[] = { "id", "size", "color", "face", NULL } ; -static const char* quote_attrs[] = { ATTRS, "cite", NULL } ; -static const char* body_contents[] = { FLOW, "ins", "del", NULL } ; -static const char* body_attrs[] = { ATTRS, "onload", "onunload", NULL } ; -static const char* body_depr[] = { "background", "bgcolor", "text", +static const char* const quote_attrs[] = { ATTRS, "cite", NULL } ; +static const char* const body_contents[] = { FLOW, "ins", "del", NULL } ; +static const char* const body_attrs[] = { ATTRS, "onload", "onunload", NULL } ; +static const char* const body_depr[] = { "background", "bgcolor", "text", "link", "vlink", "alink", NULL } ; -static const char* button_attrs[] = { ATTRS, "name", "value", "type", +static const char* const button_attrs[] = { ATTRS, "name", "value", "type", "disabled", "tabindex", "accesskey", "onfocus", "onblur", NULL } ; -static const char* col_attrs[] = { ATTRS, "span", "width", CELLHALIGN, CELLVALIGN, NULL } ; -static const char* col_elt[] = { "col", NULL } ; -static const char* edit_attrs[] = { ATTRS, "datetime", "cite", NULL } ; -static const char* compact_attrs[] = { ATTRS, "compact", NULL } ; -static const char* dl_contents[] = { "dt", "dd", NULL } ; -static const char* compact_attr[] = { "compact", NULL } ; -static const char* label_attr[] = { "label", NULL } ; -static const char* fieldset_contents[] = { FLOW, "legend" } ; -static const char* font_attrs[] = { COREATTRS, I18N, "size", "color", "face" , NULL } ; -static const char* form_contents[] = { HEADING, LIST, INLINE, "pre", "p", "div", "center", "noscript", "noframes", "blockquote", "isindex", "hr", "table", "fieldset", "address", NULL } ; -static const char* form_attrs[] = { ATTRS, "method", "enctype", "accept", "name", "onsubmit", "onreset", "accept-charset", NULL } ; -static const char* frame_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "noresize", "scrolling" , NULL } ; -static const char* frameset_attrs[] = { COREATTRS, "rows", "cols", "onload", "onunload", NULL } ; -static const char* frameset_contents[] = { "frameset", "frame", "noframes", NULL } ; -static const char* head_attrs[] = { I18N, "profile", NULL } ; -static const char* head_contents[] = { "title", "isindex", "base", "script", "style", "meta", "link", "object", NULL } ; -static const char* hr_depr[] = { "align", "noshade", "size", "width", NULL } ; -static const char* version_attr[] = { "version", NULL } ; -static const char* html_content[] = { "head", "body", "frameset", NULL } ; -static const char* iframe_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", NULL } ; -static const char* img_attrs[] = { ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", NULL } ; -static const char* input_attrs[] = { ATTRS, "type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "ismap", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", "accept", NULL } ; -static const char* prompt_attrs[] = { COREATTRS, I18N, "prompt", NULL } ; -static const char* label_attrs[] = { ATTRS, "for", "accesskey", "onfocus", "onblur", NULL } ; -static const char* legend_attrs[] = { ATTRS, "accesskey", NULL } ; -static const char* align_attr[] = { "align", NULL } ; -static const char* link_attrs[] = { ATTRS, "charset", "href", "hreflang", "type", "rel", "rev", "media", NULL } ; -static const char* map_contents[] = { BLOCK, "area", NULL } ; -static const char* name_attr[] = { "name", NULL } ; -static const char* action_attr[] = { "action", NULL } ; -static const char* blockli_elt[] = { BLOCK, "li", NULL } ; -static const char* meta_attrs[] = { I18N, "http-equiv", "name", "scheme", NULL } ; -static const char* content_attr[] = { "content", NULL } ; -static const char* type_attr[] = { "type", NULL } ; -static const char* noframes_content[] = { "body", FLOW MODIFIER, NULL } ; -static const char* object_contents[] = { FLOW, "param", NULL } ; -static const char* object_attrs[] = { ATTRS, "declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex", NULL } ; -static const char* object_depr[] = { "align", "border", "hspace", "vspace", NULL } ; -static const char* ol_attrs[] = { "type", "compact", "start", NULL} ; -static const char* option_elt[] = { "option", NULL } ; -static const char* optgroup_attrs[] = { ATTRS, "disabled", NULL } ; -static const char* option_attrs[] = { ATTRS, "disabled", "label", "selected", "value", NULL } ; -static const char* param_attrs[] = { "id", "value", "valuetype", "type", NULL } ; -static const char* width_attr[] = { "width", NULL } ; -static const char* pre_content[] = { PHRASE, "tt", "i", "b", "u", "s", "strike", "a", "br", "script", "map", "q", "span", "bdo", "iframe", NULL } ; -static const char* script_attrs[] = { "charset", "src", "defer", "event", "for", NULL } ; -static const char* language_attr[] = { "language", NULL } ; -static const char* select_content[] = { "optgroup", "option", NULL } ; -static const char* select_attrs[] = { ATTRS, "name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange", NULL } ; -static const char* style_attrs[] = { I18N, "media", "title", NULL } ; -static const char* table_attrs[] = { ATTRS "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding", "datapagesize", NULL } ; -static const char* table_depr[] = { "align", "bgcolor", NULL } ; -static const char* table_contents[] = { "caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr", NULL} ; -static const char* tr_elt[] = { "tr", NULL } ; -static const char* talign_attrs[] = { ATTRS, CELLHALIGN, CELLVALIGN, NULL} ; -static const char* th_td_depr[] = { "nowrap", "bgcolor", "width", "height", NULL } ; -static const char* th_td_attr[] = { ATTRS, "abbr", "axis", "headers", "scope", "rowspan", "colspan", CELLHALIGN, CELLVALIGN, NULL } ; -static const char* textarea_attrs[] = { ATTRS, "name", "disabled", "readonly", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", NULL } ; -static const char* tr_contents[] = { "th", "td", NULL } ; -static const char* bgcolor_attr[] = { "bgcolor", NULL } ; -static const char* li_elt[] = { "li", NULL } ; -static const char* ul_depr[] = { "type", "compact", NULL} ; -static const char* dir_attr[] = { "dir", NULL} ; +static const char* const col_attrs[] = { ATTRS, "span", "width", CELLHALIGN, CELLVALIGN, NULL } ; +static const char* const col_elt[] = { "col", NULL } ; +static const char* const edit_attrs[] = { ATTRS, "datetime", "cite", NULL } ; +static const char* const compact_attrs[] = { ATTRS, "compact", NULL } ; +static const char* const dl_contents[] = { "dt", "dd", NULL } ; +static const char* const compact_attr[] = { "compact", NULL } ; +static const char* const label_attr[] = { "label", NULL } ; +static const char* const fieldset_contents[] = { FLOW, "legend" } ; +static const char* const font_attrs[] = { COREATTRS, I18N, "size", "color", "face" , NULL } ; +static const char* const form_contents[] = { HEADING, LIST, INLINE, "pre", "p", "div", "center", "noscript", "noframes", "blockquote", "isindex", "hr", "table", "fieldset", "address", NULL } ; +static const char* const form_attrs[] = { ATTRS, "method", "enctype", "accept", "name", "onsubmit", "onreset", "accept-charset", NULL } ; +static const char* const frame_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "noresize", "scrolling" , NULL } ; +static const char* const frameset_attrs[] = { COREATTRS, "rows", "cols", "onload", "onunload", NULL } ; +static const char* const frameset_contents[] = { "frameset", "frame", "noframes", NULL } ; +static const char* const head_attrs[] = { I18N, "profile", NULL } ; +static const char* const head_contents[] = { "title", "isindex", "base", "script", "style", "meta", "link", "object", NULL } ; +static const char* const hr_depr[] = { "align", "noshade", "size", "width", NULL } ; +static const char* const version_attr[] = { "version", NULL } ; +static const char* const html_content[] = { "head", "body", "frameset", NULL } ; +static const char* const iframe_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", NULL } ; +static const char* const img_attrs[] = { ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", NULL } ; +static const char* const input_attrs[] = { ATTRS, "type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "ismap", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", "accept", NULL } ; +static const char* const prompt_attrs[] = { COREATTRS, I18N, "prompt", NULL } ; +static const char* const label_attrs[] = { ATTRS, "for", "accesskey", "onfocus", "onblur", NULL } ; +static const char* const legend_attrs[] = { ATTRS, "accesskey", NULL } ; +static const char* const align_attr[] = { "align", NULL } ; +static const char* const link_attrs[] = { ATTRS, "charset", "href", "hreflang", "type", "rel", "rev", "media", NULL } ; +static const char* const map_contents[] = { BLOCK, "area", NULL } ; +static const char* const name_attr[] = { "name", NULL } ; +static const char* const action_attr[] = { "action", NULL } ; +static const char* const blockli_elt[] = { BLOCK, "li", NULL } ; +static const char* const meta_attrs[] = { I18N, "http-equiv", "name", "scheme", NULL } ; +static const char* const content_attr[] = { "content", NULL } ; +static const char* const type_attr[] = { "type", NULL } ; +static const char* const noframes_content[] = { "body", FLOW MODIFIER, NULL } ; +static const char* const object_contents[] = { FLOW, "param", NULL } ; +static const char* const object_attrs[] = { ATTRS, "declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex", NULL } ; +static const char* const object_depr[] = { "align", "border", "hspace", "vspace", NULL } ; +static const char* const ol_attrs[] = { "type", "compact", "start", NULL} ; +static const char* const option_elt[] = { "option", NULL } ; +static const char* const optgroup_attrs[] = { ATTRS, "disabled", NULL } ; +static const char* const option_attrs[] = { ATTRS, "disabled", "label", "selected", "value", NULL } ; +static const char* const param_attrs[] = { "id", "value", "valuetype", "type", NULL } ; +static const char* const width_attr[] = { "width", NULL } ; +static const char* const pre_content[] = { PHRASE, "tt", "i", "b", "u", "s", "strike", "a", "br", "script", "map", "q", "span", "bdo", "iframe", NULL } ; +static const char* const script_attrs[] = { "charset", "src", "defer", "event", "for", NULL } ; +static const char* const language_attr[] = { "language", NULL } ; +static const char* const select_content[] = { "optgroup", "option", NULL } ; +static const char* const select_attrs[] = { ATTRS, "name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange", NULL } ; +static const char* const style_attrs[] = { I18N, "media", "title", NULL } ; +static const char* const table_attrs[] = { ATTRS "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding", "datapagesize", NULL } ; +static const char* const table_depr[] = { "align", "bgcolor", NULL } ; +static const char* const table_contents[] = { "caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr", NULL} ; +static const char* const tr_elt[] = { "tr", NULL } ; +static const char* const talign_attrs[] = { ATTRS, CELLHALIGN, CELLVALIGN, NULL} ; +static const char* const th_td_depr[] = { "nowrap", "bgcolor", "width", "height", NULL } ; +static const char* const th_td_attr[] = { ATTRS, "abbr", "axis", "headers", "scope", "rowspan", "colspan", CELLHALIGN, CELLVALIGN, NULL } ; +static const char* const textarea_attrs[] = { ATTRS, "name", "disabled", "readonly", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", NULL } ; +static const char* const tr_contents[] = { "th", "td", NULL } ; +static const char* const bgcolor_attr[] = { "bgcolor", NULL } ; +static const char* const li_elt[] = { "li", NULL } ; +static const char* const ul_depr[] = { "type", "compact", NULL} ; +static const char* const dir_attr[] = { "dir", NULL} ; #define DECL (const char**) @@ -896,7 +897,7 @@ html40ElementTable[] = { /* * start tags that imply the end of current element */ -static const char *htmlStartClose[] = { +static const char * const htmlStartClose[] = { "form", "form", "p", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "dl", "ul", "ol", "menu", "dir", "address", "pre", "listing", "xmp", "head", NULL, @@ -961,7 +962,7 @@ NULL * TODO: extend that list by reading the HTML SGML DTD on * implied paragraph */ -static const char *htmlNoContentElements[] = { +static const char *const htmlNoContentElements[] = { "html", "head", NULL @@ -972,7 +973,7 @@ static const char *htmlNoContentElements[] = { * NOTE: when adding ones, check htmlIsScriptAttribute() since * it assumes the name starts with 'on' */ -static const char *htmlScriptAttributes[] = { +static const char *const htmlScriptAttributes[] = { "onclick", "ondblclick", "onmousedown", @@ -1046,7 +1047,7 @@ htmlInitAutoClose(void) { for (indx = 0;indx < 100;indx ++) htmlStartCloseIndex[indx] = NULL; indx = 0; while ((htmlStartClose[i] != NULL) && (indx < 100 - 1)) { - htmlStartCloseIndex[indx++] = &htmlStartClose[i]; + htmlStartCloseIndex[indx++] = (const char**) &htmlStartClose[i]; while (htmlStartClose[i] != NULL) i++; i++; } @@ -2376,7 +2377,7 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { growBuffer(buffer); out = &buffer[indx]; } - c = (xmlChar)ent->value; + c = ent->value; if (c < 0x80) { *out++ = c; bits= -6; } else if (c < 0x800) @@ -2706,7 +2707,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { cur = CUR_CHAR(l); } - if (!(IS_CHAR_CH(cur))) { + if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) { htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, "Invalid char in CDATA 0x%X\n", cur); NEXT; @@ -3234,12 +3235,11 @@ htmlParseAttribute(htmlParserCtxtPtr ctxt, xmlChar **value) { NEXT; SKIP_BLANKS; val = htmlParseAttValue(ctxt); - /****** - } else { - * TODO : some attribute must have values, some may not - if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) - ctxt->sax->warning(ctxt->userData, - "No value for attribute %s\n", name); */ + } else if (htmlIsBooleanAttr(name)) { + /* + * assume a minimized attribute + */ + val = xmlStrdup(name); } *value = val; @@ -3290,7 +3290,18 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { * registered set of known encodings */ if (enc != XML_CHAR_ENCODING_ERROR) { - xmlSwitchEncoding(ctxt, enc); + if (((enc == XML_CHAR_ENCODING_UTF16LE) || + (enc == XML_CHAR_ENCODING_UTF16BE) || + (enc == XML_CHAR_ENCODING_UCS4LE) || + (enc == XML_CHAR_ENCODING_UCS4BE)) && + (ctxt->input->buf != NULL) && + (ctxt->input->buf->encoder == NULL)) { + htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, + "htmlCheckEncoding: wrong encoding meta\n", + NULL, NULL); + } else { + xmlSwitchEncoding(ctxt, enc); + } ctxt->charset = XML_CHAR_ENCODING_UTF8; } else { /* @@ -4260,10 +4271,10 @@ htmlFreeParserCtxt(htmlParserCtxtPtr ctxt) * * Allocate and initialize a new parser context. * - * Returns the xmlParserCtxtPtr or NULL + * Returns the htmlParserCtxtPtr or NULL in case of allocation error */ -static htmlParserCtxtPtr +htmlParserCtxtPtr htmlNewParserCtxt(void) { xmlParserCtxtPtr ctxt; @@ -4336,7 +4347,8 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) { * Returns the new parser context or NULL */ static htmlParserCtxtPtr -htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) { +htmlCreateDocParserCtxt(const xmlChar *cur, + const char *encoding ATTRIBUTE_UNUSED) { int len; htmlParserCtxtPtr ctxt; @@ -4939,9 +4951,17 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { /* * Handle SCRIPT/STYLE separately */ - if ((!terminate) && - (htmlParseLookupSequence(ctxt, '<', '/', 0, 0) < 0)) - goto done; + if (!terminate) { + int idx; + xmlChar val; + + idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0); + if (idx < 0) + goto done; + val = in->cur[idx + 2]; + if (val == 0) /* bad cut of input */ + goto done; + } htmlParseScript(ctxt); if ((cur == '<') && (next == '/')) { ctxt->instate = XML_PARSER_END_TAG; @@ -5379,6 +5399,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif } + ctxt->progressive = 1; return(ctxt); } @@ -5727,6 +5748,7 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt) if (ctxt == NULL) return; + xmlInitParser(); dict = ctxt->dict; while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */ @@ -5842,6 +5864,7 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options) ctxt->keepBlanks = 1; if (options & HTML_PARSE_RECOVER) { ctxt->recovery = 1; + options -= HTML_PARSE_RECOVER; } else ctxt->recovery = 0; if (options & HTML_PARSE_COMPACT) { @@ -5914,7 +5937,8 @@ htmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int opti if (cur == NULL) return (NULL); - ctxt = xmlCreateDocParserCtxt(cur); + xmlInitParser(); + ctxt = htmlCreateDocParserCtxt(cur, NULL); if (ctxt == NULL) return (NULL); return (htmlDoRead(ctxt, URL, encoding, options, 0)); @@ -5935,6 +5959,7 @@ htmlReadFile(const char *filename, const char *encoding, int options) { htmlParserCtxtPtr ctxt; + xmlInitParser(); ctxt = htmlCreateFileParserCtxt(filename, encoding); if (ctxt == NULL) return (NULL); @@ -5958,9 +5983,11 @@ htmlReadMemory(const char *buffer, int size, const char *URL, const char *encodi { htmlParserCtxtPtr ctxt; + xmlInitParser(); ctxt = xmlCreateMemoryParserCtxt(buffer, size); if (ctxt == NULL) return (NULL); + htmlDefaultSAXHandlerInit(); if (ctxt->sax != NULL) memcpy(ctxt->sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1)); return (htmlDoRead(ctxt, URL, encoding, options, 0)); @@ -5987,6 +6014,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) if (fd < 0) return (NULL); + xmlInitParser(); input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); if (input == NULL) return (NULL); @@ -6028,12 +6056,13 @@ htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, if (ioread == NULL) return (NULL); + xmlInitParser(); input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); if (input == NULL) return (NULL); - ctxt = xmlNewParserCtxt(); + ctxt = htmlNewParserCtxt(); if (ctxt == NULL) { xmlFreeParserInputBuffer(input); return (NULL); diff --git a/HTMLtree.c b/HTMLtree.c index d73024a..c1e5a0a 100644 --- a/HTMLtree.c +++ b/HTMLtree.c @@ -348,19 +348,19 @@ htmlSaveErr(int code, xmlNodePtr node, const char *extra) switch(code) { case XML_SAVE_NOT_UTF8: - msg = "string is not in UTF-8"; + msg = "string is not in UTF-8\n"; break; case XML_SAVE_CHAR_INVALID: - msg = "invalid character value"; + msg = "invalid character value\n"; break; case XML_SAVE_UNKNOWN_ENCODING: - msg = "unknown encoding %s"; + msg = "unknown encoding %s\n"; break; case XML_SAVE_NO_DOCTYPE: - msg = "HTML has no DOCTYPE"; + msg = "HTML has no DOCTYPE\n"; break; default: - msg = "unexpected error number"; + msg = "unexpected error number\n"; } __xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra); } diff --git a/Makefile.in b/Makefile.in index 980d634..d0b3f87 100644 --- a/Makefile.in +++ b/Makefile.in @@ -302,6 +302,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -330,6 +331,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -365,6 +367,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/NEWS b/NEWS index 5c9554a..e13224f 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,74 @@ ChangeLog.html to the CVS at http://cvs.gnome.org/viewcvs/libxml2/ code base.There is the list of public releases: +2.6.27: Oct 25 2006: + - Portability fixes: file names on windows (Roland Schwingel, + Emelyanov Alexey), windows compile fixup (Rob Richards), + AIX iconv() is apparently case sensitive + - improvements: Python XPath types mapping (Nic Ferrier), XPath optimization + (Kasimier), add xmlXPathCompiledEvalToBoolean (Kasimier), Python node + equality and comparison (Andreas Pakulat), xmlXPathCollectAndTest + improvememt (Kasimier), expose if library was compiled with zlib + support (Andrew Nosenko), cache for xmlSchemaIDCMatcher structs + (Kasimier), xmlTextConcat should work with comments and PIs (Rob + Richards), export htmlNewParserCtxt needed by Michael Day, refactoring + of catalog entity loaders (Michael Day), add XPointer support to + python bindings (Ross Reedstrom, Brian West and Stefan Anca), + try to sort out most file path to URI conversions and xmlPathToUri, + add --html --memory case to xmllint + - building fix: fix --with-minimum (Felipe Contreras), VMS fix, + const'ification of HTML parser structures (Matthias Clasen), + portability fix (Emelyanov Alexey), wget autodetection (Peter + Breitenlohner), remove the build path recorded in the python + shared module, separate library flags for shared and static builds + (Mikhail Zabaluev), fix --with-minimum --with-sax1 builds, fix + --with-minimum --with-schemas builds + - bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and + attribute (Kasimier), crash when using the recover mode, + xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier), + missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes + (Kasimier), warning on entities processing, XHTML script and style + serialization (Kasimier), python generator for long types, bug in + xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate + allocation bug (Marton Illes), error message end of line (Rob Richards), + fix attribute serialization in writer (Rob Richards), PHP4 DTD validation + crasher, parser safety patch (Ben Darnell), _private context propagation + when parsing entities (with Michael Day), fix entities behaviour when + using SAX, URI to file path fix (Mikhail Zabaluev), disapearing validity + context, arg error in SAX callback (Mike Hommey), fix mixed-content + autodetect when using --noblanks, fix xmlIOParseDTD error handling, + fix bug in xmlSplitQName on special Names, fix Relax-NG element content + validation bug, fix xmlReconciliateNs bug, fix potential attribute + XML parsing bug, fix line/column accounting in XML parser, chunking bug + in the HTML parser on script, try to detect obviously buggy HTML + meta encoding indications, bugs with encoding BOM and xmlSaveDoc, + HTML entities in attributes parsing, HTML minimized attribute values, + htmlReadDoc and htmlReadIO were broken, error handling bug in + xmlXPathEvalExpression (Olaf Walkowiak), fix a problem in + htmlCtxtUseOptions, xmlNewInputFromFile could leak (Marius Konitzer), + bug on misformed SSD regexps (Christopher Boumenot) + + - documentation: warning about XML_PARSE_COMPACT (Kasimier Buchcik), + fix xmlXPathCastToString documentation, improve man pages for + xmllitn and xmlcatalog (Daniel Leidert), fixed comments of a few + functions + + +2.6.26: Jun 6 2006: + - portability fixes: Python detection (Joseph Sacco), compilation + error(William Brack and Graham Bennett), LynxOS patch (Olli Savia) + - bug fixes: encoding buffer problem, mix of code and data in + xmlIO.c(Kjartan Maraas), entities in XSD validation (Kasimier Buchcik), + variousXSD validation fixes (Kasimier), memory leak in pattern (Rob + Richards andKasimier), attribute with colon in name (Rob Richards), XPath + leak inerror reporting (Aleksey Sanin), XInclude text include of + selfdocument. + - improvements: Xpath optimizations (Kasimier), XPath object + cache(Kasimier) + + +2.6.25: Jun 6 2006:: +Do not use or package 2.6.25 2.6.24: Apr 28 2006: - Portability fixes: configure on Windows, testapi compile on windows (Kasimier Buchcik, venkat naidu), Borland C++ 6 compile (Eric Zurcher), diff --git a/SAX2.c b/SAX2.c index 75d5f4c..7d4ab64 100644 --- a/SAX2.c +++ b/SAX2.c @@ -580,6 +580,7 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name) return(NULL); } ret->owner = 1; + ret->checked = 1; } return(ret); } @@ -987,7 +988,7 @@ xmlSAX2StartDocument(void *ctx) } if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) && (ctxt->input != NULL) && (ctxt->input->filename != NULL)) { - ctxt->myDoc->URL = xmlCanonicPath((const xmlChar *) ctxt->input->filename); + ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename); if (ctxt->myDoc->URL == NULL) xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument"); } @@ -1645,9 +1646,9 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) ns = xmlSearchNs(ctxt->myDoc, parent, prefix); if ((prefix != NULL) && (ns == NULL)) { ns = xmlNewNs(ret, NULL, prefix); - if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, - "Namespace prefix %s is not defined\n", prefix); + xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE, + "Namespace prefix %s is not defined\n", + prefix, NULL); } /* @@ -2255,9 +2256,9 @@ xmlSAX2StartElementNs(void *ctx, xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); return; } - if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, - "Namespace prefix %s was not found\n", prefix); + xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE, + "Namespace prefix %s was not found\n", + prefix, NULL); } } diff --git a/aclocal.m4 b/aclocal.m4 index 7786a0f..6ec819a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1597,7 +1597,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -4305,6 +4305,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -4438,11 +4441,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -4454,7 +4457,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -4534,7 +4537,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -6370,6 +6373,7 @@ do done done done +IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -6402,6 +6406,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do done ]) SED=$lt_cv_path_SED +AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) diff --git a/configure b/configure index 5bf44bb..0749a93 100755 --- a/configure +++ b/configure @@ -463,7 +463,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os LIBXML_MAJOR_VERSION LIBXML_MINOR_VERSION LIBXML_MICRO_VERSION LIBXML_VERSION LIBXML_VERSION_INFO LIBXML_VERSION_NUMBER LIBXML_VERSION_EXTRA INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP RM MV TAR PERL XMLLINT XSLTPROC EGREP U ANSI2KNR LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL HTML_DIR Z_CFLAGS Z_LIBS PYTHON WITH_PYTHON_TRUE WITH_PYTHON_FALSE pythondir PYTHON_SUBDIR WITH_MODULES MODULE_PLATFORM_LIBS MODULE_EXTENSION TEST_MODULES STATIC_BINARIES WITH_TRIO_SOURCES_TRUE WITH_TRIO_SOURCES_FALSE WITH_TRIO THREAD_LIBS BASE_THREAD_LIBS WITH_THREADS THREAD_CFLAGS TEST_THREADS THREADS_W32 WITH_TREE WITH_FTP FTP_OBJ WITH_HTTP HTTP_OBJ WITH_LEGACY WITH_READER READER_TEST WITH_WRITER WITH_PATTERN TEST_PATTERN WITH_SAX1 TEST_SAX WITH_PUSH TEST_PUSH WITH_HTML HTML_OBJ TEST_HTML TEST_PHTML WITH_VALID TEST_VALID TEST_VTIME WITH_CATALOG CATALOG_OBJ TEST_CATALOG WITH_DOCB DOCB_OBJ WITH_XPTR XPTR_OBJ TEST_XPTR WITH_C14N C14N_OBJ TEST_C14N WITH_XINCLUDE XINCLUDE_OBJ TEST_XINCLUDE WITH_XPATH XPATH_OBJ TEST_XPATH WITH_OUTPUT WITH_ICONV WITH_ISO8859X WITH_SCHEMATRON TEST_SCHEMATRON WITH_SCHEMAS TEST_SCHEMAS WITH_REGEXPS TEST_REGEXPS WITH_DEBUG DEBUG_OBJ TEST_DEBUG WITH_MEM_DEBUG WITH_RUN_DEBUG WIN32_EXTRA_LIBADD WIN32_EXTRA_LDFLAGS CYGWIN_EXTRA_LDFLAGS CYGWIN_EXTRA_PYTHON_LIBADD XML_CFLAGS XML_LIBDIR XML_LIBS XML_LIBTOOLLIBS ICONV_LIBS XML_INCLUDEDIR HAVE_ISNAN HAVE_ISINF PYTHON_VERSION PYTHON_INCLUDES PYTHON_SITE_PACKAGES M_LIBS RDL_LIBS RELDATE PYTHON_TESTS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os LIBXML_MAJOR_VERSION LIBXML_MINOR_VERSION LIBXML_MICRO_VERSION LIBXML_VERSION LIBXML_VERSION_INFO LIBXML_VERSION_NUMBER LIBXML_VERSION_EXTRA INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP RM MV TAR PERL WGET XMLLINT XSLTPROC EGREP U ANSI2KNR SED LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL HTML_DIR Z_CFLAGS Z_LIBS WITH_ZLIB PYTHON WITH_PYTHON_TRUE WITH_PYTHON_FALSE pythondir PYTHON_SUBDIR WITH_MODULES MODULE_PLATFORM_LIBS MODULE_EXTENSION TEST_MODULES STATIC_BINARIES WITH_TRIO_SOURCES_TRUE WITH_TRIO_SOURCES_FALSE WITH_TRIO THREAD_LIBS BASE_THREAD_LIBS WITH_THREADS THREAD_CFLAGS TEST_THREADS THREADS_W32 WITH_TREE WITH_FTP FTP_OBJ WITH_HTTP HTTP_OBJ WITH_LEGACY WITH_READER READER_TEST WITH_WRITER WITH_PATTERN TEST_PATTERN WITH_SAX1 TEST_SAX WITH_PUSH TEST_PUSH WITH_HTML HTML_OBJ TEST_HTML TEST_PHTML WITH_VALID TEST_VALID TEST_VTIME WITH_CATALOG CATALOG_OBJ TEST_CATALOG WITH_DOCB DOCB_OBJ WITH_XPTR XPTR_OBJ TEST_XPTR WITH_C14N C14N_OBJ TEST_C14N WITH_XINCLUDE XINCLUDE_OBJ TEST_XINCLUDE WITH_XPATH XPATH_OBJ TEST_XPATH WITH_OUTPUT WITH_ICONV WITH_ISO8859X WITH_SCHEMATRON TEST_SCHEMATRON WITH_SCHEMAS TEST_SCHEMAS WITH_REGEXPS TEST_REGEXPS WITH_DEBUG DEBUG_OBJ TEST_DEBUG WITH_MEM_DEBUG WITH_RUN_DEBUG WIN32_EXTRA_LIBADD WIN32_EXTRA_LDFLAGS CYGWIN_EXTRA_LDFLAGS CYGWIN_EXTRA_PYTHON_LIBADD XML_CFLAGS XML_LIBDIR XML_LIBS XML_LIBTOOLLIBS ICONV_LIBS XML_INCLUDEDIR HAVE_ISNAN HAVE_ISINF PYTHON_VERSION PYTHON_INCLUDES PYTHON_SITE_PACKAGES M_LIBS RDL_LIBS RELDATE PYTHON_TESTS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1618,7 +1618,7 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=6 -LIBXML_MICRO_VERSION=26 +LIBXML_MICRO_VERSION=27 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 @@ -3633,6 +3633,46 @@ else echo "${ECHO_T}no" >&6 fi +# Extract the first word of "wget", so it can be a program name with args. +set dummy wget; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_WGET+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $WGET in + [\\/]* | ?:[\\/]*) + ac_cv_path_WGET="$WGET" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="/usr/bin/wget" + ;; +esac +fi +WGET=$ac_cv_path_WGET + +if test -n "$WGET"; then + echo "$as_me:$LINENO: result: $WGET" >&5 +echo "${ECHO_T}$WGET" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "xmllint", so it can be a program name with args. set dummy xmllint; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -4246,6 +4286,7 @@ do done done done +IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -4280,6 +4321,7 @@ done fi SED=$lt_cv_path_SED + echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 @@ -4704,7 +4746,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4707 "configure"' > conftest.$ac_ext + echo '#line 4749 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6072,7 +6114,7 @@ fi # Provide some information about the compiler. -echo "$as_me:6075:" \ +echo "$as_me:6117:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -7135,11 +7177,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7138: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7180: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7142: \$? = $ac_status" >&5 + echo "$as_me:7184: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7403,11 +7445,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7406: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7448: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7410: \$? = $ac_status" >&5 + echo "$as_me:7452: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7507,11 +7549,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7510: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7552: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7514: \$? = $ac_status" >&5 + echo "$as_me:7556: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8976,7 +9018,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 8979 "configure"' > conftest.$ac_ext + echo '#line 9021 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8995,7 +9037,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -9873,7 +9915,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12361: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12320: \$? = $ac_status" >&5 + echo "$as_me:12365: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12417,11 +12462,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12420: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12465: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12424: \$? = $ac_status" >&5 + echo "$as_me:12469: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12953,7 +12998,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 12956 "configure"' > conftest.$ac_ext + echo '#line 13001 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12972,7 +13017,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -13357,6 +13402,9 @@ CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -13490,11 +13538,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_CXX +predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_CXX +postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -13506,7 +13554,7 @@ postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -13586,7 +13634,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -14008,11 +14056,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14011: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14059: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14015: \$? = $ac_status" >&5 + echo "$as_me:14063: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14112,11 +14160,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14115: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14163: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14119: \$? = $ac_status" >&5 + echo "$as_me:14167: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15561,7 +15609,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 15564 "configure"' > conftest.$ac_ext + echo '#line 15612 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -15580,7 +15628,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -15965,6 +16013,9 @@ CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -16098,11 +16149,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_F77 +predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_F77 +postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -16114,7 +16165,7 @@ postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -16194,7 +16245,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -16336,11 +16387,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16339: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16390: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16343: \$? = $ac_status" >&5 + echo "$as_me:16394: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16604,11 +16655,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16607: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16658: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16611: \$? = $ac_status" >&5 + echo "$as_me:16662: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16708,11 +16759,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16711: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16762: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16715: \$? = $ac_status" >&5 + echo "$as_me:16766: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18177,7 +18228,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 18180 "configure"' > conftest.$ac_ext + echo '#line 18231 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -18196,7 +18247,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -18581,6 +18632,9 @@ CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -18714,11 +18768,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_GCJ +predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_GCJ +postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -18730,7 +18784,7 @@ postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -18810,7 +18864,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -19062,6 +19116,9 @@ CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`gcc -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -19195,11 +19252,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_RC +predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_RC +postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -19211,7 +19268,7 @@ postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -19291,7 +19348,7 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec @@ -19805,6 +19862,7 @@ fi echo Checking zlib +WITH_ZLIB=0 if test "$with_zlib" = "no"; then echo "Disabling compression support" else @@ -20021,9 +20079,10 @@ if test $ac_cv_lib_z_gzread = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBZ +#define HAVE_LIBZ 1 _ACEOF + WITH_ZLIB=1 if test "x${Z_DIR}" != "x"; then Z_CFLAGS="-I${Z_DIR}/include" Z_LIBS="-L${Z_DIR}/lib -lz" @@ -20046,6 +20105,7 @@ fi + CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags} @@ -25988,7 +26048,7 @@ fi echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5 echo $ECHO_N "checking for type of socket length (socklen_t)... $ECHO_C" >&6 cat > conftest.$ac_ext < @@ -25999,7 +26059,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: socklen_t *" >&5 @@ -26011,7 +26071,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26022,7 +26082,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: size_t *" >&5 @@ -26034,7 +26094,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26045,7 +26105,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:26048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* echo "$as_me:$LINENO: result: int *" >&5 @@ -29698,11 +29758,13 @@ s,@RM@,$RM,;t t s,@MV@,$MV,;t t s,@TAR@,$TAR,;t t s,@PERL@,$PERL,;t t +s,@WGET@,$WGET,;t t s,@XMLLINT@,$XMLLINT,;t t s,@XSLTPROC@,$XSLTPROC,;t t s,@EGREP@,$EGREP,;t t s,@U@,$U,;t t s,@ANSI2KNR@,$ANSI2KNR,;t t +s,@SED@,$SED,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t @@ -29729,6 +29791,7 @@ s,@LIBTOOL@,$LIBTOOL,;t t s,@HTML_DIR@,$HTML_DIR,;t t s,@Z_CFLAGS@,$Z_CFLAGS,;t t s,@Z_LIBS@,$Z_LIBS,;t t +s,@WITH_ZLIB@,$WITH_ZLIB,;t t s,@PYTHON@,$PYTHON,;t t s,@WITH_PYTHON_TRUE@,$WITH_PYTHON_TRUE,;t t s,@WITH_PYTHON_FALSE@,$WITH_PYTHON_FALSE,;t t diff --git a/configure.in b/configure.in index e01408a..b2174c6 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=26 +LIBXML_MICRO_VERSION=27 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 @@ -40,6 +40,7 @@ AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(TAR, tar, /bin/tar) AC_PATH_PROG(PERL, perl, /usr/bin/perl) +AC_PATH_PROG(WGET, wget, /usr/bin/wget) AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) @@ -325,12 +326,14 @@ echo Checking zlib dnl Checks for zlib library. +WITH_ZLIB=0 if test "$with_zlib" = "no"; then echo "Disabling compression support" else AC_CHECK_HEADERS(zlib.h, AC_CHECK_LIB(z, gzread,[ - AC_DEFINE([HAVE_LIBZ], [], [Have compression library]) + AC_DEFINE([HAVE_LIBZ], [1], [Have compression library]) + WITH_ZLIB=1 if test "x${Z_DIR}" != "x"; then Z_CFLAGS="-I${Z_DIR}/include" Z_LIBS="-L${Z_DIR}/lib -lz" @@ -346,6 +349,7 @@ fi AC_SUBST(Z_CFLAGS) AC_SUBST(Z_LIBS) +AC_SUBST(WITH_ZLIB) CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags} diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index 4e55d77..f67a902 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -104,7 +104,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoFTPList
                          xmlParseAttValue
                          xmlTextWriterEndDocument
                          -
                          Allocate
                          xmlNanoFTPNewCtxt
                          +
                          Allocate
                          htmlNewParserCtxt
                          +xmlNanoFTPNewCtxt
                          xmlNewDocElementContent
                          xmlNewElementContent
                          xmlNewParserCtxt
                          @@ -129,6 +130,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Applies
                          htmlCtxtUseOptions
                          xmlCtxtUseOptions
                          xmlNormalizeURIPath
                          +xmlXPathCompiledEvalToBoolean
                          Apply
                          XML_SCHEMAS_ANYATTR_STRICT
                          XML_SCHEMAS_ANY_STRICT
                          Arabic
                          xmlUCSIsArabic
                          diff --git a/doc/APIchunk1.html b/doc/APIchunk1.html index 7c9ff72..a222fe0 100644 --- a/doc/APIchunk1.html +++ b/doc/APIchunk1.html @@ -267,6 +267,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Computes
                          xmlBuildURI
                          Concat
                          xmlTextConcat
                          Constructs
                          xmlCanonicPath
                          +xmlPathToURI
                          Content
                          xmlNodeGetBase
                          xmlParseElementContentDecl
                          Content-Type
                          xmlNanoHTTPFetch
                          @@ -337,7 +338,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Current
                          _xmlParserCtxt
                          _xmlParserInput
                          _xmlValidCtxt
                          -
                          Currently
                          xmlNanoFTPGetConnection
                          +
                          Currently
                          xmlDOMWrapCloneNode
                          +xmlNanoFTPGetConnection
                          xmlNanoFTPInit
                          xmlNanoHTTPInit
                          xmlTextReaderNextSibling
                          diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html index 0486624..432eb31 100644 --- a/doc/APIchunk10.html +++ b/doc/APIchunk10.html @@ -105,9 +105,12 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserHandleReference
                          xmlValidCtxtNormalizeAttributeValue
                          account
                          xmlSchemaValidateFacetWhtsp
                          +
                          acquire
                          _xmlDOMWrapCtxt
                          +xmlDOMWrapAcquireNsFunction
                          act
                          xmlStreamPush
                          xmlStreamPushAttr
                          xmlStreamPushNode
                          +
                          action
                          xmlDocSetRootElement
                          activate
                          xmlTextReaderSetParserProp
                          activated
                          DEBUG_MEMORY
                          xmlAutomataNewAllTrans
                          @@ -177,6 +180,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAddChild
                          xmlAddNextSibling
                          xmlAddPrevSibling
                          +xmlDOMWrapCloneNode
                          xmlDocDumpFormatMemory
                          xmlDocDumpFormatMemoryEnc
                          xmlDocFormatDump
                          @@ -223,7 +227,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAddChildList
                          xmlAddPrevSibling
                          xmlAddSibling
                          -
                          adoption
                          xmlDOMWrapCloneNode
                          affect
                          xmlKeepBlanksDefault
                          affiliation
                          _xmlSchemaElement
                          afraid
                          xmlEncodeEntities
                          @@ -280,7 +283,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewRMutex
                          xmlReallocLoc
                          xmlXPathObjectCopy
                          -
                          allocation
                          xmlBufferSetAllocationScheme
                          +
                          allocation
                          htmlNewParserCtxt
                          +xmlBufferSetAllocationScheme
                          xmlGetBufferAllocationScheme
                          xmlMallocAtomicLoc
                          xmlMallocLoc
                          @@ -476,6 +480,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseAttValue
                          xmlSAX2ResolveEntity
                          xmlSetExternalEntityLoader
                          +xmlXIncludeProcessFlagsData
                          applications
                          xmlSetGenericErrorFunc
                          xmlSetStructuredErrorFunc
                          applied
                          xmlHashCopy
                          diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html index 515f882..dc764d5 100644 --- a/doc/APIchunk11.html +++ b/doc/APIchunk11.html @@ -190,7 +190,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          boundary
                          xmlParseElementChildrenContentDecl
                          xmlParseElementMixedContentDecl
                          bracket
                          xmlParseCharData
                          -
                          branch
                          xmlDOMWrapRemoveNode
                          +
                          branch
                          xmlDOMWrapCloneNode
                          +xmlDOMWrapRemoveNode
                          break
                          _xmlError
                          xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html index 1c552b1..b036fc8 100644 --- a/doc/APIchunk12.html +++ b/doc/APIchunk12.html @@ -193,6 +193,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserInputBufferCreateMem
                          xmlParserInputBufferCreateStatic
                          checked
                          XML_SCHEMAS_ELEM_INTERNAL_CHECKED
                          +_xmlEntity
                          xmlNodeGetBase
                          xmlNodeGetLang
                          xmlNodeGetSpacePreserve
                          @@ -269,6 +270,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCleanupOutputCallbacks
                          client
                          xmlKeepBlanksDefault
                          clone
                          xmlDOMWrapCloneNode
                          +
                          cloned
                          xmlDOMWrapCloneNode
                          close
                          htmlAutoCloseTag
                          htmlCtxtReadIO
                          htmlIsAutoClosed
                          @@ -413,33 +415,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRecoverFile
                          xmlSAXParseFile
                          xmlSAXParseFileWithData
                          -
                          compiled
                          LIBXML_AUTOMATA_ENABLED
                          -LIBXML_EXPR_ENABLED
                          -LIBXML_LEGACY_ENABLED
                          -LIBXML_MODULES_ENABLED
                          -LIBXML_REGEXP_ENABLED
                          -LIBXML_SCHEMAS_ENABLED
                          -LIBXML_SCHEMATRON_ENABLED
                          -LIBXML_TEST_VERSION
                          -LIBXML_UNICODE_ENABLED
                          -_xmlSchemaAttribute
                          -_xmlSchemaElement
                          -_xmlSchemaFacet
                          -xmlAutomataCompile
                          -xmlCheckVersion
                          -xmlExpDump
                          -xmlExpMaxToken
                          -xmlGetLastError
                          -xmlHasFeature
                          -xmlPatterncompile
                          -xmlRegexpCompile
                          -xmlRegexpExec
                          -xmlRegexpIsDeterminist
                          -xmlRegexpPrint
                          -xmlSaveFile
                          -xmlSaveFormatFile
                          -xmlXPathCompiledEval
                          -xmlXPathDebugDumpCompExpr
                          compiled-in
                          xmlCleanupInputCallbacks
                          xmlCleanupOutputCallbacks
                          xmlPopInputCallbacks
                          @@ -604,6 +579,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidGetValidElements
                          construct
                          xmlParseElementChildrenContentDecl
                          construction
                          xmlCanonicPath
                          +xmlPathToURI
                          constructs
                          xmlExpParse
                          xmlParseNamespace
                          consumed
                          UTF8ToHtml
                          @@ -703,6 +679,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextWriterWriteDTDExternalEntityContents
                          contentspec
                          xmlParseElementContentDecl
                          xmlParseElementDecl
                          +
                          contexts
                          _xmlDOMWrapCtxt
                          contextual
                          xmlRelaxNGGetParserErrors
                          xmlRelaxNGSetParserErrors
                          xmlRelaxNGSetParserStructuredErrors
                          @@ -867,7 +844,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidityWarningFunc
                          cur
                          xmlXPathAxisFunc
                          currently
                          XML_SCHEMAS_INCLUDING_CONVERT_NS
                          -xmlDOMWrapCloneNode
                          xmlGcMemGet
                          xmlMemBlocks
                          xmlMemGet
                          diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html index 5980cc2..1c9e865 100644 --- a/doc/APIchunk13.html +++ b/doc/APIchunk13.html @@ -395,7 +395,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlDictReference
                          xmlDictSize
                          xmlExpNewCtxt
                          -
                          dicts
                          xmlDOMWrapCloneNode
                          did
                          XML_SCHEMAS_TYPE_BLOCK_DEFAULT
                          xmlTextReaderGetRemainder
                          xmlTextReaderStandalone
                          @@ -528,6 +527,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          don
                          XML_SCHEMAS_ANY_LAX
                          xlinkIsLink
                          xmlCreatePushParserCtxt
                          +xmlDOMWrapCloneNode
                          xmlNewDocNode
                          xmlNewDocNodeEatName
                          xmlParseStartTag
                          @@ -589,6 +589,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellCat
                          xmlShellDir
                          duplicate
                          xmlCanonicPath
                          +xmlPathToURI
                          duplicated
                          xmlRelaxNGNewDocParserCtxt
                          xmlXPathNodeSetFreeNs
                          duplicates
                          xmlSchemaCopyValue
                          diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html index f5134af..dfe748d 100644 --- a/doc/APIchunk14.html +++ b/doc/APIchunk14.html @@ -70,6 +70,7 @@ A:link, A:visited, A:active { text-decoration: underline } resolveEntitySAXFunc
                          xmlSAX2ResolveEntity
                          elem
                          XML_SCHEMAS_ELEM_INTERNAL_CHECKED
                          +
                          elem-
                          _xmlDOMWrapCtxt
                          element-
                          xmlStreamPushNode
                          xmlXPathOrderDocElems
                          element-node
                          xmlDOMWrapReconcileNamespaces
                          @@ -234,7 +235,6 @@ A:link, A:visited, A:active { text-decoration: underline }
                          equal
                          xmlAddChild
                          xmlAddNextSibling
                          xmlAddPrevSibling
                          -xmlDOMWrapCloneNode
                          xmlStrEqual
                          xmlStrQEqual
                          xmlTextReaderConstName
                          @@ -290,7 +290,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlDocSetRootElement
                          xmlParseInNodeContext
                          evaluate
                          xmlXPathEvalExpr
                          -
                          evaluated
                          xmlXPathEvalPredicate
                          +
                          evaluated
                          xmlXPathCompiledEvalToBoolean
                          +xmlXPathEvalPredicate
                          xmlXPathEvaluatePredicateResult
                          xmlXPtrNewContext
                          evaluating
                          xmlXPathEvalPredicate
                          @@ -382,13 +383,10 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStreamPush
                          xmlStreamPushAttr
                          xmlStreamPushNode
                          -
                          experimental
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          -xmlDOMWrapReconcileNamespaces
                          -xmlDOMWrapRemoveNode
                          explicitly
                          xmlSAXDefaultVersion
                          explored
                          xmlXPathAxisFunc
                          exposing
                          xmlTextReaderRead
                          +
                          expressing
                          xmlPathToURI
                          expressions
                          LIBXML_EXPR_ENABLED
                          LIBXML_REGEXP_ENABLED
                          xmlExpExpDerive
                          diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html index 4ac0a55..5bd7b26 100644 --- a/doc/APIchunk15.html +++ b/doc/APIchunk15.html @@ -74,6 +74,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellLoad
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          @@ -89,6 +90,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCharEncOutFunc
                          xmlCheckFilename
                          xmlFileOpen
                          +xmlPathToURI
                          fallback
                          XINCLUDE_FALLBACK
                          docbSAXParseDoc
                          docbSAXParseFile
                          @@ -134,6 +136,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SKIP_IDS
                          _xmlError
                          xmlParseMisc
                          +xmlXIncludeProcessFlagsData
                          xmlXPathOrderDocElems
                          fields
                          XML_SAX2_MAGIC
                          _htmlElemDesc
                          @@ -145,6 +148,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlReadFile
                          xmlCanonicPath
                          xmlCtxtReadFile
                          +xmlPathToURI
                          xmlReadFile
                          xmlReaderForFile
                          xmlReaderNewFile
                          @@ -320,6 +324,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          fragments
                          xmlParseURIRaw
                          freeing
                          xmlCanonicPath
                          xmlParserInputDeallocate
                          +xmlPathToURI
                          frees
                          xmlBufferFree
                          xmlXPathContextSetCache
                          front
                          xmlValidateNCName
                          @@ -398,6 +403,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidCtxtNormalizeAttributeValue
                          xmlValidNormalizeAttributeValue
                          xmlXIncludeSetFlags
                          +
                          future
                          _xmlDOMWrapCtxt

                          A-B C-C D-E diff --git a/doc/APIchunk16.html b/doc/APIchunk16.html index 5585cd5..0f91dc8 100644 --- a/doc/APIchunk16.html +++ b/doc/APIchunk16.html @@ -287,6 +287,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlEntityValueLookup
                          htmlParseEntityRef
                          htmlNodePtr
                          htmlNodeStatus
                          +
                          htmlParserCtxtPtr
                          htmlNewParserCtxt
                          htmlParserOption
                          htmlCtxtReadDoc
                          htmlCtxtReadFd
                          htmlCtxtReadFile
                          diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html index 071403e..9842c3a 100644 --- a/doc/APIchunk17.html +++ b/doc/APIchunk17.html @@ -153,6 +153,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCleanupOutputCallbacks
                          xmlPopInputCallbacks
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessTreeFlags
                          xmlXIncludeSetFlags
                          including
                          XML_SCHEMAS_INCLUDING_CONVERT_NS
                          @@ -357,6 +358,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_DETECT_IDS
                          XML_SKIP_IDS
                          htmlNewDocNoDtD
                          +htmlNewParserCtxt
                          xmlCharEncodingOutputFunc
                          xmlCreateEntitiesTable
                          xmlCreateEnumeration
                          @@ -403,6 +405,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAddNextSibling
                          xmlAddPrevSibling
                          xmlCopyElementContent
                          +xmlDocSetRootElement
                          xmlFreeElementContent
                          xmlIsBaseChar
                          xmlIsBlank
                          @@ -425,6 +428,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewPI
                          xmlSAX2ProcessingInstruction
                          insufficient
                          xmlCanonicPath
                          +xmlPathToURI
                          intact
                          xmlParseURIRaw
                          integer
                          xmlStrcasecmp
                          xmlStrcmp
                          @@ -434,7 +438,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathFloorFunction
                          xmlXPathRoundFunction
                          xmlXPathStringFunction
                          -
                          intended
                          xmlSchemaNewStringValue
                          +
                          intended
                          _xmlDOMWrapCtxt
                          +xmlSchemaNewStringValue
                          +
                          intensively
                          xmlDOMWrapAdoptNode
                          +xmlDOMWrapReconcileNamespaces
                          +xmlDOMWrapRemoveNode
                          interact
                          xmlParseExternalID
                          interface
                          LIBXML_PATTERN_ENABLED
                          LIBXML_READER_ENABLED
                          @@ -480,7 +488,6 @@ A:link, A:visited, A:active { text-decoration: underline }
                          invoking
                          xmlGetLineNo
                          isinf
                          xmlXPathIsInf
                          isn
                          xmlRegisterCharEncodingHandler
                          -xmlXPathCastToString
                          isnan
                          xmlXPathIsNaN
                          issue
                          xmlEncodeEntities
                          issued
                          xlinkIsLink
                          diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index 60efc29..f965440 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -37,7 +37,8 @@ A:link, A:visited, A:active { text-decoration: underline } w-w x-x y-z -

                          Letter j:

                          just
                          htmlSetMetaEncoding
                          +

                          Letter j:

                          just
                          _xmlDOMWrapCtxt
                          +htmlSetMetaEncoding
                          inputPop
                          namePop
                          nodePop
                          @@ -46,7 +47,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCreateEntitiesTable
                          xmlCreateEnumeration
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          xmlHandleEntity
                          xmlNanoFTPInit
                          xmlNanoHTTPInit
                          @@ -82,6 +82,7 @@ A:link, A:visited, A:active { text-decoration: underline } _xmlSchemaType
                          _xmlSchemaWildcard
                          know
                          BAD_CAST
                          +xmlDOMWrapCloneNode
                          knowledge
                          htmlAttrAllowed
                          known
                          _xmlParserInput
                          xmlAllocParserInputBuffer
                          @@ -345,6 +346,7 @@ A:link, A:visited, A:active { text-decoration: underline } xlinkExtendedLinkFunk
                          xlinkExtendedLinkSetFunk
                          xmlCanonicPath
                          +xmlPathToURI
                          xmlSAX2SetDocumentLocator
                          xmlTextReaderLocatorBaseURI
                          xmlTextReaderLocatorLineNumber
                          diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html index 8541fe1..5bb6121 100644 --- a/doc/APIchunk19.html +++ b/doc/APIchunk19.html @@ -79,6 +79,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          manipulation
                          LIBXML_TREE_ENABLED
                          many
                          _xmlParserInput
                          xmlXPathStringFunction
                          +
                          map
                          _xmlDOMWrapCtxt
                          maps
                          xmlTextReaderLookupNamespace
                          xmlTextWriterWriteDocType
                          xmlTextWriterWriteProcessingInstruction
                          @@ -306,7 +307,6 @@ A:link, A:visited, A:active { text-decoration: underline }
                          most
                          xmlC14NExecute
                          xmlGetFeaturesList
                          move
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          moved
                          xmlTextReaderMoveToElement
                          much
                          xmlReconciliateNs
                          multi-threaded
                          xmlSetGenericErrorFunc
                          diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index 93faeaf..e771872 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -74,6 +74,7 @@ A:link, A:visited, A:active { text-decoration: underline } ignorableWhitespaceSAXFunc
                          resolveEntity
                          resolveEntitySAXFunc
                          +xmlDOMWrapAcquireNsFunction
                          xmlDOMWrapReconcileNamespaces
                          xmlDOMWrapRemoveNode
                          xmlDocDumpFormatMemoryEnc
                          diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index ffcf125..2a9174d 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -65,6 +65,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlC14NExecute
                          xmlCopyDoc
                          xmlCopyNode
                          +xmlDOMWrapAcquireNsFunction
                          xmlDocCopyNode
                          xmlFreeNsList
                          xmlGetProp
                          @@ -92,6 +93,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SUBSTITUTE_NONE
                          XML_SUBSTITUTE_PEREF
                          XML_SUBSTITUTE_REF
                          +_xmlDOMWrapCtxt
                          xmlCreatePushParserCtxt
                          xmlGetNsList
                          xmlInitCharEncodingHandlers
                          @@ -126,7 +128,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderCurrentDoc
                          xmlValidCtxtNormalizeAttributeValue
                          xmlValidNormalizeAttributeValue
                          -xmlXPathCastToString
                          xmlXPathPopBoolean
                          xmlXPathPopExternal
                          xmlXPathPopNodeSet
                          @@ -179,7 +180,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          nillable
                          XML_SCHEMAS_ELEM_NILLABLE
                          xmlExpIsNillable
                          nod
                          xmlEntityReferenceFunc
                          -
                          node-
                          xmlDOMWrapRemoveNode
                          +
                          node-
                          _xmlDOMWrapCtxt
                          +xmlDOMWrapRemoveNode
                          xmlValidGetValidElements
                          node-set?
                          xmlXPathLocalNameFunction
                          xmlXPathNamespaceURIFunction
                          @@ -221,7 +223,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathBooleanFunction
                          none
                          XML_SCHEMAS_TYPE_VARIETY_ABSENT
                          getNamespace
                          -xmlDOMWrapCloneNode
                          xmlDecodeEntities
                          xmlGetLastChild
                          xmlOutputBufferCreateFilename
                          @@ -260,7 +261,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidNormalizeAttributeValue
                          xmlXPathNormalizeFunction
                          normalizing
                          xmlCurrentChar
                          -
                          normally
                          c
                          +
                          normally
                          _xmlNs
                          +c
                          xmlValidityErrorFunc
                          xmlValidityWarningFunc
                          notations
                          _xmlDtd
                          @@ -279,7 +281,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlDOMWrapReconcileNamespaces
                          ns-references
                          xmlDOMWrapReconcileNamespaces
                          xmlDOMWrapRemoveNode
                          -
                          nsDef
                          xmlDOMWrapAdoptNode
                          +
                          nsDef
                          _xmlDOMWrapCtxt
                          +xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          xmlDOMWrapRemoveNode
                          null
                          xmlHashScan3
                          diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html index f503ffe..f7cf410 100644 --- a/doc/APIchunk21.html +++ b/doc/APIchunk21.html @@ -55,6 +55,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          obsolete
                          xmlNormalizeWindowsPath
                          obsolete:
                          XML_SCHEMAS_ELEM_TOPLEVEL
                          occupied
                          xmlCanonicPath
                          +xmlPathToURI
                          occur
                          XML_SCHEMAS_TYPE_VARIETY_ABSENT
                          xmlParseComment
                          xmlParseMarkupDecl
                          @@ -212,7 +213,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathNotEqualValues
                          xmlXPathSubValues
                          xmlXPathValueFlipSign
                          -
                          operations
                          xmlModuleClose
                          +
                          operations
                          _xmlDOMWrapCtxt
                          +xmlModuleClose
                          xmlModuleFree
                          xmlReconciliateNs
                          operator
                          xmlExpParse
                          diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index f4c8321..bd256cb 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -101,6 +101,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseAttValue
                          xmlSetGenericErrorFunc
                          xmlSetStructuredErrorFunc
                          +xmlXIncludeProcessFlagsData
                          xmlXPathEvalFunc
                          xmlXPathIntersection
                          passive
                          xmlNanoFTPGetConnection
                          @@ -122,6 +123,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNormalizeURIPath
                          xmlNormalizeWindowsPath
                          xmlParserGetDirectory
                          +xmlPathToURI
                          xmlShellPwd
                          xmlShellValidate
                          xmlTextReaderRelaxNGValidate
                          diff --git a/doc/APIchunk23.html b/doc/APIchunk23.html index 4a78224..effe8f5 100644 --- a/doc/APIchunk23.html +++ b/doc/APIchunk23.html @@ -353,6 +353,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlBufferShrink
                          xmlCatalogRemove
                          xmlDecodeEntities
                          +xmlDocSetRootElement
                          xmlEncodeEntities
                          xmlHashRemoveEntry
                          xmlHashRemoveEntry2
                          @@ -441,7 +442,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPOpen
                          xmlNanoHTTPOpenRedir
                          xmlNanoHTTPReturnCode
                          -
                          requested
                          xmlExternalEntityLoader
                          +
                          requested
                          xmlDOMWrapAcquireNsFunction
                          +xmlExternalEntityLoader
                          xmlHasFeature
                          xmlIsID
                          xmlMallocFunc
                          @@ -517,6 +519,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPContentLength
                          responsible
                          xmlC14NDocDumpMemory
                          xmlCanonicPath
                          +xmlPathToURI
                          restored
                          xmlTextReaderSetErrorHandler
                          xmlTextReaderSetStructuredErrorHandler
                          restrict
                          xmlParseExternalID
                          diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html index 6ac493b..b737b67 100644 --- a/doc/APIchunk24.html +++ b/doc/APIchunk24.html @@ -67,6 +67,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlGcMemGet
                          xmlMemGet
                          xmlNanoHTTPFetch
                          +xmlSaveTree
                          xmlShell
                          xmlShellSave
                          saved
                          _htmlElemDesc
                          @@ -415,6 +416,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlValidatePushCData
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          @@ -492,7 +494,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewDocNode
                          xmlNewDocNodeEatName
                          xmlTextWriterWriteRawLen
                          -
                          specialized
                          xmlGcMemGet
                          +
                          specialized
                          _xmlDOMWrapCtxt
                          +xmlGcMemGet
                          xmlGcMemSetup
                          specific
                          XML_CATALOG_PI
                          _xmlValidCtxt
                          @@ -755,6 +758,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStringLenDecodeEntities
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html index befc7fa..848a69a 100644 --- a/doc/APIchunk25.html +++ b/doc/APIchunk25.html @@ -60,6 +60,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlIsAutoClosed
                          htmlSetMetaEncoding
                          take
                          xmlLockLibrary
                          +
                          taken
                          xmlDocSetRootElement
                          takes
                          xmlSchemaValidateFacetWhtsp
                          tatkes
                          xmlExpExpDerive
                          tell
                          XML_COMPLETE_ATTRS
                          @@ -96,11 +97,13 @@ A:link, A:visited, A:active { text-decoration: underline }
                          termination
                          xmlStrcat
                          xmlStrdup
                          terms
                          xmlBuildRelativeURI
                          -
                          test
                          xmlDOMWrapCloneNode
                          -xmlParserHandleReference
                          +
                          test
                          xmlParserHandleReference
                          xmlXPathEqualValues
                          xmlXPathNotEqualValues
                          tested
                          _xmlParserInput
                          +xmlDOMWrapAdoptNode
                          +xmlDOMWrapReconcileNamespaces
                          +xmlDOMWrapRemoveNode
                          testing
                          xmlRegexpCompile
                          text-
                          xmlStreamPushNode
                          xmlStreamWantsAnyNode
                          @@ -259,6 +262,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlPopInputCallbacks
                          xmlPushInput
                          xmlReconciliateNs
                          +xmlSaveTree
                          xmlSetTreeDoc
                          total
                          _xmlOutputBuffer
                          xmlGetFeaturesList
                          diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html index be247f2..828659a 100644 --- a/doc/APIchunk26.html +++ b/doc/APIchunk26.html @@ -101,7 +101,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlHasProp
                          xmlXPathNextNamespace
                          unliked
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          unlink
                          xmlFreeNode
                          unlinked
                          xmlAddNextSibling
                          xmlAddPrevSibling
                          @@ -263,6 +262,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_VARIETY_ATOMIC
                          XML_SCHEMAS_TYPE_VARIETY_LIST
                          XML_SCHEMAS_TYPE_VARIETY_UNION
                          +
                          various
                          _xmlDOMWrapCtxt
                          very
                          _htmlElemDesc
                          _xmlParserInput
                          xmlCharEncFirstLine
                          diff --git a/doc/APIchunk27.html b/doc/APIchunk27.html index 2473a34..b0e889a 100644 --- a/doc/APIchunk27.html +++ b/doc/APIchunk27.html @@ -47,7 +47,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCharEncInFunc
                          xmlCharEncOutFunc
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          warn
                          xmlCheckVersion
                          warning
                          XML_CAST_FPTR
                          _xmlValidCtxt
                          @@ -118,6 +117,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlMemShow
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          @@ -258,7 +258,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          would
                          _xmlError
                          htmlAutoCloseTag
                          xmlTextReaderGetRemainder
                          -
                          wrapper
                          xmlDOMWrapReconcileNamespaces
                          +
                          wrapper
                          xmlDOMWrapAcquireNsFunction
                          +xmlDOMWrapReconcileNamespaces
                          xmlDOMWrapRemoveNode
                          wraps
                          xmlTextReaderByteConsumed
                          write
                          xmlFileRead
                          diff --git a/doc/APIchunk28.html b/doc/APIchunk28.html index b5471fb..05bde7b 100644 --- a/doc/APIchunk28.html +++ b/doc/APIchunk28.html @@ -138,6 +138,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          xmlDefaultSAXLocator
                          setDocumentLocator
                          setDocumentLocatorSAXFunc
                          xmlSAX2SetDocumentLocator
                          +
                          xmlDoc
                          _xmlNs
                          xmlDocCopyNodeList
                          xmlCopyNodeList
                          xmlDocNewPI
                          xmlNewPI
                          xmlDocPtr
                          xmlCopyDoc
                          @@ -196,6 +197,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNodeListGetRawString
                          xmlNodeListGetString
                          xmlTextReaderValue
                          +xmlXPathCastToString
                          xmlFreeDoc
                          xmlTextReaderCurrentDoc
                          xmlFreeDocElementContent
                          xmlFreeElementContent
                          xmlFreeMutex
                          xmlFreeMutex
                          @@ -293,9 +295,12 @@ A:link, A:visited, A:active { text-decoration: underline }
                          xmlNodeType
                          xmlTextReaderNodeType
                          xmlNotationPtr
                          xmlGetDtdNotationDesc
                          xmlNotationTablePtr
                          xmlCopyNotationTable
                          -
                          xmlNsPtr
                          getNamespace
                          +
                          xmlNs
                          xmlDOMWrapAcquireNsFunction
                          +
                          xmlNsPtr
                          _xmlDOMWrapCtxt
                          +getNamespace
                          xmlCopyNamespace
                          xmlCopyNamespaceList
                          +xmlDOMWrapAcquireNsFunction
                          xmlGetNsList
                          xmlOutputBufferClose
                          xmlSaveFileTo
                          xmlSaveFormatFileTo
                          @@ -432,7 +437,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          xmlURIFromPath
                          xmlNormalizeWindowsPath
                          xmlURIPtr
                          xmlParseURI
                          xmlParseURIRaw
                          -
                          xmlUnlinkNode
                          xmlFreeNode
                          +
                          xmlUnlinkNode
                          xmlDocSetRootElement
                          +xmlFreeNode
                          xmlUnlockLibrary
                          xmlUnlockLibrary
                          xmlValidCtxtPtr
                          xmlValidityErrorFunc
                          xmlValidityWarningFunc
                          diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html index b1d3cae..cffe694 100644 --- a/doc/APIchunk3.html +++ b/doc/APIchunk3.html @@ -305,7 +305,8 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Instruction
                          xmlParsePI
                          Instuction
                          XML_CATALOG_PI
                          Intended
                          xmlSnprintfElementContent
                          -
                          Internal
                          xmlParseMarkupDecl
                          +
                          Internal
                          _xmlDOMWrapCtxt
                          +xmlParseMarkupDecl

                          A-B C-C D-E diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 561a743..b3c8364 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -200,6 +200,9 @@ A:link, A:visited, A:active { text-decoration: underline }

                          NOTE:
                          _xmlParserInput
                          htmlSetMetaEncoding
                          xmlCheckLanguageID
                          +xmlDOMWrapAdoptNode
                          +xmlDOMWrapReconcileNamespaces
                          +xmlDOMWrapRemoveNode
                          xmlGetProp
                          xmlInitCharEncodingHandlers
                          xmlNewChild
                          @@ -289,35 +292,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseNotationDecl
                          NotationType
                          xmlParseEnumeratedType
                          xmlParseNotationType
                          -
                          Note
                          ftpListCallback
                          -htmlElementAllowedHere
                          -xmlAddAttributeDecl
                          -xmlAutomataNewNegTrans
                          -xmlCheckUTF8
                          -xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          -xmlDOMWrapReconcileNamespaces
                          -xmlDocDumpFormatMemory
                          -xmlDocDumpFormatMemoryEnc
                          -xmlDocDumpMemoryEnc
                          -xmlDocFormatDump
                          -xmlExpNewOr
                          -xmlExpNewRange
                          -xmlExpNewSeq
                          -xmlHasNsProp
                          -xmlNanoHTTPContentLength
                          -xmlNodeDump
                          -xmlNodeDumpOutput
                          -xmlParseCharEncoding
                          -xmlParseEntityRef
                          -xmlRemoveProp
                          -xmlSAXDefaultVersion
                          -xmlSaveFormatFile
                          -xmlSaveFormatFileEnc
                          -xmlSchemaValidateFacetWhtsp
                          -xmlStrncat
                          -xmlTextReaderSetParserProp
                          -xmlValidateDtd
                          Note:
                          fatalErrorSAXFunc
                          xmlBuildRelativeURI
                          xmlCharEncodingOutputFunc
                          diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html index 3ebc5a8..9a6b23f 100644 --- a/doc/APIchunk5.html +++ b/doc/APIchunk5.html @@ -67,7 +67,6 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Open
                          xmlIOHTTPOpenW
                          Opens
                          xmlModuleOpen
                          OpticalCharacterRecognition
                          xmlUCSIsOpticalCharacterRecognition
                          -
                          Optimize
                          xmlDOMWrapCloneNode
                          Optional
                          _htmlElemDesc
                          Oriya
                          xmlUCSIsOriya
                          Osmanya
                          xmlUCSIsOsmanya
                          diff --git a/doc/APIchunk7.html b/doc/APIchunk7.html index 50949e1..ed7c4a2 100644 --- a/doc/APIchunk7.html +++ b/doc/APIchunk7.html @@ -263,7 +263,6 @@ A:link, A:visited, A:active { text-decoration: underline }
                          SupplementalMathematicalOperators
                          xmlUCSIsSupplementalMathematicalOperators
                          SupplementaryPrivateUseArea-A
                          xmlUCSIsSupplementaryPrivateUseAreaA
                          SupplementaryPrivateUseArea-B
                          xmlUCSIsSupplementaryPrivateUseAreaB
                          -
                          Support
                          xmlDOMWrapCloneNode
                          Syriac
                          xmlUCSIsSyriac
                          System
                          _xmlNotation
                          xmlExternalEntityLoader
                          diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index 82de64b..a980c2f 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -228,6 +228,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                          Upgrade
                          xmlKeepBlanksDefault
                          Use
                          XML_COMPLETE_ATTRS
                          XML_DETECT_IDS
                          +_xmlDOMWrapCtxt
                          _xmlParserCtxt
                          xmlCopyNodeList
                          xmlGetProp
                          diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html index 556b273..882ab74 100644 --- a/doc/APIchunk9.html +++ b/doc/APIchunk9.html @@ -72,11 +72,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseVersionNum

                          Letter W:

                          W3C
                          xmlTextReaderSchemaValidate
                          xmlTextReaderSchemaValidateCtxt
                          -
                          WARNING:
                          xmlDOMWrapAdoptNode
                          -xmlDOMWrapCloneNode
                          -xmlDOMWrapReconcileNamespaces
                          -xmlDOMWrapRemoveNode
                          -xmlSchemaGetCanonValue
                          +
                          WARNING:
                          xmlSchemaGetCanonValue
                          xmlSchemaNewStringValue
                          WFC:
                          xmlParseAttribute
                          xmlParseCharRef
                          @@ -113,6 +109,7 @@ A:link, A:visited, A:active { text-decoration: underline } notationDeclSAXFunc
                          unparsedEntityDecl
                          unparsedEntityDeclSAXFunc
                          +xmlDOMWrapCloneNode
                          xmlSAX2NotationDecl
                          xmlSAX2UnparsedEntityDecl
                          When
                          xmlHandleEntity
                          @@ -142,10 +139,12 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXIncludeNewContext
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          xmlXIncludeSetFlags
                          +
                          XInclude?
                          xmlDOMWrapCloneNode
                          XLINK_TYPE_NONE
                          xlinkIsLink
                          XML-1
                          xmlDetectCharEncoding
                          xmlValidateAttributeDecl
                          @@ -244,6 +243,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAXUserParseFile
                          xmlSetCompressMode
                          xmlSetDocCompressMode
                          +
                          Zlib
                          LIBXML_ZLIB_ENABLED

                          A-B C-C D-E diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html index 9e91cfa..c4d348c 100644 --- a/doc/APIconstructors.html +++ b/doc/APIconstructors.html @@ -79,6 +79,7 @@ A:link, A:visited, A:active { text-decoration: underline }

                          Type htmlParserCtxtPtr:

                          htmlCreateFileParserCtxt
                          htmlCreateMemoryParserCtxt
                          htmlCreatePushParserCtxt
                          +htmlNewParserCtxt

                          Type htmlStatus:

                          htmlAttrAllowed
                          htmlElementStatusHere
                          htmlNodeStatus
                          @@ -207,6 +208,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseSystemLiteral
                          xmlParseVersionInfo
                          xmlParseVersionNum
                          +xmlPathToURI
                          xmlSaveUri
                          xmlScanName
                          xmlSchemaCollapseString
                          @@ -422,6 +424,7 @@ A:link, A:visited, A:active { text-decoration: underline }

                          Type xmlNsPtr:

                          getNamespace
                          xmlCopyNamespace
                          xmlCopyNamespaceList
                          +xmlDOMWrapAcquireNsFunction
                          xmlNewGlobalNs
                          xmlNewNs
                          xmlSearchNs
                          diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 2a5af4b..e10fe00 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -66,6 +66,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlHandleOmittedElem
                          htmlIsAutoClosed
                          htmlIsScriptAttribute
                          +htmlNewParserCtxt
                          htmlNodePtr
                          htmlNodeStatus
                          htmlParseCharRef
                          @@ -651,6 +652,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_WITH_XINCLUDE
                          XML_WITH_XPATH
                          XML_WITH_XPTR
                          +XML_WITH_ZLIB
                          _xmlParserCtxt
                          _xmlParserInput
                          _xmlParserNodeInfo
                          @@ -1374,6 +1376,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCopyProp
                          xmlCopyPropList
                          xmlCreateIntSubset
                          +xmlDOMWrapAcquireNsFunction
                          xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          xmlDOMWrapCtxt
                          @@ -1543,6 +1546,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseURI
                          xmlParseURIRaw
                          xmlParseURIReference
                          +xmlPathToURI
                          xmlPrintURI
                          xmlSaveUri
                          xmlURI
                          @@ -1655,6 +1659,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXIncludeNewContext
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          @@ -3120,6 +3125,7 @@ A:link, A:visited, A:active { text-decoration: underline } LIBXML_XINCLUDE_ENABLED
                          LIBXML_XPATH_ENABLED
                          LIBXML_XPTR_ENABLED
                          +LIBXML_ZLIB_ENABLED
                          WITHOUT_TRIO
                          WITH_TRIO
                          xmlCheckVersion
                          @@ -3273,6 +3279,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathCompExprPtr
                          xmlXPathCompile
                          xmlXPathCompiledEval
                          +xmlXPathCompiledEvalToBoolean
                          xmlXPathContext
                          xmlXPathContextPtr
                          xmlXPathContextSetCache
                          diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 92489fb..fea4fd3 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -213,6 +213,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCreateEnumeration
                          xmlCreateIntSubset
                          xmlCtxtReadDoc
                          +xmlDOMWrapAcquireNsFunction
                          xmlDebugDumpString
                          xmlDictExists
                          xmlDictLookup
                          @@ -304,6 +305,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseElementContentDecl
                          xmlParseExternalEntity
                          xmlParseExternalSubset
                          +xmlPathToURI
                          xmlPatterncompile
                          xmlReadDoc
                          xmlReaderForDoc
                          @@ -861,6 +863,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlThrDefSetStructuredErrorFunc
                          xmlValidityErrorFunc
                          xmlValidityWarningFunc
                          +xmlXIncludeProcessFlagsData
                          xmlXPathFuncLookupFunc
                          xmlXPathRegisterFuncLookup
                          xmlXPathRegisterVariableLookup
                          @@ -1063,7 +1066,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlOutputBufferWriteEscape
                          xmlSaveSetAttrEscape
                          xmlSaveSetEscape
                          -

                          Type xmlDOMWrapCtxtPtr:

                          xmlDOMWrapAdoptNode
                          +

                          Type xmlDOMWrapCtxtPtr:

                          xmlDOMWrapAcquireNsFunction
                          +xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          xmlDOMWrapFreeCtxt
                          xmlDOMWrapReconcileNamespaces
                          @@ -1214,6 +1218,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXIncludeNewContext
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXPathNewContext
                          xmlXPathOrderDocElems
                          xmlXPtrNewContext
                          @@ -1427,6 +1432,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlC14NIsVisibleCallback
                          xmlCopyProp
                          xmlCopyPropList
                          +xmlDOMWrapAcquireNsFunction
                          xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          xmlDOMWrapReconcileNamespaces
                          @@ -2161,9 +2167,11 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXIncludeProcessNode
                          xmlXIncludeSetFlags

                          Type xmlXPathCompExprPtr:

                          xmlXPathCompiledEval
                          +xmlXPathCompiledEvalToBoolean
                          xmlXPathDebugDumpCompExpr
                          xmlXPathFreeCompExpr

                          Type xmlXPathContextPtr:

                          xmlXPathCompiledEval
                          +xmlXPathCompiledEvalToBoolean
                          xmlXPathContextSetCache
                          xmlXPathCtxtCompile
                          xmlXPathEval
                          diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 7e1ba3c..c6c5265 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -94,6 +94,7 @@ A:link, A:visited, A:active { text-decoration: underline } LIBXML_XINCLUDE_ENABLED
                          LIBXML_XPATH_ENABLED
                          LIBXML_XPTR_ENABLED
                          +LIBXML_ZLIB_ENABLED

                          Letter M:

                          MOVETO_ENDTAG
                          MOVETO_STARTTAG

                          Letter S:

                          SKIP_EOL
                          @@ -1320,6 +1321,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_WITH_XINCLUDE
                          XML_WITH_XPATH
                          XML_WITH_XPTR
                          +XML_WITH_ZLIB
                          XML_XINCLUDE_BUILD_FAILED
                          XML_XINCLUDE_DEPRECATED_NS
                          XML_XINCLUDE_END
                          @@ -1566,6 +1568,7 @@ A:link, A:visited, A:active { text-decoration: underline } htmlIsScriptAttribute
                          htmlNewDoc
                          htmlNewDocNoDtD
                          +htmlNewParserCtxt
                          htmlNodeDump
                          htmlNodeDumpFile
                          htmlNodeDumpFileFormat
                          @@ -1846,6 +1849,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCtxtResetPush
                          xmlCtxtUseOptions
                          xmlCurrentChar
                          +xmlDOMWrapAcquireNsFunction
                          xmlDOMWrapAdoptNode
                          xmlDOMWrapCloneNode
                          xmlDOMWrapCtxt
                          @@ -2472,6 +2476,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserValidityWarning
                          xmlParserVersion
                          xmlParserWarning
                          +xmlPathToURI
                          xmlPattern
                          xmlPatternFlags
                          xmlPatternFromRoot
                          @@ -3258,6 +3263,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXIncludeNewContext
                          xmlXIncludeProcess
                          xmlXIncludeProcessFlags
                          +xmlXIncludeProcessFlagsData
                          xmlXIncludeProcessNode
                          xmlXIncludeProcessTree
                          xmlXIncludeProcessTreeFlags
                          @@ -3289,6 +3295,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlXPathCompareValues
                          xmlXPathCompile
                          xmlXPathCompiledEval
                          +xmlXPathCompiledEvalToBoolean
                          xmlXPathConcatFunction
                          xmlXPathContainsFunction
                          xmlXPathContext
                          diff --git a/doc/DOM.html b/doc/DOM.html index a637399..52f1139 100644 --- a/doc/DOM.html +++ b/doc/DOM.html @@ -7,11 +7,11 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -DOM Principles
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          DOM Principles

                          Developer Menu
                          API Indexes
                          Related links

                          DOMstands for the -DocumentObjectModel; this is an API for accessing XML or HTML -structureddocuments.Native support for DOM in Gnome is on the way (module -gnome-dom),and will bebased on gnome-xml. This will be a far cleaner -interface tomanipulate XMLfiles within Gnome since it won't expose the -internalstructure.

                          The current DOM implementation on top of libxml2 is the gdome2 Gnome module,thisis -a full DOM interface, thanks to Paolo Casarini, check the Gdome2 -homepageformoreinformations.

                          Daniel Veillard

                          +DOM Principles
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          DOM Principles

                          Developer Menu
                          API Indexes
                          Related links

                          DOM stands for the Document +Object Model; this is an API for accessing XML or HTML structured +documents. Native support for DOM in Gnome is on the way (module gnome-dom), +and will be based on gnome-xml. This will be a far cleaner interface to +manipulate XML files within Gnome since it won't expose the internal +structure.

                          The current DOM implementation on top of libxml2 is the gdome2 Gnome module, this +is a full DOM interface, thanks to Paolo Casarini, check the Gdome2 homepage for more +informations.

                          Daniel Veillard

                          diff --git a/doc/FAQ.html b/doc/FAQ.html index cdc6585..0d5ded6 100644 --- a/doc/FAQ.html +++ b/doc/FAQ.html @@ -12,49 +12,53 @@ A:link, A:visited, A:active { text-decoration: underline }

                        3. Compilation
                        4. Developer corner
                        5. License(s)

                          1. Licensing Terms for libxml -

                            libxml2 is released under the MITLicense;see - the file Copyright in the distribution for the precisewording

                            +

                            libxml2 is released under the MIT + License; see the file Copyright in the distribution for the precise + wording

                          2. Can I embed libxml2 in a proprietary application ? -

                            Yes. The MIT License allows you to keep proprietary the changesyoumade - to libxml, but it would be graceful to send-back bug fixesandimprovements - as patches for possible incorporation in themaindevelopment tree.

                            +

                            Yes. The MIT License allows you to keep proprietary the changes you + made to libxml, but it would be graceful to send-back bug fixes and + improvements as patches for possible incorporation in the main + development tree.

                          3. -

                          Installation

                          1. Do - NotUselibxml1, use libxml2
                          2. -
                          3. Where can I get libxml? -

                            The original distribution comes from xmlsoft.orgor gnome.org

                            -

                            Most Linux and BSD distributions include libxml, this is - probablythesafer way for end-users to use libxml.

                            +

                          Installation

                          1. Do Not Use + libxml1, use libxml2
                          2. +
                          3. Where can I get libxml ? +

                            The original distribution comes from xmlsoft.org or gnome.org

                            +

                            Most Linux and BSD distributions include libxml, this is probably the + safer way for end-users to use libxml.

                            David Doolin provides precompiled Windows versions at http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/

                          4. I see libxml and libxml2 releases, which one should I install ? -
                            • If you are not constrained by backward compatibility - issueswithexisting applications, install libxml2 only
                            • -
                            • If you are not doing development, you can safely - installboth.Usually the packages libxmland libxml2arecompatible(this - is not the case for development packages).
                            • -
                            • If you are a developer and your system provides - separatepackagingfor shared libraries and the development components, - it ispossibleto install libxml and libxml2, and also libxml-develandlibxml2-develtoofor - libxml2 >= 2.3.0
                            • -
                            • If you are developing a new application, please - developagainstlibxml2(-devel)
                            • +
                              • If you are not constrained by backward compatibility issues with + existing applications, install libxml2 only
                              • +
                              • If you are not doing development, you can safely install both. + Usually the packages libxml and libxml2 are + compatible (this is not the case for development packages).
                              • +
                              • If you are a developer and your system provides separate packaging + for shared libraries and the development components, it is possible + to install libxml and libxml2, and also libxml-devel + and libxml2-devel + too for libxml2 >= 2.3.0
                              • +
                              • If you are developing a new application, please develop against + libxml2(-devel)
                            • I can't install the libxml package, it conflicts with libxml0 -

                              You probably have an old libxml0 package used to provide - thesharedlibrary for libxml.so.0, you can probably safely remove it. - Thelibxmlpackages provided on xmlsoft.orgprovidelibxml.so.0

                              +

                              You probably have an old libxml0 package used to provide the shared + library for libxml.so.0, you can probably safely remove it. The libxml + packages provided on xmlsoft.org provide + libxml.so.0

                            • -
                            • I can't install the libxml(2) RPM package due - tofaileddependencies -

                              The most generic solution is to re-fetch the latest src.rpm - ,andrebuild it locally with

                              +
                            • I can't install the libxml(2) RPM package due to failed + dependencies +

                              The most generic solution is to re-fetch the latest src.rpm , and + rebuild it locally with

                              rpm --rebuild libxml(2)-xxx.src.rpm.

                              -

                              If everything goes well it will generate two binary rpm - packages(oneproviding the shared libs and xmllint, and the other one, - the-develpackage, providing includes, static libraries and scripts needed - tobuildapplications with libxml(2)) that you can install locally.

                              +

                              If everything goes well it will generate two binary rpm packages (one + providing the shared libs and xmllint, and the other one, the -devel + package, providing includes, static libraries and scripts needed to build + applications with libxml(2)) that you can install locally.

                          Compilation

                          1. What is the process to compile libxml2 ?

                            As most UNIX libraries libxml2 follows the "standard":

                            @@ -65,106 +69,109 @@ A:link, A:visited, A:active { text-decoration: underline }

                            ./configure [possible options]

                            make

                            make install

                            -

                            At that point you may have to rerun ldconfig or a similar - utilitytoupdate your list of installed shared libs.

                            +

                            At that point you may have to rerun ldconfig or a similar utility to + update your list of installed shared libs.

                          2. What other libraries are needed to compile/install libxml2 ? -

                            Libxml2 does not require any other library, the normal C ANSIAPIshould - be sufficient (please report any violation to this rule youmayfind).

                            -

                            However if found at configuration time libxml2 will detect and - usethefollowing libs:

                            -
                            • libz:ahighly - portable and available widely compression library.
                            • -
                            • iconv: a powerful character encoding conversion library. - Itisincluded by default in recent glibc libraries, so it doesn't - needtobe installed specifically on Linux. It now seems a partofthe - official UNIXspecification. Here is one implementation - ofthelibrarywhich source can be found here.
                            • +

                              Libxml2 does not require any other library, the normal C ANSI API + should be sufficient (please report any violation to this rule you may + find).

                              +

                              However if found at configuration time libxml2 will detect and use the + following libs:

                              +
                              • libz : a + highly portable and available widely compression library.
                              • +
                              • iconv: a powerful character encoding conversion library. It is + included by default in recent glibc libraries, so it doesn't need to + be installed specifically on Linux. It now seems a part + of the official UNIX specification. Here is one implementation of the + library which source can be found here.
                            • Make check fails on some platforms -

                              Sometimes the regression tests' results don't completely matchthevalue - produced by the parser, and the makefile uses diff to printthedelta. On - some platforms the diff return breaks the compilationprocess;if the diff - is small this is probably not a serious problem.

                              -

                              Sometimes (especially on Solaris) make checks fail due tolimitationsin - make. Try using GNU-make instead.

                              +

                              Sometimes the regression tests' results don't completely match the + value produced by the parser, and the makefile uses diff to print the + delta. On some platforms the diff return breaks the compilation process; + if the diff is small this is probably not a serious problem.

                              +

                              Sometimes (especially on Solaris) make checks fail due to limitations + in make. Try using GNU-make instead.

                            • I use the CVS version and there is no configure script -

                              The configure script (and other Makefiles) are generated. - Usetheautogen.sh script to regenerate the configure script - andMakefiles,like:

                              +

                              The configure script (and other Makefiles) are generated. Use the + autogen.sh script to regenerate the configure script and Makefiles, + like:

                              ./autogen.sh --prefix=/usr --disable-shared

                            • I have troubles when running make tests with gcc-3.0 -

                              It seems the initial release of gcc-3.0 has a problem withtheoptimizer - which miscompiles the URI module. Please useanothercompiler.

                              +

                              It seems the initial release of gcc-3.0 has a problem with the + optimizer which miscompiles the URI module. Please use another + compiler.

                            • -

                          Developercorner

                          1. Troubles compiling or linking programs using libxml2 -

                            Usually the problem comes from the fact that the compiler - doesn'tgetthe right compilation or linking flags. There is a small - shellscriptxml2-configwhich is installed as part of - libxml2usualinstall process which provides those flags. Use

                            +

                          Developer corner

                          1. Troubles compiling or linking programs using libxml2 +

                            Usually the problem comes from the fact that the compiler doesn't get + the right compilation or linking flags. There is a small shell script + xml2-config which is installed as part of libxml2 usual + install process which provides those flags. Use

                            xml2-config --cflags

                            to get the compilation flags and

                            xml2-config --libs

                            -

                            to get the linker flags. Usually this is done directly fromtheMakefile - as:

                            +

                            to get the linker flags. Usually this is done directly from the + Makefile as:

                            CFLAGS=`xml2-config --cflags`

                            LIBS=`xml2-config --libs`

                          2. -
                          3. I want to install my own copy of libxml2 in my home - directoryandlink my programs against it, but it doesn't work -

                            There are many different ways to accomplish this. Here is one waytodo - this under Linux. Suppose your home directory - is/home/user.Then:

                            +
                          4. I want to install my own copy of libxml2 in my home directory and + link my programs against it, but it doesn't work +

                            There are many different ways to accomplish this. Here is one way to + do this under Linux. Suppose your home directory is /home/user. + Then:

                            • Create a subdirectory, let's call it myxml
                            • unpack the libxml2 distribution into that subdirectory
                            • -
                            • chdir into the unpacked - distribution(/home/user/myxml/libxml2)
                            • -
                            • configure the library using the - "--prefix"switch,specifying an installation - subdirectoryin/home/user/myxml, e.g. -

                              ./configure - --prefix/home/user/myxml/xmlinst{otherconfiguration - options}

                              +
                            • chdir into the unpacked distribution + (/home/user/myxml/libxml2 )
                            • +
                            • configure the library using the "--prefix" switch, + specifying an installation subdirectory in + /home/user/myxml, e.g. +

                              ./configure --prefix /home/user/myxml/xmlinst {other + configuration options}

                            • -
                            • now run makefollowed by make install
                            • -
                            • At this point, the installation subdirectory contains - thecomplete"private" include files, library files and binary - programfiles (e.g.xmllint), located in -

                              /home/user/myxml/xmlinst/lib,/home/user/myxml/xmlinst/includeand - /home/user/myxml/xmlinst/bin

                              +
                            • now run make followed by make install
                            • +
                            • At this point, the installation subdirectory contains the complete + "private" include files, library files and binary program files (e.g. + xmllint), located in +

                              /home/user/myxml/xmlinst/lib, + /home/user/myxml/xmlinst/include and + /home/user/myxml/xmlinst/bin

                              respectively.
                            • -
                            • In order to use this "private" library, you should first add - ittothe beginning of your default PATH (so that your own - privateprogramfiles such as xmllint will be used instead of the - normalsystemones). To do this, the Bash command would be +
                            • In order to use this "private" library, you should first add it to + the beginning of your default PATH (so that your own private program + files such as xmllint will be used instead of the normal system + ones). To do this, the Bash command would be

                              export PATH=/home/user/myxml/xmlinst/bin:$PATH

                            • -
                            • Now suppose you have a program test1.cthat - youwouldlike to compile with your "private" library. Simply compile - itusingthe command +
                            • Now suppose you have a program test1.c that you would + like to compile with your "private" library. Simply compile it using + the command

                              gcc `xml2-config --cflags --libs` -o test test.c

                              - Note that, because your PATH has been set - with/home/user/myxml/xmlinst/binat the beginning, - thexml2-configprogram which you just installed will be used instead - ofthe systemdefault one, and this will automaticallyget - thecorrectlibraries linked with your program.
                            • + Note that, because your PATH has been set with + /home/user/myxml/xmlinst/bin at the beginning, the xml2-config + program which you just installed will be used instead of the system + default one, and this will automatically get the correct + libraries linked with your program.
                          5. xmlDocDump() generates output on one line. -

                            Libxml2 will not inventspaces in the content - ofadocument since all spaces in the content of a - documentaresignificant. If you build a tree from the API - andwantindentation:

                            +

                            Libxml2 will not invent spaces in the content of a + document since all spaces in the content of a document are + significant. If you build a tree from the API and want + indentation:

                            1. the correct way is to generate those yourself too.
                            2. -
                            3. the dangerous way is to ask libxml2 to add those blanks - toyourcontent modifying the content of your document - intheprocess. The result may not be what you expect. - ThereisNOway to guarantee that such a - modificationwon'taffect other parts of the content of your document. - See xmlKeepBlanksDefault()andxmlSaveFormatFile()
                            4. +
                            5. the dangerous way is to ask libxml2 to add those blanks to your + content modifying the content of your document in the + process. The result may not be what you expect. There is + NO way to guarantee that such a modification won't + affect other parts of the content of your document. See xmlKeepBlanksDefault + () and xmlSaveFormatFile + ()
                          6. Extra nodes in the document:

                            For a XML file as below:

                            @@ -173,10 +180,10 @@ A:link, A:visited, A:active { text-decoration: underline } <NODE CommFlag="0"/> <NODE CommFlag="1"/> </PLAN> -

                            after parsing it with - thefunctionpxmlDoc=xmlParseFile(...);

                            -

                            I want to the get the content of the first node (node - withtheCommFlag="0")

                            +

                            after parsing it with the function + pxmlDoc=xmlParseFile(...);

                            +

                            I want to the get the content of the first node (node with the + CommFlag="0")

                            so I did it as following;

                            xmlNodePtr pnode;
                             pnode=pxmlDoc->children->children;
                            @@ -184,62 +191,63 @@ pnode=pxmlDoc->children->children;
                            pnode=pxmlDoc->children->children->next;

                            then it works. Can someone explain it to me.

                            -

                            In XML all characters in the content of the document - aresignificantincluding blanks and formatting - linebreaks.

                            -

                            The extra nodes you are wondering about are just that, text - nodeswiththe formatting spaces which are part of the document but that - peopletendto forget. There is a function xmlKeepBlanksDefault()toremove - those at parse time, but that's an heuristic, and itsuse should belimited - to cases where you are certain there is nomixed-content in - thedocument.

                            +

                            In XML all characters in the content of the document are significant + including blanks and formatting line breaks.

                            +

                            The extra nodes you are wondering about are just that, text nodes with + the formatting spaces which are part of the document but that people tend + to forget. There is a function xmlKeepBlanksDefault + () to remove those at parse time, but that's an heuristic, and its + use should be limited to cases where you are certain there is no + mixed-content in the document.

                          7. -
                          8. I get compilation errors of existing code like - whenaccessingrootor child - fieldsofnodes. -

                            You are compiling code developed for libxml version 1 and - usingalibxml2 development environment. Either switch back to libxml v1 - develoreven better fix the code to compile with libxml2 (or both) by following the instructions.

                            +
                          9. I get compilation errors of existing code like when accessing + root or child fields of nodes. +

                            You are compiling code developed for libxml version 1 and using a + libxml2 development environment. Either switch back to libxml v1 devel or + even better fix the code to compile with libxml2 (or both) by following the instructions.

                          10. -
                          11. I get compilation errors about - nonexistingxmlRootNodeorxmlChildrenNodefields. -

                            The source code you are using has been upgradedto be able to compile with both - libxmlandlibxml2, but you need to install a more recent - version:libxml(-devel)>= 1.8.8 or libxml2(-devel) >= 2.1.0

                            +
                          12. I get compilation errors about non existing + xmlRootNode or xmlChildrenNode + fields. +

                            The source code you are using has been upgraded to be able to compile with both libxml + and libxml2, but you need to install a more recent version: + libxml(-devel) >= 1.8.8 or libxml2(-devel) >= 2.1.0

                          13. XPath implementation looks seriously broken -

                            XPath implementation prior to 2.3.0 was really incomplete. Upgrade - toarecent version, there are no known bugs in the current version.

                            +

                            XPath implementation prior to 2.3.0 was really incomplete. Upgrade to + a recent version, there are no known bugs in the current version.

                          14. The example provided in the web page does not compile. -

                            It's hard to maintain the documentation in sync with - thecode<grin/> ...

                            -

                            Check the previous points 1/ and 2/ raised before, and - pleasesendpatches.

                            +

                            It's hard to maintain the documentation in sync with the code + <grin/> ...

                            +

                            Check the previous points 1/ and 2/ raised before, and please send + patches.

                          15. -
                          16. Where can I get more examples and information than provided - ontheweb page? -

                            Ideally a libxml2 book would be nice. I have no such plan ... - Butyoucan:

                            -
                            • check more deeply the existinggenerated doc
                            • -
                            • have a look at the - setofexamples.
                            • -
                            • look for examples of use for libxml2 function using the - Gnomecode.For example the following will query the full Gnome CVS - base fortheuse of the xmlAddChild()function: +
                            • Where can I get more examples and information than provided on the + web page? +

                              Ideally a libxml2 book would be nice. I have no such plan ... But you + can:

                              +
                              • check more deeply the existing + generated doc
                              • +
                              • have a look at the set of + examples.
                              • +
                              • look for examples of use for libxml2 function using the Gnome code. + For example the following will query the full Gnome CVS base for the + use of the xmlAddChild() function:

                                http://cvs.gnome.org/lxr/search?string=xmlAddChild

                                -

                                This may be slow, a large hardware donation to the - gnomeprojectcould cure this :-)

                                +

                                This may be slow, a large hardware donation to the gnome project + could cure this :-)

                              • -
                              • Browsethelibxml2 - source, I try to write code as clean and documentedaspossible, so - looking at it may be helpful. In particular the codeofxmllint.c and - of the various testXXX.c test programs shouldprovidegood examples of - how to do things with the library.
                              • +
                              • Browse + the libxml2 source , I try to write code as clean and documented + as possible, so looking at it may be helpful. In particular the code + of xmllint.c and of the various testXXX.c test programs should + provide good examples of how to do things with the library.
                            • What about C++ ? -

                              libxml2 is written in pure C in order to allow easy reuse on anumberof - platforms, including embedded systems. I don't intend to converttoC++.

                              +

                              libxml2 is written in pure C in order to allow easy reuse on a number + of platforms, including embedded systems. I don't intend to convert to + C++.

                              There is however a C++ wrapper which may fulfill your needs:

                            • How to validate a document a posteriori ? -

                              It is possible to validate documents which had not been - validatedatinitial parsing time or documents which have been built - fromscratchusing the API. Use the xmlValidateDtd()function.It - is also possible to simply add a DTD to an existingdocument:

                              +

                              It is possible to validate documents which had not been validated at + initial parsing time or documents which have been built from scratch + using the API. Use the xmlValidateDtd() + function. It is also possible to simply add a DTD to an existing + document:

                              xmlDocPtr doc; /* your existing document */
                               xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
                               
                              @@ -268,10 +277,10 @@ xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
                                         
                            • So what is this funky "xmlChar" used all the time? -

                              It is a null terminated sequence of utf-8 characters. And - onlyutf-8!You need to convert strings encoded in different ways to - utf-8beforepassing them to the API. This can be accomplished with the - iconvlibraryfor instance.

                              +

                              It is a null terminated sequence of utf-8 characters. And only utf-8! + You need to convert strings encoded in different ways to utf-8 before + passing them to the API. This can be accomplished with the iconv library + for instance.

                            • etc ...

                          Daniel Veillard

                      diff --git a/doc/Makefile.in b/doc/Makefile.in index 70bd86e..56ec810 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -149,6 +149,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -177,6 +178,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -212,6 +214,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/doc/XMLinfo.html b/doc/XMLinfo.html index 5314fac..474f9c1 100644 --- a/doc/XMLinfo.html +++ b/doc/XMLinfo.html @@ -7,9 +7,9 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -XML
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      XML

                      Main Menu
                      Related links

                      XML is astandardformarkup-based -structured documents. Here is an example -XMLdocument:

                      <?xml version="1.0"?>
                      +XML
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      XML

                      Main Menu
                      Related links

                      XML is a standard for +markup-based structured documents. Here is an example XML +document:

                      <?xml version="1.0"?>
                       <EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
                         <head>
                          <title>Welcome to Gnome</title>
                      @@ -20,17 +20,16 @@ XMLdocument:

                      <?xml version="1.0"?>
                          <image href="linus.gif"/>
                          <p>...</p>
                         </chapter>
                      -</EXAMPLE>

                      The first line specifies that it is an XML document and -givesusefulinformation about its encoding. Then the rest of the document is -atextformat whose structure is specified by tags between -brackets.Eachtag opened has to be closed. XML is pedantic -about this.However, ifa tag is empty (no content), a single tag can serve as -both theopening andclosing tag if it ends with />rather -thanwith>. Note that, for example, the image tag has no -content(justan attribute) and is closed by ending the tag -with/>.

                      XML can be applied successfully to a wide range of tasks, ranging -fromlongterm structured document maintenance (where it follows the steps -ofSGML) tosimple data encoding mechanisms like configuration file -formatting(glade),spreadsheets (gnumeric), or even shorter lived documents -such asWebDAV whereit is used to encode remote calls between a client and -aserver.

                      Daniel Veillard

                      +</EXAMPLE>

                      The first line specifies that it is an XML document and gives useful +information about its encoding. Then the rest of the document is a text +format whose structure is specified by tags between brackets. Each +tag opened has to be closed. XML is pedantic about this. However, if +a tag is empty (no content), a single tag can serve as both the opening and +closing tag if it ends with /> rather than with +>. Note that, for example, the image tag has no content (just +an attribute) and is closed by ending the tag with />.

                      XML can be applied successfully to a wide range of tasks, ranging from +long term structured document maintenance (where it follows the steps of +SGML) to simple data encoding mechanisms like configuration file formatting +(glade), spreadsheets (gnumeric), or even shorter lived documents such as +WebDAV where it is used to encode remote calls between a client and a +server.

                      Daniel Veillard

                      diff --git a/doc/XSLT.html b/doc/XSLT.html index 4a8c09b..657ead3 100644 --- a/doc/XSLT.html +++ b/doc/XSLT.html @@ -7,8 +7,7 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -XSLT
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      XSLT

                      Main Menu
                      Related links

                      Check the separate libxslt page

                      XSL Transformations, is -alanguagefor transforming XML documents into other XML documents -(orHTML/textualoutput).

                      A separate library called libxslt is available implementing -XSLT-1.0forlibxml2. This module "libxslt" too can be found in the Gnome CVS -base.

                      You can check the progresses on the libxslt Changelog.

                      Daniel Veillard

                      +XSLT
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      XSLT

                      Main Menu
                      Related links

                      Check the separate libxslt page

                      XSL Transformations, is a +language for transforming XML documents into other XML documents (or +HTML/textual output).

                      A separate library called libxslt is available implementing XSLT-1.0 for +libxml2. This module "libxslt" too can be found in the Gnome CVS base.

                      You can check the progresses on the libxslt Changelog.

                      Daniel Veillard

                      diff --git a/doc/apibuild.py b/doc/apibuild.py index f1a795f..1e73725 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -49,6 +49,7 @@ ignored_files = { "runtest.c": "regression tests program", "runsuite.c": "regression tests program", "tst.c": "not part of the library", + "test.c": "not part of the library", "testdso.c": "test for dynamid shared libraries", } diff --git a/doc/architecture.html b/doc/architecture.html index 7809bc6..906c5b2 100644 --- a/doc/architecture.html +++ b/doc/architecture.html @@ -7,8 +7,8 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -libxml2 architecture
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      libxml2 architecture

                      Developer Menu
                      API Indexes
                      Related links

                      Libxml2 is made of multiple components; some of them are optional, -andmostof the block interfaces are public. The main components are:

                      • an Input/Output layer
                      • +libxml2 architecture
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        The XML C parser and toolkit of Gnome

                        libxml2 architecture

                        Developer Menu
                        API Indexes
                        Related links

                        Libxml2 is made of multiple components; some of them are optional, and +most of the block interfaces are public. The main components are:

                        • an Input/Output layer
                        • FTP and HTTP client layers (optional)
                        • an Internationalization layer managing the encodings support
                        • a URI module
                        • @@ -17,6 +17,7 @@ andmostof the block interfaces are public. The main components are:

                          • a
                          • a SAX tree module to build an in-memory DOM representation
                          • a tree module to manipulate the DOM representation
                          • a validation module using the DOM representation (optional)
                          • -
                          • an XPath module for global lookup in a DOM representation(optional)
                          • +
                          • an XPath module for global lookup in a DOM representation + (optional)
                          • a debug module (optional)

                          Graphically this gives the following:

                          a graphical view of the various

                          Daniel Veillard

                        diff --git a/doc/bugs.html b/doc/bugs.html index c755d00..6415c85 100644 --- a/doc/bugs.html +++ b/doc/bugs.html @@ -7,62 +7,62 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Reporting bugs and getting help
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        The XML C parser and toolkit of Gnome

                        Reporting bugs and getting help

                        Main Menu
                        Related links

                        Well, bugs or missing features are always possible, and I will make -apointof fixing them in a timely fashion. The best way to report a bug is -touse theGnomebugtracking -database(make sure to use the "libxml2" module name). Ilook atreports -there regularly and it's good to have a reminder when a bugis stillopen. Be -sure to specify that the bug is for the package libxml2.

                        For small problems you can try to get help on IRC, the #xml -channelonirc.gnome.org (port 6667) usually have a few person subscribed which -mayhelp(but there is no garantee and if a real issue is raised it should go -onthemailing-list for archival).

                        There is also a mailing-list xml@gnome.orgfor libxml, with an on-line archive(old). To subscribe to this -list,pleasevisit the associatedWebpage -andfollow the instructions. Do not send code, I won'tdebug -it(but patches are really appreciated!).

                        Please note that with the current amount of virus and SPAM, sending -mailtothe list without being subscribed won't work. There is *far too -manybounces*(in the order of a thousand a day !) I cannot approve them -manuallyanymore.If your mail to the list bounced waiting for administrator -approval,it isLOST ! Repost it and fix the problem triggering the error. Also -pleasenotethat emails -withalegal warning asking to not copy or redistribute freely the -informationstheycontainare NOTacceptable for the -mailing-list,suchmail will as much as possible be discarded automatically, -and are lesslikelyto be answered if they made it to the list, DO -NOTpost tothe list from an email address where such legal -requirements areautomaticallyadded, get private paying support if you can't -shareinformations.

                        Check the following beforeposting:

                        • Read the FAQand usethesearch engineto get information related to - your problem.
                        • -
                        • Make sure you are using - arecentversion, and that the problem still shows up in a - recentversion.
                        • -
                        • Check the listarchivesto see if - theproblem was reported already. In this casethere is probably a - fixavailable, similarly check the registeredopenbugs.
                        • -
                        • Make sure you can reproduce the bug with xmllint or one of - thetestprograms found in source in the distribution.
                        • -
                        • Please send the command showing the error as well as the input - (asanattachment)
                        • -

                        Then send the bug with associated information to reproduce it to the xml@gnome.orglist; if it's -reallylibxmlrelated I will approve it. Please do not send mail to me -directly, itmakesthings really hard to track and in some cases I am not the -best persontoanswer a given question, ask on the list.

                        To be really clear about support:

                        • Support or help requests MUST be senttothe - list or on bugzillain case of problems, so that theQuestionand - Answers can be shared publicly. Failing to do so carries - theimplicitmessage "I want free support but I don't want to share - thebenefits withothers" and is not welcome. I will automatically - Carbon-Copythexml@gnome.org mailing list for any technical reply made - about libxml2orlibxslt.
                        • -
                        • There is no garantee of - support,ifyour question remains unanswered after a week, repost - it, making sureyougave all the detail needed and the information - requested.
                        • -
                        • Failing to provide information as requested or double checking - firstforprior feedback also carries the implicit message "the time of - thelibrarymaintainers is less valuable than my time" and might not - bewelcome.
                        • -

                        Of course, bugs reported with a suggested patch for fixing -themwillprobably be processed faster than those without.

                        If you're looking for help, a quick look at the list -archivemayactuallyprovide the answer. I usually send source samples when -answeringlibxml2usage questions. The auto-generateddocumentationisnot -as polished as I would like (i need to learn moreabout DocBook), butit's a -good starting point.

                        Daniel Veillard

                        +Reporting bugs and getting help
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        The XML C parser and toolkit of Gnome

                        Reporting bugs and getting help

                        Main Menu
                        Related links

                        Well, bugs or missing features are always possible, and I will make a +point of fixing them in a timely fashion. The best way to report a bug is to +use the Gnome +bug tracking database (make sure to use the "libxml2" module name). I +look at reports there regularly and it's good to have a reminder when a bug +is still open. Be sure to specify that the bug is for the package libxml2.

                        For small problems you can try to get help on IRC, the #xml channel on +irc.gnome.org (port 6667) usually have a few person subscribed which may help +(but there is no garantee and if a real issue is raised it should go on the +mailing-list for archival).

                        There is also a mailing-list xml@gnome.org for libxml, with an on-line archive (old). To subscribe to this list, +please visit the associated Web page and +follow the instructions. Do not send code, I won't debug it +(but patches are really appreciated!).

                        Please note that with the current amount of virus and SPAM, sending mail +to the list without being subscribed won't work. There is *far too many +bounces* (in the order of a thousand a day !) I cannot approve them manually +anymore. If your mail to the list bounced waiting for administrator approval, +it is LOST ! Repost it and fix the problem triggering the error. Also please +note that emails with +a legal warning asking to not copy or redistribute freely the informations +they contain are NOT acceptable for the mailing-list, +such mail will as much as possible be discarded automatically, and are less +likely to be answered if they made it to the list, DO NOT +post to the list from an email address where such legal requirements are +automatically added, get private paying support if you can't share +informations.

                        Check the following before +posting:

                        • Read the FAQ and use the + search engine to get information related to your problem.
                        • +
                        • Make sure you are using a recent + version, and that the problem still shows up in a recent version.
                        • +
                        • Check the list + archives to see if the problem was reported already. In this case + there is probably a fix available, similarly check the registered + open bugs.
                        • +
                        • Make sure you can reproduce the bug with xmllint or one of the test + programs found in source in the distribution.
                        • +
                        • Please send the command showing the error as well as the input (as an + attachment)
                        • +

                        Then send the bug with associated information to reproduce it to the xml@gnome.org list; if it's really libxml +related I will approve it. Please do not send mail to me directly, it makes +things really hard to track and in some cases I am not the best person to +answer a given question, ask on the list.

                        To be really clear about support:

                        • Support or help requests MUST be sent to + the list or on bugzilla in case of problems, so that the Question + and Answers can be shared publicly. Failing to do so carries the implicit + message "I want free support but I don't want to share the benefits with + others" and is not welcome. I will automatically Carbon-Copy the + xml@gnome.org mailing list for any technical reply made about libxml2 or + libxslt.
                        • +
                        • There is no garantee of support, if + your question remains unanswered after a week, repost it, making sure you + gave all the detail needed and the information requested.
                        • +
                        • Failing to provide information as requested or double checking first + for prior feedback also carries the implicit message "the time of the + library maintainers is less valuable than my time" and might not be + welcome.
                        • +

                        Of course, bugs reported with a suggested patch for fixing them will +probably be processed faster than those without.

                        If you're looking for help, a quick look at the list archive may actually +provide the answer. I usually send source samples when answering libxml2 +usage questions. The auto-generated documentation is +not as polished as I would like (i need to learn more about DocBook), but +it's a good starting point.

                        Daniel Veillard

                        diff --git a/doc/catalog.html b/doc/catalog.html index 34f9902..4100fed 100644 --- a/doc/catalog.html +++ b/doc/catalog.html @@ -14,78 +14,77 @@ A:link, A:visited, A:active { text-decoration: underline }
                      • How to tune catalog usage
                      • How to debug catalog processing
                      • How to create and maintain catalogs
                      • -
                      • The implementor corner quick review - oftheAPI
                      • +
                      • The implementor corner quick review of the + API
                      • Other resources
                      • -

                        General overview

                        What is a catalog? Basically it's a lookup mechanism used when an -entity(afile or a remote resource) references another entity. The catalog -lookupisinserted between the moment the reference is recognized by the -software(XMLparser, stylesheet processing, or even images referenced for -inclusionin arendering) and the time where loading that resource is -actuallystarted.

                        It is basically used for 3 things:

                        • mapping from "logical" names, the public identifiers and a - moreconcretename usable for download (and URI). For example it can - associatethelogical name +

                          General overview

                          What is a catalog? Basically it's a lookup mechanism used when an entity +(a file or a remote resource) references another entity. The catalog lookup +is inserted between the moment the reference is recognized by the software +(XML parser, stylesheet processing, or even images referenced for inclusion +in a rendering) and the time where loading that resource is actually +started.

                          It is basically used for 3 things:

                          • mapping from "logical" names, the public identifiers and a more + concrete name usable for download (and URI). For example it can associate + the logical name

                            "-//OASIS//DTD DocBook XML V4.1.2//EN"

                            -

                            of the DocBook 4.1.2 XML DTD with the actual URL where it - canbedownloaded

                            +

                            of the DocBook 4.1.2 XML DTD with the actual URL where it can be + downloaded

                            http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd

                          • -
                          • remapping from a given URL to another one, like an - HTTPindirectionsaying that +
                          • remapping from a given URL to another one, like an HTTP indirection + saying that

                            "http://www.oasis-open.org/committes/tr.xsl"

                            should really be looked at

                            "http://www.oasis-open.org/committes/entity/stylesheets/base/tr.xsl"

                          • -
                          • providing a local cache mechanism allowing to load - theentitiesassociated to public identifiers or remote resources, this is - areallyimportant feature for any significant deployment of XML or - SGMLsince itallows to avoid the aleas and delays associated to - fetchingremoteresources.
                          • -

                          The definitions

                          Libxml, as of 2.4.3 implements 2 kind of catalogs:

                          • the older SGML catalogs, the official spec is SGML - OpenTechnicalResolution TR9401:1997, but is better understood by reading - the SP - CatalogpagefromJames Clark. This is relatively old and not the - preferredmode ofoperation of libxml.
                          • -
                          • XMLCatalogsisfar - more flexible, more recent, uses an XML syntax andshould scale - quitebetter. This is the default option of libxml.
                          • -

                          Using catalog

                          In a normal environment libxml2 will by default check the presence -ofacatalog in /etc/xml/catalog, and assuming it has been -correctlypopulated,the processing is completely transparent to the document -user. Totake aconcrete example, suppose you are authoring a DocBook document, -thisonestarts with the following DOCTYPE definition:

                          <?xml version='1.0'?>
                          +  
                        • providing a local cache mechanism allowing to load the entities + associated to public identifiers or remote resources, this is a really + important feature for any significant deployment of XML or SGML since it + allows to avoid the aleas and delays associated to fetching remote + resources.
                        • +

                        The definitions

                        Libxml, as of 2.4.3 implements 2 kind of catalogs:

                        • the older SGML catalogs, the official spec is SGML Open Technical + Resolution TR9401:1997, but is better understood by reading the SP Catalog page from + James Clark. This is relatively old and not the preferred mode of + operation of libxml.
                        • +
                        • XML + Catalogs is far more flexible, more recent, uses an XML syntax and + should scale quite better. This is the default option of libxml.
                        • +

                        Using catalog

                        In a normal environment libxml2 will by default check the presence of a +catalog in /etc/xml/catalog, and assuming it has been correctly populated, +the processing is completely transparent to the document user. To take a +concrete example, suppose you are authoring a DocBook document, this one +starts with the following DOCTYPE definition:

                        <?xml version='1.0'?>
                         <!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
                        -          "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd">

                        When validating the document with libxml, the catalog will -beautomaticallyconsulted to lookup the public identifier "-//Norman -Walsh//DTDDocBk XMLV3.1.4//EN" and the -systemidentifier"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd", and if -theseentities havebeen installed on your system and the catalogs actually -point tothem, libxmlwill fetch them from the local disk.

                        Note: Really don't usethisDOCTYPE -example it's a really old version, but is fine as an example.

                        Libxml2 will check the catalog each time that it is requested to -loadanentity, this includes DTD, external parsed entities, stylesheets, etc -...Ifyour system is correctly configured all the authoring phase -andprocessingshould use only local files, even if your document stays -portablebecause ituses the canonical public and system ID, referencing the -remotedocument.

                        Some examples:

                        Here is a couple of fragments from XML Catalogs used in -libxml2earlyregression tests in test/catalogs:

                        <?xml version="1.0"?>
                        +          "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd">

                        When validating the document with libxml, the catalog will be +automatically consulted to lookup the public identifier "-//Norman Walsh//DTD +DocBk XML V3.1.4//EN" and the system identifier +"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd", and if these entities have +been installed on your system and the catalogs actually point to them, libxml +will fetch them from the local disk.

                        Note: Really don't use this +DOCTYPE example it's a really old version, but is fine as an example.

                        Libxml2 will check the catalog each time that it is requested to load an +entity, this includes DTD, external parsed entities, stylesheets, etc ... If +your system is correctly configured all the authoring phase and processing +should use only local files, even if your document stays portable because it +uses the canonical public and system ID, referencing the remote document.

                        Some examples:

                        Here is a couple of fragments from XML Catalogs used in libxml2 early +regression tests in test/catalogs :

                        <?xml version="1.0"?>
                         <!DOCTYPE catalog PUBLIC 
                            "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
                            "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
                         <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
                           <public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
                            uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
                        -...

                        This is the beginning of a catalog for DocBook 4.1.2, XML -Catalogsarewritten in XML, there is a specific namespace for -catalogelements"urn:oasis:names:tc:entity:xmlns:xml:catalog". The first entry -inthiscatalog is a publicmapping it allows to associate -aPublicIdentifier with an URI.

                        ...
                        +...

                        This is the beginning of a catalog for DocBook 4.1.2, XML Catalogs are +written in XML, there is a specific namespace for catalog elements +"urn:oasis:names:tc:entity:xmlns:xml:catalog". The first entry in this +catalog is a public mapping it allows to associate a Public +Identifier with an URI.

                        ...
                             <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/"
                                            rewritePrefix="file:///usr/share/xml/docbook/"/>
                        -...

                        A rewriteSystemis a very powerful instruction, it saysthatany -URI starting with a given prefix should be looked at anotherURIconstructed by -replacing the prefix with an new one. In effect this actslikea cache system -for a full area of the Web. In practice it is extremelyusefulwith a file -prefix if you have installed a copy of those resources onyourlocal system.

                        ...
                        +...

                        A rewriteSystem is a very powerful instruction, it says that +any URI starting with a given prefix should be looked at another URI +constructed by replacing the prefix with an new one. In effect this acts like +a cache system for a full area of the Web. In practice it is extremely useful +with a file prefix if you have installed a copy of those resources on your +local system.

                        ...
                         <delegatePublic publicIdStartString="-//OASIS//DTD XML Catalog //"
                                         catalog="file:///usr/share/xml/docbook.xml"/>
                         <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML"
                        @@ -96,21 +95,21 @@ prefix if you have installed a copy of those resources onyourlocal system.

                        Delegation is the core features which allows to build a tree -ofcatalogs,easier to maintain than a single catalog, based on -PublicIdentifier, SystemIdentifier or URI prefixes it instructs the -catalogsoftware to look upentries in another resource. This feature allow to -buildhierarchies ofcatalogs, the set of entries presented should be -sufficient toredirect theresolution of all DocBook references to the specific -catalogin/usr/share/xml/docbook.xmlthis one in turn could -delegateallreferences for DocBook 4.2.1 to a specific catalog installed at -the sametimeas the DocBook resources on the local machine.

                        How to tune catalog usage:

                        The user can change the default catalog behaviour by redirecting -queriestoits own set of catalogs, this can be done by -settingtheXML_CATALOG_FILESenvironment variable to a list of -catalogs,anempty one should deactivate loading the -default/etc/xml/catalogdefault catalog

                        How to debug catalog processing:

                        Setting up the XML_DEBUG_CATALOGenvironment variable -willmakelibxml2 output debugging informations for each catalog -operations,forexample:

                        orchis:~/XML -> xmllint --memory --noout test/ent2
                        +...

                        Delegation is the core features which allows to build a tree of catalogs, +easier to maintain than a single catalog, based on Public Identifier, System +Identifier or URI prefixes it instructs the catalog software to look up +entries in another resource. This feature allow to build hierarchies of +catalogs, the set of entries presented should be sufficient to redirect the +resolution of all DocBook references to the specific catalog in +/usr/share/xml/docbook.xml this one in turn could delegate all +references for DocBook 4.2.1 to a specific catalog installed at the same time +as the DocBook resources on the local machine.

                        How to tune catalog usage:

                        The user can change the default catalog behaviour by redirecting queries +to its own set of catalogs, this can be done by setting the +XML_CATALOG_FILES environment variable to a list of catalogs, an +empty one should deactivate loading the default /etc/xml/catalog +default catalog

                        How to debug catalog processing:

                        Setting up the XML_DEBUG_CATALOG environment variable will +make libxml2 output debugging informations for each catalog operations, for +example:

                        orchis:~/XML -> xmllint --memory --noout test/ent2
                         warning: failed to load external entity "title.xml"
                         orchis:~/XML -> export XML_DEBUG_CATALOG=
                         orchis:~/XML -> xmllint --memory --noout test/ent2
                        @@ -118,26 +117,26 @@ Failed to parse catalog /etc/xml/catalog
                         Failed to parse catalog /etc/xml/catalog
                         warning: failed to load external entity "title.xml"
                         Catalogs cleanup
                        -orchis:~/XML -> 

                        The test/ent2 references an entity, running the parser from memorymakesthe -base URI unavailable and the the "title.xml" entity cannot beloaded.Setting -up the debug environment variable allows to detect that anattempt ismade to -load the /etc/xml/catalogbut since it's notpresent theresolution -fails.

                        But the most advanced way to debug XML catalog processing is to -usethexmlcatalogcommand shipped with libxml2, it allows -toloadcatalogs and make resolution queries to see what is going on. This -isalsoused for the regression tests:

                        orchis:~/XML -> ./xmlcatalog test/catalogs/docbook.xml \
                        +orchis:~/XML -> 

                        The test/ent2 references an entity, running the parser from memory makes +the base URI unavailable and the the "title.xml" entity cannot be loaded. +Setting up the debug environment variable allows to detect that an attempt is +made to load the /etc/xml/catalog but since it's not present the +resolution fails.

                        But the most advanced way to debug XML catalog processing is to use the +xmlcatalog command shipped with libxml2, it allows to load +catalogs and make resolution queries to see what is going on. This is also +used for the regression tests:

                        orchis:~/XML -> ./xmlcatalog test/catalogs/docbook.xml \
                                            "-//OASIS//DTD DocBook XML V4.1.2//EN"
                         http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
                        -orchis:~/XML -> 

                        For debugging what is going on, adding one -v flags increase -theverbositylevel to indicate the processing done (adding a second flag -alsoindicatewhat elements are recognized at parsing):

                        orchis:~/XML -> ./xmlcatalog -v test/catalogs/docbook.xml \
                        +orchis:~/XML -> 

                        For debugging what is going on, adding one -v flags increase the verbosity +level to indicate the processing done (adding a second flag also indicate +what elements are recognized at parsing):

                        orchis:~/XML -> ./xmlcatalog -v test/catalogs/docbook.xml \
                                            "-//OASIS//DTD DocBook XML V4.1.2//EN"
                         Parsing catalog test/catalogs/docbook.xml's content
                         Found public match -//OASIS//DTD DocBook XML V4.1.2//EN
                         http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
                         Catalogs cleanup
                        -orchis:~/XML -> 

                        A shell interface is also available to debug and process -multiplequeries(and for regression tests):

                        orchis:~/XML -> ./xmlcatalog -shell test/catalogs/docbook.xml \
                        +orchis:~/XML -> 

                        A shell interface is also available to debug and process multiple queries +(and for regression tests):

                        orchis:~/XML -> ./xmlcatalog -shell test/catalogs/docbook.xml \
                                            "-//OASIS//DTD DocBook XML V4.1.2//EN"
                         > help   
                         Commands available:
                        @@ -153,18 +152,18 @@ exit:  quit the shell
                         > public "-//OASIS//DTD DocBook XML V4.1.2//EN"
                         http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
                         > quit
                        -orchis:~/XML -> 

                        This should be sufficient for most debugging purpose, this wasactuallyused -heavily to debug the XML Catalog implementation itself.

                        How to create and maintaincatalogs:

                        Basically XML Catalogs are XML files, you can either use XML toolstomanage -them or use xmlcatalogfor this. The basic stepisto create a -catalog the -create option provide this facility:

                        orchis:~/XML -> ./xmlcatalog --create tst.xml
                        +orchis:~/XML -> 

                        This should be sufficient for most debugging purpose, this was actually +used heavily to debug the XML Catalog implementation itself.

                        How to create and maintain catalogs:

                        Basically XML Catalogs are XML files, you can either use XML tools to +manage them or use xmlcatalog for this. The basic step is +to create a catalog the -create option provide this facility:

                        orchis:~/XML -> ./xmlcatalog --create tst.xml
                         <?xml version="1.0"?>
                         <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
                                  "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
                         <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/>
                        -orchis:~/XML -> 

                        By default xmlcatalog does not overwrite the original catalog and -savetheresult on the standard output, this can be overridden using -the-nooutoption. The -addcommand allows to add entries -inthecatalog:

                        orchis:~/XML -> ./xmlcatalog --noout --create --add "public" \
                        +orchis:~/XML -> 

                        By default xmlcatalog does not overwrite the original catalog and save the +result on the standard output, this can be overridden using the -noout +option. The -add command allows to add entries in the +catalog:

                        orchis:~/XML -> ./xmlcatalog --noout --create --add "public" \
                           "-//OASIS//DTD DocBook XML V4.1.2//EN" \
                           http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd tst.xml
                         orchis:~/XML -> cat tst.xml
                        @@ -175,80 +174,83 @@ orchis:~/XML -> cat tst.xml
                         <public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
                                 uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
                         </catalog>
                        -orchis:~/XML -> 

                        The -addoption will always take 3 parameters even if -someofthe XML Catalog constructs (like nextCatalog) will have only -asingleargument, just pass a third empty string, it will be ignored.

                        Similarly the -deloption remove matching entries -fromthecatalog:

                        orchis:~/XML -> ./xmlcatalog --del \
                        +orchis:~/XML -> 

                        The -add option will always take 3 parameters even if some of +the XML Catalog constructs (like nextCatalog) will have only a single +argument, just pass a third empty string, it will be ignored.

                        Similarly the -del option remove matching entries from the +catalog:

                        orchis:~/XML -> ./xmlcatalog --del \
                           "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" tst.xml
                         <?xml version="1.0"?>
                         <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
                             "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
                         <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/>
                        -orchis:~/XML -> 

                        The catalog is now empty. Note that the matching -of-delisexact and would have worked in a similar fashion with -thePublic IDstring.

                        This is rudimentary but should be sufficient to manage a not -toocomplexcatalog tree of resources.

                        The implementor corner quick review -oftheAPI:

                        First, and like for every other module of libxml, there is -anautomaticallygenerated API page -forcatalogsupport.

                        The header for the catalog interfaces should be included as:

                        #include <libxml/catalog.h>

                        The API is voluntarily kept very simple. First it is not -obviousthatapplications really need access to it since it is the default -behaviouroflibxml2 (Note: it is possible to completely override libxml2 -defaultcatalogby using xmlSetExternalEntityLoadertoplug -anapplication specific resolver).

                        Basically libxml2 support 2 catalog lists:

                        • the default one, global shared by all the application
                        • -
                        • a per-document catalog, this one is built if the document - usestheoasis-xml-catalogPIs to specify its own catalog list, - itisassociated to the parser context and destroyed when the - parsingcontextis destroyed.
                        • -

                        the document one will be used first if it exists.

                        Initialization routines:

                        xmlInitializeCatalog(), xmlLoadCatalog() and xmlLoadCatalogs() -shouldbeused at startup to initialize the catalog, if the catalog -shouldbeinitialized with specific values xmlLoadCatalog() -orxmlLoadCatalogs()should be called before xmlInitializeCatalog() which -wouldotherwise do adefault initialization first.

                        The xmlCatalogAddLocal() call is used by the parser to grow thedocumentown -catalog list if needed.

                        Preferences setup:

                        The XML Catalog spec requires the possibility to select -defaultpreferencesbetween public and system -delegation,xmlCatalogSetDefaultPrefer() allowsthis, xmlCatalogSetDefaults() -andxmlCatalogGetDefaults() allow to control ifXML Catalogs resolution -shouldbe forbidden, allowed for global catalog, fordocument catalog or both, -thedefault is to allow both.

                        And of course xmlCatalogSetDebug() allows to generate -debugmessages(through the xmlGenericError() mechanism).

                        Querying routines:

                        xmlCatalogResolve(), -xmlCatalogResolveSystem(),xmlCatalogResolvePublic()and xmlCatalogResolveURI() -are relatively explicitif you read the XMLCatalog specification they -correspond to section 7algorithms, they shouldalso work if you have loaded an -SGML catalog with asimplified semantic.

                        xmlCatalogLocalResolve() and xmlCatalogLocalResolveURI() are the -samebutoperate on the document catalog list

                        Cleanup and Miscellaneous:

                        xmlCatalogCleanup() free-up the global catalog, xmlCatalogFreeLocal()isthe -per-document equivalent.

                        xmlCatalogAdd() and xmlCatalogRemove() are used to dynamically -modifythefirst catalog in the global list, and xmlCatalogDump() allows to -dumpacatalog state, those routines are primarily designed for xmlcatalog, -I'mnotsure that exposing more complex interfaces (like navigation ones) -wouldbereally useful.

                        The xmlParseCatalogFile() is a function used to load XML Catalogfiles,it's -similar as xmlParseFile() except it bypass all catalog lookups,it'sprovided -because this functionality may be useful for client tools.

                        threaded environments:

                        Since the catalog tree is built progressively, some care has been -takentotry to avoid troubles in multithreaded environments. The code is -nowthreadsafe assuming that the libxml2 library has been compiled -withthreadssupport.

                        Other resources

                        The XML Catalog specification is relatively recent so there -isn'tmuchliterature to point at:

                        • You can find a good rant from Norm Walsh about theneedfor - catalogs, it provides a lot of context informations even ifIdon't - agree with everything presented. Norm also wrote a morerecentarticle XMLentitiesand - URI resolversdescribing them.
                        • -
                        • An oldXMLcatalog - proposalfrom John Cowan
                        • -
                        • The Resource - DirectoryDescriptionLanguage(RDDL) another catalog system but more - orientedtowardproviding metadata for XML namespaces.
                        • -
                        • the page from the OASIS Technical Committee - onEntityResolutionwho maintains XML Catalog, you will find pointers - tothespecification update, some background and pointers to - otherstoolsproviding XML Catalog support
                        • -
                        • There is a shell scriptto - generateXMLCatalogs for DocBook 4.1.2 . If it can write to the - /etc/xml/directory,it will set-up /etc/xml/catalog and /etc/xml/docbook - based ontheresources found on the system. Otherwise it will just - create~/xmlcatalogand ~/dbkxmlcatalog and doing: +orchis:~/XML ->

                        The catalog is now empty. Note that the matching of -del is +exact and would have worked in a similar fashion with the Public ID +string.

                        This is rudimentary but should be sufficient to manage a not too complex +catalog tree of resources.

                        The implementor corner quick review of the +API:

                        First, and like for every other module of libxml, there is an +automatically generated API page for +catalog support.

                        The header for the catalog interfaces should be included as:

                        #include <libxml/catalog.h>

                        The API is voluntarily kept very simple. First it is not obvious that +applications really need access to it since it is the default behaviour of +libxml2 (Note: it is possible to completely override libxml2 default catalog +by using xmlSetExternalEntityLoader to +plug an application specific resolver).

                        Basically libxml2 support 2 catalog lists:

                        • the default one, global shared by all the application
                        • +
                        • a per-document catalog, this one is built if the document uses the + oasis-xml-catalog PIs to specify its own catalog list, it is + associated to the parser context and destroyed when the parsing context + is destroyed.
                        • +

                        the document one will be used first if it exists.

                        Initialization routines:

                        xmlInitializeCatalog(), xmlLoadCatalog() and xmlLoadCatalogs() should be +used at startup to initialize the catalog, if the catalog should be +initialized with specific values xmlLoadCatalog() or xmlLoadCatalogs() +should be called before xmlInitializeCatalog() which would otherwise do a +default initialization first.

                        The xmlCatalogAddLocal() call is used by the parser to grow the document +own catalog list if needed.

                        Preferences setup:

                        The XML Catalog spec requires the possibility to select default +preferences between public and system delegation, +xmlCatalogSetDefaultPrefer() allows this, xmlCatalogSetDefaults() and +xmlCatalogGetDefaults() allow to control if XML Catalogs resolution should +be forbidden, allowed for global catalog, for document catalog or both, the +default is to allow both.

                        And of course xmlCatalogSetDebug() allows to generate debug messages +(through the xmlGenericError() mechanism).

                        Querying routines:

                        xmlCatalogResolve(), xmlCatalogResolveSystem(), xmlCatalogResolvePublic() +and xmlCatalogResolveURI() are relatively explicit if you read the XML +Catalog specification they correspond to section 7 algorithms, they should +also work if you have loaded an SGML catalog with a simplified semantic.

                        xmlCatalogLocalResolve() and xmlCatalogLocalResolveURI() are the same but +operate on the document catalog list

                        Cleanup and Miscellaneous:

                        xmlCatalogCleanup() free-up the global catalog, xmlCatalogFreeLocal() is +the per-document equivalent.

                        xmlCatalogAdd() and xmlCatalogRemove() are used to dynamically modify the +first catalog in the global list, and xmlCatalogDump() allows to dump a +catalog state, those routines are primarily designed for xmlcatalog, I'm not +sure that exposing more complex interfaces (like navigation ones) would be +really useful.

                        The xmlParseCatalogFile() is a function used to load XML Catalog files, +it's similar as xmlParseFile() except it bypass all catalog lookups, it's +provided because this functionality may be useful for client tools.

                        threaded environments:

                        Since the catalog tree is built progressively, some care has been taken to +try to avoid troubles in multithreaded environments. The code is now thread +safe assuming that the libxml2 library has been compiled with threads +support.

                        Other resources

                        The XML Catalog specification is relatively recent so there isn't much +literature to point at:

                        • You can find a good rant from Norm Walsh about the + need for catalogs, it provides a lot of context informations even if + I don't agree with everything presented. Norm also wrote a more recent + article XML + entities and URI resolvers describing them.
                        • +
                        • An old XML + catalog proposal from John Cowan
                        • +
                        • The Resource Directory Description + Language (RDDL) another catalog system but more oriented toward + providing metadata for XML namespaces.
                        • +
                        • the page from the OASIS Technical Committee on Entity + Resolution who maintains XML Catalog, you will find pointers to the + specification update, some background and pointers to others tools + providing XML Catalog support
                        • +
                        • There is a shell script to generate + XML Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/ + directory, it will set-up /etc/xml/catalog and /etc/xml/docbook based on + the resources found on the system. Otherwise it will just create + ~/xmlcatalog and ~/dbkxmlcatalog and doing:

                          export XML_CATALOG_FILES=$HOME/xmlcatalog

                          -

                          should allow to process DocBook documentations withoutrequiringnetwork - accesses for the DTD or stylesheets

                          +

                          should allow to process DocBook documentations without requiring + network accesses for the DTD or stylesheets

                        • -
                        • I have uploaded asmalltarballcontaining - XML Catalogs for DocBook 4.1.2 which seemsto workfine for me too
                        • -
                        • The xmlcatalogmanualpage
                        • -

                        If you have suggestions for corrections or additions, simply contactme:

                        Daniel Veillard

                      +
                    3. I have uploaded a + small tarball containing XML Catalogs for DocBook 4.1.2 which seems + to work fine for me too
                    4. +
                    5. The xmlcatalog + manual page
                    6. +

                      If you have suggestions for corrections or additions, simply contact +me:

                      Daniel Veillard

                    diff --git a/doc/contribs.html b/doc/contribs.html index 2163d60..e493eb3 100644 --- a/doc/contribs.html +++ b/doc/contribs.html @@ -7,29 +7,34 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Contributions
                    Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                    Made with Libxml2 Logo

                    The XML C parser and toolkit of Gnome

                    Contributions

                    Main Menu
                    Related links
                    • Bjorn Reese, William Brack and Thomas Broyer have provided a - numberofpatches, Gary Pennington worked on the validation API, - threadingsupportand Solaris port.
                    • +Contributions
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      Contributions

                      Main Menu
                      Related links

                      Daniel Veillard

                      diff --git a/doc/devhelp/Makefile.in b/doc/devhelp/Makefile.in index 83b5866..0e0e053 100644 --- a/doc/devhelp/Makefile.in +++ b/doc/devhelp/Makefile.in @@ -136,6 +136,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -164,6 +165,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -199,6 +201,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/doc/devhelp/libxml2-HTMLparser.html b/doc/devhelp/libxml2-HTMLparser.html index 3a4a67d..827da39 100644 --- a/doc/devhelp/libxml2-HTMLparser.html +++ b/doc/devhelp/libxml2-HTMLparser.html @@ -95,6 +95,7 @@ void htmlFreeParserCtxt (htmlDocPtr htmlReadFile (const char * filename,
                      const char * encoding,
                      int options); htmlDocPtr htmlCtxtReadFile (htmlParserCtxtPtr ctxt,
                      const char * filename,
                      const char * encoding,
                      int options); int htmlParseDocument (htmlParserCtxtPtr ctxt); +htmlParserCtxtPtr htmlNewParserCtxt (void); htmlDocPtr htmlSAXParseDoc (xmlChar * cur,
                      const char * encoding,
                      htmlSAXHandlerPtr sax,
                      void * userData); int htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
                      int options); htmlDocPtr htmlParseDoc (xmlChar * cur,
                      const char * encoding); @@ -294,6 +295,10 @@ int htmlCtxtUseOptions (

                      htmlIsScriptAttribute ()

                      int	htmlIsScriptAttribute		(const xmlChar * name)

                      Check if an attribute is of content type Script

                      name:an attribute name
                      Returns:1 is the attribute is a script 0 otherwise
                      +
                      +

                      htmlNewParserCtxt ()

                      htmlParserCtxtPtr	htmlNewParserCtxt	(void)
                      +

                      Allocate and initialize a new parser context.

                      +
                      Returns:the htmlParserCtxtPtr or NULL in case of allocation error

                      htmlNodeStatus ()

                      htmlStatus	htmlNodeStatus		(const htmlNodePtr node, 
                      int legacy)

                      Checks whether the tree node is valid. Experimental (the author only uses the HTML enhancements in a SAX parser)

                      diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html index bc7e54e..c12cd02 100644 --- a/doc/devhelp/libxml2-parser.html +++ b/doc/devhelp/libxml2-parser.html @@ -219,6 +219,7 @@ void xmlSetExternalEntityLoader (XML_WITH_DEBUG = 28 XML_WITH_DEBUG_MEM = 29 XML_WITH_DEBUG_RUN = 30 + XML_WITH_ZLIB = 31 XML_WITH_NONE = 99999 /* just to be sure of allocation size */ };

                      @@ -301,7 +302,7 @@ void xmlSetExternalEntityLoader (XML_PARSE_NSCLEAN = 8192 /* remove redundant namespaces declarations */ XML_PARSE_NOCDATA = 16384 /* merge CDATA as text nodes */ XML_PARSE_NOXINCNODE = 32768 /* do not generate XINCLUDE START/END nodes */ - XML_PARSE_COMPACT = 65536 /* compact small text nodes */ + XML_PARSE_COMPACT = 65536 /* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */ };

                      @@ -553,7 +554,7 @@ void xmlSetExternalEntityLoader (

                      xmlIOParseDTD ()

                      xmlDtdPtr	xmlIOParseDTD		(xmlSAXHandlerPtr sax, 
                      xmlParserInputBufferPtr input,
                      xmlCharEncoding enc)

                      Load and parse a DTD

                      -
                      sax:the SAX handler block or NULL
                      input:an Input Buffer
                      enc:the charset encoding if known
                      Returns:the resulting xmlDtdPtr or NULL in case of error. @input will be freed at parsing end.
                      +
                      sax:the SAX handler block or NULL
                      input:an Input Buffer
                      enc:the charset encoding if known
                      Returns:the resulting xmlDtdPtr or NULL in case of error. @input will be freed by the function in any case.

                      xmlInitNodeInfoSeq ()

                      void	xmlInitNodeInfoSeq		(xmlParserNodeInfoSeqPtr seq)

                      -- Initialize (set to initial state) node info sequence

                      diff --git a/doc/devhelp/libxml2-tree.html b/doc/devhelp/libxml2-tree.html index d7757e3..70c6e50 100644 --- a/doc/devhelp/libxml2-tree.html +++ b/doc/devhelp/libxml2-tree.html @@ -187,6 +187,7 @@ void xmlSetDocCompressMode (xmlNodePtr xmlCopyNode (const xmlNodePtr node,
                      int extended); void xmlUnlinkNode (xmlNodePtr cur); const xmlChar * xmlSplitQName3 (const xmlChar * name,
                      int * len); +typedef xmlNsPtr xmlDOMWrapAcquireNsFunction (xmlDOMWrapCtxtPtr ctxt,
                      xmlNodePtr node,
                      const xmlChar * nsName,
                      const xmlChar * nsPrefix); xmlNodePtr xmlDocSetRootElement (xmlDocPtr doc,
                      xmlNodePtr root); long xmlGetLineNo (xmlNodePtr node); const xmlChar * xmlBufferContent (const xmlBufferPtr buf); @@ -385,7 +386,10 @@ void xmlFreeNsList (

                      Structure xmlDOMWrapCtxt

                      struct _xmlDOMWrapCtxt {
                      -    void *	_private
                      +    void *	_private	: * The type of this context, just in case we need specialized * context
                      +    int	type	: * Internal namespace map used for various operations. *
                      +    void *	namespaceMap	: * Use this one to acquire an xmlNsPtr intended for node->ns. * (Note t
                      +    xmlDOMWrapAcquireNsFunction	getNsForNodeFunc
                       } xmlDOMWrapCtxt;
                       

                      @@ -563,6 +567,7 @@ void xmlFreeNsList (xmlChar * URI : the full URI as computed int owner : does the entity own the childrens + int checked : was the entity content checked } xmlEntity;

                      @@ -640,6 +645,7 @@ void xmlFreeNsList (xmlChar * href : URL for the namespace const xmlChar * prefix : prefix for the namespace void * _private : application data + struct _xmlDoc * context : normally an xmlDoc } xmlNs;

                      @@ -868,6 +874,10 @@ void xmlFreeNsList (

                      Typedef xmlSAXLocatorPtr

                      xmlSAXLocator * xmlSAXLocatorPtr;
                       

                      +


                      +

                      Function type xmlDOMWrapAcquireNsFunction

                      xmlNsPtr	xmlDOMWrapAcquireNsFunction	(xmlDOMWrapCtxtPtr ctxt, 
                      xmlNodePtr node,
                      const xmlChar * nsName,
                      const xmlChar * nsPrefix)
                      +

                      A function called to acquire namespaces (xmlNs) from the wrapper.

                      +
                      ctxt:a DOM wrapper context
                      node:the context node (element or attribute)
                      nsName:the requested namespace name
                      nsPrefix:the requested namespace prefix
                      Returns:an xmlNsPtr or NULL in case of an error.

                      xmlAddChild ()

                      xmlNodePtr	xmlAddChild		(xmlNodePtr parent, 
                      xmlNodePtr cur)

                      Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed) If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed.

                      @@ -1010,11 +1020,11 @@ void xmlFreeNsList (
                      doc:the document pointer
                      name:the DTD name
                      ExternalID:the external (PUBLIC) ID
                      SystemID:the system ID
                      Returns:a pointer to the new DTD structure

                      xmlDOMWrapAdoptNode ()

                      int	xmlDOMWrapAdoptNode		(xmlDOMWrapCtxtPtr ctxt, 
                      xmlDocPtr sourceDoc,
                      xmlNodePtr node,
                      xmlDocPtr destDoc,
                      xmlNodePtr destParent,
                      int options)
                      -

                      References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state.

                      +

                      References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.

                      ctxt:the optional context for custom processing
                      sourceDoc:the optional sourceDoc
                      node:the node to start with
                      destDoc:the destination doc
                      destParent:the optional new parent of @node in @destDoc
                      options:option flags
                      Returns:0 if the operation succeeded, 1 if a node of unsupported type was given, 2 if a node of not yet supported type was given and -1 on API/internal errors.

                      xmlDOMWrapCloneNode ()

                      int	xmlDOMWrapCloneNode		(xmlDOMWrapCtxtPtr ctxt, 
                      xmlDocPtr sourceDoc,
                      xmlNodePtr node,
                      xmlNodePtr * resNode,
                      xmlDocPtr destDoc,
                      xmlNodePtr destParent,
                      int deep,
                      int options)
                      -

                      References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) Support dicts Optimize string adoption for equal or none dicts. 2) XInclude WARNING: This function is in a experimental state and should only be currently only be used to test it.

                      +

                      References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used. This is the case when you don't know already where the cloned branch will be added to. If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) What to do with XInclude? Currently this returns an error for XInclude.

                      ctxt:the optional context for custom processing
                      sourceDoc:the optional sourceDoc
                      node:the node to start with
                      resNode:the clone of the given @node
                      destDoc:the destination doc
                      destParent:the optional new parent of @node in @destDoc
                      deep:descend into child if set
                      options:option flags
                      Returns:0 if the operation succeeded, 1 if a node of unsupported (or not yet supported) type was given, -1 on API/internal errors.


                      xmlDOMWrapReconcileNamespaces ()

                      int	xmlDOMWrapReconcileNamespaces	(xmlDOMWrapCtxtPtr ctxt, 
                      xmlNodePtr elem,
                      int options)
                      -

                      Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state.

                      +

                      Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.

                      ctxt:DOM wrapper context, unused at the moment
                      elem:the element-node
                      options:option flags
                      Returns:0 if succeeded, -1 otherwise and on API/internal errors.

                      xmlDOMWrapRemoveNode ()

                      int	xmlDOMWrapRemoveNode		(xmlDOMWrapCtxtPtr ctxt, 
                      xmlDocPtr doc,
                      xmlNodePtr node,
                      int options)
                      -

                      Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. WARNING: This function is in a experimental state.

                      +

                      Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. NOTE: This function was not intensively tested.

                      ctxt:a DOM wrapper context
                      doc:the doc
                      node:the node to be removed.
                      options:set of options, unused at the moment
                      Returns:0 on success, 1 if the node is not supported, -1 on API and internal errors.

                      xmlDocCopyNode ()

                      xmlNodePtr	xmlDocCopyNode		(const xmlNodePtr node, 
                      xmlDocPtr doc,
                      int extended)
                      @@ -1071,7 +1081,7 @@ void xmlFreeNsList (

                      xmlDocSetRootElement ()

                      xmlNodePtr	xmlDocSetRootElement	(xmlDocPtr doc, 
                      xmlNodePtr root)

                      Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).

                      -
                      doc:the document
                      root:the new document root element
                      Returns:the old root element if any was found
                      +
                      doc:the document
                      root:the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead.
                      Returns:the old root element if any was found, NULL if root was NULL

                      xmlElemDump ()

                      void	xmlElemDump			(FILE * f, 
                      xmlDocPtr doc,
                      xmlNodePtr cur)

                      Dump an XML/HTML node, recursive behaviour, children are printed too.

                      diff --git a/doc/devhelp/libxml2-uri.html b/doc/devhelp/libxml2-uri.html index 22f724e..33f32fa 100644 --- a/doc/devhelp/libxml2-uri.html +++ b/doc/devhelp/libxml2-uri.html @@ -52,6 +52,7 @@ char * xmlURIUnescapeString (const char * s xmlURIPtr xmlParseURI (const char * str); xmlURIPtr xmlCreateURI (void); xmlChar * xmlURIEscapeStr (const xmlChar * str,
                      const xmlChar * list); +xmlChar * xmlPathToURI (const xmlChar * path); xmlChar * xmlCanonicPath (const xmlChar * path); void xmlFreeURI (xmlURIPtr uri); int xmlParseURIReference (xmlURIPtr uri,
                      const char * str); @@ -121,6 +122,10 @@ int xmlParseURIReference (

                      xmlParseURIReference ()

                      int	xmlParseURIReference		(xmlURIPtr uri, 
                      const char * str)

                      Parse an URI reference string and fills in the appropriate fields of the @uri structure URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

                      uri:pointer to an URI structure
                      str:the string to analyze
                      Returns:0 or the error code
                      +
                      +

                      xmlPathToURI ()

                      xmlChar *	xmlPathToURI		(const xmlChar * path)
                      +

                      Constructs an URI expressing the existing path

                      +
                      path:the resource locator in a filesystem notation
                      Returns:a new URI, or a duplicate of the path parameter if the construction fails. The caller is responsible for freeing the memory occupied by the returned string. If there is insufficient memory available, or the argument is NULL, the function returns NULL.

                      xmlPrintURI ()

                      void	xmlPrintURI			(FILE * stream, 
                      xmlURIPtr uri)

                      Prints the URI in the stream @stream.

                      diff --git a/doc/devhelp/libxml2-xinclude.html b/doc/devhelp/libxml2-xinclude.html index 6ffcd5a..31df927 100644 --- a/doc/devhelp/libxml2-xinclude.html +++ b/doc/devhelp/libxml2-xinclude.html @@ -55,6 +55,7 @@ #define XINCLUDE_OLD_NS; typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; typedef xmlXIncludeCtxt * xmlXIncludeCtxtPtr; +int xmlXIncludeProcessFlagsData (xmlDocPtr doc,
                      int flags,
                      void * data); int xmlXIncludeProcessFlags (xmlDocPtr doc,
                      int flags); int xmlXIncludeProcessTree (xmlNodePtr tree); int xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
                      xmlNodePtr node); @@ -136,6 +137,10 @@ The content of this structure is not made public by the API.

                      xmlXIncludeProcessFlags ()

                      int	xmlXIncludeProcessFlags		(xmlDocPtr doc, 
                      int flags)

                      Implement the XInclude substitution on the XML document @doc

                      doc:an XML document
                      flags:a set of xmlParserOption used for parsing XML includes
                      Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.
                      +
                      +

                      xmlXIncludeProcessFlagsData ()

                      int	xmlXIncludeProcessFlagsData	(xmlDocPtr doc, 
                      int flags,
                      void * data)
                      +

                      Implement the XInclude substitution on the XML document @doc

                      +
                      doc:an XML document
                      flags:a set of xmlParserOption used for parsing XML includes
                      data:application data that will be passed to the parser context in the _private field of the parser context(s)
                      Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                      xmlXIncludeProcessNode ()

                      int	xmlXIncludeProcessNode		(xmlXIncludeCtxtPtr ctxt, 
                      xmlNodePtr node)

                      Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.

                      diff --git a/doc/devhelp/libxml2-xmlsave.html b/doc/devhelp/libxml2-xmlsave.html index 910a1df..cbe12bb 100644 --- a/doc/devhelp/libxml2-xmlsave.html +++ b/doc/devhelp/libxml2-xmlsave.html @@ -121,7 +121,7 @@ The content of this structure is not made public by the API.

                      xmlSaveTree ()

                      long	xmlSaveTree			(xmlSaveCtxtPtr ctxt, 
                      xmlNodePtr node)

                      Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead

                      -
                      ctxt:a document saving context
                      node:a document
                      Returns:the number of byte written or -1 in case of error
                      +
                      ctxt:a document saving context
                      node:the top node of the subtree to save
                      Returns:the number of byte written or -1 in case of error

                      diff --git a/doc/devhelp/libxml2-xmlversion.html b/doc/devhelp/libxml2-xmlversion.html index dcf26f8..6a3a089 100644 --- a/doc/devhelp/libxml2-xmlversion.html +++ b/doc/devhelp/libxml2-xmlversion.html @@ -73,6 +73,7 @@ #define LIBXML_UNICODE_ENABLED; #define LIBXML_FTP_ENABLED; #define LIBXML_AUTOMATA_ENABLED; +#define LIBXML_ZLIB_ENABLED; #define LIBXML_WRITER_ENABLED; #define LIBXML_C14N_ENABLED; #define LIBXML_SCHEMAS_ENABLED; @@ -217,7 +218,7 @@ void xmlCheckVersion (int version);

                      Macro LIBXML_VERSION

                      #define LIBXML_VERSION;
                      -

                      the version number: 1.2.3 value is 1002003

                      +

                      the version number: 1.2.3 value is 10203


                      Macro LIBXML_VERSION_EXTRA

                      #define LIBXML_VERSION_EXTRA;
                      @@ -225,7 +226,7 @@ void	xmlCheckVersion			(int version);
                       

                      Macro LIBXML_VERSION_STRING

                      #define LIBXML_VERSION_STRING;
                      -

                      the version number string, 1.2.3 value is "1002003"

                      +

                      the version number string, 1.2.3 value is "10203"


                      Macro LIBXML_WRITER_ENABLED

                      #define LIBXML_WRITER_ENABLED;
                      @@ -242,6 +243,10 @@ void	xmlCheckVersion			(int version);
                               

                      Macro LIBXML_XPTR_ENABLED

                      #define LIBXML_XPTR_ENABLED;
                       

                      Whether XPointer is configured in

                      +
                      +
                      +

                      Macro LIBXML_ZLIB_ENABLED

                      #define LIBXML_ZLIB_ENABLED;
                      +

                      Whether the Zlib support is compiled in


                      Macro WITHOUT_TRIO

                      #define WITHOUT_TRIO;
                      diff --git a/doc/devhelp/libxml2-xpath.html b/doc/devhelp/libxml2-xpath.html
                      index f3fe7a6..86b0cc2 100644
                      --- a/doc/devhelp/libxml2-xpath.html
                      +++ b/doc/devhelp/libxml2-xpath.html
                      @@ -74,7 +74,7 @@ typedef xmlXPathFunction xmlXPathIsNaN			(double val);
                       int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
                      int active,
                      int value,
                      int options); xmlXPathObjectPtr xmlXPathConvertString (xmlXPathObjectPtr val); -xmlXPathObjectPtr xmlXPathConvertBoolean (xmlXPathObjectPtr val); +int xmlXPathCompiledEvalToBoolean (xmlXPathCompExprPtr comp,
                      xmlXPathContextPtr ctxt); int xmlXPathIsInf (double val); long xmlXPathOrderDocElems (xmlDocPtr doc); xmlNodeSetPtr xmlXPathNodeSetCreate (xmlNodePtr val); @@ -96,11 +96,12 @@ void xmlXPathFreeNodeSetList (xmlXPathObjectPtr xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
                      xmlXPathContextPtr ctx); xmlXPathObjectPtr xmlXPathEvalExpression (const xmlChar * str,
                      xmlXPathContextPtr ctxt); void xmlXPathInit (void); -xmlXPathCompExprPtr xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
                      const xmlChar * str); +xmlXPathObjectPtr xmlXPathConvertBoolean (xmlXPathObjectPtr val); typedef int xmlXPathConvertFunc (xmlXPathObjectPtr obj,
                      int type); typedef void xmlXPathFunction (xmlXPathParserContextPtr ctxt,
                      int nargs); int xmlXPathCmpNodes (xmlNodePtr node1,
                      xmlNodePtr node2); xmlChar * xmlXPathCastToString (xmlXPathObjectPtr val); +xmlXPathCompExprPtr xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
                      const xmlChar * str); typedef void xmlXPathEvalFunc (xmlXPathParserContextPtr ctxt,
                      int nargs); xmlChar * xmlXPathCastBooleanToString (int val); int xmlXPathCastNumberToBoolean (double val); @@ -424,7 +425,7 @@ The content of this structure is not made public by the API.

                      xmlXPathCastToString ()

                      xmlChar *	xmlXPathCastToString	(xmlXPathObjectPtr val)

                      Converts an existing object to its string() equivalent

                      -
                      val:an XPath object
                      Returns:the string value of the object, NULL in case of error. A new string is allocated only if needed (@val isn't a string object).
                      +
                      val:an XPath object
                      Returns:the allocated string value of the object, NULL in case of error. It's up to the caller to free the string memory with xmlFree().

                      xmlXPathCmpNodes ()

                      int	xmlXPathCmpNodes		(xmlNodePtr node1, 
                      xmlNodePtr node2)

                      Compare two nodes w.r.t document order

                      @@ -437,6 +438,10 @@ The content of this structure is not made public by the API.

                      xmlXPathCompiledEval ()

                      xmlXPathObjectPtr	xmlXPathCompiledEval	(xmlXPathCompExprPtr comp, 
                      xmlXPathContextPtr ctx)

                      Evaluate the Precompiled XPath expression in the given context.

                      comp:the compiled XPath expression
                      ctx:the XPath context
                      Returns:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.
                      +
                      +

                      xmlXPathCompiledEvalToBoolean ()

                      int	xmlXPathCompiledEvalToBoolean	(xmlXPathCompExprPtr comp, 
                      xmlXPathContextPtr ctxt)
                      +

                      Applies the XPath boolean() function on the result of the given compiled expression.

                      +
                      comp:the compiled XPath expression
                      ctxt:the XPath context
                      Returns:1 if the expression evaluated to true, 0 if to false and -1 in API and internal errors.

                      xmlXPathContextSetCache ()

                      int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
                      int active,
                      int value,
                      int options)

                      Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect.

                      diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp index e0af836..d789934 100644 --- a/doc/devhelp/libxml2.devhelp +++ b/doc/devhelp/libxml2.devhelp @@ -127,6 +127,7 @@ + @@ -1413,6 +1414,7 @@ + @@ -1788,6 +1790,7 @@ + @@ -1948,6 +1951,7 @@ + @@ -2633,6 +2637,7 @@ + @@ -3294,6 +3299,7 @@ + @@ -3319,6 +3325,7 @@ + diff --git a/doc/docs.html b/doc/docs.html index fa30ac2..4c5fe55 100644 --- a/doc/docs.html +++ b/doc/docs.html @@ -7,22 +7,27 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Developer Menu
                      Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                      Made with Libxml2 Logo

                      The XML C parser and toolkit of Gnome

                      Developer Menu

                      Developer Menu
                      API Indexes
                      Related links

                      There are several on-line resources related to using libxml:

                      1. Use the search engineto lookupinformation.
                      2. +Developer Menu
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        The XML C parser and toolkit of Gnome

                        Developer Menu

                        Developer Menu
                        API Indexes
                        Related links

                        There are several on-line resources related to using libxml:

                        1. Use the search engine to look up + information.
                        2. Check the FAQ.
                        3. -
                        4. Check the extensivedocumentationautomaticallyextracted - from code comments.
                        5. -
                        6. Look at the documentation about libxmlinternationalization support.
                        7. -
                        8. This page provides a global overview and someexampleson how to use libxml.
                        9. +
                        10. Check the extensive + documentation automatically extracted from code comments.
                        11. +
                        12. Look at the documentation about libxml + internationalization support.
                        13. +
                        14. This page provides a global overview and some + examples on how to use libxml.
                        15. Code examples
                        16. -
                        17. John Fleck's libxml2 tutorial: htmlorpdf.
                        18. -
                        19. If you need to parse large files, check the xmlReaderAPI tutorial
                        20. -
                        21. James Henstridgewrote somenicedocumentationexplaining - how to use the libxml SAX interface.
                        22. -
                        23. George Lebl wrote anarticlefor - IBM developerWorksabout using libxml.
                        24. -
                        25. Check theTODOfile.
                        26. -
                        27. Read the 1.x to 2.x upgrade - pathdescription.If you are starting a new project using libxml you - shouldreally use the2.x version.
                        28. +
                        29. John Fleck's libxml2 tutorial: html + or pdf.
                        30. +
                        31. If you need to parse large files, check the xmlReader API tutorial
                        32. +
                        33. James Henstridge wrote some nice + documentation explaining how to use the libxml SAX interface.
                        34. +
                        35. George Lebl wrote an article + for IBM developerWorks about using libxml.
                        36. +
                        37. Check the TODO + file.
                        38. +
                        39. Read the 1.x to 2.x upgrade path + description. If you are starting a new project using libxml you should + really use the 2.x version.
                        40. And don't forget to look at the mailing-list archive.

                        Daniel Veillard

                        diff --git a/doc/downloads.html b/doc/downloads.html index 71ce9a6..e49f483 100644 --- a/doc/downloads.html +++ b/doc/downloads.html @@ -7,28 +7,30 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Downloads
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        The XML C parser and toolkit of Gnome

                        Downloads

                        Main Menu
                        Related links

                        The latest versions of libxml2 can be found on the xmlsoft.orgserver ( HTTP, FTPand rsync are available), there -isalsomirrors (Australia(Web), France) or on the Gnome FTP serveras source -archive,Antonin Sprinzl also provide amirror in Austria. (NOTE -thatyou need both the libxml(2)and libxml(2)-develpackagesinstalled -to compile applications using libxml.)

                        You can find all the history of libxml(2) and libxslt releases in the olddirectory. -TheprecompiledWindows binaries made by Igor Zlatovic are available in the win32directory.

                        Binary ports:

                        • Red Hat RPMs for i386 are available directly on xmlsoft.org, the source RPM - willcompile onany architecture supported by Red Hat.
                        • -
                        • Igor Zlatkovicis - nowthemaintainer of the Windows port, heprovidesbinaries.
                        • -
                        • Blastwave provides Solarisbinaries.
                        • -
                        • Steve Ballprovides Mac - OsXbinaries.
                        • +Downloads
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          Downloads

                          Main Menu
                          Related links

                          The latest versions of libxml2 can be found on the xmlsoft.org server ( HTTP, FTP and rsync are available), there is also +mirrors (Australia( Web), France) or on the Gnome FTP server as source archive +, Antonin Sprinzl also provide a +mirror in Austria. (NOTE that you need both the libxml(2) and libxml(2)-devel +packages installed to compile applications using libxml.)

                          You can find all the history of libxml(2) and libxslt releases in the old directory. The precompiled +Windows binaries made by Igor Zlatovic are available in the win32 directory.

                          Binary ports:

                          If you know other supported binary ports, please contact me.

                          Snapshot:

                          Contributions:

                          I do accept external contributions, especially if compiling -onanotherplatform, get in touch with the list to upload the package, -wrappersforvarious languages have been provided, and can be found in the bindings section

                          Libxml2 is also available from CVS:

                          Contributions:

                          I do accept external contributions, especially if compiling on another +platform, get in touch with the list to upload the package, wrappers for +various languages have been provided, and can be found in the bindings section

                          Libxml2 is also available from CVS:

                          • The Gnome CVS + base. Check the Gnome CVS Tools + page; the CVS module is libxml2.

                          • -
                          • The libxsltmodule is also present there
                          • +
                          • The libxslt module is also present there

                          Daniel Veillard

                          diff --git a/doc/encoding.html b/doc/encoding.html index 8db787e..1f4558d 100644 --- a/doc/encoding.html +++ b/doc/encoding.html @@ -7,44 +7,44 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Encodings support
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          Encodings support

                          Main Menu
                          Related links

                          If you are not really familiar with Internationalization (usual -shortcutisI18N) , Unicode, characters and glyphs, I suggest you read a presentationbyTim -Bray on Unicode and why you should care about it.

                          If you don't understand why it does not make sense to have -astringwithout knowing what encoding it uses, then as Joel Spolsky said -please do -notwriteanother line of code until you finish reading that article.. It -isaprerequisite to understand this page, and avoid a lot of -problemswithlibxml2, XML or text processing in general.

                          Table of Content:

                          1. What does internationalization - supportmean?
                          2. -
                          3. The internal encoding, - howandwhy
                          4. +Encodings support
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            Encodings support

                            Main Menu
                            Related links

                            If you are not really familiar with Internationalization (usual shortcut +is I18N) , Unicode, characters and glyphs, I suggest you read a presentation +by Tim Bray on Unicode and why you should care about it.

                            If you don't understand why it does not make sense to have a string +without knowing what encoding it uses, then as Joel Spolsky said please do not +write another line of code until you finish reading that article.. It is +a prerequisite to understand this page, and avoid a lot of problems with +libxml2, XML or text processing in general.

                            Table of Content:

                            1. What does internationalization support + mean ?
                            2. +
                            3. The internal encoding, how and + why
                            4. How is it implemented ?
                            5. Default supported encodings
                            6. -
                            7. How to extend theexistingsupport
                            8. -

                            What does internationalization support mean ?

                            XML was designed from the start to allow the support of any charactersetby -using Unicode. Any conformant XML parser has to support the UTF-8andUTF-16 -default encodings which can both express the full unicode ranges.UTF8is a -variable length encoding whose greatest points are to reuse thesameencoding -for ASCII and to save space for Western encodings, but it is abitmore complex -to handle in practice. UTF-16 use 2 bytes per character(andsometimes combines -two pairs), it makes implementation easier, but looksabit overkill for -Western languages encoding. Moreover the XMLspecificationallows the document -to be encoded in other encodings at thecondition thatthey are clearly labeled -as such. For example the following isa wellformedXML document encoded in -ISO-8859-1 and using accentuated lettersthat weFrench like for both markup -and content:

                            <?xml version="1.0" encoding="ISO-8859-1"?>
                            +  
                          5. How to extend the existing + support
                          6. +

                            What does internationalization support mean ?

                            XML was designed from the start to allow the support of any character set +by using Unicode. Any conformant XML parser has to support the UTF-8 and +UTF-16 default encodings which can both express the full unicode ranges. UTF8 +is a variable length encoding whose greatest points are to reuse the same +encoding for ASCII and to save space for Western encodings, but it is a bit +more complex to handle in practice. UTF-16 use 2 bytes per character (and +sometimes combines two pairs), it makes implementation easier, but looks a +bit overkill for Western languages encoding. Moreover the XML specification +allows the document to be encoded in other encodings at the condition that +they are clearly labeled as such. For example the following is a wellformed +XML document encoded in ISO-8859-1 and using accentuated letters that we +French like for both markup and content:

                            <?xml version="1.0" encoding="ISO-8859-1"?>
                             <très>là</très>

                            Having internationalization support in libxml2 means the following:

                            • the document is properly parsed
                            • informations about it's encoding are saved
                            • it can be modified
                            • it can be saved in its original encoding
                            • -
                            • it can also be saved in another encoding supported by - libxml2(forexample straight UTF8 or even an ASCII form)
                            • -

                            Another very important point is that the whole libxml2 API, -withtheexception of a few routines to read with a specific encoding or save -toaspecific encoding, is completely agnostic about the original encoding -ofthedocument.

                            It should be noted too that the HTML parser embedded in libxml2 nowobeythe -same rules too, the following document will be (as of 2.2.2) handledinan -internationalized fashion by libxml2 too:

                            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                            +  
                          7. it can also be saved in another encoding supported by libxml2 (for + example straight UTF8 or even an ASCII form)
                          8. +

                            Another very important point is that the whole libxml2 API, with the +exception of a few routines to read with a specific encoding or save to a +specific encoding, is completely agnostic about the original encoding of the +document.

                            It should be noted too that the HTML parser embedded in libxml2 now obey +the same rules too, the following document will be (as of 2.2.2) handled in +an internationalized fashion by libxml2 too:

                            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                                                   "http://www.w3.org/TR/REC-html40/loose.dtd">
                             <html lang="fr">
                             <head>
                            @@ -52,60 +52,59 @@ internationalized fashion by libxml2 too:

                            <!DOCTYPE HTML PUBLIC "-//W
                             </head>
                             <body>
                             <p>W3C crée des standards pour le Web.</body>
                            -</html>

                            The internal encoding, how and why

                            One of the core decisions was to force all documents to be converted -toadefault internal encoding, and that encoding to be UTF-8, here -aretherationales for those choices:

                            • keeping the native encoding in the internal form would force - thelibxmlusers (or the code associated) to be fully aware of the encoding - oftheoriginal document, for examples when adding a text node to - adocument,the content would have to be provided in the document - encoding,i.e. theclient code would have to check it before hand, make - sure it'sconformantto the encoding, etc ... Very hard in practice, though - in somespecificcases this may make sense.
                            • -
                            • the second decision was which encoding. From the XML spec only - UTF8andUTF16 really makes sense as being the two only encodings for - whichthereis mandatory support. UCS-4 (32 bits fixed size encoding) - couldbeconsidered an intelligent choice too since it's a direct - Unicodemappingsupport. I selected UTF-8 on the basis of efficiency - andcompatibilitywith surrounding software: -
                              • UTF-8 while a bit more complex to convert from/to (i.e.slightlymore - costly to import and export CPU wise) is also far morecompactthan - UTF-16 (and UCS-4) for a majority of the documents I seeit usedfor - right now (RPM RDF catalogs, advogato data, variousconfigurationfile - formats, etc.) and the key point for today'scomputerarchitecture is - efficient uses of caches. If one nearlydouble thememory requirement - to store the same amount of data, thiswill trashcaches (main - memory/external caches/internal caches) and mytake isthat this harms - the system far more than the CPU requirementsneededfor the conversion - to UTF-8
                              • -
                              • Most of libxml2 version 1 users were using it with - straightASCIImost of the time, doing the conversion with an - internalencodingrequiring all their code to be rewritten was a - seriousshow-stopperfor using UTF-16 or UCS-4.
                              • -
                              • UTF-8 is being used as the de-facto internal encoding - standardforrelated code like the pangoupcoming Gnome text widget, - anda lot of Unix code (yet another placewhere Unix programmer base - takesa different approach from Microsoft- they are using UTF-16)
                              • +</html>

                            The internal encoding, how and why

                            One of the core decisions was to force all documents to be converted to a +default internal encoding, and that encoding to be UTF-8, here are the +rationales for those choices:

                            • keeping the native encoding in the internal form would force the libxml + users (or the code associated) to be fully aware of the encoding of the + original document, for examples when adding a text node to a document, + the content would have to be provided in the document encoding, i.e. the + client code would have to check it before hand, make sure it's conformant + to the encoding, etc ... Very hard in practice, though in some specific + cases this may make sense.
                            • +
                            • the second decision was which encoding. From the XML spec only UTF8 and + UTF16 really makes sense as being the two only encodings for which there + is mandatory support. UCS-4 (32 bits fixed size encoding) could be + considered an intelligent choice too since it's a direct Unicode mapping + support. I selected UTF-8 on the basis of efficiency and compatibility + with surrounding software: +
                              • UTF-8 while a bit more complex to convert from/to (i.e. slightly + more costly to import and export CPU wise) is also far more compact + than UTF-16 (and UCS-4) for a majority of the documents I see it used + for right now (RPM RDF catalogs, advogato data, various configuration + file formats, etc.) and the key point for today's computer + architecture is efficient uses of caches. If one nearly double the + memory requirement to store the same amount of data, this will trash + caches (main memory/external caches/internal caches) and my take is + that this harms the system far more than the CPU requirements needed + for the conversion to UTF-8
                              • +
                              • Most of libxml2 version 1 users were using it with straight ASCII + most of the time, doing the conversion with an internal encoding + requiring all their code to be rewritten was a serious show-stopper + for using UTF-16 or UCS-4.
                              • +
                              • UTF-8 is being used as the de-facto internal encoding standard for + related code like the pango + upcoming Gnome text widget, and a lot of Unix code (yet another place + where Unix programmer base takes a different approach from Microsoft + - they are using UTF-16)
                            • -

                            What does this mean in practice for the libxml2 user:

                            • xmlChar, the libxml2 data type is a byte, those bytes must - beassembledas UTF-8 valid strings. The proper way to terminate an xmlChar - *stringis simply to append 0 byte, as usual.
                            • -
                            • One just need to make sure that when using chars outside the - ASCIIset,the values has been properly converted to UTF-8
                            • -

                            How is it implemented ?

                            Let's describe how all this works within libxml, basically -theI18N(internationalization) support get triggered only during I/O -operation,i.e.when reading a document or saving one. Let's look first at -thereadingsequence:

                            1. when a document is processed, we usually don't know the - encoding,asimple heuristic allows to detect UTF-16 and UCS-4 from - encodingswherethe ASCII range (0-0x7F) maps with ASCII
                            2. -
                            3. the xml declaration if available is parsed, including - theencodingdeclaration. At that point, if the autodetected encoding - isdifferentfrom the one declared a call to xmlSwitchEncoding() - isissued.
                            4. -
                            5. If there is no encoding declaration, then the input has to be - ineitherUTF-8 or UTF-16, if it is not then at some point when - processingtheinput, the converter/checker of UTF-8 form will raise an - encodingerror.You may end-up with a garbled document, or no document at - all !Example: +

                              What does this mean in practice for the libxml2 user:

                              • xmlChar, the libxml2 data type is a byte, those bytes must be assembled + as UTF-8 valid strings. The proper way to terminate an xmlChar * string + is simply to append 0 byte, as usual.
                              • +
                              • One just need to make sure that when using chars outside the ASCII set, + the values has been properly converted to UTF-8
                              • +

                              How is it implemented ?

                              Let's describe how all this works within libxml, basically the I18N +(internationalization) support get triggered only during I/O operation, i.e. +when reading a document or saving one. Let's look first at the reading +sequence:

                              1. when a document is processed, we usually don't know the encoding, a + simple heuristic allows to detect UTF-16 and UCS-4 from encodings where + the ASCII range (0-0x7F) maps with ASCII
                              2. +
                              3. the xml declaration if available is parsed, including the encoding + declaration. At that point, if the autodetected encoding is different + from the one declared a call to xmlSwitchEncoding() is issued.
                              4. +
                              5. If there is no encoding declaration, then the input has to be in either + UTF-8 or UTF-16, if it is not then at some point when processing the + input, the converter/checker of UTF-8 form will raise an encoding error. + You may end-up with a garbled document, or no document at all ! Example:
                                ~/XML -> ./xmllint err.xml 
                                 err.xml:1: error: Input is not proper UTF-8, indicate encoding !
                                 <très>là</très>
                                @@ -114,93 +113,94 @@ err.xml:1: error: Bytes: 0xE8 0x73 0x3E 0x6C
                                 <très>là</très>
                                    ^
                              6. -
                              7. xmlSwitchEncoding() does an encoding name lookup, canonicalize - it,andthen search the default registered encoding converters for - thatencoding.If it's not within the default set and iconv() support has - beencompiledit, it will ask iconv for such an encoder. If this fails then - theparserwill report an error and stops processing: +
                              8. xmlSwitchEncoding() does an encoding name lookup, canonicalize it, and + then search the default registered encoding converters for that encoding. + If it's not within the default set and iconv() support has been compiled + it, it will ask iconv for such an encoder. If this fails then the parser + will report an error and stops processing:
                                ~/XML -> ./xmllint err2.xml 
                                 err2.xml:1: error: Unsupported encoding UnsupportedEnc
                                 <?xml version="1.0" encoding="UnsupportedEnc"?>
                                                                              ^
                              9. -
                              10. From that point the encoder processes progressively the input - (itisplugged as a front-end to the I/O module) for that entity. - Itcapturesand converts on-the-fly the document to be parsed to UTF-8. - Theparseritself just does UTF-8 checking of this input and - processittransparently. The only difference is that the encoding - informationhasbeen added to the parsing context (more precisely to - theinputcorresponding to this entity).
                              11. -
                              12. The result (when using DOM) is an internal form completely in - UTF-8withjust an encoding information on the document node.
                              13. -

                              Ok then what happens when saving the document (assuming -youcollected/builtan xmlDoc DOM like structure) ? It depends on the -functioncalled,xmlSaveFile() will just try to save in the original -encoding,whilexmlSaveFileTo() and xmlSaveFileEnc() can optionally save to -agivenencoding:

                              1. if no encoding is given, libxml2 will look for an - encodingvalueassociated to the document and if it exists will try to save - tothatencoding, +
                              2. From that point the encoder processes progressively the input (it is + plugged as a front-end to the I/O module) for that entity. It captures + and converts on-the-fly the document to be parsed to UTF-8. The parser + itself just does UTF-8 checking of this input and process it + transparently. The only difference is that the encoding information has + been added to the parsing context (more precisely to the input + corresponding to this entity).
                              3. +
                              4. The result (when using DOM) is an internal form completely in UTF-8 + with just an encoding information on the document node.
                              5. +

                              Ok then what happens when saving the document (assuming you +collected/built an xmlDoc DOM like structure) ? It depends on the function +called, xmlSaveFile() will just try to save in the original encoding, while +xmlSaveFileTo() and xmlSaveFileEnc() can optionally save to a given +encoding:

                              1. if no encoding is given, libxml2 will look for an encoding value + associated to the document and if it exists will try to save to that + encoding,

                                otherwise everything is written in the internal form, i.e. UTF-8

                              2. -
                              3. so if an encoding was specified, either at the API level or - onthedocument, libxml2 will again canonicalize the encoding name, - lookupfor aconverter in the registered set or through iconv. If not - foundthefunction will return an error code
                              4. -
                              5. the converter is placed before the I/O buffer layer, as another - kindofbuffer, then libxml2 will simply push the UTF-8 serialization - tothroughthat buffer, which will then progressively be converted and - pushedontothe I/O layer.
                              6. -
                              7. It is possible that the converter code fails on some input, - forexampletrying to push an UTF-8 encoded Chinese character through - theUTF-8 toISO-8859-1 converter won't work. Since the encoders - areprogressive theywill just report the error and the number of - bytesconverted, at thatpoint libxml2 will decode the offending - character,remove it from thebuffer and replace it with the associated - charRefencoding &#123; andresume the conversion. This guarantees that - anydocument will be savedwithout losses (except for markup names where - thisis not legal, this isa problem in the current version, in practice - avoidusing non-asciicharacters for tag or attribute names). A special - "ascii"encoding nameis used to save documents to a pure ascii form can be - usedwhenportability is really crucial
                              8. +
                              9. so if an encoding was specified, either at the API level or on the + document, libxml2 will again canonicalize the encoding name, lookup for a + converter in the registered set or through iconv. If not found the + function will return an error code
                              10. +
                              11. the converter is placed before the I/O buffer layer, as another kind of + buffer, then libxml2 will simply push the UTF-8 serialization to through + that buffer, which will then progressively be converted and pushed onto + the I/O layer.
                              12. +
                              13. It is possible that the converter code fails on some input, for example + trying to push an UTF-8 encoded Chinese character through the UTF-8 to + ISO-8859-1 converter won't work. Since the encoders are progressive they + will just report the error and the number of bytes converted, at that + point libxml2 will decode the offending character, remove it from the + buffer and replace it with the associated charRef encoding &#123; and + resume the conversion. This guarantees that any document will be saved + without losses (except for markup names where this is not legal, this is + a problem in the current version, in practice avoid using non-ascii + characters for tag or attribute names). A special "ascii" encoding name + is used to save documents to a pure ascii form can be used when + portability is really crucial

                              Here are a few examples based on the same test document:

                              ~/XML -> ./xmllint isolat1 
                               <?xml version="1.0" encoding="ISO-8859-1"?>
                               <très>là</très>
                               ~/XML -> ./xmllint --encode UTF-8 isolat1 
                               <?xml version="1.0" encoding="UTF-8"?>
                               <très>là  </très>
                              -~/XML -> 

                              The same processing is applied (and reuse most of the code) for -HTMLI18Nprocessing. Looking up and modifying the content encoding is a -bitmoredifficult since it is located in a <meta> tag under -the<head>,so a couple of functions htmlGetMetaEncoding() -andhtmlSetMetaEncoding() havebeen provided. The parser also attempts to -switchencoding on the fly whendetecting such a tag on input. Except for that -theprocessing is the same(and again reuses the same code).

                              Default supported encodings

                              libxml2 has a set of default converters for the followingencodings(located -in encoding.c):

                              1. UTF-8 is supported by default (null handlers)
                              2. +~/XML ->

                            The same processing is applied (and reuse most of the code) for HTML I18N +processing. Looking up and modifying the content encoding is a bit more +difficult since it is located in a <meta> tag under the <head>, +so a couple of functions htmlGetMetaEncoding() and htmlSetMetaEncoding() have +been provided. The parser also attempts to switch encoding on the fly when +detecting such a tag on input. Except for that the processing is the same +(and again reuses the same code).

                            Default supported encodings

                            libxml2 has a set of default converters for the following encodings +(located in encoding.c):

                            1. UTF-8 is supported by default (null handlers)
                            2. UTF-16, both little and big endian
                            3. ISO-Latin-1 (ISO-8859-1) covering most western languages
                            4. ASCII, useful mostly for saving
                            5. -
                            6. HTML, a specific handler for the conversion of UTF-8 to ASCII - withHTMLpredefined entities like &copy; for the Copyright sign.
                            7. -

                            More over when compiled on an Unix platform with iconv support the -fullsetof encodings supported by iconv can be instantly be used by libxml. On -alinuxmachine with glibc-2.1 the list of supported encodings and aliases -fill3 fullpages, and include UCS-4, the full set of ISO-Latin encodings, and -thevariousJapanese ones.

                            To convert from the UTF-8 values returned from the API to -anotherencodingthen it is possible to use the function provided from the encoding modulelike UTF8Toisolat1, or -usethePOSIX iconv()APIdirectly.

                            Encoding aliases

                            From 2.2.3, libxml2 has support to register encoding names aliases.Thegoal -is to be able to parse document whose encoding is supported butwherethe name -differs (for example from the default set of names acceptedbyiconv). The -following functions allow to register and handle new aliasesforexisting -encodings. Once registered libxml2 will automatically lookupthealiases when -handling a document:

                            • int xmlAddEncodingAlias(const char *name, const char *alias);
                            • +
                            • HTML, a specific handler for the conversion of UTF-8 to ASCII with HTML + predefined entities like &copy; for the Copyright sign.
                            • +

                              More over when compiled on an Unix platform with iconv support the full +set of encodings supported by iconv can be instantly be used by libxml. On a +linux machine with glibc-2.1 the list of supported encodings and aliases fill +3 full pages, and include UCS-4, the full set of ISO-Latin encodings, and the +various Japanese ones.

                              To convert from the UTF-8 values returned from the API to another encoding +then it is possible to use the function provided from the encoding module like UTF8Toisolat1, or use the +POSIX iconv() +API directly.

                              Encoding aliases

                              From 2.2.3, libxml2 has support to register encoding names aliases. The +goal is to be able to parse document whose encoding is supported but where +the name differs (for example from the default set of names accepted by +iconv). The following functions allow to register and handle new aliases for +existing encodings. Once registered libxml2 will automatically lookup the +aliases when handling a document:

                              • int xmlAddEncodingAlias(const char *name, const char *alias);
                              • int xmlDelEncodingAlias(const char *alias);
                              • const char * xmlGetEncodingAlias(const char *alias);
                              • void xmlCleanupEncodingAliases(void);
                              • -

                              How to extend the existing support

                              Well adding support for new encoding, or overriding one of -theencoders(assuming it is buggy) should not be hard, just write input -andoutputconversion routines to/from UTF-8, and register -themusingxmlNewCharEncodingHandler(name, xxxToUTF8, UTF8Toxxx), and they -willbecalled automatically if the parser(s) encounter such an -encodingname(register it uppercase, this will help). The description of -theencoders,their arguments and expected return values are described in -theencoding.hheader.

                              Daniel Veillard

                            +

                            How to extend the existing support

                            Well adding support for new encoding, or overriding one of the encoders +(assuming it is buggy) should not be hard, just write input and output +conversion routines to/from UTF-8, and register them using +xmlNewCharEncodingHandler(name, xxxToUTF8, UTF8Toxxx), and they will be +called automatically if the parser(s) encounter such an encoding name +(register it uppercase, this will help). The description of the encoders, +their arguments and expected return values are described in the encoding.h +header.

                            Daniel Veillard

                          diff --git a/doc/entities.html b/doc/entities.html index 732562a..c234b41 100644 --- a/doc/entities.html +++ b/doc/entities.html @@ -7,35 +7,34 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Entities or no entities
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          Entities or no entities

                          Developer Menu
                          API Indexes
                          Related links

                          Entities in principle are similar to simple C macros. An entity -definesanabbreviation for a given string that you can reuse many times -throughoutthecontent of your document. Entities are especially useful when a -givenstringmay occur frequently within a document, or to confine the change -neededto adocument to a restricted area in the internal subset of the -document (atthebeginning). Example:

                          1 <?xml version="1.0"?>
                          +Entities or no entities
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          Entities or no entities

                          Developer Menu
                          API Indexes
                          Related links

                          Entities in principle are similar to simple C macros. An entity defines an +abbreviation for a given string that you can reuse many times throughout the +content of your document. Entities are especially useful when a given string +may occur frequently within a document, or to confine the change needed to a +document to a restricted area in the internal subset of the document (at the +beginning). Example:

                          1 <?xml version="1.0"?>
                           2 <!DOCTYPE EXAMPLE SYSTEM "example.dtd" [
                           3 <!ENTITY xml "Extensible Markup Language">
                           4 ]>
                           5 <EXAMPLE>
                           6    &xml;
                          -7 </EXAMPLE>

                          Line 3 declares the xml entity. Line 6 uses the xml entity, byprefixingits -name with '&' and following it by ';' without any spacesadded. Thereare 5 -predefined entities in libxml2 allowing you to escapecharacters -withpredefined meaning in some parts of the xml -documentcontent:&lt;for the character -'<',&gt;for the character -'>',&apos;for the -character''',&quot;for the character -'"',and&amp;for the character '&'.

                          One of the problems related to entities is that you may want the -parsertosubstitute an entity's content so that you can see the replacement -textinyour application. Or you may prefer to keep entity references as such -inthecontent to be able to save the document back without losing -thisusuallyprecious information (if the user went through the pain -ofexplicitlydefining entities, he may have a a rather negative attitude if -youblindlysubstitute them as saving time). The xmlSubstituteEntitiesDefault()functionallows -you to check and change the behaviour, which is to notsubstituteentities by -default.

                          Here is the DOM tree built by libxml2 for the previous document -inthedefault case:

                          /gnome/src/gnome-xml -> ./xmllint --debug test/ent1
                          +7 </EXAMPLE>

                          Line 3 declares the xml entity. Line 6 uses the xml entity, by prefixing +its name with '&' and following it by ';' without any spaces added. There +are 5 predefined entities in libxml2 allowing you to escape characters with +predefined meaning in some parts of the xml document content: +&lt; for the character '<', &gt; +for the character '>', &apos; for the character ''', +&quot; for the character '"', and +&amp; for the character '&'.

                          One of the problems related to entities is that you may want the parser to +substitute an entity's content so that you can see the replacement text in +your application. Or you may prefer to keep entity references as such in the +content to be able to save the document back without losing this usually +precious information (if the user went through the pain of explicitly +defining entities, he may have a a rather negative attitude if you blindly +substitute them as saving time). The xmlSubstituteEntitiesDefault() +function allows you to check and change the behaviour, which is to not +substitute entities by default.

                          Here is the DOM tree built by libxml2 for the previous document in the +default case:

                          /gnome/src/gnome-xml -> ./xmllint --debug test/ent1
                           DOCUMENT
                           version=1.0
                              ELEMENT EXAMPLE
                          @@ -50,17 +49,16 @@ DOCUMENT
                           version=1.0
                              ELEMENT EXAMPLE
                                TEXT
                          -     content=     Extensible Markup Language

                          So, entities or no entities? Basically, it depends on your use -case.Isuggest that you keep the non-substituting default behaviour and -avoidusingentities in your XML document or data if you are not willing to -handletheentity references elements in the DOM tree.

                          Note that at save time libxml2 enforces the conversion of -thepredefinedentities where necessary to prevent well-formedness problems, -andwill alsotransparently replace those with chars (i.e. it will not -generateentityreference elements in the DOM tree or call the reference() SAX -callbackwhenfinding them in the input).

                          WARNING: handlingentitieson -top of the libxml2 SAX interface is difficult!!! If you plan -tousenon-predefined entities in your documents, then the learning curve -tohandlethen using the SAX API may be long. If you plan to use -complexdocuments, Istrongly suggest you consider using the DOM interface -instead andlet libxmldeal with the complexity rather than trying to do it -yourself.

                          Daniel Veillard

                          + content= Extensible Markup Language

                          So, entities or no entities? Basically, it depends on your use case. I +suggest that you keep the non-substituting default behaviour and avoid using +entities in your XML document or data if you are not willing to handle the +entity references elements in the DOM tree.

                          Note that at save time libxml2 enforces the conversion of the predefined +entities where necessary to prevent well-formedness problems, and will also +transparently replace those with chars (i.e. it will not generate entity +reference elements in the DOM tree or call the reference() SAX callback when +finding them in the input).

                          WARNING: handling entities +on top of the libxml2 SAX interface is difficult!!! If you plan to use +non-predefined entities in your documents, then the learning curve to handle +then using the SAX API may be long. If you plan to use complex documents, I +strongly suggest you consider using the DOM interface instead and let libxml +deal with the complexity rather than trying to do it yourself.

                          Daniel Veillard

                          diff --git a/doc/example.html b/doc/example.html index 194f619..894f03a 100644 --- a/doc/example.html +++ b/doc/example.html @@ -7,11 +7,11 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -A real example
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          A real example

                          Developer Menu
                          API Indexes
                          Related links

                          Here is a real size example, where the actual content of -theapplicationdata is not kept in the DOM tree but uses internal structures. -Itis based ona proposal to keep a database of jobs related to Gnome, with -anXML basedstorage structure. Here is an XML -encodedjobsbase:

                          <?xml version="1.0"?>
                          +A real example
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          A real example

                          Developer Menu
                          API Indexes
                          Related links

                          Here is a real size example, where the actual content of the application +data is not kept in the DOM tree but uses internal structures. It is based on +a proposal to keep a database of jobs related to Gnome, with an XML based +storage structure. Here is an XML encoded jobs +base:

                          <?xml version="1.0"?>
                           <gjob:Helping xmlns:gjob="http://www.gnome.org/some-location">
                             <gjob:Jobs>
                           
                          @@ -66,14 +66,13 @@ encodedjobsbase:

                          <?xml version="1.0"?>
                               </gjob:Job>
                           
                             </gjob:Jobs>
                          -</gjob:Helping>

                          While loading the XML file into an internal DOM tree is a matter -ofcallingonly a couple of functions, browsing the tree to gather the data -andgeneratethe internal structures is harder, and more error prone.

                          The suggested principle is to be tolerant with respect to -theinputstructure. For example, the ordering of the attributes is -notsignificant,the XML specification is clear about it. It's also usually a -goodidea not todepend on the order of the children of a given node, unless -itreally makesthings harder. Here is some code to parse the information for -aperson:

                          /*
                          +</gjob:Helping>

                          While loading the XML file into an internal DOM tree is a matter of +calling only a couple of functions, browsing the tree to gather the data and +generate the internal structures is harder, and more error prone.

                          The suggested principle is to be tolerant with respect to the input +structure. For example, the ordering of the attributes is not significant, +the XML specification is clear about it. It's also usually a good idea not to +depend on the order of the children of a given node, unless it really makes +things harder. Here is some code to parse the information for a person:

                          /*
                            * A person record
                            */
                           typedef struct person {
                          @@ -114,22 +113,21 @@ DEBUG("parsePerson\n");
                               }
                           
                               return(ret);
                          -}

                          Here are a couple of things to notice:

                          • Usually a recursive parsing style is the more convenient one: XMLdatais - by nature subject to repetitive constructs and usually - exhibitshighlystructured patterns.
                          • -
                          • The two arguments of type xmlDocPtrand - xmlNsPtr,i.e.the pointer to the global XML document and the - namespace reserved totheapplication. Document wide information are needed - for example todecodeentities and it's a good coding practice to define a - namespace foryourapplication set of data and test that the element and - attributesyou'reanalyzing actually pertains to your application space. - This isdone by asimple equality test (cur->ns == ns).
                          • -
                          • To retrieve text and attributes value, you can use - thefunctionxmlNodeListGetStringto gather all the text and - entityreferencenodes generated by the DOM output and produce an single - textstring.
                          • -

                          Here is another piece of code used to parse another level -ofthestructure:

                          #include <libxml/tree.h>
                          +}

                          Here are a couple of things to notice:

                          • Usually a recursive parsing style is the more convenient one: XML data + is by nature subject to repetitive constructs and usually exhibits highly + structured patterns.
                          • +
                          • The two arguments of type xmlDocPtr and xmlNsPtr, + i.e. the pointer to the global XML document and the namespace reserved to + the application. Document wide information are needed for example to + decode entities and it's a good coding practice to define a namespace for + your application set of data and test that the element and attributes + you're analyzing actually pertains to your application space. This is + done by a simple equality test (cur->ns == ns).
                          • +
                          • To retrieve text and attributes value, you can use the function + xmlNodeListGetString to gather all the text and entity reference + nodes generated by the DOM output and produce an single text string.
                          • +

                          Here is another piece of code used to parse another level of the +structure:

                          #include <libxml/tree.h>
                           /*
                            * a Description for a Job
                            */
                          @@ -179,10 +177,10 @@ DEBUG("parseJob\n");
                               }
                           
                               return(ret);
                          -}

                          Once you are used to it, writing this kind of code is quite -simple,butboring. Ultimately, it could be possible to write stubbers taking -eitherCdata structure definitions, a set of XML examples or an XML DTD -andproducethe code needed to import and export the content between C data -andXMLstorage. This is left as an exercise to the reader :-)

                          Feel free to use the code for the -fullCparsing exampleas a template, it is also available with Makefile -intheGnome CVS base under gnome-xml/example

                          Daniel Veillard

                          +}

                          Once you are used to it, writing this kind of code is quite simple, but +boring. Ultimately, it could be possible to write stubbers taking either C +data structure definitions, a set of XML examples or an XML DTD and produce +the code needed to import and export the content between C data and XML +storage. This is left as an exercise to the reader :-)

                          Feel free to use the code for the full C +parsing example as a template, it is also available with Makefile in the +Gnome CVS base under gnome-xml/example

                          Daniel Veillard

                          diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 55a674d..cd9f4ef 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -9,6 +9,7 @@ examples.xml: index.py *.c -@($(srcdir)/index.py) index.html: examples.xml examples.xsl + -@(touch index.html) -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) install-data-local: diff --git a/doc/examples/Makefile.in b/doc/examples/Makefile.in index b0b4d33..f8af861 100644 --- a/doc/examples/Makefile.in +++ b/doc/examples/Makefile.in @@ -196,6 +196,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -224,6 +225,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -259,6 +261,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ @@ -696,6 +699,7 @@ examples.xml: index.py *.c -@($(srcdir)/index.py) index.html: examples.xml examples.xsl + -@(touch index.html) -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) install-data-local: diff --git a/doc/help.html b/doc/help.html index a660a87..5559007 100644 --- a/doc/help.html +++ b/doc/help.html @@ -7,17 +7,19 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -How to help
                          Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                          Made with Libxml2 Logo

                          The XML C parser and toolkit of Gnome

                          How to help

                          Main Menu
                          Related links

                          You can help the project in various ways, the best thing to do first -istosubscribe to the mailing-list as explained before, check the archives and the Gnomebugdatabase:

                          1. Provide patches when you find problems.
                          2. -
                          3. Provide the diffs when you port libxml2 to a new platform. They - maynotbe integrated in all cases but help pinpointing - portabilityproblemsand
                          4. -
                          5. Provide documentation fixes (either as patches to the code commentsoras - HTML diffs).
                          6. -
                          7. Provide new documentations pieces (translations, examples, etc...).
                          8. +How to help
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            How to help

                            Main Menu
                            Related links

                            You can help the project in various ways, the best thing to do first is to +subscribe to the mailing-list as explained before, check the archives and the Gnome bug +database:

                            1. Provide patches when you find problems.
                            2. +
                            3. Provide the diffs when you port libxml2 to a new platform. They may not + be integrated in all cases but help pinpointing portability problems + and
                            4. +
                            5. Provide documentation fixes (either as patches to the code comments or + as HTML diffs).
                            6. +
                            7. Provide new documentations pieces (translations, examples, etc + ...).
                            8. Check the TODO file and try to close one of the items.
                            9. -
                            10. Take one of the points raised in the archive or the bug - databaseandprovide a fix. Get in - touch withmebefore to avoid synchronization problems and check that - thesuggestedfix will fit in nicely :-)
                            11. +
                            12. Take one of the points raised in the archive or the bug database and + provide a fix. Get in touch with me + before to avoid synchronization problems and check that the suggested + fix will fit in nicely :-)

                            Daniel Veillard

                            diff --git a/doc/html/index.html b/doc/html/index.html deleted file mode 100644 index 4a4962a..0000000 --- a/doc/html/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - -Reference Manual for libxml2
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            Reference Manual for libxml2

                            API Menu
                            API Indexes
                            Related links

                            Table of Contents

                            • DOCBparser: old DocBook SGML parser
                            • HTMLparser: interface for an HTML 4.0 non-verifying parser
                            • HTMLtree: specific APIs to process HTML tree, especially serialization
                            • SAX: Old SAX version 1 handler, deprecated
                            • SAX2: SAX2 parser interface used to build the DOM tree
                            • c14n: Provide Canonical XML and Exclusive XML Canonicalization
                            • catalog: interfaces to the Catalog handling system
                            • chvalid: Unicode character range checking
                            • debugXML: Tree debugging APIs
                            • dict: string dictionnary
                            • encoding: interface for the encoding conversion functions
                            • entities: interface for the XML entities handling
                            • globals: interface for all global variables of the library
                            • hash: Chained hash tables
                            • list: lists interfaces
                            • nanoftp: minimal FTP implementation
                            • nanohttp: minimal HTTP implementation
                            • parser: the core parser module
                            • parserInternals: internals routines exported by the parser.
                            • pattern: pattern expression handling
                            • relaxng: implementation of the Relax-NG validation
                            • schemasInternals: internal interfaces for XML Schemas
                            • schematron: XML Schemastron implementation
                            • threads: interfaces for thread handling
                            • tree: interfaces for tree manipulation
                            • uri: library of generic URI related routines
                            • valid: The DTD validation
                            • xinclude: implementation of XInclude
                            • xlink: unfinished XLink detection module
                            • xmlIO: interface for the I/O interfaces used by the parser
                            • xmlautomata: API to build regexp automata
                            • xmlerror: error handling
                            • xmlexports: macros for marking symbols as exportable/importable.
                            • xmlmemory: interface for the memory allocator
                            • xmlmodule: dynamic module loading
                            • xmlreader: the XMLReader implementation
                            • xmlregexp: regular expressions handling
                            • xmlsave: the XML document serializer
                            • xmlschemas: incomplete XML Schemas structure implementation
                            • xmlschemastypes: implementation of XML Schema Datatypes
                            • xmlstring: set of routines to process strings
                            • xmlunicode: Unicode character APIs
                            • xmlversion: compile-time version informations
                            • xmlwriter: text writing API for XML
                            • xpath: XML Path Language implementation
                            • xpathInternals: internal interfaces for XML Path Language implementation
                            • xpointer: API to handle XML Pointers

                            Daniel Veillard

                            diff --git a/doc/html/libxml-HTMLparser.html b/doc/html/libxml-HTMLparser.html index adc6875..694a08f 100644 --- a/doc/html/libxml-HTMLparser.html +++ b/doc/html/libxml-HTMLparser.html @@ -46,6 +46,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                            int	htmlHandleOmittedElem		(int val)
                            int	htmlIsAutoClosed		(htmlDocPtr doc, 
                            htmlNodePtr elem)
                            int	htmlIsScriptAttribute		(const xmlChar * name)
                            +
                            htmlParserCtxtPtr	htmlNewParserCtxt	(void)
                            htmlStatus	htmlNodeStatus		(const htmlNodePtr node, 
                            int legacy)
                            int	htmlParseCharRef		(htmlParserCtxtPtr ctxt)
                            int	htmlParseChunk			(htmlParserCtxtPtr ctxt, 
                            const char * chunk,
                            int size,
                            int terminate)
                            @@ -143,7 +144,9 @@ A:link, A:visited, A:active { text-decoration: underline }

                            The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it's child

                            doc:the HTML document
                            elem:the HTML element
                            Returns:1 if autoclosed, 0 otherwise

                            Function: htmlIsScriptAttribute

                            int	htmlIsScriptAttribute		(const xmlChar * name)

                            Check if an attribute is of content type Script

                            -
                            name:an attribute name
                            Returns:1 is the attribute is a script 0 otherwise

                            Function: htmlNodeStatus

                            htmlStatus	htmlNodeStatus		(const htmlNodePtr node, 
                            int legacy)
                            +
                            name:an attribute name
                            Returns:1 is the attribute is a script 0 otherwise

                            Function: htmlNewParserCtxt

                            htmlParserCtxtPtr	htmlNewParserCtxt	(void)
                            +

                            Allocate and initialize a new parser context.

                            +
                            Returns:the htmlParserCtxtPtr or NULL in case of allocation error

                            Function: htmlNodeStatus

                            htmlStatus	htmlNodeStatus		(const htmlNodePtr node, 
                            int legacy)

                            Checks whether the tree node is valid. Experimental (the author only uses the HTML enhancements in a SAX parser)

                            node:an htmlNodePtr in a tree
                            legacy:whether to allow deprecated elements (YES is faster here for Element nodes)
                            Returns:for Element nodes, a return from htmlElementAllowedHere (if legacy allowed) or htmlElementStatusHere (otherwise). for Attribute nodes, a return from htmlAttrAllowed for other nodes, HTML_NA (no checks performed)

                            Function: htmlParseCharRef

                            int	htmlParseCharRef		(htmlParserCtxtPtr ctxt)

                            parse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'

                            diff --git a/doc/html/libxml-parser.html b/doc/html/libxml-parser.html index 438500b..b0849cf 100644 --- a/doc/html/libxml-parser.html +++ b/doc/html/libxml-parser.html @@ -223,6 +223,7 @@ void xmlParserInputDeallocate (XML_WITH_DEBUG = 28 XML_WITH_DEBUG_MEM = 29 XML_WITH_DEBUG_RUN = 30 + XML_WITH_ZLIB = 31 XML_WITH_NONE = 99999 : just to be sure of allocation size }

                            Enum xmlParserInputState

                            Enum xmlParserInputState {
                            @@ -280,7 +281,7 @@ void	xmlParserInputDeallocate	(XML_PARSE_NSCLEAN = 8192 : remove redundant namespaces declarations
                                 XML_PARSE_NOCDATA = 16384 : merge CDATA as text nodes
                                 XML_PARSE_NOXINCNODE = 32768 : do not generate XINCLUDE START/END nodes
                            -    XML_PARSE_COMPACT = 65536 : compact small text nodes
                            +    XML_PARSE_COMPACT = 65536 : compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree)
                             }
                             

                            Structure xmlSAXHandlerV1

                            Structure xmlSAXHandlerV1
                            struct _xmlSAXHandlerV1 { internalSubsetSAXFunc internalSubset @@ -446,7 +447,7 @@ void warningSAXFunc (void * ctx,
                            const char * msg,
                            ...

                            Examines if the library has been compiled with a given feature.

                            feature:the feature to be examined
                            Returns:a non-zero value if the feature exist, otherwise zero. Returns zero (0) if the feature does not exist or an unknown unknown feature is requested, non-zero otherwise.

                            Function: xmlIOParseDTD

                            xmlDtdPtr	xmlIOParseDTD		(xmlSAXHandlerPtr sax, 
                            xmlParserInputBufferPtr input,
                            xmlCharEncoding enc)

                            Load and parse a DTD

                            -
                            sax:the SAX handler block or NULL
                            input:an Input Buffer
                            enc:the charset encoding if known
                            Returns:the resulting xmlDtdPtr or NULL in case of error. @input will be freed at parsing end.

                            Function: xmlInitNodeInfoSeq

                            void	xmlInitNodeInfoSeq		(xmlParserNodeInfoSeqPtr seq)
                            +
                            sax:the SAX handler block or NULL
                            input:an Input Buffer
                            enc:the charset encoding if known
                            Returns:the resulting xmlDtdPtr or NULL in case of error. @input will be freed by the function in any case.

                            Function: xmlInitNodeInfoSeq

                            void	xmlInitNodeInfoSeq		(xmlParserNodeInfoSeqPtr seq)

                            -- Initialize (set to initial state) node info sequence

                            seq:a node info sequence pointer

                            Function: xmlInitParser

                            void	xmlInitParser			(void)

                            Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.

                            diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html index 9e45be1..26ec73b 100644 --- a/doc/html/libxml-tree.html +++ b/doc/html/libxml-tree.html @@ -95,6 +95,9 @@ A:link, A:visited, A:active { text-decoration: underline }
                            xmlAttrPtr	xmlCopyProp		(xmlNodePtr target, 
                            xmlAttrPtr cur)
                            xmlAttrPtr	xmlCopyPropList		(xmlNodePtr target, 
                            xmlAttrPtr cur)
                            xmlDtdPtr	xmlCreateIntSubset	(xmlDocPtr doc, 
                            const xmlChar * name,
                            const xmlChar * ExternalID,
                            const xmlChar * SystemID)
                            +
                            Function type: xmlDOMWrapAcquireNsFunction
                            +xmlNsPtr	xmlDOMWrapAcquireNsFunction	(xmlDOMWrapCtxtPtr ctxt, 
                            xmlNodePtr node,
                            const xmlChar * nsName,
                            const xmlChar * nsPrefix) +
                            int	xmlDOMWrapAdoptNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr sourceDoc,
                            xmlNodePtr node,
                            xmlDocPtr destDoc,
                            xmlNodePtr destParent,
                            int options)
                            int	xmlDOMWrapCloneNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr sourceDoc,
                            xmlNodePtr node,
                            xmlNodePtr * resNode,
                            xmlDocPtr destDoc,
                            xmlNodePtr destParent,
                            int deep,
                            int options)
                            void	xmlDOMWrapFreeCtxt		(xmlDOMWrapCtxtPtr ctxt)
                            @@ -280,7 +283,10 @@ A:link, A:visited, A:active { text-decoration: underline } XML_BUFFER_ALLOC_IMMUTABLE = 3 }

                            Structure xmlDOMWrapCtxt

                            Structure xmlDOMWrapCtxt
                            struct _xmlDOMWrapCtxt { - void * _private + void * _private : * The type of this context, just in case + int type : * Internal namespace map used for variou + void * namespaceMap : * Use this one to acquire an xmlNsPtr in + xmlDOMWrapAcquireNsFunction getNsForNodeFunc }

                            Structure xmlDoc

                            Structure xmlDoc
                            struct _xmlDoc { void * _private : application data xmlElementType type : XML_DOCUMENT_NODE, must be second ! @@ -406,6 +412,7 @@ A:link, A:visited, A:active { text-decoration: underline } struct _xmlEntity * nexte : unused const xmlChar * URI : the full URI as computed int owner : does the entity own the childrens + int checked : was the entity content checked }

                            Structure xmlEnumeration

                            Structure xmlEnumeration
                            struct _xmlEnumeration { struct _xmlEnumeration * next : next one const xmlChar * name : Enumeration name @@ -443,6 +450,7 @@ A:link, A:visited, A:active { text-decoration: underline } const xmlChar * href : URL for the namespace const xmlChar * prefix : prefix for the namespace void * _private : application data + struct _xmlDoc * context : normally an xmlDoc }

                            Structure xmlOutputBuffer

                            Structure xmlOutputBuffer
                            struct _xmlOutputBuffer { void * context xmlOutputWriteCallback writecallback @@ -674,18 +682,21 @@ A:link, A:visited, A:active { text-decoration: underline }

                            Do a copy of an attribute list.

                            target:the element where the attributes will be grafted
                            cur:the first attribute
                            Returns:a new #xmlAttrPtr, or NULL in case of error.

                            Function: xmlCreateIntSubset

                            xmlDtdPtr	xmlCreateIntSubset	(xmlDocPtr doc, 
                            const xmlChar * name,
                            const xmlChar * ExternalID,
                            const xmlChar * SystemID)

                            Create the internal subset of a document

                            -
                            doc:the document pointer
                            name:the DTD name
                            ExternalID:the external (PUBLIC) ID
                            SystemID:the system ID
                            Returns:a pointer to the new DTD structure

                            Function: xmlDOMWrapAdoptNode

                            int	xmlDOMWrapAdoptNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr sourceDoc,
                            xmlNodePtr node,
                            xmlDocPtr destDoc,
                            xmlNodePtr destParent,
                            int options)
                            -

                            References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state.

                            +
                            doc:the document pointer
                            name:the DTD name
                            ExternalID:the external (PUBLIC) ID
                            SystemID:the system ID
                            Returns:a pointer to the new DTD structure

                            Function type: xmlDOMWrapAcquireNsFunction

                            Function type: xmlDOMWrapAcquireNsFunction
                            +xmlNsPtr	xmlDOMWrapAcquireNsFunction	(xmlDOMWrapCtxtPtr ctxt, 
                            xmlNodePtr node,
                            const xmlChar * nsName,
                            const xmlChar * nsPrefix) +

                            A function called to acquire namespaces (xmlNs) from the wrapper.

                            ctxt:a DOM wrapper context
                            node:the context node (element or attribute)
                            nsName:the requested namespace name
                            nsPrefix:the requested namespace prefix
                            Returns:an xmlNsPtr or NULL in case of an error.

                            +

                            Function: xmlDOMWrapAdoptNode

                            int	xmlDOMWrapAdoptNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr sourceDoc,
                            xmlNodePtr node,
                            xmlDocPtr destDoc,
                            xmlNodePtr destParent,
                            int options)
                            +

                            References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.

                            ctxt:the optional context for custom processing
                            sourceDoc:the optional sourceDoc
                            node:the node to start with
                            destDoc:the destination doc
                            destParent:the optional new parent of @node in @destDoc
                            options:option flags
                            Returns:0 if the operation succeeded, 1 if a node of unsupported type was given, 2 if a node of not yet supported type was given and -1 on API/internal errors.

                            Function: xmlDOMWrapCloneNode

                            int	xmlDOMWrapCloneNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr sourceDoc,
                            xmlNodePtr node,
                            xmlNodePtr * resNode,
                            xmlDocPtr destDoc,
                            xmlNodePtr destParent,
                            int deep,
                            int options)
                            -

                            References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) Support dicts Optimize string adoption for equal or none dicts. 2) XInclude WARNING: This function is in a experimental state and should only be currently only be used to test it.

                            +

                            References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used. This is the case when you don't know already where the cloned branch will be added to. If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) What to do with XInclude? Currently this returns an error for XInclude.

                            ctxt:the optional context for custom processing
                            sourceDoc:the optional sourceDoc
                            node:the node to start with
                            resNode:the clone of the given @node
                            destDoc:the destination doc
                            destParent:the optional new parent of @node in @destDoc
                            deep:descend into child if set
                            options:option flags
                            Returns:0 if the operation succeeded, 1 if a node of unsupported (or not yet supported) type was given, -1 on API/internal errors.

                            Function: xmlDOMWrapFreeCtxt

                            void	xmlDOMWrapFreeCtxt		(xmlDOMWrapCtxtPtr ctxt)

                            Frees the DOM-wrapper context.

                            ctxt:the DOM-wrapper context

                            Function: xmlDOMWrapNewCtxt

                            xmlDOMWrapCtxtPtr	xmlDOMWrapNewCtxt	(void)

                            Allocates and initializes a new DOM-wrapper context.

                            Returns:the xmlDOMWrapCtxtPtr or NULL in case of an internal errror.

                            Function: xmlDOMWrapReconcileNamespaces

                            int	xmlDOMWrapReconcileNamespaces	(xmlDOMWrapCtxtPtr ctxt, 
                            xmlNodePtr elem,
                            int options)
                            -

                            Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state.

                            +

                            Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.

                            ctxt:DOM wrapper context, unused at the moment
                            elem:the element-node
                            options:option flags
                            Returns:0 if succeeded, -1 otherwise and on API/internal errors.

                            Function: xmlDOMWrapRemoveNode

                            int	xmlDOMWrapRemoveNode		(xmlDOMWrapCtxtPtr ctxt, 
                            xmlDocPtr doc,
                            xmlNodePtr node,
                            int options)
                            -

                            Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. WARNING: This function is in a experimental state.

                            +

                            Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. NOTE: This function was not intensively tested.

                            ctxt:a DOM wrapper context
                            doc:the doc
                            node:the node to be removed.
                            options:set of options, unused at the moment
                            Returns:0 on success, 1 if the node is not supported, -1 on API and internal errors.

                            Function: xmlDocCopyNode

                            xmlNodePtr	xmlDocCopyNode		(const xmlNodePtr node, 
                            xmlDocPtr doc,
                            int extended)

                            Do a copy of the node to a given document.

                            node:the node
                            doc:the document
                            extended:if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)
                            Returns:a new #xmlNodePtr, or NULL in case of error.

                            Function: xmlDocCopyNodeList

                            xmlNodePtr	xmlDocCopyNodeList	(xmlDocPtr doc, 
                            const xmlNodePtr node)
                            @@ -706,7 +717,7 @@ A:link, A:visited, A:active { text-decoration: underline }

                            Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).

                            doc:the document
                            Returns:the #xmlNodePtr for the root or NULL

                            Function: xmlDocSetRootElement

                            xmlNodePtr	xmlDocSetRootElement	(xmlDocPtr doc, 
                            xmlNodePtr root)

                            Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).

                            -
                            doc:the document
                            root:the new document root element
                            Returns:the old root element if any was found

                            Function: xmlElemDump

                            void	xmlElemDump			(FILE * f, 
                            xmlDocPtr doc,
                            xmlNodePtr cur)
                            +
                            doc:the document
                            root:the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead.
                            Returns:the old root element if any was found, NULL if root was NULL

                            Function: xmlElemDump

                            void	xmlElemDump			(FILE * f, 
                            xmlDocPtr doc,
                            xmlNodePtr cur)

                            Dump an XML/HTML node, recursive behaviour, children are printed too.

                            f:the FILE * for the output
                            doc:the document
                            cur:the current node

                            Function: xmlFreeDoc

                            void	xmlFreeDoc			(xmlDocPtr cur)

                            Free up all the structures used by a document, tree included.

                            diff --git a/doc/html/libxml-uri.html b/doc/html/libxml-uri.html index cb2a419..fa7ee19 100644 --- a/doc/html/libxml-uri.html +++ b/doc/html/libxml-uri.html @@ -21,6 +21,7 @@ A:link, A:visited, A:active { text-decoration: underline }
                            xmlURIPtr	xmlParseURI		(const char * str)
                            xmlURIPtr	xmlParseURIRaw		(const char * str, 
                            int raw)
                            int	xmlParseURIReference		(xmlURIPtr uri, 
                            const char * str)
                            +
                            xmlChar *	xmlPathToURI		(const xmlChar * path)
                            void	xmlPrintURI			(FILE * stream, 
                            xmlURIPtr uri)
                            xmlChar *	xmlSaveUri		(xmlURIPtr uri)
                            xmlChar *	xmlURIEscape		(const xmlChar * str)
                            @@ -56,7 +57,9 @@ A:link, A:visited, A:active { text-decoration: underline }

                            Parse an URI but allows to keep intact the original fragments. URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

                            str:the URI string to analyze
                            raw:if 1 unescaping of URI pieces are disabled
                            Returns:a newly built xmlURIPtr or NULL in case of error

                            Function: xmlParseURIReference

                            int	xmlParseURIReference		(xmlURIPtr uri, 
                            const char * str)

                            Parse an URI reference string and fills in the appropriate fields of the @uri structure URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

                            -
                            uri:pointer to an URI structure
                            str:the string to analyze
                            Returns:0 or the error code

                            Function: xmlPrintURI

                            void	xmlPrintURI			(FILE * stream, 
                            xmlURIPtr uri)
                            +
                            uri:pointer to an URI structure
                            str:the string to analyze
                            Returns:0 or the error code

                            Function: xmlPathToURI

                            xmlChar *	xmlPathToURI		(const xmlChar * path)
                            +

                            Constructs an URI expressing the existing path

                            +
                            path:the resource locator in a filesystem notation
                            Returns:a new URI, or a duplicate of the path parameter if the construction fails. The caller is responsible for freeing the memory occupied by the returned string. If there is insufficient memory available, or the argument is NULL, the function returns NULL.

                            Function: xmlPrintURI

                            void	xmlPrintURI			(FILE * stream, 
                            xmlURIPtr uri)

                            Prints the URI in the stream @stream.

                            stream:a FILE* for the output
                            uri:pointer to an xmlURI

                            Function: xmlSaveUri

                            xmlChar *	xmlSaveUri		(xmlURIPtr uri)

                            Save the URI as an escaped string

                            diff --git a/doc/html/libxml-xinclude.html b/doc/html/libxml-xinclude.html index 44771b9..58c1c19 100644 --- a/doc/html/libxml-xinclude.html +++ b/doc/html/libxml-xinclude.html @@ -17,6 +17,7 @@ The content of this structure is not made public by the API.
                            xmlXIncludeCtxtPtr	xmlXIncludeNewContext	(xmlDocPtr doc)
                            int	xmlXIncludeProcess		(xmlDocPtr doc)
                            int	xmlXIncludeProcessFlags		(xmlDocPtr doc, 
                            int flags)
                            +
                            int	xmlXIncludeProcessFlagsData	(xmlDocPtr doc, 
                            int flags,
                            void * data)
                            int	xmlXIncludeProcessNode		(xmlXIncludeCtxtPtr ctxt, 
                            xmlNodePtr node)
                            int	xmlXIncludeProcessTree		(xmlNodePtr tree)
                            int	xmlXIncludeProcessTreeFlags	(xmlNodePtr tree, 
                            int flags)
                            @@ -42,7 +43,9 @@ The content of this structure is not made public by the API.

                            Implement the XInclude substitution on the XML document @doc

                            doc:an XML document
                            Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                            Function: xmlXIncludeProcessFlags

                            int	xmlXIncludeProcessFlags		(xmlDocPtr doc, 
                            int flags)

                            Implement the XInclude substitution on the XML document @doc

                            -
                            doc:an XML document
                            flags:a set of xmlParserOption used for parsing XML includes
                            Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                            Function: xmlXIncludeProcessNode

                            int	xmlXIncludeProcessNode		(xmlXIncludeCtxtPtr ctxt, 
                            xmlNodePtr node)
                            +
                            doc:an XML document
                            flags:a set of xmlParserOption used for parsing XML includes
                            Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                            Function: xmlXIncludeProcessFlagsData

                            int	xmlXIncludeProcessFlagsData	(xmlDocPtr doc, 
                            int flags,
                            void * data)
                            +

                            Implement the XInclude substitution on the XML document @doc

                            +
                            doc:an XML document
                            flags:a set of xmlParserOption used for parsing XML includes
                            data:application data that will be passed to the parser context in the _private field of the parser context(s)
                            Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                            Function: xmlXIncludeProcessNode

                            int	xmlXIncludeProcessNode		(xmlXIncludeCtxtPtr ctxt, 
                            xmlNodePtr node)

                            Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.

                            ctxt:an existing XInclude context
                            node:a node in an XML document
                            Returns:0 if no substitution were done, -1 if some processing failed or the number of substitutions done.

                            Function: xmlXIncludeProcessTree

                            int	xmlXIncludeProcessTree		(xmlNodePtr tree)

                            Implement the XInclude substitution for the given subtree

                            diff --git a/doc/html/libxml-xmlsave.html b/doc/html/libxml-xmlsave.html index 664c6ef..d649ef7 100644 --- a/doc/html/libxml-xmlsave.html +++ b/doc/html/libxml-xmlsave.html @@ -53,4 +53,4 @@ The content of this structure is not made public by the API.

                            Create a document saving context serializing to a file descriptor with the encoding and the options given

                            iowrite:an I/O write function
                            ioclose:an I/O close function
                            ioctx:an I/O handler
                            encoding:the encoding name to use or NULL
                            options:a set of xmlSaveOptions
                            Returns:a new serialization context or NULL in case of error.

                            Function: xmlSaveTree

                            long	xmlSaveTree			(xmlSaveCtxtPtr ctxt, 
                            xmlNodePtr node)

                            Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead

                            -
                            ctxt:a document saving context
                            node:a document
                            Returns:the number of byte written or -1 in case of error

                            Daniel Veillard

                          +
                          ctxt:a document saving context
                          node:the top node of the subtree to save
                          Returns:the number of byte written or -1 in case of error

                          Daniel Veillard

                        diff --git a/doc/html/libxml-xmlversion.html b/doc/html/libxml-xmlversion.html index c27b701..3e9d50a 100644 --- a/doc/html/libxml-xmlversion.html +++ b/doc/html/libxml-xmlversion.html @@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline } Module xmlversion from libxml2
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        Module xmlversion from libxml2

                        API Menu
                        API Indexes
                        Related links

                        compile-time version informations for the XML library

                        Table of Contents

                        #define ATTRIBUTE_UNUSED
                        #define DEBUG_MEMORY_LOCATION
                        #define LIBXML_AUTOMATA_ENABLED
                        #define LIBXML_C14N_ENABLED
                        #define LIBXML_CATALOG_ENABLED
                        #define LIBXML_DEBUG_ENABLED
                        #define LIBXML_DEBUG_RUNTIME
                        #define LIBXML_DOCB_ENABLED
                        #define LIBXML_DOTTED_VERSION
                        #define LIBXML_EXPR_ENABLED
                        #define LIBXML_FTP_ENABLED
                        #define LIBXML_HTML_ENABLED
                        #define LIBXML_HTTP_ENABLED
                        #define LIBXML_ICONV_ENABLED
                        #define LIBXML_ISO8859X_ENABLED
                        #define LIBXML_LEGACY_ENABLED
                        #define LIBXML_MODULES_ENABLED
                        #define LIBXML_MODULE_EXTENSION
                        #define LIBXML_OUTPUT_ENABLED
                        #define LIBXML_PATTERN_ENABLED
                        #define LIBXML_PUSH_ENABLED
                        #define LIBXML_READER_ENABLED
                        #define LIBXML_REGEXP_ENABLED
                        #define LIBXML_SAX1_ENABLED
                        #define LIBXML_SCHEMAS_ENABLED
                        #define LIBXML_SCHEMATRON_ENABLED
                        #define LIBXML_TEST_VERSION
                        #define LIBXML_THREAD_ENABLED
                        #define LIBXML_TREE_ENABLED
                        #define LIBXML_UNICODE_ENABLED
                        #define LIBXML_VALID_ENABLED
                        #define LIBXML_VERSION
                        #define LIBXML_VERSION_EXTRA
                        #define LIBXML_VERSION_STRING
                        #define LIBXML_WRITER_ENABLED
                        #define LIBXML_XINCLUDE_ENABLED
                        #define LIBXML_XPATH_ENABLED
                        #define LIBXML_XPTR_ENABLED
                        #define WITHOUT_TRIO
                        #define WITH_TRIO
                        void	xmlCheckVersion			(int version)
                        + Module xmlversion from libxml2
                        Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                        Made with Libxml2 Logo

                        Module xmlversion from libxml2

                        API Menu
                        API Indexes
                        Related links

                        compile-time version informations for the XML library

                        Table of Contents

                        #define ATTRIBUTE_UNUSED
                        #define DEBUG_MEMORY_LOCATION
                        #define LIBXML_AUTOMATA_ENABLED
                        #define LIBXML_C14N_ENABLED
                        #define LIBXML_CATALOG_ENABLED
                        #define LIBXML_DEBUG_ENABLED
                        #define LIBXML_DEBUG_RUNTIME
                        #define LIBXML_DOCB_ENABLED
                        #define LIBXML_DOTTED_VERSION
                        #define LIBXML_EXPR_ENABLED
                        #define LIBXML_FTP_ENABLED
                        #define LIBXML_HTML_ENABLED
                        #define LIBXML_HTTP_ENABLED
                        #define LIBXML_ICONV_ENABLED
                        #define LIBXML_ISO8859X_ENABLED
                        #define LIBXML_LEGACY_ENABLED
                        #define LIBXML_MODULES_ENABLED
                        #define LIBXML_MODULE_EXTENSION
                        #define LIBXML_OUTPUT_ENABLED
                        #define LIBXML_PATTERN_ENABLED
                        #define LIBXML_PUSH_ENABLED
                        #define LIBXML_READER_ENABLED
                        #define LIBXML_REGEXP_ENABLED
                        #define LIBXML_SAX1_ENABLED
                        #define LIBXML_SCHEMAS_ENABLED
                        #define LIBXML_SCHEMATRON_ENABLED
                        #define LIBXML_TEST_VERSION
                        #define LIBXML_THREAD_ENABLED
                        #define LIBXML_TREE_ENABLED
                        #define LIBXML_UNICODE_ENABLED
                        #define LIBXML_VALID_ENABLED
                        #define LIBXML_VERSION
                        #define LIBXML_VERSION_EXTRA
                        #define LIBXML_VERSION_STRING
                        #define LIBXML_WRITER_ENABLED
                        #define LIBXML_XINCLUDE_ENABLED
                        #define LIBXML_XPATH_ENABLED
                        #define LIBXML_XPTR_ENABLED
                        #define LIBXML_ZLIB_ENABLED
                        #define WITHOUT_TRIO
                        #define WITH_TRIO
                        void	xmlCheckVersion			(int version)

                        Description

                        Macro: ATTRIBUTE_UNUSED

                        #define ATTRIBUTE_UNUSED

                        Macro used to signal to GCC unused function parameters

                        Macro: DEBUG_MEMORY_LOCATION

                        #define DEBUG_MEMORY_LOCATION

                        Whether the memory debugging is configured in

                        @@ -43,13 +43,14 @@ A:link, A:visited, A:active { text-decoration: underline }

                        Macro: LIBXML_TREE_ENABLED

                        #define LIBXML_TREE_ENABLED

                        Whether the DOM like tree manipulation API support is configured in

                        Macro: LIBXML_UNICODE_ENABLED

                        #define LIBXML_UNICODE_ENABLED

                        Whether the Unicode related interfaces are compiled in

                        Macro: LIBXML_VALID_ENABLED

                        #define LIBXML_VALID_ENABLED

                        Whether the DTD validation support is configured in

                        -

                        Macro: LIBXML_VERSION

                        #define LIBXML_VERSION

                        the version number: 1.2.3 value is 1002003

                        +

                        Macro: LIBXML_VERSION

                        #define LIBXML_VERSION

                        the version number: 1.2.3 value is 10203

                        Macro: LIBXML_VERSION_EXTRA

                        #define LIBXML_VERSION_EXTRA

                        extra version information, used to show a CVS compilation

                        -

                        Macro: LIBXML_VERSION_STRING

                        #define LIBXML_VERSION_STRING

                        the version number string, 1.2.3 value is "1002003"

                        +

                        Macro: LIBXML_VERSION_STRING

                        #define LIBXML_VERSION_STRING

                        the version number string, 1.2.3 value is "10203"

                        Macro: LIBXML_WRITER_ENABLED

                        #define LIBXML_WRITER_ENABLED

                        Whether the xmlWriter saving interface is configured in

                        Macro: LIBXML_XINCLUDE_ENABLED

                        #define LIBXML_XINCLUDE_ENABLED

                        Whether XInclude is configured in

                        Macro: LIBXML_XPATH_ENABLED

                        #define LIBXML_XPATH_ENABLED

                        Whether XPath is configured in

                        Macro: LIBXML_XPTR_ENABLED

                        #define LIBXML_XPTR_ENABLED

                        Whether XPointer is configured in

                        +

                        Macro: LIBXML_ZLIB_ENABLED

                        #define LIBXML_ZLIB_ENABLED

                        Whether the Zlib support is compiled in

                        Macro: WITHOUT_TRIO

                        #define WITHOUT_TRIO

                        defined if the trio support should not be configured in

                        Macro: WITH_TRIO

                        #define WITH_TRIO

                        defined if the trio support need to be configured in

                        Function: xmlCheckVersion

                        void	xmlCheckVersion			(int version)
                        diff --git a/doc/html/libxml-xpath.html b/doc/html/libxml-xpath.html index a0d9ba7..6aca3c3 100644 --- a/doc/html/libxml-xpath.html +++ b/doc/html/libxml-xpath.html @@ -51,6 +51,7 @@ The content of this structure is not made public by the API.
                        int	xmlXPathCmpNodes		(xmlNodePtr node1, 
                        xmlNodePtr node2)
                        xmlXPathCompExprPtr	xmlXPathCompile	(const xmlChar * str)
                        xmlXPathObjectPtr	xmlXPathCompiledEval	(xmlXPathCompExprPtr comp, 
                        xmlXPathContextPtr ctx)
                        +
                        int	xmlXPathCompiledEvalToBoolean	(xmlXPathCompExprPtr comp, 
                        xmlXPathContextPtr ctxt)
                        int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
                        int active,
                        int value,
                        int options)
                        xmlXPathObjectPtr	xmlXPathConvertBoolean	(xmlXPathObjectPtr val)
                        Function type: xmlXPathConvertFunc
                        @@ -240,13 +241,15 @@ The content of this structure is not made public by the API.
                         

                        Converts an XPath object to its number value

                        val:an XPath object
                        Returns:the number value

                        Function: xmlXPathCastToString

                        xmlChar *	xmlXPathCastToString	(xmlXPathObjectPtr val)

                        Converts an existing object to its string() equivalent

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

                        Function: xmlXPathCmpNodes

                        int	xmlXPathCmpNodes		(xmlNodePtr node1, 
                        xmlNodePtr node2)
                        +
                        val:an XPath object
                        Returns:the allocated string value of the object, NULL in case of error. It's up to the caller to free the string memory with xmlFree().

                        Function: xmlXPathCmpNodes

                        int	xmlXPathCmpNodes		(xmlNodePtr node1, 
                        xmlNodePtr node2)

                        Compare two nodes w.r.t document order

                        node1:the first node
                        node2:the second node
                        Returns:-2 in case of error 1 if first point < second point, 0 if it's the same node, -1 otherwise

                        Function: xmlXPathCompile

                        xmlXPathCompExprPtr	xmlXPathCompile	(const xmlChar * str)

                        Compile an XPath expression

                        str:the XPath expression
                        Returns:the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.

                        Function: xmlXPathCompiledEval

                        xmlXPathObjectPtr	xmlXPathCompiledEval	(xmlXPathCompExprPtr comp, 
                        xmlXPathContextPtr ctx)

                        Evaluate the Precompiled XPath expression in the given context.

                        -
                        comp:the compiled XPath expression
                        ctx:the XPath context
                        Returns:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

                        Function: xmlXPathContextSetCache

                        int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
                        int active,
                        int value,
                        int options)
                        +
                        comp:the compiled XPath expression
                        ctx:the XPath context
                        Returns:the xmlXPathObjectPtr resulting from the evaluation or NULL. the caller has to free the object.

                        Function: xmlXPathCompiledEvalToBoolean

                        int	xmlXPathCompiledEvalToBoolean	(xmlXPathCompExprPtr comp, 
                        xmlXPathContextPtr ctxt)
                        +

                        Applies the XPath boolean() function on the result of the given compiled expression.

                        +
                        comp:the compiled XPath expression
                        ctxt:the XPath context
                        Returns:1 if the expression evaluated to true, 0 if to false and -1 in API and internal errors.

                        Function: xmlXPathContextSetCache

                        int	xmlXPathContextSetCache		(xmlXPathContextPtr ctxt, 
                        int active,
                        int value,
                        int options)

                        Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect.

                        ctxt:the XPath context
                        active:enables/disables (creates/frees) the cache
                        value:a value with semantics dependant on @options
                        options:options (currently only the value 0 is used)
                        Returns:0 if the setting succeeded, and -1 on API or internal errors.

                        Function: xmlXPathConvertBoolean

                        xmlXPathObjectPtr	xmlXPathConvertBoolean	(xmlXPathObjectPtr val)

                        Converts an existing object to its boolean() equivalent

                        diff --git a/doc/index.html b/doc/index.html index 22f013b..21d61eb 100644 --- a/doc/index.html +++ b/doc/index.html @@ -216,73 +216,74 @@ A:link, A:visited, A:active { text-decoration: underline }

                        -

                        "Programmingwithlibxml2 -is like the thrilling embrace of an exotic stranger." MarkPilgrim

                        -

                        Libxml2 is the XML C parser and toolkit developed for the Gnomeproject(but -usable outside of the Gnome platform), it is free softwareavailableunder the -MITLicense.XML -itself is a metalanguage to design markup languages, i.e.text languagewhere -semantic and structure are added to the content usingextra -"markup"information enclosed between angle brackets. HTML is the -mostwell-knownmarkup language. Though the library is written in C avariety of language bindingsmake it available inother -environments.

                        -

                        Libxml2 is known to be very portable, the library should build -andworkwithout serious troubles on a variety of systems (Linux, -Unix,Windows,CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, ...)

                        -

                        Libxml2 implements a number of existing standards related -tomarkuplanguages:

                        +

                        "Programming +with libxml2 is like the thrilling embrace of an exotic stranger." Mark +Pilgrim

                        +

                        Libxml2 is the XML C parser and toolkit developed for the Gnome project +(but usable outside of the Gnome platform), it is free software available +under the MIT +License. XML itself is a metalanguage to design markup languages, i.e. +text language where semantic and structure are added to the content using +extra "markup" information enclosed between angle brackets. HTML is the most +well-known markup language. Though the library is written in C a variety of language bindings make it available in +other environments.

                        +

                        Libxml2 is known to be very portable, the library should build and work +without serious troubles on a variety of systems (Linux, Unix, Windows, +CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, ...)

                        +

                        Libxml2 implements a number of existing standards related to markup +languages:

                        -

                        In most cases libxml2 tries to implement the specifications in -arelativelystrictly compliant way. As of release 2.4.16, libxml2 passed -all1800+ testsfrom the OASIS -XMLTestsSuite.

                        -

                        To some extent libxml2 provides support for the -followingadditionalspecifications but doesn't claim to implement them -completely:

                        -
                        • Document Object Model (DOM) http://www.w3.org/TR/DOM-Level-2-Core/thedocument - model, but it doesn't implement the API itself, gdome2 doesthison top of - libxml2
                        • -
                        • RFC959:libxml2 - implements a basic FTP client code
                        • -
                        • RFC1945:HTTP/1.0, - again a basic HTTP client code
                        • -
                        • SAX: a SAX2 like interface and a minimal SAX1 - implementationcompatiblewith early expat versions
                        • +

                          In most cases libxml2 tries to implement the specifications in a +relatively strictly compliant way. As of release 2.4.16, libxml2 passed all +1800+ tests from the OASIS XML Tests +Suite.

                          +

                          To some extent libxml2 provides support for the following additional +specifications but doesn't claim to implement them completely:

                          +
                          • Document Object Model (DOM) http://www.w3.org/TR/DOM-Level-2-Core/ + the document model, but it doesn't implement the API itself, gdome2 does + this on top of libxml2
                          • +
                          • RFC 959 : + libxml2 implements a basic FTP client code
                          • +
                          • RFC 1945 : + HTTP/1.0, again a basic HTTP client code
                          • +
                          • SAX: a SAX2 like interface and a minimal SAX1 implementation compatible + with early expat versions
                          -

                          A partial implementation of XML Schemas -Part1:Structureis being worked on but it would be far too early to -makeanyconformance statement about it at the moment.

                          +

                          A partial implementation of XML Schemas Part +1: Structure is being worked on but it would be far too early to make any +conformance statement about it at the moment.

                          Separate documents:

                          -
                          • the libxslt - pageprovidinganimplementation of XSLT 1.0 and common extensions like - EXSLTforlibxml2
                          • -
                          • the gdome2 - page:a standard DOM2 implementation for libxml2
                          • -
                          • the XMLSec - page:animplementation of W3CXMLDigital Signaturefor - libxml2
                          • -
                          • also check the related links section below for more related - andactiveprojects.
                          • +

                            Logo designed by Marc Liyanage.

                            diff --git a/doc/interface.html b/doc/interface.html index 88ec0d8..8163c41 100644 --- a/doc/interface.html +++ b/doc/interface.html @@ -7,18 +7,19 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -The SAX interface
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            The SAX interface

                            Developer Menu
                            API Indexes
                            Related links

                            Sometimes the DOM tree output is just too large to fit -reasonablyintomemory. In that case (and if you don't expect to save back the -XMLdocumentloaded using libxml), it's better to use the SAX interface of -libxml.SAX isa callback-based interfaceto the parser. -Beforeparsing,the application layer registers a customized set of callbacks -whicharecalled by the library as it progresses through the XML input.

                            To get more detailed step-by-step guidance on using the SAX -interfaceoflibxml, see the nicedocumentation.writtenby -JamesHenstridge.

                            You can debug the SAX behaviour by using -thetestSAXprogram located in the gnome-xml module (it's -usuallynot shipped in thebinary packages of libxml, but you can find it in -the tarsourcedistribution). Here is the sequence of callbacks that would be -reportedbytestSAX when parsing the example XML document shown earlier:

                            SAX.setDocumentLocator()
                            +The SAX interface
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            The SAX interface

                            Developer Menu
                            API Indexes
                            Related links

                            Sometimes the DOM tree output is just too large to fit reasonably into +memory. In that case (and if you don't expect to save back the XML document +loaded using libxml), it's better to use the SAX interface of libxml. SAX is +a callback-based interface to the parser. Before parsing, +the application layer registers a customized set of callbacks which are +called by the library as it progresses through the XML input.

                            To get more detailed step-by-step guidance on using the SAX interface of +libxml, see the nice +documentation.written by James +Henstridge.

                            You can debug the SAX behaviour by using the testSAX +program located in the gnome-xml module (it's usually not shipped in the +binary packages of libxml, but you can find it in the tar source +distribution). Here is the sequence of callbacks that would be reported by +testSAX when parsing the example XML document shown earlier:

                            SAX.setDocumentLocator()
                             SAX.startDocument()
                             SAX.getEntity(amp)
                             SAX.startElement(EXAMPLE, prop1='gnome is great', prop2='&amp; linux too')
                            @@ -51,8 +52,8 @@ SAX.characters(   , 3)
                             SAX.endElement(chapter)
                             SAX.characters( , 1)
                             SAX.endElement(EXAMPLE)
                            -SAX.endDocument()

                            Most of the other interfaces of libxml2 are based on the -DOMtree-buildingfacility, so nearly everything up to the end of this -documentpresupposes theuse of the standard DOM tree build. Note that the DOM -treeitself is built bya set of registered default callbacks, without -internalspecificinterface.

                            Daniel Veillard

                            +SAX.endDocument()

                            Most of the other interfaces of libxml2 are based on the DOM tree-building +facility, so nearly everything up to the end of this document presupposes the +use of the standard DOM tree build. Note that the DOM tree itself is built by +a set of registered default callbacks, without internal specific +interface.

                            Daniel Veillard

                            diff --git a/doc/intro.html b/doc/intro.html index 1ae322f..650eccb 100644 --- a/doc/intro.html +++ b/doc/intro.html @@ -7,23 +7,25 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Introduction
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            Introduction

                            Main Menu
                            Related links

                            This document describes libxml, the XMLC parser and toolkit developed for theGnomeproject. XML is a standardfor -buildingtag-basedstructured documents/data.

                            Here are some key points about libxml:

                            Warning: unless you are forced to because your application links with a +Gnome-1.X library requiring it, Do Not Use libxml1, use +libxml2

                            Daniel Veillard

                            diff --git a/doc/library.html b/doc/library.html index afe4d77..b5faade 100644 --- a/doc/library.html +++ b/doc/library.html @@ -7,25 +7,27 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -The parser interfaces
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            The parser interfaces

                            Developer Menu
                            API Indexes
                            Related links

                            This section is directly intended to help programmers -gettingbootstrappedusing the XML tollkit from the C language. It is not -intended tobeextensive. I hope the automatically generated documents will -providethecompleteness required, but as a separate set of documents. The -interfacesofthe XML parser are by principle low level, Those interested in a -higherlevelAPI should look at DOM.

                            The parser interfaces -forXMLareseparated from the HTMLparserinterfaces. Let's have a -look at how the XML parser can becalled:

                            Invoking the parser : the pull method

                            Usually, the first thing to do is to read an XML input. The -parseracceptsdocuments either from in-memory strings or from files. The -functionsaredefined in "parser.h":

                            xmlDocPtr xmlParseMemory(char *buffer, int size);
                            +The parser interfaces
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            The parser interfaces

                            Developer Menu
                            API Indexes
                            Related links

                            This section is directly intended to help programmers getting bootstrapped +using the XML tollkit from the C language. It is not intended to be +extensive. I hope the automatically generated documents will provide the +completeness required, but as a separate set of documents. The interfaces of +the XML parser are by principle low level, Those interested in a higher level +API should look at DOM.

                            The parser interfaces for XML are +separated from the HTML parser +interfaces. Let's have a look at how the XML parser can be called:

                            Invoking the parser : the pull method

                            Usually, the first thing to do is to read an XML input. The parser accepts +documents either from in-memory strings or from files. The functions are +defined in "parser.h":

                            xmlDocPtr xmlParseMemory(char *buffer, int size);

                            Parse a null-terminated string containing the document.

                            xmlDocPtr xmlParseFile(const char *filename);
                            -

                            Parse an XML document contained in a (possibly compressed)file.

                            +

                            Parse an XML document contained in a (possibly compressed) + file.

                            -

                            The parser returns a pointer to the document structure (or NULL in -caseoffailure).

                            Invoking the parser: the push method

                            In order for the application to keep the control when the document -isbeingfetched (which is common for GUI based programs) libxml2 provides -apushinterface, too, as of version 1.8.3. Here are the interfacefunctions:

                            xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
                            +

                            The parser returns a pointer to the document structure (or NULL in case of +failure).

                            Invoking the parser: the push method

                            In order for the application to keep the control when the document is +being fetched (which is common for GUI based programs) libxml2 provides a +push interface, too, as of version 1.8.3. Here are the interface +functions:

                            xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
                                                                      void *user_data,
                                                                      const char *chunk,
                                                                      int size,
                            @@ -52,17 +54,17 @@ int              xmlParseChunk          (xmlParserCtxtPtr ctxt,
                                                 doc = ctxt->myDoc;
                                                 xmlFreeParserCtxt(ctxt);
                                             }
                            -            }

                            The HTML parser embedded into libxml2 also has a push -interface;thefunctions are just prefixed by "html" rather than "xml".

                            Invoking the parser: the SAX interface

                            The tree-building interface makes the parser memory-hungry, -firstloadingthe document in memory and then building the tree itself. Reading -adocumentwithout building the tree is possible using the SAX interfaces -(seeSAX.h andJamesHenstridge'sdocumentation). -Note also that the push interface can belimited to SAX:just use the two first -arguments ofxmlCreatePushParserCtxt().

                            Building a tree from scratch

                            The other way to get an XML tree in memory is by building -it.Basicallythere is a set of functions dedicated to building new -elements.(These arealso described in <libxml/tree.h>.) For example, -here is apiece ofcode that produces the XML document used in the previous -examples:

                                #include <libxml/tree.h>
                            +            }

                            The HTML parser embedded into libxml2 also has a push interface; the +functions are just prefixed by "html" rather than "xml".

                            Invoking the parser: the SAX interface

                            The tree-building interface makes the parser memory-hungry, first loading +the document in memory and then building the tree itself. Reading a document +without building the tree is possible using the SAX interfaces (see SAX.h and +James +Henstridge's documentation). Note also that the push interface can be +limited to SAX: just use the two first arguments of +xmlCreatePushParserCtxt().

                            Building a tree from scratch

                            The other way to get an XML tree in memory is by building it. Basically +there is a set of functions dedicated to building new elements. (These are +also described in <libxml/tree.h>.) For example, here is a piece of +code that produces the XML document used in the previous examples:

                                #include <libxml/tree.h>
                                 xmlDocPtr doc;
                                 xmlNodePtr tree, subtree;
                             
                            @@ -76,58 +78,59 @@ examples:

                                #include <libxml/tree.h>
                                 subtree = xmlNewChild(tree, NULL, "title", "The Linux adventure");
                                 subtree = xmlNewChild(tree, NULL, "p", "bla bla bla ...");
                                 subtree = xmlNewChild(tree, NULL, "image", NULL);
                            -    xmlSetProp(subtree, "href", "linus.gif");

                            Not really rocket science ...

                            Traversing the tree

                            Basically by including"tree.h"yourcode -has access to the internal structure of all the elementsof the tree.The names -should be somewhat simple -likeparent,children, -next,prev,properties, -etc... For example, stillwith the previousexample:

                            doc->children->children->children

                            points to the title element,

                            doc->children->children->next->children->children

                            points to the text node containing the chapter title -"TheLinuxadventure".

                            NOTE: XML allows PIs and -commentstobepresent before the document root, so -doc->childrenmaypointto an element which is not the document -Root Element; afunctionxmlDocGetRootElement()was added for this -purpose.

                            Modifying the tree

                            Functions are provided for reading and writing the document content.Hereis -an excerpt from the tree API:

                            xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar - *name,constxmlChar *value);
                            -

                            This sets (or changes) an attribute carried by an ELEMENT - node.Thevalue can be NULL.

                            + xmlSetProp(subtree, "href", "linus.gif");

                            Not really rocket science ...

                            Traversing the tree

                            Basically by including "tree.h" your +code has access to the internal structure of all the elements of the tree. +The names should be somewhat simple like parent, +children, next, prev, +properties, etc... For example, still with the previous +example:

                            doc->children->children->children

                            points to the title element,

                            doc->children->children->next->children->children

                            points to the text node containing the chapter title "The Linux +adventure".

                            NOTE: XML allows PIs and comments to be +present before the document root, so doc->children may point +to an element which is not the document Root Element; a function +xmlDocGetRootElement() was added for this purpose.

                            Modifying the tree

                            Functions are provided for reading and writing the document content. Here +is an excerpt from the tree API:

                            xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar *name, const + xmlChar *value);
                            +

                            This sets (or changes) an attribute carried by an ELEMENT node. + The value can be NULL.

                            -
                            const xmlChar *xmlGetProp(xmlNodePtr node, - constxmlChar*name);
                            -

                            This function returns a pointer to new copy of thepropertycontent. - Note that the user must deallocate the result.

                            +
                            const xmlChar *xmlGetProp(xmlNodePtr node, const xmlChar + *name);
                            +

                            This function returns a pointer to new copy of the property + content. Note that the user must deallocate the result.

                            -

                            Two functions are provided for reading and writing the text -associatedwithelements:

                            xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, - constxmlChar*value);
                            -

                            This function takes an "external" string and converts it toonetext - node or possibly to a list of entity and text nodes.Allnon-predefined - entity references like &Gnome; will bestoredinternally as entity - nodes, hence the result of the function maynot bea single node.

                            +

                            Two functions are provided for reading and writing the text associated +with elements:

                            xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const xmlChar + *value);
                            +

                            This function takes an "external" string and converts it to one + text node or possibly to a list of entity and text nodes. All + non-predefined entity references like &Gnome; will be stored + internally as entity nodes, hence the result of the function may not be + a single node.

                            -
                            xmlChar *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr - list,intinLine);
                            -

                            This function is the inverseofxmlStringGetNodeList(). - It generates a newstringcontaining the content of the text and entity - nodes. Note theextraargument inLine. If this argument is set to 1, the - function willexpandentity references. For example, instead of - returning the&Gnome;XML encoding in the string, it will substitute - it with itsvalue (say,"GNU Network Object Model Environment").

                            +
                            xmlChar *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int + inLine);
                            +

                            This function is the inverse of + xmlStringGetNodeList(). It generates a new string + containing the content of the text and entity nodes. Note the extra + argument inLine. If this argument is set to 1, the function will expand + entity references. For example, instead of returning the &Gnome; + XML encoding in the string, it will substitute it with its value (say, + "GNU Network Object Model Environment").

                            -

                            Saving a tree

                            Basically 3 options are possible:

                            void xmlDocDumpMemory(xmlDocPtr cur, - xmlChar**mem,int*size);
                            +

                            Saving a tree

                            Basically 3 options are possible:

                            void xmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int + *size);

                            Returns a buffer into which the document has been saved.

                            extern void xmlDocDump(FILE *f, xmlDocPtr doc);

                            Dumps a document to an open file descriptor.

                            int xmlSaveFile(const char *filename, xmlDocPtr cur);
                            -

                            Saves the document to a file. In this case, - thecompressioninterface is triggered if it has been turned on.

                            +

                            Saves the document to a file. In this case, the compression + interface is triggered if it has been turned on.

                            -

                            Compression

                            The library transparently handles compression when -doingfile-basedaccesses. The level of compression on saves can be turned on -eithergloballyor individually for one file:

                            int xmlGetDocCompressMode (xmlDocPtr doc);
                            +

                            Compression

                            The library transparently handles compression when doing file-based +accesses. The level of compression on saves can be turned on either globally +or individually for one file:

                            int xmlGetDocCompressMode (xmlDocPtr doc);

                            Gets the document compression ratio (0-9).

                            void xmlSetDocCompressMode (xmlDocPtr doc, int mode);
                            diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 2dbf900..dd49a2b 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -94,6 +94,7 @@ + @@ -722,6 +723,7 @@ + @@ -1587,6 +1589,7 @@ + @@ -1668,6 +1671,7 @@ + @@ -1786,6 +1790,7 @@ + @@ -3322,6 +3327,7 @@ + @@ -3501,7 +3507,7 @@ - + @@ -3523,11 +3529,12 @@ - + + @@ -3947,13 +3954,13 @@ Whether the DTD validation support is configured in - the version number: 1.2.3 value is 1002003 + the version number: 1.2.3 value is 10203 extra version information, used to show a CVS compilation - the version number string, 1.2.3 value is "1002003" + the version number string, 1.2.3 value is "10203" Whether the xmlWriter saving interface is configured in @@ -3967,6 +3974,9 @@ Whether XPointer is configured in + + Whether the Zlib support is compiled in + Skips to the next '>' char. @@ -4964,7 +4974,9 @@ - + @@ -5641,6 +5653,7 @@ + @@ -5872,7 +5885,15 @@ if necessary or NULL'/> - + + + + @@ -5977,6 +5998,7 @@ actually an xmlCharEncoding'/> + @@ -6113,6 +6135,7 @@ actually an xmlCharEncoding'/> + @@ -7432,6 +7455,11 @@ Could we use @subtypes for this?'/> + + defined(LIBXML_HTML_ENABLED) + Allocate and initialize a new parser context. + + defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added. @@ -9038,8 +9066,16 @@ Could we use @subtypes for this?'/> + + A function called to acquire namespaces (xmlNs) from the wrapper. + + + + + + - References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state. + References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested. @@ -9049,7 +9085,7 @@ Could we use @subtypes for this?'/> - References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used This is the case when you have an unliked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) Support dicts Optimize string adoption for equal or none dicts. 2) XInclude WARNING: This function is in a experimental state and should only be currently only be used to test it. + References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc->oldNs entries are used. This is the case when you don't know already where the cloned branch will be added to. If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) What to do with XInclude? Currently this returns an error for XInclude. @@ -9070,14 +9106,14 @@ Could we use @subtypes for this?'/> - Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state. + Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested. - Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. WARNING: This function is in a experimental state. + Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. NOTE: This function was not intensively tested. @@ -9329,9 +9365,9 @@ Could we use @subtypes for this?'/> defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). - + - + defined(LIBXML_OUTPUT_ENABLED) @@ -9933,7 +9969,7 @@ Could we use @subtypes for this?'/> - defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) + defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) Search all the namespace applying to a given element. @@ -10279,7 +10315,7 @@ Could we use @subtypes for this?'/> defined(LIBXML_VALID_ENABLED) Load and parse a DTD - + @@ -12180,6 +12216,11 @@ Could we use @subtypes for this?'/> + + Constructs an URI expressing the existing path + + + defined(LIBXML_PATTERN_ENABLED) Check if the pattern must be looked at from the root. @@ -13250,7 +13291,7 @@ Could we use @subtypes for this?'/> Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead - + Save the URI as an escaped string @@ -16636,7 +16677,7 @@ Could we use @subtypes for this?'/> - defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) + defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) Check that a value conforms to the lexical space of NCName @@ -16804,6 +16845,14 @@ Could we use @subtypes for this?'/> + + defined(LIBXML_XINCLUDE_ENABLED) + Implement the XInclude substitution on the XML document @doc + + + + + defined(LIBXML_XINCLUDE_ENABLED) Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context. @@ -16932,7 +16981,7 @@ Could we use @subtypes for this?'/> defined(LIBXML_XPATH_ENABLED) Converts an existing object to its string() equivalent - + @@ -16970,6 +17019,13 @@ Could we use @subtypes for this?'/> + + defined(LIBXML_XPATH_ENABLED) + Applies the XPath boolean() function on the result of the given compiled expression. + + + + defined(LIBXML_XPATH_ENABLED) Implement the concat() XPath function string concat(string, string, string*) The concat function returns the concatenation of its arguments. diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa index 0cfdca5..341e126 100644 --- a/doc/libxml2.xsa +++ b/doc/libxml2.xsa @@ -8,9 +8,20 @@ libxml2 - 2.6.25 - Jun 6 2006: + 2.6.26 + Jun 6 2006 http://xmlsoft.org/ - Do not use or package 2.6.25 + - portability fixes: Python detection (Joseph Sacco), compilation + error(William Brack and Graham Bennett), LynxOS patch (Olli Savia) + - bug fixes: encoding buffer problem, mix of code and data in + xmlIO.c(Kjartan Maraas), entities in XSD validation (Kasimier Buchcik), + variousXSD validation fixes (Kasimier), memory leak in pattern (Rob + Richards andKasimier), attribute with colon in name (Rob Richards), XPath + leak inerror reporting (Aleksey Sanin), XInclude text include of + selfdocument. + - improvements: Xpath optimizations (Kasimier), XPath object + cache(Kasimier) + + diff --git a/doc/namespaces.html b/doc/namespaces.html index a4d6ace..32c7787 100644 --- a/doc/namespaces.html +++ b/doc/namespaces.html @@ -7,44 +7,44 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Namespaces
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            Namespaces

                            Main Menu
                            Related links

                            The libxml2 library implements XML -namespacessupportbyrecognizing namespace constructs in the input, and -does namespacelookupautomatically when building the DOM tree. A namespace -declarationisassociated with an in-memory structure and all elements or -attributeswithinthat namespace point to it. Hence testing the namespace is a -simple andfastequality operation at the user level.

                            I suggest that people using libxml2 use a namespace, and declare it -intheroot element of their document as the default namespace. Then they -don'tneedto use the prefix in the content but we will have a basis for -futuresemanticrefinement and merging of data from different sources. This -doesn'tincreasethe size of the XML output significantly, but significantly -increasesitsvalue in the long-term. Example:

                            <mydoc xmlns="http://mydoc.example.org/schemas/">
                            +Namespaces
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            Namespaces

                            Main Menu
                            Related links

                            The libxml2 library implements XML namespaces support by +recognizing namespace constructs in the input, and does namespace lookup +automatically when building the DOM tree. A namespace declaration is +associated with an in-memory structure and all elements or attributes within +that namespace point to it. Hence testing the namespace is a simple and fast +equality operation at the user level.

                            I suggest that people using libxml2 use a namespace, and declare it in the +root element of their document as the default namespace. Then they don't need +to use the prefix in the content but we will have a basis for future semantic +refinement and merging of data from different sources. This doesn't increase +the size of the XML output significantly, but significantly increases its +value in the long-term. Example:

                            <mydoc xmlns="http://mydoc.example.org/schemas/">
                                <elem1>...</elem1>
                                <elem2>...</elem2>
                            -</mydoc>

                            The namespace value has to be an absolute URL, but the URL doesn't -havetopoint to any existing resource on the Web. It will bind all the -elementandattributes with that URL. I suggest to use an URL within a -domainyoucontrol, and that the URL should contain some kind of version -informationifpossible. For example, -"http://www.gnome.org/gnumeric/1.0/"isagood namespace scheme.

                            Then when you load a file, make sure that a namespace -carryingtheversion-independent prefix is installed on the root element of -yourdocument,and if the version information don't match something you know, -warnthe userand be liberal in what you accept as the input. Also do *not* try -tobasenamespace checking on the prefix value. <foo:text> may be -exactlythesame as <bar:text> in another document. What really matters -is theURIassociated with the element or the attribute, not the prefix string -(whichisjust a shortcut for the full URI). In libxml, element and attributes -haveannsfield pointing to an xmlNs structure detailing -thenamespaceprefix and its URI.

                            @@Interfaces@@

                            xmlNodePtr node;
                            +</mydoc>

                            The namespace value has to be an absolute URL, but the URL doesn't have to +point to any existing resource on the Web. It will bind all the element and +attributes with that URL. I suggest to use an URL within a domain you +control, and that the URL should contain some kind of version information if +possible. For example, "http://www.gnome.org/gnumeric/1.0/" is a +good namespace scheme.

                            Then when you load a file, make sure that a namespace carrying the +version-independent prefix is installed on the root element of your document, +and if the version information don't match something you know, warn the user +and be liberal in what you accept as the input. Also do *not* try to base +namespace checking on the prefix value. <foo:text> may be exactly the +same as <bar:text> in another document. What really matters is the URI +associated with the element or the attribute, not the prefix string (which is +just a shortcut for the full URI). In libxml, element and attributes have an +ns field pointing to an xmlNs structure detailing the namespace +prefix and its URI.

                            @@Interfaces@@

                            xmlNodePtr node;
                             if(!strncmp(node->name,"mytag",5)
                               && node->ns
                               && !strcmp(node->ns->href,"http://www.mysite.com/myns/1.0")) {
                               ...
                            -}

                            Usually people object to using namespaces together with validitychecking.I -will try to make sure that using namespaces won't break validitychecking,so -even if you plan to use or currently are using validation Istronglysuggest -adding namespaces to your document. A default -namespaceschemexmlns="http://...."should not break validity even -onlessflexible parsers. Using namespaces to mix and differentiate -contentcomingfrom multiple DTDs will certainly break current validation -schemes. Tochecksuch documents one needs to use schema-validation, which is -supportedinlibxml2 as well. See relagx-ngand w3c-schema.

                            Daniel Veillard

                            +}

                            Usually people object to using namespaces together with validity checking. +I will try to make sure that using namespaces won't break validity checking, +so even if you plan to use or currently are using validation I strongly +suggest adding namespaces to your document. A default namespace scheme +xmlns="http://...." should not break validity even on less +flexible parsers. Using namespaces to mix and differentiate content coming +from multiple DTDs will certainly break current validation schemes. To check +such documents one needs to use schema-validation, which is supported in +libxml2 as well. See relagx-ng and w3c-schema.

                            Daniel Veillard

                            diff --git a/doc/news.html b/doc/news.html index b67feaa..79a89d6 100644 --- a/doc/news.html +++ b/doc/news.html @@ -7,12 +7,62 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Releases
                            Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                            Made with Libxml2 Logo

                            The XML C parser and toolkit of Gnome

                            Releases

                            Main Menu
                            Related links

                            Items not finished and worked on, get in touch with the list if you -wanttohelp those

                            • More testing on RelaxNG
                            • -
                            • Finishing up XMLSchemas
                            • -

                            The change logdescribes the recents -commitstothe CVScode -base.

                            There is the list of public releases:

                            2.6.26: Jun 6 2006

                            • portability fixes: Python detection (Joseph Sacco), compilation +Releases
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              Releases

                              Main Menu
                              Related links

                              Items not finished and worked on, get in touch with the list if you want +to help those

                              The change log describes the recents commits +to the CVS code base.

                              There is the list of public releases:

                              2.6.27: Oct 25 2006

                              • Portability fixes: file names on windows (Roland Schwingel, + Emelyanov Alexey), windows compile fixup (Rob Richards), + AIX iconv() is apparently case sensitive
                              • +
                              • improvements: Python XPath types mapping (Nic Ferrier), XPath optimization + (Kasimier), add xmlXPathCompiledEvalToBoolean (Kasimier), Python node + equality and comparison (Andreas Pakulat), xmlXPathCollectAndTest + improvememt (Kasimier), expose if library was compiled with zlib + support (Andrew Nosenko), cache for xmlSchemaIDCMatcher structs + (Kasimier), xmlTextConcat should work with comments and PIs (Rob + Richards), export htmlNewParserCtxt needed by Michael Day, refactoring + of catalog entity loaders (Michael Day), add XPointer support to + python bindings (Ross Reedstrom, Brian West and Stefan Anca), + try to sort out most file path to URI conversions and xmlPathToUri, + add --html --memory case to xmllint
                              • +
                              • building fix: fix --with-minimum (Felipe Contreras), VMS fix, + const'ification of HTML parser structures (Matthias Clasen), + portability fix (Emelyanov Alexey), wget autodetection (Peter + Breitenlohner), remove the build path recorded in the python + shared module, separate library flags for shared and static builds + (Mikhail Zabaluev), fix --with-minimum --with-sax1 builds, fix + --with-minimum --with-schemas builds
                              • +
                              • bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and + attribute (Kasimier), crash when using the recover mode, + xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier), + missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes + (Kasimier), warning on entities processing, XHTML script and style + serialization (Kasimier), python generator for long types, bug in + xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate + allocation bug (Marton Illes), error message end of line (Rob Richards), + fix attribute serialization in writer (Rob Richards), PHP4 DTD validation + crasher, parser safety patch (Ben Darnell), _private context propagation + when parsing entities (with Michael Day), fix entities behaviour when + using SAX, URI to file path fix (Mikhail Zabaluev), disapearing validity + context, arg error in SAX callback (Mike Hommey), fix mixed-content + autodetect when using --noblanks, fix xmlIOParseDTD error handling, + fix bug in xmlSplitQName on special Names, fix Relax-NG element content + validation bug, fix xmlReconciliateNs bug, fix potential attribute + XML parsing bug, fix line/column accounting in XML parser, chunking bug + in the HTML parser on script, try to detect obviously buggy HTML + meta encoding indications, bugs with encoding BOM and xmlSaveDoc, + HTML entities in attributes parsing, HTML minimized attribute values, + htmlReadDoc and htmlReadIO were broken, error handling bug in + xmlXPathEvalExpression (Olaf Walkowiak), fix a problem in + htmlCtxtUseOptions, xmlNewInputFromFile could leak (Marius Konitzer), + bug on misformed SSD regexps (Christopher Boumenot) +
                              • +
                              • documentation: warning about XML_PARSE_COMPACT (Kasimier Buchcik), + fix xmlXPathCastToString documentation, improve man pages for + xmllitn and xmlcatalog (Daniel Leidert), fixed comments of a few + functions
                              • +

                              2.6.26: Jun 6 2006

                              • portability fixes: Python detection (Joseph Sacco), compilation error(William Brack and Graham Bennett), LynxOS patch (Olli Savia)
                              • bug fixes: encoding buffer problem, mix of code and data in xmlIO.c(Kjartan Maraas), entities in XSD validation (Kasimier Buchcik), @@ -22,474 +72,465 @@ base.

                                There is the list of public releases:

                                2.6.26: Jun 6 2006

                                selfdocument.
                              • improvements: Xpath optimizations (Kasimier), XPath object cache(Kasimier)
                              • -

                              2.6.25: Jun 6 2006:

                              Do not use or package 2.6.25

                              2.6.24: Apr 28 2006

                              • Portability fixes: configure on Windows, testapi compile - onwindows(Kasimier Buchcik, venkat naidu), Borland C++ 6 compile - (EricZurcher),HP-UX compiler workaround (Rick Jones), xml2-config - bugfix,gcc-4.1cleanups, Python detection scheme (Joseph Sacco), UTF-8 - file pathsonWindows (Roland Schwingel).
                              • -
                              • Improvements: xmlDOMWrapReconcileNamespaces - xmlDOMWrapCloneNode(KasimierBuchcik), XML catalog debugging (Rick Jones), - update to Unicode4.01.
                              • -
                              • Bug fixes: xmlParseChunk() problem in 2.6.23, - xmlParseInNodeContext()onHTML docs, URI behaviour on Windows (Rob - Richards), comment streamingbug,xmlParseComment (with William Brack), - regexp bug fixes (DV &YouriGolovanov), xmlGetNodePath on text/CDATA - (Kasimier),one Relax-NGinterleave bug, xmllint --path and --valid,XSD - bugfixes (Kasimier),remove debugleft in Python bindings (Nic Ferrier), - xmlCatalogAdd bug(Martin Cole),xmlSetProp fixes (Rob Richards), HTML - IDness (RobRichards), a largenumber of cleanups and small fixes based on - Coverityreports, bugin character ranges, Unicode tables const (Aivars - Kalvans),schemasfix (Stefan Kost), xmlRelaxNGParse - errordeallocation,xmlSchemaAddSchemaDoc error deallocation, error - handling onunallowedcode point, ixmllint --nonet to never reach the net - (GaryCoady),line break in writer after end PI (Jason Viers).
                              • +

                              2.6.25: Jun 6 2006:

                              Do not use or package 2.6.25

                              2.6.24: Apr 28 2006

                              • Portability fixes: configure on Windows, testapi compile on windows + (Kasimier Buchcik, venkat naidu), Borland C++ 6 compile (Eric Zurcher), + HP-UX compiler workaround (Rick Jones), xml2-config bugfix, gcc-4.1 + cleanups, Python detection scheme (Joseph Sacco), UTF-8 file paths on + Windows (Roland Schwingel). +
                              • +
                              • Improvements: xmlDOMWrapReconcileNamespaces xmlDOMWrapCloneNode (Kasimier + Buchcik), XML catalog debugging (Rick Jones), update to Unicode 4.01.
                              • +
                              • Bug fixes: xmlParseChunk() problem in 2.6.23, xmlParseInNodeContext() + on HTML docs, URI behaviour on Windows (Rob Richards), comment streaming + bug, xmlParseComment (with William Brack), regexp bug fixes (DV & + Youri Golovanov), xmlGetNodePath on text/CDATA (Kasimier), + one Relax-NG interleave bug, xmllint --path and --valid, + XSD bugfixes (Kasimier), remove debug + left in Python bindings (Nic Ferrier), xmlCatalogAdd bug (Martin Cole), + xmlSetProp fixes (Rob Richards), HTML IDness (Rob Richards), a large + number of cleanups and small fixes based on Coverity reports, bug + in character ranges, Unicode tables const (Aivars Kalvans), schemas + fix (Stefan Kost), xmlRelaxNGParse error deallocation, + xmlSchemaAddSchemaDoc error deallocation, error handling on unallowed + code point, ixmllint --nonet to never reach the net (Gary Coady), + line break in writer after end PI (Jason Viers).
                              • Documentation: man pages updates and cleanups (Daniel Leidert).
                              • New features: Relax NG structure error handlers.
                              • -

                              2.6.23: Jan 5 2006

                              • portability fixes: Windows (Rob Richards), getaddrinfo on - Windows(KoljaNowak, Rob Richards), icc warnings (Kjartan - Maraas),--with-minimumcompilation fixes (William Brack), error case - handling fixon Solaris(Albert Chin), don't use 'list' as parameter name - reported bySamuel DiazGarcia, more old Unices portability fixes (Albert - Chin),MinGW compilation(Mark Junker), HP-UX compiler warnings - (RickJones),
                              • -
                              • code cleanup: xmlReportError (Adrian Mouat), removexmlBufferClose(Geert - Jansen), unreachable code (Oleksandr Kononenko),refactoringparsing code - (Bjorn Reese)
                              • -
                              • bug fixes: xmlBuildRelativeURI and empty path - (WilliamBrack),combinatory explosion and performances in regexp code, - leakinxmlTextReaderReadString(), xmlStringLenDecodeEntities - problem(MassimoMorara), Identity Constraints bugs and a segfault - (KasimierBuchcik),XPath pattern based evaluation bugs (DV - &Kasimier),xmlSchemaContentModelDump() memory leak (Kasimier), - potentialleak inxmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() - misuseofvsnprintf (William Brack), XHTML serialization fix (Rob - Richards),CRLFsplit problem (William), issues with non-namespaced - attributesinxmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() - (RobRichards),HTML parsing of script, Python must not output to stdout - (NicFerrier),exclusive C14N namespace visibility (Aleksey Sanin), - XSDdataypetotalDigits bug (Kasimier Buchcik), error handling when writing - toanxmlBuffer (Rob Richards), runtest schemas error not - reported(HisashiFujinaka), signed/unsigned problem in date/time code - (AlbertChin), fixXSI driven XSD validation (Kasimier), parsing of - xs:decimal(Kasimier),fix DTD writer output (Rob Richards), leak - inxmlTextReaderReadInnerXml(Gary Coady), regexp bug affecting - schemas(Kasimier), configuration ofruntime debugging - (Kasimier),xmlNodeBufGetContent bug on entity refs(Oleksandr - Kononenko),xmlRegExecPushString2 bug (Sreeni Nair),compilation and build - fixes(Michael Day), removed dependancies onxmlSchemaValidError - (Kasimier), bugwith <xml:foo/>, more XPathpattern based evaluation - fixes(Kasimier)
                              • -
                              • improvements: XSD Schemas redefinitions/restrictions - (KasimierBuchcik),node copy checks and fix for attribute (Rob Richards), - countedtransitionbug in regexps, ctxt->standalone = -2 to indicate - nostandaloneattribute was found, add - xmlSchemaSetParserStructuredErrors()(KasimierBuchcik), add - xmlTextReaderSchemaValidateCtxt() to API(Kasimier), handlegzipped HTTP - resources (Gary Coady), addhtmlDocDumpMemoryFormat. (RobRichards),
                              • -
                              • documentation: typo (Michael Day), libxml man page (Albert - Chin),savefunction to XML buffer (Geert Jansen), small doc fix - (AronStansvik),
                              • +

                              2.6.23: Jan 5 2006

                              • portability fixes: Windows (Rob Richards), getaddrinfo on Windows + (Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas), + --with-minimum compilation fixes (William Brack), error case handling fix + on Solaris (Albert Chin), don't use 'list' as parameter name reported by + Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin), + MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick + Jones),
                              • +
                              • code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose + (Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring + parsing code (Bjorn Reese)
                              • +
                              • bug fixes: xmlBuildRelativeURI and empty path (William Brack), + combinatory explosion and performances in regexp code, leak in + xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo + Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik), + XPath pattern based evaluation bugs (DV & Kasimier), + xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in + xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of + vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF + split problem (William), issues with non-namespaced attributes in + xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards), + HTML parsing of script, Python must not output to stdout (Nic Ferrier), + exclusive C14N namespace visibility (Aleksey Sanin), XSD dataype + totalDigits bug (Kasimier Buchcik), error handling when writing to an + xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi + Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix + XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier), + fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml + (Gary Coady), regexp bug affecting schemas (Kasimier), configuration of + runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs + (Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair), + compilation and build fixes (Michael Day), removed dependancies on + xmlSchemaValidError (Kasimier), bug with <xml:foo/>, more XPath + pattern based evaluation fixes (Kasimier)
                              • +
                              • improvements: XSD Schemas redefinitions/restrictions (Kasimier + Buchcik), node copy checks and fix for attribute (Rob Richards), counted + transition bug in regexps, ctxt->standalone = -2 to indicate no + standalone attribute was found, add xmlSchemaSetParserStructuredErrors() + (Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API + (Kasimier), handle gzipped HTTP resources (Gary Coady), add + htmlDocDumpMemoryFormat. (Rob Richards),
                              • +
                              • documentation: typo (Michael Day), libxml man page (Albert Chin), save + function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik),

                              2.6.22: Sep 12 2005

                              • build fixes: compile without schematron (Stéphane Bidoul)
                              • -
                              • bug fixes: xmlDebugDumpNode on namespace node (Oleg - Paraschenko)i,CDATApush parser bug, xmlElemDump problem with XHTML1 - doc,XML_FEATURE_xxxclash with expat headers renamed XML_WITH_xxx, fix - someoutput formattingfor meta element (Rob Richards), script and - styleXHTML1 serialization(David Madore), Attribute derivation fixups in - XSD(Kasimier Buchcik),better IDC error reports (Kasimier Buchcik)
                              • -
                              • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob - Richards),addXML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements - preparingforderive (Kasimier Buchcik).
                              • -
                              • documentation: generation of gtk-doc like docs, - integrationwithdevhelp.
                              • -

                              2.6.21: Sep 4 2005

                              • build fixes: Cygwin portability fixes (Gerrit P. - Haase),callingconvention problems on Windows (Marcus Boerger), cleanups - based onLinus'sparse tool, update of win32/configure.js (Rob Richards), - removewarningson Windows(Marcus Boerger), compilation without SAX1, - detectionof thePython binary, use $GCC inestad of $CC = 'gcc' (Andrew - W.Nosenko),compilation/link with threads and old gcc, compile problem - byC370 onZ/OS,
                              • -
                              • bug fixes: http_proxy environments (Peter Breitenlohner), HTML - UTF-8bug(Jiri Netolicky), XPath NaN compare bug (William - Brack),htmlParseScriptpotential bug, Schemas regexp handling of spaces, - Base64Schemascomparisons NIST passes, automata build error - xsd:all,xmlGetNodePath fornamespaced attributes (Alexander Pohoyda), - xmlSchemasforeign namespaceshandling, XML Schemas facet comparison - (KupriyanovAnatolij),xmlSchemaPSimpleTypeErr error report (Kasimier - Buchcik), xml:namespaceahndling in Schemas (Kasimier), empty model group - in Schemas(Kasimier),wilcard in Schemas (Kasimier), URI composition - (William),xs:anyType inSchemas (Kasimier), Python resolver emmitting - errormessages directly,Python xmlAttr.parent (Jakub Piotr Clapa), trying - tofix the file path/URIconversion, xmlTextReaderGetAttribute fix - (RobRichards),xmlSchemaFreeAnnot memleak (Kasimier), HTML - UTF-8serialization, streamingXPath, Schemas determinism detection - problem,XInclude bug, Schemascontext type (Dean Hill), validation fix - (DerekPoon),xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), - Schemastype fix(Kuba Nowakowski), UTF-8 parser bug, error in - encodinghandling,xmlGetLineNo fixes, bug on entities handling, entity - nameextraction inerror handling with XInclude, text nodes in HTML body - tags(Gary Coady),xml:id and IDness at the treee level fixes, XPath - streamingpatternsbugs.
                              • -
                              • improvements: structured interfaces for schemas and RNG - errorreports(Marcus Boerger), optimization of the char data inner - loopparsing(thanks to Behdad Esfahbod for the idea), schematron - validationthoughnot finished yet, xmlSaveOption to omit XML declaration, - keyrefmatcherror reports (Kasimier), formal expression handling code - notpluggedyet, more lax mode for the HTML parser, parser - XML_PARSE_COMPACToptionfor text nodes allocation.
                              • +
                              • bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i, + CDATA push parser bug, xmlElemDump problem with XHTML1 doc, + XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some + output formatting for meta element (Rob Richards), script and style + XHTML1 serialization (David Madore), Attribute derivation fixups in XSD + (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik)
                              • +
                              • improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add + XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for + derive (Kasimier Buchcik).
                              • +
                              • documentation: generation of gtk-doc like docs, integration with + devhelp.
                              • +

                              2.6.21: Sep 4 2005

                              • build fixes: Cygwin portability fixes (Gerrit P. Haase), calling + convention problems on Windows (Marcus Boerger), cleanups based on Linus' + sparse tool, update of win32/configure.js (Rob Richards), remove warnings + on Windows(Marcus Boerger), compilation without SAX1, detection of the + Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko), + compilation/link with threads and old gcc, compile problem by C370 on + Z/OS,
                              • +
                              • bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8 + bug (Jiri Netolicky), XPath NaN compare bug (William Brack), + htmlParseScript potential bug, Schemas regexp handling of spaces, Base64 + Schemas comparisons NIST passes, automata build error xsd:all, + xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas + foreign namespaces handling, XML Schemas facet comparison (Kupriyanov + Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml: + namespace ahndling in Schemas (Kasimier), empty model group in Schemas + (Kasimier), wilcard in Schemas (Kasimier), URI composition (William), + xs:anyType in Schemas (Kasimier), Python resolver emmitting error + messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to + fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob + Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8 + serialization, streaming XPath, Schemas determinism detection problem, + XInclude bug, Schemas context type (Dean Hill), validation fix (Derek + Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas + type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling, + xmlGetLineNo fixes, bug on entities handling, entity name extraction in + error handling with XInclude, text nodes in HTML body tags (Gary Coady), + xml:id and IDness at the treee level fixes, XPath streaming patterns + bugs.
                              • +
                              • improvements: structured interfaces for schemas and RNG error reports + (Marcus Boerger), optimization of the char data inner loop parsing + (thanks to Behdad Esfahbod for the idea), schematron validation though + not finished yet, xmlSaveOption to omit XML declaration, keyref match + error reports (Kasimier), formal expression handling code not plugged + yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option + for text nodes allocation.
                              • documentation: xmllint man page had --nonet duplicated
                              • -

                              2.6.20: Jul 10 2005

                              • build fixes: Windows build (Rob Richards), Mingw - compilation(IgorZlatkovic), Windows Makefile (Igor), gcc warnings - (Kasimierandandriy@google.com), use gcc weak references to pthread to - avoidthepthread dependancy on Linux, compilation problem (Steve - Nairn),compilingof subset (Morten Welinder), IPv6/ss_family compilation - (WilliamBrack),compilation when disabling parts of the library, - standalonetestdistribution.
                              • -
                              • bug fixes: bug in lang(), memory cleanup on errors (William - Brack),HTTPquery strings (Aron Stansvik), memory leak in DTD - (William),integeroverflow in XPath (William), nanoftp buffer size, - pattern "." apthfixup(Kasimier), leak in tree reported by Malcolm Rowe, - replaceNodepatch(Brent Hendricks), CDATA with NULL content (Mark Vakoc), - xml:basefixupon XInclude (William), pattern fixes (William), attribute - buginexclusive c14n (Aleksey Sanin), xml:space and xml:lang with - SAX2(RobRichards), namespace trouble in complex parsing (Malcolm Rowe), - XSDtypeQNames fixes (Kasimier), XPath streaming fixups (William), - RelaxNGbug(Rob Richards), Schemas for Schemas fixes (Kasimier), removal - of ID(RobRichards), a small RelaxNG leak, HTML parsing in push mode - bug(JamesBursa), failure to detect UTF-8 parsing bugs in - CDATAsections,areBlanks() heuristic failure, duplicate attributes in - DTDbug(William).
                              • -
                              • improvements: lot of work on Schemas by Kasimier Buchcik - bothonconformance and streaming, Schemas validation messages - (KasimierBuchcik,Matthew Burgess), namespace removal at the python - level(BrentHendricks), Update to new Schemas regression tests - fromW3C/Nist(Kasimier), xmlSchemaValidateFile() (Kasimier), - implementationofxmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml - (JamesWert),standalone test framework and programs, new DOM - importAPIsxmlDOMWrapReconcileNamespaces() - xmlDOMWrapAdoptNode()andxmlDOMWrapRemoveNode(), extension of xmllint - capabilities for SAXandSchemas regression tests, xmlStopParser() - available in pull modetoo,ienhancement to xmllint --shell namespaces - support, Windows port ofthestandalone testing tools (Kasimier - andWilliam),xmlSchemaValidateStream() xmlSchemaSAXPlug() - andxmlSchemaSAXUnplug() SAXSchemas APIs, Schemas xmlReader support.
                              • -

                              2.6.19: Apr 02 2005

                              • build fixes: drop .la from RPMs, --with-minimum build - fix(WilliamBrack), use XML_SOCKLEN_T instead of SOCKLEN_T because it - breakswith AIX5.3 compiler, fixed elfgcchack.h generation and PLT - reductioncode onLinux/ELF/gcc4
                              • -
                              • bug fixes: schemas type decimal fixups (William Brack), - xmmlintreturncode (Gerry Murphy), small schemas fixes (Matthew Burgess - andGUYFabrice), workaround "DAV:" namespace brokeness in c14n - (AlekseySanin),segfault in Schemas (Kasimier Buchcik), Schemas - attributevalidation(Kasimier), Prop related functions and - xmlNewNodeEatName (RobRichards),HTML serialization of name attribute on a - elements, Pythonerror handlersleaks and improvement (Brent Hendricks), - uninitializedvariable inencoding code, Relax-NG validation bug, potential - crashifgnorableWhitespace is NULL, xmlSAXParseDoc and - xmlParseDocsignatures,switched back to assuming UTF-8 in case no encoding - is givenatserialization time
                              • -
                              • improvements: lot of work on Schemas by Kasimier Buchcik - onfacetschecking and also mixed handling.
                              • +

                              2.6.20: Jul 10 2005

                              • build fixes: Windows build (Rob Richards), Mingw compilation (Igor + Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and + andriy@google.com), use gcc weak references to pthread to avoid the + pthread dependancy on Linux, compilation problem (Steve Nairn), compiling + of subset (Morten Welinder), IPv6/ss_family compilation (William Brack), + compilation when disabling parts of the library, standalone test + distribution.
                              • +
                              • bug fixes: bug in lang(), memory cleanup on errors (William Brack), + HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer + overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup + (Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch + (Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup + on XInclude (William), pattern fixes (William), attribute bug in + exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob + Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type + QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug + (Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob + Richards), a small RelaxNG leak, HTML parsing in push mode bug (James + Bursa), failure to detect UTF-8 parsing bugs in CDATA sections, + areBlanks() heuristic failure, duplicate attributes in DTD bug + (William).
                              • +
                              • improvements: lot of work on Schemas by Kasimier Buchcik both on + conformance and streaming, Schemas validation messages (Kasimier Buchcik, + Matthew Burgess), namespace removal at the python level (Brent + Hendricks), Update to new Schemas regression tests from W3C/Nist + (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of + xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert), + standalone test framework and programs, new DOM import APIs + xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and + xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and + Schemas regression tests, xmlStopParser() available in pull mode too, + ienhancement to xmllint --shell namespaces support, Windows port of the + standalone testing tools (Kasimier and William), + xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX + Schemas APIs, Schemas xmlReader support.
                              • +

                              2.6.19: Apr 02 2005

                              • build fixes: drop .la from RPMs, --with-minimum build fix (William + Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX + 5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on + Linux/ELF/gcc4
                              • +
                              • bug fixes: schemas type decimal fixups (William Brack), xmmlint return + code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY + Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin), + segfault in Schemas (Kasimier Buchcik), Schemas attribute validation + (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards), + HTML serialization of name attribute on a elements, Python error handlers + leaks and improvement (Brent Hendricks), uninitialized variable in + encoding code, Relax-NG validation bug, potential crash if + gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures, + switched back to assuming UTF-8 in case no encoding is given at + serialization time
                              • +
                              • improvements: lot of work on Schemas by Kasimier Buchcik on facets + checking and also mixed handling.
                              • -

                              2.6.18: Mar 13 2005

                              • build fixes: warnings (Peter Breitenlohner), - testapi.cgeneration,Bakefile support (Francesco Montorsi), Windows - compilation(Joel Reed),some gcc4 fixes, HP-UX portability fixes (Rick - Jones).
                              • -
                              • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), - pushandxmlreader stopping on non-fatal errors, thread support - fordictionnariesreference counting (Gary Coady), internal subset and - pushproblem, URLsaved in xmlCopyDoc, various schemas bug fixes - (Kasimier),Python pathsfixup (Stephane Bidoul), xmlGetNodePath and - namespaces,xmlSetNsProp fix(Mike Hommey), warning should not count as - error (WilliamBrack),xmlCreatePushParser empty chunk, XInclude parser - flags (William),cleanupFTP and HTTP code to reuse the uri parsing and - IPv6(William),xmlTextWriterStartAttributeNS fix (Rob - Richards),XMLLINT_INDENT beingempty (William), xmlWriter bugs (Rob - Richards),multithreading on Windows(Rich Salz), xmlSearchNsByHref fix - (Kasimier),Python binding leak (BrentHendricks), aliasing bug exposed by - gcc4 ons390, xmlTextReaderNext bug(Rob Richards), Schemas decimal type - fixes(William Brack),xmlByteConsumed static buffer (Ben Maurer).
                              • -
                              • improvement: speedup parsing comments and DTDs, dictionnary - supportforhash tables, Schemas Identity constraints (Kasimier), - streamingXPathsubset, xmlTextReaderReadString added (Bjorn Reese), - Schemascanonicalvalues handling (Kasimier), add - xmlTextReaderByteConsumed(AronStansvik),
                              • +

                              2.6.18: Mar 13 2005

                              • build fixes: warnings (Peter Breitenlohner), testapi.c generation, + Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), + some gcc4 fixes, HP-UX portability fixes (Rick Jones).
                              • +
                              • bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and + xmlreader stopping on non-fatal errors, thread support for dictionnaries + reference counting (Gary Coady), internal subset and push problem, URL + saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths + fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix + (Mike Hommey), warning should not count as error (William Brack), + xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup + FTP and HTTP code to reuse the uri parsing and IPv6 (William), + xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being + empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows + (Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent + Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug + (Rob Richards), Schemas decimal type fixes (William Brack), + xmlByteConsumed static buffer (Ben Maurer).
                              • +
                              • improvement: speedup parsing comments and DTDs, dictionnary support for + hash tables, Schemas Identity constraints (Kasimier), streaming XPath + subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical + values handling (Kasimier), add xmlTextReaderByteConsumed (Aron + Stansvik),
                              • Documentation: Wiki support (Joel Reed)
                              • -

                              2.6.17: Jan 16 2005

                              • build fixes: Windows, warnings removal (William - Brack),maintainer-cleandependency(William), build in a different - directory(William), fixing--with-minimum configure build (William), BeOS - build(Marcin Konicki),Python-2.4 detection (William), compilation on AIX - (DanMcNichol)
                              • -
                              • bug fixes: xmlTextReaderHasAttributes (Rob - Richards),xmlCtxtReadFile()to use the catalog(s), loop on output (William - Brack),XPath memory leak,ID deallocation problem (Steve Shepard), - debugDumpNodecrash (William),warning not using error callback (William), - xmlStopParserbug (William),UTF-16 with BOM on DTDs (William), namespace - bug on emptyelements inpush mode (Rob Richards), line and col - computations fixups(AlekseySanin), xmlURIEscape fix (William), - xmlXPathErr on bad range(William),patterns with too many steps, bug in - RNG choice optimization,line numbersometimes missing.
                              • -
                              • improvements: XSD Schemas (Kasimier Buchcik), pythongenerator(William), - xmlUTF8Strpos speedup (William), unicode Pythonstrings(William), XSD - error reports (Kasimier Buchcik), Python __str__callserialize().
                              • -
                              • new APIs: added xmlDictExists(), GetLineNumber and - GetColumnNumberforthe xmlReader (Aleksey Sanin), Dynamic Shared Libraries - APIs (mostlyJoelReed), error extraction API from regexps, new XMLSave - option forformat(Phil Shafer)
                              • -
                              • documentation: site improvement (John Fleck), FAQ entries(William).
                              • -

                              2.6.16: Nov 10 2004

                              • general hardening and bug fixing crossing all the API based - onnewautomated regression testing
                              • +

                              2.6.17: Jan 16 2005

                              • build fixes: Windows, warnings removal (William Brack), + maintainer-clean dependency(William), build in a different directory + (William), fixing --with-minimum configure build (William), BeOS build + (Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan + McNichol)
                              • +
                              • bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile() + to use the catalog(s), loop on output (William Brack), XPath memory leak, + ID deallocation problem (Steve Shepard), debugDumpNode crash (William), + warning not using error callback (William), xmlStopParser bug (William), + UTF-16 with BOM on DTDs (William), namespace bug on empty elements in + push mode (Rob Richards), line and col computations fixups (Aleksey + Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William), + patterns with too many steps, bug in RNG choice optimization, line number + sometimes missing.
                              • +
                              • improvements: XSD Schemas (Kasimier Buchcik), python generator + (William), xmlUTF8Strpos speedup (William), unicode Python strings + (William), XSD error reports (Kasimier Buchcik), Python __str__ call + serialize().
                              • +
                              • new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for + the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel + Reed), error extraction API from regexps, new XMLSave option for format + (Phil Shafer)
                              • +
                              • documentation: site improvement (John Fleck), FAQ entries + (William).
                              • +

                              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,encodingconversion functions return values, UTF-8 bug affecting - XPathreported byMarkus Bertheau, catalog problem with NULL entries - (WilliamBrack)
                              • -
                              • documentation: fix to xmllint man page, some API - functiondescritpionwere updated.
                              • -
                              • improvements: DTD validation APIs provided at the Python - level(BrentHendricks)
                              • +
                              • 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 - outsidethesource tree (Thomas Fitzsimmons)
                              • -
                              • bug fixes: HTML parser on broken ASCII chars in names - (William),Pythonpaths (Malcolm Tredinnick), xmlHasNsProp and default - namespace(William),saving to python file objects (Malcolm Tredinnick), - DTD lookupfix(Malcolm), save back <group> in catalogs (William), - treebuildfixes (DV and Rob Richards), Schemas memory bug, structured - errorhandleron Python 64bits, thread local memory deallocation, memory - leakreportedby Volker Roth, xmlValidateDtd in the presence of an - internalsubset,entities and _private problem (William), - xmlBuildRelativeURIerror(William).
                              • -
                              • improvements: better XInclude error reports (William), - treedebuggingmodule and tests, convenience functions at the Reader - API(GrahamBennett), add support for PI in the HTML parser.
                              • -

                              2.6.14: Sep 29 2004

                              • build fixes: configure paths for xmllint and - xsltproc,compilationwithout HTML parser, compilation warning cleanups - (WilliamBrack &Malcolm Tredinnick), VMS makefile update (Craig - Berry),
                              • -
                              • bug fixes: xmlGetUTF8Char (William Brack), QName - properties(KasimierBuchcik), XInclude testing, Notation - serialization,UTF8ToISO8859xtranscoding (Mark Itzcovitz), lots of XML - Schemas cleanupand fixes(Kasimier), ChangeLog cleanup (Stepan Kasal), - memory fixes (MarkVakoc),handling of failed realloc(), out of bound array - adressing inSchemasdate handling, Python space/tabs cleanups (Malcolm - Tredinnick),NMTOKENSE20 validation fix (Malcolm),
                              • -
                              • improvements: added W3C XML Schemas testsuite (Kasimier - Buchcik),addxmlSchemaValidateOneElement (Kasimier), Python - exceptionhierearchy(Malcolm Tredinnick), Python libxml2 driver - improvement(MalcolmTredinnick), Schemas support - forxsi:schemaLocation,xsi:noNamespaceSchemaLocation, xsi:type - (KasimierBuchcik)
                              • -

                              2.6.13: Aug 31 2004

                              • build fixes: Windows and zlib (Igor Zlatkovic), -O flag withgcc,Solaris - compiler warning, fixing RPM BuildRequires,
                              • -
                              • fixes: DTD loading on Windows (Igor), Schemas error - reportsAPIs(Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 - (WilliamBrackand Julius Mittenzwei), Schemas facet check (Kasimier), - defaultnamespaceproblem (William), Schemas hexbinary empty values, - encodingerror couldgenrate a serialization loop.
                              • -
                              • Improvements: Schemas validity improvements (Kasimier), added - --pathand--load-trace options to xmllint
                              • +
                              • build fixes: xmllint detection bug in configure, building outside the + source tree (Thomas Fitzsimmons)
                              • +
                              • bug fixes: HTML parser on broken ASCII chars in names (William), Python + paths (Malcolm Tredinnick), xmlHasNsProp and default namespace (William), + saving to python file objects (Malcolm Tredinnick), DTD lookup fix + (Malcolm), save back <group> in catalogs (William), tree build + fixes (DV and Rob Richards), Schemas memory bug, structured error handler + on Python 64bits, thread local memory deallocation, memory leak reported + by Volker Roth, xmlValidateDtd in the presence of an internal subset, + entities and _private problem (William), xmlBuildRelativeURI error + (William).
                              • +
                              • improvements: better XInclude error reports (William), tree debugging + module and tests, convenience functions at the Reader API (Graham + Bennett), add support for PI in the HTML parser.
                              • +

                              2.6.14: Sep 29 2004

                              • build fixes: configure paths for xmllint and xsltproc, compilation + without HTML parser, compilation warning cleanups (William Brack & + Malcolm Tredinnick), VMS makefile update (Craig Berry),
                              • +
                              • bug fixes: xmlGetUTF8Char (William Brack), QName properties (Kasimier + Buchcik), XInclude testing, Notation serialization, UTF8ToISO8859x + transcoding (Mark Itzcovitz), lots of XML Schemas cleanup and fixes + (Kasimier), ChangeLog cleanup (Stepan Kasal), memory fixes (Mark Vakoc), + handling of failed realloc(), out of bound array adressing in Schemas + date handling, Python space/tabs cleanups (Malcolm Tredinnick), NMTOKENS + E20 validation fix (Malcolm),
                              • +
                              • improvements: added W3C XML Schemas testsuite (Kasimier Buchcik), add + xmlSchemaValidateOneElement (Kasimier), Python exception hierearchy + (Malcolm Tredinnick), Python libxml2 driver improvement (Malcolm + Tredinnick), Schemas support for xsi:schemaLocation, + xsi:noNamespaceSchemaLocation, xsi:type (Kasimier Buchcik)
                              • +

                              2.6.13: Aug 31 2004

                              • build fixes: Windows and zlib (Igor Zlatkovic), -O flag with gcc, + Solaris compiler warning, fixing RPM BuildRequires,
                              • +
                              • fixes: DTD loading on Windows (Igor), Schemas error reports APIs + (Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 (William Brack + and Julius Mittenzwei), Schemas facet check (Kasimier), default namespace + problem (William), Schemas hexbinary empty values, encoding error could + genrate a serialization loop.
                              • +
                              • Improvements: Schemas validity improvements (Kasimier), added --path + and --load-trace options to xmllint
                              • documentation: tutorial update (John Fleck)
                              • -

                              2.6.12: Aug 22 2004

                              • build fixes: fix --with-minimum, elfgcchack.h - fixes(PeterBreitenlohner), perl path lookup (William), diff on - Solaris(AlbertChin), some 64bits cleanups.
                              • -
                              • Python: avoid a warning with 2.3 (William Brack), tab and - spacemixes(William), wrapper generator fixes (William), Cygwin support - (GerritP.Haase), node wrapper fix (Marc-Antoine Parent), XML - Schemassupport(Torkel Lyng)
                              • +

                              2.6.12: Aug 22 2004

                              • build fixes: fix --with-minimum, elfgcchack.h fixes (Peter + Breitenlohner), perl path lookup (William), diff on Solaris (Albert + Chin), some 64bits cleanups.
                              • +
                              • Python: avoid a warning with 2.3 (William Brack), tab and space mixes + (William), wrapper generator fixes (William), Cygwin support (Gerrit P. + Haase), node wrapper fix (Marc-Antoine Parent), XML Schemas support + (Torkel Lyng)
                              • Schemas: a lot of bug fixes and improvements from Kasimier Buchcik
                              • -
                              • fixes: RVT fixes (William), XPath context resets bug - (William),memorydebug (Steve Hay), catalog white space handling - (PeterBreitenlohner),xmlReader state after attribute reading - (William),structured errorhandler (William), XInclude generated xml:base - fixup(William), Windowsmemory reallocation problem (Steve Hay), Out of - Memoryconditionshandling (William and Olivier Andrieu), htmlNewDoc() - charsetbug,htmlReadMemory init (William), a posteriori validation - DTDbase(William), notations serialization missing, - xmlGetNodePath(Dodji),xmlCheckUTF8 (Diego Tartara), missing line numbers - onentity(William)
                              • -
                              • improvements: DocBook catalog build scrip (William), - xmlcatalogtool(Albert Chin), xmllint --c14n option, no_proxy environment - (MikeHommey),xmlParseInNodeContext() addition, extend xmllint --shell, - allowXIncludeto not generate start/end nodes, extend xmllint --version - toinclude CVStag (William)
                              • -
                              • documentation: web pages fixes, validity API docs fixes(William)schemas - API fix (Eric Haszlakiewicz), xmllint man page (JohnFleck)
                              • -

                              2.6.11: July 5 2004

                              • Schemas: a lot of changes and improvements by Kasimier - Buchcikforattributes, namespaces and simple types.
                              • -
                              • build fixes: --with-minimum (William Brack), some gcccleanup(William), - --with-thread-alloc (William)
                              • -
                              • portability: Windows binary package change (Igor Zlatkovic),Catalogpath - on Windows
                              • -
                              • documentation: update to the tutorial (John Fleck), xmllint - returncode(John Fleck), man pages (Ville Skytta),
                              • -
                              • bug fixes: C14N bug serializing namespaces (Aleksey - Sanin),testSAXproperly initialize the library (William), empty node set - inXPath(William), xmlSchemas errors (William), invalid charref - problempointedby Morus Walter, XInclude xml:base generation (William), - Relax-NGbugwith div processing (William), XPointer and - xml:baseproblem(William),Reader and entities, xmllint return code for - schemas(William), readerstreaming problem (Steve Ball), DTD - serializationproblem (William),libxml.m4 fixes (Mike Hommey), do not - providedestructors as methods onPython classes, xmlReader buffer bug, - Pythonbindings memory interfacesimprovement (with Stéphane Bidoul), Fixed - thepush parser to be back tosynchronous behaviour.
                              • -
                              • improvement: custom per-thread I/O enhancement (Rob - Richards),registernamespace in debug shell (Stefano Debenedetti), Python - basedregressiontest for non-Unix users (William), dynamically increase - thenumber ofXPath extension functions in Python and fix a memory - leak(Marc-AntoineParent and William)
                              • -
                              • performance: hack done with Arjan van de Ven to reduce ELF - footprintandgenerated code on Linux, plus use gcc runtime profiling to - optimizethecode generated in the RPM packages.
                              • +
                              • fixes: RVT fixes (William), XPath context resets bug (William), memory + debug (Steve Hay), catalog white space handling (Peter Breitenlohner), + xmlReader state after attribute reading (William), structured error + handler (William), XInclude generated xml:base fixup (William), Windows + memory reallocation problem (Steve Hay), Out of Memory conditions + handling (William and Olivier Andrieu), htmlNewDoc() charset bug, + htmlReadMemory init (William), a posteriori validation DTD base + (William), notations serialization missing, xmlGetNodePath (Dodji), + xmlCheckUTF8 (Diego Tartara), missing line numbers on entity + (William)
                              • +
                              • improvements: DocBook catalog build scrip (William), xmlcatalog tool + (Albert Chin), xmllint --c14n option, no_proxy environment (Mike Hommey), + xmlParseInNodeContext() addition, extend xmllint --shell, allow XInclude + to not generate start/end nodes, extend xmllint --version to include CVS + tag (William)
                              • +
                              • documentation: web pages fixes, validity API docs fixes (William) + schemas API fix (Eric Haszlakiewicz), xmllint man page (John Fleck)
                              • +

                              2.6.11: July 5 2004

                              • Schemas: a lot of changes and improvements by Kasimier Buchcik for + attributes, namespaces and simple types.
                              • +
                              • build fixes: --with-minimum (William Brack), some gcc cleanup + (William), --with-thread-alloc (William)
                              • +
                              • portability: Windows binary package change (Igor Zlatkovic), Catalog + path on Windows
                              • +
                              • documentation: update to the tutorial (John Fleck), xmllint return code + (John Fleck), man pages (Ville Skytta),
                              • +
                              • bug fixes: C14N bug serializing namespaces (Aleksey Sanin), testSAX + properly initialize the library (William), empty node set in XPath + (William), xmlSchemas errors (William), invalid charref problem pointed + by Morus Walter, XInclude xml:base generation (William), Relax-NG bug + with div processing (William), XPointer and xml:base problem(William), + Reader and entities, xmllint return code for schemas (William), reader + streaming problem (Steve Ball), DTD serialization problem (William), + libxml.m4 fixes (Mike Hommey), do not provide destructors as methods on + Python classes, xmlReader buffer bug, Python bindings memory interfaces + improvement (with Stéphane Bidoul), Fixed the push parser to be back to + synchronous behaviour.
                              • +
                              • improvement: custom per-thread I/O enhancement (Rob Richards), register + namespace in debug shell (Stefano Debenedetti), Python based regression + test for non-Unix users (William), dynamically increase the number of + XPath extension functions in Python and fix a memory leak (Marc-Antoine + Parent and William)
                              • +
                              • performance: hack done with Arjan van de Ven to reduce ELF footprint + and generated code on Linux, plus use gcc runtime profiling to optimize + the code generated in the RPM packages.

                              2.6.10: May 17 2004

                              • Web page generated for ChangeLog
                              • build fixes: --without-html problems, make check without make all
                              • -
                              • portability: problem with xpath.c on Windows (MSC and - Borland),memcmpvs. strncmp on Solaris, XPath tests on Windows (Mark - Vakoc), C++ donotuse "list" as parameter name, make tests work with - Python 1.5(EdDavis),
                              • -
                              • improvements: made xmlTextReaderMode public, small - buffersresizing(Morten Welinder), add --maxmem option to - xmllint,addxmlPopInputCallback() for Matt Sergeant, refactoring - ofserializationescaping, added escaping customization
                              • -
                              • bugfixes: xsd:extension (Taihei Goi), assorted regexp - bugs(WilliamBrack), xmlReader end of stream problem, node deregistration - withreader,URI escaping and filemanes, XHTML1 formatting (Nick - Wellnhofer),regexptransition reduction (William), various XSD Schemas - fixes(KasimierBuchcik), XInclude fallback problem (William), weird - problemswith DTD(William), structured error handler callback context - (William),reversexmlEncodeSpecialChars() behaviour back to escaping - '"'
                              • +
                              • portability: problem with xpath.c on Windows (MSC and Borland), memcmp + vs. strncmp on Solaris, XPath tests on Windows (Mark Vakoc), C++ do not + use "list" as parameter name, make tests work with Python 1.5 (Ed + Davis),
                              • +
                              • improvements: made xmlTextReaderMode public, small buffers resizing + (Morten Welinder), add --maxmem option to xmllint, add + xmlPopInputCallback() for Matt Sergeant, refactoring of serialization + escaping, added escaping customization
                              • +
                              • bugfixes: xsd:extension (Taihei Goi), assorted regexp bugs (William + Brack), xmlReader end of stream problem, node deregistration with reader, + URI escaping and filemanes, XHTML1 formatting (Nick Wellnhofer), regexp + transition reduction (William), various XSD Schemas fixes (Kasimier + Buchcik), XInclude fallback problem (William), weird problems with DTD + (William), structured error handler callback context (William), reverse + xmlEncodeSpecialChars() behaviour back to escaping '"'

                              2.6.9: Apr 18 2004

                              • implement xml:id Working Draft, relaxed XPath id() checking
                              • -
                              • bugfixes: xmlCtxtReset (Brent Hendricks), line number and - CDATA(DaveBeckett), Relax-NG compilation (William Brack), Regexp - patches(withWilliam), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed - problem(withWilliam), Relax-NG name classes compares (William), - XIncludeduplicatefallback (William), external DTD encoding detection - (William), aDTDvalidation bug (William), xmlReader Close() fix, - recusiveextentionschemas
                              • -
                              • improvements: use xmlRead* APIs in test tools (Mark - Vakoc),indentingsave optimization, better handle IIS broken HTTP - redirectbehaviour (IanHummel), HTML parser frameset (James Bursa), - libxml2-pythonRPMdependancy, XML Schemas union support (Kasimier - Buchcik), warningremovalclanup (William), keep ChangeLog compressed when - installing fromRPMs
                              • -
                              • documentation: examples and xmlDocDumpMemory docs (John - Fleck),newexample (load, xpath, modify, save), xmlCatalogDump() - comments,
                              • -
                              • Windows: Borland C++ builder (Eric Zurcher), work - aroundMicrosoftcompiler NaN handling bug (Mark Vakoc)
                              • +
                              • bugfixes: xmlCtxtReset (Brent Hendricks), line number and CDATA (Dave + Beckett), Relax-NG compilation (William Brack), Regexp patches (with + William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with + William), Relax-NG name classes compares (William), XInclude duplicate + fallback (William), external DTD encoding detection (William), a DTD + validation bug (William), xmlReader Close() fix, recusive extention + schemas
                              • +
                              • improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting + save optimization, better handle IIS broken HTTP redirect behaviour (Ian + Hummel), HTML parser frameset (James Bursa), libxml2-python RPM + dependancy, XML Schemas union support (Kasimier Buchcik), warning removal + clanup (William), keep ChangeLog compressed when installing from RPMs
                              • +
                              • documentation: examples and xmlDocDumpMemory docs (John Fleck), new + example (load, xpath, modify, save), xmlCatalogDump() comments,
                              • +
                              • Windows: Borland C++ builder (Eric Zurcher), work around Microsoft + compiler NaN handling bug (Mark Vakoc)

                              2.6.8: Mar 23 2004

                              • First step of the cleanup of the serialization code and APIs
                              • -
                              • XML Schemas: mixed content (Adam Dickmeiss), QName handling - fixes(AdamDickmeiss), anyURI for "" (John Belmonte)
                              • +
                              • XML Schemas: mixed content (Adam Dickmeiss), QName handling fixes (Adam + Dickmeiss), anyURI for "" (John Belmonte)
                              • Python: Canonicalization C14N support added (Anthony Carrico)
                              • xmlDocCopyNode() extension (William)
                              • -
                              • Relax-NG: fix when processing XInclude results - (William),externalreference in interleave (William), missing error - on<choice>failure (William), memory leak in schemas - datatypefacets.
                              • +
                              • Relax-NG: fix when processing XInclude results (William), external + reference in interleave (William), missing error on <choice> + failure (William), memory leak in schemas datatype facets.
                              • xmlWriter: patch for better DTD support (Alfred Mickautsch)
                              • -
                              • bug fixes: xmlXPathLangFunction memory leak (Mike Hommey - andWilliamBrack), no ID errors if using HTML_PARSE_NOERROR, - xmlcatalogfallbacks toURI on SYSTEM lookup failure, XInclude parse - flagsinheritance (William),XInclude and XPointer fixes for entities - (William),XML parser bugreported by Holger Rauch, nanohttp fd leak - (William),regexps chargroups '-' handling (William), dictionnary - reference countingproblems,do not close stderr.
                              • +
                              • bug fixes: xmlXPathLangFunction memory leak (Mike Hommey and William + Brack), no ID errors if using HTML_PARSE_NOERROR, xmlcatalog fallbacks to + URI on SYSTEM lookup failure, XInclude parse flags inheritance (William), + XInclude and XPointer fixes for entities (William), XML parser bug + reported by Holger Rauch, nanohttp fd leak (William), regexps char + groups '-' handling (William), dictionnary reference counting problems, + do not close stderr.
                              • performance patches from Petr Pajas
                              • Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)
                              • -
                              • compilation and portability fixes: --without-valid, - catalogcleanups(Peter Breitenlohner), MingW patch (Roland - Schwingel),cross-compilationto Windows (Christophe de Vienne), - --with-html-dirfixup (Julio MerinoVidal), Windows build (Eric - Zurcher)
                              • +
                              • compilation and portability fixes: --without-valid, catalog cleanups + (Peter Breitenlohner), MingW patch (Roland Schwingel), cross-compilation + to Windows (Christophe de Vienne), --with-html-dir fixup (Julio Merino + Vidal), Windows build (Eric Zurcher)

                              2.6.7: Feb 23 2004

                              • documentation: tutorial updates (John Fleck), benchmark results
                              • xmlWriter: updates and fixes (Alfred Mickautsch, Lucas Brasilino)
                              • XPath optimization (Petr Pajas)
                              • DTD ID handling optimization
                              • -
                              • bugfixes: xpath number with > 19 fractional (William - Brack),pushmode with unescaped '>' characters, fix xmllint --stream - --timing,fixxmllint --memory --stream memory - usage,xmlAttrSerializeTxtContenthandling NULL, trying to fix - Relax-NG/Perlinterface.
                              • +
                              • bugfixes: xpath number with > 19 fractional (William Brack), push + mode with unescaped '>' characters, fix xmllint --stream --timing, fix + xmllint --memory --stream memory usage, xmlAttrSerializeTxtContent + handling NULL, trying to fix Relax-NG/Perl interface.
                              • python: 2.3 compatibility, whitespace fixes (Malcolm Tredinnick)
                              • Added relaxng option to xmllint --shell
                              • -

                              2.6.6: Feb 12 2004

                              • nanohttp and nanoftp: buffer overflow error on URI parsing - (IgorandWilliam) reported by Yuuichi Teranishi
                              • -
                              • bugfixes: make test and path issues, xmlWriter - attributeserialization(William Brack), xmlWriter indentation (William), - schemasvalidation(Eric Haszlakiewicz), XInclude dictionnaries issues - (Williamand OlegParaschenko), XInclude empty fallback (William), HTML - warnings(William),XPointer in XInclude (William), Python - namespaceserialization,isolat1ToUTF8 bound error (Alfred Mickautsch), - output ofparameterentities in internal subset (William), internal subset - bug inpush mode,<xs:all> fix (Alexey Sarytchev)
                              • -
                              • Build: fix for automake-1.8 (Alexander Winston), warningsremoval(Philip - Ludlam), SOCKLEN_T detection fixes (Daniel Richard),fix--with-minimum - configuration.
                              • +

                              2.6.6: Feb 12 2004

                              • nanohttp and nanoftp: buffer overflow error on URI parsing (Igor and + William) reported by Yuuichi Teranishi
                              • +
                              • bugfixes: make test and path issues, xmlWriter attribute serialization + (William Brack), xmlWriter indentation (William), schemas validation + (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg + Paraschenko), XInclude empty fallback (William), HTML warnings (William), + XPointer in XInclude (William), Python namespace serialization, + isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter + entities in internal subset (William), internal subset bug in push mode, + <xs:all> fix (Alexey Sarytchev)
                              • +
                              • Build: fix for automake-1.8 (Alexander Winston), warnings removal + (Philip Ludlam), SOCKLEN_T detection fixes (Daniel Richard), fix + --with-minimum configuration.
                              • XInclude: allow the 2001 namespace without warning.
                              • -
                              • Documentation: missing example/index.html (John - Fleck),versiondependancies (John Fleck)
                              • +
                              • Documentation: missing example/index.html (John Fleck), version + dependancies (John Fleck)
                              • reader API: structured error reporting (Steve Ball)
                              • -
                              • Windows compilation: mingw, msys (Mikhail - Grushinskiy),functionprototype (Cameron Johnson), MSVC6 compiler - warnings,_WINSOCKAPI_patch
                              • -
                              • Parsers: added xmlByteConsumed(ctxt) API to get the byte - offestininput.
                              • -

                              2.6.5: Jan 25 2004

                              • Bugfixes: dictionnaries for schemas (William Brack), - regexpsegfault(William), xs:all problem (William), a number of - XPointerbugfixes(William), xmllint error go to stderr, DTD validation - problemwithnamespace, memory leak (William), SAX1 cleanup and minimal - optionsfixes(Mark Vadoc), parser context reset on error (Shaun McCance), - XPathunionevaluation problem (William) , xmlReallocLoc with NULL - (AlekseySanin),XML Schemas double free (Steve Ball), XInclude with no - href,argumentcallbacks order for XPath callbacks (Frederic Peters)
                              • -
                              • Documentation: python scripts (William Brack), xslt - stylesheets(JohnFleck), doc (Sven Zimmerman), I/O example.
                              • -
                              • Python bindings: fixes (William), enum support - (StéphaneBidoul),structured error reporting (Stéphane Bidoul)
                              • -
                              • XInclude: various fixes for conformance, problem related - todictionnaryreferences (William & me), recursion (William)
                              • -
                              • xmlWriter: indentation (Lucas Brasilino), memory - leaks(AlfredMickautsch),
                              • +
                              • Windows compilation: mingw, msys (Mikhail Grushinskiy), function + prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_ + patch
                              • +
                              • Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in + input.
                              • +

                              2.6.5: Jan 25 2004

                              • Bugfixes: dictionnaries for schemas (William Brack), regexp segfault + (William), xs:all problem (William), a number of XPointer bugfixes + (William), xmllint error go to stderr, DTD validation problem with + namespace, memory leak (William), SAX1 cleanup and minimal options fixes + (Mark Vadoc), parser context reset on error (Shaun McCance), XPath union + evaluation problem (William) , xmlReallocLoc with NULL (Aleksey Sanin), + XML Schemas double free (Steve Ball), XInclude with no href, argument + callbacks order for XPath callbacks (Frederic Peters)
                              • +
                              • Documentation: python scripts (William Brack), xslt stylesheets (John + Fleck), doc (Sven Zimmerman), I/O example.
                              • +
                              • Python bindings: fixes (William), enum support (Stéphane Bidoul), + structured error reporting (Stéphane Bidoul)
                              • +
                              • XInclude: various fixes for conformance, problem related to dictionnary + references (William & me), recursion (William)
                              • +
                              • xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred + Mickautsch),
                              • xmlSchemas: normalizedString datatype (John Belmonte)
                              • code cleanup for strings functions (William)
                              • Windows: compiler patches (Mark Vakoc)
                              • -
                              • Parser optimizations, a few new XPath and dictionnary APIs - forfutureXSLT optimizations.
                              • +
                              • Parser optimizations, a few new XPath and dictionnary APIs for future + XSLT optimizations.

                              2.6.4: Dec 24 2003

                              • Windows build fixes (Igor Zlatkovic)
                              • Some serious XInclude problems reported by Oleg Paraschenko and
                              • Unix and Makefile packaging fixes (me, William Brack,
                              • -
                              • Documentation improvements (John Fleck, William Brack), - examplefix(Lucas Brasilino)
                              • -
                              • bugfixes: xmlTextReaderExpand() with xmlReaderWalker, XPath - handlingofNULL strings (William Brack) , API building reader or - parserfromfiledescriptor should not close it, changed XPath sorting to - bestableagain (William Brack), xmlGetNodePath() generating - '(null)'(WilliamBrack), DTD validation and namespace bug (William Brack), - XMLSchemasdouble inclusion behaviour
                              • +
                              • Documentation improvements (John Fleck, William Brack), example fix + (Lucas Brasilino)
                              • +
                              • bugfixes: xmlTextReaderExpand() with xmlReaderWalker, XPath handling of + NULL strings (William Brack) , API building reader or parser from + filedescriptor should not close it, changed XPath sorting to be stable + again (William Brack), xmlGetNodePath() generating '(null)' (William + Brack), DTD validation and namespace bug (William Brack), XML Schemas + double inclusion behaviour

                              2.6.3: Dec 10 2003

                              • documentation updates and cleanup (DV, William Brack, John Fleck)
                              • -
                              • added a repository of examples, examples from Aleksey - Sanin,DodjiSeketeli, Alfred Mickautsch
                              • -
                              • Windows updates: Mark Vakoc, Igor Zlatkovic, Eric Zurcher,Mingw(Kenneth - Haley)
                              • +
                              • added a repository of examples, examples from Aleksey Sanin, Dodji + Seketeli, Alfred Mickautsch
                              • +
                              • Windows updates: Mark Vakoc, Igor Zlatkovic, Eric Zurcher, Mingw + (Kenneth Haley)
                              • Unicode range checking (William Brack)
                              • code cleanup (William Brack)
                              • Python bindings: doc (John Fleck), bug fixes
                              • UTF-16 cleanup and BOM issues (William Brack)
                              • -
                              • bug fixes: ID and xmlReader validation, XPath (William - Brack),xmlWriter(Alfred Mickautsch), hash.h inclusion problem, HTML - parser(James Bursa),attribute defaulting and validation, some - serializationcleanups,XML_GET_LINE macro, memory debug when using threads - (WilliamBrack),serialization of attributes and entities content, - xmlWriter(DanielSchulman)
                              • -
                              • XInclude bugfix, new APIs and update to the last version - includingthenamespace change.
                              • -
                              • XML Schemas improvements: include (Robert Stepanek), importandnamespace - handling, fixed the regression tests troubles, addedexamplesbased on Eric - van der Vlist book, regexp fixes
                              • -
                              • preliminary pattern support for streaming (needed - forschemasconstraints), added xmlTextReaderPreservePattern() to - collectsubdocumentwhen streaming.
                              • +
                              • bug fixes: ID and xmlReader validation, XPath (William Brack), + xmlWriter (Alfred Mickautsch), hash.h inclusion problem, HTML parser + (James Bursa), attribute defaulting and validation, some serialization + cleanups, XML_GET_LINE macro, memory debug when using threads (William + Brack), serialization of attributes and entities content, xmlWriter + (Daniel Schulman)
                              • +
                              • XInclude bugfix, new APIs and update to the last version including the + namespace change.
                              • +
                              • XML Schemas improvements: include (Robert Stepanek), import and + namespace handling, fixed the regression tests troubles, added examples + based on Eric van der Vlist book, regexp fixes
                              • +
                              • preliminary pattern support for streaming (needed for schemas + constraints), added xmlTextReaderPreservePattern() to collect subdocument + when streaming.
                              • various fixes in the structured error handling

                              2.6.2: Nov 4 2003

                              • XPath context unregistration fixes
                              • text node coalescing fixes (Mark Lilback)
                              • @@ -501,118 +542,117 @@ base.

                                There is the list of public releases:

                                2.6.26: Jun 6 2006

                              • a posteriori DTD validation fixes
                              • xmlReader bug fixes: Walker fixes, python bindings
                              • fixed xmlStopParser() to really stop the parser and errors
                              • -
                              • always generate line numbers when using the new xmlReadxxxfunctions
                              • +
                              • always generate line numbers when using the new xmlReadxxx + functions
                              • added XInclude support to the xmlReader interface
                              • implemented XML_PARSE_NONET parser option
                              • DocBook XSLT processing bug fixed
                              • HTML serialization for <p> elements (William Brack and me)
                              • XPointer failure in XInclude are now handled as resource errors
                              • -
                              • fixed xmllint --html to use the HTML serializer on output(added--xmlout - to implement the previous behaviour of saving it using - theXMLserializer)
                              • +
                              • fixed xmllint --html to use the HTML serializer on output (added + --xmlout to implement the previous behaviour of saving it using the XML + serializer)

                              2.6.1: Oct 28 2003

                              • Mostly bugfixes after the big 2.6.0 changes
                              • -
                              • Unix compilation patches: libxml.m4 (Patrick Welche), - warningscleanup(William Brack)
                              • -
                              • Windows compilation patches (Joachim Bauch, Stephane - Bidoul,IgorZlatkovic)
                              • +
                              • Unix compilation patches: libxml.m4 (Patrick Welche), warnings cleanup + (William Brack)
                              • +
                              • Windows compilation patches (Joachim Bauch, Stephane Bidoul, Igor + Zlatkovic)
                              • xmlWriter bugfix (Alfred Mickautsch)
                              • chvalid.[ch]: couple of fixes from Stephane Bidoul
                              • -
                              • context reset: error state reset, push parser reset (GrahamBennett)
                              • +
                              • context reset: error state reset, push parser reset (Graham + Bennett)
                              • context reuse: generate errors if file is not readable
                              • -
                              • defaulted attributes for element coming from internal - entities(StephaneBidoul)
                              • +
                              • defaulted attributes for element coming from internal entities + (Stephane Bidoul)
                              • Python: tab and spaces mix (William Brack)
                              • Error handler could crash in DTD validation in 2.6.0
                              • xmlReader: do not use the document or element _private field
                              • testSAX.c: avoid a problem with some PIs (Massimo Morara)
                              • -
                              • general bug fixes: mandatory encoding in text decl, - serializingDocumentFragment nodes, xmlSearchNs 2.6.0 problem (Kasimier - Buchcik),XPath errorsnot reported, slow HTML parsing of large - documents.
                              • -

                              2.6.0: Oct 20 2003

                              • Major revision release: should be API and ABI compatible but got alotof - change
                              • -
                              • Increased the library modularity, far more options can be strippedout,a - --with-minimum configuration will weight around 160KBytes
                              • -
                              • Use per parser and per document dictionnary, allocate names - andsmalltext nodes from the dictionnary
                              • -
                              • Switch to a SAX2 like parser rewrote most of the XML - parsercore,provides namespace resolution and defaulted attributes, - minimizememoryallocations and copies, namespace checking and specific - errorhandling,immutable buffers, make predefined entities static - structures,etc...
                              • -
                              • rewrote all the error handling in the library, all errors - canbeintercepted at a structured level, with - preciseinformationavailable.
                              • -
                              • New simpler and more generic XML and HTML parser APIs, - allowingtoeasilly modify the parsing options and reuse parser context - formultipleconsecutive documents.
                              • -
                              • Similar new APIs for the xmlReader, for options and reuse, - providednewfunctions to access content as const strings, use them - forPythonbindings
                              • -
                              • a lot of other smaller API improvements: xmlStrPrintf - (AlekseySanin),Walker i.e. reader on a document tree based on Alfred - Mickautschcode,make room in nodes for line numbers, reference counting - and futurePSVIextensions, generation of character ranges to be checked - withfasteralgorithm (William), xmlParserMaxDepth (Crutcher - Dunnavant),bufferaccess
                              • +
                              • general bug fixes: mandatory encoding in text decl, serializing + Document Fragment nodes, xmlSearchNs 2.6.0 problem (Kasimier Buchcik), + XPath errors not reported, slow HTML parsing of large documents.
                              • +

                              2.6.0: Oct 20 2003

                              • Major revision release: should be API and ABI compatible but got a lot + of change
                              • +
                              • Increased the library modularity, far more options can be stripped out, + a --with-minimum configuration will weight around 160KBytes
                              • +
                              • Use per parser and per document dictionnary, allocate names and small + text nodes from the dictionnary
                              • +
                              • Switch to a SAX2 like parser rewrote most of the XML parser core, + provides namespace resolution and defaulted attributes, minimize memory + allocations and copies, namespace checking and specific error handling, + immutable buffers, make predefined entities static structures, etc...
                              • +
                              • rewrote all the error handling in the library, all errors can be + intercepted at a structured level, with precise information + available.
                              • +
                              • New simpler and more generic XML and HTML parser APIs, allowing to + easilly modify the parsing options and reuse parser context for multiple + consecutive documents.
                              • +
                              • Similar new APIs for the xmlReader, for options and reuse, provided new + functions to access content as const strings, use them for Python + bindings
                              • +
                              • a lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin), + Walker i.e. reader on a document tree based on Alfred Mickautsch code, + make room in nodes for line numbers, reference counting and future PSVI + extensions, generation of character ranges to be checked with faster + algorithm (William), xmlParserMaxDepth (Crutcher Dunnavant), buffer + access
                              • New xmlWriter API provided by Alfred Mickautsch
                              • Schemas: base64 support by Anthony Carrico
                              • -
                              • Parser<->HTTP integration fix, proper processing of - theMime-Typeand charset informations if available.
                              • -
                              • Relax-NG: bug fixes including the one reported by Martijn - FaassenandzeroOrMore, better error reporting.
                              • -
                              • Python bindings (Stéphane Bidoul), never use stdout forerrorsoutput
                              • -
                              • Portability: all the headers have macros for export - andcallingconvention definitions (Igor Zlatkovic), VMS update (Craig - A.Berry),Windows: threads (Jesse Pelton), Borland compiler (Eric - Zurcher,Igor),Mingw (Igor), typos (Mark Vakoc), beta version - (StephaneBidoul),warning cleanups on AIX and MIPS compilers (William - Brack), BeOS(Marcin'Shard' Konicki)
                              • -
                              • Documentation fixes and README (William Brack), search - fix(William),tutorial updates (John Fleck), namespace docs (Stefan - Kost)
                              • -
                              • Bug fixes: xmlCleanupParser (Dave Beckett), - threadinguninitializedmutexes, HTML doctype lowercase, SAX/IO - (William),compression detectionand restore (William), attribute - declaration in DTDs(William), namespaceon attribute in HTML output - (William), input filename(Rob Richards),namespace DTD validation, - xmlReplaceNode (Chris Ryland),I/O callbacks(Markus Keim), CDATA - serialization (Shaun McCance),xmlReader (PeterDerr), high codepoint - charref like &#x10FFFF;, bufferaccess in pushmode (Justin Fletcher), - TLS threads on Windows (JessePelton), XPath bug(William), - xmlCleanupParser (Marc Liyanage), CDATAoutput (William), HTTPerror - handling.
                              • -
                              • xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 - forcompattesting, --nodict for building without tree dictionnary, - --nocdatatoreplace CDATA by text, --nsclean to remove - surperfluousnamespacedeclarations
                              • +
                              • Parser<->HTTP integration fix, proper processing of the Mime-Type + and charset informations if available.
                              • +
                              • Relax-NG: bug fixes including the one reported by Martijn Faassen and + zeroOrMore, better error reporting.
                              • +
                              • Python bindings (Stéphane Bidoul), never use stdout for errors + output
                              • +
                              • Portability: all the headers have macros for export and calling + convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry), + Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher, Igor), + Mingw (Igor), typos (Mark Vakoc), beta version (Stephane Bidoul), + warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin + 'Shard' Konicki)
                              • +
                              • Documentation fixes and README (William Brack), search fix (William), + tutorial updates (John Fleck), namespace docs (Stefan Kost)
                              • +
                              • Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized + mutexes, HTML doctype lowercase, SAX/IO (William), compression detection + and restore (William), attribute declaration in DTDs (William), namespace + on attribute in HTML output (William), input filename (Rob Richards), + namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks + (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter + Derr), high codepoint charref like &#x10FFFF;, buffer access in push + mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug + (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP + error handling.
                              • +
                              • xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat + testing, --nodict for building without tree dictionnary, --nocdata to + replace CDATA by text, --nsclean to remove surperfluous namespace + declarations
                              • added xml2-config --libtool-libs option from Kevin P. Fleming
                              • -
                              • a lot of profiling and tuning of the code, speedup - patchforxmlSearchNs() by Luca Padovani. The xmlReader should do - farlessallocation and it speed should get closer to SAX. Chris - Andersonworkedon speeding and cleaning up repetitive checking code.
                              • +
                              • a lot of profiling and tuning of the code, speedup patch for + xmlSearchNs() by Luca Padovani. The xmlReader should do far less + allocation and it speed should get closer to SAX. Chris Anderson worked + on speeding and cleaning up repetitive checking code.
                              • cleanup of "make tests"
                              • libxml-2.0-uninstalled.pc from Malcolm Tredinnick
                              • -
                              • deactivated the broken docBook SGML parser code and plugged - theXMLparser instead.
                              • +
                              • deactivated the broken docBook SGML parser code and plugged the XML + parser instead.

                              2.5.11: Sep 9 2003

                              A bugfix only release:

                              • risk of crash in Relax-NG
                              • risk of crash when using multithreaded programs

                              2.5.10: Aug 15 2003

                              A bugfixes only release

                              • Windows Makefiles (William Brack)
                              • UTF-16 support fixes (Mark Itzcovitz)
                              • -
                              • Makefile and portability (William Brack) automake, Linux alpha, - MingwonWindows (Mikhail Grushinskiy)
                              • +
                              • Makefile and portability (William Brack) automake, Linux alpha, Mingw + on Windows (Mikhail Grushinskiy)
                              • HTML parser (Oliver Stoeneberg)
                              • XInclude performance problem reported by Kevin Ruscoe
                              • XML parser performance problem reported by Grant Goodale
                              • xmlSAXParseDTD() bug fix from Malcolm Tredinnick
                              • and a couple other cleanup
                              • -

                              2.5.9: Aug 9 2003

                              • bugfixes: IPv6 portability, xmlHasNsProp (Markus Keim), - Windowsbuild(Wiliam Brake, Jesse Pelton, Igor), Schemas (Peter - Sobisch),threading(Rob Richards), hexBinary type (), UTF-16 BOM - (DodjiSeketeli),xmlReader, Relax-NG schemas compilation, namespace - handling,EXSLT (SeanGriffin), HTML parsing problem (William Brack), DTD - validationfor mixedcontent + namespaces, HTML serialization, - libraryinitialization,progressive HTML parser
                              • +

                              2.5.9: Aug 9 2003

                              • bugfixes: IPv6 portability, xmlHasNsProp (Markus Keim), Windows build + (Wiliam Brake, Jesse Pelton, Igor), Schemas (Peter Sobisch), threading + (Rob Richards), hexBinary type (), UTF-16 BOM (Dodji Seketeli), + xmlReader, Relax-NG schemas compilation, namespace handling, EXSLT (Sean + Griffin), HTML parsing problem (William Brack), DTD validation for mixed + content + namespaces, HTML serialization, library initialization, + progressive HTML parser
                              • better interfaces for Relax-NG error handling (Joachim Bauch, )
                              • adding xmlXIncludeProcessTree() for XInclud'ing in a subtree
                              • doc fixes and improvements (John Fleck)
                              • @@ -620,121 +660,122 @@ base.

                                There is the list of public releases:

                                2.6.26: Jun 6 2006

                              • couple of new UTF-8 helper functions (William Brack)
                              • general encoding cleanup + ISO-8859-x without iconv (Peter Jacobi)
                              • xmlTextReader cleanup + enum for node types (Bjorn Reese)
                              • -
                              • general compilation/warning cleanup Solaris/HP-UX/...(WilliamBrack)
                              • -

                              2.5.8: Jul 6 2003

                              • bugfixes: XPath, XInclude, file/URI mapping, UTF-16 - save(MarkItzcovitz), UTF-8 checking, URI saving, error printing - (WilliamBrack),PI related memleak, compilation without schemas or without - xpath(JoergSchmitz-Linneweber/Garry Pennington), xmlUnlinkNode problem - withDTDs,rpm problem on , i86_64, removed a few compilation problems - from2.5.7,xmlIOParseDTD, and xmlSAXParseDTD (Malcolm Tredinnick)
                              • +
                              • general compilation/warning cleanup Solaris/HP-UX/... (William + Brack)
                              • +

                              2.5.8: Jul 6 2003

                              • bugfixes: XPath, XInclude, file/URI mapping, UTF-16 save (Mark + Itzcovitz), UTF-8 checking, URI saving, error printing (William Brack), + PI related memleak, compilation without schemas or without xpath (Joerg + Schmitz-Linneweber/Garry Pennington), xmlUnlinkNode problem with DTDs, + rpm problem on , i86_64, removed a few compilation problems from 2.5.7, + xmlIOParseDTD, and xmlSAXParseDTD (Malcolm Tredinnick)
                              • portability: DJGPP (MsDos) , OpenVMS (Craig A. Berry)
                              • William Brack fixed multithreading lock problems
                              • IPv6 patch for FTP and HTTP accesses (Archana Shah/Wipro)
                              • -
                              • Windows fixes (Igor Zlatkovic, Eric Zurcher), - threading(StéphaneBidoul)
                              • +
                              • Windows fixes (Igor Zlatkovic, Eric Zurcher), threading (Stéphane + Bidoul)
                              • A few W3C Schemas Structure improvements
                              • W3C Schemas Datatype improvements (Charlie Bozeman)
                              • -
                              • Python bindings for thread globals (Stéphane Bidoul), - andmethod/classgenerator
                              • +
                              • Python bindings for thread globals (Stéphane Bidoul), and method/class + generator
                              • added --nonet option to xmllint
                              • documentation improvements (John Fleck)
                              • -

                              2.5.7: Apr 25 2003

                              • Relax-NG: Compiling to regexp and streaming validation on top - ofthexmlReader interface, added to xmllint --stream
                              • +

                              2.5.7: Apr 25 2003

                              • Relax-NG: Compiling to regexp and streaming validation on top of the + xmlReader interface, added to xmllint --stream
                              • xmlReader: Expand(), Next() and DOM access glue, bug fixes
                              • Support for large files: RGN validated a 4.5GB instance
                              • Thread support is now configured in by default
                              • -
                              • Fixes: update of the Trio code (Bjorn), WXS Date and - Durationfixes(Charles Bozeman), DTD and namespaces (Brent Hendricks), - HTML pushparserand zero bytes handling, some missing Windows file - pathconversions,behaviour of the parser and validator in the presence of - "outof memory"error conditions
                              • -
                              • extended the API to be able to plug a garbage - collectingmemoryallocator, added xmlMallocAtomic() and modified - theallocationsaccordingly.
                              • -
                              • Performances: removed excessive malloc() calls, speedup of the - pushandxmlReader interfaces, removed excessive thread locking
                              • +
                              • Fixes: update of the Trio code (Bjorn), WXS Date and Duration fixes + (Charles Bozeman), DTD and namespaces (Brent Hendricks), HTML push parser + and zero bytes handling, some missing Windows file path conversions, + behaviour of the parser and validator in the presence of "out of memory" + error conditions
                              • +
                              • extended the API to be able to plug a garbage collecting memory + allocator, added xmlMallocAtomic() and modified the allocations + accordingly.
                              • +
                              • Performances: removed excessive malloc() calls, speedup of the push and + xmlReader interfaces, removed excessive thread locking
                              • Documentation: man page (John Fleck), xmlReader documentation
                              • Python: adding binding for xmlCatalogAddLocal (Brent M Hendricks)
                              • -

                              2.5.6: Apr 1 2003

                              • Fixed W3C XML Schemas datatype, should be compliant now exceptforbinHex - and base64 which are not supported yet.
                              • -
                              • bug fixes: non-ASCII IDs, HTML output, XInclude on large - docsandXInclude entities handling, encoding detection on external - subsets,XMLSchemas bugs and memory leaks, HTML parser (James Bursa)
                              • +

                              2.5.6: Apr 1 2003

                              • Fixed W3C XML Schemas datatype, should be compliant now except for + binHex and base64 which are not supported yet.
                              • +
                              • bug fixes: non-ASCII IDs, HTML output, XInclude on large docs and + XInclude entities handling, encoding detection on external subsets, XML + Schemas bugs and memory leaks, HTML parser (James Bursa)
                              • portability: python/trio (Albert Chin), Sun compiler warnings
                              • documentation: added --relaxng option to xmllint man page (John)
                              • -
                              • improved error reporting: xml:space, start/end tag mismatches, - RelaxNGerrors
                              • -

                              2.5.5: Mar 24 2003

                              • Lot of fixes on the Relax NG implementation. More - testingincludingDocBook and TEI examples.
                              • +
                              • improved error reporting: xml:space, start/end tag mismatches, Relax NG + errors
                              • +

                              2.5.5: Mar 24 2003

                              • Lot of fixes on the Relax NG implementation. More testing including + DocBook and TEI examples.
                              • Increased the support for W3C XML Schemas datatype
                              • Several bug fixes in the URI handling layer
                              • -
                              • Bug fixes: HTML parser, xmlReader, DTD validation, - XPath,encodingconversion, line counting in the parser.
                              • +
                              • Bug fixes: HTML parser, xmlReader, DTD validation, XPath, encoding + conversion, line counting in the parser.
                              • Added support for $XMLLINT_INDENT environment variable, FTP delete
                              • Fixed the RPM spec file name
                              • -

                              2.5.4: Feb 20 2003

                              • Conformance testing and lot of fixes on Relax NG - andXIncludeimplementation
                              • +

                              2.5.4: Feb 20 2003

                              • Conformance testing and lot of fixes on Relax NG and XInclude + implementation
                              • Implementation of XPointer element() scheme
                              • -
                              • Bug fixes: XML parser, XInclude entities merge, validity - checkingonnamespaces, -

                                2 serialization bugs, node info generation problems, a - DTDregexpgeneration problem.

                                +
                              • Bug fixes: XML parser, XInclude entities merge, validity checking on + namespaces, +

                                2 serialization bugs, node info generation problems, a DTD regexp + generation problem.

                              • Portability: windows updates and path canonicalization (Igor)
                              • A few typo fixes (Kjartan Maraas)
                              • Python bindings generator fixes (Stephane Bidoul)
                              • -

                              2.5.3: Feb 10 2003

                              • RelaxNG and XML Schemas datatypes improvements, and added afirstversion - of RelaxNG Python bindings
                              • -
                              • Fixes: XLink (Sean Chittenden), XInclude (Sean Chittenden), API - fixforserializing namespace nodes, encoding conversion - bug,XHTML1serialization
                              • +

                              2.5.3: Feb 10 2003

                              • RelaxNG and XML Schemas datatypes improvements, and added a first + version of RelaxNG Python bindings
                              • +
                              • Fixes: XLink (Sean Chittenden), XInclude (Sean Chittenden), API fix for + serializing namespace nodes, encoding conversion bug, XHTML1 + serialization
                              • Portability fixes: Windows (Igor), AMD 64bits RPM spec file

                              2.5.2: Feb 5 2003

                              • First implementation of RelaxNG, added --relaxng flag to xmllint
                              • Schemas support now compiled in by default.
                              • -
                              • Bug fixes: DTD validation, namespace checking, XInclude - andentities,delegateURI in XML Catalogs, HTML parser, XML reader - (StéphaneBidoul),XPath parser and evaluation, UTF8ToUTF8 serialization, - XMLreader memoryconsumption, HTML parser, HTML serialization in the - presenceofnamespaces
                              • +
                              • Bug fixes: DTD validation, namespace checking, XInclude and entities, + delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane Bidoul), + XPath parser and evaluation, UTF8ToUTF8 serialization, XML reader memory + consumption, HTML parser, HTML serialization in the presence of + namespaces
                              • added an HTML API to check elements and attributes.
                              • -
                              • Documentation improvement, PDF for the tutorial (John Fleck),docpatches - (Stefan Kost)
                              • +
                              • Documentation improvement, PDF for the tutorial (John Fleck), doc + patches (Stefan Kost)
                              • Portability fixes: NetBSD (Julio Merino), Windows (Igor Zlatkovic)
                              • -
                              • Added python bindings for XPointer, contextual error - reporting(StéphaneBidoul)
                              • +
                              • Added python bindings for XPointer, contextual error reporting + (Stéphane Bidoul)
                              • URI/file escaping problems (Stefano Zacchiroli)

                              2.5.1: Jan 8 2003

                              • Fixes a memory leak and configuration/compilation problems in 2.5.0
                              • documentation updates (John)
                              • a couple of XmlTextReader fixes
                              • -

                              2.5.0: Jan 6 2003

                              2.5.0: Jan 6 2003

                              • New XmltextReader interface based on C# + API (with help of Stéphane Bidoul)
                              • Windows: more exports, including the new API (Igor)
                              • XInclude fallback fix
                              • -
                              • Python: bindings for the new API, packaging - (StéphaneBidoul),drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), - fixes,speedupand iterators for Python-2.2 (Hannu Krosing)
                              • -
                              • Tutorial fixes (john Fleck and Niraj Tolia) xmllint manupdate(John)
                              • +
                              • Python: bindings for the new API, packaging (Stéphane Bidoul), + drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, speedup + and iterators for Python-2.2 (Hannu Krosing)
                              • +
                              • Tutorial fixes (john Fleck and Niraj Tolia) xmllint man update + (John)
                              • Fix an XML parser bug raised by Vyacheslav Pindyura
                              • Fix for VMS serialization (Nigel Hall) and config (Craig A. Berry)
                              • Entities handling fixes
                              • -
                              • new API to optionally track node creation and - deletion(LukasSchroeder)
                              • +
                              • new API to optionally track node creation and deletion (Lukas + Schroeder)
                              • Added documentation for the XmltextReader interface and some XML guidelines

                              2.4.30: Dec 12 2002

                              • 2.4.29 broke the python bindings, rereleasing
                              • -
                              • Improvement/fixes of the XML API generator, and couple of - minorcodefixes.
                              • -

                              2.4.29: Dec 11 2002

                              • Windows fixes (Igor): Windows CE port, pthread linking, - pythonbindings(Stéphane Bidoul), Mingw (Magnus Henoch), and export - listupdates
                              • +
                              • Improvement/fixes of the XML API generator, and couple of minor code + fixes.
                              • +

                              2.4.29: Dec 11 2002

                              • Windows fixes (Igor): Windows CE port, pthread linking, python bindings + (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
                              • Fix for prev in python bindings (ERDI Gergo)
                              • Fix for entities handling (Marcus Clarke)
                              • -
                              • Refactored the XML and HTML dumps to a single code path, - fixedXHTML1dump
                              • +
                              • Refactored the XML and HTML dumps to a single code path, fixed XHTML1 + dump
                              • Fix for URI parsing when handling URNs with fragment identifiers
                              • Fix for HTTP URL escaping problem
                              • added an TextXmlReader (C#) like API (work in progress)
                              • -
                              • Rewrote the API in XML generation script, includes a C parser - andsavesmore informations needed for C# bindings
                              • +
                              • Rewrote the API in XML generation script, includes a C parser and saves + more informations needed for C# bindings

                              2.4.28: Nov 22 2002

                              • a couple of python binding fixes
                              • 2 bug fixes in the XML push parser
                              • potential memory leak removed (Martin Stoilov)
                              • @@ -743,41 +784,41 @@ base.

                                There is the list of public releases:

                                2.6.26: Jun 6 2006

                              • autodetection of XHTML1 and specific serialization rules added
                              • nasty threading bug fixed (William Brack)

                              2.4.27: Nov 17 2002

                              • fixes for the Python bindings
                              • -
                              • a number of bug fixes: SGML catalogs,xmlParseBalancedChunkMemory(),HTML - parser, Schemas (Charles Bozeman),document fragment support(Christian - Glahn), xmlReconciliateNs (BrianStafford), XPointer,xmlFreeNode(), - xmlSAXParseMemory (Peter Jones),xmlGetNodePath (PetrPajas), entities - processing
                              • +
                              • a number of bug fixes: SGML catalogs, xmlParseBalancedChunkMemory(), + HTML parser, Schemas (Charles Bozeman), document fragment support + (Christian Glahn), xmlReconciliateNs (Brian Stafford), XPointer, + xmlFreeNode(), xmlSAXParseMemory (Peter Jones), xmlGetNodePath (Petr + Pajas), entities processing
                              • added grep to xmllint --shell
                              • VMS update patch from Craig A. Berry
                              • -
                              • cleanup of the Windows build with support for more - compilers(Igor),better thread support on Windows
                              • +
                              • cleanup of the Windows build with support for more compilers (Igor), + better thread support on Windows
                              • cleanup of Unix Makefiles and spec file
                              • Improvements to the documentation (John Fleck)

                              2.4.26: Oct 18 2002

                              • Patches for Windows CE port, improvements on Windows paths handling
                              • -
                              • Fixes to the validation code (DTD and Schemas), xmlNodeGetPath() - ,HTMLserialization, Namespace compliance, and a number of - smallproblems
                              • -

                              2.4.25: Sep 26 2002

                              • A number of bug fixes: XPath, validation, Python bindings, DOM - andtree,xmlI/O, Html
                              • +
                              • Fixes to the validation code (DTD and Schemas), xmlNodeGetPath() , + HTML serialization, Namespace compliance, and a number of small + problems
                              • +

                              2.4.25: Sep 26 2002

                              • A number of bug fixes: XPath, validation, Python bindings, DOM and + tree, xmlI/O, Html
                              • Serious rewrite of XInclude
                              • -
                              • Made XML Schemas regexp part of the default build and APIs, smallfixand - improvement of the regexp core
                              • +
                              • Made XML Schemas regexp part of the default build and APIs, small fix + and improvement of the regexp core
                              • Changed the validation code to reuse XML Schemas regexp APIs
                              • -
                              • Better handling of Windows file paths, improvement of - Makefiles(Igor,Daniel Gehriger, Mark Vakoc)
                              • -
                              • Improved the python I/O bindings, the tests, added resolver - andregexpAPIs
                              • +
                              • Better handling of Windows file paths, improvement of Makefiles (Igor, + Daniel Gehriger, Mark Vakoc)
                              • +
                              • Improved the python I/O bindings, the tests, added resolver and regexp + APIs
                              • New logos from Marc Liyanage
                              • Tutorial improvements: John Fleck, Christopher Harris
                              • -
                              • Makefile: Fixes for AMD x86_64 (Mandrake), - DESTDIR(ChristopheMerlet)
                              • +
                              • Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR (Christophe + Merlet)
                              • removal of all stderr/perror use for error reporting
                              • Better error reporting: XPath and DTD validation
                              • update of the trio portability layer (Bjorn Reese)

                              2.4.24: Aug 22 2002

                              • XPath fixes (William), xf:escape-uri() (Wesley Terpstra)
                              • -
                              • Python binding fixes: makefiles (William), generator, rpm - build,x86-64(fcrozat)
                              • +
                              • Python binding fixes: makefiles (William), generator, rpm build, x86-64 + (fcrozat)
                              • HTML <style> and boolean attributes serializer fixes
                              • C14N improvements by Aleksey
                              • doc cleanups: Rick Jones
                              • @@ -787,98 +828,96 @@ base.

                                There is the list of public releases:

                                2.6.26: Jun 6 2006

                              • c14n fixes, testsuite and performances: Aleksey Sanin
                              • added xmlDocFormatDump: Chema Celorio
                              • new tutorial: John Fleck
                              • -
                              • new hash functions and performances: Sander Vesik, portability - fixfromPeter Jacobi
                              • -
                              • a number of bug fixes: XPath (William Brack, Richard Jinks), XMLandHTML - parsers, ID lookup function
                              • +
                              • new hash functions and performances: Sander Vesik, portability fix from + Peter Jacobi
                              • +
                              • a number of bug fixes: XPath (William Brack, Richard Jinks), XML and + HTML parsers, ID lookup function
                              • removal of all remaining sprintf: Aleksey Sanin
                              • -

                              2.4.22: May 27 2002

                              • a number of bug fixes: configure scripts, base handling, - parser,memoryusage, HTML parser, XPath, documentation - (ChristianCornelssen),indentation, URI parsing
                              • -
                              • Optimizations for XMLSec, fixing and making public some of - thenetworkprotocol handlers (Aleksey)
                              • +

                              2.4.22: May 27 2002

                              • a number of bug fixes: configure scripts, base handling, parser, memory + usage, HTML parser, XPath, documentation (Christian Cornelssen), + indentation, URI parsing
                              • +
                              • Optimizations for XMLSec, fixing and making public some of the network + protocol handlers (Aleksey)
                              • performance patch from Gary Pennington
                              • -
                              • Charles Bozeman provided date and time support for - XMLSchemasdatatypes
                              • -

                              2.4.21: Apr 29 2002

                              This release is both a bug fix release and also contains the -earlyXMLSchemas structuresand -datatypescode, -beware,allinterfaces are likely to change, there is huge holes, it is clearly -a workinprogress and don't even think of putting this code in a -productionsystem,it's actually not compiled in by default. The real fixes -are:

                              • a couple of bugs or limitations introduced in 2.4.20
                              • +
                              • Charles Bozeman provided date and time support for XML Schemas + datatypes
                              • +

                              2.4.21: Apr 29 2002

                              This release is both a bug fix release and also contains the early XML +Schemas structures and datatypes code, beware, all +interfaces are likely to change, there is huge holes, it is clearly a work in +progress and don't even think of putting this code in a production system, +it's actually not compiled in by default. The real fixes are:

                              • a couple of bugs or limitations introduced in 2.4.20
                              • patches for Borland C++ and MSC by Igor
                              • -
                              • some fixes on XPath strings and conformance patches by RichardJinks
                              • +
                              • some fixes on XPath strings and conformance patches by Richard + Jinks
                              • patch from Aleksey for the ExcC14N specification
                              • OSF/1 bug fix by Bjorn

                              2.4.20: Apr 15 2002

                              • bug fixes: file descriptor leak, XPath, HTML output, DTD validation
                              • XPath conformance testing by Richard Jinks
                              • -
                              • Portability fixes: Solaris, MPE/iX, Windows, OSF/1, - pythonbindings,libxml.m4
                              • -

                              2.4.19: Mar 25 2002

                              • bug fixes: half a dozen XPath bugs, Validation, ISO-Latin - toUTF8encoder
                              • +
                              • Portability fixes: Solaris, MPE/iX, Windows, OSF/1, python bindings, + libxml.m4
                              • +

                              2.4.19: Mar 25 2002

                              • bug fixes: half a dozen XPath bugs, Validation, ISO-Latin to UTF8 + encoder
                              • portability fixes in the HTTP code
                              • memory allocation checks using valgrind, and profiling tests
                              • revamp of the Windows build and Makefiles
                              • -

                              2.4.18: Mar 18 2002

                              • bug fixes: tree, SAX, canonicalization, - validation,portability,XPath
                              • +

                              2.4.18: Mar 18 2002

                              • bug fixes: tree, SAX, canonicalization, validation, portability, + XPath
                              • removed the --with-buffer option it was becoming unmaintainable
                              • serious cleanup of the Python makefiles
                              • speedup patch to XPath very effective for DocBook stylesheets
                              • Fixes for Windows build, cleanup of the documentation
                              • -

                              2.4.17: Mar 8 2002

                              • a lot of bug fixes, including "namespace nodes have no - parentsinXPath"
                              • -
                              • fixed/improved the Python wrappers, added more examples - andmoreregression tests, XPath extension functions can now - returnnode-sets
                              • +

                              2.4.17: Mar 8 2002

                              • a lot of bug fixes, including "namespace nodes have no parents in + XPath"
                              • +
                              • fixed/improved the Python wrappers, added more examples and more + regression tests, XPath extension functions can now return node-sets
                              • added the XML Canonicalization support from Aleksey Sanin
                              • -

                              2.4.16: Feb 20 2002

                              • a lot of bug fixes, most of them were triggered by the XMLTestsuitefrom - OASIS and W3C. Compliance has been significantlyimproved.
                              • +

                              2.4.16: Feb 20 2002

                              • a lot of bug fixes, most of them were triggered by the XML Testsuite + from OASIS and W3C. Compliance has been significantly improved.
                              • a couple of portability fixes too.

                              2.4.15: Feb 11 2002

                              • Fixed the Makefiles, especially the python module ones
                              • A few bug fixes and cleanup
                              • Includes cleanup
                              • -

                              2.4.14: Feb 8 2002

                              • Change of License to the MITLicensebasicallyfor - integration in XFree86 codebase, and removingconfusion around theprevious - dual-licensing
                              • -
                              • added Python bindings, beta software but should already - bequitecomplete
                              • -
                              • a large number of fixes and cleanups, especially for - alltreemanipulations
                              • -
                              • cleanup of the headers, generation of a reference API - definitioninXML
                              • +

                              2.4.14: Feb 8 2002

                              • Change of License to the MIT + License basically for integration in XFree86 codebase, and removing + confusion around the previous dual-licensing
                              • +
                              • added Python bindings, beta software but should already be quite + complete
                              • +
                              • a large number of fixes and cleanups, especially for all tree + manipulations
                              • +
                              • cleanup of the headers, generation of a reference API definition in + XML

                              2.4.13: Jan 14 2002

                              • update of the documentation: John Fleck and Charlie Bozeman
                              • cleanup of timing code from Justin Fletcher
                              • -
                              • fixes for Windows and initial thread support on Win32: Igor - andSergueiNarojnyi
                              • +
                              • fixes for Windows and initial thread support on Win32: Igor and Serguei + Narojnyi
                              • Cygwin patch from Robert Collins
                              • added xmlSetEntityReferenceFunc() for Keith Isdale work on xsldbg
                              • -

                              2.4.12: Dec 7 2001

                              • a few bug fixes: thread (Gary Pennington), xmllint - (GeertKloosterman),XML parser (Robin Berjon), XPointer (Danny Jamshy), - I/Ocleanups(robert)
                              • +

                              2.4.12: Dec 7 2001

                              • a few bug fixes: thread (Gary Pennington), xmllint (Geert Kloosterman), + XML parser (Robin Berjon), XPointer (Danny Jamshy), I/O cleanups + (robert)
                              • Eric Lavigne contributed project files for MacOS
                              • some makefiles cleanups
                              • -

                              2.4.11: Nov 26 2001

                              • fixed a couple of errors in the includes, fixed a few bugs, - somecodecleanups
                              • +

                              2.4.11: Nov 26 2001

                              • fixed a couple of errors in the includes, fixed a few bugs, some code + cleanups
                              • xmllint man pages improvement by Heiko Rupp
                              • updated VMS build instructions from John A Fotheringham
                              • Windows Makefiles updates from Igor

                              2.4.10: Nov 10 2001

                              • URI escaping fix (Joel Young)
                              • added xmlGetNodePath() (for paths or XPointers generation)
                              • Fixes namespace handling problems when using DTD and validation
                              • -
                              • improvements on xmllint: Morus Walter patches for --format - and--encode,Stefan Kost and Heiko Rupp improvements on the --shell
                              • +
                              • improvements on xmllint: Morus Walter patches for --format and + --encode, Stefan Kost and Heiko Rupp improvements on the --shell
                              • fixes for xmlcatalog linking pointed by Weiqi Gao
                              • fixes to the HTML parser

                              2.4.9: Nov 6 2001

                              • fixes more catalog bugs
                              • avoid a compilation problem, improve xmlGetLineNo()
                              • -

                              2.4.8: Nov 4 2001

                              • fixed SGML catalogs broken in previous release, - updatedxmlcatalogtool
                              • +

                              2.4.8: Nov 4 2001

                              • fixed SGML catalogs broken in previous release, updated xmlcatalog + tool
                              • fixed a compile errors and some includes troubles.

                              2.4.7: Oct 30 2001

                              • exported some debugging interfaces
                              • serious rewrite of the catalog code
                              • -
                              • integrated Gary Pennington thread safety patch, added - configureoptionand regression tests
                              • +
                              • integrated Gary Pennington thread safety patch, added configure option + and regression tests
                              • removed an HTML parser bug
                              • fixed a couple of potentially serious validation bugs
                              • integrated the SGML DocBook support in xmllint
                              • @@ -894,11 +933,12 @@ are:

                                • a couple of bugs or limitations introduced in 2.4.20
                                • fixed half a dozen bugs reported for libxml or libxslt
                                • updated xmlcatalog to be able to modify SGML super catalogs

                                2.4.5: Sep 14 2001

                                • Remove a few annoying bugs in 2.4.4
                                • -
                                • forces the HTML serializer to output decimal charrefs since - someversionof Netscape can't handle hexadecimal ones
                                • -

                                1.8.16: Sep 14 2001

                                • maintenance release of the old libxml1 branch, couple of - bugandportability fixes
                                • -

                                2.4.4: Sep 12 2001

                                • added --convert to xmlcatalog, bug fixes and cleanups of XMLCatalog
                                • +
                                • forces the HTML serializer to output decimal charrefs since some + version of Netscape can't handle hexadecimal ones
                                • +

                                1.8.16: Sep 14 2001

                                • maintenance release of the old libxml1 branch, couple of bug and + portability fixes
                                • +

                                2.4.4: Sep 12 2001

                                • added --convert to xmlcatalog, bug fixes and cleanups of XML + Catalog
                                • a few bug fixes and some portability changes
                                • some documentation cleanups

                                2.4.3: Aug 23 2001

                                • XML Catalog support see the doc
                                • @@ -916,13 +956,13 @@ are:

                                  • a couple of bugs or limitations introduced in 2.4.20
                                  • cleanup for alpha and ia64 targets
                                  • patch to allow saving through HTTP PUT or POST

                                  2.4.0: July 10 2001

                                  • Fixed a few bugs in XPath, validation, and tree handling.
                                  • -
                                  • Fixed XML Base implementation, added a couple of examples - totheregression tests
                                  • +
                                  • Fixed XML Base implementation, added a couple of examples to the + regression tests
                                  • A bit of cleanup
                                  • -

                                  2.3.14: July 5 2001

                                  • fixed some entities problems and reduce memory - requirementwhensubstituting them
                                  • -
                                  • lots of improvements in the XPath queries interpreter - canbesubstantially faster
                                  • +

                                  2.3.14: July 5 2001

                                  • fixed some entities problems and reduce memory requirement when + substituting them
                                  • +
                                  • lots of improvements in the XPath queries interpreter can be + substantially faster
                                  • Makefiles and configure cleanups
                                  • Fixes to XPath variable eval, and compare on empty node set
                                  • HTML tag closing bug fixed
                                  • @@ -936,38 +976,37 @@ are:

                                    • a couple of bugs or limitations introduced in 2.4.20
                                    • fixed line number counting
                                    • fixed serious problems in the XInclude processing
                                    • added support for UTF8 BOM at beginning of entities
                                    • -
                                    • fixed a strange gcc optimizer bugs in xpath handling of - float,gcc-3.0miscompile uri.c (William), Thomas Leitner provided a fix - fortheoptimizer on Tru64
                                    • -
                                    • incorporated Yon Derek and Igor Zlatkovic fixes and - improvementsforcompilation on Windows MSC
                                    • +
                                    • fixed a strange gcc optimizer bugs in xpath handling of float, gcc-3.0 + miscompile uri.c (William), Thomas Leitner provided a fix for the + optimizer on Tru64
                                    • +
                                    • incorporated Yon Derek and Igor Zlatkovic fixes and improvements for + compilation on Windows MSC
                                    • update of libxml-doc.el (Felix Natter)
                                    • fixed 2 bugs in URI normalization code
                                    • -

                                    2.3.11: June 17 2001

                                    • updates to trio, Makefiles and configure should fix - someportabilityproblems (alpha)
                                    • -
                                    • fixed some HTML serialization problems (pre, script, - andblock/inlinehandling), added encoding aware APIs, cleanup of - thiscode
                                    • +

                                    2.3.11: June 17 2001

                                    • updates to trio, Makefiles and configure should fix some portability + problems (alpha)
                                    • +
                                    • fixed some HTML serialization problems (pre, script, and block/inline + handling), added encoding aware APIs, cleanup of this code
                                    • added xmlHasNsProp()
                                    • -
                                    • implemented a specific PI for encoding support in the - DocBookSGMLparser
                                    • -
                                    • some XPath fixes (-Infinity, / as a function parameter - andnamespacesnode selection)
                                    • +
                                    • implemented a specific PI for encoding support in the DocBook SGML + parser
                                    • +
                                    • some XPath fixes (-Infinity, / as a function parameter and namespaces + node selection)
                                    • fixed a performance problem and an error in the validation code
                                    • fixed XInclude routine to implement the recursive behaviour
                                    • fixed xmlFreeNode problem when libxml is included statically twice
                                    • added --version to xmllint for bug reports

                                    2.3.10: June 1 2001

                                    • fixed the SGML catalog support
                                    • -
                                    • a number of reported bugs got fixed, in XPath, iconv - detection,XIncludeprocessing
                                    • +
                                    • a number of reported bugs got fixed, in XPath, iconv detection, + XInclude processing
                                    • XPath string function should now handle unicode correctly

                                    2.3.9: May 19 2001

                                    Lots of bugfixes, and added a basic SGML catalog support:

                                    • HTML push bugfix #54891 and another patch from Jonas Borgström
                                    • some serious speed optimization again
                                    • some documentation cleanups
                                    • trying to get better linking on Solaris (-R)
                                    • XPath API cleanup from Thomas Broyer
                                    • -
                                    • Validation bug fixed #54631, added a patch from Gary - Pennington,fixedxmlValidGetValidElements()
                                    • +
                                    • Validation bug fixed #54631, added a patch from Gary Pennington, fixed + xmlValidGetValidElements()
                                    • Added an INSTALL file
                                    • Attribute removal added to API: #54433
                                    • added a basic support for SGML catalogs
                                    • @@ -978,10 +1017,10 @@ are:

                                      • a couple of bugs or limitations introduced in 2.4.20

                                      1.8.13: May 14 2001

                                      • bugfixes release of the old libxml1 branch used by Gnome

                                      2.3.8: May 3 2001

                                      • Integrated an SGML DocBook parser for the Gnome project
                                      • Fixed a few things in the HTML parser
                                      • -
                                      • Fixed some XPath bugs raised by XSLT use, tried to fix thefloatingpoint - portability issue
                                      • -
                                      • Speed improvement (8M/s for SAX, 3M/s for DOM, 1.5M/s - forDOM+validationusing the XML REC as input and a 700MHz celeron).
                                      • +
                                      • Fixed some XPath bugs raised by XSLT use, tried to fix the floating + point portability issue
                                      • +
                                      • Speed improvement (8M/s for SAX, 3M/s for DOM, 1.5M/s for + DOM+validation using the XML REC as input and a 700MHz celeron).
                                      • incorporated more Windows cleanup
                                      • added xmlSaveFormatFile()
                                      • fixed problems in copying nodes with entities references (gdome)
                                      • @@ -996,33 +1035,32 @@ are:

                                        • a couple of bugs or limitations introduced in 2.4.20
                                        • Improved validation speed sensible for DocBook
                                        • fixed a big bug with ID declared in external parsed entities
                                        • portability fixes, update of Trio from Bjorn Reese
                                        • -

                                        2.3.6: April 8 2001

                                        • Code cleanup using extreme gcc compiler warning options, - foundandcleared half a dozen potential problem
                                        • +

                                        2.3.6: April 8 2001

                                        • Code cleanup using extreme gcc compiler warning options, found and + cleared half a dozen potential problem
                                        • the Eazel team found an XML parser bug
                                        • -
                                        • cleaned up the user of some of the string formatting function. - usedthetrio library code to provide the one needed when the platform - ismissingthem
                                        • -
                                        • xpath: removed a memory leak and fixed the predicate - evaluationproblem,extended the testsuite and cleaned up the result. - XPointer seemsbroken...
                                        • -

                                        2.3.5: Mar 23 2001

                                        • Biggest change is separate parsing and evaluation of - XPathexpressions,there is some new APIs for this too
                                        • -
                                        • included a number of bug fixes(XML push parser, - 51876,notations,52299)
                                        • +
                                        • cleaned up the user of some of the string formatting function. used the + trio library code to provide the one needed when the platform is missing + them
                                        • +
                                        • xpath: removed a memory leak and fixed the predicate evaluation + problem, extended the testsuite and cleaned up the result. XPointer seems + broken ...
                                        • +

                                        2.3.5: Mar 23 2001

                                        • Biggest change is separate parsing and evaluation of XPath expressions, + there is some new APIs for this too
                                        • +
                                        • included a number of bug fixes(XML push parser, 51876, notations, + 52299)
                                        • Fixed some portability issues

                                        2.3.4: Mar 10 2001

                                        • Fixed bugs #51860 and #51861
                                        • -
                                        • Added a global variable xmlDefaultBufferSize to allow defaultbuffersize - to be application tunable.
                                        • -
                                        • Some cleanup in the validation code, still a bug left and - thispartshould probably be rewritten to support ambiguous content - model:-\
                                        • -
                                        • Fix a couple of serious bugs introduced or raised by changes - in2.3.3parser
                                        • +
                                        • Added a global variable xmlDefaultBufferSize to allow default buffer + size to be application tunable.
                                        • +
                                        • Some cleanup in the validation code, still a bug left and this part + should probably be rewritten to support ambiguous content model :-\
                                        • +
                                        • Fix a couple of serious bugs introduced or raised by changes in 2.3.3 + parser
                                        • Fixed another bug in xmlNodeGetContent()
                                        • Bjorn fixed XPath node collection and Number formatting
                                        • Fixed a loop reported in the HTML parsing
                                        • -
                                        • blank space are reported even if the Dtd content model proves - thattheyare formatting spaces, this is for XML conformance
                                        • +
                                        • blank space are reported even if the Dtd content model proves that they + are formatting spaces, this is for XML conformance

                                        2.3.3: Mar 1 2001

                                        • small change in XPath for XSLT
                                        • documentation cleanups
                                        • fix in validation by Gary Pennington
                                        • @@ -1032,17 +1070,18 @@ are:

                                          • a couple of bugs or limitations introduced in 2.4.20
                                          • fixed a bug in xmlNodeGetContent
                                          • ID/IDREF support partly rewritten by Gary Pennington

                                          2.3.1: Feb 15 2001

                                          • some XPath and HTML bug fixes for XSLT
                                          • -
                                          • small extension of the hash table interfaces for - DOMgdome2implementation
                                          • +
                                          • small extension of the hash table interfaces for DOM gdome2 + implementation
                                          • A few bug fixes

                                          2.3.0: Feb 8 2001 (2.2.12 was on 25 Jan but I didn't kept track)

                                          • Lots of XPath bug fixes
                                          • -
                                          • Add a mode with Dtd lookup but without validation error - reportingforXSLT
                                          • +
                                          • Add a mode with Dtd lookup but without validation error reporting for + XSLT
                                          • Add support for text node without escaping (XSLT)
                                          • bug fixes for xmlCheckFilename
                                          • validation code bug fixes from Gary Pennington
                                          • Patch from Paul D. Smith correcting URI path normalization
                                          • -
                                          • Patch to allow simultaneous install of libxml-develandlibxml2-devel
                                          • +
                                          • Patch to allow simultaneous install of libxml-devel and + libxml2-devel
                                          • the example Makefile is now fixed
                                          • added HTML to the RPM packages
                                          • tree copying bugfixes
                                          • @@ -1059,7 +1098,8 @@ are:

                                            • a couple of bugs or limitations introduced in 2.4.20
                                            • Improved the XPointer implementation
                                            • integrate a number of provided patches

                                            2.2.9: Nov 25 2000

                                            • erroneous release :-(
                                            • -

                                            2.2.8: Nov 13 2000

                                            2.2.8: Nov 13 2000

                                            • First version of XInclude + support
                                            • Patch in conditional section handling
                                            • updated MS compiler project
                                            • fixed some XPath problems
                                            • @@ -1070,19 +1110,19 @@ are:

                                              • a couple of bugs or limitations introduced in 2.4.20
                                              • xmlIOParseDTD() added
                                              • various small fixes in the HTML, URI, HTTP and XPointer support
                                              • some cleanup of the Makefile, autoconf and the distribution content
                                              • -

                                              2.2.6: Oct 25 2000:

                                              • Added an hash table module, migrated a number of internal - structuretothose
                                              • +

                                              2.2.6: Oct 25 2000:

                                              • Added an hash table module, migrated a number of internal structure to + those
                                              • Fixed a posteriori validation problems
                                              • HTTP module cleanups
                                              • -
                                              • HTML parser improvements (tag errors, script/style - handling,attributenormalization)
                                              • +
                                              • HTML parser improvements (tag errors, script/style handling, attribute + normalization)
                                              • coalescing of adjacent text nodes
                                              • couple of XPath bug fixes, exported the internal API

                                              2.2.5: Oct 15 2000:

                                              • XPointer implementation and testsuite
                                              • -
                                              • Lot of XPath fixes, added variable and functions - registration,moretests
                                              • -
                                              • Portability fixes, lots of enhancements toward an easy Windows - buildandrelease
                                              • +
                                              • Lot of XPath fixes, added variable and functions registration, more + tests
                                              • +
                                              • Portability fixes, lots of enhancements toward an easy Windows build + and release
                                              • Late validation fixes
                                              • Integrated a lot of contributed patches
                                              • added memory management docs
                                              • @@ -1092,113 +1132,115 @@ are:

                                                • a couple of bugs or limitations introduced in 2.4.20
                                                • Serious bug fixes on the URI and HTML code

                                                2.2.3: Sep 17 2000

                                                • bug fixes
                                                • cleanup of entity handling code
                                                • -
                                                • overall review of all loops in the parsers, all sprintf usage - hasbeenchecked too
                                                • -
                                                • Far better handling of larges Dtd. Validating against DocBook - XMLDtdworks smoothly now.
                                                • +
                                                • overall review of all loops in the parsers, all sprintf usage has been + checked too
                                                • +
                                                • Far better handling of larges Dtd. Validating against DocBook XML Dtd + works smoothly now.

                                                1.8.10: Sep 6 2000

                                                • bug fix release for some Gnome projects

                                                2.2.2: August 12 2000

                                                • mostly bug fixes
                                                • started adding routines to access xml parser context options

                                                2.2.1: July 21 2000

                                                • a purely bug fixes release
                                                • fixed an encoding support problem when parsing from a memory block
                                                • fixed a DOCTYPE parsing problem
                                                • -
                                                • removed a bug in the function allowing to override the - memoryallocationroutines
                                                • +
                                                • removed a bug in the function allowing to override the memory + allocation routines

                                                2.2.0: July 14 2000

                                                • applied a lot of portability fixes
                                                • -
                                                • better encoding support/cleanup and saving (content is nowalwaysencoded - in UTF-8)
                                                • +
                                                • better encoding support/cleanup and saving (content is now always + encoded in UTF-8)
                                                • the HTML parser now correctly handles encodings
                                                • added xmlHasProp()
                                                • fixed a serious problem with &#38;
                                                • propagated the fix to FTP client
                                                • cleanup, bugfixes, etc ...
                                                • -
                                                • Added a page about libxmlInternationalizationsupport
                                                • +
                                                • Added a page about libxml Internationalization + support

                                                1.8.9: July 9 2000

                                                • fixed the spec the RPMs should be better
                                                • -
                                                • fixed a serious bug in the FTP implementation, released 1.8.9 - tosolverpmfind users problem
                                                • +
                                                • fixed a serious bug in the FTP implementation, released 1.8.9 to solve + rpmfind users problem

                                                2.1.1: July 1 2000

                                                • fixes a couple of bugs in the 2.1.0 packaging
                                                • improvements on the HTML parser
                                                • -

                                                2.1.0 and 1.8.8: June 29 2000

                                                • 1.8.8 is mostly a commodity package for upgrading to libxml2accordingto - new instructions. It fixes a nastyproblemabout - &#38; charref parsing
                                                • -
                                                • 2.1.0 also ease the upgrade from libxml v1 to the recent version.italso - contains numerous fixes and enhancements: +

                                                2.1.0 and 1.8.8: June 29 2000

                                                • 1.8.8 is mostly a commodity package for upgrading to libxml2 according + to new instructions. It fixes a nasty problem + about &#38; charref parsing
                                                • +
                                                • 2.1.0 also ease the upgrade from libxml v1 to the recent version. it + also contains numerous fixes and enhancements:
                                                  • added xmlStopParser() to stop parsing
                                                  • improved a lot parsing speed when there is large CDATA blocs
                                                  • includes XPath patches provided by Picdar Technology
                                                  • -
                                                  • tried to fix as much as possible DTD validation andnamespacerelated - problems
                                                  • +
                                                  • tried to fix as much as possible DTD validation and namespace + related problems
                                                  • output to a given encoding has been added/tested
                                                  • lot of various fixes
                                                • -

                                                2.0.0: Apr 12 2000

                                                • First public release of libxml2. If you are using libxml, it's - agoodidea to check the 1.x to 2.x upgrade instructions. NOTE: - whileinitiallyscheduled for Apr 3 the release occurred only on Apr 12 due - tomassiveworkload.
                                                • -
                                                • The include are now located under $prefix/include/libxml - (insteadof$prefix/include/gnome-xml), they also are referenced by +

                                                2.0.0: Apr 12 2000

                                                • First public release of libxml2. If you are using libxml, it's a good + idea to check the 1.x to 2.x upgrade instructions. NOTE: while initially + scheduled for Apr 3 the release occurred only on Apr 12 due to massive + workload.
                                                • +
                                                • The include are now located under $prefix/include/libxml (instead of + $prefix/include/gnome-xml), they also are referenced by
                                                  #include <libxml/xxx.h>

                                                  instead of

                                                  #include "xxx.h"
                                                • a new URI module for parsing URIs and following strictly RFC 2396
                                                • -
                                                • the memory allocation routines used by libxml can now - beoverloadeddynamically by using xmlMemSetup()
                                                • -
                                                • The previously CVS only tool tester has - beenrenamedxmllintand is now installed as part of - thelibxml2package
                                                • -
                                                • The I/O interface has been revamped. There is now ways to - pluginspecific I/O modules, either at the URI scheme detection - levelusingxmlRegisterInputCallbacks() or by passing I/O functions - whencreating aparser context using xmlCreateIOParserCtxt()
                                                • -
                                                • there is a C preprocessor macro LIBXML_VERSION providing - theversionnumber of the libxml module in use
                                                • -
                                                • a number of optional features of libxml can now be excluded - atconfiguretime (FTP/HTTP/HTML/XPath/Debug)
                                                • +
                                                • the memory allocation routines used by libxml can now be overloaded + dynamically by using xmlMemSetup()
                                                • +
                                                • The previously CVS only tool tester has been renamed + xmllint and is now installed as part of the libxml2 + package
                                                • +
                                                • The I/O interface has been revamped. There is now ways to plug in + specific I/O modules, either at the URI scheme detection level using + xmlRegisterInputCallbacks() or by passing I/O functions when creating a + parser context using xmlCreateIOParserCtxt()
                                                • +
                                                • there is a C preprocessor macro LIBXML_VERSION providing the version + number of the libxml module in use
                                                • +
                                                • a number of optional features of libxml can now be excluded at + configure time (FTP/HTTP/HTML/XPath/Debug)

                                                2.0.0beta: Mar 14 2000

                                                • This is a first Beta release of libxml version 2
                                                • -
                                                • It's available only fromxmlsoft.orgFTP, it's packaged - aslibxml2-2.0.0beta and available as tar andRPMs
                                                • -
                                                • This version is now the head in the Gnome CVS base, the old - oneisavailable under the tag LIB_XML_1_X
                                                • -
                                                • This includes a very large set of changes. From a programmatic - pointofview applications should not have to be modified too much, check - theupgrade page
                                                • +
                                                • It's available only fromxmlsoft.org + FTP, it's packaged as libxml2-2.0.0beta and available as tar and + RPMs
                                                • +
                                                • This version is now the head in the Gnome CVS base, the old one is + available under the tag LIB_XML_1_X
                                                • +
                                                • This includes a very large set of changes. From a programmatic point + of view applications should not have to be modified too much, check the + upgrade page
                                                • Some interfaces may changes (especially a bit about encoding).
                                                • the updates includes: -
                                                  • fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) - seemscorrectlyhandled now
                                                  • -
                                                  • Better handling of entities, especially well-formedness - checkingandproper PEref extensions in external subsets
                                                  • + -
                                                  • Serious progress were made toward compliance, here are the result of the - testagainsttheOASIS testsuite (except the Japanese tests since I - don't supportthatencoding yet). This URL is rebuilt every couple of hours - using theCVShead version.
                                                  • +
                                                  • Serious progress were made toward compliance, here are the result of the test against the + OASIS testsuite (except the Japanese tests since I don't support that + encoding yet). This URL is rebuilt every couple of hours using the CVS + head version.

                                                  1.8.7: Mar 6 2000

                                                  • This is a bug fix release:
                                                  • -
                                                  • It is possible to disable the ignorable blanks heuristic - usedbylibxml-1.x, a new function xmlKeepBlanksDefault(0) will allow - this.Notethat for adherence to XML spec, this behaviour will be - disabledbydefault in 2.x . The same function will allow to keep - compatibilityforold code.
                                                  • -
                                                  • Blanks in <a> </a> constructs are not - ignoredanymore,avoiding heuristic is really the Right Way :-\
                                                  • -
                                                  • The unchecked use of snprintf which was breakinglibxml-1.8.6compilation - on some platforms has been fixed
                                                  • -
                                                  • nanoftp.c nanohttp.c: Fixed '#' and '?' stripping - whenprocessingURIs
                                                  • -

                                                  1.8.6: Jan 31 2000

                                                  • added a nanoFTP transport module, debugged until the new version of rpmfindcanuseit - without troubles
                                                  • -

                                                  1.8.5: Jan 21 2000

                                                  • adding APIs to parse a well balanced chunk of XML (production [43] contentof - theXMLspec)
                                                  • +
                                                  • It is possible to disable the ignorable blanks heuristic used by + libxml-1.x, a new function xmlKeepBlanksDefault(0) will allow this. Note + that for adherence to XML spec, this behaviour will be disabled by + default in 2.x . The same function will allow to keep compatibility for + old code.
                                                  • +
                                                  • Blanks in <a> </a> constructs are not ignored anymore, + avoiding heuristic is really the Right Way :-\
                                                  • +
                                                  • The unchecked use of snprintf which was breaking libxml-1.8.6 + compilation on some platforms has been fixed
                                                  • +
                                                  • nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when processing + URIs
                                                  • +

                                                  1.8.6: Jan 31 2000

                                                  • added a nanoFTP transport module, debugged until the new version of rpmfind can use + it without troubles
                                                  • +

                                                  1.8.5: Jan 21 2000

                                                  • adding APIs to parse a well balanced chunk of XML (production [43] content of the + XML spec)
                                                  • fixed a hideous bug in xmlGetProp pointed by Rune.Djurhuus@fast.no
                                                  • -
                                                  • Jody Goldberg <jgoldberg@home.com> provided another patchtryingto - solve the zlib checks problems
                                                  • -
                                                  • The current state in gnome CVS base is expected to ship as - 1.8.5withgnumeric soon
                                                  • +
                                                  • Jody Goldberg <jgoldberg@home.com> provided another patch trying + to solve the zlib checks problems
                                                  • +
                                                  • The current state in gnome CVS base is expected to ship as 1.8.5 with + gnumeric soon

                                                  1.8.4: Jan 13 2000

                                                  • bug fixes, reintroduced xmlNewGlobalNs(), fixed xmlNewNs()
                                                  • all exit() call should have been removed from libxml
                                                  • fixed a problem with INCLUDE_WINSOCK on WIN32 platform
                                                  • @@ -1209,52 +1251,52 @@ are:

                                                    • a couple of bugs or limitations introduced in 2.4.20
                                                    • fixed the DTD parsing code to work with the xhtml DTD
                                                    • added xmlRemoveProp(), xmlRemoveID() and xmlRemoveRef()
                                                    • Fixed bugs in xmlNewNs()
                                                    • -
                                                    • External entity loading code has been revamped, now - itusesxmlLoadExternalEntity(), some fix on entities processing - wereadded
                                                    • +
                                                    • External entity loading code has been revamped, now it uses + xmlLoadExternalEntity(), some fix on entities processing were added
                                                    • cleaned up WIN32 includes of socket stuff
                                                    • -

                                                    1.8.2: Dec 21 1999

                                                    • I got another problem with includes and C++, I hope this issue - isfixedfor good this time
                                                    • -
                                                    • Added a few tree modification - functions:xmlReplaceNode,xmlAddPrevSibling, xmlAddNextSibling, - xmlNodeSetNameandxmlDocSetRootElement
                                                    • +

                                                    1.8.2: Dec 21 1999

                                                    • I got another problem with includes and C++, I hope this issue is fixed + for good this time
                                                    • +
                                                    • Added a few tree modification functions: xmlReplaceNode, + xmlAddPrevSibling, xmlAddNextSibling, xmlNodeSetName and + xmlDocSetRootElement
                                                    • Tried to improve the HTML output with help from Chris Lahey
                                                    • -

                                                    1.8.1: Dec 18 1999

                                                    • various patches to avoid troubles when using libxml with - C++compilersthe "namespace" keyword and C escaping in include files
                                                    • +

                                                    1.8.1: Dec 18 1999

                                                    • various patches to avoid troubles when using libxml with C++ compilers + the "namespace" keyword and C escaping in include files
                                                    • a problem in one of the core macros IS_CHAR was corrected
                                                    • -
                                                    • fixed a bug introduced in 1.8.0 breaking default - namespaceprocessing,and more specifically the Dia application
                                                    • -
                                                    • fixed a posteriori validation (validation after parsing, or by - usingaDtd not specified in the original document)
                                                    • +
                                                    • fixed a bug introduced in 1.8.0 breaking default namespace processing, + and more specifically the Dia application
                                                    • +
                                                    • fixed a posteriori validation (validation after parsing, or by using a + Dtd not specified in the original document)
                                                    • fixed a bug in

                                                    1.8.0: Dec 12 1999

                                                    • cleanup, especially memory wise
                                                    • -
                                                    • the parser should be more reliable, especially the HTML one, - itshouldnot crash, whatever the input !
                                                    • -
                                                    • Integrated various patches, especially a speedup improvement - forlargedataset from CarlNygard,configure with - --with-buffers to enable them.
                                                    • +
                                                    • the parser should be more reliable, especially the HTML one, it should + not crash, whatever the input !
                                                    • +
                                                    • Integrated various patches, especially a speedup improvement for large + dataset from Carl Nygard, + configure with --with-buffers to enable them.
                                                    • attribute normalization, oops should have been added long ago !
                                                    • -
                                                    • attributes defaulted from DTDs should be available, xmlSetProp()nowdoes - entities escaping by default.
                                                    • +
                                                    • attributes defaulted from DTDs should be available, xmlSetProp() now + does entities escaping by default.

                                                    1.7.4: Oct 25 1999

                                                    • Lots of HTML improvement
                                                    • Fixed some errors when saving both XML and HTML
                                                    • More examples, the regression tests should now look clean
                                                    • Fixed a bug with contiguous charref

                                                    1.7.3: Sep 29 1999

                                                    • portability problems fixed
                                                    • -
                                                    • snprintf was used unconditionally, leading to link problems - onsystemwere it's not available, fixed
                                                    • -

                                                    1.7.1: Sep 24 1999

                                                    • The basic type for strings manipulated by libxml has been - renamedin1.7.1 from CHARto xmlChar. - Thereasonis that CHAR was conflicting with a predefined type on - Windows.Howeveron non WIN32 environment, compatibility is provided by the - way ofa#define .
                                                    • -
                                                    • Changed another error : the use of a structure field called - errno,andleading to troubles on platforms where it's a macro
                                                    • -

                                                    1.7.0: Sep 23 1999

                                                    • Added the ability to fetch remote DTD or parsed entities, see the nanohttpmodule.
                                                    • -
                                                    • Added an errno to report errors by another mean than a simpleprintflike - callback
                                                    • +
                                                    • snprintf was used unconditionally, leading to link problems on system + were it's not available, fixed
                                                    • +

                                                    1.7.1: Sep 24 1999

                                                    • The basic type for strings manipulated by libxml has been renamed in + 1.7.1 from CHAR to xmlChar. The reason + is that CHAR was conflicting with a predefined type on Windows. However + on non WIN32 environment, compatibility is provided by the way of a + #define .
                                                    • +
                                                    • Changed another error : the use of a structure field called errno, and + leading to troubles on platforms where it's a macro
                                                    • +

                                                    1.7.0: Sep 23 1999

                                                    • Added the ability to fetch remote DTD or parsed entities, see the nanohttp module.
                                                    • +
                                                    • Added an errno to report errors by another mean than a simple printf + like callback
                                                    • Finished ID/IDREF support and checking when validation
                                                    • -
                                                    • Serious memory leaks fixed (there is now a memory wrappermodule)
                                                    • -
                                                    • Improvement of XPathimplementation
                                                    • +
                                                    • Serious memory leaks fixed (there is now a memory wrapper module)
                                                    • +
                                                    • Improvement of XPath + implementation
                                                    • Added an HTML parser front-end

                                                    Daniel Veillard

                              diff --git a/doc/python.html b/doc/python.html index adb3d36..5910766 100644 --- a/doc/python.html +++ b/doc/python.html @@ -7,66 +7,73 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Python and bindings
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              Python and bindings

                              Developer Menu
                              API Indexes
                              Related links

                              There are a number of language bindings and wrappers available -forlibxml2,the list below is not exhaustive. Please contact the xml-bindings@gnome.org(archives) inorder -toget updates to this list or to discuss the specific topic of -libxml2orlibxslt wrappers or bindings:

                              • Libxml++seemsthemost - up-to-date C++ bindings for libxml2, check the documentationandthe - examples.
                              • -
                              • There is another C++wrapperbased on the gdome2 - bindingsmaintained by Tobias Peters.
                              • +Python and bindings
                                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                Made with Libxml2 Logo

                                The XML C parser and toolkit of Gnome

                                Python and bindings

                                Developer Menu
                                API Indexes
                                Related links

                                There are a number of language bindings and wrappers available for +libxml2, the list below is not exhaustive. Please contact the xml-bindings@gnome.org +(archives) in +order to get updates to this list or to discuss the specific topic of libxml2 +or libxslt wrappers or bindings:

                                The distribution includes a set of Python bindings, which are -guaranteedtobe maintained as part of the library in the future, though -thePythoninterface have not yet reached the completeness of the C API.

                                Note that some of the Python purist dislike the default set -ofPythonbindings, rather than complaining I suggest they have a look at lxml the more pythonic bindings -forlibxml2and libxsltand helpMartijnFaassencomplete -those.

                                StéphaneBidoulmaintains aWindows portof the Python -bindings.

                                Note to people interested in building bindings, the API is formalized asan XML API description filewhich allows -toautomatea large part of the Python bindings, this includes -functiondescriptions,enums, structures, typedefs, etc... The Python script -used tobuild thebindings is python/generator.py in the source -distribution.

                                To install the Python bindings there are 2 options:

                                • If you use an RPM based distribution, simply install the libxml2-pythonRPM(andif - needed the libxslt-pythonRPM).
                                • -
                                • Otherwise use the libxml2-pythonmoduledistributioncorresponding - to your installed version oflibxml2 andlibxslt. Note that to install it - you will need both libxml2and libxsltinstalled and run "python setup.py - build install" in themodule tree.
                                • -

                                The distribution includes a set of examples and regression tests -forthepython bindings in the python/testsdirectory. Here -aresomeexcerpts from those tests:

                                tst.py:

                                This is a basic test of the file interface and DOM navigation:

                                import libxml2, sys
                                +  
                              • LibxmlJ is + an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and + libxslt as part of GNU ClasspathX project.
                              • +
                              • Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for + RexxXML.
                              • +
                              • Satimage + provides XMLLib + osax. This is an osax for Mac OS X with a set of commands to + implement in AppleScript the XML DOM, XPATH and XSLT. Also includes + commands for Property-lists (Apple's fast lookup table XML format.)
                              • +
                              • Francesco Montorsi developped wxXml2 + wrappers that interface libxml2, allowing wxWidgets applications to + load/save/edit XML instances.
                              • +

                                The distribution includes a set of Python bindings, which are guaranteed +to be maintained as part of the library in the future, though the Python +interface have not yet reached the completeness of the C API.

                                Note that some of the Python purist dislike the default set of Python +bindings, rather than complaining I suggest they have a look at lxml the more pythonic bindings for libxml2 +and libxslt and help Martijn +Faassen complete those.

                                Stéphane Bidoul +maintains a Windows port +of the Python bindings.

                                Note to people interested in building bindings, the API is formalized as +an XML API description file which allows to +automate a large part of the Python bindings, this includes function +descriptions, enums, structures, typedefs, etc... The Python script used to +build the bindings is python/generator.py in the source distribution.

                                To install the Python bindings there are 2 options:

                                • If you use an RPM based distribution, simply install the libxml2-python + RPM (and if needed the libxslt-python + RPM).
                                • +
                                • Otherwise use the libxml2-python + module distribution corresponding to your installed version of + libxml2 and libxslt. Note that to install it you will need both libxml2 + and libxslt installed and run "python setup.py build install" in the + module tree.
                                • +

                                The distribution includes a set of examples and regression tests for the +python bindings in the python/tests directory. Here are some +excerpts from those tests:

                                tst.py:

                                This is a basic test of the file interface and DOM navigation:

                                import libxml2, sys
                                 
                                 doc = libxml2.parseFile("tst.xml")
                                 if doc.name != "tst.xml":
                                @@ -80,25 +87,24 @@ child = root.children
                                 if child.name != "foo":
                                     print "child.name failed"
                                     sys.exit(1)
                                -doc.freeDoc()

                                The Python module is called libxml2; parseFile is the -equivalentofxmlParseFile (most of the bindings are automatically generated, -and thexmlprefix is removed and the casing convention are kept). All node -seen atthebinding level share the same subset of accessors:

                                • name: returns the node name
                                • -
                                • type: returns a string indicating the node type
                                • -
                                • content: returns the content of the node, it is - basedonxmlNodeGetContent() and hence is recursive.
                                • -
                                • parent, - children,last,next, - prev,doc,properties: pointing to - the associatedelement in the tree,those may return None in case no such - linkexists.
                                • -

                                Also note the need to explicitly deallocate documents with -freeDoc().Reference counting for libxml2 trees would need quite a lot of -worktofunction properly, and rather than risk memory leaks if -notimplementedcorrectly it sounds safer to have an explicit function to free -atree. Thewrapper python objects like doc, root or child are -themautomatically garbagecollected.

                                validate.py:

                                This test check the validation interfaces and redirection -oferrormessages:

                                import libxml2
                                +doc.freeDoc()

                                The Python module is called libxml2; parseFile is the equivalent of +xmlParseFile (most of the bindings are automatically generated, and the xml +prefix is removed and the casing convention are kept). All node seen at the +binding level share the same subset of accessors:

                                • name : returns the node name
                                • +
                                • type : returns a string indicating the node type
                                • +
                                • content : returns the content of the node, it is based on + xmlNodeGetContent() and hence is recursive.
                                • +
                                • parent , children, last, + next, prev, doc, + properties: pointing to the associated element in the tree, + those may return None in case no such link exists.
                                • +

                                Also note the need to explicitly deallocate documents with freeDoc() . +Reference counting for libxml2 trees would need quite a lot of work to +function properly, and rather than risk memory leaks if not implemented +correctly it sounds safer to have an explicit function to free a tree. The +wrapper python objects like doc, root or child are them automatically garbage +collected.

                                validate.py:

                                This test check the validation interfaces and redirection of error +messages:

                                import libxml2
                                 
                                 #deactivate error messages from the validation
                                 def noerr(ctx, str):
                                @@ -113,29 +119,27 @@ doc = ctxt.doc()
                                 valid = ctxt.isValid()
                                 doc.freeDoc()
                                 if valid != 0:
                                -    print "validity check failed"

                                The first thing to notice is the call to registerErrorHandler(), -itdefinesa new error handler global to the library. It is used to avoid -seeingtheerror messages when trying to validate the invalid document.

                                The main interest of that test is the creation of a parser -contextwithcreateFileParserCtxt() and how the behaviour can be changed -beforecallingparseDocument() . Similarly the informations resulting from -theparsing phaseare also available using context methods.

                                Contexts like nodes are defined as class and the libxml2 wrappers mapstheC -function interfaces in terms of objects method as much as possible.Thebest to -get a complete view of what methods are supported is to look atthelibxml2.py -module containing all the wrappers.

                                push.py:

                                This test show how to activate the push parser interface:

                                import libxml2
                                +    print "validity check failed"

                                The first thing to notice is the call to registerErrorHandler(), it +defines a new error handler global to the library. It is used to avoid seeing +the error messages when trying to validate the invalid document.

                                The main interest of that test is the creation of a parser context with +createFileParserCtxt() and how the behaviour can be changed before calling +parseDocument() . Similarly the informations resulting from the parsing phase +are also available using context methods.

                                Contexts like nodes are defined as class and the libxml2 wrappers maps the +C function interfaces in terms of objects method as much as possible. The +best to get a complete view of what methods are supported is to look at the +libxml2.py module containing all the wrappers.

                                push.py:

                                This test show how to activate the push parser interface:

                                import libxml2
                                 
                                 ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml")
                                 ctxt.parseChunk("/>", 2, 1)
                                 doc = ctxt.doc()
                                 
                                -doc.freeDoc()

                                The context is created with a special call based -onthexmlCreatePushParser() from the C library. The first argument is -anoptionalSAX callback object, then the initial set of data, the length and -thename ofthe resource in case URI-References need to be computed by -theparser.

                                Then the data are pushed using the parseChunk() method, the -lastcallsetting the third argument terminate to 1.

                                pushSAX.py:

                                this test show the use of the event based parsing interfaces. In -thiscasethe parser does not build a document, but provides callback -informationasthe parser makes progresses analyzing the data being -provided:

                                import libxml2
                                +doc.freeDoc()

                                The context is created with a special call based on the +xmlCreatePushParser() from the C library. The first argument is an optional +SAX callback object, then the initial set of data, the length and the name of +the resource in case URI-References need to be computed by the parser.

                                Then the data are pushed using the parseChunk() method, the last call +setting the third argument terminate to 1.

                                pushSAX.py:

                                this test show the use of the event based parsing interfaces. In this case +the parser does not build a document, but provides callback information as +the parser makes progresses analyzing the data being provided:

                                import libxml2
                                 log = ""
                                 
                                 class callback:
                                @@ -183,16 +187,15 @@ reference = "startDocument:startElement foo {'url': 'tst'}:" + \
                                             "characters: bar:endElement foo:endDocument:"
                                 if log != reference:
                                     print "Error got: %s" % log
                                -    print "Expected: %s" % reference

                                The key object in that test is the handler, it provides a number -ofentrypoints which can be called by the parser as it makes progresses -toindicatethe information set obtained. The full set of callback is larger -thanwhatthe callback class in that specific example implements (see -theSAXdefinition for a complete list). The wrapper will only call those -suppliedbythe object when activated. The startElement receives the names of -theelementand a dictionary containing the attributes carried by this -element.

                                Also note that the reference string generated from the callback -showsasingle character call even though the string "bar" is passed to -theparserfrom 2 different call to parseChunk()

                                xpath.py:

                                This is a basic test of XPath wrappers support

                                import libxml2
                                +    print "Expected: %s" % reference

                                The key object in that test is the handler, it provides a number of entry +points which can be called by the parser as it makes progresses to indicate +the information set obtained. The full set of callback is larger than what +the callback class in that specific example implements (see the SAX +definition for a complete list). The wrapper will only call those supplied by +the object when activated. The startElement receives the names of the element +and a dictionary containing the attributes carried by this element.

                                Also note that the reference string generated from the callback shows a +single character call even though the string "bar" is passed to the parser +from 2 different call to parseChunk()

                                xpath.py:

                                This is a basic test of XPath wrappers support

                                import libxml2
                                 
                                 doc = libxml2.parseFile("tst.xml")
                                 ctxt = doc.xpathNewContext()
                                @@ -204,15 +207,14 @@ if res[0].name != "doc" or res[1].name != "foo":
                                     print "xpath query: wrong node set value"
                                     sys.exit(1)
                                 doc.freeDoc()
                                -ctxt.xpathFreeContext()

                                This test parses a file, then create an XPath context to -evaluateXPathexpression on it. The xpathEval() method execute an XPath query -andreturnsthe result mapped in a Python way. String and numbers are -nativelyconverted,and node sets are returned as a tuple of libxml2 Python -nodeswrappers. Likethe document, the XPath context need to be freed -explicitly,also not thatthe result of the XPath query may point back to the -documenttree and hencethe document must be freed after the result of the -query isused.

                                xpathext.py:

                                This test shows how to extend the XPath engine with functions -writteninpython:

                                import libxml2
                                +ctxt.xpathFreeContext()

                                This test parses a file, then create an XPath context to evaluate XPath +expression on it. The xpathEval() method execute an XPath query and returns +the result mapped in a Python way. String and numbers are natively converted, +and node sets are returned as a tuple of libxml2 Python nodes wrappers. Like +the document, the XPath context need to be freed explicitly, also not that +the result of the XPath query may point back to the document tree and hence +the document must be freed after the result of the query is used.

                                xpathext.py:

                                This test shows how to extend the XPath engine with functions written in +python:

                                import libxml2
                                 
                                 def foo(ctx, x):
                                     return x + 1
                                @@ -224,10 +226,9 @@ res = ctxt.xpathEval("foo(1)")
                                 if res != 2:
                                     print "xpath extension failure"
                                 doc.freeDoc()
                                -ctxt.xpathFreeContext()

                                Note how the extension function is registered with the context -(butthatpart is not yet finalized, this may change slightly in the -future).

                                tstxpath.py:

                                This test is similar to the previous one but shows how -theextensionfunction can access the XPath evaluation context:

                                def foo(ctx, x):
                                +ctxt.xpathFreeContext()

                                Note how the extension function is registered with the context (but that +part is not yet finalized, this may change slightly in the future).

                                tstxpath.py:

                                This test is similar to the previous one but shows how the extension +function can access the XPath evaluation context:

                                def foo(ctx, x):
                                     global called
                                 
                                     #
                                @@ -236,16 +237,16 @@ theextensionfunction can access the XPath evaluation context:

                                def foo(ct
                                     pctxt = libxml2.xpathParserContext(_obj=ctx)
                                     ctxt = pctxt.context()
                                     called = ctxt.function()
                                -    return x + 1

                                All the interfaces around the XPath parser(or rather evaluation)contextare -not finalized, but it should be sufficient to do contextual workat -theevaluation point.

                                Memory debugging:

                                last but not least, all tests starts with the following prologue:

                                #memory debug specific
                                +    return x + 1

                                All the interfaces around the XPath parser(or rather evaluation) context +are not finalized, but it should be sufficient to do contextual work at the +evaluation point.

                                Memory debugging:

                                last but not least, all tests starts with the following prologue:

                                #memory debug specific
                                 libxml2.debugMemory(1)

                                and ends with the following epilogue:

                                #memory debug specific
                                 libxml2.cleanupParser()
                                 if libxml2.debugMemory(1) == 0:
                                     print "OK"
                                 else:
                                     print "Memory leak %d bytes" % (libxml2.debugMemory(1))
                                -    libxml2.dumpMemory()

                                Those activate the memory debugging interface of libxml2 whereallallocated -block in the library are tracked. The prologue then cleans upthelibrary state -and checks that all allocated memory has been freed. If notitcalls -dumpMemory() which saves that list in a .memdumpfile.

                                Daniel Veillard

                                + libxml2.dumpMemory()

                                Those activate the memory debugging interface of libxml2 where all +allocated block in the library are tracked. The prologue then cleans up the +library state and checks that all allocated memory has been freed. If not it +calls dumpMemory() which saves that list in a .memdump file.

                                Daniel Veillard

                              diff --git a/doc/threads.html b/doc/threads.html index e6fe497..8082dbd 100644 --- a/doc/threads.html +++ b/doc/threads.html @@ -7,16 +7,15 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -Thread safety
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              Thread safety

                              Developer Menu
                              API Indexes
                              Related links

                              Starting with 2.4.7, libxml2 makes provisions to ensure -thatconcurrentthreads can safely work in parallel parsing different -documents.There ishowever a couple of things to do to ensure it:

                              • configure the library accordingly using the --with-threads options
                              • -
                              • call xmlInitParser() in the "main" thread before using any ofthelibxml2 - API (except possibly selecting a different memoryallocator)
                              • -

                              Note that the thread safety cannot be ensured for multiple -threadssharingthe same document, the locking must be done at the application -level,libxmlexports a basic mutex and reentrant mutexes API -in<libxml/threads.h>.The parts of the library checked for thread -safetyare:

                              XPath is supposed to be thread safe now, but this wasn't tested +seriously.

                              Daniel Veillard

                              diff --git a/doc/tree.html b/doc/tree.html index 238cd6d..6556637 100644 --- a/doc/tree.html +++ b/doc/tree.html @@ -7,22 +7,22 @@ H1 {font-family: Verdana,Arial,Helvetica} H2 {font-family: Verdana,Arial,Helvetica} H3 {font-family: Verdana,Arial,Helvetica} A:link, A:visited, A:active { text-decoration: underline } -The tree output
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              The tree output

                              Developer Menu
                              API Indexes
                              Related links

                              The parser returns a tree built during the document analysis. -Thevaluereturned is an xmlDocPtr(i.e., a pointer -toanxmlDocstructure). This structure contains -informationsuchas the file name, the document type, and -achildrenpointerwhich is the root of the document (or -moreexactly the first child under theroot which is the document). The tree -ismade of xmlNodes,chained in double-linked lists of -siblingsand with a children<->parentrelationship. An xmlNode can also -carryproperties (a chain of xmlAttrstructures). An attribute may have a -valuewhich is a list of TEXT orENTITY_REF nodes.

                              Here is an example (erroneous with respect to the XML spec -sincethereshould be only one ELEMENT under the root):

                               structure.gif

                              In the source package there is a small program (not installed -bydefault)called xmllintwhich parses XML files given -asargument andprints them back as parsed. This is useful for detecting -errorsboth in XMLcode and in the XML parser itself. It has an -option--debugwhich prints the actual in-memory structure of -thedocument; here is theresult with the examplegivenbefore:

                              DOCUMENT
                              +The tree output
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              The tree output

                              Developer Menu
                              API Indexes
                              Related links

                              The parser returns a tree built during the document analysis. The value +returned is an xmlDocPtr (i.e., a pointer to an +xmlDoc structure). This structure contains information such +as the file name, the document type, and a children pointer +which is the root of the document (or more exactly the first child under the +root which is the document). The tree is made of xmlNodes, +chained in double-linked lists of siblings and with a children<->parent +relationship. An xmlNode can also carry properties (a chain of xmlAttr +structures). An attribute may have a value which is a list of TEXT or +ENTITY_REF nodes.

                              Here is an example (erroneous with respect to the XML spec since there +should be only one ELEMENT under the root):

                               structure.gif

                              In the source package there is a small program (not installed by default) +called xmllint which parses XML files given as argument and +prints them back as parsed. This is useful for detecting errors both in XML +code and in the XML parser itself. It has an option --debug +which prints the actual in-memory structure of the document; here is the +result with the example given before:

                              DOCUMENT
                               version=1.0
                               standalone=true
                                 ELEMENT EXAMPLE
                              diff --git a/doc/upgrade.html b/doc/upgrade.html
                              index 590b8a4..59815ba 100644
                              --- a/doc/upgrade.html
                              +++ b/doc/upgrade.html
                              @@ -7,102 +7,100 @@ H1 {font-family: Verdana,Arial,Helvetica}
                               H2 {font-family: Verdana,Arial,Helvetica}
                               H3 {font-family: Verdana,Arial,Helvetica}
                               A:link, A:visited, A:active { text-decoration: underline }
                              -Upgrading 1.x code
                              Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                              Made with Libxml2 Logo

                              The XML C parser and toolkit of Gnome

                              Upgrading 1.x code

                              Developer Menu
                              API Indexes
                              Related links

                              Incompatible changes:

                              Version 2 of libxml2 is the first version introducing -seriousbackwardincompatible changes. The main goals were:

                              • a general cleanup. A number of mistakes inherited from the - veryearlyversions couldn't be changed due to compatibility - constraints.Examplethe "childs" element in the nodes.
                              • -
                              • Uniformization of the various nodes, at least for their header - andlinkparts (doc, parent, children, prev, next), the goal is - asimplerprogramming model and simplifying the task of the - DOMimplementors.
                              • -
                              • better conformances to the XML specification, for example version1.xhad - an heuristic to try to detect ignorable white spaces. As a resulttheSAX - event generated were ignorableWhitespace() while the - specrequirescharacter() in that case. This also mean that a number of - DOMnodecontaining blank text may populate the DOM tree which were - notpresentbefore.
                              • -

                              How to fix libxml-1.x code:

                              So client code of libxml designed to run with version 1.x may have -tobechanged to compile against version 2.x of libxml. Here is a list -ofchangesthat I have collected, they may not be sufficient, so in case you -findotherchange which are required, dropme amail:

                              1. The package name have changed from libxml to libxml2, the librarynameis - now -lxml2 . There is a new xml2-config script which should beused - toselect the right parameters libxml2
                              2. -
                              3. Node childsfield has - beenrenamedchildrenso s/childs/children/g should - beapplied(probability of having "childs" anywhere else is close to 0+
                              4. -
                              5. The document don't have anymore a rootelement - ithasbeen replaced by childrenand usually you will - getalist of element here. For example a Dtd element for the - internalsubsetand it's declaration may be found in that list, as well - asprocessinginstructions or comments found before or after the - documentroot element.Use xmlDocGetRootElement(doc)to get - theroot element ofa document. Alternatively if you are sure to not - referenceDTDs nor havePIs or comments before or after the - rootelements/->root/->children/g will probably do it.
                              6. -
                              7. The white space issue, this one is more complex, unless special - caseofvalidating parsing, the line breaks and spaces usually used - forindentingand formatting the document content becomes significant. So - theyarereported by SAX and if your using the DOM tree, corresponding - nodesaregenerated. Too approach can be taken: -
                                1. lazy one, use the - compatibilitycallxmlKeepBlanksDefault(0)but be aware - that youarerelying on a special (and possibly broken) set of - heuristicsoflibxml to detect ignorable blanks. Don't complain if it - breaksormake your application not 100% clean w.r.t. to it's - input.
                                2. -
                                3. the Right Way: change you code to accept - possiblyinsignificantblanks characters, or have your tree populated - withweird blank textnodes. You can spot them using the - commodityfunctionxmlIsBlankNode(node)returning 1 for - suchblanknodes.
                                4. -

                                Note also that with the new default the output functions don't - addanyextra indentation when saving a tree in order to be able to - roundtrip(read and save) without inflating the document with - extraformattingchars.

                                +Upgrading 1.x code
                                Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                Made with Libxml2 Logo

                                The XML C parser and toolkit of Gnome

                                Upgrading 1.x code

                                Developer Menu
                                API Indexes
                                Related links

                                Incompatible changes:

                                Version 2 of libxml2 is the first version introducing serious backward +incompatible changes. The main goals were:

                                • a general cleanup. A number of mistakes inherited from the very early + versions couldn't be changed due to compatibility constraints. Example + the "childs" element in the nodes.
                                • +
                                • Uniformization of the various nodes, at least for their header and link + parts (doc, parent, children, prev, next), the goal is a simpler + programming model and simplifying the task of the DOM implementors.
                                • +
                                • better conformances to the XML specification, for example version 1.x + had an heuristic to try to detect ignorable white spaces. As a result the + SAX event generated were ignorableWhitespace() while the spec requires + character() in that case. This also mean that a number of DOM node + containing blank text may populate the DOM tree which were not present + before.
                                • +

                                How to fix libxml-1.x code:

                                So client code of libxml designed to run with version 1.x may have to be +changed to compile against version 2.x of libxml. Here is a list of changes +that I have collected, they may not be sufficient, so in case you find other +change which are required, drop me a +mail:

                                1. The package name have changed from libxml to libxml2, the library name + is now -lxml2 . There is a new xml2-config script which should be used to + select the right parameters libxml2
                                2. +
                                3. Node childs field has been renamed + children so s/childs/children/g should be applied + (probability of having "childs" anywhere else is close to 0+
                                4. +
                                5. The document don't have anymore a root element it has + been replaced by children and usually you will get a + list of element here. For example a Dtd element for the internal subset + and it's declaration may be found in that list, as well as processing + instructions or comments found before or after the document root element. + Use xmlDocGetRootElement(doc) to get the root element of + a document. Alternatively if you are sure to not reference DTDs nor have + PIs or comments before or after the root element + s/->root/->children/g will probably do it.
                                6. +
                                7. The white space issue, this one is more complex, unless special case of + validating parsing, the line breaks and spaces usually used for indenting + and formatting the document content becomes significant. So they are + reported by SAX and if your using the DOM tree, corresponding nodes are + generated. Too approach can be taken: +
                                  1. lazy one, use the compatibility call + xmlKeepBlanksDefault(0) but be aware that you are + relying on a special (and possibly broken) set of heuristics of + libxml to detect ignorable blanks. Don't complain if it breaks or + make your application not 100% clean w.r.t. to it's input.
                                  2. +
                                  3. the Right Way: change you code to accept possibly insignificant + blanks characters, or have your tree populated with weird blank text + nodes. You can spot them using the commodity function + xmlIsBlankNode(node) returning 1 for such blank + nodes.
                                  4. +

                                  Note also that with the new default the output functions don't add any + extra indentation when saving a tree in order to be able to round trip + (read and save) without inflating the document with extra formatting + chars.

                                8. -
                                9. The include path has changed to $prefix/libxml/ and - theincludesthemselves uses this new prefix in includes instructions... - Ifyou areusing (as expected) the +
                                10. The include path has changed to $prefix/libxml/ and the includes + themselves uses this new prefix in includes instructions... If you are + using (as expected) the
                                  xml2-config --cflags
                                  -

                                  output to generate you compile commands this will probably work - outofthe box

                                  +

                                  output to generate you compile commands this will probably work out of + the box

                                11. -
                                12. xmlDetectCharEncoding takes an extra argument indicating the - lengthinbyte of the head of the document available for character - detection.
                                13. -

                                Ensuring both libxml-1.x and libxml-2.x compatibility

                                Two new version of libxml (1.8.11) and libxml2 (2.3.4) have beenreleasedto -allow smooth upgrade of existing libxml v1code whileretainingcompatibility. -They offers the following:

                                1. similar include naming, one - shoulduse#include<libxml/...>in both cases.
                                2. -
                                3. similar identifiers defined via macros for the child and - rootfields:respectivelyxmlChildrenNodeandxmlRootNode
                                4. -
                                5. a new macro LIBXML_TEST_VERSIONwhich should - beinsertedonce in the client code
                                6. -

                                So the roadmap to upgrade your existing libxml applications -isthefollowing:

                                1. install the libxml-1.8.8 (and libxml-devel-1.8.8) packages
                                2. -
                                3. find all occurrences where the xmlDoc rootfield - isusedand change it to xmlRootNode
                                4. -
                                5. similarly find all occurrences where - thexmlNodechildsfield is used and change - ittoxmlChildrenNode
                                6. -
                                7. add a LIBXML_TEST_VERSIONmacro somewhere - inyourmain()or in the library init entry point
                                8. +
                                9. xmlDetectCharEncoding takes an extra argument indicating the length in + byte of the head of the document available for character detection.
                                10. +

                                Ensuring both libxml-1.x and libxml-2.x compatibility

                                Two new version of libxml (1.8.11) and libxml2 (2.3.4) have been released +to allow smooth upgrade of existing libxml v1code while retaining +compatibility. They offers the following:

                                1. similar include naming, one should use + #include<libxml/...> in both cases.
                                2. +
                                3. similar identifiers defined via macros for the child and root fields: + respectively xmlChildrenNode and + xmlRootNode
                                4. +
                                5. a new macro LIBXML_TEST_VERSION which should be + inserted once in the client code
                                6. +

                                So the roadmap to upgrade your existing libxml applications is the +following:

                                1. install the libxml-1.8.8 (and libxml-devel-1.8.8) packages
                                2. +
                                3. find all occurrences where the xmlDoc root field is + used and change it to xmlRootNode
                                4. +
                                5. similarly find all occurrences where the xmlNode + childs field is used and change it to + xmlChildrenNode
                                6. +
                                7. add a LIBXML_TEST_VERSION macro somewhere in your + main() or in the library init entry point
                                8. Recompile, check compatibility, it should still work
                                9. -
                                10. Change your configure script to look first for xml2-config and - fallbackusing xml-config . Use the --cflags and --libs output of the - commandasthe Include and Linking parameters needed to use libxml.
                                11. -
                                12. install libxml2-2.3.x and libxml2-devel-2.3.x - (libxml-1.8.yandlibxml-devel-1.8.y can be kept simultaneously)
                                13. -
                                14. remove your config.cache, relaunch your configuration - mechanism,andrecompile, if steps 2 and 3 were done right it should - compileas-is
                                15. -
                                16. Test that your application is still running correctly, if not thismaybe - due to extra empty nodes due to formating spaces being kept - inlibxml2contrary to libxml1, in that case insert - xmlKeepBlanksDefault(1)in yourcode before calling the parser - (nexttoLIBXML_TEST_VERSIONis a fine place).
                                17. -

                                Following those steps should work. It worked for some of my own code.

                                Let me put some emphasis on the fact that there is far more -changesfromlibxml 1.x to 2.x than the ones you may have to patch for. The -overallcodehas been considerably cleaned up and the conformance to the -XMLspecificationhas been drastically improved too. Don't take those changes -asan excuse tonot upgrade, it may cost a lot on the long term ...

                                Daniel Veillard

                                +
                              8. Change your configure script to look first for xml2-config and fall + back using xml-config . Use the --cflags and --libs output of the command + as the Include and Linking parameters needed to use libxml.
                              9. +
                              10. install libxml2-2.3.x and libxml2-devel-2.3.x (libxml-1.8.y and + libxml-devel-1.8.y can be kept simultaneously)
                              11. +
                              12. remove your config.cache, relaunch your configuration mechanism, and + recompile, if steps 2 and 3 were done right it should compile as-is
                              13. +
                              14. Test that your application is still running correctly, if not this may + be due to extra empty nodes due to formating spaces being kept in libxml2 + contrary to libxml1, in that case insert xmlKeepBlanksDefault(1) in your + code before calling the parser (next to + LIBXML_TEST_VERSION is a fine place).
                              15. +

                              Following those steps should work. It worked for some of my own code.

                              Let me put some emphasis on the fact that there is far more changes from +libxml 1.x to 2.x than the ones you may have to patch for. The overall code +has been considerably cleaned up and the conformance to the XML specification +has been drastically improved too. Don't take those changes as an excuse to +not upgrade, it may cost a lot on the long term ...

                              Daniel Veillard

                              diff --git a/doc/xml.html b/doc/xml.html index 72a0a9c..a25b8d0 100644 --- a/doc/xml.html +++ b/doc/xml.html @@ -3,42 +3,42 @@ The XML C parser and toolkit of Gnome - - + +

                              The XML C parser and toolkit of Gnome

                              -

                              Note: this is the flat content of the website

                              +

                              Note: this is the flat content of the web +site

                              libxml, a.k.a. gnome-xml

                              "Programmingwithlibxml2 -is like the thrilling embrace of an exotic stranger." MarkPilgrim

                              - -

                              Libxml2 is the XML C parser and toolkit developed for the Gnomeproject(but -usable outside of the Gnome platform), it is free softwareavailableunder the -MITLicense.XML -itself is a metalanguage to design markup languages, i.e.text languagewhere -semantic and structure are added to the content usingextra -"markup"information enclosed between angle brackets. HTML is the -mostwell-knownmarkup language. Though the library is written in C avariety of language bindingsmake it available inother -environments.

                              - -

                              Libxml2 is known to be very portable, the library should build -andworkwithout serious troubles on a variety of systems (Linux, -Unix,Windows,CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, ...)

                              - -

                              Libxml2 implements a number of existing standards related -tomarkuplanguages:

                              +style="text-align: right; font-style: italic; font-size: 10pt">"Programming +with libxml2 is like the thrilling embrace of an exotic stranger." Mark +Pilgrim

                              + +

                              Libxml2 is the XML C parser and toolkit developed for the Gnome project +(but usable outside of the Gnome platform), it is free software available +under the MIT +License. XML itself is a metalanguage to design markup languages, i.e. +text language where semantic and structure are added to the content using +extra "markup" information enclosed between angle brackets. HTML is the most +well-known markup language. Though the library is written in C a variety of language bindings make it available in +other environments.

                              + +

                              Libxml2 is known to be very portable, the library should build and work +without serious troubles on a variety of systems (Linux, Unix, Windows, +CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, ...)

                              + +

                              Libxml2 implements a number of existing standards related to markup +languages:

                              -

                              In most cases libxml2 tries to implement the specifications in -arelativelystrictly compliant way. As of release 2.4.16, libxml2 passed -all1800+ testsfrom the OASIS -XMLTestsSuite.

                              +

                              In most cases libxml2 tries to implement the specifications in a +relatively strictly compliant way. As of release 2.4.16, libxml2 passed all +1800+ tests from the OASIS XML Tests +Suite.

                              -

                              To some extent libxml2 provides support for the -followingadditionalspecifications but doesn't claim to implement them -completely:

                              +

                              To some extent libxml2 provides support for the following additional +specifications but doesn't claim to implement them completely:

                              • Document Object Model (DOM) http://www.w3.org/TR/DOM-Level-2-Core/thedocument - model, but it doesn't implement the API itself, gdome2 doesthison top of - libxml2
                              • -
                              • RFC959:libxml2 - implements a basic FTP client code
                              • -
                              • RFC1945:HTTP/1.0, - again a basic HTTP client code
                              • -
                              • SAX: a SAX2 like interface and a minimal SAX1 - implementationcompatiblewith early expat versions
                              • + href="http://www.w3.org/TR/DOM-Level-2-Core/">http://www.w3.org/TR/DOM-Level-2-Core/ + the document model, but it doesn't implement the API itself, gdome2 does + this on top of libxml2 +
                              • RFC 959 : + libxml2 implements a basic FTP client code
                              • +
                              • RFC 1945 : + HTTP/1.0, again a basic HTTP client code
                              • +
                              • SAX: a SAX2 like interface and a minimal SAX1 implementation compatible + with early expat versions

                              A partial implementation of XML Schemas -Part1:Structureis being worked on but it would be far too early to -makeanyconformance statement about it at the moment.

                              +href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML Schemas Part +1: Structure is being worked on but it would be far too early to make any +conformance statement about it at the moment.

                              Separate documents:

                              - 2006-03-05 + $Date: 2006/08/21 08:34:11 $ @@ -94,35 +94,6 @@ or it can perform multiple functions in interactive mode. It can operate on both XML and SGML files. - More information can be found at - - - - libxml - 3 - web page - - - - - libxml - 3 - catalog support web page - at - - - - James Clark's SGML catalog - page - - - - OASIS XML catalog specification - - - - - @@ -340,7 +311,7 @@ - Execute a public identifier lookup of the catalog entry + Execute a Formal Public Identifier look-up of the catalog entry for PUBLIC-ID. The corresponding entry will be output to the command line. @@ -358,7 +329,7 @@ - Execute a public identifier lookup of the catalog entry + Execute a Formal Public Identifier look-up of the catalog entry for SYSTEM-ID. The corresponding entry will be output to the command line. @@ -375,12 +346,11 @@ XML_CATALOG_FILES - - Catalog behavior can be changed by redirecting queries to the user's - own set of catalogs. This can be done by setting + XML catalog behavior can be changed by redirecting + queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the - default /etc/xml/catalog default catalog. + default /etc/xml/catalog catalog. @@ -391,7 +361,7 @@ DIAGNOSTICS - &xmlcatalog;'s return codes provide information that can be used when + &xmlcatalog; return codes provide information that can be used when calling it from scripts. @@ -427,7 +397,7 @@ 4 - Failed to lookup an entry in the catalog + Failed to look up an entry in the catalog @@ -436,12 +406,41 @@ SEE ALSO - - + libxml 3 + + More information can be found at + + + + libxml + 3 + web page + + + + + libxml + 3 + catalog support web page + at + + + + James Clark's SGML catalog + page + + + + OASIS XML catalog specification + + + + + diff --git a/doc/xmldtd.html b/doc/xmldtd.html index 3f5a797..c5541d6 100644 --- a/doc/xmldtd.html +++ b/doc/xmldtd.html @@ -17,84 +17,84 @@ A:link, A:visited, A:active { text-decoration: underline }
                            • Some examples
                            • How to validate
                            • Other resources
                            • -

                              General overview

                              Well what is validation and what is a DTD ?

                              DTD is the acronym for Document Type Definition. This is a -descriptionofthe content for a family of XML files. This is part of the -XML1.0specification, and allows one to describe and verify that a -givendocumentinstance conforms to the set of rules detailing its structure -andcontent.

                              Validation is the process of checking a document against a -DTD(moregenerally against a set of construction rules).

                              The validation process and building DTDs are the two most difficultpartsof -the XML life cycle. Briefly a DTD defines all the possible elementsto befound -within your document, what is the formal shape of your documenttree(by -defining the allowed content of an element; either text, aregularexpression -for the allowed list of children, or mixed content i.e.both textand -children). The DTD also defines the valid attributes for allelements andthe -types of those attributes.

                              The definition

                              The W3C XML Recommendation(Tim Bray's annotated -versionofRev1):

                              (unfortunately) all this is inherited from the SGML world, the -syntaxisancient...

                              Simple rules

                              Writing DTDs can be done in many ways. The rules to build them if -youneedsomething permanent or something which can evolve over time can -beradicallydifferent. Really complex DTDs like DocBook ones are flexible -butquiteharder to design. I will just focus on DTDs for a formats with a -fixedsimplestructure. It is just a set of basic rules, and definitely -notexhaustive norusable for complex DTD design.

                              How to reference a DTD from a document:

                              Assuming the top element of the document is specand the -dtdisplaced in the file mydtdin the -subdirectorydtdsofthe directory from where the document were -loaded:

                              <!DOCTYPE spec SYSTEM "dtds/mydtd">

                              Notes:

                              • The system string is actually an URI-Reference (as defined in RFC 2396) so you can - useafull URL string indicating the location of your DTD on the Web. This - isareally good thing to do if you want others to validate - yourdocument.
                              • -
                              • It is also possible to associate a PUBLICidentifier(amagic - string) so that the DTD is looked up in catalogs on the clientsidewithout - having to locate it on the web.
                              • -
                              • A DTD contains a set of element and attribute declarations, - buttheydon't define what the root of the document should be. This - isexplicitlytold to the parser/validator as the first element - oftheDOCTYPEdeclaration.
                              • -

                              Declaring elements:

                              The following declares an element spec:

                              <!ELEMENT spec (front, body, back?)>

                              It also expresses that the spec element contains onefront,one -bodyand one optionalbackchildren elements inthis -order. The declaration of oneelement of the structure and its contentare done -in a single declaration.Similarly the following -declaresdiv1elements:

                              <!ELEMENT div1 (head, (p | list | note)*, div2?)>

                              which means div1 contains one headthen a series -ofoptionalp, lists and notes and -thenanoptional div2. And last but not least an element -cancontaintext:

                              <!ELEMENT b (#PCDATA)>

                              bcontains text or being of mixed content (text and -elementsinno particular order):

                              <!ELEMENT p (#PCDATA|a|ul|b|i|em)*>

                              p can contain text or -a,ul,b, i or -emelements inno particularorder.

                              Declaring attributes:

                              Again the attributes declaration includes their content definition:

                              <!ATTLIST termdef name CDATA #IMPLIED>

                              means that the element termdefcan have -anameattribute containing text (CDATA) and which -isoptional(#IMPLIED). The attribute value can also be -definedwithin aset:

                              <!ATTLIST list -type(bullets|ordered|glossary)"ordered">

                              means listelement have a typeattribute -with3allowed values "bullets", "ordered" or "glossary" and which -defaultto"ordered" if the attribute is not explicitly specified.

                              The content type of an attribute can be -text(CDATA),anchor/reference/references(ID/IDREF/IDREFS),entity(ies)(ENTITY/ENTITIES) -orname(s)(NMTOKEN/NMTOKENS). The following -definesthat achapterelement can have an -optionalidattributeof type ID, usable for reference -fromattribute of typeIDREF:

                              <!ATTLIST chapter id ID #IMPLIED>

                              The last value of an attribute definition can -be#REQUIREDmeaning that the attribute has to be -given,#IMPLIEDmeaning that it is optional, or the default -value(possibly prefixed by#FIXEDif it is the only allowed).

                              Notes:

                              • Usually the attributes pertaining to a given element are declared - inasingle expression, but it is just a convention adopted by a lot - ofDTDwriters: +

                                General overview

                                Well what is validation and what is a DTD ?

                                DTD is the acronym for Document Type Definition. This is a description of +the content for a family of XML files. This is part of the XML 1.0 +specification, and allows one to describe and verify that a given document +instance conforms to the set of rules detailing its structure and content.

                                Validation is the process of checking a document against a DTD (more +generally against a set of construction rules).

                                The validation process and building DTDs are the two most difficult parts +of the XML life cycle. Briefly a DTD defines all the possible elements to be +found within your document, what is the formal shape of your document tree +(by defining the allowed content of an element; either text, a regular +expression for the allowed list of children, or mixed content i.e. both text +and children). The DTD also defines the valid attributes for all elements and +the types of those attributes.

                                The definition

                                The W3C XML Recommendation (Tim Bray's annotated version of +Rev1):

                                (unfortunately) all this is inherited from the SGML world, the syntax is +ancient...

                                Simple rules

                                Writing DTDs can be done in many ways. The rules to build them if you need +something permanent or something which can evolve over time can be radically +different. Really complex DTDs like DocBook ones are flexible but quite +harder to design. I will just focus on DTDs for a formats with a fixed simple +structure. It is just a set of basic rules, and definitely not exhaustive nor +usable for complex DTD design.

                                How to reference a DTD from a document:

                                Assuming the top element of the document is spec and the dtd +is placed in the file mydtd in the subdirectory +dtds of the directory from where the document were loaded:

                                <!DOCTYPE spec SYSTEM "dtds/mydtd">

                                Notes:

                                • The system string is actually an URI-Reference (as defined in RFC 2396) so you can use a + full URL string indicating the location of your DTD on the Web. This is a + really good thing to do if you want others to validate your document.
                                • +
                                • It is also possible to associate a PUBLIC identifier (a + magic string) so that the DTD is looked up in catalogs on the client side + without having to locate it on the web.
                                • +
                                • A DTD contains a set of element and attribute declarations, but they + don't define what the root of the document should be. This is explicitly + told to the parser/validator as the first element of the + DOCTYPE declaration.
                                • +

                                Declaring elements:

                                The following declares an element spec:

                                <!ELEMENT spec (front, body, back?)>

                                It also expresses that the spec element contains one front, +one body and one optional back children elements in +this order. The declaration of one element of the structure and its content +are done in a single declaration. Similarly the following declares +div1 elements:

                                <!ELEMENT div1 (head, (p | list | note)*, div2?)>

                                which means div1 contains one head then a series of optional +p, lists and notes and then an +optional div2. And last but not least an element can contain +text:

                                <!ELEMENT b (#PCDATA)>

                                b contains text or being of mixed content (text and elements +in no particular order):

                                <!ELEMENT p (#PCDATA|a|ul|b|i|em)*>

                                p can contain text or a, ul, +b, i or em elements in no particular +order.

                                Declaring attributes:

                                Again the attributes declaration includes their content definition:

                                <!ATTLIST termdef name CDATA #IMPLIED>

                                means that the element termdef can have a name +attribute containing text (CDATA) and which is optional +(#IMPLIED). The attribute value can also be defined within a +set:

                                <!ATTLIST list type (bullets|ordered|glossary) +"ordered">

                                means list element have a type attribute with 3 +allowed values "bullets", "ordered" or "glossary" and which default to +"ordered" if the attribute is not explicitly specified.

                                The content type of an attribute can be text (CDATA), +anchor/reference/references +(ID/IDREF/IDREFS), entity(ies) +(ENTITY/ENTITIES) or name(s) +(NMTOKEN/NMTOKENS). The following defines that a +chapter element can have an optional id attribute +of type ID, usable for reference from attribute of type +IDREF:

                                <!ATTLIST chapter id ID #IMPLIED>

                                The last value of an attribute definition can be #REQUIRED +meaning that the attribute has to be given, #IMPLIED +meaning that it is optional, or the default value (possibly prefixed by +#FIXED if it is the only allowed).

                                Notes:

                                • Usually the attributes pertaining to a given element are declared in a + single expression, but it is just a convention adopted by a lot of DTD + writers:
                                  <!ATTLIST termdef
                                             id      ID      #REQUIRED
                                             name    CDATA   #IMPLIED>
                                  -

                                  The previous construct defines - bothidandnameattributes for the - elementtermdef.

                                  +

                                  The previous construct defines both id and + name attributes for the element termdef.

                                • -

                                Some examples

                                The directory test/valid/dtds/in the -libxml2distributioncontains some complex DTD examples. The example in -thefiletest/valid/dia.xmlshows an XML file where the simple -DTDisdirectly included within the document.

                                How to validate

                                The simplest way is to use the xmllint program included with -libxml.The--validoption turns-on validation of the files given -asinput.For example the following validates a copy of the first revision of -theXML1.0 specification:

                                xmllint --valid --noout test/valid/REC-xml-19980210.xml

                                the -- noout is used to disable output of the resulting tree.

                                The --dtdvalid dtdallows validation of the -document(s)againsta given DTD.

                                Libxml2 exports an API to handle DTDs and validation, check the associateddescription.

                                Other resources

                                DTDs are as old as SGML. So there may be a number of examples -on-line,Iwill just list one for now, others pointers welcome:

                                I suggest looking at the examples found under test/valid/dtd and any -ofthelarge number of books available on XML. The dia example in -test/validshouldbe both simple and complete enough to allow you to build your -own.

                                Daniel Veillard

                              +

                              Some examples

                              The directory test/valid/dtds/ in the libxml2 distribution +contains some complex DTD examples. The example in the file +test/valid/dia.xml shows an XML file where the simple DTD is +directly included within the document.

                              How to validate

                              The simplest way is to use the xmllint program included with libxml. The +--valid option turns-on validation of the files given as input. +For example the following validates a copy of the first revision of the XML +1.0 specification:

                              xmllint --valid --noout test/valid/REC-xml-19980210.xml

                              the -- noout is used to disable output of the resulting tree.

                              The --dtdvalid dtd allows validation of the document(s) +against a given DTD.

                              Libxml2 exports an API to handle DTDs and validation, check the associated +description.

                              Other resources

                              DTDs are as old as SGML. So there may be a number of examples on-line, I +will just list one for now, others pointers welcome:

                              I suggest looking at the examples found under test/valid/dtd and any of +the large number of books available on XML. The dia example in test/valid +should be both simple and complete enough to allow you to build your own.

                              Daniel Veillard

                              diff --git a/doc/xmlio.html b/doc/xmlio.html index ae71ba1..60188df 100644 --- a/doc/xmlio.html +++ b/doc/xmlio.html @@ -13,64 +13,64 @@ A:link, A:visited, A:active { text-decoration: underline }
                            • Output I/O handlers
                            • The entities loader
                            • Example of customized I/O
                            • -

                              General overview

                              The module xmlIO.hprovidestheinterfaces -to the libxml2 I/O system. This consists of 4 main parts:

                              • Entities loader, this is a routine which tries to fetch - theentities(files) based on their PUBLIC and SYSTEM identifiers. The - defaultloaderdon't look at the public identifier since libxml2 do not - maintainacatalog. You can redefine you own entity loader - byusingxmlGetExternalEntityLoader()andxmlSetExternalEntityLoader().Check theexample.
                              • -
                              • Input I/O buffers which are a commodity structure used by - theparser(s)input layer to handle fetching the informations to feed - theparser. Thisprovides buffering and is also a placeholder where - theencodingconverters to UTF8 are piggy-backed.
                              • -
                              • Output I/O buffers are similar to the Input ones and fulfillsimilartask - but when generating a serialization from a tree.
                              • -
                              • A mechanism to register sets of I/O callbacks and associate - themwithspecific naming schemes like the protocol part of the URIs. -

                                This affect the default I/O operations and allows to use - specificI/Ohandlers for certain names.

                                +

                                General overview

                                The module xmlIO.h provides +the interfaces to the libxml2 I/O system. This consists of 4 main parts:

                                • Entities loader, this is a routine which tries to fetch the entities + (files) based on their PUBLIC and SYSTEM identifiers. The default loader + don't look at the public identifier since libxml2 do not maintain a + catalog. You can redefine you own entity loader by using + xmlGetExternalEntityLoader() and + xmlSetExternalEntityLoader(). Check the + example.
                                • +
                                • Input I/O buffers which are a commodity structure used by the parser(s) + input layer to handle fetching the informations to feed the parser. This + provides buffering and is also a placeholder where the encoding + converters to UTF8 are piggy-backed.
                                • +
                                • Output I/O buffers are similar to the Input ones and fulfill similar + task but when generating a serialization from a tree.
                                • +
                                • A mechanism to register sets of I/O callbacks and associate them with + specific naming schemes like the protocol part of the URIs. +

                                  This affect the default I/O operations and allows to use specific I/O + handlers for certain names.

                                • -

                                The general mechanism used when loading -http://rpmfind.net/xml.htmlforexample in the HTML parser is the following:

                                1. The default entity loader - callsxmlNewInputFromFile()withthe parsing context and the - URIstring.
                                2. -
                                3. the URI string is checked against the existing registered - handlersusingtheir match() callback function, if the HTTP module was - compiledin, it isregistered and its match() function will succeeds
                                4. -
                                5. the open() function of the handler is called and if - successfulwillreturn an I/O Input buffer
                                6. -
                                7. the parser will the start reading from this buffer - andprogressivelyfetch information from the resource, calling the - read()function of thehandler until the resource is exhausted
                                8. -
                                9. if an encoding change is detected it will be installed on - theinputbuffer, providing buffering and efficient use of - theconversionroutines
                                10. -
                                11. once the parser has finished, the close() function of the - handleriscalled once and the Input buffer and associated - resourcesaredeallocated.
                                12. -

                                The user defined callbacks are checked first to allow overriding -ofthedefault libxml2 I/O routines.

                                The basic buffer type

                                All the buffer manipulation handling is done -usingthexmlBuffertype define in tree.hwhich -isaresizable memory buffer. The buffer allocation strategy can be selected -tobeeither best-fit or use an exponential doubling one (CPU vs. -memoryusetrade-off). The values -areXML_BUFFER_ALLOC_EXACTandXML_BUFFER_ALLOC_DOUBLEIT,and -can be set individually or on asystem wide basis -usingxmlBufferSetAllocationScheme(). A numberof functions allows -tomanipulate buffers with names starting -withthexmlBuffer...prefix.

                                Input I/O handlers

                                An Input I/O handler is a -simplestructurexmlParserInputBuffercontaining a context -associated totheresource (file descriptor, or pointer to a protocol handler), -the read()andclose() callbacks to use and an xmlBuffer. And extra xmlBuffer -and acharsetencoding handler are also present to support charset -conversionwhenneeded.

                                Output I/O handlers

                                An Output handler xmlOutputBufferis completely similar -toanInput one except the callbacks are write() and close().

                                The entities loader

                                The entity loader resolves requests for new entities and create -inputsforthe parser. Creating an input from a filename or an URI string -isdonethrough the xmlNewInputFromFile() routine. The default entity loader -donothandle the PUBLIC identifier associated with an entity (if any). So -itjustcalls xmlNewInputFromFile() with the SYSTEM identifier (which -ismandatory inXML).

                                If you want to hook up a catalog mechanism then you simply need -tooverridethe default entity loader, here is an example:

                                #include <libxml/xmlIO.h>
                                +

                              The general mechanism used when loading http://rpmfind.net/xml.html for +example in the HTML parser is the following:

                              1. The default entity loader calls xmlNewInputFromFile() with + the parsing context and the URI string.
                              2. +
                              3. the URI string is checked against the existing registered handlers + using their match() callback function, if the HTTP module was compiled + in, it is registered and its match() function will succeeds
                              4. +
                              5. the open() function of the handler is called and if successful will + return an I/O Input buffer
                              6. +
                              7. the parser will the start reading from this buffer and progressively + fetch information from the resource, calling the read() function of the + handler until the resource is exhausted
                              8. +
                              9. if an encoding change is detected it will be installed on the input + buffer, providing buffering and efficient use of the conversion + routines
                              10. +
                              11. once the parser has finished, the close() function of the handler is + called once and the Input buffer and associated resources are + deallocated.
                              12. +

                              The user defined callbacks are checked first to allow overriding of the +default libxml2 I/O routines.

                              The basic buffer type

                              All the buffer manipulation handling is done using the +xmlBuffer type define in tree.h which is a +resizable memory buffer. The buffer allocation strategy can be selected to be +either best-fit or use an exponential doubling one (CPU vs. memory use +trade-off). The values are XML_BUFFER_ALLOC_EXACT and +XML_BUFFER_ALLOC_DOUBLEIT, and can be set individually or on a +system wide basis using xmlBufferSetAllocationScheme(). A number +of functions allows to manipulate buffers with names starting with the +xmlBuffer... prefix.

                              Input I/O handlers

                              An Input I/O handler is a simple structure +xmlParserInputBuffer containing a context associated to the +resource (file descriptor, or pointer to a protocol handler), the read() and +close() callbacks to use and an xmlBuffer. And extra xmlBuffer and a charset +encoding handler are also present to support charset conversion when +needed.

                              Output I/O handlers

                              An Output handler xmlOutputBuffer is completely similar to an +Input one except the callbacks are write() and close().

                              The entities loader

                              The entity loader resolves requests for new entities and create inputs for +the parser. Creating an input from a filename or an URI string is done +through the xmlNewInputFromFile() routine. The default entity loader do not +handle the PUBLIC identifier associated with an entity (if any). So it just +calls xmlNewInputFromFile() with the SYSTEM identifier (which is mandatory in +XML).

                              If you want to hook up a catalog mechanism then you simply need to +override the default entity loader, here is an example:

                              #include <libxml/xmlIO.h>
                               
                               xmlExternalEntityLoader defaultLoader = NULL;
                               
                              @@ -99,10 +99,11 @@ int main(..) {
                                   xmlSetExternalEntityLoader(xmlMyExternalEntityLoader);
                               
                                   ...
                              -}

                              Example of customized I/O

                              This example come from areal use case,xmlDocDump() -closes the FILE * passed by the applicationand this was aproblem. The solutionwasto redefine anew -output handler with the closing call deactivated:

                              1. First define a new I/O output allocator where the output don't - closethefile: +}

                                Example of customized I/O

                                This example come from a +real use case, xmlDocDump() closes the FILE * passed by the application +and this was a problem. The solution was to redefine a +new output handler with the closing call deactivated:

                                1. First define a new I/O output allocator where the output don't close + the file:
                                  xmlOutputBufferPtr
                                   xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
                                       xmlOutputBufferPtr ret;
                                  diff --git a/doc/xmllint.1 b/doc/xmllint.1
                                  index 13e38f5..18ef917 100644
                                  --- a/doc/xmllint.1
                                  +++ b/doc/xmllint.1
                                  @@ -2,7 +2,7 @@
                                   .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
                                   .\" Instead of manually editing it, you probably should edit the DocBook XML
                                   .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
                                  -.TH "XMLLINT" "1" "2006\-03\-05" "libxml2" ""
                                  +.TH "XMLLINT" "1" "$Date: 2006/08/21 08:34:11 $" "libxml2" ""
                                   .\" disable hyphenation
                                   .nh
                                   .\" disable justification (adjust text to left margin only)
                                  @@ -18,7 +18,9 @@ xmllint \- command line XML tool
                                   .PP
                                   The
                                   \fBxmllint\fR
                                  -program parses one or more XML files, specified on the command line as
                                  +program parses one or more
                                  +XML
                                  +files, specified on the command line as
                                   \fIXML\-FILE\fR
                                   (or the standard input if the filename provided is
                                   \fB\-\fR
                                  @@ -31,19 +33,6 @@ parser itself.
                                   \fBxmllint\fR
                                   is included in
                                   \fBlibxml\fR(3).
                                  -.PP
                                  -More information can be found at
                                  -.TP 3
                                  -\(bu
                                  -\fBlibxml\fR(3)
                                  -web page
                                  -\fI\%http://www.xmlsoft.org/\fR
                                  -.TP
                                  -\(bu
                                  -W3C
                                  -XSLT
                                  -page
                                  -\fI\%http://www.w3.org/TR/xslt\fR
                                   .SH "OPTIONS"
                                   .PP
                                   \fBxmllint\fR
                                  @@ -53,10 +42,14 @@ accepts the following options (in alphabetical order):
                                   Generate a small document for testing purposes.
                                   .TP
                                   \fB\-\-catalogs\fR
                                  -Use the catalogs from
                                  +Use the
                                  +SGML
                                  +catalog(s) from
                                   \fBSGML_CATALOG_FILES\fR. Otherwise
                                  +XML
                                  +catalogs starting from
                                   \fI/etc/xml/catalog\fR
                                  -is used by default.
                                  +are used by default.
                                   .TP
                                   \fB\-\-chkregister\fR
                                   Turn on node registration. Useful for developers testing
                                  @@ -65,14 +58,16 @@ node tracking code.
                                   .TP
                                   \fB\-\-compress\fR
                                   Turn on
                                  -gzip
                                  +\fBgzip\fR(1)
                                   compression of output.
                                   .TP
                                   \fB\-\-copy\fR
                                   Test the internal copy implementation.
                                   .TP
                                   \fB\-\-c14n\fR
                                  -Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to
                                  +Use the W3C
                                  +XML
                                  +Canonicalisation (C14N) to serialize the result of parsing to
                                   \fIstdout\fR. It keeps comments in the result.
                                   .TP
                                   \fB\-\-dtdvalid \fR\fB\fIURL\fR\fR
                                  @@ -85,9 +80,9 @@ for validation.
                                   \fB\-\-dtdvalidfpi \fR\fB\fIFPI\fR\fR
                                   Use the
                                   DTD
                                  -specified by a Public Identifier
                                  +specified by a Formal Public Identifier
                                   \fIFPI\fR
                                  -for validation, note that this will require a Catalog exporting that Public Identifier to work.
                                  +for validation, note that this will require a catalog exporting that Formal Public Identifier to work.
                                   .TP
                                   \fB\-\-debug\fR
                                   Parse a file and output an annotated tree of the in\-memory version of the document.
                                  @@ -111,7 +106,7 @@ Output in the given encoding.
                                   \fB\-\-format\fR
                                   Reformat and reindent the output. The
                                   \fBXMLLINT_INDENT\fR
                                  -environment variable controls the indentation (default value is two spaces " ").
                                  +environment variable controls the indentation. The default value is two spaces " ").
                                   .TP
                                   \fB\-\-help\fR
                                   Print out a short usage summary for
                                  @@ -135,7 +130,7 @@ tags surrounding the result tree output so the results can be displayed/viewed i
                                   Test for valid insertions.
                                   .TP
                                   \fB\-\-loaddtd\fR
                                  -Fetch external
                                  +Fetch an external
                                   DTD.
                                   .TP
                                   \fB\-\-load\-trace\fR
                                  @@ -207,7 +202,7 @@ DTDs or entities. Enclose space\-separated lists by quotation marks.
                                   Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser. It allows to select some nodes in the document based on an XPath (subset) expression. Used for debugging.
                                   .TP
                                   \fB\-\-postvalid\fR
                                  -Validate after parsing is completed.
                                  +Validate after parsing has completed.
                                   .TP
                                   \fB\-\-push\fR
                                   Use the push mode of the parser.
                                  @@ -224,7 +219,9 @@ for validation.
                                   Repeat 100 times, for timing or profiling.
                                   .TP
                                   \fB\-\-schema \fR\fB\fISCHEMA\fR\fR
                                  -Use a W3C XML Schema file named
                                  +Use a W3C
                                  +XML
                                  +Schema file named
                                   \fISCHEMA\fR
                                   for validation.
                                   .TP
                                  @@ -233,7 +230,9 @@ Run a navigating shell. Details on available commands in shell mode are below (s
                                   the section called \(lqSHELL COMMANDS\(rq).
                                   .TP
                                   \fB\-\-stream\fR
                                  -Use streaming API \- useful when used in combination with
                                  +Use streaming
                                  +API
                                  +\- useful when used in combination with
                                   \fB\-\-relaxng\fR
                                   or
                                   \fB\-\-valid\fR
                                  @@ -264,7 +263,7 @@ used.
                                   \fB\-\-walker\fR
                                   Test the walker module, which is a reader interface but for a document tree, instead of using the reader
                                   API
                                  -on an unparsed document it works on a existing in\-memory tree. Used in debugging.
                                  +on an unparsed document it works on an existing in\-memory tree. Used for debugging.
                                   .TP
                                   \fB\-\-xinclude\fR
                                   Do XInclude processing.
                                  @@ -275,7 +274,7 @@ Used in conjunction with
                                   HTML
                                   is parsed the document is saved with the
                                   HTML
                                  -serializer, but with this option the resulting document is saved with the
                                  +serializer. But with this option the resulting document is saved with the
                                   XML
                                   serializer. This is primarily used to generate
                                   XHTML
                                  @@ -341,29 +340,38 @@ Write the current node to the given filename.
                                   .SH "ENVIRONMENT"
                                   .TP
                                   \fBSGML_CATALOG_FILES\fR
                                  -to be written ...
                                  +SGML
                                  +catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the
                                  +\fBSGML_CATALOG_FILES\fR
                                  +environment variable to a list of catalogs. An empty one should deactivate loading the default
                                  +\fI/etc/sgml/catalog\fR
                                  +catalog.
                                   .TP
                                   \fBXML_CATALOG_FILES\fR
                                  -Catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the
                                  +XML
                                  +catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the
                                   \fBXML_CATALOG_FILES\fR
                                   environment variable to a list of catalogs. An empty one should deactivate loading the default
                                   \fI/etc/xml/catalog\fR
                                  -default catalog.
                                  +catalog.
                                   .TP
                                   \fBXML_DEBUG_CATALOG\fR
                                   Setting the environment variable
                                   \fBXML_DEBUG_CATALOG\fR
                                  +to
                                  +\fInon\-zero\fR
                                   using the
                                   \fBexport\fR
                                   command outputs debugging information related to catalog operations.
                                   .TP
                                   \fBXMLLINT_INDENT\fR
                                  -to be written ...
                                  +Setting the environment variable
                                  +\fBXMLLINT_INDENT\fR
                                  +controls the indentation. The default value is two spaces " ".
                                   .SH "DIAGNOSTICS"
                                   .PP
                                  -On the completion of execution,
                                   \fBxmllint\fR
                                  -returns the following error codes:
                                  +return codes provide information that can be used when calling it from scripts.
                                   .TP
                                   \fB0\fR
                                   No error
                                  @@ -402,5 +410,18 @@ Out of memory error
                                   .SH "SEE ALSO"
                                   .PP
                                   \fBlibxml\fR(3)
                                  +.PP
                                  +More information can be found at
                                  +.TP 3
                                  +\(bu
                                  +\fBlibxml\fR(3)
                                  +web page
                                  +\fI\%http://www.xmlsoft.org/\fR
                                  +.TP
                                  +\(bu
                                  +W3C
                                  +XSLT
                                  +page
                                  +\fI\%http://www.w3.org/TR/xslt\fR
                                   .SH "AUTHOR"
                                   John Fleck , Ziying Sherwin , Heiko Rupp . 
                                  diff --git a/doc/xmllint.xml b/doc/xmllint.xml
                                  index 904e706..9757675 100644
                                  --- a/doc/xmllint.xml
                                  +++ b/doc/xmllint.xml
                                  @@ -46,7 +46,7 @@
                                   		
                                   	
                                   	
                                  -	2006-03-05
                                  +	$Date: 2006/08/21 08:34:11 $
                                   	
                                   	
                                   	
                                  @@ -130,34 +130,18 @@
                                   
                                   	DESCRIPTION
                                   	
                                  -		The &xmllint; program parses one or more XML files, specified on the
                                  -		command line as XML-FILE (or the standard
                                  -		input if the filename provided is - ).
                                  -		It prints various types of output, depending upon the options selected.
                                  -		It is useful for detecting errors both
                                  -		in XML code and in the XML parser
                                  -		itself.
                                  +		The &xmllint; program parses one or more XML files,
                                  +		specified on the command line as XML-FILE
                                  +		(or the standard input if the filename provided
                                  +		is - ). It prints various types of
                                  +		output, depending upon the options selected. It is useful for detecting
                                  +		errors both in XML code and in
                                  +		the XML parser itself.
                                   	
                                   	&xmllint; is included in 
                                   		libxml
                                   		3
                                   	.
                                  -	More information can be found at
                                  -		
                                  -			
                                  -				
                                  -						libxml
                                  -						3
                                  -					 web page 
                                  -				
                                  -			
                                  -			
                                  -				
                                  -					W3C XSLT page 
                                  -				
                                  -			
                                  -		
                                  -	
                                   
                                   
                                   
                                  @@ -179,8 +163,9 @@
                                   	
                                   	
                                   		
                                  -			Use the catalogs from SGML_CATALOG_FILES.
                                  -			Otherwise /etc/xml/catalog is used by default.
                                  +			Use the SGML catalog(s) from SGML_CATALOG_FILES.
                                  +			Otherwise XML catalogs starting
                                  +			from /etc/xml/catalog are used by default.
                                   		
                                   	
                                   		
                                  @@ -201,7 +186,10 @@
                                   	
                                   	
                                   		
                                  -			Turn on gzip compression of output.
                                  +			Turn on 
                                  +		gzip
                                  +		1
                                  +	 compression of output.
                                   		
                                   	
                                   		
                                  @@ -217,8 +205,8 @@
                                   	
                                   	
                                   		
                                  -			Use the W3C XML Canonicalisation (C14N) to serialize
                                  -			the result of parsing to stdout.
                                  +			Use the W3C XML Canonicalisation (C14N) to
                                  +			serialize the result of parsing to stdout.
                                   			It keeps comments in the result.
                                   		
                                   	
                                  @@ -238,9 +226,9 @@
                                   	
                                   	
                                   		
                                  -			Use the DTD specified by a Public
                                  +			Use the DTD specified by a Formal Public
                                   			Identifier FPI for validation, note that this
                                  -			will require a Catalog exporting that Public Identifier to work.
                                  +			will require a catalog exporting that Formal Public Identifier to work.
                                   		
                                   	
                                   		
                                  @@ -291,7 +279,7 @@
                                   	
                                   		
                                   			Reformat and reindent the output. The XMLLINT_INDENT
                                  -			environment variable controls the indentation (default value is two
                                  +			environment variable controls the indentation. The default value is two
                                   			spaces "  ").
                                   		
                                   	
                                  @@ -333,7 +321,7 @@
                                   		
                                   	
                                   	
                                  -		Fetch external DTD.
                                  +		Fetch an external DTD.
                                   	
                                   		
                                   
                                  @@ -484,7 +472,7 @@
                                   		
                                   	
                                   	
                                  -		Validate after parsing is completed.
                                  +		Validate after parsing has completed.
                                   	
                                   		
                                   
                                  @@ -523,8 +511,8 @@
                                   	
                                   	
                                   		
                                  -			Use a W3C XML Schema file named SCHEMA
                                  -			for validation.
                                  +			Use a W3C XML Schema file
                                  +			named SCHEMA for validation.
                                   		
                                   	
                                   		
                                  @@ -543,7 +531,7 @@
                                   	
                                   	
                                   		
                                  -			Use streaming API - useful when  used  in combination
                                  +			Use streaming API - useful when used in combination
                                   			with  or  options
                                   			for validation of files that are too large to be held in memory.
                                   		
                                  @@ -599,7 +587,7 @@
                                   		
                                   			Test the walker module, which is a reader interface but for a
                                   			document tree, instead of using the reader API on
                                  -			an unparsed document it works on a existing in-memory tree. Used in
                                  +			an unparsed document it works on an existing in-memory tree. Used for
                                   			debugging.
                                   		
                                   	
                                  @@ -618,11 +606,10 @@
                                   		
                                   			Used in conjunction with . Usually
                                   			when HTML is parsed the document is saved with
                                  -			the HTML serializer, but with this option the
                                  +			the HTML serializer. But with this option the
                                   			resulting document is saved with the XML
                                   			serializer. This is primarily used to
                                  -			generate XHTML
                                  -			from HTML input.
                                  +			generate XHTML from HTML input.
                                   		
                                   	
                                   		
                                  @@ -770,19 +757,23 @@
                                   		
                                   	SGML_CATALOG_FILES
                                   	
                                  -		to be written ...
                                  +		SGML catalog behavior can be changed by redirecting
                                  +			queries to the user's own set of catalogs. This can be done by setting
                                  +			the SGML_CATALOG_FILES environment variable to a list
                                  +			of catalogs. An empty one should deactivate loading the
                                  +			default /etc/sgml/catalog catalog.
                                  +		
                                   	
                                   		
                                   
                                   		
                                   	XML_CATALOG_FILES
                                   	
                                  -		
                                  -			Catalog behavior can be changed by redirecting queries to the user's
                                  -			own set of catalogs. This can be done by setting
                                  +		XML catalog behavior can be changed by redirecting
                                  +			queries to the user's own set of catalogs. This can be done by setting
                                   			the XML_CATALOG_FILES environment variable to a list
                                   			of catalogs. An empty one should deactivate loading the
                                  -			default /etc/xml/catalog default catalog.
                                  +			default /etc/xml/catalog catalog.
                                   		
                                   	
                                   		
                                  @@ -790,10 +781,9 @@
                                   		
                                   	XML_DEBUG_CATALOG
                                   	
                                  -		
                                  -			Setting the environment variable XML_DEBUG_CATALOG
                                  -			using the export command outputs debugging information
                                  -			related to catalog operations.
                                  +		Setting the environment variable XML_DEBUG_CATALOG
                                  +			to non-zero using the export
                                  +			command outputs debugging information related to catalog operations.
                                   		
                                   	
                                   		
                                  @@ -801,7 +791,9 @@
                                   		
                                   	XMLLINT_INDENT
                                   	
                                  -		to be written ...
                                  +		Setting the environment variable XMLLINT_INDENT
                                  +			controls the indentation. The default value is two spaces "  ".
                                  +		
                                   	
                                   		
                                   		
                                  @@ -811,7 +803,8 @@
                                   
                                   	DIAGNOSTICS
                                   	
                                  -		On the completion of execution, &xmllint; returns the following error codes:
                                  +		&xmllint; return codes provide information that can be used when
                                  +		calling it from scripts.
                                   	
                                   	
                                  @@ -897,12 +890,27 @@
                                   
                                   
                                   	SEE ALSO
                                  -	
                                  -		
                                  +	
                                   			libxml
                                   			3
                                   		
                                   	
                                  +	
                                  +		More information can be found at
                                  +		
                                  +			
                                  +				
                                  +						libxml
                                  +						3
                                  +					 web page 
                                  +				
                                  +			
                                  +			
                                  +				W3C XSLT page 
                                  +				
                                  +			
                                  +		
                                  +	
                                   
                                   
                                   
                                  diff --git a/doc/xmlmem.html b/doc/xmlmem.html
                                  index 40dc4cb..58c2987 100644
                                  --- a/doc/xmlmem.html
                                  +++ b/doc/xmlmem.html
                                  @@ -12,91 +12,91 @@ A:link, A:visited, A:active { text-decoration: underline }
                                     
                                2. Cleaning up after parsing
                                3. Debugging routines
                                4. General memory requirements
                                5. -

                                General overview

                                The module xmlmemory.hprovidesthe -interfaces to the libxml2 memory system:

                                • libxml2 does not use the libc memory allocator directly - butxmlFree(),xmlMalloc() and xmlRealloc()
                                • -
                                • those routines can be reallocated to a specific set of - routine,bydefault the libc ones i.e. free(), malloc() and realloc()
                                • +

                              General overview

                              The module xmlmemory.h +provides the interfaces to the libxml2 memory system:

                              • libxml2 does not use the libc memory allocator directly but xmlFree(), + xmlMalloc() and xmlRealloc()
                              • +
                              • those routines can be reallocated to a specific set of routine, by + default the libc ones i.e. free(), malloc() and realloc()
                              • the xmlmemory.c module includes a set of debugging routine
                              • -

                              Setting libxml2 set of memory routines

                              It is sometimes useful to not use the default memory allocator, -eitherfordebugging, analysis or to implement a specific behaviour on -memorymanagement(like on embedded systems). Two function calls are available -to doso:

                              • xmlMemGet()whichreturn - the current set of functions in use by the parser
                              • -
                              • xmlMemSetup()whichallow - to set up a new set of memory allocation functions
                              • -

                              Of course a call to xmlMemSetup() should probably be done beforecallingany -other libxml2 routines (unless you are sure your allocationsroutines -arecompatibles).

                              Cleaning up after parsing

                              Libxml2 is not stateless, there is a few set of memory -structuresneedingallocation before the parser is fully functional (some -encodingstructuresfor example). This also mean that once parsing is finished -there isa tinyamount of memory (a few hundred bytes) which can be recollected -if youdon'treuse the parser immediately:

                              • xmlCleanupParser()isa - centralized routine to free the parsing states. Note that - itwon'tdeallocate any produced tree if any (use the xmlFreeDoc() - andrelatedroutines for this).
                              • -
                              • xmlInitParser()isthe - dual routine allowing to preallocate the parsing statewhich can beuseful - for example to avoid initialization reentrancyproblems when usinglibxml2 - in multithreaded applications
                              • -

                              Generally xmlCleanupParser() is safe, if needed the state will berebuildat -the next invocation of parser routines, but be careful of theconsequencesin -multithreaded applications.

                              Debugging routines

                              When configured using --with-mem-debug flag (off by default), libxml2usesa -set of memory allocation debugging routines keeping track of -allallocatedblocks and the location in the code where the routine was called. -Acouple ofother debugging routines allow to dump the memory allocated infos -toa fileor call a specific routine when a given block number is allocated:

                              When developing libxml2 memory debug is enabled, the tests -programscallxmlMemoryDump () and the "make test" regression tests will check -foranymemory leak during the full regression test sequence, this helps -alotensuring that libxml2 does not leak memory and bullet -proofmemoryallocations use (some libc implementations are known to be far -toopermissiveresulting in major portability problems!).

                              If the .memdump reports a leak, it displays the allocation functionandalso -tries to give some informations about the content and structure -oftheallocated blocks left. This is sufficient in most cases to find -theculprit,but not always. Assuming the allocation problem is reproducible, -itispossible to find more easily:

                              1. write down the block number xxxx not allocated
                              2. -
                              3. export the environment variable XML_MEM_BREAKPOINT=xxxx , - theeasiestwhen using GDB is to simply give the command +

                            Setting libxml2 set of memory routines

                            It is sometimes useful to not use the default memory allocator, either for +debugging, analysis or to implement a specific behaviour on memory management +(like on embedded systems). Two function calls are available to do so:

                            • xmlMemGet + () which return the current set of functions in use by the parser
                            • +
                            • xmlMemSetup() + which allow to set up a new set of memory allocation functions
                            • +

                            Of course a call to xmlMemSetup() should probably be done before calling +any other libxml2 routines (unless you are sure your allocations routines are +compatibles).

                            Cleaning up after parsing

                            Libxml2 is not stateless, there is a few set of memory structures needing +allocation before the parser is fully functional (some encoding structures +for example). This also mean that once parsing is finished there is a tiny +amount of memory (a few hundred bytes) which can be recollected if you don't +reuse the parser immediately:

                            • xmlCleanupParser + () is a centralized routine to free the parsing states. Note that it + won't deallocate any produced tree if any (use the xmlFreeDoc() and + related routines for this).
                            • +
                            • xmlInitParser + () is the dual routine allowing to preallocate the parsing state + which can be useful for example to avoid initialization reentrancy + problems when using libxml2 in multithreaded applications
                            • +

                            Generally xmlCleanupParser() is safe, if needed the state will be rebuild +at the next invocation of parser routines, but be careful of the consequences +in multithreaded applications.

                            Debugging routines

                            When configured using --with-mem-debug flag (off by default), libxml2 uses +a set of memory allocation debugging routines keeping track of all allocated +blocks and the location in the code where the routine was called. A couple of +other debugging routines allow to dump the memory allocated infos to a file +or call a specific routine when a given block number is allocated:

                            When developing libxml2 memory debug is enabled, the tests programs call +xmlMemoryDump () and the "make test" regression tests will check for any +memory leak during the full regression test sequence, this helps a lot +ensuring that libxml2 does not leak memory and bullet proof memory +allocations use (some libc implementations are known to be far too permissive +resulting in major portability problems!).

                            If the .memdump reports a leak, it displays the allocation function and +also tries to give some informations about the content and structure of the +allocated blocks left. This is sufficient in most cases to find the culprit, +but not always. Assuming the allocation problem is reproducible, it is +possible to find more easily:

                            1. write down the block number xxxx not allocated
                            2. +
                            3. export the environment variable XML_MEM_BREAKPOINT=xxxx , the easiest + when using GDB is to simply give the command

                              set environment XML_MEM_BREAKPOINT xxxx

                              before running the program.

                            4. -
                            5. run the program under a debugger and set a - breakpointonxmlMallocBreakpoint() a specific function called when this - preciseblockis allocated
                            6. -
                            7. when the breakpoint is reached you can then do a fine analysis - oftheallocation an step to see the condition resulting in - themissingdeallocation.
                            8. -

                            I used to use a commercial tool to debug libxml2 memory problems -butafternoticing that it was not detecting memory leaks that simple -mechanismwasused and proved extremely efficient until now. Lately I have also -used valgrindwith quite -somesuccess,it is tied to the i386 architecture since it works by emulating -theprocessorand instruction set, it is slow but extremely efficient, i.e. -itspot memoryusage errors in a very precise way.

                            General memory requirements

                            How much libxml2 memory require ? It's hard to tell in average itdependsof -a number of things:

                            • the parser itself should work in a fixed amount of memory, - exceptforinformation maintained about the stacks of names and - entitieslocations.The I/O and encoding handlers will probably account for - a fewKBytes.This is true for both the XML and HTML parser (though the - HTMLparserneed more state).
                            • -
                            • If you are generating the DOM tree then memory requirements - willgrownearly linear with the size of the data. In general for - abalancedtextual document the internal memory requirement is about 4 - timesthesize of the UTF8 serialization of this document (example - theXML-1.0recommendation is a bit more of 150KBytes and takes 650KBytes - ofmainmemory when parsed). Validation will add a amount of memory - requiredformaintaining the external Dtd state which should be linear - withthecomplexity of the content model defined by the Dtd
                            • -
                            • If you need to work with fixed memory requirements or don't needthefull - DOM tree then using the xmlReaderinterfaceis - probably the best way toproceed, it still allows tovalidate or operate on - subset of the tree ifneeded.
                            • -
                            • If you don't care about the advanced features of libxml2likevalidation, - DOM, XPath or XPointer, don't use entities, need to workwithfixed memory - requirements, and try to get the fastest parsingpossiblethen the SAX - interface should be used, but it has knownrestrictions.
                            • +
                            • run the program under a debugger and set a breakpoint on + xmlMallocBreakpoint() a specific function called when this precise block + is allocated
                            • +
                            • when the breakpoint is reached you can then do a fine analysis of the + allocation an step to see the condition resulting in the missing + deallocation.
                            • +

                              I used to use a commercial tool to debug libxml2 memory problems but after +noticing that it was not detecting memory leaks that simple mechanism was +used and proved extremely efficient until now. Lately I have also used valgrind with quite some +success, it is tied to the i386 architecture since it works by emulating the +processor and instruction set, it is slow but extremely efficient, i.e. it +spot memory usage errors in a very precise way.

                              General memory requirements

                              How much libxml2 memory require ? It's hard to tell in average it depends +of a number of things:

                              • the parser itself should work in a fixed amount of memory, except for + information maintained about the stacks of names and entities locations. + The I/O and encoding handlers will probably account for a few KBytes. + This is true for both the XML and HTML parser (though the HTML parser + need more state).
                              • +
                              • If you are generating the DOM tree then memory requirements will grow + nearly linear with the size of the data. In general for a balanced + textual document the internal memory requirement is about 4 times the + size of the UTF8 serialization of this document (example the XML-1.0 + recommendation is a bit more of 150KBytes and takes 650KBytes of main + memory when parsed). Validation will add a amount of memory required for + maintaining the external Dtd state which should be linear with the + complexity of the content model defined by the Dtd
                              • +
                              • If you need to work with fixed memory requirements or don't need the + full DOM tree then using the xmlReader + interface is probably the best way to proceed, it still allows to + validate or operate on subset of the tree if needed.
                              • +
                              • If you don't care about the advanced features of libxml2 like + validation, DOM, XPath or XPointer, don't use entities, need to work with + fixed memory requirements, and try to get the fastest parsing possible + then the SAX interface should be used, but it has known restrictions.

                              Daniel Veillard

                            diff --git a/encoding.c b/encoding.c index 6dee212..ee33df1 100644 --- a/encoding.c +++ b/encoding.c @@ -1613,6 +1613,12 @@ xmlFindCharEncodingHandler(const char *name) { /* check whether iconv can handle this */ icv_in = iconv_open("UTF-8", name); icv_out = iconv_open(name, "UTF-8"); + if (icv_in == (iconv_t) -1) { + icv_in = iconv_open("UTF-8", upper); + } + if (icv_out == (iconv_t) -1) { + icv_out = iconv_open(upper, "UTF-8"); + } if ((icv_in != (iconv_t) -1) && (icv_out != (iconv_t) -1)) { enc = (xmlCharEncodingHandlerPtr) xmlMalloc(sizeof(xmlCharEncodingHandler)); diff --git a/entities.c b/entities.c index 6a0e38d..91a3978 100644 --- a/entities.c +++ b/entities.c @@ -31,35 +31,35 @@ static xmlEntity xmlEntityLt = { NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "<", BAD_CAST "<", 1, XML_INTERNAL_PREDEFINED_ENTITY, - NULL, NULL, NULL, NULL, 0 + NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityGt = { NULL, XML_ENTITY_DECL, BAD_CAST "gt", NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST ">", BAD_CAST ">", 1, XML_INTERNAL_PREDEFINED_ENTITY, - NULL, NULL, NULL, NULL, 0 + NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityAmp = { NULL, XML_ENTITY_DECL, BAD_CAST "amp", NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "&", BAD_CAST "&", 1, XML_INTERNAL_PREDEFINED_ENTITY, - NULL, NULL, NULL, NULL, 0 + NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityQuot = { NULL, XML_ENTITY_DECL, BAD_CAST "quot", NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "\"", BAD_CAST "\"", 1, XML_INTERNAL_PREDEFINED_ENTITY, - NULL, NULL, NULL, NULL, 0 + NULL, NULL, NULL, NULL, 0, 1 }; static xmlEntity xmlEntityApos = { NULL, XML_ENTITY_DECL, BAD_CAST "apos", NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "'", BAD_CAST "'", 1, XML_INTERNAL_PREDEFINED_ENTITY, - NULL, NULL, NULL, NULL, 0 + NULL, NULL, NULL, NULL, 0, 1 }; /** @@ -182,6 +182,7 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type, } memset(ret, 0, sizeof(xmlEntity)); ret->type = XML_ENTITY_DECL; + ret->checked = 0; /* * fill the structure. diff --git a/example/Makefile.in b/example/Makefile.in index d1ac9ef..42681b2 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -156,6 +156,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -184,6 +185,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -219,6 +221,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/include/Makefile.in b/include/Makefile.in index e4897bc..1ed9f8a 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -145,6 +145,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -173,6 +174,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -208,6 +210,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h index 8477efb..05905e4 100644 --- a/include/libxml/HTMLparser.h +++ b/include/libxml/HTMLparser.h @@ -105,6 +105,9 @@ XMLPUBFUN int XMLCALL XMLPUBFUN void XMLCALL htmlParseElement(htmlParserCtxtPtr ctxt); +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlNewParserCtxt(void); + XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateMemoryParserCtxt(const char *buffer, int size); diff --git a/include/libxml/Makefile.in b/include/libxml/Makefile.in index f273b82..a63f77f 100644 --- a/include/libxml/Makefile.in +++ b/include/libxml/Makefile.in @@ -149,6 +149,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -177,6 +178,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -212,6 +214,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ diff --git a/include/libxml/entities.h b/include/libxml/entities.h index 0bb28a0..fdd7222 100644 --- a/include/libxml/entities.h +++ b/include/libxml/entities.h @@ -56,6 +56,7 @@ struct _xmlEntity { struct _xmlEntity *nexte; /* unused */ const xmlChar *URI; /* the full URI as computed */ int owner; /* does the entity own the childrens */ + int checked; /* was the entity content checked */ }; /* diff --git a/include/libxml/parser.h b/include/libxml/parser.h index 46377ff..fe63bda 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -1089,7 +1089,9 @@ typedef enum { XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ - XML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ + XML_PARSE_COMPACT = 1<<16 /* compact small text nodes; no modification of + the tree allowed afterwards (will possibly + crash if you try to modify the tree) */ } xmlParserOption; XMLPUBFUN void XMLCALL @@ -1204,6 +1206,7 @@ typedef enum { XML_WITH_DEBUG = 28, XML_WITH_DEBUG_MEM = 29, XML_WITH_DEBUG_RUN = 30, + XML_WITH_ZLIB = 31, XML_WITH_NONE = 99999 /* just to be sure of allocation size */ } xmlFeature; diff --git a/include/libxml/tree.h b/include/libxml/tree.h index b162574..321280e 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -54,6 +54,15 @@ typedef xmlEntity *xmlEntityPtr; */ #define BASE_BUFFER_SIZE 4096 +/** + * LIBXML_NAMESPACE_DICT: + * + * Defines experimental behaviour: + * 1) xmlNs gets an additional field @context (a xmlDoc) + * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc. + */ +/* #define LIBXML_NAMESPACE_DICT */ + /** * xmlBufferAllocationScheme: * @@ -342,6 +351,7 @@ struct _xmlNs { const xmlChar *href; /* URL for the namespace */ const xmlChar *prefix; /* prefix for the namespace */ void *_private; /* application data */ + struct _xmlDoc *context; /* normally an xmlDoc */ }; /** @@ -508,10 +518,47 @@ struct _xmlDoc { void *psvi; /* for type/PSVI informations */ }; + typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt; typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr; + +/** + * xmlDOMWrapAcquireNsFunction: + * @ctxt: a DOM wrapper context + * @node: the context node (element or attribute) + * @nsName: the requested namespace name + * @nsPrefix: the requested namespace prefix + * + * A function called to acquire namespaces (xmlNs) from the wrapper. + * + * Returns an xmlNsPtr or NULL in case of an error. + */ +typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr node, + const xmlChar *nsName, + const xmlChar *nsPrefix); + +/** + * xmlDOMWrapCtxt: + * + * Context for DOM wrapper-operations. + */ struct _xmlDOMWrapCtxt { void * _private; + /* + * The type of this context, just in case we need specialized + * contexts in the future. + */ + int type; + /* + * Internal namespace map used for various operations. + */ + void * namespaceMap; + /* + * Use this one to acquire an xmlNsPtr intended for node->ns. + * (Note that this is not intended for elem->nsDef). + */ + xmlDOMWrapAcquireNsFunction getNsForNodeFunc; }; /** @@ -541,7 +588,7 @@ struct _xmlDOMWrapCtxt { /* * Some helper functions */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) XMLPUBFUN int XMLCALL xmlValidateNCName (const xmlChar *value, int space); @@ -871,7 +918,7 @@ XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNsByHref (xmlDocPtr doc, xmlNodePtr node, const xmlChar *href); -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) XMLPUBFUN xmlNsPtr * XMLCALL xmlGetNsList (xmlDocPtr doc, xmlNodePtr node); diff --git a/include/libxml/uri.h b/include/libxml/uri.h index 89e3653..5e29671 100644 --- a/include/libxml/uri.h +++ b/include/libxml/uri.h @@ -80,6 +80,8 @@ XMLPUBFUN void XMLCALL xmlFreeURI (xmlURIPtr uri); XMLPUBFUN xmlChar* XMLCALL xmlCanonicPath (const xmlChar *path); +XMLPUBFUN xmlChar* XMLCALL + xmlPathToURI (const xmlChar *path); #ifdef __cplusplus } diff --git a/include/libxml/xinclude.h b/include/libxml/xinclude.h index 4bb0aab..ba9c9b5 100644 --- a/include/libxml/xinclude.h +++ b/include/libxml/xinclude.h @@ -94,6 +94,10 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlXIncludeProcessFlags (xmlDocPtr doc, int flags); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlagsData(xmlDocPtr doc, + int flags, + void *data); XMLPUBFUN int XMLCALL xmlXIncludeProcessTree (xmlNodePtr tree); XMLPUBFUN int XMLCALL diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h index cc75dc0..bacbe1d 100644 --- a/include/libxml/xmlversion.h +++ b/include/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.6.26" +#define LIBXML_DOTTED_VERSION "2.6.27" /** * LIBXML_VERSION: * - * the version number: 1.2.3 value is 1002003 + * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20626 +#define LIBXML_VERSION 20627 /** * LIBXML_VERSION_STRING: * - * the version number string, 1.2.3 value is "1002003" + * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20626" +#define LIBXML_VERSION_STRING "20627" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-CVS2798" +#define LIBXML_VERSION_EXTRA "-CVS2872" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20626); +#define LIBXML_TEST_VERSION xmlCheckVersion(20627); #ifndef VMS #if 0 @@ -372,6 +372,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_MODULE_EXTENSION ".so" #endif +/** + * LIBXML_ZLIB_ENABLED: + * + * Whether the Zlib support is compiled in + */ +#if 1 +#define LIBXML_ZLIB_ENABLED +#endif + /** * ATTRIBUTE_UNUSED: * diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index cf547dd..0967913 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -34,14 +34,14 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); /** * LIBXML_VERSION: * - * the version number: 1.2.3 value is 1002003 + * the version number: 1.2.3 value is 10203 */ #define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ /** * LIBXML_VERSION_STRING: * - * the version number string, 1.2.3 value is "1002003" + * the version number string, 1.2.3 value is "10203" */ #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" @@ -372,6 +372,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_MODULE_EXTENSION "@MODULE_EXTENSION@" #endif +/** + * LIBXML_ZLIB_ENABLED: + * + * Whether the Zlib support is compiled in + */ +#if @WITH_ZLIB@ +#define LIBXML_ZLIB_ENABLED +#endif + /** * ATTRIBUTE_UNUSED: * diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h index febbf78..89008fc 100644 --- a/include/libxml/xpath.h +++ b/include/libxml/xpath.h @@ -343,7 +343,8 @@ struct _xmlXPathContext { /* dictionnary */ xmlDictPtr dict; /* dictionnary if any */ - int flags; /* flags to control compilation */ + int flags; /* flags to control compilation */ + /* Cache for reusal of XPath objects */ void *cache; }; @@ -520,6 +521,9 @@ XMLPUBFUN xmlXPathCompExprPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathCompiledEval (xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx); +XMLPUBFUN int XMLCALL + xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctxt); XMLPUBFUN void XMLCALL xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); #endif /* LIBXML_XPATH_ENABLED */ diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in index c66f82b..075848c 100644 --- a/libxml-2.0.pc.in +++ b/libxml-2.0.pc.in @@ -8,5 +8,6 @@ Name: libXML Version: @VERSION@ Description: libXML library version2. Requires: -Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ +Libs: -L${libdir} -lxml2 +Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/libxml2.spec b/libxml2.spec index 5604bb9..9cf0f73 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,6 +1,6 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.6.26 +Version: 2.6.27 Release: 1 License: MIT Group: Development/Libraries @@ -128,6 +128,6 @@ rm -fr %{buildroot} %doc doc/python.html %changelog -* Tue Jun 6 2006 Daniel Veillard -- upstream release 2.6.26 see http://xmlsoft.org/news.html +* Wed Oct 25 2006 Daniel Veillard +- upstream release 2.6.27 see http://xmlsoft.org/news.html diff --git a/ltmain.sh b/ltmain.sh index 06823e0..0223495 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -46,10 +46,16 @@ PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi # Check that we have a working $echo. @@ -105,12 +111,14 @@ esac # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi +for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + fi" +done # Make sure IFS has a sensible default lt_nl=' @@ -136,6 +144,8 @@ duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 ##################################### # Shell function definitions: @@ -327,7 +337,17 @@ func_extract_archives () *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" @@ -758,6 +778,7 @@ if test -z "$show_help"; then *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; + *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` @@ -1138,8 +1159,9 @@ EOF for arg do case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi @@ -1147,12 +1169,20 @@ EOF dlopen_self=$dlopen_self_static fi prefer_static_libs=yes - else + ;; + -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built - fi + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac build_libtool_libs=no build_old_libs=yes break @@ -1712,7 +1742,7 @@ EOF continue ;; - -static) + -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects @@ -2490,7 +2520,9 @@ EOF if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. @@ -3186,7 +3218,7 @@ EOF # which has an extra 1 added just for fun # case $version_type in - darwin|linux|osf|windows) + darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" @@ -3410,11 +3442,11 @@ EOF fi # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - done +# for path in $notinst_path; do +# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` +# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` +# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` +# done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. @@ -3515,13 +3547,12 @@ EOF int main() { return 0; } EOF $rm conftest - $LTCC $LTCFLAGS -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then ldd_output=`ldd conftest` for i in $deplibs; do name=`expr $i : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then + if test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) @@ -3560,9 +3591,7 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then $rm conftest - $LTCC $LTCFLAGS -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in @@ -3594,7 +3623,7 @@ EOF droppeddeps=yes $echo $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" + $echo "*** make it link in! You will probably need to install it or some" $echo "*** library that it depends on before this library will be fully" $echo "*** functional. Installing it before continuing would be even better." fi @@ -4239,12 +4268,14 @@ EOF reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" @@ -4692,16 +4723,16 @@ static const void *lt_preloaded_setup() { case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; @@ -4716,13 +4747,13 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. @@ -4809,7 +4840,7 @@ static const void *lt_preloaded_setup() { if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= @@ -4846,7 +4877,7 @@ static const void *lt_preloaded_setup() { fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. @@ -5253,6 +5284,18 @@ EOF Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi + # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @@ -5395,7 +5438,7 @@ else ;; esac $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else @@ -5581,7 +5624,7 @@ fi\ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -5926,9 +5969,9 @@ relink_command=\"$relink_command\"" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 @@ -6137,7 +6180,7 @@ relink_command=\"$relink_command\"" file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : @@ -6413,12 +6456,15 @@ relink_command=\"$relink_command\"" fi # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi + for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + # Now prepare to actually exec the command. exec_cmd="\$cmd$args" @@ -6775,9 +6821,9 @@ The following components of LINK-COMMAND are treated specially: -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE + try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX - try to export only the symbols matching REGEX + try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened @@ -6791,9 +6837,11 @@ The following components of LINK-COMMAND are treated specially: -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] + specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. diff --git a/parser.c b/parser.c index 12b2d7f..bd44585 100644 --- a/parser.c +++ b/parser.c @@ -807,6 +807,12 @@ xmlHasFeature(xmlFeature feature) #else return(0); #endif + case XML_WITH_ZLIB: +#ifdef LIBXML_ZLIB_ENABLED + return(1); +#else + return(0); +#endif default: break; } @@ -1442,7 +1448,7 @@ static int spacePop(xmlParserCtxtPtr ctxt) { if (ctxt->spaceNr > 0) ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1]; else - ctxt->space = NULL; + ctxt->space = &ctxt->spaceTab[0]; ret = ctxt->spaceTab[ctxt->spaceNr]; ctxt->spaceTab[ctxt->spaceNr] = -1; return(ret); @@ -2356,7 +2362,8 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, /* * Check for xml:space value. */ - if (*(ctxt->space) == 1) + if ((ctxt->space == NULL) || (*(ctxt->space) == 1) || + (*(ctxt->space) == -2)) return(0); /* @@ -2485,10 +2492,12 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) { buffer[len] = 0; } - /* nasty but well=formed if ((c == ':') && (*cur == 0)) { + if (buffer != NULL) + xmlFree(buffer); + *prefix = NULL; return(xmlStrdup(name)); - } */ + } if (buffer == NULL) ret = xmlStrndup(buf, len); @@ -3500,9 +3509,13 @@ get_more_space: if (ctxt->sax->ignorableWhitespace != NULL) ctxt->sax->ignorableWhitespace(ctxt->userData, tmp, nbchar); - } else if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, - tmp, nbchar); + } else { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, + tmp, nbchar); + if (*ctxt->space == -1) + *ctxt->space = -2; + } } else if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL)) { ctxt->sax->characters(ctxt->userData, @@ -3549,9 +3562,13 @@ get_more: if (ctxt->sax->ignorableWhitespace != NULL) ctxt->sax->ignorableWhitespace(ctxt->userData, tmp, nbchar); - } else if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, - tmp, nbchar); + } else { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, + tmp, nbchar); + if (*ctxt->space == -1) + *ctxt->space = -2; + } line = ctxt->input->line; col = ctxt->input->col; } else if (ctxt->sax != NULL) { @@ -3634,6 +3651,10 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) { } else { if (ctxt->sax->characters != NULL) ctxt->sax->characters(ctxt->userData, buf, nbchar); + if ((ctxt->sax->characters != + ctxt->sax->ignorableWhitespace) && + (*ctxt->space == -1)) + *ctxt->space = -2; } } nbchar = 0; @@ -3658,6 +3679,9 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) { } else { if (ctxt->sax->characters != NULL) ctxt->sax->characters(ctxt->userData, buf, nbchar); + if ((ctxt->sax->characters != ctxt->sax->ignorableWhitespace) && + (*ctxt->space == -1)) + *ctxt->space = -2; } } } @@ -5923,10 +5947,13 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { ctxt->sax->characters(ctxt->userData, out, i); } } else { + int was_checked; + ent = xmlParseEntityRef(ctxt); if (ent == NULL) return; if (!ctxt->wellFormed) return; + was_checked = ent->checked; if ((ent->name != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) { xmlNodePtr list = NULL; @@ -5938,8 +5965,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { * where the ent->children is filled with the result from * the parsing. */ - if (ent->children == NULL) { + if (ent->checked == 0) { xmlChar *value; + value = ent->content; /* @@ -6074,15 +6102,69 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { list = NULL; } } + ent->checked = 1; + } + + if (ent->children == NULL) { + /* + * Probably running in SAX mode and the callbacks don't + * build the entity content. So unless we already went + * though parsing for first checking go though the entity + * content to generate callbacks associated to the entity + */ + if (was_checked == 1) { + void *user_data; + /* + * This is a bit hackish but this seems the best + * way to make sure both SAX and DOM entity support + * behaves okay. + */ + if (ctxt->userData == ctxt) + user_data = NULL; + else + user_data = ctxt->userData; + + if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) { + ctxt->depth++; + ret = xmlParseBalancedChunkMemoryInternal(ctxt, + ent->content, user_data, NULL); + ctxt->depth--; + } else if (ent->etype == + XML_EXTERNAL_GENERAL_PARSED_ENTITY) { + ctxt->depth++; + ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, + ctxt->sax, user_data, ctxt->depth, + ent->URI, ent->ExternalID, NULL); + ctxt->depth--; + } else { + ret = XML_ERR_ENTITY_PE_INTERNAL; + xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, + "invalid entity type found\n", NULL); + } + if (ret == XML_ERR_ENTITY_LOOP) { + xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); + return; + } + } + if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) && + (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) { + /* + * Entity reference callback comes second, it's somewhat + * superfluous but a compatibility to historical behaviour + */ + ctxt->sax->reference(ctxt->userData, ent->name); + } + return; } if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) && - (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) { + (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) { /* * Create a node. */ ctxt->sax->reference(ctxt->userData, ent->name); return; - } else if (ctxt->replaceEntities) { + } + if ((ctxt->replaceEntities) || (ent->children == NULL)) { /* * There is a problem on the handling of _private for entities * (bug 155816): Should we copy the content of the field from @@ -6206,31 +6288,6 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { ctxt->nodemem = 0; ctxt->nodelen = 0; return; - } else { - /* - * Probably running in SAX mode - */ - xmlParserInputPtr input; - - input = xmlNewEntityInputStream(ctxt, ent); - xmlPushInput(ctxt, input); - if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) && - (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && - (IS_BLANK_CH(NXT(5)))) { - xmlParseTextDecl(ctxt); - if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { - /* - * The XML REC instructs us to stop parsing right here - */ - ctxt->instate = XML_PARSER_EOF; - return; - } - if (input->standalone == 1) { - xmlFatalErr(ctxt, XML_ERR_EXT_ENTITY_STANDALONE, - NULL); - } - } - return; } } } else { @@ -6337,7 +6394,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { if ((ctxt->inSubset == 0) && (ctxt->sax != NULL) && (ctxt->sax->reference != NULL)) { - ctxt->sax->reference(ctxt, name); + ctxt->sax->reference(ctxt->userData, name); } } ctxt->valid = 0; @@ -7808,7 +7865,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref, const xmlChar **atts = ctxt->atts; int maxatts = ctxt->maxatts; int nratts, nbatts, nbdef; - int i, j, nbNs, attval; + int i, j, nbNs, attval, oldline, oldcol; const xmlChar *base; unsigned long cur; int nsNr = ctxt->nsNr; @@ -7827,6 +7884,8 @@ reparse: SHRINK; base = ctxt->input->base; cur = ctxt->input->cur - ctxt->input->base; + oldline = ctxt->input->line; + oldcol = ctxt->input->col; nbatts = 0; nratts = 0; nbdef = 0; @@ -7861,6 +7920,12 @@ reparse: attname = xmlParseAttribute2(ctxt, prefix, localname, &aprefix, &attvalue, &len, &alloc); + if (ctxt->input->base != base) { + if ((attvalue != NULL) && (alloc != 0)) + xmlFree(attvalue); + attvalue = NULL; + goto base_changed; + } if ((attname != NULL) && (attvalue != NULL)) { if (len < 0) len = xmlStrlen(attvalue); if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) { @@ -8152,6 +8217,8 @@ base_changed: xmlFree((xmlChar *) atts[i]); } ctxt->input->cur = ctxt->input->base + cur; + ctxt->input->line = oldline; + ctxt->input->col = oldcol; if (ctxt->wellFormed == 1) { goto reparse; } @@ -8349,7 +8416,8 @@ void xmlParseContent(xmlParserCtxtPtr ctxt) { GROW; while ((RAW != 0) && - ((RAW != '<') || (NXT(1) != '/'))) { + ((RAW != '<') || (NXT(1) != '/')) && + (ctxt->instate != XML_PARSER_EOF)) { const xmlChar *test = CUR_PTR; unsigned int cons = ctxt->input->consumed; const xmlChar *cur = ctxt->input->cur; @@ -8442,6 +8510,14 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { xmlNodePtr ret; int nsNr = ctxt->nsNr; + if ((unsigned int) ctxt->nameNr > xmlParserMaxDepth) { + xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR, + "Excessive depth in document: change xmlParserMaxDepth = %d\n", + xmlParserMaxDepth); + ctxt->instate = XML_PARSER_EOF; + return; + } + /* Capture start position */ if (ctxt->record_info) { node_info.begin_pos = ctxt->input->consumed + @@ -8451,6 +8527,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { if (ctxt->spaceNr == 0) spacePush(ctxt, -1); + else if (*ctxt->space == -2) + spacePush(ctxt, -1); else spacePush(ctxt, *ctxt->space); @@ -9767,6 +9845,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { } if (ctxt->spaceNr == 0) spacePush(ctxt, -1); + else if (*ctxt->space == -2) + spacePush(ctxt, -1); else spacePush(ctxt, *ctxt->space); #ifdef LIBXML_SAX1_ENABLED @@ -10759,7 +10839,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, * Load and parse a DTD * * Returns the resulting xmlDtdPtr or NULL in case of error. - * @input will be freed at parsing end. + * @input will be freed by the function in any case. */ xmlDtdPtr @@ -10775,6 +10855,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { + xmlFreeParserInputBuffer(input); return(NULL); } @@ -10796,6 +10877,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, pinput = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE); if (pinput == NULL) { if (sax != NULL) ctxt->sax = NULL; + xmlFreeParserInputBuffer(input); xmlFreeParserCtxt(ctxt); return(NULL); } @@ -10919,7 +11001,8 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, */ if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL)) - input = ctxt->sax->resolveEntity(ctxt, ExternalID, systemIdCanonic); + input = ctxt->sax->resolveEntity(ctxt->userData, ExternalID, + systemIdCanonic); if (input == NULL) { if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); @@ -11032,6 +11115,8 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, int ret = 0; xmlChar start[4]; xmlCharEncoding enc; + xmlParserInputPtr inputStream; + char *directory = NULL; if (ctx == NULL) return(-1); @@ -11046,11 +11131,27 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, if (ctx->myDoc == NULL) /* @@ relax but check for dereferences */ return(-1); - - ctxt = xmlCreateEntityParserCtxt(URL, ID, NULL); - if (ctxt == NULL) return(-1); + ctxt = xmlNewParserCtxt(); + if (ctxt == NULL) { + return(-1); + } + ctxt->userData = ctxt; ctxt->_private = ctx->_private; + + inputStream = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt); + if (inputStream == NULL) { + xmlFreeParserCtxt(ctxt); + return(-1); + } + + inputPush(ctxt, inputStream); + + if ((ctxt->directory == NULL) && (directory == NULL)) + directory = xmlParserGetDirectory((char *)URL); + if ((ctxt->directory == NULL) && (directory != NULL)) + ctxt->directory = directory; + oldsax = ctxt->sax; ctxt->sax = ctx->sax; xmlDetectSAX2(ctxt); @@ -11897,6 +11998,9 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, } else { ctxt->myDoc = newDoc; newDoc->children->doc = doc; + /* Ensure that doc has XML spec namespace */ + xmlSearchNsByHref(doc, (xmlNodePtr)doc, XML_XML_NAMESPACE); + newDoc->oldNs = doc->oldNs; } ctxt->instate = XML_PARSER_CONTENT; ctxt->depth = depth; @@ -11957,6 +12061,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, xmlFreeParserCtxt(ctxt); newDoc->intSubset = NULL; newDoc->extSubset = NULL; + newDoc->oldNs = NULL; xmlFreeDoc(newDoc); return(ret); diff --git a/parserInternals.c b/parserInternals.c index 5706299..f4da58d 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -1473,6 +1473,7 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) { else URI = xmlStrdup((xmlChar *) inputStream->filename); directory = xmlParserGetDirectory((const char *) URI); + if (inputStream->filename != NULL) xmlFree((char *)inputStream->filename); inputStream->filename = (char *) xmlCanonicPath((const xmlChar *) URI); if (URI != NULL) xmlFree((char *) URI); inputStream->directory = directory; diff --git a/python/Makefile.am b/python/Makefile.am index c37c0c2..6c0bffa 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -25,7 +25,7 @@ EXTRA_DIST = \ libxml2-python-api.xml \ $(DOCS) -libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version -L$(top_builddir)/.libs +libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version if WITH_PYTHON mylibs = \ diff --git a/python/Makefile.in b/python/Makefile.in index 9451aaf..9f3a13e 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -174,6 +174,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -202,6 +203,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -237,6 +239,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ @@ -321,7 +324,7 @@ EXTRA_DIST = \ libxml2-python-api.xml \ $(DOCS) -libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version -L$(top_builddir)/.libs +libxml2mod_la_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -module -avoid-version @WITH_PYTHON_TRUE@mylibs = \ @WITH_PYTHON_TRUE@ $(top_builddir)/libxml2.la diff --git a/python/generator.py b/python/generator.py index 642b8d1..f116f8a 100755 --- a/python/generator.py +++ b/python/generator.py @@ -231,7 +231,7 @@ skipped_types = { py_types = { 'void': (None, None, None, None), 'int': ('i', None, "int", "int"), - 'long': ('i', None, "int", "int"), + 'long': ('l', None, "long", "long"), 'double': ('d', None, "double", "double"), 'unsigned int': ('i', None, "int", "int"), 'xmlChar': ('c', None, "int", "int"), diff --git a/python/libxml.c b/python/libxml.c index 88b29cf..6e9a78e 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -3677,6 +3677,40 @@ libxml_getObjDesc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return Py_BuildValue((char *)"s", str); } +static PyObject * +libxml_compareNodesEqual(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + + PyObject *py_node1, *py_node2; + xmlNodePtr node1, node2; + + if (!PyArg_ParseTuple(args, (char *)"OO:compareNodesEqual", + &py_node1, &py_node2)) + return NULL; + /* To compare two node objects, we compare their pointer addresses */ + node1 = PyxmlNode_Get(py_node1); + node2 = PyxmlNode_Get(py_node2); + if ( node1 == node2 ) + return Py_BuildValue((char *)"i", 1); + else + return Py_BuildValue((char *)"i", 0); + +} + +static PyObject * +libxml_nodeHash(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + + PyObject *py_node1; + xmlNodePtr node1; + + if (!PyArg_ParseTuple(args, (char *)"O:nodeHash", &py_node1)) + return NULL; + /* For simplicity, we use the node pointer address as a hash value */ + node1 = PyxmlNode_Get(py_node1); + + return PyLong_FromVoidPtr(node1); + +} + /************************************************************************ * * * The registration stuff * @@ -3730,6 +3764,8 @@ static PyMethodDef libxmlMethods[] = { #endif #endif {(char *) "getObjDesc", libxml_getObjDesc, METH_VARARGS, NULL}, + {(char *) "compareNodesEqual", libxml_compareNodesEqual, METH_VARARGS, NULL}, + {(char *) "nodeHash", libxml_nodeHash, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; diff --git a/python/libxml.py b/python/libxml.py index 997e15f..4c9fe92 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -232,6 +232,23 @@ class xmlCore: self._o = _obj; return self._o = None + + def __eq__(self, other): + if other == None: + return False + ret = libxml2mod.compareNodesEqual(self._o, other._o) + if ret == None: + return False + return ret == True + def __ne__(self, other): + if other == None: + return True + ret = libxml2mod.compareNodesEqual(self._o, other._o) + return not ret + def __hash__(self): + ret = libxml2mod.nodeHash(self._o) + return ret + def __str__(self): return self.serialize() def get_parent(self): @@ -535,10 +552,17 @@ def nodeWrap(o): return xmlNode(_obj=o) def xpathObjectRet(o): - if type(o) == type([]) or type(o) == type(()): - ret = map(lambda x: nodeWrap(x), o) + otype = type(o) + if otype == type([]): + ret = map(xpathObjectRet, o) return ret - return o + elif otype == type(()): + ret = map(xpathObjectRet, o) + return tuple(ret) + elif otype == type('') or otype == type(0) or otype == type(0.0): + return o + else: + return nodeWrap(o) # # register an XPath function diff --git a/python/libxml2-py.c b/python/libxml2-py.c index e0559a0..853a894 100644 --- a/python/libxml2-py.c +++ b/python/libxml2-py.c @@ -2411,6 +2411,20 @@ libxml_xmlSaveFormatFile(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_OUTPUT_ENABLED) */ +PyObject * +libxml_xmlPathToURI(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + xmlChar * c_retval; + xmlChar * path; + + if (!PyArg_ParseTuple(args, (char *)"z:xmlPathToURI", &path)) + return(NULL); + + c_retval = xmlPathToURI(path); + py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); + return(py_retval); +} + PyObject * libxml_xmlParseXMLDecl(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { xmlParserCtxtPtr ctxt; @@ -2535,7 +2549,7 @@ libxml_xmlXPathOrderDocElems(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { doc = (xmlDocPtr) PyxmlNode_Get(pyobj_doc); c_retval = xmlXPathOrderDocElems(doc); - py_retval = libxml_intWrap((int) c_retval); + py_retval = libxml_longWrap((long) c_retval); return(py_retval); } @@ -4253,7 +4267,7 @@ libxml_xmlByteConsumed(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt); c_retval = xmlByteConsumed(ctxt); - py_retval = libxml_intWrap((int) c_retval); + py_retval = libxml_longWrap((long) c_retval); return(py_retval); } @@ -7001,7 +7015,7 @@ libxml_xmlClearParserCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(Py_None); } -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) PyObject * libxml_xmlValidateNCName(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -7017,7 +7031,7 @@ libxml_xmlValidateNCName(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) */ +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) */ PyObject * libxml_xmlStrlen(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -7365,7 +7379,7 @@ libxml_xmlTextReaderByteConsumed(PyObject *self ATTRIBUTE_UNUSED, PyObject *args reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader); c_retval = xmlTextReaderByteConsumed(reader); - py_retval = libxml_intWrap((int) c_retval); + py_retval = libxml_longWrap((long) c_retval); return(py_retval); } @@ -10291,6 +10305,18 @@ libxml_xmlXPtrNewRangeNodes(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_XPTR_ENABLED) */ +#if defined(LIBXML_HTML_ENABLED) +PyObject * +libxml_htmlNewParserCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) { + PyObject *py_retval; + htmlParserCtxtPtr c_retval; + + c_retval = htmlNewParserCtxt(); + py_retval = libxml_xmlParserCtxtPtrWrap((xmlParserCtxtPtr) c_retval); + return(py_retval); +} + +#endif /* defined(LIBXML_HTML_ENABLED) */ PyObject * libxml_xmlStringDecodeEntities(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -14082,7 +14108,7 @@ libxml_xmlGetLineNo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { node = (xmlNodePtr) PyxmlNode_Get(pyobj_node); c_retval = xmlGetLineNo(node); - py_retval = libxml_intWrap((int) c_retval); + py_retval = libxml_longWrap((long) c_retval); return(py_retval); } diff --git a/python/setup.py b/python/setup.py index 99def88..9e3300b 100755 --- a/python/setup.py +++ b/python/setup.py @@ -226,7 +226,7 @@ else: setup (name = "libxml2-python", # On *nix, the version number is created from setup.py.in # On windows, it is set by configure.js - version = "2.6.26", + version = "2.6.27", description = descr, author = "Daniel Veillard", author_email = "veillard@redhat.com", diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 3571abf..39950f6 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -43,7 +43,8 @@ PYTESTS= \ tstmem.py \ validDTD.py \ validSchemas.py \ - validRNG.py + validRNG.py \ + compareNodes.py XMLS= \ tst.xml \ diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in index 5b84cc2..bd49790 100644 --- a/python/tests/Makefile.in +++ b/python/tests/Makefile.in @@ -136,6 +136,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -164,6 +165,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -199,6 +201,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ @@ -302,7 +305,8 @@ PYTESTS = \ tstmem.py \ validDTD.py \ validSchemas.py \ - validRNG.py + validRNG.py \ + compareNodes.py XMLS = \ tst.xml \ diff --git a/python/tests/compareNodes.py b/python/tests/compareNodes.py new file mode 100755 index 0000000..ec04323 --- /dev/null +++ b/python/tests/compareNodes.py @@ -0,0 +1,50 @@ +#!/usr/bin/python -u +import sys +import libxml2 + +# Memory debug specific +libxml2.debugMemory(1) + +# +# Testing XML Node comparison and Node hash-value +# +doc = libxml2.parseDoc("""""") +root = doc.getRootElement() + +# Create two different objects which point to foo +foonode1 = root.children +foonode2 = root.children + +# Now check that [in]equality tests work ok +if not ( foonode1 == foonode2 ): + print "Error comparing nodes with ==, nodes should be equal but are unequal" + sys.exit(1) +if not ( foonode1 != root ): + print "Error comparing nodes with ==, nodes should not be equal but are equal" + sys.exit(1) +if not ( foonode1 != root ): + print "Error comparing nodes with !=, nodes should not be equal but are equal" +if ( foonode1 != foonode2 ): + print "Error comparing nodes with !=, nodes should be equal but are unequal" + +# Next check that the hash function for the objects also works ok +if not (hash(foonode1) == hash(foonode2)): + print "Error hash values for two equal nodes are different" + sys.exit(1) +if not (hash(foonode1) != hash(root)): + print "Error hash values for two unequal nodes are not different" + sys.exit(1) +if hash(foonode1) == hash(root): + print "Error hash values for two unequal nodes are equal" + sys.exit(1) + +# Basic tests successful +doc.freeDoc() + +# Memory debug specific +libxml2.cleanupParser() +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() diff --git a/python/types.c b/python/types.c index 8a6a9a0..5c5dcca 100644 --- a/python/types.c +++ b/python/types.c @@ -395,8 +395,106 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) ret = PyString_FromString((char *) obj->stringval); break; case XPATH_POINT: + { + PyObject *node; + PyObject *indexIntoNode; + PyObject *tuple; + + node = libxml_xmlNodePtrWrap(obj->user); + indexIntoNode = PyInt_FromLong((long) obj->index); + + tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, node); + PyTuple_SetItem(tuple, 1, indexIntoNode); + + ret = tuple; + break; + } case XPATH_RANGE: + { + unsigned short bCollapsedRange; + + bCollapsedRange = ( (obj->user2 == NULL) || + ((obj->user2 == obj->user) && (obj->index == obj->index2)) ); + if ( bCollapsedRange ) { + PyObject *node; + PyObject *indexIntoNode; + PyObject *tuple; + PyObject *list; + + list = PyList_New(1); + + node = libxml_xmlNodePtrWrap(obj->user); + indexIntoNode = PyInt_FromLong((long) obj->index); + + tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, node); + PyTuple_SetItem(tuple, 1, indexIntoNode); + + PyList_SetItem(list, 0, tuple); + + ret = list; + } else { + PyObject *node; + PyObject *indexIntoNode; + PyObject *tuple; + PyObject *list; + + list = PyList_New(2); + + node = libxml_xmlNodePtrWrap(obj->user); + indexIntoNode = PyInt_FromLong((long) obj->index); + + tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, node); + PyTuple_SetItem(tuple, 1, indexIntoNode); + + PyList_SetItem(list, 0, tuple); + + node = libxml_xmlNodePtrWrap(obj->user2); + indexIntoNode = PyInt_FromLong((long) obj->index2); + + tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, node); + PyTuple_SetItem(tuple, 1, indexIntoNode); + + PyList_SetItem(list, 1, tuple); + + ret = list; + } + break; + } case XPATH_LOCATIONSET: + { + xmlLocationSetPtr set; + + set = obj->user; + if ( set && set->locNr > 0 ) { + int i; + PyObject *list; + + list = PyList_New(set->locNr); + + for (i=0; ilocNr; i++) { + xmlXPathObjectPtr setobj; + PyObject *pyobj; + + setobj = set->locTab[i]; /*xmlXPathObjectPtr setobj*/ + + pyobj = libxml_xmlXPathObjectPtrWrap(setobj); + /* xmlXPathFreeObject(setobj) is called */ + set->locTab[i] = NULL; + + PyList_SetItem(list, i, pyobj); + } + set->locNr = 0; + ret = list; + } else { + Py_INCREF(Py_None); + ret = Py_None; + } + break; + } default: #ifdef DEBUG printf("Unable to convert XPath object type %d\n", obj->type); @@ -422,6 +520,20 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj) if PyFloat_Check (obj) { ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj)); + + } else if PyInt_Check(obj) { + + ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj)); + + } else if PyBool_Check (obj) { + + if (obj == Py_True) { + ret = xmlXPathNewBoolean(1); + } + else { + ret = xmlXPathNewBoolean(0); + } + } else if PyString_Check (obj) { xmlChar *str; diff --git a/relaxng.c b/relaxng.c index dd8b6cd..16527cc 100644 --- a/relaxng.c +++ b/relaxng.c @@ -9899,8 +9899,10 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt, if ((ctxt->flags & FLAGS_IGNORABLE) == 0) { xmlRelaxNGDumpValidError(ctxt); ret = 0; +#if 0 } else { ret = -2; +#endif } } else { if (ctxt->errNr > errNr) diff --git a/runtest.c b/runtest.c index cf0fb63..b694d56 100644 --- a/runtest.c +++ b/runtest.c @@ -565,6 +565,7 @@ static char *resultFilename(const char *filename, const char *out, const char *suffix) { const char *base; char res[500]; + char suffixbuff[500]; /************* if ((filename[0] == 't') && (filename[1] == 'e') && @@ -578,7 +579,14 @@ static char *resultFilename(const char *filename, const char *out, suffix = ".tmp"; if (out == NULL) out = ""; - snprintf(res, 499, "%s%s%s", out, base, suffix); + + strncpy(suffixbuff,suffix,499); +#ifdef VMS + if(strstr(base,".") && suffixbuff[0]=='.') + suffixbuff[0]='_'; +#endif + + snprintf(res, 499, "%s%s%s", out, base, suffixbuff); res[499] = 0; return(strdup(res)); } @@ -2881,6 +2889,7 @@ schemasOneTest(const char *sch, xmlDocPtr doc; xmlSchemaValidCtxtPtr ctxt; int ret = 0; + int validResult = 0; char *temp; FILE *schemasOutput; @@ -2908,10 +2917,10 @@ schemasOneTest(const char *sch, (xmlSchemaValidityErrorFunc) testErrorHandler, (xmlSchemaValidityWarningFunc) testErrorHandler, ctxt); - ret = xmlSchemaValidateDoc(ctxt, doc); - if (ret == 0) { + validResult = xmlSchemaValidateDoc(ctxt, doc); + if (validResult == 0) { fprintf(schemasOutput, "%s validates\n", filename); - } else if (ret > 0) { + } else if (validResult > 0) { fprintf(schemasOutput, "%s fails to validate\n", filename); } else { fprintf(schemasOutput, "%s validation generated an internal error\n", @@ -2927,12 +2936,10 @@ schemasOneTest(const char *sch, unlink(temp); free(temp); - if ((ret != 0) && (err != NULL)) { + if ((validResult != 0) && (err != NULL)) { if (compareFileMem(err, testErrors, testErrorsSize)) { fprintf(stderr, "Error for %s on %s failed\n", filename, sch); ret = 1; - } else { - ret = 0; } } diff --git a/testapi.c b/testapi.c index 4629bc2..01a4184 100644 --- a/testapi.c +++ b/testapi.c @@ -14,6 +14,7 @@ #include #endif +#include /* for putenv() */ #include #include #include @@ -126,6 +127,9 @@ int main(int argc, char **argv) { int ret; int blocks, mem; + /* access to the proxy can slow up regression tests a lot */ + putenv("http_proxy="); + memset(chartab, 0, sizeof(chartab)); strncpy((char *) chartab, " chartab\n", 20); memset(inttab, 0, sizeof(inttab)); @@ -2124,6 +2128,33 @@ test_htmlIsScriptAttribute(void) { } +static int +test_htmlNewParserCtxt(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) + int mem_base; + htmlParserCtxtPtr ret_val; + + mem_base = xmlMemBlocks(); + + ret_val = htmlNewParserCtxt(); + desret_htmlParserCtxtPtr(ret_val); + call_tests++; + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlNewParserCtxt", + xmlMemBlocks() - mem_base); + test_ret++; + printf("\n"); + } + function_tests++; +#endif + + return(test_ret); +} + + static int test_htmlNodeStatus(void) { int test_ret = 0; @@ -2723,7 +2754,7 @@ static int test_HTMLparser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n"); + if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n"); test_ret += test_UTF8ToHtml(); test_ret += test_htmlAttrAllowed(); test_ret += test_htmlAutoCloseTag(); @@ -2742,6 +2773,7 @@ test_HTMLparser(void) { test_ret += test_htmlHandleOmittedElem(); test_ret += test_htmlIsAutoClosed(); test_ret += test_htmlIsScriptAttribute(); + test_ret += test_htmlNewParserCtxt(); test_ret += test_htmlNodeStatus(); test_ret += test_htmlParseCharRef(); test_ret += test_htmlParseChunk(); @@ -19978,7 +20010,7 @@ test_xmlDocSetRootElement(void) { xmlNodePtr ret_val; xmlDocPtr doc; /* the document */ int n_doc; - xmlNodePtr root; /* the new document root element */ + xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */ int n_root; for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { @@ -23561,7 +23593,7 @@ static int test_xmlValidateNCName(void) { int test_ret = 0; -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #ifdef LIBXML_TREE_ENABLED int mem_base; int ret_val; @@ -24094,6 +24126,38 @@ test_xmlParseURIReference(void) { } +static int +test_xmlPathToURI(void) { + int test_ret = 0; + + int mem_base; + xmlChar * ret_val; + xmlChar * path; /* the resource locator in a filesystem notation */ + int n_path; + + for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { + mem_base = xmlMemBlocks(); + path = gen_const_xmlChar_ptr(n_path, 0); + + ret_val = xmlPathToURI((const xmlChar *)path); + desret_xmlChar_ptr(ret_val); + call_tests++; + des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlPathToURI", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_path); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + static int test_xmlPrintURI(void) { int test_ret = 0; @@ -24247,7 +24311,7 @@ static int test_uri(void) { int test_ret = 0; - if (quiet == 0) printf("Testing uri : 9 of 14 functions ...\n"); + if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n"); test_ret += test_xmlBuildRelativeURI(); test_ret += test_xmlBuildURI(); test_ret += test_xmlCanonicPath(); @@ -24256,6 +24320,7 @@ test_uri(void) { test_ret += test_xmlParseURI(); test_ret += test_xmlParseURIRaw(); test_ret += test_xmlParseURIReference(); + test_ret += test_xmlPathToURI(); test_ret += test_xmlPrintURI(); test_ret += test_xmlSaveUri(); test_ret += test_xmlURIEscape(); @@ -26889,6 +26954,54 @@ test_xmlXIncludeProcessFlags(void) { return(test_ret); } + +static int +test_xmlXIncludeProcessFlagsData(void) { + int test_ret = 0; + +#if defined(LIBXML_XINCLUDE_ENABLED) + int mem_base; + int ret_val; + xmlDocPtr doc; /* an XML document */ + int n_doc; + int flags; /* a set of xmlParserOption used for parsing XML includes */ + int n_flags; + void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ + int n_data; + + for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { + for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_data = 0;n_data < gen_nb_userdata;n_data++) { + mem_base = xmlMemBlocks(); + doc = gen_xmlDocPtr(n_doc, 0); + flags = gen_int(n_flags, 1); + data = gen_userdata(n_data, 2); + + ret_val = xmlXIncludeProcessFlagsData(doc, flags, data); + desret_int(ret_val); + call_tests++; + des_xmlDocPtr(n_doc, doc, 0); + des_int(n_flags, flags, 1); + des_userdata(n_data, data, 2); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_doc); + printf(" %d", n_flags); + printf(" %d", n_data); + printf("\n"); + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + #ifdef LIBXML_XINCLUDE_ENABLED #define gen_nb_xmlXIncludeCtxtPtr 1 @@ -27060,10 +27173,11 @@ static int test_xinclude(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n"); + if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n"); test_ret += test_xmlXIncludeNewContext(); test_ret += test_xmlXIncludeProcess(); test_ret += test_xmlXIncludeProcessFlags(); + test_ret += test_xmlXIncludeProcessFlagsData(); test_ret += test_xmlXIncludeProcessNode(); test_ret += test_xmlXIncludeProcessTree(); test_ret += test_xmlXIncludeProcessTreeFlags(); @@ -33356,7 +33470,7 @@ test_xmlSaveTree(void) { long ret_val; xmlSaveCtxtPtr ctxt; /* a document saving context */ int n_ctxt; - xmlNodePtr node; /* a document */ + xmlNodePtr node; /* the top node of the subtree to save */ int n_node; for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { @@ -45558,6 +45672,47 @@ test_xmlXPathCompiledEval(void) { } +static int +test_xmlXPathCompiledEvalToBoolean(void) { + int test_ret = 0; + +#if defined(LIBXML_XPATH_ENABLED) + int mem_base; + int ret_val; + xmlXPathCompExprPtr comp; /* the compiled XPath expression */ + int n_comp; + xmlXPathContextPtr ctxt; /* the XPath context */ + int n_ctxt; + + for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) { + for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + comp = gen_xmlXPathCompExprPtr(n_comp, 0); + ctxt = gen_xmlXPathContextPtr(n_ctxt, 1); + + ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt); + desret_int(ret_val); + call_tests++; + des_xmlXPathCompExprPtr(n_comp, comp, 0); + des_xmlXPathContextPtr(n_ctxt, ctxt, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_comp); + printf(" %d", n_ctxt); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + static int test_xmlXPathContextSetCache(void) { int test_ret = 0; @@ -46059,7 +46214,7 @@ static int test_xpath(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xpath : 29 of 37 functions ...\n"); + if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n"); test_ret += test_xmlXPathCastBooleanToNumber(); test_ret += test_xmlXPathCastBooleanToString(); test_ret += test_xmlXPathCastNodeSetToBoolean(); @@ -46077,6 +46232,7 @@ test_xpath(void) { test_ret += test_xmlXPathCmpNodes(); test_ret += test_xmlXPathCompile(); test_ret += test_xmlXPathCompiledEval(); + test_ret += test_xmlXPathCompiledEvalToBoolean(); test_ret += test_xmlXPathContextSetCache(); test_ret += test_xmlXPathConvertBoolean(); test_ret += test_xmlXPathConvertNumber(); diff --git a/threads.c b/threads.c index 90a461a..7124bca 100644 --- a/threads.c +++ b/threads.c @@ -319,8 +319,10 @@ xmlFreeRMutex(xmlRMutexPtr tok ATTRIBUTE_UNUSED) if (tok == NULL) return; #ifdef HAVE_PTHREAD_H - if (libxml_is_threaded != 0) + if (libxml_is_threaded != 0) { pthread_mutex_destroy(&tok->lock); + pthread_cond_destroy(&tok->cv); + } #elif defined HAVE_WIN32_THREADS DeleteCriticalSection(&tok->cs); #elif defined HAVE_BEOS_THREADS diff --git a/tree.c b/tree.c index d382e29..d5b9fec 100644 --- a/tree.c +++ b/tree.c @@ -43,8 +43,16 @@ int __xmlRegisterCallbacks = 0; +/************************************************************************ + * * + * Forward declarations * + * * + ************************************************************************/ + xmlNsPtr xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns); +static xmlChar* xmlGetPropNodeValueInternal(xmlAttrPtr prop); + /************************************************************************ * * * Tree memory error handler * @@ -337,7 +345,7 @@ xmlSplitQName3(const xmlChar *name, int *len) { #define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l) -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) /** * xmlValidateNCName: * @value: the value to check @@ -1015,6 +1023,42 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \ xmlFree((char *)(str)); + +/** + * DICT_COPY: + * @str: a string + * + * Copy a string using a "dict" dictionnary in the current scope, + * if availabe. + */ +#define DICT_COPY(str, cpy) \ + if (str) { \ + if (dict) { \ + if (xmlDictOwns(dict, (const xmlChar *)(str))) \ + cpy = (xmlChar *) (str); \ + else \ + cpy = (xmlChar *) xmlDictLookup((dict), (const xmlChar *)(str), -1); \ + } else \ + cpy = xmlStrdup((const xmlChar *)(str)); } + +/** + * DICT_CONST_COPY: + * @str: a string + * + * Copy a string using a "dict" dictionnary in the current scope, + * if availabe. + */ +#define DICT_CONST_COPY(str, cpy) \ + if (str) { \ + if (dict) { \ + if (xmlDictOwns(dict, (const xmlChar *)(str))) \ + cpy = (const xmlChar *) (str); \ + else \ + cpy = xmlDictLookup((dict), (const xmlChar *)(str), -1); \ + } else \ + cpy = (const xmlChar *) xmlStrdup((const xmlChar *)(str)); } + + /** * xmlFreeDtd: * @cur: the DTD structure to free up @@ -4236,7 +4280,7 @@ xmlGetNodePath(xmlNodePtr node) const char *sep; const char *name; char nametemp[100]; - int occur = 0; + int occur = 0, generic; if (node == NULL) return (NULL); @@ -4267,17 +4311,23 @@ xmlGetNodePath(xmlNodePtr node) sep = "/"; next = NULL; } else if (cur->type == XML_ELEMENT_NODE) { + generic = 0; sep = "/"; name = (const char *) cur->name; if (cur->ns) { - if (cur->ns->prefix != NULL) + if (cur->ns->prefix != NULL) { snprintf(nametemp, sizeof(nametemp) - 1, "%s:%s", (char *)cur->ns->prefix, (char *)cur->name); - else - snprintf(nametemp, sizeof(nametemp) - 1, "%s", - (char *)cur->name); - nametemp[sizeof(nametemp) - 1] = 0; - name = nametemp; + nametemp[sizeof(nametemp) - 1] = 0; + name = nametemp; + } else { + /* + * We cannot express named elements in the default + * namespace, so use "*". + */ + generic = 1; + name = "*"; + } } next = cur->parent; @@ -4288,10 +4338,11 @@ xmlGetNodePath(xmlNodePtr node) tmp = cur->prev; while (tmp != NULL) { if ((tmp->type == XML_ELEMENT_NODE) && - (xmlStrEqual(cur->name, tmp->name)) && - ((tmp->ns == cur->ns) || - ((tmp->ns != NULL) && (cur->ns != NULL) && - (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))) + (generic || + (xmlStrEqual(cur->name, tmp->name) && + ((tmp->ns == cur->ns) || + ((tmp->ns != NULL) && (cur->ns != NULL) && + (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) occur++; tmp = tmp->prev; } @@ -4299,10 +4350,11 @@ xmlGetNodePath(xmlNodePtr node) tmp = cur->next; while (tmp != NULL && occur == 0) { if ((tmp->type == XML_ELEMENT_NODE) && - (xmlStrEqual(cur->name, tmp->name)) && - ((tmp->ns == cur->ns) || - ((tmp->ns != NULL) && (cur->ns != NULL) && - (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))) + (generic || + (xmlStrEqual(cur->name, tmp->name) && + ((tmp->ns == cur->ns) || + ((tmp->ns != NULL) && (cur->ns != NULL) && + (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) occur++; tmp = tmp->next; } @@ -4482,12 +4534,13 @@ xmlDocGetRootElement(xmlDocPtr doc) { /** * xmlDocSetRootElement: * @doc: the document - * @root: the new document root element + * @root: the new document root element, if root is NULL no action is taken, + * to remove a node from a document use xmlUnlinkNode(root) instead. * * Set the root element of the document (doc->children is a list * containing possibly comments, PIs, etc ...). * - * Returns the old root element if any was found + * Returns the old root element if any was found, NULL if root was NULL */ xmlNodePtr xmlDocSetRootElement(xmlDocPtr doc, xmlNodePtr root) { @@ -4748,6 +4801,7 @@ xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { void xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { xmlNsPtr ns; + const xmlChar* fixed; if (cur == NULL) return; switch(cur->type) { @@ -4783,7 +4837,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { if (uri == NULL) doc->URL = NULL; else - doc->URL = xmlStrdup(uri); + doc->URL = xmlPathToURI(uri); return; } } @@ -4791,7 +4845,13 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); if (ns == NULL) return; - xmlSetNsProp(cur, ns, BAD_CAST "base", uri); + fixed = xmlPathToURI(uri); + if (fixed != NULL) { + xmlSetNsProp(cur, ns, BAD_CAST "base", fixed); + xmlFree(fixed); + } else { + xmlSetNsProp(cur, ns, BAD_CAST "base", uri); + } } #endif /* LIBXML_TREE_ENABLED */ @@ -5055,16 +5115,8 @@ xmlNodeGetContent(xmlNodePtr cur) xmlBufferFree(buffer); return (ret); } - case XML_ATTRIBUTE_NODE:{ - xmlAttrPtr attr = (xmlAttrPtr) cur; - - if (attr->parent != NULL) - return (xmlNodeListGetString - (attr->parent->doc, attr->children, 1)); - else - return (xmlNodeListGetString(NULL, attr->children, 1)); - break; - } + case XML_ATTRIBUTE_NODE: + return(xmlGetPropNodeValueInternal((xmlAttrPtr) cur)); case XML_COMMENT_NODE: case XML_PI_NODE: if (cur->content != NULL) @@ -5403,7 +5455,7 @@ xmlTextMerge(xmlNodePtr first, xmlNodePtr second) { return(first); } -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) /** * xmlGetNsList: * @doc: the document @@ -5467,6 +5519,38 @@ xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node) } #endif /* LIBXML_TREE_ENABLED */ +/* +* xmlTreeEnsureXMLDecl: +* @doc: the doc +* +* Ensures that there is an XML namespace declaration on the doc. +* +* Returns the XML ns-struct or NULL on API and internal errors. +*/ +static xmlNsPtr +xmlTreeEnsureXMLDecl(xmlDocPtr doc) +{ + if (doc == NULL) + return (NULL); + if (doc->oldNs != NULL) + return (doc->oldNs); + { + xmlNsPtr ns; + ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); + if (ns == NULL) { + xmlTreeErrMemory( + "allocating the XML namespace"); + return (NULL); + } + memset(ns, 0, sizeof(xmlNs)); + ns->type = XML_LOCAL_NAMESPACE; + ns->href = xmlStrdup(XML_XML_NAMESPACE); + ns->prefix = xmlStrdup((const xmlChar *)"xml"); + doc->oldNs = ns; + return (ns); + } +} + /** * xmlSearchNs: * @doc: the document @@ -5516,22 +5600,13 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { if (doc == NULL) return(NULL); } - if (doc->oldNs == NULL) { - /* - * Allocate a new Namespace and fill the fields. - */ - doc->oldNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (doc->oldNs == NULL) { - xmlTreeErrMemory("searching namespace"); - return(NULL); - } - memset(doc->oldNs, 0, sizeof(xmlNs)); - doc->oldNs->type = XML_LOCAL_NAMESPACE; - - doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); - doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); - } - return(doc->oldNs); + /* + * Return the XML namespace declaration held by the doc. + */ + if (doc->oldNs == NULL) + return(xmlTreeEnsureXMLDecl(doc)); + else + return(doc->oldNs); } while (node != NULL) { if ((node->type == XML_ENTITY_REF_NODE) || @@ -5658,22 +5733,13 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href) if (doc == NULL) return(NULL); } - if (doc->oldNs == NULL) { - /* - * Allocate a new Namespace and fill the fields. - */ - doc->oldNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (doc->oldNs == NULL) { - xmlTreeErrMemory("searching namespace"); - return (NULL); - } - memset(doc->oldNs, 0, sizeof(xmlNs)); - doc->oldNs->type = XML_LOCAL_NAMESPACE; - - doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); - doc->oldNs->prefix = xmlStrdup((const xmlChar *) "xml"); - } - return (doc->oldNs); + /* + * Return the XML namespace declaration held by the doc. + */ + if (doc->oldNs == NULL) + return(xmlTreeEnsureXMLDecl(doc)); + else + return(doc->oldNs); } is_attr = (node->type == XML_ATTRIBUTE_NODE); while (node != NULL) { @@ -5871,73 +5937,75 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { /* * now check for namespace hold by attributes on the node. */ - attr = node->properties; - while (attr != NULL) { - if (attr->ns != NULL) { - /* - * initialize the cache if needed - */ - if (sizeCache == 0) { - sizeCache = 10; - oldNs = (xmlNsPtr *) xmlMalloc(sizeCache * - sizeof(xmlNsPtr)); - if (oldNs == NULL) { - xmlTreeErrMemory("fixing namespaces"); - return(-1); - } - newNs = (xmlNsPtr *) xmlMalloc(sizeCache * - sizeof(xmlNsPtr)); - if (newNs == NULL) { - xmlTreeErrMemory("fixing namespaces"); - xmlFree(oldNs); - return(-1); - } - } - for (i = 0;i < nbCache;i++) { - if (oldNs[i] == attr->ns) { - attr->ns = newNs[i]; - break; - } - } - if (i == nbCache) { + if (node->type == XML_ELEMENT_NODE) { + attr = node->properties; + while (attr != NULL) { + if (attr->ns != NULL) { /* - * OK we need to recreate a new namespace definition + * initialize the cache if needed */ - n = xmlNewReconciliedNs(doc, tree, attr->ns); - if (n != NULL) { /* :-( what if else ??? */ + if (sizeCache == 0) { + sizeCache = 10; + oldNs = (xmlNsPtr *) xmlMalloc(sizeCache * + sizeof(xmlNsPtr)); + if (oldNs == NULL) { + xmlTreeErrMemory("fixing namespaces"); + return(-1); + } + newNs = (xmlNsPtr *) xmlMalloc(sizeCache * + sizeof(xmlNsPtr)); + if (newNs == NULL) { + xmlTreeErrMemory("fixing namespaces"); + xmlFree(oldNs); + return(-1); + } + } + for (i = 0;i < nbCache;i++) { + if (oldNs[i] == attr->ns) { + attr->ns = newNs[i]; + break; + } + } + if (i == nbCache) { /* - * check if we need to grow the cache buffers. + * OK we need to recreate a new namespace definition */ - if (sizeCache <= nbCache) { - sizeCache *= 2; - oldNs = (xmlNsPtr *) xmlRealloc(oldNs, sizeCache * - sizeof(xmlNsPtr)); - if (oldNs == NULL) { - xmlTreeErrMemory("fixing namespaces"); - xmlFree(newNs); - return(-1); - } - newNs = (xmlNsPtr *) xmlRealloc(newNs, sizeCache * - sizeof(xmlNsPtr)); - if (newNs == NULL) { - xmlTreeErrMemory("fixing namespaces"); - xmlFree(oldNs); - return(-1); + n = xmlNewReconciliedNs(doc, tree, attr->ns); + if (n != NULL) { /* :-( what if else ??? */ + /* + * check if we need to grow the cache buffers. + */ + if (sizeCache <= nbCache) { + sizeCache *= 2; + oldNs = (xmlNsPtr *) xmlRealloc(oldNs, + sizeCache * sizeof(xmlNsPtr)); + if (oldNs == NULL) { + xmlTreeErrMemory("fixing namespaces"); + xmlFree(newNs); + return(-1); + } + newNs = (xmlNsPtr *) xmlRealloc(newNs, + sizeCache * sizeof(xmlNsPtr)); + if (newNs == NULL) { + xmlTreeErrMemory("fixing namespaces"); + xmlFree(oldNs); + return(-1); + } } + newNs[nbCache] = n; + oldNs[nbCache++] = attr->ns; + attr->ns = n; } - newNs[nbCache] = n; - oldNs[nbCache++] = attr->ns; - attr->ns = n; } } + attr = attr->next; } - attr = attr->next; } /* * Browse the full subtree, deep first */ - if (node->children != NULL && node->type != XML_ENTITY_REF_NODE) { + if ((node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) { /* deep first */ node = node->children; } else if ((node != tree) && (node->next != NULL)) { @@ -6096,7 +6164,7 @@ xmlGetPropNodeValueInternal(xmlAttrPtr prop) * TODO: Do we really always want that? */ if (prop->children != NULL) { - if ((prop->children == prop->last) && + if ((prop->children->next == NULL) && ((prop->children->type == XML_TEXT_NODE) || (prop->children->type == XML_CDATA_SECTION_NODE))) { @@ -6471,7 +6539,9 @@ xmlTextConcat(xmlNodePtr node, const xmlChar *content, int len) { if (node == NULL) return(-1); if ((node->type != XML_TEXT_NODE) && - (node->type != XML_CDATA_SECTION_NODE)) { + (node->type != XML_CDATA_SECTION_NODE) && + (node->type != XML_COMMENT_NODE) && + (node->type != XML_PI_NODE)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlTextConcat: node is not text nor CDATA\n"); @@ -7153,41 +7223,6 @@ xmlSetCompressMode(int mode) { else xmlCompressMode = mode; } -/* -* xmlDOMWrapNewCtxt: -* -* Allocates and initializes a new DOM-wrapper context. -* -* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror. -*/ -xmlDOMWrapCtxtPtr -xmlDOMWrapNewCtxt(void) -{ - xmlDOMWrapCtxtPtr ret; - - ret = xmlMalloc(sizeof(xmlDOMWrapCtxt)); - if (ret == NULL) { - xmlTreeErrMemory("allocating DOM-wrapper context"); - return (NULL); - } - memset(ret, 0, sizeof(xmlDOMWrapCtxt)); - return (ret); -} - -/* -* xmlDOMWrapFreeCtxt: -* @ctxt: the DOM-wrapper context -* -* Frees the DOM-wrapper context. -*/ -void -xmlDOMWrapFreeCtxt(xmlDOMWrapCtxtPtr ctxt) -{ - if (ctxt == NULL) - return; - xmlFree(ctxt); -} - #define XML_TREE_NSMAP_PARENT -1 #define XML_TREE_NSMAP_XML -2 #define XML_TREE_NSMAP_DOC -3 @@ -7261,7 +7296,6 @@ xmlDOMWrapNsMapFree(xmlNsMapPtr nsmap) /* * xmlDOMWrapNsMapAddItem: * @map: the ns-map -* @cur: the current map entry to append a new entry to * @oldNs: the old ns-struct * @newNs: the new ns-struct * @depth: depth and ns-kind information @@ -7269,7 +7303,7 @@ xmlDOMWrapNsMapFree(xmlNsMapPtr nsmap) * Adds an ns-mapping item. */ static xmlNsMapItemPtr -xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position, /* xmlNsMapItemPtr *cur, */ +xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position, xmlNsPtr oldNs, xmlNsPtr newNs, int depth) { xmlNsMapItemPtr ret; @@ -7343,38 +7377,6 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position, /* xmlNsMapItemPtr *cur return (ret); } -/* -* xmlTreeEnsureXMLDecl: -* @doc: the doc -* -* Ensures that there is an XML namespace declaration on the doc. -* -* Returns the XML ns-struct or NULL on API and internal errors. -*/ -static xmlNsPtr -xmlTreeEnsureXMLDecl(xmlDocPtr doc) -{ - if (doc == NULL) - return (NULL); - if (doc->oldNs != NULL) - return (doc->oldNs); - { - xmlNsPtr ns; - ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (ns == NULL) { - xmlTreeErrMemory( - "allocating the XML namespace"); - return (NULL); - } - memset(ns, 0, sizeof(xmlNs)); - ns->type = XML_LOCAL_NAMESPACE; - ns->href = xmlStrdup(XML_XML_NAMESPACE); - ns->prefix = xmlStrdup((const xmlChar *)"xml"); - doc->oldNs = ns; - return (ns); - } -} - /* * xmlDOMWrapStoreNs: * @doc: the doc @@ -7418,6 +7420,46 @@ xmlDOMWrapStoreNs(xmlDocPtr doc, return (ns->next); } +/* +* xmlDOMWrapNewCtxt: +* +* Allocates and initializes a new DOM-wrapper context. +* +* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror. +*/ +xmlDOMWrapCtxtPtr +xmlDOMWrapNewCtxt(void) +{ + xmlDOMWrapCtxtPtr ret; + + ret = xmlMalloc(sizeof(xmlDOMWrapCtxt)); + if (ret == NULL) { + xmlTreeErrMemory("allocating DOM-wrapper context"); + return (NULL); + } + memset(ret, 0, sizeof(xmlDOMWrapCtxt)); + return (ret); +} + +/* +* xmlDOMWrapFreeCtxt: +* @ctxt: the DOM-wrapper context +* +* Frees the DOM-wrapper context. +*/ +void +xmlDOMWrapFreeCtxt(xmlDOMWrapCtxtPtr ctxt) +{ + if (ctxt == NULL) + return; + if (ctxt->namespaceMap != NULL) + xmlDOMWrapNsMapFree((xmlNsMapPtr) ctxt->namespaceMap); + /* + * TODO: Store the namespace map in the context. + */ + xmlFree(ctxt); +} + /* * xmlTreeLookupNsListByPrefix: * @nsList: a list of ns-structs @@ -7586,7 +7628,8 @@ xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number, * This will substitute ns-references to node->nsDef for * ns-references to doc->oldNs, thus ensuring the removed * branch to be autark wrt ns-references. -* WARNING: This function is in a experimental state. +* +* NOTE: This function was not intensively tested. * * Returns 0 on success, 1 if the node is not supported, * -1 on API and internal errors. @@ -7817,7 +7860,6 @@ xmlSearchNsByNamespaceStrict(xmlDocPtr doc, xmlNodePtr node, * @node: the start node * @prefix: the searched namespace prefix * @retNs: the resulting ns-decl -* @prefixed: if the found ns-decl must have a prefix (for attributes) * * Dynamically searches for a ns-declaration which matches * the given @nsName in the ancestor-or-self axis of @node. @@ -7939,10 +7981,10 @@ ns_next_prefix: return (NULL); if (prefix == NULL) { snprintf((char *) buf, sizeof(buf), - "default%d", counter); + "ns_%d", counter); } else snprintf((char *) buf, sizeof(buf), - "%.30s%d", (char *)prefix, counter); + "%.30s_%d", (char *)prefix, counter); pref = BAD_CAST buf; } } @@ -7954,7 +7996,6 @@ ns_next_prefix: * @ns: the ns-struct to use for the search * @retNs: the found/created ns-struct * @nsMap: the ns-map -* @topmi: the last ns-map entry * @depth: the current tree depth * @ancestorsOnly: search in ancestor ns-decls only * @prefixed: if the searched ns-decl must have a prefix (for attributes) @@ -8001,7 +8042,8 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, * If the search should be done in ancestors only and no * @elem (the first ancestor) was specified, then skip the search. */ - if ((! (ancestorsOnly && (elem == NULL))) && (XML_NSMAP_NOTEMPTY(*nsMap))) + if ((XML_NSMAP_NOTEMPTY(*nsMap)) && + (! (ancestorsOnly && (elem == NULL)))) { /* * Try to find an equal ns-name in in-scope ns-decls. @@ -8102,7 +8144,8 @@ typedef enum { * ns-decls where needed. Note that, since prefixes of already existent * ns-decls can be shadowed by this process, it could break QNames in * attribute values or element content. -* WARNING: This function is in a experimental state. +* +* NOTE: This function was not intensively tested. * * Returns 0 if succeeded, -1 otherwise and on API/internal errors. */ @@ -8120,7 +8163,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlNsMapItemPtr /* topmi = NULL, */ mi; /* @ancestorsOnly should be set by an option flag. */ int ancestorsOnly = 0; - int optRemoveDedundantNS = + int optRemoveRedundantNS = ((xmlDOMReconcileNSOptions) options & XML_DOM_RECONNS_REMOVEREDUND) ? 1 : 0; xmlNsPtr *listRedund = NULL; int sizeRedund = 0, nbRedund = 0, ret, i, j; @@ -8160,7 +8203,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED, /* * Lookup the ns ancestor-axis for equal ns-decls in scope. */ - if (optRemoveDedundantNS && XML_NSMAP_NOTEMPTY(nsMap)) { + if (optRemoveRedundantNS && XML_NSMAP_NOTEMPTY(nsMap)) { XML_NSMAP_FOREACH(nsMap, mi) { if ((mi->depth >= XML_TREE_NSMAP_PARENT) && (mi->shadowDepth == -1) && @@ -8366,6 +8409,8 @@ exit: * shadowed by this process, it could break QNames in attribute * values or element content. * +* NOTE: This function was not intensively tested. +* * Returns 0 if succeeded, -1 otherwise and on API/internal errors. */ static int @@ -8383,7 +8428,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, xmlNsPtr ns = NULL; int depth = -1, adoptStr = 1; /* gather @parent's ns-decls. */ - int parnsdone = 0; + int parnsdone; /* @ancestorsOnly should be set per option. */ int ancestorsOnly = 0; @@ -8396,8 +8441,29 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, else adoptStr = 1; + /* + * Get the ns-map from the context if available. + */ + if (ctxt) + nsMap = (xmlNsMapPtr) ctxt->namespaceMap; + /* + * Disable search for ns-decls in the parent-axis of the + * desination element, if: + * 1) there's no destination parent + * 2) custom ns-reference handling is used + */ + if ((destParent == NULL) || + (ctxt && ctxt->getNsForNodeFunc)) + { + parnsdone = 1; + } else + parnsdone = 0; + cur = node; while (cur != NULL) { + /* + * Paranoid source-doc sanity check. + */ if (cur->doc != sourceDoc) { /* * We'll assume XIncluded nodes if the doc differs. @@ -8429,23 +8495,28 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, curElem = cur; depth++; /* - * Namespace declarations. + * Namespace declarations. + * - ns->href and ns->prefix are never in the dict, so + * we need not move the values over to the destination dict. + * - Note that for custom handling of ns-references, + * the ns-decls need not be stored in the ns-map, + * since they won't be referenced by node->ns. */ - if ((ctxt == NULL) && (cur->nsDef != NULL)) { + if ((cur->nsDef) && + ((ctxt == NULL) || (ctxt->getNsForNodeFunc == NULL))) + { if (! parnsdone) { - if (destParent && (ctxt == NULL)) { - /* - * Gather @parent's in-scope ns-decls. - */ - if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap, - destParent) == -1) - goto internal_error; - } + /* + * Gather @parent's in-scope ns-decls. + */ + if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap, + destParent) == -1) + goto internal_error; parnsdone = 1; } for (ns = cur->nsDef; ns != NULL; ns = ns->next) { /* - * ns->prefix and ns->href seem not to be in the dict. + * NOTE: ns->prefix and ns->href are never in the dict. * XML_TREE_ADOPT_STR(ns->prefix) * XML_TREE_ADOPT_STR(ns->href) */ @@ -8453,7 +8524,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, * Does it shadow any ns-decl? */ if (XML_NSMAP_NOTEMPTY(nsMap)) { - XML_NSMAP_FOREACH(nsMap, mi) { + XML_NSMAP_FOREACH(nsMap, mi) { if ((mi->depth >= XML_TREE_NSMAP_PARENT) && (mi->shadowDepth == -1) && ((ns->prefix == mi->newNs->prefix) || @@ -8472,27 +8543,26 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, goto internal_error; } } - /* No break on purpose. */ + /* No break on purpose. */ case XML_ATTRIBUTE_NODE: - + /* No namespace, no fun. */ if (cur->ns == NULL) goto ns_end; + if (! parnsdone) { - if (destParent && (ctxt == NULL)) { - if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap, - destParent) == -1) - goto internal_error; - } + if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap, + destParent) == -1) + goto internal_error; parnsdone = 1; } /* * Adopt ns-references. */ - if (XML_NSMAP_NOTEMPTY(nsMap)) { + if (XML_NSMAP_NOTEMPTY(nsMap)) { /* * Search for a mapping. */ - XML_NSMAP_FOREACH(nsMap, mi) { + XML_NSMAP_FOREACH(nsMap, mi) { if ((mi->shadowDepth == -1) && (cur->ns == mi->oldNs)) { @@ -8502,21 +8572,20 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, } } /* - * Start searching for an in-scope ns-decl. - */ - if (ctxt != NULL) { + * No matching namespace in scope. We need a new one. + */ + if ((ctxt) && (ctxt->getNsForNodeFunc)) { /* * User-defined behaviour. */ -#if 0 - ctxt->aquireNsDecl(ctxt, cur->ns, &ns); -#endif + ns = ctxt->getNsForNodeFunc(ctxt, cur, + cur->ns->href, cur->ns->prefix); /* * Insert mapping if ns is available; it's the users fault * if not. */ if (xmlDOMWrapNsMapAddItem(&nsMap, -1, - ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) + cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) goto internal_error; cur->ns = ns; } else { @@ -8560,7 +8629,9 @@ ns_end: */ if ((sourceDoc != NULL) && (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID)) + { xmlRemoveID(sourceDoc, (xmlAttrPtr) cur); + } ((xmlAttrPtr) cur)->atype = 0; ((xmlAttrPtr) cur)->psvi = NULL; } @@ -8615,7 +8686,8 @@ leave_node: break; if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_XINCLUDE_START) || - (cur->type == XML_XINCLUDE_END)) { + (cur->type == XML_XINCLUDE_END)) + { /* * TODO: Do we expect nsDefs on XML_XINCLUDE_START? */ @@ -8640,7 +8712,11 @@ leave_node: } if (cur->next != NULL) cur = cur->next; - else { + else if ((cur->type == XML_ATTRIBUTE_NODE) && + (cur->parent->children != NULL)) + { + cur = cur->parent->children; + } else { cur = cur->parent; goto leave_node; } @@ -8655,8 +8731,20 @@ exit: /* * Cleanup. */ - if (nsMap != NULL) - xmlDOMWrapNsMapFree(nsMap); + if (nsMap != NULL) { + if ((ctxt) && (ctxt->namespaceMap == nsMap)) { + /* + * Just cleanup the map but don't free. + */ + if (nsMap->first) { + if (nsMap->pool) + nsMap->last->next = nsMap->pool; + nsMap->pool = nsMap->first; + nsMap->first = NULL; + } + } else + xmlDOMWrapNsMapFree(nsMap); + } return(ret); } @@ -8673,9 +8761,9 @@ exit: * * References of out-of scope ns-decls are remapped to point to @destDoc: * 1) If @destParent is given, then nsDef entries on element-nodes are used -* 2) If *no* @destParent is given, then @destDoc->oldNs entries are used -* This is the case when you have an unliked node and just want to move it -* to the context of +* 2) If *no* @destParent is given, then @destDoc->oldNs entries are used. +* This is the case when you don't know already where the cloned branch +* will be added to. * * If @destParent is given, it ensures that the tree is namespace * wellformed by creating additional ns-decls where needed. @@ -8683,11 +8771,7 @@ exit: * shadowed by this process, it could break QNames in attribute * values or element content. * TODO: -* 1) Support dicts -* Optimize string adoption for equal or none dicts. -* 2) XInclude -* WARNING: This function is in a experimental state and should only be currently -* only be used to test it. +* 1) What to do with XInclude? Currently this returns an error for XInclude. * * Returns 0 if the operation succeeded, * 1 if a node of unsupported (or not yet supported) type was given, @@ -8713,10 +8797,15 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, /* int adoptStr = 1; */ /* gather @parent's ns-decls. */ int parnsdone = 0; - /* @ancestorsOnly should be set per option. */ + /* + * @ancestorsOnly: + * TODO: @ancestorsOnly should be set per option. + * + */ int ancestorsOnly = 0; xmlNodePtr resultClone = NULL, clone = NULL, parentClone = NULL, prevClone = NULL; - xmlNsPtr cloneNs = NULL, *cloneNsDefSlot = NULL; + xmlNsPtr cloneNs = NULL, *cloneNsDefSlot = NULL; + xmlDictPtr dict; /* The destination dict */ if ((node == NULL) || (resNode == NULL) || (destDoc == NULL)) return(-1); @@ -8740,6 +8829,13 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, if (sourceDoc == NULL) return (-1); + dict = destDoc->dict; + /* + * Reuse the namespace map of the context. + */ + if (ctxt) + nsMap = (xmlNsMapPtr) ctxt->namespaceMap; + *resNode = NULL; cur = node; @@ -8758,23 +8854,25 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, switch (cur->type) { case XML_XINCLUDE_START: case XML_XINCLUDE_END: - /* TODO: What to do with XInclude? */ + /* + * TODO: What to do with XInclude? + */ goto internal_error; break; - case XML_TEXT_NODE: - case XML_CDATA_SECTION_NODE: case XML_ELEMENT_NODE: + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_COMMENT_NODE: + case XML_PI_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: - case XML_PI_NODE: - case XML_COMMENT_NODE: /* * Nodes of xmlNode structure. */ clone = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); if (clone == NULL) { - xmlTreeErrMemory("xmlDOMWrapCloneBranch(): allocating a node"); + xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating a node"); goto internal_error; } memset(clone, 0, sizeof(xmlNode)); @@ -8798,12 +8896,13 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, */ clone = (xmlNodePtr) xmlMalloc(sizeof(xmlAttr)); if (clone == NULL) { - xmlTreeErrMemory("xmlDOMWrapCloneBranch(): allocating an attr-node"); + xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node"); goto internal_error; } memset(clone, 0, sizeof(xmlAttr)); /* * Set hierachical links. + * TODO: Change this to add to the end of attributes. */ if (resultClone != NULL) { clone->parent = parentClone; @@ -8816,28 +8915,31 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, resultClone = clone; break; default: - /* TODO */ + /* + * TODO QUESTION: Any other nodes expected? + */ goto internal_error; } clone->type = cur->type; clone->doc = destDoc; - + + /* + * Clone the name of the node if any. + */ if (cur->name == xmlStringText) clone->name = xmlStringText; else if (cur->name == xmlStringTextNoenc) /* - * TODO: xmlStringTextNoenc is never assigned to a node - * in tree.c. + * NOTE: Although xmlStringTextNoenc is never assigned to a node + * in tree.c, it might be set in Libxslt via + * "xsl:disable-output-escaping". */ clone->name = xmlStringTextNoenc; else if (cur->name == xmlStringComment) clone->name = xmlStringComment; else if (cur->name != NULL) { - if ((destDoc != NULL) && (destDoc->dict != NULL)) - clone->name = xmlDictLookup(destDoc->dict, cur->name, -1); - else - clone->name = xmlStrdup(cur->name); + DICT_CONST_COPY(cur->name, clone->name); } switch (cur->type) { @@ -8875,7 +8977,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, */ cloneNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); if (cloneNs == NULL) { - xmlTreeErrMemory("xmlDOMWrapCloneBranch(): " + xmlTreeErrMemory("xmlDOMWrapCloneNode(): " "allocating namespace"); return(-1); } @@ -8890,7 +8992,14 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, *cloneNsDefSlot = cloneNs; cloneNsDefSlot = &(cloneNs->next); - if (ctxt == NULL) { + /* + * Note that for custom handling of ns-references, + * the ns-decls need not be stored in the ns-map, + * since they won't be referenced by node->ns. + */ + if ((ctxt == NULL) || + (ctxt->getNsForNodeFunc == NULL)) + { /* * Does it shadow any ns-decl? */ @@ -8926,8 +9035,10 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, break; case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: - if (cur->content) - clone->content = xmlStrdup(cur->content); + /* + * Note that this will also cover the values of attributes. + */ + DICT_COPY(cur->content, clone->content); goto leave_node; case XML_ENTITY_NODE: /* TODO: What to do here? */ @@ -8954,15 +9065,13 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, clone->content = cur->content; clone->children = cur->children; clone->last = cur->last; - } + } goto leave_node; case XML_PI_NODE: - if (cur->content) - clone->content = xmlStrdup(cur->content); + DICT_COPY(cur->content, clone->content); goto leave_node; case XML_COMMENT_NODE: - if (cur->content) - clone->content = xmlStrdup(cur->content); + DICT_COPY(cur->content, clone->content); goto leave_node; default: goto internal_error; @@ -9003,15 +9112,14 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, } } /* - * Start searching for an in-scope ns-decl. + * No matching namespace in scope. We need a new one. */ - if (ctxt != NULL) { + if ((ctxt != NULL) && (ctxt->getNsForNodeFunc != NULL)) { /* * User-defined behaviour. */ -#if 0 - ctxt->aquireNsDecl(ctxt, cur->ns, &ns); -#endif + ns = ctxt->getNsForNodeFunc(ctxt, cur, + cur->ns->href, cur->ns->prefix); /* * Add user's mapping. */ @@ -9028,6 +9136,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, destParent ? curElem : NULL, cur->ns, &ns, &nsMap, depth, + /* if we need to search only in the ancestor-axis */ ancestorsOnly, /* ns-decls must be prefixed for attributes. */ (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) @@ -9043,7 +9152,8 @@ end_ns_reference: * Handle ID attributes. */ if ((clone->type == XML_ATTRIBUTE_NODE) && - (clone->parent != NULL)) { + (clone->parent != NULL)) + { if (xmlIsID(destDoc, clone->parent, (xmlAttrPtr) clone)) { xmlChar *idVal; @@ -9061,7 +9171,7 @@ end_ns_reference: } /* ** - ** The following will traversing the tree ************************ + ** The following will traverse the tree ************************** ** * * Walk the element's attributes before descending into child-nodes. @@ -9153,8 +9263,20 @@ exit: /* * Cleanup. */ - if (nsMap != NULL) - xmlDOMWrapNsMapFree(nsMap); + if (nsMap != NULL) { + if ((ctxt) && (ctxt->namespaceMap == nsMap)) { + /* + * Just cleanup the map but don't free. + */ + if (nsMap->first) { + if (nsMap->pool) + nsMap->last->next = nsMap->pool; + nsMap->pool = nsMap->first; + nsMap->first = NULL; + } + } else + xmlDOMWrapNsMapFree(nsMap); + } /* * TODO: Should we try a cleanup of the cloned node in case of a * fatal error? @@ -9303,7 +9425,7 @@ internal_error: * Note that, since prefixes of already existent ns-decls can be * shadowed by this process, it could break QNames in attribute * values or element content. -* WARNING: This function is in a experimental state. +* NOTE: This function was not intensively tested. * * Returns 0 if the operation succeeded, * 1 if a node of unsupported type was given, diff --git a/uri.c b/uri.c index 7d60ffe..1e29223 100644 --- a/uri.c +++ b/uri.c @@ -2343,7 +2343,7 @@ done: (((p[0] >= 'a') && (p[0] <= 'z')) || \ ((p[0] >= 'A') && (p[0] <= 'Z'))) && \ (p[1] == ':') && ((p[2] == '/') || (p[2] == '\\'))) -xmlChar* +xmlChar * xmlCanonicPath(const xmlChar *path) { #if defined(_WIN32) && !defined(__CYGWIN__) @@ -2406,12 +2406,20 @@ path_processing: len = xmlStrlen(path); if ((len > 2) && IS_WINDOWS_PATH(path)) { uri->scheme = xmlStrdup(BAD_CAST "file"); - uri->path = xmlMallocAtomic(len + 2); /* FIXME - check alloc! */ + uri->path = xmlMallocAtomic(len + 2); + if (uri->path == NULL) { + xmlFreeURI(uri); + return(NULL); + } uri->path[0] = '/'; p = uri->path + 1; strncpy(p, path, len + 1); } else { - uri->path = xmlStrdup(path); /* FIXME - check alloc! */ + uri->path = xmlStrdup(path); + if (uri->path == NULL) { + xmlFreeURI(uri); + return(NULL); + } p = uri->path; } while (*p != '\0') { @@ -2424,11 +2432,11 @@ path_processing: return(NULL); } - if (uri->scheme == NULL) { - ret = xmlStrdup((const xmlChar *) path); - } else { - ret = xmlSaveUri(uri); - } + if (uri->scheme == NULL) { + ret = xmlStrdup((const xmlChar *) path); + } else { + ret = xmlSaveUri(uri); + } xmlFreeURI(uri); #else @@ -2437,5 +2445,39 @@ path_processing: return(ret); } +/** + * xmlPathToURI: + * @path: the resource locator in a filesystem notation + * + * Constructs an URI expressing the existing path + * + * Returns a new URI, or a duplicate of the path parameter if the + * construction fails. The caller is responsible for freeing the memory + * occupied by the returned string. If there is insufficient memory available, + * or the argument is NULL, the function returns NULL. + */ +xmlChar * +xmlPathToURI(const xmlChar *path) +{ + xmlURIPtr uri; + xmlURI temp; + xmlChar *ret, *cal; + + if (path == NULL) + return(NULL); + + if ((uri = xmlParseURI((const char *) path)) != NULL) { + xmlFreeURI(uri); + return xmlStrdup(path); + } + cal = xmlCanonicPath(path); + if (cal == NULL) + return(NULL); + memset(&temp, 0, sizeof(temp)); + temp.path = (char *) cal; + ret = xmlSaveUri(&temp); + xmlFree(cal); + return(ret); +} #define bottom_uri #include "elfgcchack.h" diff --git a/valid.c b/valid.c index edf5426..a239e68 100644 --- a/valid.c +++ b/valid.c @@ -63,7 +63,9 @@ xmlVErrMemory(xmlValidCtxtPtr ctxt, const char *extra) context */ if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { - pctxt = ctxt->userData; + long delta = (char *) ctxt - (char *) ctxt->userData; + if ((delta > 0) && (delta < 250)) + pctxt = ctxt->userData; } } if (extra) @@ -101,7 +103,9 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error, context */ if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { - pctxt = ctxt->userData; + long delta = (char *) ctxt - (char *) ctxt->userData; + if ((delta > 0) && (delta < 250)) + pctxt = ctxt->userData; } } if (extra) @@ -146,7 +150,9 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt, context */ if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { - pctxt = ctxt->userData; + long delta = (char *) ctxt - (char *) ctxt->userData; + if ((delta > 0) && (delta < 250)) + pctxt = ctxt->userData; } } __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error, @@ -187,7 +193,9 @@ xmlErrValidNodeNr(xmlValidCtxtPtr ctxt, context */ if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { - pctxt = ctxt->userData; + long delta = (char *) ctxt - (char *) ctxt->userData; + if ((delta > 0) && (delta < 250)) + pctxt = ctxt->userData; } } __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error, @@ -226,7 +234,9 @@ xmlErrValidWarning(xmlValidCtxtPtr ctxt, context */ if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { - pctxt = ctxt->userData; + long delta = (char *) ctxt - (char *) ctxt->userData; + if ((delta > 0) && (delta < 250)) + pctxt = ctxt->userData; } } __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error, @@ -5340,7 +5350,7 @@ fail: } #endif /* LIBXML_REGEXP_ENABLED */ if ((warn) && ((ret != 1) && (ret != -3))) { - if ((ctxt != NULL) && (ctxt->warning != NULL)) { + if (ctxt != NULL) { char expr[5000]; char list[5000]; diff --git a/xinclude.c b/xinclude.c index d5bba6e..c58bbcf 100644 --- a/xinclude.c +++ b/xinclude.c @@ -82,6 +82,8 @@ struct _xmlXIncludeCtxt { int legacy; /* using XINCLUDE_OLD_NS */ int parseFlags; /* the flags used for parsing XML documents */ xmlChar * base; /* the current xml:base */ + + void *_private; /* application data */ }; static int @@ -427,6 +429,12 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { xmlXIncludeErrMemory(ctxt, NULL, "cannot allocate parser context"); return(NULL); } + + /* + * pass in the application data to the parser context. + */ + pctxt->_private = ctxt->_private; + /* * try to ensure that new documents included are actually * built with the same dictionary as the including document. @@ -2409,9 +2417,11 @@ xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { } /** - * xmlXIncludeProcessFlags: + * xmlXIncludeProcessFlagsData: * @doc: an XML document * @flags: a set of xmlParserOption used for parsing XML includes + * @data: application data that will be passed to the parser context + * in the _private field of the parser context(s) * * Implement the XInclude substitution on the XML document @doc * @@ -2419,7 +2429,7 @@ xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { * or the number of substitutions done. */ int -xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) { +xmlXIncludeProcessFlagsData(xmlDocPtr doc, int flags, void *data) { xmlXIncludeCtxtPtr ctxt; xmlNodePtr tree; int ret = 0; @@ -2432,6 +2442,7 @@ xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) { ctxt = xmlXIncludeNewContext(doc); if (ctxt == NULL) return(-1); + ctxt->_private = data; ctxt->base = xmlStrdup((xmlChar *)doc->URL); xmlXIncludeSetFlags(ctxt, flags); ret = xmlXIncludeDoProcess(ctxt, doc, tree); @@ -2442,6 +2453,21 @@ xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) { return(ret); } +/** + * xmlXIncludeProcessFlags: + * @doc: an XML document + * @flags: a set of xmlParserOption used for parsing XML includes + * + * Implement the XInclude substitution on the XML document @doc + * + * Returns 0 if no substitution were done, -1 if some processing failed + * or the number of substitutions done. + */ +int +xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) { + return xmlXIncludeProcessFlagsData(doc, flags, NULL); +} + /** * xmlXIncludeProcess: * @doc: an XML document diff --git a/xmlIO.c b/xmlIO.c index 60e0a50..90db848 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -50,6 +50,12 @@ # endif # define HAVE_STAT # endif +#else +# ifdef HAVE__STAT +# if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +# define stat _stat +# endif +# endif #endif #ifdef HAVE_STAT # ifndef S_ISDIR @@ -193,7 +199,7 @@ static const char *IOerr[] = { "unknown address familly", /* EAFNOSUPPORT */ }; -#if defined(WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) /** * __xmlIOWin32UTF8ToWChar: * @u8String: uft-8 string @@ -203,26 +209,25 @@ static const char *IOerr[] = { static wchar_t * __xmlIOWin32UTF8ToWChar(const char *u8String) { - wchar_t *wString = NULL; + wchar_t *wString = NULL; + + if (u8String) { + int wLen = + MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, u8String, + -1, NULL, 0); + if (wLen) { + wString = xmlMalloc(wLen * sizeof(wchar_t)); + if (wString) { + if (MultiByteToWideChar + (CP_UTF8, 0, u8String, -1, wString, wLen) == 0) { + xmlFree(wString); + wString = NULL; + } + } + } + } - if (u8String) - { - int wLen = MultiByteToWideChar(CP_UTF8,0,u8String,-1,NULL,0); - if (wLen) - { - wString = malloc((wLen+1) * sizeof(wchar_t)); - if (wString) - { - if (MultiByteToWideChar(CP_UTF8,0,u8String,-1,wString,wLen+1) == 0) - { - free(wString); - wString = NULL; - } - } - } - } - - return wString; + return wString; } #endif @@ -572,6 +577,132 @@ xmlCleanupOutputCallbacks(void) * * ************************************************************************/ +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + +/** + * xmlWrapOpenUtf8: + * @path: the path in utf-8 encoding + * @mode: type of access (0 - read, 1 - write) + * + * function opens the file specified by @path + * + */ +static FILE* +xmlWrapOpenUtf8(const char *path,int mode) +{ + FILE *fd = NULL; + wchar_t *wPath; + + wPath = __xmlIOWin32UTF8ToWChar(path); + if(wPath) + { + fd = _wfopen(wPath, mode ? L"wb" : L"rb"); + xmlFree(wPath); + } + /* maybe path in native encoding */ + if(fd == NULL) + fd = fopen(path, mode ? "wb" : "rb"); + + return fd; +} + +/** + * xmlWrapStatUtf8: + * @path: the path in utf-8 encoding + * @info: structure that stores results + * + * function obtains information about the file or directory + * + */ +static int +xmlWrapStatUtf8(const char *path,struct stat *info) +{ +#ifdef HAVE_STAT + int retval = -1; + wchar_t *wPath; + + wPath = __xmlIOWin32UTF8ToWChar(path); + if (wPath) + { + retval = _wstat(wPath,info); + xmlFree(wPath); + } + /* maybe path in native encoding */ + if(retval < 0) + retval = stat(path,info); + return retval; +#else + return -1; +#endif +} + +/** + * xmlWrapOpenNative: + * @path: the path + * @mode: type of access (0 - read, 1 - write) + * + * function opens the file specified by @path + * + */ +static FILE* +xmlWrapOpenNative(const char *path,int mode) +{ + return fopen(path,mode ? "wb" : "rb"); +} + +/** + * xmlWrapStatNative: + * @path: the path + * @info: structure that stores results + * + * function obtains information about the file or directory + * + */ +static int +xmlWrapStatNative(const char *path,struct stat *info) +{ +#ifdef HAVE_STAT + return stat(path,info); +#else + return -1; +#endif +} + +typedef int (* xmlWrapStatFunc) (const char *f, struct stat *s); +static xmlWrapStatFunc xmlWrapStat = xmlWrapStatNative; +typedef FILE* (* xmlWrapOpenFunc)(const char *f,int mode); +static xmlWrapOpenFunc xmlWrapOpen = xmlWrapOpenNative; + +/** + * xmlInitPlatformSpecificIo: + * + * Initialize platform specific features. + */ +static void +xmlInitPlatformSpecificIo(void) +{ + static int xmlPlatformIoInitialized = 0; + OSVERSIONINFO osvi; + + if(xmlPlatformIoInitialized) + return; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + + if(GetVersionEx(&osvi) && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)) { + xmlWrapStat = xmlWrapStatUtf8; + xmlWrapOpen = xmlWrapOpenUtf8; + } else { + xmlWrapStat = xmlWrapStatNative; + xmlWrapOpen = xmlWrapOpenNative; + } + + xmlPlatformIoInitialized = 1; + return; +} + +#endif + /** * xmlCheckFilename: * @path: the path to check @@ -594,41 +725,20 @@ xmlCheckFilename (const char *path) #endif if (path == NULL) return(0); - -#if defined(WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - { - int retval = 0; - - wchar_t *wPath = __xmlIOWin32UTF8ToWChar(path); - if (wPath) - { - struct _stat stat_buffer; - - if (_wstat(wPath,&stat_buffer) == 0) - { - retval = 1; - - if (((stat_buffer.st_mode & S_IFDIR) == S_IFDIR)) - retval = 2; - } - - free(wPath); - } - return retval; - } -#else #ifdef HAVE_STAT +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + if (xmlWrapStat(path, &stat_buffer) == -1) + return 0; +#else if (stat(path, &stat_buffer) == -1) return 0; - +#endif #ifdef S_ISDIR if (S_ISDIR(stat_buffer.st_mode)) return 2; -#endif /* S_ISDIR */ +#endif #endif /* HAVE_STAT */ -#endif /* WIN32 */ - return 1; } @@ -750,19 +860,8 @@ xmlFileOpen_real (const char *filename) { if (!xmlCheckFilename(path)) return(NULL); -#if defined(WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - { - wchar_t *wPath = __xmlIOWin32UTF8ToWChar(path); - if (wPath) - { - fd = _wfopen(wPath, L"rb"); - free(wPath); - } - else - { - fd = fopen(path, "rb"); - } - } +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + fd = xmlWrapOpen(path, 0); #else fd = fopen(path, "r"); #endif /* WIN32 */ @@ -832,19 +931,8 @@ xmlFileOpenW (const char *filename) { if (path == NULL) return(NULL); -#if defined(WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - { - wchar_t *wPath = __xmlIOWin32UTF8ToWChar(path); - if (wPath) - { - fd = _wfopen(wPath, L"wb"); - free(wPath); - } - else - { - fd = fopen(path, "wb"); - } - } +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + fd = xmlWrapOpen(path, 1); #else fd = fopen(path, "wb"); #endif /* WIN32 */ @@ -2018,11 +2106,14 @@ xmlRegisterOutputCallbacks(xmlOutputMatchCallback matchFunc, * Registers the default compiled-in I/O handlers. */ void -xmlRegisterDefaultInputCallbacks -(void) { +xmlRegisterDefaultInputCallbacks(void) { if (xmlInputCallbackInitialized) return; +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + xmlInitPlatformSpecificIo(); +#endif + xmlRegisterInputCallbacks(xmlFileMatch, xmlFileOpen, xmlFileRead, xmlFileClose); #ifdef HAVE_ZLIB_H @@ -2049,11 +2140,14 @@ xmlRegisterDefaultInputCallbacks * Registers the default compiled-in I/O handlers. */ void -xmlRegisterDefaultOutputCallbacks -(void) { +xmlRegisterDefaultOutputCallbacks (void) { if (xmlOutputCallbackInitialized) return; +#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) + xmlInitPlatformSpecificIo(); +#endif + xmlRegisterOutputCallbacks(xmlFileMatch, xmlFileOpenW, xmlFileWrite, xmlFileClose); @@ -2368,7 +2462,8 @@ __xmlOutputBufferCreateFilename(const char *URI, /* * try to limit the damages of the URI unescaping code. */ - if (puri->scheme != NULL) + if ((puri->scheme == NULL) || + (xmlStrEqual(BAD_CAST puri->scheme, BAD_CAST "file"))) unescaped = xmlURIUnescapeString(URI, 0, NULL); xmlFreeURI(puri); } @@ -3499,10 +3594,7 @@ xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret) { return(ret); } -static int xmlSysIDExists(const char *URL) { -#ifdef HAVE_STAT - int ret; - struct stat info; +static int xmlNoNetExists(const char *URL) { const char *path; if (URL == NULL) @@ -3522,13 +3614,88 @@ static int xmlSysIDExists(const char *URL) { #endif } else path = URL; - ret = stat(path, &info); - if (ret == 0) - return(1); -#endif - return(0); + + return xmlCheckFilename(path); } +#ifdef LIBXML_CATALOG_ENABLED + +/** + * xmlResolveResourceFromCatalog: + * @URL: the URL for the entity to load + * @ID: the System ID for the entity to load + * @ctxt: the context in which the entity is called or NULL + * + * Resolves the URL and ID against the appropriate catalog. + * This function is used by xmlDefaultExternalEntityLoader and + * xmlNoNetExternalEntityLoader. + * + * Returns a new allocated URL, or NULL. + */ +xmlChar * +xmlResolveResourceFromCatalog(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt) { + xmlChar *resource = NULL; + xmlCatalogAllow pref; + + /* + * If the resource doesn't exists as a file, + * try to load it from the resource pointed in the catalogs + */ + pref = xmlCatalogGetDefaults(); + + if ((pref != XML_CATA_ALLOW_NONE) && (!xmlNoNetExists(URL))) { + /* + * Do a local lookup + */ + if ((ctxt != NULL) && (ctxt->catalogs != NULL) && + ((pref == XML_CATA_ALLOW_ALL) || + (pref == XML_CATA_ALLOW_DOCUMENT))) { + resource = xmlCatalogLocalResolve(ctxt->catalogs, + (const xmlChar *)ID, + (const xmlChar *)URL); + } + /* + * Try a global lookup + */ + if ((resource == NULL) && + ((pref == XML_CATA_ALLOW_ALL) || + (pref == XML_CATA_ALLOW_GLOBAL))) { + resource = xmlCatalogResolve((const xmlChar *)ID, + (const xmlChar *)URL); + } + if ((resource == NULL) && (URL != NULL)) + resource = xmlStrdup((const xmlChar *) URL); + + /* + * TODO: do an URI lookup on the reference + */ + if ((resource != NULL) && (!xmlNoNetExists((const char *)resource))) { + xmlChar *tmp = NULL; + + if ((ctxt != NULL) && (ctxt->catalogs != NULL) && + ((pref == XML_CATA_ALLOW_ALL) || + (pref == XML_CATA_ALLOW_DOCUMENT))) { + tmp = xmlCatalogLocalResolveURI(ctxt->catalogs, resource); + } + if ((tmp == NULL) && + ((pref == XML_CATA_ALLOW_ALL) || + (pref == XML_CATA_ALLOW_GLOBAL))) { + tmp = xmlCatalogResolveURI(resource); + } + + if (tmp != NULL) { + xmlFree(resource); + resource = tmp; + } + } + } + + return resource; +} + +#endif + /** * xmlDefaultExternalEntityLoader: * @URL: the URL for the entity to load @@ -3546,15 +3713,10 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID, xmlParserInputPtr ret = NULL; xmlChar *resource = NULL; -#ifdef LIBXML_CATALOG_ENABLED - xmlCatalogAllow pref; -#endif - #ifdef DEBUG_EXTERNAL_ENTITIES xmlGenericError(xmlGenericErrorContext, "xmlDefaultExternalEntityLoader(%s, xxx)\n", URL); #endif -#ifdef LIBXML_CATALOG_ENABLED if ((ctxt != NULL) && (ctxt->options & XML_PARSE_NONET)) { int options = ctxt->options; @@ -3563,60 +3725,8 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID, ctxt->options = options; return(ret); } - - /* - * If the resource doesn't exists as a file, - * try to load it from the resource pointed in the catalogs - */ - pref = xmlCatalogGetDefaults(); - - if ((pref != XML_CATA_ALLOW_NONE) && (!xmlSysIDExists(URL))) { - /* - * Do a local lookup - */ - if ((ctxt != NULL) && (ctxt->catalogs != NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_DOCUMENT))) { - resource = xmlCatalogLocalResolve(ctxt->catalogs, - (const xmlChar *) ID, - (const xmlChar *) URL); - } - /* - * Try a global lookup - */ - if ((resource == NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_GLOBAL))) { - resource = xmlCatalogResolve((const xmlChar *) ID, - (const xmlChar *) URL); - } - if ((resource == NULL) && (URL != NULL)) - resource = xmlStrdup((const xmlChar *) URL); - - /* - * TODO: do an URI lookup on the reference - */ - if ((resource != NULL) - && (!xmlSysIDExists((const char *) resource))) { - xmlChar *tmp = NULL; - - if ((ctxt != NULL) && (ctxt->catalogs != NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_DOCUMENT))) { - tmp = xmlCatalogLocalResolveURI(ctxt->catalogs, resource); - } - if ((tmp == NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_GLOBAL))) { - tmp = xmlCatalogResolveURI(resource); - } - - if (tmp != NULL) { - xmlFree(resource); - resource = tmp; - } - } - } +#ifdef LIBXML_CATALOG_ENABLED + resource = xmlResolveResourceFromCatalog(URL, ID, ctxt); #endif if (resource == NULL) @@ -3674,7 +3784,7 @@ xmlGetExternalEntityLoader(void) { xmlParserInputPtr xmlLoadExternalEntity(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { - if ((URL != NULL) && (xmlSysIDExists(URL) == 0)) { + if ((URL != NULL) && (xmlNoNetExists(URL) == 0)) { char *canonicFilename; xmlParserInputPtr ret; @@ -3697,40 +3807,6 @@ xmlLoadExternalEntity(const char *URL, const char *ID, * * ************************************************************************/ -#ifdef LIBXML_CATALOG_ENABLED -static int -xmlNoNetExists(const char *URL) -{ -#ifdef HAVE_STAT - int ret; - struct stat info; - const char *path; - - if (URL == NULL) - return (0); - - if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) - path = &URL[17]; -#else - path = &URL[16]; -#endif - else if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) - path = &URL[8]; -#else - path = &URL[7]; -#endif - } else - path = URL; - ret = stat(path, &info); - if (ret == 0) - return (1); -#endif - return (0); -} -#endif - /** * xmlNoNetExternalEntityLoader: * @URL: the URL for the entity to load @@ -3749,61 +3825,9 @@ xmlNoNetExternalEntityLoader(const char *URL, const char *ID, xmlChar *resource = NULL; #ifdef LIBXML_CATALOG_ENABLED - xmlCatalogAllow pref; - - /* - * If the resource doesn't exists as a file, - * try to load it from the resource pointed in the catalogs - */ - pref = xmlCatalogGetDefaults(); - - if ((pref != XML_CATA_ALLOW_NONE) && (!xmlNoNetExists(URL))) { - /* - * Do a local lookup - */ - if ((ctxt != NULL) && (ctxt->catalogs != NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_DOCUMENT))) { - resource = xmlCatalogLocalResolve(ctxt->catalogs, - (const xmlChar *)ID, - (const xmlChar *)URL); - } - /* - * Try a global lookup - */ - if ((resource == NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_GLOBAL))) { - resource = xmlCatalogResolve((const xmlChar *)ID, - (const xmlChar *)URL); - } - if ((resource == NULL) && (URL != NULL)) - resource = xmlStrdup((const xmlChar *) URL); - - /* - * TODO: do an URI lookup on the reference - */ - if ((resource != NULL) && (!xmlNoNetExists((const char *)resource))) { - xmlChar *tmp = NULL; - - if ((ctxt != NULL) && (ctxt->catalogs != NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_DOCUMENT))) { - tmp = xmlCatalogLocalResolveURI(ctxt->catalogs, resource); - } - if ((tmp == NULL) && - ((pref == XML_CATA_ALLOW_ALL) || - (pref == XML_CATA_ALLOW_GLOBAL))) { - tmp = xmlCatalogResolveURI(resource); - } - - if (tmp != NULL) { - xmlFree(resource); - resource = tmp; - } - } - } + resource = xmlResolveResourceFromCatalog(URL, ID, ctxt); #endif + if (resource == NULL) resource = (xmlChar *) URL; diff --git a/xmllint.c b/xmllint.c index 79025f1..5e1bfd7 100644 --- a/xmllint.c +++ b/xmllint.c @@ -98,6 +98,9 @@ #ifdef LIBXML_C14N_ENABLED #include #endif +#ifdef LIBXML_OUTPUT_ENABLED +#include +#endif #ifndef XML_XML_DEFAULT_CATALOG #define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" @@ -133,6 +136,7 @@ static int nowrap = 0; static int format = 0; static const char *output = NULL; static int compress = 0; +static int oldout = 0; #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef LIBXML_VALID_ENABLED static int valid = 0; @@ -2089,6 +2093,26 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } #endif /* LIBXML_PUSH_ENABLED */ +#ifdef HAVE_SYS_MMAN_H + else if ((html) && (memory)) { + int fd; + struct stat info; + const char *base; + if (stat(filename, &info) < 0) + return; + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; + if (base == (void *) MAP_FAILED) + return; + + doc = htmlReadMemory((char *) base, info.st_size, filename, + NULL, options); + + munmap((char *) base, info.st_size); + close(fd); + } +#endif else if (html) { doc = htmlReadFile(filename, NULL, options); } @@ -2203,6 +2227,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { filename, NULL, options); munmap((char *) base, info.st_size); + close(fd); #endif #ifdef LIBXML_VALID_ENABLED } else if (valid) { @@ -2280,8 +2305,10 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { /* * shell interaction */ - if (shell) + if (shell) { + xmlXPathOrderDocElems(doc); xmlShell(doc, filename, xmlShellReadline, stdout); + } #endif #endif @@ -2443,48 +2470,71 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { write(1, result, len); xmlFree(result); } + } else #endif /* HAVE_SYS_MMAN_H */ if (compress) { xmlSaveFile(output ? output : "-", doc); - } - else if (encoding != NULL) { - if ( format ) { - ret = xmlSaveFormatFileEnc(output ? output : "-", doc, - encoding, 1); - } - else { - ret = xmlSaveFileEnc(output ? output : "-", doc, encoding); - } - if (ret < 0) { - fprintf(stderr, "failed save to %s\n", - output ? output : "-"); - progresult = XMLLINT_ERR_OUT; - } - } - else if (format) { - ret = xmlSaveFormatFile(output ? output : "-", doc, 1); - if (ret < 0) { - fprintf(stderr, "failed save to %s\n", - output ? output : "-"); - progresult = XMLLINT_ERR_OUT; + } else if (oldout) { + if (encoding != NULL) { + if ( format ) { + ret = xmlSaveFormatFileEnc(output ? output : "-", doc, + encoding, 1); + } + else { + ret = xmlSaveFileEnc(output ? output : "-", doc, + encoding); + } + if (ret < 0) { + fprintf(stderr, "failed save to %s\n", + output ? output : "-"); + progresult = XMLLINT_ERR_OUT; + } + } else if (format) { + ret = xmlSaveFormatFile(output ? output : "-", doc, 1); + if (ret < 0) { + fprintf(stderr, "failed save to %s\n", + output ? output : "-"); + progresult = XMLLINT_ERR_OUT; + } + } else { + FILE *out; + if (output == NULL) + out = stdout; + else { + out = fopen(output,"wb"); + } + if (out != NULL) { + if (xmlDocDump(out, doc) < 0) + progresult = XMLLINT_ERR_OUT; + + if (output != NULL) + fclose(out); + } else { + fprintf(stderr, "failed to open %s\n", output); + progresult = XMLLINT_ERR_OUT; + } } - } - else { - FILE *out; + } else { + xmlSaveCtxtPtr ctxt; + int saveOpts = 0; + + if (format) + saveOpts |= XML_SAVE_FORMAT; + if (output == NULL) - out = stdout; - else { - out = fopen(output,"wb"); - } - if (out != NULL) { - if (xmlDocDump(out, doc) < 0) - progresult = XMLLINT_ERR_OUT; + ctxt = xmlSaveToFd(1, encoding, saveOpts); + else + ctxt = xmlSaveToFilename(output, encoding, saveOpts); - if (output != NULL) - fclose(out); + if (ctxt != NULL) { + if (xmlSaveDoc(ctxt, doc) < 0) { + fprintf(stderr, "failed save to %s\n", + output ? output : "-"); + progresult = XMLLINT_ERR_OUT; + } + xmlSaveClose(ctxt); } else { - fprintf(stderr, "failed to open %s\n", output); progresult = XMLLINT_ERR_OUT; } } @@ -2752,6 +2802,7 @@ static void showVersion(const char *name) { if (xmlHasFeature(XML_WITH_DEBUG)) fprintf(stderr, "Debug "); if (xmlHasFeature(XML_WITH_DEBUG_MEM)) fprintf(stderr, "MemDebug "); if (xmlHasFeature(XML_WITH_DEBUG_RUN)) fprintf(stderr, "RunDebug "); + if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(stderr, "Zlib "); fprintf(stderr, "\n"); } diff --git a/xmlmemory.c b/xmlmemory.c index 18e0ff1..362a0b0 100644 --- a/xmlmemory.c +++ b/xmlmemory.c @@ -577,7 +577,7 @@ xmlMemBlocks(void) { static void xmlMemContentShow(FILE *fp, MEMHDR *p) { - int i,j,len = p->mh_size; + int i,j,k,len = p->mh_size; const char *buf = (const char *) HDR_2_CLIENT(p); if (p == NULL) { @@ -594,13 +594,15 @@ xmlMemContentShow(FILE *fp, MEMHDR *p) MEMHDR *q; void *cur; - for (j = 0;j < len -3;j += 4) { + for (j = 0;(j < len -3) && (j < 40);j += 4) { cur = *((void **) &buf[j]); q = CLIENT_2_HDR(cur); p = memlist; + k = 0; while (p != NULL) { if (p == q) break; p = p->mh_next; + if (k++ > 100) break; } if ((p != NULL) && (p == q)) { fprintf(fp, " pointer to #%lu at index %d", diff --git a/xmlregexp.c b/xmlregexp.c index 58f480d..e7d519e 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -4807,6 +4807,11 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { int start = -1; int end = -1; + if (CUR == '\0') { + ERROR("Expecting ']'"); + return; + } + if ((CUR == '&') && (NXT(1) == '#')) { end = start = xmlFAParseCharRef(ctxt); xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg, @@ -4897,7 +4902,7 @@ xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) { xmlFAParseCharRange(ctxt); } } while ((CUR != ']') && (CUR != '^') && (CUR != '-') && - (ctxt->error == 0)); + (CUR != 0) && (ctxt->error == 0)); } /** diff --git a/xmlsave.c b/xmlsave.c index ba35f32..6963e7b 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -122,19 +122,19 @@ xmlSaveErr(int code, xmlNodePtr node, const char *extra) switch(code) { case XML_SAVE_NOT_UTF8: - msg = "string is not in UTF-8"; + msg = "string is not in UTF-8\n"; break; case XML_SAVE_CHAR_INVALID: - msg = "invalid character value"; + msg = "invalid character value\n"; break; case XML_SAVE_UNKNOWN_ENCODING: - msg = "unknown encoding %s"; + msg = "unknown encoding %s\n"; break; case XML_SAVE_NO_DOCTYPE: - msg = "document has no DOCTYPE"; + msg = "document has no DOCTYPE\n"; break; default: - msg = "unexpected error number"; + msg = "unexpected error number\n"; } __xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra); } @@ -392,7 +392,7 @@ xmlNewSaveCtxt(const char *encoding, int options) return(NULL); } ret->encoding = xmlStrdup((const xmlChar *)encoding); - ret->escape = xmlEscapeEntities; + ret->escape = NULL; } xmlSaveCtxtInit(ret); @@ -464,7 +464,7 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur); static void xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur); static void xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur); void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur); -static void xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur); +static int xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur); /** * xmlNsDumpOutput: @@ -820,35 +820,77 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { * * Dump an XML document. */ -static void +static int xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { #ifdef LIBXML_HTML_ENABLED xmlDtdPtr dtd; int is_xhtml = 0; #endif const xmlChar *oldenc = cur->encoding; + const xmlChar *oldctxtenc = ctxt->encoding; const xmlChar *encoding = ctxt->encoding; - xmlOutputBufferPtr buf; + xmlCharEncodingOutputFunc oldescape = ctxt->escape; + xmlCharEncodingOutputFunc oldescapeAttr = ctxt->escapeAttr; + xmlOutputBufferPtr buf = ctxt->buf; + xmlCharEncodingHandlerPtr handler = NULL; + xmlCharEncoding enc; xmlInitParser(); - if (ctxt->encoding != NULL) + if (ctxt->encoding != NULL) { cur->encoding = BAD_CAST ctxt->encoding; + } else if (cur->encoding != NULL) { + encoding = cur->encoding; + } else if (cur->charset != XML_CHAR_ENCODING_UTF8) { + encoding = (const xmlChar *) + xmlGetCharEncodingName((xmlCharEncoding) cur->charset); + } - buf = ctxt->buf; + enc = xmlParseCharEncoding((const char*) encoding); + if ((encoding != NULL) && (oldctxtenc == NULL) && + (buf->encoder == NULL) && (buf->conv == NULL) && + ((ctxt->options & XML_SAVE_NO_DECL) == 0)) { + if ((enc != XML_CHAR_ENCODING_UTF8) && + (enc != XML_CHAR_ENCODING_NONE) && + (enc != XML_CHAR_ENCODING_ASCII)) { + /* + * we need to switch to this encoding but just for this document + * since we output the XMLDecl the conversion must be done to not + * generate not well formed documents. + */ + buf->encoder = xmlFindCharEncodingHandler((const char *)encoding); + if (buf->encoder == NULL) { + xmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, + (const char *)encoding); + return(-1); + } + buf->conv = xmlBufferCreate(); + if (buf->conv == NULL) { + xmlCharEncCloseFunc(buf->encoder); + xmlSaveErrMemory("creating encoding buffer"); + return(-1); + } + /* + * initialize the state, e.g. if outputting a BOM + */ + xmlCharEncOutFunc(buf->encoder, buf->conv, NULL); + } + if (ctxt->escape == xmlEscapeEntities) + ctxt->escape = NULL; + if (ctxt->escapeAttr == xmlEscapeEntities) + ctxt->escapeAttr = NULL; + } + + + /* + * Save the XML declaration + */ if ((ctxt->options & XML_SAVE_NO_DECL) == 0) { xmlOutputBufferWrite(buf, 14, "version != NULL) xmlBufferWriteQuotedString(buf->buffer, cur->version); else xmlOutputBufferWrite(buf, 5, "\"1.0\""); - if (ctxt->encoding == NULL) { - if (cur->encoding != NULL) - encoding = cur->encoding; - else if (cur->charset != XML_CHAR_ENCODING_UTF8) - encoding = (const xmlChar *) - xmlGetCharEncodingName((xmlCharEncoding) cur->charset); - } if (encoding != NULL) { xmlOutputBufferWrite(buf, 10, " encoding="); xmlBufferWriteQuotedString(buf->buffer, (xmlChar *) encoding); @@ -890,6 +932,25 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { } if (ctxt->encoding != NULL) cur->encoding = oldenc; + + /* + * Restore the state of the saving context at the end of the document + */ + if ((encoding != NULL) && (oldctxtenc == NULL) && + ((ctxt->options & XML_SAVE_NO_DECL) == 0)) { + if ((enc != XML_CHAR_ENCODING_UTF8) && + (enc != XML_CHAR_ENCODING_NONE) && + (enc != XML_CHAR_ENCODING_ASCII)) { + xmlOutputBufferFlush(buf); + xmlCharEncCloseFunc(buf->encoder); + xmlBufferFree(buf->conv); + buf->encoder = NULL; + buf->conv = NULL; + } + ctxt->escape = oldescape; + ctxt->escapeAttr = oldescapeAttr; + } + return(0); } #ifdef LIBXML_HTML_ENABLED @@ -1316,6 +1377,11 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape); } +#if 0 + /* + * This was removed due to problems with HTML processors. + * See bug #345147. + */ /* * 4.8. Script and Style elements */ @@ -1380,7 +1446,10 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { } child = child->next; } - } else if (cur->children != NULL) { + } +#endif + + if (cur->children != NULL) { int indent = ctxt->format; if (format) xmlOutputBufferWrite(buf, 1, "\n"); @@ -1555,14 +1624,15 @@ xmlSaveDoc(xmlSaveCtxtPtr ctxt, xmlDocPtr doc) long ret = 0; if ((ctxt == NULL) || (doc == NULL)) return(-1); - xmlDocContentDumpOutput(ctxt, doc); + if (xmlDocContentDumpOutput(ctxt, doc) < 0) + return(-1); return(ret); } /** * xmlSaveTree: * @ctxt: a document saving context - * @node: a document + * @node: the top node of the subtree to save * * Save a subtree starting at the node parameter to a saving context * TODO: The function is not fully implemented yet as it does not return the diff --git a/xmlschemas.c b/xmlschemas.c index ff89e2c..11e3eac 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -84,6 +84,8 @@ /* #define DEBUG_IDC_NODE_TABLE */ +/* #define WXS_ELEM_DECL_CONS_ENABLED */ + #ifdef DEBUG_IDC #ifndef DEBUG_IDC_NODE_TABLE #define DEBUG_IDC_NODE_TABLE @@ -183,6 +185,8 @@ static const xmlChar *xmlNamespaceNs = (const xmlChar *) #define WXS_PARTICLE_TERM(p) (WXS_PARTICLE(p))->children +#define WXS_PARTICLE_TERM_AS_ELEM(p) (WXS_ELEM_CAST WXS_PARTICLE_TERM(p)) + #define WXS_PARTICLE_MODEL(p) WXS_MODEL_GROUP_CAST WXS_PARTICLE(p)->children /* * Macros for model groups definitions. @@ -242,6 +246,10 @@ static const xmlChar *xmlNamespaceNs = (const xmlChar *) #define WXS_IS_TYPE_NOT_FIXED_1(item) \ (((item)->type != XML_SCHEMA_TYPE_BASIC) && \ (((item)->flags & XML_SCHEMAS_TYPE_FIXUP_1) == 0)) + +#define WXS_TYPE_IS_GLOBAL(t) ((t)->flags & XML_SCHEMAS_TYPE_GLOBAL) + +#define WXS_TYPE_IS_LOCAL(t) (((t)->flags & XML_SCHEMAS_TYPE_GLOBAL) == 0) /* * Macros for exclusively for complex types. */ @@ -836,12 +844,12 @@ struct _xmlSchemaIDCMatcher { int type; int depth; /* the tree depth at creation time */ xmlSchemaIDCMatcherPtr next; /* next in the list */ + xmlSchemaIDCMatcherPtr nextCached; /* next in the cache list */ xmlSchemaIDCAugPtr aidc; /* the augmented IDC item */ int idcType; xmlSchemaPSVIIDCKeyPtr **keySeqs; /* the key-sequences of the target elements */ int sizeKeySeqs; - int targetDepth; xmlSchemaItemListPtr targets; /* list of target-node (xmlSchemaPSVIIDCNodePtr) entries */ }; @@ -993,6 +1001,7 @@ struct _xmlSchemaValidCtxt { xmlSchemaIDCStateObjPtr xpathStates; /* first active state object. */ xmlSchemaIDCStateObjPtr xpathStatePool; /* first stored state object. */ + xmlSchemaIDCMatcherPtr idcMatcherCache; /* Cache for IDC matcher objects. */ xmlSchemaPSVIIDCNodePtr *idcNodes; /* list of all IDC node-table entries*/ int nbIdcNodes; @@ -18287,10 +18296,18 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt, if (type->contentType == XML_SCHEMA_CONTENT_EMPTY) { /* * SPEC (3.2.1) + * "If the ·effective content· is empty, then the + * {content type} of the [...] base ..." */ type->contentType = baseType->contentType; type->subtypes = baseType->subtypes; /* + * Fixes bug #347316: + * This is the case when the base type has a simple + * type definition as content. + */ + type->contentTypeDef = baseType->contentTypeDef; + /* * NOTE that the effective mixed is ignored here. */ } else if (baseType->contentType == XML_SCHEMA_CONTENT_EMPTY) { @@ -19736,6 +19753,123 @@ add_member: } } +#ifdef WXS_ELEM_DECL_CONS_ENABLED /* enable when finished */ +/** + * xmlSchemaCheckElementDeclComponent + * @pctxt: the schema parser context + * @ctxtComponent: the context component (an element declaration) + * @ctxtParticle: the first particle of the context component + * @searchParticle: the element declaration particle to be analysed + * + * Schema Component Constraint: Element Declarations Consistent + */ +static int +xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt, + xmlSchemaBasicItemPtr ctxtComponent, + xmlSchemaParticlePtr ctxtParticle, + xmlSchemaParticlePtr searchParticle, + xmlSchemaParticlePtr curParticle, + int search) +{ + return(0); + + int ret = 0; + xmlSchemaParticlePtr cur = curParticle; + if (curParticle == NULL) { + return(0); + } + if (WXS_PARTICLE_TERM(curParticle) == NULL) { + /* + * Just return in this case. A missing "term" of the particle + * might arise due to an invalid "term" component. + */ + return(0); + } + while (cur != NULL) { + switch (WXS_PARTICLE_TERM(cur)->type) { + case XML_SCHEMA_TYPE_ANY: + break; + case XML_SCHEMA_TYPE_ELEMENT: + if (search == 0) { + ret = xmlSchemaCheckElementDeclConsistent(pctxt, + ctxtComponent, ctxtParticle, cur, ctxtParticle, 1); + if (ret != 0) + return(ret); + } else { + xmlSchemaElementPtr elem = + WXS_ELEM_CAST(WXS_PARTICLE_TERM(cur)); + /* + * SPEC Element Declarations Consistent: + * "If the {particles} contains, either directly, + * indirectly (that is, within the {particles} of a + * contained model group, recursively) or ·implicitly· + * two or more element declaration particles with + * the same {name} and {target namespace}, then + * all their type definitions must be the same + * top-level definition [...]" + */ + if (xmlStrEqual(WXS_PARTICLE_TERM_AS_ELEM(cur)->name, + WXS_PARTICLE_TERM_AS_ELEM(searchParticle)->name) && + xmlStrEqual(WXS_PARTICLE_TERM_AS_ELEM(cur)->targetNamespace, + WXS_PARTICLE_TERM_AS_ELEM(searchParticle)->targetNamespace)) + { + xmlChar *strA = NULL, *strB = NULL; + + xmlSchemaCustomErr(ACTXT_CAST pctxt, + /* TODO: error code */ + XML_SCHEMAP_COS_NONAMBIG, + WXS_ITEM_NODE(cur), NULL, + "In the content model of %s, there are multiple " + "element declarations for '%s' with different " + "type definitions", + xmlSchemaGetComponentDesignation(&strA, + ctxtComponent), + xmlSchemaFormatQName(&strB, + WXS_PARTICLE_TERM_AS_ELEM(cur)->targetNamespace, + WXS_PARTICLE_TERM_AS_ELEM(cur)->name)); + FREE_AND_NULL(strA); + FREE_AND_NULL(strB); + return(XML_SCHEMAP_COS_NONAMBIG); + } + } + break; + case XML_SCHEMA_TYPE_SEQUENCE: { + break; + } + case XML_SCHEMA_TYPE_CHOICE:{ + /* + xmlSchemaTreeItemPtr sub; + + sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr) + while (sub != NULL) { + ret = xmlSchemaCheckElementDeclConsistent(pctxt, ctxtComponent, + ctxtParticle, ctxtElem); + if (ret != 0) + return(ret); + sub = sub->next; + } + */ + break; + } + case XML_SCHEMA_TYPE_ALL: + break; + case XML_SCHEMA_TYPE_GROUP: + break; + default: + xmlSchemaInternalErr2(ACTXT_CAST pctxt, + "xmlSchemaCheckElementDeclConsistent", + "found unexpected term of type '%s' in content model", + WXS_ITEM_TYPE_NAME(WXS_PARTICLE_TERM(cur)), NULL); + return(-1); + } + cur = (xmlSchemaParticlePtr) cur->next; + } + +exit: + return(ret); +} +#endif + /** * xmlSchemaCheckElementDeclComponent * @item: an schema element declaration/particle @@ -19743,8 +19877,7 @@ add_member: * @name: the name of the attribute * * Validates the value constraints of an element declaration. - * - * Fixes finish doing the computations on the element declarations. + * Adds substitution group members. */ static void xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl, @@ -19755,8 +19888,12 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl, if (elemDecl->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) return; elemDecl->flags |= XML_SCHEMAS_ELEM_INTERNAL_CHECKED; - if (xmlSchemaCheckElemPropsCorrect(ctxt, elemDecl) == 0) - xmlSchemaCheckElemSubstGroup(ctxt, elemDecl); + if (xmlSchemaCheckElemPropsCorrect(ctxt, elemDecl) == 0) { + /* + * Adds substitution group members. + */ + xmlSchemaCheckElemSubstGroup(ctxt, elemDecl); + } } /** @@ -20579,6 +20716,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, xmlSchemaTreeItemPtr item, *items; int nbItems, i, ret = 0; xmlSchemaBucketPtr oldbucket = con->bucket; + xmlSchemaElementPtr elemDecl; #define FIXHFAILURE if (pctxt->err == XML_SCHEMAP_INTERNAL) goto exit_failure; @@ -20852,7 +20990,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, if (pctxt->nberrors != 0) goto exit_error; /* - * At this point we need all simple types to be builded and checked. + * At this point we need build and check all simple types. */ /* * Apply contraints for attribute declarations. @@ -20919,8 +21057,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, if (pctxt->nberrors != 0) goto exit_error; - /* - * Fixup complex types. + /* + * Complex types are builded and checked. */ for (i = 0; i < nbItems; i++) { item = con->pending->items[i]; @@ -20943,11 +21081,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, * will create particles and model groups in some cases. */ items = (xmlSchemaTreeItemPtr *) con->pending->items; - nbItems = con->pending->nbItems; - - /* - * At this point all complex types need to be builded and checked. - */ + nbItems = con->pending->nbItems; + /* * Apply some constraints for element declarations. */ @@ -20955,13 +21090,30 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, item = items[i]; switch (item->type) { case XML_SCHEMA_TYPE_ELEMENT: + elemDecl = (xmlSchemaElementPtr) item; - if ((((xmlSchemaElementPtr) item)->flags & - XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0) { + if ((elemDecl->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0) + { xmlSchemaCheckElementDeclComponent( - (xmlSchemaElementPtr) item, pctxt); + (xmlSchemaElementPtr) elemDecl, pctxt); FIXHFAILURE; } + +#ifdef WXS_ELEM_DECL_CONS_ENABLED + /* + * Schema Component Constraint: Element Declarations Consistent + * Apply this constraint to local types of element declarations. + */ + if ((WXS_ELEM_TYPEDEF(elemDecl) != NULL) && + (WXS_IS_COMPLEX(WXS_ELEM_TYPEDEF(elemDecl))) && + (WXS_TYPE_IS_LOCAL(WXS_ELEM_TYPEDEF(elemDecl)))) + { + xmlSchemaCheckElementDeclConsistent(pctxt, + WXS_BASIC_CAST elemDecl, + WXS_TYPE_PARTICLE(WXS_ELEM_TYPEDEF(elemDecl)), + NULL, NULL, 0); + } +#endif break; default: break; @@ -20969,6 +21121,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt, } if (pctxt->nberrors != 0) goto exit_error; + /* * Finally we can build the automaton from the content model of * complex types. @@ -22005,7 +22158,7 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher) while (matcher != NULL) { next = matcher->next; - if (matcher->keySeqs != NULL) { + if (matcher->keySeqs != NULL) { int i; for (i = 0; i < matcher->sizeKeySeqs; i++) if (matcher->keySeqs[i] != NULL) @@ -22035,6 +22188,63 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher) } } +/** + * xmlSchemaIDCReleaseMatcherList: + * @vctxt: the WXS validation context + * @matcher: the first IDC matcher in the list + * + * Caches a list of IDC matchers for reuse. + */ +static void +xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt, + xmlSchemaIDCMatcherPtr matcher) +{ + xmlSchemaIDCMatcherPtr next; + + while (matcher != NULL) { + next = matcher->next; + if (matcher->keySeqs != NULL) { + int i; + /* + * Don't free the array, but only the content. + */ + for (i = 0; i < matcher->sizeKeySeqs; i++) + if (matcher->keySeqs[i] != NULL) { + xmlFree(matcher->keySeqs[i]); + matcher->keySeqs[i] = NULL; + } + } + if (matcher->targets) { + if (matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) { + int i; + xmlSchemaPSVIIDCNodePtr idcNode; + /* + * Node-table items for keyrefs are not stored globally + * to the validation context, since they are not bubbled. + * We need to free them here. + */ + for (i = 0; i < matcher->targets->nbItems; i++) { + idcNode = + (xmlSchemaPSVIIDCNodePtr) matcher->targets->items[i]; + xmlFree(idcNode->keys); + xmlFree(idcNode); + } + } + xmlSchemaItemListFree(matcher->targets); + matcher->targets = NULL; + } + matcher->next = NULL; + /* + * Cache the matcher. + */ + if (vctxt->idcMatcherCache != NULL) + matcher->nextCached = vctxt->idcMatcherCache; + vctxt->idcMatcherCache = matcher; + + matcher = next; + } +} + /** * xmlSchemaIDCAddStateObject: * @vctxt: the WXS validation context @@ -22189,7 +22399,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, "allocating the state object history", NULL); return(-1); } - sto->sizeHistory = 10; + sto->sizeHistory = 5; } else if (sto->sizeHistory <= sto->nbHistory) { sto->sizeHistory *= 2; sto->history = (int *) xmlRealloc(sto->history, @@ -22815,7 +23025,7 @@ deregister_check: /* * Link it to the pool of reusable state objects. */ - vctxt->xpathStatePool = sto; + vctxt->xpathStatePool = sto; sto = nextsto; } else sto = sto->next; @@ -22912,14 +23122,23 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, /* * Create an IDC matcher for every IDC definition. */ - matcher = (xmlSchemaIDCMatcherPtr) - xmlMalloc(sizeof(xmlSchemaIDCMatcher)); - if (matcher == NULL) { - xmlSchemaVErrMemory(vctxt, - "allocating an IDC matcher", NULL); - return (-1); + if (vctxt->idcMatcherCache != NULL) { + /* + * Reuse a cached matcher. + */ + matcher = vctxt->idcMatcherCache; + vctxt->idcMatcherCache = matcher->nextCached; + matcher->nextCached = NULL; + } else { + matcher = (xmlSchemaIDCMatcherPtr) + xmlMalloc(sizeof(xmlSchemaIDCMatcher)); + if (matcher == NULL) { + xmlSchemaVErrMemory(vctxt, + "allocating an IDC matcher", NULL); + return (-1); + } + memset(matcher, 0, sizeof(xmlSchemaIDCMatcher)); } - memset(matcher, 0, sizeof(xmlSchemaIDCMatcher)); if (last == NULL) vctxt->inode->idcMatchers = matcher; else @@ -23665,8 +23884,14 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, return (0); } +/** + * xmlSchemaClearElemInfo: + * @vctxt: the WXS validation context + * @ielem: the element information item + */ static void -xmlSchemaClearElemInfo(xmlSchemaNodeInfoPtr ielem) +xmlSchemaClearElemInfo(xmlSchemaValidCtxtPtr vctxt, + xmlSchemaNodeInfoPtr ielem) { ielem->hasKeyrefs = 0; ielem->appliedXPath = 0; @@ -23692,9 +23917,13 @@ xmlSchemaClearElemInfo(xmlSchemaNodeInfoPtr ielem) } if (ielem->idcMatchers != NULL) { /* - * URGENT OPTIMIZE TODO: Use a pool of IDC matchers. + * REVISIT OPTIMIZE TODO: Use a pool of IDC matchers. + * Does it work? */ + xmlSchemaIDCReleaseMatcherList(vctxt, ielem->idcMatchers); +#if 0 xmlSchemaIDCFreeMatcherList(ielem->idcMatchers); +#endif ielem->idcMatchers = NULL; } if (ielem->idcTable != NULL) { @@ -26060,7 +26289,7 @@ end_elem: * VAL TODO: Don't free the PSVI IDC tables if they are * requested for the PSVI. */ - xmlSchemaClearElemInfo(inode); + xmlSchemaClearElemInfo(vctxt, inode); /* * Skip further processing if we are on the validation root. */ @@ -27160,6 +27389,18 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) } while (cur != NULL); vctxt->aidcs = NULL; } + if (vctxt->idcMatcherCache != NULL) { + xmlSchemaIDCMatcherPtr matcher = vctxt->idcMatcherCache, tmp; + + while (matcher) { + tmp = matcher; + matcher = matcher->nextCached; + xmlSchemaIDCFreeMatcherList(tmp); + } + vctxt->idcMatcherCache = NULL; + } + + if (vctxt->idcNodes != NULL) { int i; xmlSchemaPSVIIDCNodePtr item; @@ -27171,6 +27412,8 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) } xmlFree(vctxt->idcNodes); vctxt->idcNodes = NULL; + vctxt->nbIdcNodes = 0; + vctxt->sizeIdcNodes = 0; } /* * Note that we won't delete the XPath state pool here. @@ -27196,7 +27439,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt) ei = vctxt->elemInfos[i]; if (ei == NULL) break; - xmlSchemaClearElemInfo(ei); + xmlSchemaClearElemInfo(vctxt, ei); } } xmlSchemaItemListClear(vctxt->nodeQNames); @@ -27242,10 +27485,14 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt) xmlFree(ctxt->idcKeys); } - if (ctxt->xpathStates != NULL) + if (ctxt->xpathStates != NULL) { xmlSchemaFreeIDCStateObjList(ctxt->xpathStates); - if (ctxt->xpathStatePool != NULL) + ctxt->xpathStates = NULL; + } + if (ctxt->xpathStatePool != NULL) { xmlSchemaFreeIDCStateObjList(ctxt->xpathStatePool); + ctxt->xpathStatePool = NULL; + } /* * Augmented IDC information. @@ -27279,7 +27526,7 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt) ei = ctxt->elemInfos[i]; if (ei == NULL) break; - xmlSchemaClearElemInfo(ei); + xmlSchemaClearElemInfo(ctxt, ei); xmlFree(ei); } xmlFree(ctxt->elemInfos); diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 987f85f..a35c539 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -5715,6 +5715,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) if ((dec.frac == 0) || (dec.frac == dec.total)) bufsize++; buf = xmlMalloc(bufsize); + if (buf == NULL) + return(-1); offs = buf; if (dec.sign) *offs++ = '-'; @@ -5788,6 +5790,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) if (dec.sign) bufsize++; *retValue = xmlMalloc(bufsize); + if (*retValue == NULL) + return(-1); if (dec.hi != 0) { if (dec.sign) snprintf((char *) *retValue, bufsize, @@ -5863,7 +5867,9 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) case XML_SCHEMAS_GMONTH: { /* TODO: Unclear in XML Schema 1.0 */ /* TODO: What to do with the timezone? */ - *retValue = xmlMalloc(5); + *retValue = xmlMalloc(6); + if (*retValue == NULL) + return(-1); snprintf((char *) *retValue, 6, "--%02u", val->value.date.mon); } @@ -5872,6 +5878,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) /* TODO: Unclear in XML Schema 1.0 */ /* TODO: What to do with the timezone? */ *retValue = xmlMalloc(6); + if (*retValue == NULL) + return(-1); snprintf((char *) *retValue, 6, "---%02u", val->value.date.day); } @@ -5880,6 +5888,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) /* TODO: Unclear in XML Schema 1.0 */ /* TODO: What to do with the timezone? */ *retValue = xmlMalloc(8); + if (*retValue == NULL) + return(-1); snprintf((char *) *retValue, 8, "--%02u-%02u", val->value.date.mon, val->value.date.day); } @@ -6024,6 +6034,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) *retValue = BAD_CAST xmlStrdup(BAD_CAST "???"); return (1); } + if (*retValue == NULL) + return(-1); return (0); } diff --git a/xmlwriter.c b/xmlwriter.c index 43934b3..74838e6 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -91,6 +91,7 @@ struct _xmlTextWriter { char qchar; /* character used for quoting attribute values */ xmlParserCtxtPtr ctxt; int no_doc_free; + xmlDocPtr doc; }; static void xmlFreeTextWriterStackEntry(xmlLinkPtr lk); @@ -215,6 +216,9 @@ xmlNewTextWriter(xmlOutputBufferPtr out) "xmlNewTextWriter : out of memory!\n"); return NULL; } + + ret->doc = xmlNewDoc(NULL); + ret->no_doc_free = 0; return ret; @@ -487,6 +491,9 @@ xmlFreeTextWriter(xmlTextWriterPtr writer) xmlFreeParserCtxt(writer->ctxt); } + if (writer->doc != NULL) + xmlFreeDoc(writer->doc); + if (writer->ichar != NULL) xmlFree(writer->ichar); xmlFree(writer); @@ -539,6 +546,8 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version, if (encoder != NULL) { writer->out->conv = xmlBufferCreateSize(4000); xmlCharEncOutFunc(encoder, writer->out->conv, NULL); + if ((writer->doc != NULL) && (writer->doc->encoding == NULL)) + writer->doc->encoding = xmlStrdup((xmlChar *)writer->out->encoder->name); } else writer->out->conv = NULL; @@ -1425,7 +1434,7 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content) break; case XML_TEXTWRITER_ATTRIBUTE: buf = NULL; - xmlAttrSerializeTxtContent(writer->out->buffer, NULL, + xmlAttrSerializeTxtContent(writer->out->buffer, writer->doc, NULL, content); break; default: diff --git a/xpath.c b/xpath.c index c6c2274..8964628 100644 --- a/xpath.c +++ b/xpath.c @@ -64,18 +64,6 @@ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); -/* -* XP_PATTERN_TO_ANY_NODE_ENABLED: when an XPath expression can be -* evaluated using the streaming mode (pattern.c) then this is used to -* enable resolution to nodes of type text-node, cdata-section-node, -* comment-node and pi-node. The only known scenario where this is -* needed is an expression like "foo//.", "//.", etc.; i.e. an expression -* where the final node to be selected can be of any type. -* Disabling this #define will result in an incorrect evaluation to -* only element-nodes and the document node. -*/ -#define XP_PATTERN_TO_ANY_NODE_ENABLED - /* * XP_OPTIMIZED_NON_ELEM_COMPARISON: * If defined, this will use xmlXPathCmpNodesExt() instead of @@ -109,15 +97,6 @@ */ #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -/************************************************************************ - * * - * Forward declarations * - * * - ************************************************************************/ -static void -xmlXPathFreeValueTree(xmlNodeSetPtr obj); -static void -xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj); /************************************************************************ * * @@ -606,6 +585,23 @@ struct _xmlXPathCompExpr { #endif }; +/************************************************************************ + * * + * Forward declarations * + * * + ************************************************************************/ +static void +xmlXPathFreeValueTree(xmlNodeSetPtr obj); +static void +xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj); +static int +xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, xmlNodePtr *first); +static int +xmlXPathCompOpEvalToBoolean(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + int isPredicate); + /************************************************************************ * * * Parser Type functions * @@ -736,6 +732,7 @@ xmlXPathCompExprAdd(xmlXPathCompExprPtr comp, int ch1, int ch2, comp->steps = real; } comp->last = comp->nbStep; + comp->steps[comp->nbStep].rewriteType = 0; comp->steps[comp->nbStep].ch1 = ch1; comp->steps[comp->nbStep].ch2 = ch2; comp->steps[comp->nbStep].op = op; @@ -2327,22 +2324,20 @@ xmlXPathCacheObjectCopy(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) if (val == NULL) return(NULL); - switch (val->type) { - case XPATH_NODESET: - if (XP_HAS_CACHE(ctxt)) + if (XP_HAS_CACHE(ctxt)) { + switch (val->type) { + case XPATH_NODESET: return(xmlXPathCacheWrapNodeSet(ctxt, xmlXPathNodeSetMerge(NULL, val->nodesetval))); - case XPATH_STRING: - if (XP_HAS_CACHE(ctxt)) + case XPATH_STRING: return(xmlXPathCacheNewString(ctxt, val->stringval)); - case XPATH_BOOLEAN: - if (XP_HAS_CACHE(ctxt)) + case XPATH_BOOLEAN: return(xmlXPathCacheNewBoolean(ctxt, val->boolval)); - case XPATH_NUMBER: - if (XP_HAS_CACHE(ctxt)) - return(xmlXPathCacheNewFloat(ctxt, val->floatval)); - default: - break; + case XPATH_NUMBER: + return(xmlXPathCacheNewFloat(ctxt, val->floatval)); + default: + break; + } } return(xmlXPathObjectCopy(val)); } @@ -3399,6 +3394,37 @@ xmlXPathNodeSetCreate(xmlNodePtr val) { return(ret); } +/** + * xmlXPathNodeSetCreateSize: + * @size: the initial size of the set + * + * Create a new xmlNodeSetPtr of type double and of value @val + * + * Returns the newly created object. + */ +static xmlNodeSetPtr +xmlXPathNodeSetCreateSize(int size) { + xmlNodeSetPtr ret; + + ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet)); + if (ret == NULL) { + xmlXPathErrMemory(NULL, "creating nodeset\n"); + return(NULL); + } + memset(ret, 0 , (size_t) sizeof(xmlNodeSet)); + if (size < XML_NODESET_DEFAULT) + size = XML_NODESET_DEFAULT; + ret->nodeTab = (xmlNodePtr *) xmlMalloc(size * sizeof(xmlNodePtr)); + if (ret->nodeTab == NULL) { + xmlXPathErrMemory(NULL, "creating nodeset\n"); + xmlFree(ret); + return(NULL); + } + memset(ret->nodeTab, 0 , size * (size_t) sizeof(xmlNodePtr)); + ret->nodeMax = size; + return(ret); +} + /** * xmlXPathNodeSetContains: * @cur: the node-set @@ -3717,6 +3743,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { return(val1); } +#if 0 /* xmlXPathNodeSetMergeUnique() is currently not used anymore */ /** * xmlXPathNodeSetMergeUnique: * @val1: the first NodeSet or NULL @@ -3775,6 +3802,188 @@ xmlXPathNodeSetMergeUnique(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { return(val1); } +#endif /* xmlXPathNodeSetMergeUnique() is currently not used anymore */ + +/** + * xmlXPathNodeSetMergeAndClear: + * @set1: the first NodeSet or NULL + * @set2: the second NodeSet + * @hasSet2NsNodes: 1 if set2 contains namespaces nodes + * + * Merges two nodesets, all nodes from @set2 are added to @set1 + * if @set1 is NULL, a new set is created and copied from @set2. + * Checks for duplicate nodes. Clears set2. + * + * Returns @set1 once extended or NULL in case of error. + */ +static xmlNodeSetPtr +xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2, + int hasNullEntries) +{ + if ((set1 == NULL) && (hasNullEntries == 0)) { + /* + * Note that doing a memcpy of the list, namespace nodes are + * just assigned to set1, since set2 is cleared anyway. + */ + set1 = xmlXPathNodeSetCreateSize(set2->nodeNr); + if (set1 == NULL) + return(NULL); + if (set2->nodeNr != 0) { + memcpy(set1->nodeTab, set2->nodeTab, + set2->nodeNr * sizeof(xmlNodePtr)); + set1->nodeNr = set2->nodeNr; + } + } else { + int i, j, initNbSet1; + xmlNodePtr n1, n2; + + if (set1 == NULL) + set1 = xmlXPathNodeSetCreate(NULL); + + initNbSet1 = set1->nodeNr; + for (i = 0;i < set2->nodeNr;i++) { + n2 = set2->nodeTab[i]; + /* + * Skip NULLed entries. + */ + if (n2 == NULL) + continue; + /* + * Skip duplicates. + */ + for (j = 0; j < initNbSet1; j++) { + n1 = set1->nodeTab[j]; + if (n1 == n2) { + goto skip_node; + } else if ((n1->type == XML_NAMESPACE_DECL) && + (n2->type == XML_NAMESPACE_DECL)) + { + if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) && + (xmlStrEqual(((xmlNsPtr) n1)->prefix, + ((xmlNsPtr) n2)->prefix))) + { + /* + * Free the namespace node. + */ + set2->nodeTab[i] = NULL; + xmlXPathNodeSetFreeNs((xmlNsPtr) n2); + goto skip_node; + } + } + } + /* + * grow the nodeTab if needed + */ + if (set1->nodeMax == 0) { + set1->nodeTab = (xmlNodePtr *) xmlMalloc( + XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); + if (set1->nodeTab == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + memset(set1->nodeTab, 0, + XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); + set1->nodeMax = XML_NODESET_DEFAULT; + } else if (set1->nodeNr >= set1->nodeMax) { + xmlNodePtr *temp; + + set1->nodeMax *= 2; + temp = (xmlNodePtr *) xmlRealloc( + set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + set1->nodeTab = temp; + } + if (n2->type == XML_NAMESPACE_DECL) { + xmlNsPtr ns = (xmlNsPtr) n2; + + set1->nodeTab[set1->nodeNr++] = + xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); + } else + set1->nodeTab[set1->nodeNr++] = n2; +skip_node: + {} + } + } + set2->nodeNr = 0; + return(set1); +} + +/** + * xmlXPathNodeSetMergeAndClearNoDupls: + * @set1: the first NodeSet or NULL + * @set2: the second NodeSet + * @hasSet2NsNodes: 1 if set2 contains namespaces nodes + * + * Merges two nodesets, all nodes from @set2 are added to @set1 + * if @set1 is NULL, a new set is created and copied from @set2. + * Doesn't chack for duplicate nodes. Clears set2. + * + * Returns @set1 once extended or NULL in case of error. + */ +static xmlNodeSetPtr +xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2, + int hasNullEntries) +{ + if (set2 == NULL) + return(set1); + if ((set1 == NULL) && (hasNullEntries == 0)) { + /* + * Note that doing a memcpy of the list, namespace nodes are + * just assigned to set1, since set2 is cleared anyway. + */ + set1 = xmlXPathNodeSetCreateSize(set2->nodeNr); + if (set1 == NULL) + return(NULL); + if (set2->nodeNr != 0) { + memcpy(set1->nodeTab, set2->nodeTab, + set2->nodeNr * sizeof(xmlNodePtr)); + set1->nodeNr = set2->nodeNr; + } + } else { + int i; + xmlNodePtr n2; + + if (set1 == NULL) + set1 = xmlXPathNodeSetCreate(NULL); + + for (i = 0;i < set2->nodeNr;i++) { + n2 = set2->nodeTab[i]; + /* + * Skip NULLed entries. + */ + if (n2 == NULL) + continue; + if (set1->nodeMax == 0) { + set1->nodeTab = (xmlNodePtr *) xmlMalloc( + XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); + if (set1->nodeTab == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + memset(set1->nodeTab, 0, + XML_NODESET_DEFAULT * (size_t) sizeof(xmlNodePtr)); + set1->nodeMax = XML_NODESET_DEFAULT; + } else if (set1->nodeNr >= set1->nodeMax) { + xmlNodePtr *temp; + + set1->nodeMax *= 2; + temp = (xmlNodePtr *) xmlRealloc( + set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr)); + if (temp == NULL) { + xmlXPathErrMemory(NULL, "merging nodeset\n"); + return(NULL); + } + set1->nodeTab = temp; + } + set1->nodeTab[set1->nodeNr++] = n2; + } + } + set2->nodeNr = 0; + return(set1); +} /** * xmlXPathNodeSetDel: @@ -3857,32 +4066,59 @@ xmlXPathFreeNodeSet(xmlNodeSetPtr obj) { /** * xmlXPathNodeSetClear: - * @set: the xmlNodeSetPtr to free + * @set: the node set to clear * * Clears the list from all temporary XPath objects (e.g. namespace nodes * are feed), but does *not* free the list itself. Sets the length of the * list to 0. */ static void -xmlXPathNodeSetClear(xmlNodeSetPtr set) -{ - int i; - xmlNodePtr node; - +xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes) +{ if ((set == NULL) || (set->nodeNr <= 0)) return; - - for (i = 0; i < set->nodeNr; i++) { - node = set->nodeTab[i]; - if ((node != NULL) && - (node->type == XML_NAMESPACE_DECL)) - { - xmlXPathNodeSetFreeNs((xmlNsPtr) node); - } + else if (hasNsNodes) { + int i; + xmlNodePtr node; + + for (i = 0; i < set->nodeNr; i++) { + node = set->nodeTab[i]; + if ((node != NULL) && + (node->type == XML_NAMESPACE_DECL)) + xmlXPathNodeSetFreeNs((xmlNsPtr) node); + } } set->nodeNr = 0; } +/** + * xmlXPathNodeSetClearFromPos: + * @set: the node set to be cleared + * @pos: the start position to clear from + * + * Clears the list from temporary XPath objects (e.g. namespace nodes + * are feed) starting with the entry at @pos, but does *not* free the list + * itself. Sets the length of the list to @pos. + */ +static void +xmlXPathNodeSetClearFromPos(xmlNodeSetPtr set, int pos, int hasNsNodes) +{ + if ((set == NULL) || (set->nodeNr <= 0) || (pos >= set->nodeNr)) + return; + else if ((hasNsNodes)) { + int i; + xmlNodePtr node; + + for (i = pos; i < set->nodeNr; i++) { + node = set->nodeTab[i]; + if ((node != NULL) && + (node->type == XML_NAMESPACE_DECL)) + xmlXPathNodeSetFreeNs((xmlNsPtr) node); + } + } + set->nodeNr = pos; +} + /** * xmlXPathFreeValueTree: * @obj: the xmlNodeSetPtr to free @@ -5361,9 +5597,8 @@ xmlXPathCastNodeSetToString (xmlNodeSetPtr ns) { * * Converts an existing object to its string() equivalent * - * Returns the string value of the object, NULL in case of error. - * A new string is allocated only if needed (@val isn't a - * string object). + * Returns the allocated string value of the object, NULL in case of error. + * It's up to the caller to free the string memory with xmlFree(). */ xmlChar * xmlXPathCastToString(xmlXPathObjectPtr val) { @@ -5795,6 +6030,17 @@ xmlXPathFreeContext(xmlXPathContextPtr ctxt) { return(NULL); \ } \ +#define CHECK_CTXT_NEG(ctxt) \ + if (ctxt == NULL) { \ + __xmlRaiseError(NULL, NULL, NULL, \ + NULL, NULL, XML_FROM_XPATH, \ + XML_ERR_INTERNAL_ERROR, XML_ERR_FATAL, \ + __FILE__, __LINE__, \ + NULL, NULL, NULL, 0, 0, \ + "NULL context pointer\n"); \ + return(-1); \ + } \ + #define CHECK_CONTEXT(ctxt) \ if ((ctxt == NULL) || (ctxt->doc == NULL) || \ @@ -7221,6 +7467,13 @@ typedef xmlNodePtr (*xmlXPathTraversalFunction) typedef xmlNodePtr (*xmlXPathTraversalFunctionExt) (xmlNodePtr cur, xmlNodePtr contextNode); +/* + * xmlXPathNodeSetMergeFunction: + * Used for merging node sets in xmlXPathCollectAndTest(). + */ +typedef xmlNodeSetPtr (*xmlXPathNodeSetMergeFunction) + (xmlNodeSetPtr, xmlNodeSetPtr, int); + /** * xmlXPathNextSelf: @@ -10602,7 +10855,19 @@ xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) { SKIP_BLANKS; ctxt->comp->last = -1; - xmlXPathCompileExpr(ctxt, 1); + /* + * This call to xmlXPathCompileExpr() will deactivate sorting + * of the predicate result. + * TODO: Sorting is still activated for filters, since I'm not + * sure if needed. Normally sorting should not be needed, since + * a filter can only diminish the number of items in a sequence, + * but won't change its order; so if the initial sequence is sorted, + * subsequent sorting is not needed. + */ + if (! filter) + xmlXPathCompileExpr(ctxt, 0); + else + xmlXPathCompileExpr(ctxt, 1); CHECK_ERROR; if (CUR != ']') { @@ -11092,201 +11357,60 @@ xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) { static int xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op); -/** - * xmlXPathNodeCollectAndTest: - * @ctxt: the XPath Parser context - * @op: the XPath precompiled step operation - * @first: pointer to the first element in document order - * @last: pointer to the last element in document order - * - * This is the function implementing a step: based on the current list - * of nodes, it builds up a new list, looking at all nodes under that - * axis and selecting them. It also does the predicate filtering - * - * Pushes the new NodeSet resulting from the search. - * - * Returns the number of nodes traversed - */ -static int -xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, - xmlXPathStepOpPtr op, - xmlNodePtr * first, xmlNodePtr * last) -{ - xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value; - xmlXPathTestVal test = (xmlXPathTestVal) op->value2; - xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3; - const xmlChar *prefix = op->value4; - const xmlChar *name = op->value5; - const xmlChar *URI = NULL; - -#ifdef DEBUG_STEP - int nbMatches = 0; -#endif - int inputIdx, total = 0, specialNodeInSet = 0; - xmlNodeSetPtr inputList, resultList, list; - xmlXPathTraversalFunction next = NULL; - xmlXPathTraversalFunctionExt compoundNext = NULL; - void (*addNode) (xmlNodeSetPtr, xmlNodePtr); - xmlNodeSetPtr (*mergeNodeSet) (xmlNodeSetPtr, xmlNodeSetPtr); - xmlNodePtr oldContextNode, contextNode, cur, compoundContextNode; - xmlXPathObjectPtr obj; - xmlXPathContextPtr xpctxt = ctxt->context; - - CHECK_TYPE0(XPATH_NODESET); - obj = valuePop(ctxt); - - /* - * Setup wrt namespaces. - */ - if (prefix != NULL) { - URI = xmlXPathNsLookup(xpctxt, prefix); - if (URI == NULL) { - xmlXPathFreeObject(obj); - XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR); - } - } - #ifdef DEBUG_STEP +static void +xmlXPathDebugDumpStepAxis(xmlXPathAxisVal axis, + xmlXPathTestVal test, + int nbNodes) +{ xmlGenericError(xmlGenericErrorContext, "new step : "); -#endif - - /* - * Setup wrt the axis. - */ - addNode = xmlXPathNodeSetAdd; - mergeNodeSet = xmlXPathNodeSetMerge; switch (axis) { case AXIS_ANCESTOR: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'ancestors' "); -#endif - first = NULL; - next = xmlXPathNextAncestor; break; case AXIS_ANCESTOR_OR_SELF: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'ancestors-or-self' "); -#endif - first = NULL; - next = xmlXPathNextAncestorOrSelf; break; case AXIS_ATTRIBUTE: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'attributes' "); -#endif - first = NULL; - last = NULL; - next = xmlXPathNextAttribute; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; case AXIS_CHILD: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'child' "); -#endif - last = NULL; - if (op->rewriteType == XP_REWRITE_DOS_CHILD_ELEM) { - /* - * This iterator will give us only nodes which can - * hold element nodes. - */ - compoundNext = xmlXPathNextDescendantOrSelfElemParent; - } - if ((test == NODE_TEST_NAME) && (type == NODE_TYPE_NODE)) { - /* - * Optimization if an element node type is 'element'. - */ - next = xmlXPathNextChildElement; - } else - next = xmlXPathNextChild; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; case AXIS_DESCENDANT: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'descendant' "); -#endif - last = NULL; - next = xmlXPathNextDescendant; break; case AXIS_DESCENDANT_OR_SELF: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'descendant-or-self' "); -#endif - last = NULL; - next = xmlXPathNextDescendantOrSelf; break; case AXIS_FOLLOWING: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'following' "); -#endif - last = NULL; - next = xmlXPathNextFollowing; break; case AXIS_FOLLOWING_SIBLING: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'following-siblings' "); -#endif - last = NULL; - next = xmlXPathNextFollowingSibling; break; case AXIS_NAMESPACE: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'namespace' "); -#endif - first = NULL; - last = NULL; - next = (xmlXPathTraversalFunction) xmlXPathNextNamespace; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; case AXIS_PARENT: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'parent' "); -#endif - first = NULL; - next = xmlXPathNextParent; break; case AXIS_PRECEDING: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'preceding' "); -#endif - first = NULL; - next = xmlXPathNextPrecedingInternal; break; case AXIS_PRECEDING_SIBLING: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'preceding-sibling' "); -#endif - first = NULL; - next = xmlXPathNextPrecedingSibling; break; case AXIS_SELF: -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, "axis 'self' "); -#endif - first = NULL; - last = NULL; - next = xmlXPathNextSelf; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; } - if (next == NULL) { - xmlXPathReleaseObject(xpctxt, obj); - return(0); - } - - inputList = obj->nodesetval; - if ((inputList == NULL) || (inputList->nodeNr <= 0)) { - xmlXPathReleaseObject(xpctxt, obj); - valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, NULL)); - return(0); - } - -#ifdef DEBUG_STEP xmlGenericError(xmlGenericErrorContext, - " context contains %d nodes\n", nodelist->nodeNr); + " context contains %d nodes\n", nbNodes); switch (test) { case NODE_TEST_NONE: xmlGenericError(xmlGenericErrorContext, @@ -11318,561 +11442,638 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, break; } xmlGenericError(xmlGenericErrorContext, "Testing : "); -#endif - /* - * 2.3 Node Tests - * - For the attribute axis, the principal node type is attribute. - * - For the namespace axis, the principal node type is namespace. - * - For other axes, the principal node type is element. - * - * A node test * is true for any node of the - * principal node type. For example, child::* will - * select all element children of the context node - */ - oldContextNode = xpctxt->node; - addNode = xmlXPathNodeSetAddUnique; - resultList = NULL; - list = NULL; - compoundContextNode = NULL; - contextNode = NULL; - inputIdx = 0; +} +#endif /* DEBUG_STEP */ - while ((inputIdx < inputList->nodeNr) || (contextNode != NULL)) { - if (compoundNext != NULL) { +static int +xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + xmlNodeSetPtr set, + int contextSize, + int hasNsNodes) +{ + if (op->ch1 != -1) { + xmlXPathCompExprPtr comp = ctxt->comp; + /* + * Process inner predicates first. + */ + if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) { /* - * This is a compound traversal. + * TODO: raise an internal error. */ - if (contextNode == NULL) { - /* - * Set the context for the initial traversal. - */ - compoundContextNode = inputList->nodeTab[inputIdx++]; - contextNode = compoundNext(NULL, compoundContextNode); - } else - contextNode = compoundNext(contextNode, compoundContextNode); - if (contextNode == NULL) + } + contextSize = xmlXPathCompOpEvalPredicate(ctxt, + &comp->steps[op->ch1], set, contextSize, hasNsNodes); + CHECK_ERROR0; + if (contextSize <= 0) + return(0); + } + if (op->ch2 != -1) { + xmlXPathContextPtr xpctxt = ctxt->context; + xmlNodePtr contextNode, oldContextNode; + xmlDocPtr oldContextDoc; + int i, res, contextPos = 0, newContextSize; + xmlXPathStepOpPtr exprOp; + xmlXPathObjectPtr contextObj = NULL, exprRes = NULL; + +#ifdef LIBXML_XPTR_ENABLED + /* + * URGENT TODO: Check the following: + * We don't expect location sets if evaluating prediates, right? + * Only filters should expect location sets, right? + */ +#endif + /* + * SPEC XPath 1.0: + * "For each node in the node-set to be filtered, the + * PredicateExpr is evaluated with that node as the + * context node, with the number of nodes in the + * node-set as the context size, and with the proximity + * position of the node in the node-set with respect to + * the axis as the context position;" + * @oldset is the node-set" to be filtered. + * + * SPEC XPath 1.0: + * "only predicates change the context position and + * context size (see [2.4 Predicates])." + * Example: + * node-set context pos + * nA 1 + * nB 2 + * nC 3 + * After applying predicate [position() > 1] : + * node-set context pos + * nB 1 + * nC 2 + */ + oldContextNode = xpctxt->node; + oldContextDoc = xpctxt->doc; + /* + * Get the expression of this predicate. + */ + exprOp = &ctxt->comp->steps[op->ch2]; + newContextSize = 0; + for (i = 0; i < set->nodeNr; i++) { + if (set->nodeTab[i] == NULL) continue; + + contextNode = set->nodeTab[i]; + xpctxt->node = contextNode; + xpctxt->contextSize = contextSize; + xpctxt->proximityPosition = ++contextPos; + + /* + * Also set the xpath document in case things like + * key() are evaluated in the predicate. + */ + if ((contextNode->type != XML_NAMESPACE_DECL) && + (contextNode->doc != NULL)) + xpctxt->doc = contextNode->doc; /* - * Set the context for the main traversal. + * Evaluate the predicate expression with 1 context node + * at a time; this node is packaged into a node set; this + * node set is handed over to the evaluation mechanism. */ - xpctxt->node = contextNode; - } else - xpctxt->node = inputList->nodeTab[inputIdx++]; - - if (list == NULL) { - list = xmlXPathNodeSetCreate(NULL); - if (list == NULL) { - total = 0; - goto error; - } - } - cur = NULL; - specialNodeInSet = 0; - do { - cur = next(ctxt, cur); - if (cur == NULL) - break; + if (contextObj == NULL) + contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); + else + xmlXPathNodeSetAddUnique(contextObj->nodesetval, + contextNode); - if (first != NULL) { - if (*first == cur) - break; - if ((*first != NULL) && - ((total % 256) == 0) && -#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON - (xmlXPathCmpNodesExt(*first, cur) >= 0)) -#else - (xmlXPathCmpNodes(*first, cur) >= 0)) -#endif - { - break; - } + valuePush(ctxt, contextObj); + + res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); + + if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) + goto evaluation_error; + + if (res != 0) { + newContextSize++; + } else { + /* + * Remove the entry from the initial node set. + */ + set->nodeTab[i] = NULL; + if (contextNode->type == XML_NAMESPACE_DECL) + xmlXPathNodeSetFreeNs((xmlNsPtr) contextNode); } - if (last != NULL) { - if (*last == cur) - break; - if ((*last != NULL) && - ((total % 256) == 0) && -#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON - (xmlXPathCmpNodesExt(cur, *last) >= 0)) -#else - (xmlXPathCmpNodes(cur, *last) >= 0)) -#endif - { - break; - } + if (ctxt->value == contextObj) { + /* + * Don't free the temporary XPath object holding the + * context node, in order to avoid massive recreation + * inside this loop. + */ + valuePop(ctxt); + xmlXPathNodeSetClear(contextObj->nodesetval, hasNsNodes); + } else { + /* + * TODO: The object was lost in the evaluation machinery. + * Can this happen? Maybe in internal-error cases. + */ + contextObj = NULL; } + } + goto evaluation_exit; - total++; -#ifdef DEBUG_STEP - xmlGenericError(xmlGenericErrorContext, " %s", cur->name); -#endif - switch (test) { - case NODE_TEST_NONE: - STRANGE - goto error; - case NODE_TEST_TYPE: - if ((cur->type == type) || - ((type == NODE_TYPE_NODE) && - ((cur->type == XML_DOCUMENT_NODE) || - (cur->type == XML_HTML_DOCUMENT_NODE) || - (cur->type == XML_ELEMENT_NODE) || - (cur->type == XML_NAMESPACE_DECL) || - (cur->type == XML_ATTRIBUTE_NODE) || - (cur->type == XML_PI_NODE) || - (cur->type == XML_COMMENT_NODE) || - (cur->type == XML_CDATA_SECTION_NODE) || - (cur->type == XML_TEXT_NODE))) || - ((type == NODE_TYPE_TEXT) && - (cur->type == XML_CDATA_SECTION_NODE))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - if (cur->type == XML_NAMESPACE_DECL) - specialNodeInSet = 1; - /* - * TODO: Don't we need to use xmlXPathNodeSetAddNs() - * for namespace nodes here ? - */ - addNode(list, cur); - } - break; - case NODE_TEST_PI: - if ((cur->type == XML_PI_NODE) && - ((name == NULL) || xmlStrEqual(name, cur->name))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } - break; - case NODE_TEST_ALL: - if (axis == AXIS_ATTRIBUTE) { - if (cur->type == XML_ATTRIBUTE_NODE) { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } - } else if (axis == AXIS_NAMESPACE) { - if (cur->type == XML_NAMESPACE_DECL) { -#ifdef DEBUG_STEP - nbMatches++; -#endif - specialNodeInSet = 1; - xmlXPathNodeSetAddNs(list, xpctxt->node, - (xmlNsPtr) cur); - } - } else { - if (cur->type == XML_ELEMENT_NODE) { - if (prefix == NULL) { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } else if ((cur->ns != NULL) && - (xmlStrEqual(URI, cur->ns->href))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } - } - } - break; - case NODE_TEST_NS:{ - TODO; - break; - } - case NODE_TEST_NAME: - switch (cur->type) { - case XML_ELEMENT_NODE: - if (xmlStrEqual(name, cur->name)) { - if (prefix == NULL) { - if (cur->ns == NULL) { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } - } else { - if ((cur->ns != NULL) && - (xmlStrEqual(URI, - cur->ns->href))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, cur); - } - } - } - break; - case XML_ATTRIBUTE_NODE:{ - xmlAttrPtr attr = (xmlAttrPtr) cur; +evaluation_error: + xmlXPathNodeSetClear(set, hasNsNodes); + newContextSize = 0; - if (xmlStrEqual(name, attr->name)) { - if (prefix == NULL) { - if ((attr->ns == NULL) || - (attr->ns->prefix == NULL)) { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, - (xmlNodePtr) attr); - } - } else { - if ((attr->ns != NULL) && - (xmlStrEqual(URI, - attr->ns-> - href))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - addNode(list, - (xmlNodePtr) attr); - } - } - } - break; - } - case XML_NAMESPACE_DECL: - if (cur->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr) cur; +evaluation_exit: + if (contextObj != NULL) { + if (ctxt->value == contextObj) + valuePop(ctxt); + xmlXPathReleaseObject(xpctxt, contextObj); + } + if (exprRes != NULL) + xmlXPathReleaseObject(ctxt->context, exprRes); + /* + * Reset/invalidate the context. + */ + xpctxt->node = oldContextNode; + xpctxt->doc = oldContextDoc; + xpctxt->contextSize = -1; + xpctxt->proximityPosition = -1; + return(newContextSize); + } + return(contextSize); +} - if ((ns->prefix != NULL) && (name != NULL) - && (xmlStrEqual(ns->prefix, name))) - { -#ifdef DEBUG_STEP - nbMatches++; -#endif - specialNodeInSet = 1; - xmlXPathNodeSetAddNs(list, - xpctxt->node, (xmlNsPtr) cur); - } - } - break; - default: - break; - } /* switch (cur->type) */ - break; /* case NODE_TEST_NAME: */ - } /* switch (test) */ - } while (cur != NULL); +static int +xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + xmlNodeSetPtr set, + int contextSize, + int minPos, + int maxPos, + int hasNsNodes) +{ + if (op->ch1 != -1) { + xmlXPathCompExprPtr comp = ctxt->comp; + if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) { + /* + * TODO: raise an internal error. + */ + } + contextSize = xmlXPathCompOpEvalPredicate(ctxt, + &comp->steps[op->ch1], set, contextSize, hasNsNodes); + CHECK_ERROR0; + if (contextSize <= 0) + return(0); + } + /* + * Check if the node set contains a sufficient number of nodes for + * the requested range. + */ + if (contextSize < minPos) { + xmlXPathNodeSetClear(set, hasNsNodes); + return(0); + } + if (op->ch2 == -1) { + /* + * TODO: Can this ever happen? + */ + return (contextSize); + } else { + xmlDocPtr oldContextDoc; + int i, pos = 0, newContextSize = 0, contextPos = 0, res; + xmlXPathStepOpPtr exprOp; + xmlXPathObjectPtr contextObj = NULL, exprRes = NULL; + xmlNodePtr oldContextNode, contextNode = NULL; + xmlXPathContextPtr xpctxt = ctxt->context; - /* - * If there is some predicate filtering do it now - */ - if ((op->ch2 != -1) && (list != NULL) && (list->nodeNr > 0)) { - xmlXPathObjectPtr obj2; +#ifdef LIBXML_XPTR_ENABLED + /* + * URGENT TODO: Check the following: + * We don't expect location sets if evaluating prediates, right? + * Only filters should expect location sets, right? + */ +#endif /* LIBXML_XPTR_ENABLED */ - valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, list)); - xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch2]); - CHECK_TYPE0(XPATH_NODESET); - obj2 = valuePop(ctxt); - list = obj2->nodesetval; - obj2->nodesetval = NULL; - xmlXPathReleaseObject(xpctxt, obj2); + /* + * Save old context. + */ + oldContextNode = xpctxt->node; + oldContextDoc = xpctxt->doc; + /* + * Get the expression of this predicate. + */ + exprOp = &ctxt->comp->steps[op->ch2]; + for (i = 0; i < set->nodeNr; i++) { + if (set->nodeTab[i] == NULL) + continue; - if (ctxt->error != XPATH_EXPRESSION_OK) { - total = 0; - goto error; - } - } - if (resultList == NULL) { - resultList = list; - list = NULL; - } else if ((list != NULL) && (list->nodeNr > 0)) { - resultList = mergeNodeSet(resultList, list); + contextNode = set->nodeTab[i]; + xpctxt->node = contextNode; + xpctxt->contextSize = contextSize; + xpctxt->proximityPosition = ++contextPos; + /* - * This is the list containing the current matching nodes. - * Avoid massive creation/freeing and preserve it for the - * next iterations. + * Initialize the new set. + * Also set the xpath document in case things like + * key() evaluation are attempted on the predicate */ - /* If a namespace node was put it, then we need a more - * time consuming cleanup. + if ((contextNode->type != XML_NAMESPACE_DECL) && + (contextNode->doc != NULL)) + xpctxt->doc = contextNode->doc; + /* + * Evaluate the predicate expression with 1 context node + * at a time; this node is packaged into a node set; this + * node set is handed over to the evaluation mechanism. */ - if (specialNodeInSet) - xmlXPathNodeSetClear(list); + if (contextObj == NULL) + contextObj = xmlXPathCacheNewNodeSet(xpctxt, contextNode); else - list->nodeNr = 0; - } + xmlXPathNodeSetAddUnique(contextObj->nodesetval, + contextNode); + + valuePush(ctxt, contextObj); + res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1); + + if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) + goto evaluation_error; + + if (res) + pos++; + + if (res && (pos >= minPos) && (pos <= maxPos)) { + /* + * Fits in the requested range. + */ + newContextSize++; + if (minPos == maxPos) { + /* + * Only 1 node was requested. + */ + if (contextNode->type == XML_NAMESPACE_DECL) { + /* + * As always: take care of those nasty + * namespace nodes. + */ + set->nodeTab[i] = NULL; + } + xmlXPathNodeSetClear(set, hasNsNodes); + set->nodeNr = 1; + set->nodeTab[0] = contextNode; + goto evaluation_exit; + } + if (pos == maxPos) { + /* + * We are done. + */ + xmlXPathNodeSetClearFromPos(set, i +1, hasNsNodes); + goto evaluation_exit; + } + } else { + /* + * Remove the entry from the initial node set. + */ + set->nodeTab[i] = NULL; + if (contextNode->type == XML_NAMESPACE_DECL) + xmlXPathNodeSetFreeNs((xmlNsPtr) contextNode); + } + if (exprRes != NULL) { + xmlXPathReleaseObject(ctxt->context, exprRes); + exprRes = NULL; + } + if (ctxt->value == contextObj) { + /* + * Don't free the temporary XPath object holding the + * context node, in order to avoid massive recreation + * inside this loop. + */ + valuePop(ctxt); + xmlXPathNodeSetClear(contextObj->nodesetval, hasNsNodes); + } else { + /* + * The object was lost in the evaluation machinery. + * Can this happen? Maybe in case of internal-errors. + */ + contextObj = NULL; + } + } + goto evaluation_exit; + +evaluation_error: + xmlXPathNodeSetClear(set, hasNsNodes); + newContextSize = 0; + +evaluation_exit: + if (contextObj != NULL) { + if (ctxt->value == contextObj) + valuePop(ctxt); + xmlXPathReleaseObject(xpctxt, contextObj); + } + if (exprRes != NULL) + xmlXPathReleaseObject(ctxt->context, exprRes); + /* + * Reset/invalidate the context. + */ + xpctxt->node = oldContextNode; + xpctxt->doc = oldContextDoc; + xpctxt->contextSize = -1; + xpctxt->proximityPosition = -1; + return(newContextSize); } + return(contextSize); +} + +static int +xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + int *maxPos) +{ + + xmlXPathStepOpPtr exprOp; - xpctxt->node = oldContextNode; /* - * Cleanup the temporary list of current node-test matches. + * BIG NOTE: This is not intended for XPATH_OP_FILTER yet! */ - if ((list != NULL) && (list != resultList)) { - xmlXPathFreeNodeSet(list); - list = NULL; - } -#ifdef DEBUG_STEP - xmlGenericError(xmlGenericErrorContext, - "\nExamined %d nodes, found %d nodes at that step\n", - total, nbMatches); -#endif + /* + * If not -1, then ch1 will point to: + * 1) For predicates (XPATH_OP_PREDICATE): + * - an inner predicate operator + * 2) For filters (XPATH_OP_FILTER): + * - an inner filter operater OR + * - an expression selecting the node set. + * E.g. "key('a', 'b')" or "(//foo | //bar)". + */ + if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER)) + return(0); - valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, resultList)); + if (op->ch2 != -1) { + exprOp = &ctxt->comp->steps[op->ch2]; + } else + return(0); - if ((obj->boolval) && (obj->user != NULL)) { + if ((exprOp != NULL) && + (exprOp->op == XPATH_OP_VALUE) && + (exprOp->value4 != NULL) && + (((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER)) + { /* - * QUESTION TODO: What does this do and why? + * We have a "[n]" predicate here. + * TODO: Unfortunately this simplistic test here is not + * able to detect a position() predicate in compound + * expressions like "[@attr = 'a" and position() = 1], + * and even not the usage of position() in + * "[position() = 1]"; thus - obviously - a position-range, + * like it "[position() < 5]", is also not detected. + * Maybe we could rewrite the AST to ease the optimization. */ - ctxt->value->boolval = 1; - ctxt->value->user = obj->user; - obj->user = NULL; - obj->boolval = 0; - } - xmlXPathReleaseObject(xpctxt, obj); - return(total); - -error: - xpctxt->node = oldContextNode; - xmlXPathReleaseObject(xpctxt, obj); - if ((list != NULL) && (list != resultList)) { - xmlXPathFreeNodeSet(list); + *maxPos = (int) ((xmlXPathObjectPtr) exprOp->value4)->floatval; + + if (((xmlXPathObjectPtr) exprOp->value4)->floatval == + (float) *maxPos) + { + return(1); + } } - if (resultList != NULL) - xmlXPathFreeNodeSet(resultList); - return(total); + return(0); } -/** - * xmlXPathNodeCollectAndTestNth: - * @ctxt: the XPath Parser context - * @op: the XPath precompiled step operation - * @reqpos: the requested position wrt to the axis - * @first: pointer to the first element in document order - * @last: pointer to the last element in document order - * - * This is the function implementing a step: based on the current list - * of nodes, it builds up a new list, looking at all nodes under that - * axis and selecting them. It also does the predicate filtering - * - * Pushes the new NodeSet resulting from the search. - * Returns the number of node traversed - */ static int -xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, - xmlXPathStepOpPtr op, int reqpos, - xmlNodePtr * first, xmlNodePtr * last) +xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + xmlNodePtr * first, xmlNodePtr * last, + int toBool) { + +#define XP_TEST_HIT \ + if (hasAxisRange != 0) { \ + if (++pos == maxPos) { \ + addNode(seq, cur); \ + goto axis_range_end; } \ + } else { \ + addNode(seq, cur); \ + if (breakOnFirstHit) goto first_hit; } + +#define XP_TEST_HIT_NS \ + if (hasAxisRange != 0) { \ + if (++pos == maxPos) { \ + hasNsNodes = 1; \ + xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur); \ + goto axis_range_end; } \ + } else { \ + hasNsNodes = 1; \ + xmlXPathNodeSetAddNs(seq, \ + xpctxt->node, (xmlNsPtr) cur); \ + if (breakOnFirstHit) goto first_hit; } + xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value; xmlXPathTestVal test = (xmlXPathTestVal) op->value2; xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3; const xmlChar *prefix = op->value4; const xmlChar *name = op->value5; const xmlChar *URI = NULL; - int pos; /* The current context position */ - int inputIdx, total = 0; - xmlNodeSetPtr inputList, list; +#ifdef DEBUG_STEP + int nbMatches = 0, prevMatches = 0; +#endif + int total = 0, hasNsNodes = 0; + /* The popped object holding the context nodes */ + xmlXPathObjectPtr obj; + /* The set of context nodes for the node tests */ + xmlNodeSetPtr contextSeq; + int contextIdx; + xmlNodePtr contextNode; + /* The context node for a compound traversal */ + xmlNodePtr outerContextNode; + /* The final resulting node set wrt to all context nodes */ + xmlNodeSetPtr outSeq; + /* + * The temporary resulting node set wrt 1 context node. + * Used to feed predicate evaluation. + */ + xmlNodeSetPtr seq; + xmlNodePtr cur; + /* First predicate operator */ + xmlXPathStepOpPtr predOp; + int maxPos; /* The requested position() (when a "[n]" predicate) */ + int hasPredicateRange, hasAxisRange, pos, size, newSize; + int breakOnFirstHit; + xmlXPathTraversalFunction next = NULL; - xmlXPathTraversalFunctionExt compoundNext = NULL; + /* compound axis traversal */ + xmlXPathTraversalFunctionExt outerNext = NULL; void (*addNode) (xmlNodeSetPtr, xmlNodePtr); - xmlNodePtr oldContextNode, contextNode, cur, compoundContextNode; - xmlXPathObjectPtr obj; - xmlXPathContextPtr xpctxt = ctxt->context; + xmlXPathNodeSetMergeFunction mergeAndClear; + xmlNodePtr oldContextNode; + xmlXPathContextPtr xpctxt = ctxt->context; CHECK_TYPE0(XPATH_NODESET); obj = valuePop(ctxt); - addNode = xmlXPathNodeSetAdd; - + /* + * Setup namespaces. + */ if (prefix != NULL) { URI = xmlXPathNsLookup(xpctxt, prefix); if (URI == NULL) { - xmlXPathFreeObject(obj); + xmlXPathReleaseObject(xpctxt, obj); XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR); } - } - -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "new step : "); - if (first != NULL) { - if (*first != NULL) - xmlGenericError(xmlGenericErrorContext, "first = %s ", - (*first)->name); - else - xmlGenericError(xmlGenericErrorContext, "first = NULL "); - } - if (last != NULL) { - if (*last != NULL) - xmlGenericError(xmlGenericErrorContext, "last = %s ", - (*last)->name); - else - xmlGenericError(xmlGenericErrorContext, "last = NULL "); - } -#endif + } + /* + * Setup axis. + * + * MAYBE FUTURE TODO: merging optimizations: + * - If the nodes to be traversed wrt to the initial nodes and + * the current axis cannot overlap, then we could avoid searching + * for duplicates during the merge. + * But the question is how/when to evaluate if they cannot overlap. + * Example: if we know that for two initial nodes, the one is + * not in the ancestor-or-self axis of the other, then we could safely + * avoid a duplicate-aware merge, if the axis to be traversed is e.g. + * the descendant-or-self axis. + */ + addNode = xmlXPathNodeSetAdd; + mergeAndClear = xmlXPathNodeSetMergeAndClear; switch (axis) { case AXIS_ANCESTOR: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'ancestors' "); -#endif first = NULL; next = xmlXPathNextAncestor; break; case AXIS_ANCESTOR_OR_SELF: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - "axis 'ancestors-or-self' "); -#endif first = NULL; next = xmlXPathNextAncestorOrSelf; break; case AXIS_ATTRIBUTE: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'attributes' "); -#endif first = NULL; last = NULL; next = xmlXPathNextAttribute; + mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls; break; case AXIS_CHILD: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'child' "); -#endif last = NULL; if (op->rewriteType == XP_REWRITE_DOS_CHILD_ELEM) { /* * This iterator will give us only nodes which can * hold element nodes. */ - compoundNext = xmlXPathNextDescendantOrSelfElemParent; - } - if ((test == NODE_TEST_NAME) && (type == NODE_TYPE_NODE)) { + outerNext = xmlXPathNextDescendantOrSelfElemParent; + } + if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) && + (type == NODE_TYPE_NODE)) + { /* * Optimization if an element node type is 'element'. */ next = xmlXPathNextChildElement; } else - next = xmlXPathNextChild; + next = xmlXPathNextChild; + mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls; break; case AXIS_DESCENDANT: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'descendant' "); -#endif last = NULL; next = xmlXPathNextDescendant; break; case AXIS_DESCENDANT_OR_SELF: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - "axis 'descendant-or-self' "); -#endif last = NULL; next = xmlXPathNextDescendantOrSelf; break; case AXIS_FOLLOWING: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'following' "); -#endif last = NULL; next = xmlXPathNextFollowing; break; case AXIS_FOLLOWING_SIBLING: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - "axis 'following-siblings' "); -#endif last = NULL; next = xmlXPathNextFollowingSibling; break; case AXIS_NAMESPACE: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'namespace' "); -#endif - last = NULL; first = NULL; + last = NULL; next = (xmlXPathTraversalFunction) xmlXPathNextNamespace; + mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls; break; case AXIS_PARENT: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'parent' "); -#endif first = NULL; next = xmlXPathNextParent; break; case AXIS_PRECEDING: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'preceding' "); -#endif first = NULL; next = xmlXPathNextPrecedingInternal; break; case AXIS_PRECEDING_SIBLING: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - "axis 'preceding-sibling' "); -#endif first = NULL; next = xmlXPathNextPrecedingSibling; break; case AXIS_SELF: -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, "axis 'self' "); -#endif first = NULL; last = NULL; next = xmlXPathNextSelf; + mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls; break; } + +#ifdef DEBUG_STEP + xmlXPathDebugDumpStepAxis(axis, test, + (obj->nodesetval != NULL) ? obj->nodsetval->nodeNr : 0); +#endif + if (next == NULL) { - xmlXPathReleaseObject(xpctxt, obj); + xmlXPathReleaseObject(xpctxt, obj); return(0); - } - - inputList = obj->nodesetval; - if ((inputList == NULL) || (inputList->nodeNr <= 0)) { - xmlXPathReleaseObject(xpctxt, obj); - valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, NULL)); + } + contextSeq = obj->nodesetval; + if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) { + xmlXPathReleaseObject(xpctxt, obj); + valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, NULL)); return(0); + } + /* + * Predicate optimization --------------------------------------------- + * If this step has a last predicate, which contains a position(), + * then we'll optimize (although not exactly "position()", but only + * the short-hand form, i.e., "[n]". + * + * Example - expression "/foo[parent::bar][1]": + * + * COLLECT 'child' 'name' 'node' foo -- op (we are here) + * ROOT -- op->ch1 + * PREDICATE -- op->ch2 (predOp) + * PREDICATE -- predOp->ch1 = [parent::bar] + * SORT + * COLLECT 'parent' 'name' 'node' bar + * NODE + * ELEM Object is a number : 1 -- predOp->ch2 = [1] + * + */ + maxPos = 0; + predOp = NULL; + hasPredicateRange = 0; + hasAxisRange = 0; + if (op->ch2 != -1) { + /* + * There's at least one predicate. 16 == XPATH_OP_PREDICATE + */ + predOp = &ctxt->comp->steps[op->ch2]; + if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) { + if (predOp->ch1 != -1) { + /* + * Use the next inner predicate operator. + */ + predOp = &ctxt->comp->steps[predOp->ch1]; + hasPredicateRange = 1; + } else { + /* + * There's no other predicate than the [n] predicate. + */ + predOp = NULL; + hasAxisRange = 1; + } + } } - -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - " context contains %d nodes\n", nodelist->nodeNr); - switch (test) { - case NODE_TEST_NONE: - xmlGenericError(xmlGenericErrorContext, - " searching for none !!!\n"); - break; - case NODE_TEST_TYPE: - xmlGenericError(xmlGenericErrorContext, - " searching for type %d\n", type); - break; - case NODE_TEST_PI: - xmlGenericError(xmlGenericErrorContext, - " searching for PI !!!\n"); - break; - case NODE_TEST_ALL: - xmlGenericError(xmlGenericErrorContext, - " searching for *\n"); - break; - case NODE_TEST_NS: - xmlGenericError(xmlGenericErrorContext, - " searching for namespace %s\n", - prefix); - break; - case NODE_TEST_NAME: - xmlGenericError(xmlGenericErrorContext, - " searching for name %s\n", name); - if (prefix != NULL) - xmlGenericError(xmlGenericErrorContext, - " with namespace %s\n", prefix); - break; - } - xmlGenericError(xmlGenericErrorContext, "Testing : "); -#endif + breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0; + /* + * Axis traversal ----------------------------------------------------- + */ /* * 2.3 Node Tests * - For the attribute axis, the principal node type is attribute. - * - For the namespace axis, the principal node type is namespace. - * - For other axes, the principal node type is element. + * - For the namespace axis, the principal node type is namespace. + * - For other axes, the principal node type is element. * * A node test * is true for any node of the * principal node type. For example, child::* will @@ -11880,25 +12081,26 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, */ oldContextNode = xpctxt->node; addNode = xmlXPathNodeSetAddUnique; - list = NULL; - compoundContextNode = NULL; + outSeq = NULL; + seq = NULL; + outerContextNode = NULL; contextNode = NULL; - inputIdx = 0; - list = xmlXPathNodeSetCreate(NULL); + contextIdx = 0; + - while ((inputIdx < inputList->nodeNr) || (contextNode != NULL)) { - if (compoundNext != NULL) { + while ((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) { + if (outerNext != NULL) { /* * This is a compound traversal. */ if (contextNode == NULL) { /* - * Set the context for the initial traversal. + * Set the context for the outer traversal. */ - compoundContextNode = inputList->nodeTab[inputIdx++]; - contextNode = compoundNext(NULL, compoundContextNode); + outerContextNode = contextSeq->nodeTab[contextIdx++]; + contextNode = outerNext(NULL, outerContextNode); } else - contextNode = compoundNext(contextNode, compoundContextNode); + contextNode = outerNext(contextNode, outerContextNode); if (contextNode == NULL) continue; /* @@ -11906,20 +12108,33 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, */ xpctxt->node = contextNode; } else - xpctxt->node = inputList->nodeTab[inputIdx++]; - - cur = NULL; - pos = 0; + xpctxt->node = contextSeq->nodeTab[contextIdx++]; + + if (seq == NULL) { + seq = xmlXPathNodeSetCreate(NULL); + if (seq == NULL) { + total = 0; + goto error; + } + } + /* + * Traverse the axis and test the nodes. + */ + pos = 0; + cur = NULL; + hasNsNodes = 0; do { cur = next(ctxt, cur); if (cur == NULL) break; - if (first != NULL) { + /* + * QUESTION TODO: What does the "first" and "last" stuff do? + */ + if ((first != NULL) && (*first != NULL)) { if (*first == cur) break; - if ((*first != NULL) && - ((total % 256) == 0) && + if (((total % 256) == 0) && #ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON (xmlXPathCmpNodesExt(*first, cur) >= 0)) #else @@ -11929,11 +12144,10 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, break; } } - if (last != NULL) { + if ((last != NULL) && (*last != NULL)) { if (*last == cur) break; - if ((*last != NULL) && - ((total % 256) == 0) && + if (((total % 256) == 0) && #ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON (xmlXPathCmpNodesExt(cur, *last) >= 0)) #else @@ -11945,63 +12159,79 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, } total++; - switch (test) { + +#ifdef DEBUG_STEP + xmlGenericError(xmlGenericErrorContext, " %s", cur->name); +#endif + switch (test) { case NODE_TEST_NONE: total = 0; STRANGE goto error; case NODE_TEST_TYPE: - if ((cur->type == type) || - ((type == NODE_TYPE_NODE) && - ((cur->type == XML_DOCUMENT_NODE) || - (cur->type == XML_HTML_DOCUMENT_NODE) || - (cur->type == XML_ELEMENT_NODE) || - (cur->type == XML_PI_NODE) || - (cur->type == XML_COMMENT_NODE) || - (cur->type == XML_CDATA_SECTION_NODE) || - (cur->type == XML_TEXT_NODE))) || - ((type == NODE_TYPE_TEXT) && - (cur->type == XML_CDATA_SECTION_NODE))) { - pos++; - if (pos == reqpos) - addNode(list, cur); - } - break; + /* + * TODO: Don't we need to use + * xmlXPathNodeSetAddNs() for namespace nodes here? + * Surprisingly, some c14n tests fail, if we do this. + */ + if (type == NODE_TYPE_NODE) { + switch (cur->type) { + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: +#ifdef LIBXML_DOCB_ENABLED + case XML_DOCB_DOCUMENT_NODE: +#endif + case XML_ELEMENT_NODE: + case XML_ATTRIBUTE_NODE: + case XML_PI_NODE: + case XML_COMMENT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_TEXT_NODE: + case XML_NAMESPACE_DECL: + XP_TEST_HIT + break; + default: + break; + } + } else if (cur->type == type) { + if (type == XML_NAMESPACE_DECL) + XP_TEST_HIT_NS + else + XP_TEST_HIT + } else if ((type == NODE_TYPE_TEXT) && + (cur->type == XML_CDATA_SECTION_NODE)) + { + XP_TEST_HIT + } + break; case NODE_TEST_PI: - if (cur->type == XML_PI_NODE) { - if ((name != NULL) && - (!xmlStrEqual(name, cur->name))) - break; - pos++; - if (pos == reqpos) - addNode(list, cur); + if ((cur->type == XML_PI_NODE) && + ((name == NULL) || xmlStrEqual(name, cur->name))) + { + XP_TEST_HIT } break; case NODE_TEST_ALL: if (axis == AXIS_ATTRIBUTE) { - if (cur->type == XML_ATTRIBUTE_NODE) { - pos++; - if (pos == reqpos) - addNode(list, cur); + if (cur->type == XML_ATTRIBUTE_NODE) + { + XP_TEST_HIT } } else if (axis == AXIS_NAMESPACE) { - if (cur->type == XML_NAMESPACE_DECL) { - pos++; - if (pos == reqpos) - xmlXPathNodeSetAddNs(list, xpctxt->node, - (xmlNsPtr) cur); + if (cur->type == XML_NAMESPACE_DECL) + { + XP_TEST_HIT_NS } } else { if (cur->type == XML_ELEMENT_NODE) { - if (prefix == NULL) { - pos++; - if (pos == reqpos) - addNode(list, cur); + if (prefix == NULL) + { + XP_TEST_HIT + } else if ((cur->ns != NULL) && - (xmlStrEqual(URI, cur->ns->href))) { - pos++; - if (pos == reqpos) - addNode(list, cur); + (xmlStrEqual(URI, cur->ns->href))) + { + XP_TEST_HIT } } } @@ -12015,19 +12245,15 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, case XML_ELEMENT_NODE: if (xmlStrEqual(name, cur->name)) { if (prefix == NULL) { - if (cur->ns == NULL) { - pos++; - if (pos == reqpos) - addNode(list, cur); + if (cur->ns == NULL) + { + XP_TEST_HIT } } else { if ((cur->ns != NULL) && - (xmlStrEqual(URI, - cur->ns->href))) + (xmlStrEqual(URI, cur->ns->href))) { - pos++; - if (pos == reqpos) - addNode(list, cur); + XP_TEST_HIT } } } @@ -12040,18 +12266,14 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, if ((attr->ns == NULL) || (attr->ns->prefix == NULL)) { - pos++; - if (pos == reqpos) - addNode(list, cur); + XP_TEST_HIT } } else { if ((attr->ns != NULL) && (xmlStrEqual(URI, attr->ns->href))) { - pos++; - if (pos == reqpos) - addNode(list, cur); + XP_TEST_HIT } } } @@ -12062,11 +12284,9 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, xmlNsPtr ns = (xmlNsPtr) cur; if ((ns->prefix != NULL) && (name != NULL) - && (xmlStrEqual(ns->prefix, name))) { - pos++; - if (pos == reqpos) - xmlXPathNodeSetAddNs(list, - xpctxt->node, (xmlNsPtr) cur); + && (xmlStrEqual(ns->prefix, name))) + { + XP_TEST_HIT_NS } } break; @@ -12074,33 +12294,179 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, break; } break; - } - } while (pos < reqpos); + } /* switch(test) */ + } while (cur != NULL); + + goto apply_predicates; + +axis_range_end: /* ----------------------------------------------------- */ + /* + * We have a "/foo[n]", and position() = n was reached. + * Note that we can have as well "/foo/::parent::foo[1]", so + * a duplicate-aware merge is still needed. + * Merge with the result. + */ + if (outSeq == NULL) { + outSeq = seq; + seq = NULL; + } else + outSeq = mergeAndClear(outSeq, seq, 0); + /* + * Break if only a true/false result was requested. + */ + if (toBool) + break; + continue; + +first_hit: /* ---------------------------------------------------------- */ + /* + * Break if only a true/false result was requested and + * no predicates existed and a node test succeeded. + */ + if (outSeq == NULL) { + outSeq = seq; + seq = NULL; + } else + outSeq = mergeAndClear(outSeq, seq, 0); + break; + +#ifdef DEBUG_STEP + if (seq != NULL) + nbMatches += seq->nodeNr; +#endif + +apply_predicates: /* --------------------------------------------------- */ + /* + * Apply predicates. + */ + if ((predOp != NULL) && (seq->nodeNr > 0)) { + /* + * E.g. when we have a "/foo[some expression][n]". + */ + /* + * QUESTION TODO: The old predicate evaluation took into + * account location-sets. + * (E.g. ctxt->value->type == XPATH_LOCATIONSET) + * Do we expect such a set here? + * All what I learned now from the evaluation semantics + * does not indicate that a location-set will be processed + * here, so this looks OK. + */ + /* + * Iterate over all predicates, starting with the outermost + * predicate. + * TODO: Problem: we cannot execute the inner predicates first + * since we cannot go back *up* the operator tree! + * Options we have: + * 1) Use of recursive functions (like is it currently done + * via xmlXPathCompOpEval()) + * 2) Add a predicate evaluation information stack to the + * context struct + * 3) Change the way the operators are linked; we need a + * "parent" field on xmlXPathStepOp + * + * For the moment, I'll try to solve this with a recursive + * function: xmlXPathCompOpEvalPredicate(). + */ + size = seq->nodeNr; + if (hasPredicateRange != 0) + newSize = xmlXPathCompOpEvalPositionalPredicate(ctxt, + predOp, seq, size, maxPos, maxPos, hasNsNodes); + else + newSize = xmlXPathCompOpEvalPredicate(ctxt, + predOp, seq, size, hasNsNodes); + + if (ctxt->error != XPATH_EXPRESSION_OK) { + total = 0; + goto error; + } + /* + * Add the filtered set of nodes to the result node set. + */ + if (newSize == 0) { + /* + * The predicates filtered all nodes out. + */ + xmlXPathNodeSetClear(seq, hasNsNodes); + } else if (seq->nodeNr > 0) { + /* + * Add to result set. + */ + if (outSeq == NULL) { + if (size != newSize) { + /* + * We need to merge and clear here, since + * the sequence will contained NULLed entries. + */ + outSeq = mergeAndClear(NULL, seq, 1); + } else { + outSeq = seq; + seq = NULL; + } + } else + outSeq = mergeAndClear(outSeq, seq, + (size != newSize) ? 1: 0); + /* + * Break if only a true/false result was requested. + */ + if (toBool) + break; + } + } else if (seq->nodeNr > 0) { + /* + * Add to result set. + */ + if (outSeq == NULL) { + outSeq = seq; + seq = NULL; + } else { + outSeq = mergeAndClear(outSeq, seq, 0); + } + } } - xpctxt->node = oldContextNode; - -#ifdef DEBUG_STEP_NTH - xmlGenericError(xmlGenericErrorContext, - "\nExamined %d nodes, found %d nodes at that step\n", - total, list->nodeNr); -#endif - - valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, list)); +error: if ((obj->boolval) && (obj->user != NULL)) { + /* + * QUESTION TODO: What does this do and why? + * TODO: Do we have to do this also for the "error" + * cleanup further down? + */ ctxt->value->boolval = 1; ctxt->value->user = obj->user; obj->user = NULL; obj->boolval = 0; } xmlXPathReleaseObject(xpctxt, obj); - return(total); -error: + /* + * Ensure we return at least an emtpy set. + */ + if (outSeq == NULL) { + if ((seq != NULL) && (seq->nodeNr == 0)) + outSeq = seq; + else + outSeq = xmlXPathNodeSetCreate(NULL); + } + if ((seq != NULL) && (seq != outSeq)) { + xmlXPathFreeNodeSet(seq); + } + /* + * Hand over the result. Better to push the set also in + * case of errors. + */ + valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, outSeq)); + /* + * Reset the context node. + */ xpctxt->node = oldContextNode; - xmlXPathReleaseObject(xpctxt, obj); - if (list != NULL) - xmlXPathFreeNodeSet(list); + +#ifdef DEBUG_STEP + xmlGenericError(xmlGenericErrorContext, + "\nExamined %d nodes, found %d nodes at that step\n", + total, nbMatches); +#endif + return(total); } @@ -12202,29 +12568,7 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt, total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; - /* - * Optimization for [n] selection where n is a number - */ - if ((op->ch2 != -1) && - (comp->steps[op->ch2].op == XPATH_OP_PREDICATE) && - (comp->steps[op->ch2].ch1 == -1) && - (comp->steps[op->ch2].ch2 != -1) && - (comp->steps[comp->steps[op->ch2].ch2].op == - XPATH_OP_VALUE)) { - xmlXPathObjectPtr val; - - val = comp->steps[comp->steps[op->ch2].ch2].value4; - if ((val != NULL) && (val->type == XPATH_NUMBER)) { - int indx = (int) val->floatval; - - if (val->floatval == (float) indx) { - xmlXPathNodeCollectAndTestNth(ctxt, op, indx, - first, NULL); - return (total); - } - } - } - total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL); + total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0); return (total); } case XPATH_OP_VALUE: @@ -12359,31 +12703,7 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op, total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; - /* - * Optimization for [n] selection where n is a number - */ - if ((op->ch2 != -1) && - (comp->steps[op->ch2].op == XPATH_OP_PREDICATE) && - (comp->steps[op->ch2].ch1 == -1) && - (comp->steps[op->ch2].ch2 != -1) && - (comp->steps[comp->steps[op->ch2].ch2].op == - XPATH_OP_VALUE)) { - xmlXPathObjectPtr val; - - val = comp->steps[comp->steps[op->ch2].ch2].value4; - if ((val != NULL) && (val->type == XPATH_NUMBER)) { - int indx = (int) val->floatval; - - if (val->floatval == (float) indx) { - total += - xmlXPathNodeCollectAndTestNth(ctxt, op, - indx, NULL, - last); - return (total); - } - } - } - total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last); + total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0); return (total); } case XPATH_OP_VALUE: @@ -12551,7 +12871,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt, } if (ctxt->value == tmp) { valuePop(ctxt); - xmlXPathNodeSetClear(tmp->nodesetval); + xmlXPathNodeSetClear(tmp->nodesetval, 1); /* * REVISIT TODO: Don't create a temporary nodeset * for everly iteration. @@ -12670,7 +12990,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt, * in order to avoid massive recreation inside this * loop. */ - xmlXPathNodeSetClear(tmp->nodesetval); + xmlXPathNodeSetClear(tmp->nodesetval, 1); } else tmp = NULL; ctxt->context->node = NULL; @@ -12917,32 +13237,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); CHECK_ERROR0; - - if ((op->ch2 != -1) && - (comp->steps[op->ch2].op == XPATH_OP_PREDICATE) && - (comp->steps[op->ch2].ch1 == -1) && - (comp->steps[op->ch2].ch2 != -1) && - (comp->steps[comp->steps[op->ch2].ch2].op == - XPATH_OP_VALUE)) - { - xmlXPathObjectPtr val; - /* - * Optimization for [n] selection where n is a number - */ - val = comp->steps[comp->steps[op->ch2].ch2].value4; - if ((val != NULL) && (val->type == XPATH_NUMBER)) { - int indx = (int) val->floatval; - if (val->floatval == (float) indx) { - total += - xmlXPathNodeCollectAndTestNth(ctxt, op, - indx, NULL, - NULL); - return (total); - } - } - } - total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL); + total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0); return (total); } case XPATH_OP_VALUE: @@ -13391,7 +13687,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) } if (ctxt->value == tmp) { valuePop(ctxt); - xmlXPathNodeSetClear(tmp->nodesetval); + xmlXPathNodeSetClear(tmp->nodesetval, 1); /* * Don't free the temporary nodeset * in order to avoid massive recreation inside this @@ -13599,6 +13895,95 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) return (total); } +/** + * xmlXPathCompOpEvalToBoolean: + * @ctxt: the XPath parser context + * + * Evaluates if the expression evaluates to true. + * + * Returns 1 if true, 0 if false and -1 on API or internal errors. + */ +static int +xmlXPathCompOpEvalToBoolean(xmlXPathParserContextPtr ctxt, + xmlXPathStepOpPtr op, + int isPredicate) +{ + xmlXPathObjectPtr resObj = NULL; + +start: + /* comp = ctxt->comp; */ + switch (op->op) { + case XPATH_OP_END: + return (0); + case XPATH_OP_VALUE: + resObj = (xmlXPathObjectPtr) op->value4; + if (isPredicate) + return(xmlXPathEvaluatePredicateResult(ctxt, resObj)); + return(xmlXPathCastToBoolean(resObj)); + case XPATH_OP_SORT: + /* + * We don't need sorting for boolean results. Skip this one. + */ + if (op->ch1 != -1) { + op = &ctxt->comp->steps[op->ch1]; + goto start; + } + return(0); + case XPATH_OP_COLLECT: + if (op->ch1 == -1) + return(0); + + xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]); + if (ctxt->error != XPATH_EXPRESSION_OK) + return(-1); + + xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1); + if (ctxt->error != XPATH_EXPRESSION_OK) + return(-1); + + resObj = valuePop(ctxt); + if (resObj == NULL) + return(-1); + break; + default: + /* + * Fallback to call xmlXPathCompOpEval(). + */ + xmlXPathCompOpEval(ctxt, op); + if (ctxt->error != XPATH_EXPRESSION_OK) + return(-1); + + resObj = valuePop(ctxt); + if (resObj == NULL) + return(-1); + break; + } + + if (resObj) { + int res; + + if (resObj->type == XPATH_BOOLEAN) { + res = resObj->boolval; + } else if (isPredicate) { + /* + * For predicates a result of type "number" is handled + * differently: + * SPEC XPath 1.0: + * "If the result is a number, the result will be converted + * to true if the number is equal to the context position + * and will be converted to false otherwise;" + */ + res = xmlXPathEvaluatePredicateResult(ctxt, resObj); + } else { + res = xmlXPathCastToBoolean(resObj); + } + xmlXPathReleaseObject(ctxt->context, resObj); + return(res); + } + + return(0); +} + #ifdef XPATH_STREAMING /** * xmlXPathRunStreamEval: @@ -13606,53 +13991,63 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) * * Evaluate the Precompiled Streamable XPath expression in the given context. */ -static xmlXPathObjectPtr -xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { +static int +xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp, + xmlXPathObjectPtr *resultSeq, int toBool) +{ int max_depth, min_depth; int from_root; int ret, depth; -#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED int eval_all_nodes; -#endif xmlNodePtr cur = NULL, limit = NULL; - xmlXPathObjectPtr retval; - xmlStreamCtxtPtr patstream; + xmlStreamCtxtPtr patstream = NULL; int nb_nodes = 0; if ((ctxt == NULL) || (comp == NULL)) - return(NULL); + return(-1); max_depth = xmlPatternMaxDepth(comp); if (max_depth == -1) - return(NULL); + return(-1); if (max_depth == -2) max_depth = 10000; min_depth = xmlPatternMinDepth(comp); if (min_depth == -1) - return(NULL); + return(-1); from_root = xmlPatternFromRoot(comp); if (from_root < 0) - return(NULL); + return(-1); #if 0 printf("stream eval: depth %d from root %d\n", max_depth, from_root); #endif - retval = xmlXPathCacheNewNodeSet(ctxt, NULL); - if (retval == NULL) - return(NULL); + if (! toBool) { + if (resultSeq == NULL) + return(-1); + *resultSeq = xmlXPathCacheNewNodeSet(ctxt, NULL); + if (*resultSeq == NULL) + return(-1); + } /* - * handle the special cases of / amd . being matched + * handle the special cases of "/" amd "." being matched */ if (min_depth == 0) { if (from_root) { - xmlXPathNodeSetAddUnique(retval->nodesetval, (xmlNodePtr) ctxt->doc); + /* Select "/" */ + if (toBool) + return(1); + xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, + (xmlNodePtr) ctxt->doc); } else { - xmlXPathNodeSetAddUnique(retval->nodesetval, ctxt->node); + /* Select "self::node()" */ + if (toBool) + return(1); + xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, ctxt->node); } } if (max_depth == 0) { - return(retval); + return(0); } if (from_root) { @@ -13688,23 +14083,27 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { } limit = cur; } - if (cur == NULL) - return(retval); + if (cur == NULL) { + return(0); + } patstream = xmlPatternGetStreamCtxt(comp); if (patstream == NULL) { - return(retval); + /* + * QUESTION TODO: Is this an error? + */ + return(0); } -#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED eval_all_nodes = xmlStreamWantsAnyNode(patstream); -#endif if (from_root) { ret = xmlStreamPush(patstream, NULL, NULL); if (ret < 0) { } else if (ret == 1) { - xmlXPathNodeSetAddUnique(retval->nodesetval, cur); + if (toBool) + goto return_1; + xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur); } } depth = 0; @@ -13715,27 +14114,24 @@ next_node: switch (cur->type) { case XML_ELEMENT_NODE: -#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: - case XML_PI_NODE: -#endif + case XML_PI_NODE: if (cur->type == XML_ELEMENT_NODE) { ret = xmlStreamPush(patstream, cur->name, (cur->ns ? cur->ns->href : NULL)); - } -#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED - else if (eval_all_nodes) + } else if (eval_all_nodes) ret = xmlStreamPushNode(patstream, NULL, NULL, cur->type); else break; -#endif if (ret < 0) { /* NOP. */ } else if (ret == 1) { - xmlXPathNodeSetAddUnique(retval->nodesetval, cur); + if (toBool) + goto return_1; + xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur); } if ((cur->children == NULL) || (depth >= max_depth)) { ret = xmlStreamPop(patstream); @@ -13748,8 +14144,8 @@ next_node: } default: break; - } - + } + scan_children: if ((cur->children != NULL) && (depth < max_depth)) { /* @@ -13783,9 +14179,7 @@ scan_children: goto done; if (cur->type == XML_ELEMENT_NODE) { ret = xmlStreamPop(patstream); - } -#ifdef XP_PATTERN_TO_ANY_NODE_ENABLED - else if ((eval_all_nodes) && + } else if ((eval_all_nodes) && ((cur->type == XML_TEXT_NODE) || (cur->type == XML_CDATA_SECTION_NODE) || (cur->type == XML_COMMENT_NODE) || @@ -13793,7 +14187,6 @@ scan_children: { ret = xmlStreamPop(patstream); } -#endif if (cur->next != NULL) { cur = cur->next; break; @@ -13801,28 +14194,39 @@ scan_children: } while (cur != NULL); } while ((cur != NULL) && (depth >= 0)); + done: + #if 0 printf("stream eval: checked %d nodes selected %d\n", - nb_nodes, retval->nodesetval->nodeNr); + nb_nodes, retObj->nodesetval->nodeNr); #endif - xmlFreeStreamCtxt(patstream); - return(retval); + + if (patstream) + xmlFreeStreamCtxt(patstream); + return(0); + +return_1: + if (patstream) + xmlFreeStreamCtxt(patstream); + return(1); } #endif /* XPATH_STREAMING */ /** * xmlXPathRunEval: * @ctxt: the XPath parser context with the compiled expression + * @toBool: evaluate to a boolean result * * Evaluate the Precompiled XPath expression in the given context. */ -static void -xmlXPathRunEval(xmlXPathParserContextPtr ctxt) { +static int +xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool) +{ xmlXPathCompExprPtr comp; if ((ctxt == NULL) || (ctxt->comp == NULL)) - return; + return(-1); if (ctxt->valueTab == NULL) { /* Allocate the value stack */ @@ -13838,21 +14242,51 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt) { } #ifdef XPATH_STREAMING if (ctxt->comp->stream) { - xmlXPathObjectPtr ret; - ret = xmlXPathRunStreamEval(ctxt->context, ctxt->comp->stream); - if (ret != NULL) { - valuePush(ctxt, ret); - return; + int res; + + if (toBool) { + /* + * Evaluation to boolean result. + */ + res = xmlXPathRunStreamEval(ctxt->context, + ctxt->comp->stream, NULL, 1); + if (res != -1) + return(res); + } else { + xmlXPathObjectPtr resObj = NULL; + + /* + * Evaluation to a sequence. + */ + res = xmlXPathRunStreamEval(ctxt->context, + ctxt->comp->stream, &resObj, 0); + + if ((res != -1) && (resObj != NULL)) { + valuePush(ctxt, resObj); + return(0); + } + if (resObj != NULL) + xmlXPathReleaseObject(ctxt->context, resObj); } + /* + * QUESTION TODO: This falls back to normal XPath evaluation + * if res == -1. Is this intended? + */ } #endif comp = ctxt->comp; - if(comp->last < 0) { + if (comp->last < 0) { xmlGenericError(xmlGenericErrorContext, "xmlXPathRunEval: last is less than zero\n"); - return; + return(-1); } - xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]); + if (toBool) + return(xmlXPathCompOpEvalToBoolean(ctxt, + &comp->steps[comp->last], 0)); + else + xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]); + + return(0); } /************************************************************************ @@ -13935,8 +14369,7 @@ xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt, return(0); return(res->nodesetval->nodeNr != 0); case XPATH_STRING: - return((res->stringval != NULL) && - (xmlStrlen(res->stringval) != 0)); + return((res->stringval != NULL) && (res->stringval[0] != 0)); #ifdef LIBXML_XPTR_ENABLED case XPATH_LOCATIONSET:{ xmlLocationSetPtr ptr = res->user; @@ -14058,7 +14491,7 @@ xmlXPathRewriteDOSExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) ((xmlXPathTypeVal) op->value3 == NODE_TYPE_NODE /* 0 */)) { /* - * This is an "foo" + * This is a "child::foo" */ xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; @@ -14072,7 +14505,7 @@ xmlXPathRewriteDOSExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) (comp->steps[prevop->ch1].op == XPATH_OP_ROOT)) { /* - * This is a "descendant-or-self::node()" without predicates. + * This is a "/descendant-or-self::node()" without predicates. * Eliminate it. */ op->ch1 = prevop->ch1; @@ -14132,17 +14565,20 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { pctxt->comp = NULL; } xmlXPathFreeParserContext(pctxt); + if (comp != NULL) { comp->expr = xmlStrdup(str); #ifdef DEBUG_EVAL_COUNTS comp->string = xmlStrdup(str); comp->nb = 0; -#endif - if ((comp->nbStep > 2) && +#endif + if ((comp->expr != NULL) && + (comp->nbStep > 2) && + (comp->last >= 0) && (xmlXPathCanRewriteDosExpression(comp->expr) == 1)) { xmlXPathRewriteDOSExpression(comp, &comp->steps[comp->last]); - } + } } return(comp); } @@ -14162,28 +14598,34 @@ xmlXPathCompile(const xmlChar *str) { } /** - * xmlXPathCompiledEval: + * xmlXPathCompiledEvalInternal: * @comp: the compiled XPath expression - * @ctx: the XPath context + * @ctxt: the XPath context + * @resObj: the resulting XPath object or NULL + * @toBool: 1 if only a boolean result is requested * * Evaluate the Precompiled XPath expression in the given context. + * The caller has to free @resObj. * * Returns the xmlXPathObjectPtr resulting from the evaluation or NULL. * the caller has to free the object. */ -xmlXPathObjectPtr -xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) { - xmlXPathParserContextPtr ctxt; - xmlXPathObjectPtr res, tmp, init = NULL; - int stack = 0; +static int +xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctxt, + xmlXPathObjectPtr *resObj, + int toBool) +{ + xmlXPathParserContextPtr pctxt; #ifndef LIBXML_THREAD_ENABLED static int reentance = 0; #endif + int res; - CHECK_CTXT(ctx) + CHECK_CTXT_NEG(ctxt) if (comp == NULL) - return(NULL); + return(-1); xmlXPathInit(); #ifndef LIBXML_THREAD_ENABLED @@ -14199,43 +14641,93 @@ xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) { comp->nb = 0; } #endif - ctxt = xmlXPathCompParserContext(comp, ctx); - xmlXPathRunEval(ctxt); + pctxt = xmlXPathCompParserContext(comp, ctxt); + res = xmlXPathRunEval(pctxt, toBool); - if (ctxt->value == NULL) { - xmlGenericError(xmlGenericErrorContext, + if (resObj) { + if (pctxt->value == NULL) { + xmlGenericError(xmlGenericErrorContext, "xmlXPathCompiledEval: evaluation failed\n"); - res = NULL; - } else { - res = valuePop(ctxt); + *resObj = NULL; + } else { + *resObj = valuePop(pctxt); + } } - - do { - tmp = valuePop(ctxt); - if (tmp != NULL) { - if (tmp != init) - stack++; - xmlXPathReleaseObject(ctx, tmp); - } - } while (tmp != NULL); - if ((stack != 0) && (res != NULL)) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompiledEval: %d object left on the stack\n", - stack); + /* + * Pop all remaining objects from the stack. + */ + if (pctxt->valueNr > 0) { + xmlXPathObjectPtr tmp; + int stack = 0; + + do { + tmp = valuePop(pctxt); + if (tmp != NULL) { + if (tmp != NULL) + stack++; + xmlXPathReleaseObject(ctxt, tmp); + } + } while (tmp != NULL); + if ((stack != 0) && + ((toBool) || ((resObj) && (*resObj)))) + { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompiledEval: %d objects left on the stack.\n", + stack); + } } - if (ctxt->error != XPATH_EXPRESSION_OK) { - xmlXPathFreeObject(res); - res = NULL; + + if ((pctxt->error != XPATH_EXPRESSION_OK) && (resObj) && (*resObj)) { + xmlXPathFreeObject(*resObj); + *resObj = NULL; } - ctxt->comp = NULL; - xmlXPathFreeParserContext(ctxt); + pctxt->comp = NULL; + xmlXPathFreeParserContext(pctxt); #ifndef LIBXML_THREAD_ENABLED reentance--; #endif + + return(res); +} + +/** + * xmlXPathCompiledEval: + * @comp: the compiled XPath expression + * @ctx: the XPath context + * + * Evaluate the Precompiled XPath expression in the given context. + * + * Returns the xmlXPathObjectPtr resulting from the evaluation or NULL. + * the caller has to free the object. + */ +xmlXPathObjectPtr +xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) +{ + xmlXPathObjectPtr res = NULL; + + xmlXPathCompiledEvalInternal(comp, ctx, &res, 0); return(res); } +/** + * xmlXPathCompiledEvalToBoolean: + * @comp: the compiled XPath expression + * @ctxt: the XPath context + * + * Applies the XPath boolean() function on the result of the given + * compiled expression. + * + * Returns 1 if the expression evaluated to true, 0 if to false and + * -1 in API and internal errors. + */ +int +xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctxt) +{ + return(xmlXPathCompiledEvalInternal(comp, ctxt, NULL, 1)); +} + /** * xmlXPathEvalExpr: * @ctxt: the XPath Parser context @@ -14263,16 +14755,22 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) { #endif { xmlXPathCompileExpr(ctxt, 1); - if ((ctxt->comp != NULL) && + /* + * In this scenario the expression string will sit in ctxt->base. + */ + if ((ctxt->error == XPATH_EXPRESSION_OK) && + (ctxt->comp != NULL) && + (ctxt->base != NULL) && (ctxt->comp->nbStep > 2) && - (xmlXPathCanRewriteDosExpression(ctxt->comp->expr) == 1)) + (ctxt->comp->last >= 0) && + (xmlXPathCanRewriteDosExpression((xmlChar *) ctxt->base) == 1)) { xmlXPathRewriteDOSExpression(ctxt->comp, - &ctxt->comp->steps[comp->last]); + &ctxt->comp->steps[ctxt->comp->last]); } } CHECK_ERROR; - xmlXPathRunEval(ctxt); + xmlXPathRunEval(ctxt, 0); } /** @@ -14358,7 +14856,7 @@ xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt) { pctxt = xmlXPathNewParserContext(str, ctxt); xmlXPathEvalExpr(pctxt); - if (*pctxt->cur != 0) { + if ((*pctxt->cur != 0) || (pctxt->error != XPATH_EXPRESSION_OK)) { xmlXPatherror(pctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR); res = NULL; } else { diff --git a/xstc/Makefile.am b/xstc/Makefile.am index 8b1d1f0..57e1a4a 100644 --- a/xstc/Makefile.am +++ b/xstc/Makefile.am @@ -33,20 +33,24 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M mkdir Tests ; \ fi) -@(if [ ! -f $(TARBALL_2) ] ; then \ + if [ -f $(srcdir)/$(TARBALL_2) ] ; then \ + $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \ echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\ - if [ -x /usr/bin/wget ] ; then \ - wget $(TARBALLURL_2) ; \ - else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi) + if [ -x "$(WGET)" ] ; then \ + $(WGET) $(TARBALLURL_2) ; \ + else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi) -@(if [ -f $(TARBALL_2) ] ; then \ echo -n "extracting test data (NIST)..." ; \ $(TAR) -xzf $(TARBALL_2) '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \ echo "done" ; \ fi) -@(if [ ! -f $(TARBALL) ] ; then \ + if [ -f $(srcdir)/$(TARBALL) ] ; then \ + $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \ echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\ - if [ -x /usr/bin/wget ] ; then \ - wget $(TARBALLURL) ; \ - else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi) + if [ -x "$(WGET)" ] ; then \ + $(WGET) $(TARBALLURL) ; \ + else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi) -@(if [ -f $(TARBALL) ] ; then \ echo -n "extracting test data (Sun, Microsoft)..." ; \ $(TAR) -C Tests -xzf $(TARBALL) '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \ @@ -92,21 +96,21 @@ sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl pytests: $(PYSCRIPTS) $(TESTDIRS) -@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then \ echo "## Running XML Schema tests (NIST)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi) -@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then \ echo "## Running Schema tests (Sun)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi) -@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then \ echo "## Running Schema tests (Microsoft)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ diff --git a/xstc/Makefile.in b/xstc/Makefile.in index ad49db7..f889d3f 100644 --- a/xstc/Makefile.in +++ b/xstc/Makefile.in @@ -136,6 +136,7 @@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ RM = @RM@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_BINARIES = @STATIC_BINARIES@ @@ -164,6 +165,7 @@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ U = @U@ VERSION = @VERSION@ +WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ WITH_C14N = @WITH_C14N@ @@ -199,6 +201,7 @@ WITH_WRITER = @WITH_WRITER@ WITH_XINCLUDE = @WITH_XINCLUDE@ WITH_XPATH = @WITH_XPATH@ WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ XINCLUDE_OBJ = @XINCLUDE_OBJ@ XMLLINT = @XMLLINT@ XML_CFLAGS = @XML_CFLAGS@ @@ -450,20 +453,24 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M mkdir Tests ; \ fi) -@(if [ ! -f $(TARBALL_2) ] ; then \ + if [ -f $(srcdir)/$(TARBALL_2) ] ; then \ + $(LN_S) $(srcdir)/$(TARBALL_2) $(TARBALL_2) ; else \ echo "Missing the test suite description (2004-01-14), trying to fetch it" ;\ - if [ -x /usr/bin/wget ] ; then \ - wget $(TARBALLURL_2) ; \ - else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi) + if [ -x "$(WGET)" ] ; then \ + $(WGET) $(TARBALLURL_2) ; \ + else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi) -@(if [ -f $(TARBALL_2) ] ; then \ echo -n "extracting test data (NIST)..." ; \ $(TAR) -xzf $(TARBALL_2) '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \ echo "done" ; \ fi) -@(if [ ! -f $(TARBALL) ] ; then \ + if [ -f $(srcdir)/$(TARBALL) ] ; then \ + $(LN_S) $(srcdir)/$(TARBALL) $(TARBALL) ; else \ echo "Missing the test suite description (2002-01-16), trying to fetch it" ;\ - if [ -x /usr/bin/wget ] ; then \ - wget $(TARBALLURL) ; \ - else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi) + if [ -x "$(WGET)" ] ; then \ + $(WGET) $(TARBALLURL) ; \ + else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi) -@(if [ -f $(TARBALL) ] ; then \ echo -n "extracting test data (Sun, Microsoft)..." ; \ $(TAR) -C Tests -xzf $(TARBALL) '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \ @@ -509,21 +516,21 @@ sun-test.py: Tests/Metadata/$(SUNTESTDEF) xstc-to-python.xsl pytests: $(PYSCRIPTS) $(TESTDIRS) -@(if [ -x nist-test.py -a -d $(TESTDIR)/Datatypes ] ; then \ echo "## Running XML Schema tests (NIST)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ $(CHECKER) $(PYTHON) nist-test.py -s -b $(srcdir) ; fi) -@(if [ -x sun-test.py -a -d $(TESTDIR)/suntest ] ; then \ echo "## Running Schema tests (Sun)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ $(CHECKER) $(PYTHON) sun-test.py -s -b $(srcdir) ; fi) -@(if [ -x ms-test.py -a -d $(TESTDIR)/msxsdtest ] ; then \ echo "## Running Schema tests (Microsoft)"; \ - PYTHONPATH="../python:../python/.libs:..:../libs:$$PYTHONPATH" ;\ + PYTHONPATH="../python:../python/.libs:..:../.libs:$$PYTHONPATH" ;\ export PYTHONPATH; \ LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ export LD_LIBRARY_PATH; \ -- cgit v1.2.3 From 0c8f97ec9edb09da2e0b19c4f9ddf8c725cebc59 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sun, 1 Mar 2009 10:54:49 +0100 Subject: Import upstream version 2.7.2 --- ChangeLog | 36 +++++ HTMLparser.c | 32 ++++- NEWS | 11 ++ config.h.in | 3 + configure | 294 ++++++++++++++++++++++++++++++++++++++- configure.in | 4 +- dict.c | 4 + doc/APIfiles.html | 5 +- doc/APIsymbols.html | 3 + doc/devhelp/libxml2-xmlsave.html | 5 +- doc/devhelp/libxml2.devhelp | 3 + doc/html/libxml-xmlsave.html | 3 + doc/libxml2-api.xml | 10 +- doc/libxml2.xsa | 33 +---- doc/news.html | 9 +- doc/xml.html | 11 ++ include/libxml/xmlsave.h | 5 +- include/libxml/xmlversion.h | 8 +- libxml2.spec | 6 +- parser.c | 6 +- python/setup.py | 2 +- runxmlconf.c | 10 ++ xmlreader.c | 57 +++++--- xmlsave.c | 27 +++- 24 files changed, 514 insertions(+), 73 deletions(-) (limited to 'doc/devhelp/libxml2-xmlsave.html') diff --git a/ChangeLog b/ChangeLog index 2ef2cc7..a37871e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +Fri Oct 3 09:43:45 CEST 2008 Daniel Veillard + + * configure.in doc/* NEWS: preparing the release of 2.7.2 + * dict.c: fix the Solaris portability issue + * parser.c: additional cleanup on #554660 fix + * test/ent13 result/ent13* result/noent/ent13*: added the + example in the regression test suite. + * HTMLparser.c: handle leading BOM in htmlParseElement() + +Thu Oct 2 22:53:39 CEST 2008 Daniel Veillard + + * parser.c: fix a nasty bug introduced when cleaning up + entities processing in 2.7.x , fixes #554660 + +Thu Sep 25 18:04:20 CEST 2008 Daniel Veillard + + * HTMLparser.c: fix an HTML parsing error on large data sections + reported by Mike Day + * test/HTML/utf8bug.html result/HTML/utf8bug.html.err + result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the + reproducer to the test suite + +Thu Sep 25 17:35:57 CEST 2008 Daniel Veillard + + * runxmlconf.c: fix compilation if XPath is not included + +Thu Sep 25 16:54:04 CEST 2008 Daniel Veillard + + * xmlreader.c: patch from Riccardo Scussat fixing custom error + handlers problems. + +Thu Sep 25 16:30:11 CEST 2008 Daniel Veillard + + * include/libxml/xmlsave.h xmlsave.c: new options to serialize + as XML/HTML/XHTML and restore old entry point behaviours + Mon Sep 1 16:49:05 CEST 2008 Daniel Veillard * doc/xml.html doc/news.html configure.in python/setup.py NEWS: diff --git a/HTMLparser.c b/HTMLparser.c index 57e64df..24b0fc0 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2768,6 +2768,7 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5]; int nbchar = 0; int cur, l; + int chunk = 0; SHRINK; cur = CUR_CHAR(l); @@ -2798,6 +2799,12 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { nbchar = 0; } NEXTL(l); + chunk++; + if (chunk > HTML_PARSER_BUFFER_SIZE) { + chunk = 0; + SHRINK; + GROW; + } cur = CUR_CHAR(l); if (cur == 0) { SHRINK; @@ -4113,6 +4120,8 @@ htmlParseElement(htmlParserCtxtPtr ctxt) { int htmlParseDocument(htmlParserCtxtPtr ctxt) { + xmlChar start[4]; + xmlCharEncoding enc; xmlDtdPtr dtd; xmlInitParser(); @@ -4132,6 +4141,23 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); + if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) && + ((ctxt->input->end - ctxt->input->cur) >= 4)) { + /* + * Get the 4 first bytes and decode the charset + * if enc != XML_CHAR_ENCODING_NONE + * plug some encoding conversion routines. + */ + start[0] = RAW; + start[1] = NXT(1); + start[2] = NXT(2); + start[3] = NXT(3); + enc = xmlDetectCharEncoding(&start[0], 4); + if (enc != XML_CHAR_ENCODING_NONE) { + xmlSwitchEncoding(ctxt, enc); + } + } + /* * Wipe out everything which is before the first '<' */ @@ -4151,10 +4177,10 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { while (((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) || ((CUR == '<') && (NXT(1) == '?'))) { - htmlParseComment(ctxt); - htmlParsePI(ctxt); + htmlParseComment(ctxt); + htmlParsePI(ctxt); SKIP_BLANKS; - } + } /* diff --git a/NEWS b/NEWS index 8c34320..6928d5b 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,17 @@ ChangeLog.html to the SVN at http://svn.gnome.org/viewcvs/libxml2/trunk/ code base.Here is the list of public releases: +2.7.2: Oct 3 2008: + - Portability fix: fix solaris compilation problem, fix compilation + if XPath is not configured in + - Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour + when saving an HTML doc with an xml dump function, HTML UTF-8 parsing + bug, fix reader custom error handlers (Riccardo Scussat) + + - Improvement: xmlSave options for more flexibility to save as + XML/HTML/XHTML, handle leading BOM in HTML documents + + 2.7.1: Sep 1 2008: - Portability fix: Borland C fix (Moritz Both) - Bug fixes: python serialization wrappers, XPath QName corner diff --git a/config.h.in b/config.h.in index f8435d4..1285789 100644 --- a/config.h.in +++ b/config.h.in @@ -85,6 +85,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H_H + /* Define if isinf is there */ #undef HAVE_ISINF diff --git a/configure b/configure index e782bfb..fa9aa59 100755 --- a/configure +++ b/configure @@ -2191,7 +2191,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=1 +LIBXML_MICRO_VERSION=2 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 @@ -22663,6 +22663,286 @@ fi done +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $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. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $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 <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in inttypes.h.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $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. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $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 <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_header in time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -26382,7 +26662,7 @@ fi { echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5 echo $ECHO_N "checking for type of socket length (socklen_t)... $ECHO_C" >&6; } cat > conftest.$ac_ext < @@ -26393,7 +26673,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: socklen_t *" >&5 @@ -26405,7 +26685,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26416,7 +26696,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: size_t *" >&5 @@ -26428,7 +26708,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26439,7 +26719,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:26442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: int *" >&5 diff --git a/configure.in b/configure.in index 17dad0b..04f363f 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CANONICAL_HOST LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=1 +LIBXML_MICRO_VERSION=2 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 @@ -378,6 +378,8 @@ AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([stdarg.h]) AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS([sys/types.h]) +AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_HEADERS([inttypes.h.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([ansidecl.h]) AC_CHECK_HEADERS([ieeefp.h]) diff --git a/dict.c b/dict.c index 20bd310..0e07e8d 100644 --- a/dict.c +++ b/dict.c @@ -22,9 +22,13 @@ #include #ifdef HAVE_STDINT_H #include +#else +#ifdef HAVE_INTTYPES_H +#include #elif defined(WIN32) typedef unsigned __int32 uint32_t; #endif +#endif #include #include #include diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 479d244..f4ef0e5 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -2797,10 +2797,13 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRegexpIsDeterminist
                            xmlRegexpPrint
                            xmlRegexpPtr
                            -

                            Module xmlsave:

                            XML_SAVE_FORMAT
                            +

                            Module xmlsave:

                            XML_SAVE_AS_HTML
                            +XML_SAVE_AS_XML
                            +XML_SAVE_FORMAT
                            XML_SAVE_NO_DECL
                            XML_SAVE_NO_EMPTY
                            XML_SAVE_NO_XHTML
                            +XML_SAVE_XHTML
                            xmlSaveClose
                            xmlSaveCtxt
                            xmlSaveCtxtPtr
                            diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 952abf5..9a1cf8e 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -788,6 +788,8 @@ A:link, A:visited, A:active { text-decoration: underline } XML_RNGP_VALUE_NO_CONTENT
                            XML_RNGP_XMLNS_NAME
                            XML_RNGP_XML_NS
                            +XML_SAVE_AS_HTML
                            +XML_SAVE_AS_XML
                            XML_SAVE_CHAR_INVALID
                            XML_SAVE_FORMAT
                            XML_SAVE_NOT_UTF8
                            @@ -796,6 +798,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SAVE_NO_EMPTY
                            XML_SAVE_NO_XHTML
                            XML_SAVE_UNKNOWN_ENCODING
                            +XML_SAVE_XHTML
                            XML_SAX2_MAGIC
                            XML_SCHEMAP_AG_PROPS_CORRECT
                            XML_SCHEMAP_ATTRFORMDEFAULT_VALUE
                            diff --git a/doc/devhelp/libxml2-xmlsave.html b/doc/devhelp/libxml2-xmlsave.html index cbe12bb..852a906 100644 --- a/doc/devhelp/libxml2-xmlsave.html +++ b/doc/devhelp/libxml2-xmlsave.html @@ -78,7 +78,10 @@ The content of this structure is not made public by the API. XML_SAVE_FORMAT = 1 /* format save output */ XML_SAVE_NO_DECL = 2 /* drop the xml declaration */ XML_SAVE_NO_EMPTY = 4 /* no empty tags */ - XML_SAVE_NO_XHTML = 8 /* disable XHTML1 specific rules */ + XML_SAVE_NO_XHTML = 8 /* disable XHTML1 specific rules */ + XML_SAVE_XHTML = 16 /* force XHTML1 specific rules */ + XML_SAVE_AS_XML = 32 /* force XML serialization on HTML doc */ + XML_SAVE_AS_HTML = 64 /* force HTML serialization on XML doc */ };

                            diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp index 1288b18..31a5d91 100644 --- a/doc/devhelp/libxml2.devhelp +++ b/doc/devhelp/libxml2.devhelp @@ -969,6 +969,8 @@ + + @@ -977,6 +979,7 @@ + diff --git a/doc/html/libxml-xmlsave.html b/doc/html/libxml-xmlsave.html index ec9b5da..8609169 100644 --- a/doc/html/libxml-xmlsave.html +++ b/doc/html/libxml-xmlsave.html @@ -32,6 +32,9 @@ The content of this structure is not made public by the API. XML_SAVE_NO_DECL = 2 : drop the xml declaration XML_SAVE_NO_EMPTY = 4 : no empty tags XML_SAVE_NO_XHTML = 8 : disable XHTML1 specific rules + XML_SAVE_XHTML = 16 : force XHTML1 specific rules + XML_SAVE_AS_XML = 32 : force XML serialization on HTML doc + XML_SAVE_AS_HTML = 64 : force HTML serialization on XML doc }

                            Function: xmlSaveClose

                            int	xmlSaveClose			(xmlSaveCtxtPtr ctxt)

                            Close a document saving context, i.e. make sure that all bytes have been output and free the associated data.

                            diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 98dc568..b396c3e 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -2982,9 +2982,12 @@ the XML document serializer API to save document or subtree of document Daniel Veillard + + - + + @@ -5235,14 +5238,17 @@ crash if you try to modify the tree)'/> + + - + + diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa index bcb3a0e..5a673bb 100644 --- a/doc/libxml2.xsa +++ b/doc/libxml2.xsa @@ -8,33 +8,14 @@ libxml2 - 2.7.0 - Aug 30 2008 + 2.7.1 + Sep 1 2008 http://xmlsoft.org/ - - Documentation: switch ChangeLog to UTF-8, improve mutithreads and - xmlParserCleanup docs - - Portability fixes: Older Win32 platforms (Rob Richards), MSVC - porting fix (Rob Richards), Mac OS X regression tests (Sven Herzberg), - non GNUCC builds (Rob Richards), compilation on Haiku (Andreas Färber) - - - Bug fixes: various realloc problems (Ashwin), potential double-free - (Ashwin), regexp crash, icrash with invalid whitespace facets (Rob - Richards), pattern fix when streaming (William Brack), various XML - parsing and validation fixes based on the W3C regression tests, reader - tree skipping function fix (Ashwin), Schemas regexps escaping fix - (Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown - when encoder cant serialize characters on output - - Code cleanup: compilation fix without the reader, without the output - (Robert Schwebel), python whitespace (Martin), many space/tabs cleanups, - serious cleanup of the entity handling code - - Improvement: switch parser to XML-1.0 5th edition, add parsing flags - for old versions, switch URI parsing to RFC 3986, - add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer), - new hashing functions for dictionnaries (based on Stefan Behnel work), - improve handling of misplaced html/head/body in HTML parser, better - regression test tools and code coverage display, better algorithms - to detect various versions of the billion laughts attacks, make - arbitrary parser limits avoidable as a parser option + - Portability fix: Borland C fix (Moritz Both) + - Bug fixes: python serialization wrappers, XPath QName corner + case handking and leaks (Martin) + - Improvement: extend the xmlSave to handle HTML documents and trees + - Cleanup: python serialization wrappers diff --git a/doc/news.html b/doc/news.html index d9dd809..31a0cf0 100644 --- a/doc/news.html +++ b/doc/news.html @@ -12,7 +12,14 @@ to help those

                            The change log describes the recents commits -to the SVN code base.

                            Here is the list of public releases:

                            2.7.1: Sep 1 2008

                            • Portability fix: Borland C fix (Moritz Both)
                            • +to the SVN code base.

                              Here is the list of public releases:

                              2.7.2: Oct 3 2008

                              • Portability fix: fix solaris compilation problem, fix compilation + if XPath is not configured in
                              • +
                              • Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour + when saving an HTML doc with an xml dump function, HTML UTF-8 parsing + bug, fix reader custom error handlers (Riccardo Scussat) +
                              • Improvement: xmlSave options for more flexibility to save as + XML/HTML/XHTML, handle leading BOM in HTML documents
                              • +

                              2.7.1: Sep 1 2008

                              • Portability fix: Borland C fix (Moritz Both)
                              • Bug fixes: python serialization wrappers, XPath QName corner case handking and leaks (Martin)
                              • Improvement: extend the xmlSave to handle HTML documents and trees
                              • diff --git a/doc/xml.html b/doc/xml.html index 9117958..b443229 100644 --- a/doc/xml.html +++ b/doc/xml.html @@ -727,6 +727,17 @@ to the SVN code base.<

                                Here is the list of public releases:

                                +

                                2.7.2: Oct 3 2008

                                +
                                  +
                                • Portability fix: fix solaris compilation problem, fix compilation + if XPath is not configured in
                                • +
                                • Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour + when saving an HTML doc with an xml dump function, HTML UTF-8 parsing + bug, fix reader custom error handlers (Riccardo Scussat) +
                                • Improvement: xmlSave options for more flexibility to save as + XML/HTML/XHTML, handle leading BOM in HTML documents
                                • +
                                +

                                2.7.1: Sep 1 2008

                                • Portability fix: Borland C fix (Moritz Both)
                                • diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h index c71c71a..4201b4d 100644 --- a/include/libxml/xmlsave.h +++ b/include/libxml/xmlsave.h @@ -30,7 +30,10 @@ typedef enum { XML_SAVE_FORMAT = 1<<0, /* format save output */ XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ - XML_SAVE_NO_XHTML = 1<<3 /* disable XHTML1 specific rules */ + XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ + XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ + XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ + XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */ } xmlSaveOption; diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h index 227a860..6c5d342 100644 --- a/include/libxml/xmlversion.h +++ b/include/libxml/xmlversion.h @@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.7.1" +#define LIBXML_DOTTED_VERSION "2.7.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20701 +#define LIBXML_VERSION 20702 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20701" +#define LIBXML_VERSION_STRING "20702" /** * LIBXML_VERSION_EXTRA: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20701); +#define LIBXML_TEST_VERSION xmlCheckVersion(20702); #ifndef VMS #if 0 diff --git a/libxml2.spec b/libxml2.spec index 039c198..a6da308 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,6 +1,6 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.7.1 +Version: 2.7.2 Release: 1 License: MIT Group: Development/Libraries @@ -128,6 +128,6 @@ rm -fr %{buildroot} %doc doc/python.html %changelog -* Mon Sep 1 2008 Daniel Veillard -- upstream release 2.7.1 see http://xmlsoft.org/news.html +* Fri Oct 3 2008 Daniel Veillard +- upstream release 2.7.2 see http://xmlsoft.org/news.html diff --git a/parser.c b/parser.c index 9876a46..4b7b758 100644 --- a/parser.c +++ b/parser.c @@ -7215,6 +7215,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { } if (*ptr != ';') { xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); + xmlFree(name); *str = ptr; return(NULL); } @@ -7225,8 +7226,11 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { * Predefined entites override any extra definition */ ent = xmlGetPredefinedEntity(name); - if (ent != NULL) + if (ent != NULL) { + xmlFree(name); + *str = ptr; return(ent); + } /* * Increate the number of entity references parsed diff --git a/python/setup.py b/python/setup.py index 75b3a40..50585c8 100755 --- a/python/setup.py +++ b/python/setup.py @@ -226,7 +226,7 @@ else: setup (name = "libxml2-python", # On *nix, the version number is created from setup.py.in # On windows, it is set by configure.js - version = "2.7.1", + version = "2.7.2", description = descr, author = "Daniel Veillard", author_email = "veillard@redhat.com", diff --git a/runxmlconf.c b/runxmlconf.c index 8ef7f74..38b0ce4 100644 --- a/runxmlconf.c +++ b/runxmlconf.c @@ -12,6 +12,8 @@ #include #endif +#ifdef LIBXML_XPATH_ENABLED + #if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -605,3 +607,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { fclose(logfile); return(ret); } + +#else /* ! LIBXML_XPATH_ENABLED */ +#include +int +main(int argc, char **argv) { + fprintf(stderr, "%s need XPath support\n", argv[0]); +} +#endif diff --git a/xmlreader.c b/xmlreader.c index bd47ea5..d42b1a0 100644 --- a/xmlreader.c +++ b/xmlreader.c @@ -44,6 +44,27 @@ #include #endif +#define MAX_ERR_MSG_SIZE 64000 + +/* + * The following VA_COPY was coded following an example in + * the Samba project. It may not be sufficient for some + * esoteric implementations of va_list (i.e. it may need + * something involving a memcpy) but (hopefully) will be + * sufficient for libxml2. + */ +#ifndef VA_COPY + #ifdef HAVE_VA_COPY + #define VA_COPY(dest, src) va_copy(dest, src) + #else + #ifdef HAVE___VA_COPY + #define VA_COPY(dest,src) __va_copy(dest, src) + #else + #define VA_COPY(dest,src) (dest) = (src) + #endif + #endif +#endif + /* #define DEBUG_CALLBACKS */ /* #define DEBUG_READER */ @@ -4500,30 +4521,32 @@ xmlTextReaderStandalone(xmlTextReaderPtr reader) { /* helper to build a xmlMalloc'ed string from a format and va_list */ static char * xmlTextReaderBuildMessage(const char *msg, va_list ap) { - int size; + int size = 0; int chars; char *larger; - char *str; - - str = (char *) xmlMallocAtomic(150); - if (str == NULL) { - xmlGenericError(xmlGenericErrorContext, "xmlMalloc failed !\n"); - return NULL; - } - - size = 150; + char *str = NULL; + va_list aq; while (1) { - chars = vsnprintf(str, size, msg, ap); - if ((chars > -1) && (chars < size)) + VA_COPY(aq, ap); + chars = vsnprintf(str, size, msg, aq); + va_end(aq); + if (chars < 0) { + xmlGenericError(xmlGenericErrorContext, "vsnprintf failed !\n"); + if (str) + xmlFree(str); + return NULL; + } + if ((chars < size) || (size == MAX_ERR_MSG_SIZE)) break; - if (chars > -1) - size += chars + 1; - else - size += 100; + if (chars < MAX_ERR_MSG_SIZE) + size = chars + 1; + else + size = MAX_ERR_MSG_SIZE; if ((larger = (char *) xmlRealloc(str, size)) == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlRealloc failed !\n"); - xmlFree(str); + if (str) + xmlFree(str); return NULL; } str = larger; diff --git a/xmlsave.c b/xmlsave.c index a650722..53b23e6 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -757,8 +757,14 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { return; } #ifdef LIBXML_HTML_ENABLED - if ((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) && - (cur->doc->type == XML_HTML_DOCUMENT_NODE)) { + if (ctxt->options & XML_SAVE_XHTML) { + xhtmlNodeDumpOutput(ctxt, cur); + return; + } + if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) && + (cur->doc->type == XML_HTML_DOCUMENT_NODE) && + ((ctxt->options & XML_SAVE_AS_XML) == 0)) || + (ctxt->options & XML_SAVE_AS_HTML)) { htmlNodeDumpOutputInternal(ctxt, cur); return; } @@ -953,7 +959,10 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { xmlGetCharEncodingName((xmlCharEncoding) cur->charset); } - if (cur->type == XML_HTML_DOCUMENT_NODE) { + if (((cur->type == XML_HTML_DOCUMENT_NODE) && + ((ctxt->options & XML_SAVE_AS_XML) == 0) && + ((ctxt->options & XML_SAVE_XHTML) == 0)) || + (ctxt->options & XML_SAVE_AS_HTML)) { #ifdef LIBXML_HTML_ENABLED if (encoding != NULL) htmlSetMetaEncoding(cur, (const xmlChar *) encoding); @@ -981,7 +990,9 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { #else return(-1); #endif - } else if (cur->type == XML_DOCUMENT_NODE) { + } else if ((cur->type == XML_DOCUMENT_NODE) || + (ctxt->options & XML_SAVE_AS_XML) || + (ctxt->options & XML_SAVE_XHTML)) { enc = xmlParseCharEncoding((const char*) encoding); if ((encoding != NULL) && (oldctxtenc == NULL) && (buf->encoder == NULL) && (buf->conv == NULL) && @@ -1032,6 +1043,8 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { } #ifdef LIBXML_HTML_ENABLED + if (ctxt->options & XML_SAVE_XHTML) + is_xhtml = 1; if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) { dtd = xmlGetIntSubset(cur); if (dtd != NULL) { @@ -2123,6 +2136,7 @@ xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; #ifdef LIBXML_HTML_ENABLED dtd = xmlGetIntSubset(doc); @@ -2208,6 +2222,7 @@ xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr, ctxt.format = format; ctxt.encoding = (const xmlChar *) txt_encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, out_doc); xmlOutputBufferFlush(out_buff); if (out_buff->conv != NULL) { @@ -2326,6 +2341,7 @@ xmlDocFormatDump(FILE *f, xmlDocPtr cur, int format) { ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); @@ -2375,6 +2391,7 @@ xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) { ctxt.format = 0; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); return(ret); @@ -2414,6 +2431,7 @@ xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); return (ret); @@ -2468,6 +2486,7 @@ xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); -- cgit v1.2.3 From 2d1849b271fa8697b88d07ba7d78dc83591e1363 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 5 Nov 2010 08:17:59 +0100 Subject: Import upstream version 2.7.8 --- HTMLparser.c | 21 +- Makefile.am | 4 +- Makefile.in | 12 +- SAX2.c | 8 +- aclocal.m4 | 4 +- catalog.c | 7 +- config.h.in | 3 + configure | 29346 +++++++++++------------------ configure.in | 68 +- debugXML.c | 2 +- doc/APIchunk0.html | 4 +- doc/APIchunk1.html | 4 +- doc/APIchunk10.html | 10 +- doc/APIchunk11.html | 8 +- doc/APIchunk12.html | 12 +- doc/APIchunk13.html | 5 +- doc/APIchunk14.html | 7 +- doc/APIchunk15.html | 6 +- doc/APIchunk16.html | 5 +- doc/APIchunk17.html | 9 +- doc/APIchunk18.html | 8 +- doc/APIchunk19.html | 8 +- doc/APIchunk2.html | 5 +- doc/APIchunk20.html | 6 +- doc/APIchunk21.html | 5 +- doc/APIchunk22.html | 13 +- doc/APIchunk23.html | 15 +- doc/APIchunk24.html | 24 +- doc/APIchunk25.html | 7 +- doc/APIchunk26.html | 8 +- doc/APIchunk27.html | 7 +- doc/APIchunk28.html | 4 +- doc/APIchunk29.html | 4 +- doc/APIchunk3.html | 7 +- doc/APIchunk4.html | 4 +- doc/APIchunk5.html | 4 +- doc/APIchunk6.html | 6 +- doc/APIchunk7.html | 5 +- doc/APIchunk8.html | 5 +- doc/APIchunk9.html | 4 +- doc/APIconstructors.html | 8 +- doc/APIfiles.html | 14 +- doc/APIfunctions.html | 4 +- doc/APIsymbols.html | 14 +- doc/ChangeLog.xsl | 2 +- doc/DOM.html | 4 +- doc/FAQ.html | 4 +- doc/Makefile.am | 10 +- doc/Makefile.in | 16 +- doc/XMLinfo.html | 4 +- doc/XSLT.html | 4 +- doc/api.xsl | 12 +- doc/architecture.html | 4 +- doc/bugs.html | 4 +- doc/catalog.html | 4 +- doc/contribs.html | 4 +- doc/devhelp/Makefile.am | 8 +- doc/devhelp/Makefile.in | 14 +- doc/devhelp/libxml2-HTMLparser.html | 1 + doc/devhelp/libxml2-encoding.html | 12 +- doc/devhelp/libxml2-nanoftp.html | 20 +- doc/devhelp/libxml2-parser.html | 1 + doc/devhelp/libxml2-parserInternals.html | 2 +- doc/devhelp/libxml2-xmlreader.html | 2 +- doc/devhelp/libxml2-xmlsave.html | 3 +- doc/devhelp/libxml2-xmlversion.html | 9 +- doc/devhelp/libxml2.devhelp | 7 + doc/docs.html | 4 +- doc/downloads.html | 4 +- doc/elfgcchack.xsl | 2 +- doc/encoding.html | 17 +- doc/entities.html | 4 +- doc/example.html | 4 +- doc/examples/Makefile.am | 2 +- doc/examples/Makefile.in | 8 +- doc/help.html | 4 +- doc/html/book1.html | 4 +- doc/html/index.html | 4 +- doc/html/libxml-DOCBparser.html | 4 +- doc/html/libxml-HTMLparser.html | 5 +- doc/html/libxml-HTMLtree.html | 4 +- doc/html/libxml-SAX.html | 4 +- doc/html/libxml-SAX2.html | 4 +- doc/html/libxml-c14n.html | 4 +- doc/html/libxml-catalog.html | 4 +- doc/html/libxml-chvalid.html | 4 +- doc/html/libxml-debugXML.html | 4 +- doc/html/libxml-dict.html | 4 +- doc/html/libxml-encoding.html | 14 +- doc/html/libxml-entities.html | 4 +- doc/html/libxml-globals.html | 4 +- doc/html/libxml-hash.html | 4 +- doc/html/libxml-lib.html | 4 +- doc/html/libxml-list.html | 4 +- doc/html/libxml-nanoftp.html | 16 +- doc/html/libxml-nanohttp.html | 4 +- doc/html/libxml-parser.html | 5 +- doc/html/libxml-parserInternals.html | 6 +- doc/html/libxml-pattern.html | 4 +- doc/html/libxml-relaxng.html | 4 +- doc/html/libxml-schemasInternals.html | 4 +- doc/html/libxml-schematron.html | 4 +- doc/html/libxml-threads.html | 4 +- doc/html/libxml-tree.html | 4 +- doc/html/libxml-uri.html | 4 +- doc/html/libxml-valid.html | 4 +- doc/html/libxml-xinclude.html | 4 +- doc/html/libxml-xlink.html | 4 +- doc/html/libxml-xmlIO.html | 4 +- doc/html/libxml-xmlautomata.html | 4 +- doc/html/libxml-xmlerror.html | 4 +- doc/html/libxml-xmlexports.html | 4 +- doc/html/libxml-xmlmemory.html | 4 +- doc/html/libxml-xmlmodule.html | 4 +- doc/html/libxml-xmlreader.html | 6 +- doc/html/libxml-xmlregexp.html | 4 +- doc/html/libxml-xmlsave.html | 5 +- doc/html/libxml-xmlschemas.html | 4 +- doc/html/libxml-xmlschemastypes.html | 4 +- doc/html/libxml-xmlstring.html | 4 +- doc/html/libxml-xmlunicode.html | 4 +- doc/html/libxml-xmlversion.html | 7 +- doc/html/libxml-xmlwriter.html | 4 +- doc/html/libxml-xpath.html | 4 +- doc/html/libxml-xpathInternals.html | 4 +- doc/html/libxml-xpointer.html | 4 +- doc/index.html | 4 +- doc/interface.html | 4 +- doc/intro.html | 4 +- doc/library.html | 4 +- doc/libxml2-api.xml | 42 +- doc/libxml2.xsa | 55 +- doc/namespaces.html | 4 +- doc/newapi.xsl | 6 +- doc/news.html | 156 +- doc/python.html | 6 +- doc/searches.xsl | 4 +- doc/site.xsl | 4 +- doc/threads.html | 4 +- doc/tree.html | 4 +- doc/upgrade.html | 4 +- doc/wiki.xsl | 6 +- doc/xml.html | 174 +- doc/xmldtd.html | 4 +- doc/xmlio.html | 28 +- doc/xmlmem.html | 4 +- encoding.c | 886 +- example/Makefile.in | 6 +- include/Makefile.in | 6 +- include/libxml/HTMLparser.h | 1 + include/libxml/Makefile.am | 3 - include/libxml/Makefile.in | 28 +- include/libxml/encoding.h | 14 + include/libxml/nanoftp.h | 67 +- include/libxml/parser.h | 2 +- include/libxml/xmlsave.h | 3 +- include/libxml/xmlversion.h | 19 +- include/libxml/xmlversion.h.in | 9 + libxml.h | 2 +- libxml2.spec | 6 +- ltmain.sh | 1739 +- m4/libtool.m4 | 999 +- m4/ltoptions.m4 | 13 +- m4/ltversion.m4 | 10 +- m4/lt~obsolete.m4 | 12 +- mkinstalldirs | 162 - nanoftp.c | 215 +- nanohttp.c | 67 +- parser.c | 208 +- python/Makefile.am | 2 +- python/Makefile.in | 8 +- python/generator.py | 4 +- python/libxml.c | 2 +- python/setup.py | 2 +- python/tests/Makefile.in | 6 +- testapi.c | 61 +- threads.c | 6 +- tree.c | 15 +- uri.c | 2 +- win32/Makefile.bcb | 4 +- win32/Makefile.mingw | 4 +- win32/Makefile.msvc | 7 +- win32/configure.js | 16 +- xmllint.c | 46 +- xmlreader.c | 12 +- xmlsave.c | 124 +- xmlschemas.c | 5 + xmlschemastypes.c | 11 +- xpath.c | 46 +- xstc/Makefile.in | 6 +- 190 files changed, 14737 insertions(+), 20816 deletions(-) delete mode 100755 mkinstalldirs (limited to 'doc/devhelp/libxml2-xmlsave.html') diff --git a/HTMLparser.c b/HTMLparser.c index 42dc776..4d43b93 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2887,9 +2887,11 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { } if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) { - htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, - "Invalid char in CDATA 0x%X\n", cur); - NEXT; + htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, + "Invalid char in CDATA 0x%X\n", cur); + if (ctxt->input->cur < ctxt->input->end) { + NEXT; + } } if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) { @@ -3275,7 +3277,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) { val = val * 16 + (CUR - 'A') + 10; else { htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, - "htmlParseCharRef: missing semicolumn\n", + "htmlParseCharRef: missing semicolon\n", NULL, NULL); break; } @@ -3290,7 +3292,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) { val = val * 10 + (CUR - '0'); else { htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, - "htmlParseCharRef: missing semicolumn\n", + "htmlParseCharRef: missing semicolon\n", NULL, NULL); break; } @@ -4670,7 +4672,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) ctxt->sax->endDocument(ctxt->userData); - if (ctxt->myDoc != NULL) { + if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL)) { dtd = xmlGetIntSubset(ctxt->myDoc); if (dtd == NULL) ctxt->myDoc->intSubset = @@ -5609,7 +5611,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { int idx; xmlChar val; - idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 1); + idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 0); if (idx < 0) goto done; val = in->cur[idx + 2]; @@ -6451,6 +6453,7 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt) ctxt->wellFormed = 1; ctxt->nsWellFormed = 1; + ctxt->disableSAX = 0; ctxt->valid = 1; ctxt->vctxt.userData = ctxt; ctxt->vctxt.error = xmlParserValidityError; @@ -6530,6 +6533,10 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options) ctxt->options |= XML_PARSE_HUGE; options -= XML_PARSE_HUGE; } + if (options & HTML_PARSE_NODEFDTD) { + ctxt->options |= HTML_PARSE_NODEFDTD; + options -= HTML_PARSE_NODEFDTD; + } ctxt->dictNames = 0; return (options); } diff --git a/Makefile.am b/Makefile.am index 967afbd..b8cbb4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1213,9 +1213,9 @@ DOC_MODULE=libxml2-$(VERSION) EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples install-data-local: - $(mkinstalldirs) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - $(mkinstalldirs) $(DESTDIR)$(EXAMPLES_DIR) + @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) diff --git a/Makefile.in b/Makefile.in index df1b84a..1e0e461 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,7 +52,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/libxml-2.0.pc.in $(srcdir)/libxml.spec.in \ $(srcdir)/xml2-config.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO acconfig.h config.guess \ - config.sub depcomp install-sh ltmain.sh missing mkinstalldirs + config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -62,7 +62,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = libxml2.spec xml2-config libxml-2.0.pc \ libxml-2.0-uninstalled.pc @@ -418,6 +418,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -466,6 +467,7 @@ VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ WGET = @WGET@ WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ +WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ WITH_C14N = @WITH_C14N@ WITH_CATALOG = @WITH_CATALOG@ WITH_DEBUG = @WITH_DEBUG@ @@ -474,6 +476,7 @@ WITH_FTP = @WITH_FTP@ WITH_HTML = @WITH_HTML@ WITH_HTTP = @WITH_HTTP@ WITH_ICONV = @WITH_ICONV@ +WITH_ICU = @WITH_ICU@ WITH_ISO8859X = @WITH_ISO8859X@ WITH_LEGACY = @WITH_LEGACY@ WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ @@ -544,7 +547,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -2700,9 +2702,9 @@ xml2Conf.sh: xml2Conf.sh.in Makefile && mv xml2Conf.tmp xml2Conf.sh install-data-local: - $(mkinstalldirs) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + @MKDIR_P@ $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) -@INSTALL@ -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - $(mkinstalldirs) $(DESTDIR)$(EXAMPLES_DIR) + @MKDIR_P@ $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) -@INSTALL@ -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) diff --git a/SAX2.c b/SAX2.c index 84c1f00..c0482c0 100644 --- a/SAX2.c +++ b/SAX2.c @@ -2242,8 +2242,12 @@ xmlSAX2StartElementNs(void *ctx, if ((URI != NULL) && (prefix == pref)) ret->ns = ns; } else { - xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); - return; + /* + * any out of memory error would already have been raised + * but we can't be garanteed it's the actual error due to the + * API, best is to skip in this case + */ + continue; } #ifdef LIBXML_VALID_ENABLED if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed && diff --git a/aclocal.m4 b/aclocal.m4 index d12d086..d34a49e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, -[m4_warning([this file was generated for autoconf 2.63. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],, +[m4_warning([this file was generated for autoconf 2.66. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) diff --git a/catalog.c b/catalog.c index af84b7c..f33a0aa 100644 --- a/catalog.c +++ b/catalog.c @@ -997,18 +997,15 @@ xmlLoadFileContent(const char *filename) } #ifdef HAVE_STAT len = read(fd, content, size); + close(fd); #else len = fread(content, 1, size, fd); + fclose(fd); #endif if (len < 0) { xmlFree(content); return (NULL); } -#ifdef HAVE_STAT - close(fd); -#else - fclose(fd); -#endif content[len] = 0; return(content); diff --git a/config.h.in b/config.h.in index 6f45c6c..d60f362 100644 --- a/config.h.in +++ b/config.h.in @@ -274,6 +274,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff --git a/configure b/configure index 1d1c54a..605e8c4 100755 --- a/configure +++ b/configure @@ -1,18 +1,22 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. +# Generated by GNU Autoconf 2.66. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +24,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +40,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +57,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +80,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +89,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -114,12 +109,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -131,7 +130,256 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -145,8 +393,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -166,623 +418,188 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit } -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -if as_func_ret_success; then - : +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi else - exitcode=1 - echo as_func_ret_success failed. + as_ln_s='cp -p' fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - exitcode=1 - echo positional parameters were not saved. + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi +as_executable_p=$as_test_x -test \$exitcode = 0) || { (exit 1); exit 1; } +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +SHELL=${CONFIG_SHELL-/bin/sh} - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +test -n "$DJDIR" || exec 7<&0 &1 +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="entities.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" +ac_unique_file="entities.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE @@ -805,6 +622,7 @@ XML_LIBDIR XML_CFLAGS CYGWIN_EXTRA_PYTHON_LIBADD CYGWIN_EXTRA_LDFLAGS +WIN32_EXTRA_PYTHON_LIBADD WIN32_EXTRA_LDFLAGS WIN32_EXTRA_LIBADD WITH_RUN_DEBUG @@ -819,6 +637,7 @@ WITH_SCHEMAS TEST_SCHEMATRON WITH_SCHEMATRON WITH_ISO8859X +WITH_ICU WITH_ICONV WITH_OUTPUT TEST_XPATH @@ -894,7 +713,6 @@ OTOOL LIPO NMEDIT DSYMUTIL -lt_ECHO RANLIB AR LN_S @@ -1004,6 +822,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -1033,6 +852,7 @@ with_html_dir with_html_subdir with_http with_iconv +with_icu with_iso8859x with_legacy with_mem_debug @@ -1058,5456 +878,1620 @@ with_xpath with_xptr with_modules with_zlib -with_coverage -enable_rebuild_docs -enable_ipv6 -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=yes] - --enable-ipv6[=yes/no] enables compilation of IPv6 code [default=yes] - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-c14n add the Canonicalization support (on) - --with-catalog add the Catalog support (on) - --with-debug add the debugging module (on) - --with-docbook add Docbook SGML support (on) - --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off) - --with-ftp add the FTP support (on) - --with-history add history support to xmllint shell(off) - --with-html add the HTML support (on) - --with-html-dir=path path to base html directory, default - $datadir/doc/html - --with-html-subdir=path directory used under html-dir, default - $PACKAGE-$VERSION/html - --with-http add the HTTP support (on) - --with-iconv[=DIR] add ICONV support (on) - --with-iso8859x add ISO8859X support if no iconv (on) - --with-legacy add deprecated APIs for compatibility (on) - --with-mem-debug add the memory debugging module (off) - --with-minimum build a minimally sized library (off) - --with-output add the serialization support (on) - --with-pattern add the xmlPattern selection interface (on) - --with-push add the PUSH parser interfaces (on) - --with-python[=DIR] build Python bindings if found - --with-reader add the xmlReader parsing interface (on) - --with-readline=DIR use readline in DIR - --with-regexps add Regular Expressions support (on) - --with-run-debug add the runtime debugging module (off) - --with-sax1 add the older SAX1 interface (on) - --with-schemas add Relax-NG and Schemas support (on) - --with-schematron add Schematron support (on) - --with-threads add multithread support(on) - --with-thread-alloc add per-thread memory(off) - --with-tree add the DOM like tree manipulation APIs (on) - --with-valid add the DTD validation support (on) - --with-writer add the xmlWriter saving interface (on) - --with-xinclude add the XInclude support (on) - --with-xpath add the XPATH support (on) - --with-xptr add the XPointer support (on) - --with-modules add the dynamic modules support (on) - --with-zlib[=DIR] use libz in DIR - --with-coverage build for code coverage with GCC (off) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.63 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers config.h" - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=7 -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 - -LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` - -if test -f CVS/Entries ; then - extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-CVS$extra" - fi -else if test -d .svn ; then - extra=`svn info | grep Revision | sed 's+Revision: ++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-SVN$extra" - fi -else if test -d .git ; then - extra=`git describe | sed 's+LIBXML[0-9.]*-++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-GIT$extra" - fi -fi -fi -fi - - - - - - - - -VERSION=${LIBXML_VERSION} - -am__api_version='1.11' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 -$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} - { (exit 1); exit 1; }; };; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 -$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} - { (exit 1); exit 1; }; };; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -$as_echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS - -fi - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE=libxml2 - VERSION=$VERSION - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - -# Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Extract the first word of "rm", so it can be a program name with args. -set dummy rm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_RM+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:$LINENO: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MV+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:$LINENO: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TAR+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:$LINENO: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PERL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:$LINENO: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "wget", so it can be a program name with args. -set dummy wget; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_WGET+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $WGET in - [\\/]* | ?:[\\/]*) - ac_cv_path_WGET="$WGET" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="/usr/bin/wget" - ;; -esac -fi -WGET=$ac_cv_path_WGET -if test -n "$WGET"; then - { $as_echo "$as_me:$LINENO: result: $WGET" >&5 -$as_echo "$WGET" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xmllint", so it can be a program name with args. -set dummy xmllint; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XMLLINT+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $XMLLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XMLLINT" && ac_cv_path_XMLLINT="/usr/bin/xmllint" - ;; -esac -fi -XMLLINT=$ac_cv_path_XMLLINT -if test -n "$XMLLINT"; then - { $as_echo "$as_me:$LINENO: result: $XMLLINT" >&5 -$as_echo "$XMLLINT" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XSLTPROC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="/usr/bin/xsltproc" - ;; -esac -fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -{ $as_echo "$as_me:$LINENO: checking for function prototypes" >&5 -$as_echo_n "checking for function prototypes... " >&6; } -if test "$ac_cv_prog_cc_c89" != no; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define PROTOTYPES 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define __PROTOTYPES 1 -_ACEOF - -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. - - -for ac_header in string.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -test "x$U" != "x" && { { $as_echo "$as_me:$LINENO: error: Compiler not ANSI compliant" >&5 -$as_echo "$as_me: error: Compiler not ANSI compliant" >&2;} - { (exit 1); exit 1; }; } - -enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:$LINENO: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi +with_coverage +enable_rebuild_docs +enable_ipv6 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +ac_prev= +ac_dashdash= +for ac_option do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - - ;; -esac - -test -z "$AS" && AS=as - + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -test -z "$DLLTOOL" && DLLTOOL=dlltool + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + --config-cache | -C) + cache_file=config.cache ;; + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; -test -z "$OBJDUMP" && OBJDUMP=objdump + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; -macro_version='2.2.6b' -macro_revision='1.3017' + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; -ltmain="$ac_aux_dir/ltmain.sh" + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; -{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; - $ac_path_SED_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_SED=$SED -fi + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; -{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + --x) + # Obsolete; use --with-x. + with_x=yes ;; - $ac_path_FGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_FGREP=$FGREP -fi + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; -test -z "$GREP" && GREP=grep + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- +test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. +Usage: $0 [OPTION]... [VAR=VALUE]... +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. +Defaults for the options are specified in brackets. +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi +For better control, use the options below. -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld + cat <<\_ACEOF +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi +if test -n "$ac_init_help"; then + cat <<\_ACEOF +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=yes] + --enable-ipv6[=yes/no] enables compilation of IPv6 code [default=yes] +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-c14n add the Canonicalization support (on) + --with-catalog add the Catalog support (on) + --with-debug add the debugging module (on) + --with-docbook add Docbook SGML support (on) + --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off) + --with-ftp add the FTP support (on) + --with-history add history support to xmllint shell(off) + --with-html add the HTML support (on) + --with-html-dir=path path to base html directory, default + $datadir/doc/html + --with-html-subdir=path directory used under html-dir, default + $PACKAGE-$VERSION/html + --with-http add the HTTP support (on) + --with-iconv[=DIR] add ICONV support (on) + --with-icu add ICU support (off) + --with-iso8859x add ISO8859X support if no iconv (on) + --with-legacy add deprecated APIs for compatibility (on) + --with-mem-debug add the memory debugging module (off) + --with-minimum build a minimally sized library (off) + --with-output add the serialization support (on) + --with-pattern add the xmlPattern selection interface (on) + --with-push add the PUSH parser interfaces (on) + --with-python[=DIR] build Python bindings if found + --with-reader add the xmlReader parsing interface (on) + --with-readline=DIR use readline in DIR + --with-regexps add Regular Expressions support (on) + --with-run-debug add the runtime debugging module (off) + --with-sax1 add the older SAX1 interface (on) + --with-schemas add Relax-NG and Schemas support (on) + --with-schematron add Schematron support (on) + --with-threads add multithread support(on) + --with-thread-alloc add per-thread memory(off) + --with-tree add the DOM like tree manipulation APIs (on) + --with-valid add the DTD validation support (on) + --with-writer add the xmlWriter saving interface (on) + --with-xinclude add the XInclude support (on) + --with-xpath add the XPATH support (on) + --with-xptr add the XPointer support (on) + --with-modules add the dynamic modules support (on) + --with-zlib[=DIR] use libz in DIR + --with-coverage build for code coverage with GCC (off) +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. -{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi +Report bugs to the package provider. +_ACEOF +ac_status=$? fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.66 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi - test -n "$ac_ct_DUMPBIN" && break -done +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - DUMPBIN=$ac_ct_DUMPBIN +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_c_try_compile - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err fi -fi -test -z "$NM" && NM=nm + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_c_try_cpp +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_c_try_run -{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval "test \"\${$3+set}\"" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5953: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:5956: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:5959: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -# find the maximum length of command line arguments -{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - $as_echo_n "(cached) " >&6 +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; +} # ac_fn_c_check_header_mongrel - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; +} # ac_fn_c_check_header_compile - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:$LINENO: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } +It was created by $as_me, which was +generated by GNU Autoconf 2.66. Invocation command line was + $ $0 $@ -{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +_ASUNAME +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS +} >&5 -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac +cat >&5 <<_ACEOF +## ----------- ## +## Core tests. ## +## ----------- ## +_ACEOF +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo -{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h +# Predefined preprocessor variables. +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac fi else - OBJDUMP="$ac_cv_prog_OBJDUMP" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - -{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; esac - lt_cv_deplibs_check_method=pass_all - ;; + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## -# This must be Linux ELF. -linux* | k*bsd*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; +ac_config_headers="$ac_config_headers config.h" -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +LIBXML_MAJOR_VERSION=2 +LIBXML_MINOR_VERSION=7 +LIBXML_MICRO_VERSION=8 +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 +LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` +if test -f CVS/Entries ; then + extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` + echo extra=$extra + if test "$extra" != "" + then + LIBXML_VERSION_EXTRA="-CVS$extra" + fi +else if test -d .svn ; then + extra=`svn info | grep Revision | sed 's+Revision: ++'` + echo extra=$extra + if test "$extra" != "" + then + LIBXML_VERSION_EXTRA="-SVN$extra" + fi +else if test -d .git ; then + extra=`git describe | sed 's+LIBXML[0-9.]*-++'` + echo extra=$extra + if test "$extra" != "" + then + LIBXML_VERSION_EXTRA="-GIT$extra" + fi +fi +fi +fi @@ -6515,117 +2499,206 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +VERSION=${LIBXML_VERSION} +am__api_version='1.11' -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done IFS=$as_save_IFS -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +rm -rf conftest.one conftest.two conftest.dir - if test "x$ac_ct_AR" = x; then - AR="false" +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh fi -else - AR="$ac_cv_prog_AR" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru - +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi -if test -n "$ac_tool_prefix"; then +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -6636,24 +2709,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6663,9 +2736,9 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6676,24 +2749,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6702,7 +2775,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -6712,560 +2785,735 @@ else STRIP="$ac_cv_prog_STRIP" fi -test -z "$STRIP" && STRIP=: - - - - - +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done IFS=$as_save_IFS fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - + test -n "$AWK" && break +done - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +# Define the identity of the package. + PACKAGE=libxml2 + VERSION=$VERSION +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF +# Some tools Automake needs. +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. +AMTAR=${AMTAR-"${am_missing_run}tar"} +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +done + done +IFS=$as_save_IFS -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" + if test "x$ac_ct_CC" = x; then + CC="" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" +fi - # Check to see that the pipe works correctly. - pipe_works=no +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - cat <<_LT_EOF >> conftest.$ac_ext -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi done + done +IFS=$as_save_IFS fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:$LINENO: result: failed" >&5 -$as_echo "failed" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: ok" >&5 -$as_echo "ok" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break +done + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi +fi +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= - - - - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; +else + ac_file='' fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 7161 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi fi - rm -rf conftest* - ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7276,956 +3524,1482 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - lt_cv_cc_needs_belf=yes + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - lt_cv_cc_needs_belf=no +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c +ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU ;; esac - -need_locks="$enable_libtool_lock" +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + AMDEP_TRUE='#' + AMDEP_FALSE= fi -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi +depcc="$CC" am_compiler_list= - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi -done -done -IFS=$as_save_IFS + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none fi + fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.$ac_ext - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - NMEDIT="$ac_cv_prog_NMEDIT" + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi + done + ac_cv_prog_CPP=$CPP fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. + CPP=$ac_cv_prog_CPP else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi else - LIPO="$ac_cv_prog_LIPO" + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then +if test "${ac_cv_path_RM+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" + ;; +esac +fi +RM=$ac_cv_path_RM +if test -n "$RM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 +$as_echo "$RM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +# Extract the first word of "mv", so it can be a program name with args. +set dummy mv; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then +if test "${ac_cv_path_MV+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $MV in + [\\/]* | ?:[\\/]*) + ac_cv_path_MV="$MV" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS + test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" + ;; +esac fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } +MV=$ac_cv_path_MV +if test -n "$MV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 +$as_echo "$MV" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +# Extract the first word of "tar", so it can be a program name with args. +set dummy tar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then +if test "${ac_cv_path_TAR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $TAR in + [\\/]* | ?:[\\/]*) + ac_cv_path_TAR="$TAR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS + test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" + ;; +esac fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } +TAR=$ac_cv_path_TAR +if test -n "$TAR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +$as_echo "$TAR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then +if test "${ac_cv_path_PERL+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" + ;; +esac fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then +# Extract the first word of "wget", so it can be a program name with args. +set dummy wget; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_WGET+set}" = set; then : $as_echo_n "(cached) " >&6 else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - lt_cv_ld_exported_symbols_list=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_ld_exported_symbols_list=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac + case $WGET in + [\\/]* | ?:[\\/]*) + ac_cv_path_WGET="$WGET" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="/usr/bin/wget" + ;; +esac +fi +WGET=$ac_cv_path_WGET +if test -n "$WGET"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 +$as_echo "$WGET" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -for ac_header in dlfcn.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +# Extract the first word of "xmllint", so it can be a program name with args. +set dummy xmllint; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XMLLINT+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + case $XMLLINT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + test -z "$ac_cv_path_XMLLINT" && ac_cv_path_XMLLINT="/usr/bin/xmllint" + ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +XMLLINT=$ac_cv_path_XMLLINT +if test -n "$XMLLINT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 +$as_echo "$XMLLINT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi +# Extract the first word of "xsltproc", so it can be a program name with args. +set dummy xsltproc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XSLTPROC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $XSLTPROC in + [\\/]* | ?:[\\/]*) + ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="/usr/bin/xsltproc" + ;; +esac +fi +XSLTPROC=$ac_cv_path_XSLTPROC +if test -n "$XSLTPROC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Set options - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 +$as_echo_n "checking for function prototypes... " >&6; } +if test "$ac_cv_prog_cc_c89" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } - enable_dlopen=no +$as_echo "#define PROTOTYPES 1" >>confdefs.h +$as_echo "#define __PROTOTYPES 1" >>confdefs.h - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac else - enable_shared=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - enable_static=yes + ac_cv_path_EGREP=$EGREP fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +int +main () +{ - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - pic_mode=default + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -test -z "$pic_mode" && pic_mode=default - - +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : +else + ac_cv_header_stdc=no +fi +rm -f conftest* +fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac else - enable_fast_install=yes + ac_cv_header_stdc=no fi +rm -f conftest* +fi +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then +$as_echo "#define STDC_HEADERS 1" >>confdefs.h +fi +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' +done +if test "$ac_cv_prog_cc_stdc" != no; then + U= ANSI2KNR= +else + U=_ ANSI2KNR=./ansi2knr +fi +# Ensure some checks needed by ansi2knr itself. +for ac_header in string.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRING_H 1 +_ACEOF +fi +done +test "x$U" != "x" && as_fn_error $? "Compiler not ANSI compliant" "$LINENO" 5 +enable_win32_dll=yes +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -test -z "$LN_S" && LN_S="ln -s" +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + ;; +esac +test -z "$AS" && AS=as +test -z "$DLLTOOL" && DLLTOOL=dlltool -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi +test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac +macro_version='2.2.10' +macro_revision='1.3175' @@ -8239,20 +5013,10 @@ _ACEOF -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac +ltmain="$ac_aux_dir/ltmain.sh" -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. +# Backslashify metacharacters that are still active within +# double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. @@ -8268,200 +5032,214 @@ delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' -# Global variables: -ofile=libtool -can_build_shared=yes +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -with_gnu_ld="$lt_cv_prog_gnu_ld" +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -old_CC="$CC" -old_CFLAGS="$CFLAGS" -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_SED=$SED fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:$LINENO: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_FGREP=$FGREP fi - - else - MAGIC_CMD=: - fi + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" - fi - ;; -esac -# Use C for the default configuration in the libtool script +test -z "$GREP" && GREP=grep -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Source file extension for C test sources. -ac_ext=c -# Object file extension for compiled C test sources. -objext=o -objext=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' @@ -8469,1699 +5247,1496 @@ lt_simple_link_test_code='int main(){return(0);}' -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then -lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8528: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8532: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" else - : + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} fi - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; + test -n "$ac_ct_DUMPBIN" && break +done - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac + *) + DUMPBIN=: ;; + esac + fi - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi - linux* | k*bsd*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - esac - ;; +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; esac - ;; + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +fi - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi ;; esac -{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8867: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8871: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" fi +test -z "$OBJDUMP" && OBJDUMP=objdump + -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi +beos*) + lt_cv_deplibs_check_method=pass_all + ;; +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8972: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:8976: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9027: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:9031: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. -_LT_EOF - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - gnu* | linux* | tpf* | k*bsd*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - case $cc_basename in - xlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +test -z "$STRIP" && STRIP=: -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +test -z "$RANLIB" && RANLIB=: - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= -int -main () -{ +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - darwin* | rhapsody*) - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - else - ld_shlibs=no - fi - ;; - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat >conftest.$ac_ext <<_ACEOF -int foo(void) {} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -fi +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" - *nto* | *qnx*) - ;; + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; + # Check to see that the pipe works correctly. + pipe_works=no - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + rm -f "$nlist"T fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; + cat <<_LT_EOF >> conftest.$ac_ext - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + echo "cannot find nm_test_var in $nlist" >&5 fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; +fi - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - *) - ld_shlibs=no - ;; - esac - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi -{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no -with_gnu_ld=$with_gnu_ld @@ -10175,102 +6750,661 @@ with_gnu_ld=$with_gnu_ld +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac ;; esac fi + rm -rf conftest* ;; esac +need_locks="$enable_libtool_lock" + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi @@ -10298,24 +7432,181 @@ esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF +fi +done +# Set options + enable_dlopen=no + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi @@ -10325,6 +7616,28 @@ esac + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi @@ -10335,8 +7648,15 @@ esac +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi +test -z "$pic_mode" && pic_mode=default @@ -10344,6 +7664,28 @@ esac + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi @@ -10355,7 +7697,11 @@ esac +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -10376,6 +7722,14 @@ esac + + + + + + +test -z "$LN_S" && LN_S="ln -s" + @@ -10389,732 +7743,246 @@ esac - - - - - - - - { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then - shlibpath_overrides_runpath=yes -fi - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES fi ;; +esac -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; +# Global variables: +ofile=libtool +can_build_shared=yes -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a -rdos*) - dynamic_linker=no - ;; +with_gnu_ld="$lt_cv_prog_gnu_ld" -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +old_CC="$CC" +old_CFLAGS="$CFLAGS" -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org -*) - dynamic_linker=no +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac -{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + else + MAGIC_CMD=: + fi +fi + fi + ;; +esac +# Use C for the default configuration in the libtool script +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Source file extension for C test sources. +ac_ext=c +# Object file extension for compiled C test sources. +objext=o +objext=$objext +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' @@ -11122,7361 +7990,4684 @@ fi +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then +lt_prog_compiler_no_builtin_flag= +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi +fi + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } - - - - - - { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi +fi - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dl_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" - ac_cv_lib_dl_dlopen=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - + lt_prog_compiler_static= fi - ;; - - *) - { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 -$as_echo_n "checking for shl_load... " >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef shl_load -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load -choke me -#endif -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_shl_load=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -$as_echo "$ac_cv_func_shl_load" >&6; } -if test "x$ac_cv_func_shl_load" = x""yes; then - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dld_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no -fi + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 -$as_echo_n "checking for dlopen... " >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -#ifdef __STDC__ -# include -#else -# include -#endif -#undef dlopen -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_dlopen || defined __stub___dlopen -choke me -#endif -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_dlopen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -$as_echo "$ac_cv_func_dlopen" >&6; } -if test "x$ac_cv_func_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dl_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - ac_cv_lib_dl_dlopen=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_svld_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_svld_dlopen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - $as_echo_n "(cached) " >&6 +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + need_locks=no +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dld_dld_link=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dld_dld_link=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -fi + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 -fi +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. +_LT_EOF + fi + ;; -fi + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; -fi + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - ;; - esac + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi - { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11830 "configure" -#include "confdefs.h" + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; -#if HAVE_DLFCN_H -#include -#endif + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -#include + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. - return status; -} _LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11926 "configure" -#include "confdefs.h" + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac -#if HAVE_DLFCN_H -#include -#endif + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -#include + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); +int +main () +{ - return status; + ; + return 0; } -_LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + darwin* | rhapsody*) + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + else + ld_shlibs=no + fi + ;; + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + freebsd1*) + ld_shlibs=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -striplib= -old_striplib= -{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: - # Report which library types will actually be built - { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' - { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; - { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; -CC="$lt_save_CC" + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; - ac_config_commands="$ac_config_commands libtool" + *) + ld_shlibs=no + ;; + esac + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no +with_gnu_ld=$with_gnu_ld -# Only expand once: -VERSION_SCRIPT_FLAGS= -# lt_cv_prog_gnu_ld is from libtool 2.+ -if test "$lt_cv_prog_gnu_ld" = yes; then - VERSION_SCRIPT_FLAGS=-Wl,--version-script= -else - case $host in - *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; - esac -fi - if test -n "$VERSION_SCRIPT_FLAGS"; then - USE_VERSION_SCRIPT_TRUE= - USE_VERSION_SCRIPT_FALSE='#' -else - USE_VERSION_SCRIPT_TRUE='#' - USE_VERSION_SCRIPT_FALSE= -fi -_cppflags="${CPPFLAGS}" -_ldflags="${LDFLAGS}" -# Check whether --with-c14n was given. -if test "${with_c14n+set}" = set; then - withval=$with_c14n; -fi -# Check whether --with-catalog was given. -if test "${with_catalog+set}" = set; then - withval=$with_catalog; -fi -# Check whether --with-debug was given. -if test "${with_debug+set}" = set; then - withval=$with_debug; -fi +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes -# Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then - withval=$with_docbook; -fi + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* -# Check whether --with-fexceptions was given. -if test "${with_fexceptions+set}" = set; then - withval=$with_fexceptions; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + -# Check whether --with-ftp was given. -if test "${with_ftp+set}" = set; then - withval=$with_ftp; -fi - -# Check whether --with-history was given. -if test "${with_history+set}" = set; then - withval=$with_history; -fi -# Check whether --with-html was given. -if test "${with_html+set}" = set; then - withval=$with_html; -fi -# Check whether --with-html-dir was given. -if test "${with_html_dir+set}" = set; then - withval=$with_html_dir; HTML_DIR=$withval -else - HTML_DIR='$(datadir)/doc' -fi -# Check whether --with-html-subdir was given. -if test "${with_html_subdir+set}" = set; then - withval=$with_html_subdir; test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval" -else - HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html" -fi -# Check whether --with-http was given. -if test "${with_http+set}" = set; then - withval=$with_http; -fi -# Check whether --with-iconv was given. -if test "${with_iconv+set}" = set; then - withval=$with_iconv; -fi -# Check whether --with-iso8859x was given. -if test "${with_iso8859x+set}" = set; then - withval=$with_iso8859x; -fi -# Check whether --with-legacy was given. -if test "${with_legacy+set}" = set; then - withval=$with_legacy; -fi -# Check whether --with-mem_debug was given. -if test "${with_mem_debug+set}" = set; then - withval=$with_mem_debug; -fi -# Check whether --with-minimum was given. -if test "${with_minimum+set}" = set; then - withval=$with_minimum; -fi -# Check whether --with-output was given. -if test "${with_output+set}" = set; then - withval=$with_output; -fi -# Check whether --with-pattern was given. -if test "${with_pattern+set}" = set; then - withval=$with_pattern; -fi -# Check whether --with-push was given. -if test "${with_push+set}" = set; then - withval=$with_push; -fi -# Check whether --with-python was given. -if test "${with_python+set}" = set; then - withval=$with_python; -fi -# Check whether --with-reader was given. -if test "${with_reader+set}" = set; then - withval=$with_reader; -fi -# Check whether --with-readline was given. -if test "${with_readline+set}" = set; then - withval=$with_readline; - if test "$withval" != "no" -a "$withval" != "yes"; then - RDL_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" - fi -fi -# Check whether --with-regexps was given. -if test "${with_regexps+set}" = set; then - withval=$with_regexps; -fi -# Check whether --with-run_debug was given. -if test "${with_run_debug+set}" = set; then - withval=$with_run_debug; -fi -# Check whether --with-sax1 was given. -if test "${with_sax1+set}" = set; then - withval=$with_sax1; -fi -# Check whether --with-schemas was given. -if test "${with_schemas+set}" = set; then - withval=$with_schemas; -fi -# Check whether --with-schematron was given. -if test "${with_schematron+set}" = set; then - withval=$with_schematron; -fi -# Check whether --with-threads was given. -if test "${with_threads+set}" = set; then - withval=$with_threads; -fi -# Check whether --with-thread-alloc was given. -if test "${with_thread_alloc+set}" = set; then - withval=$with_thread_alloc; -fi -# Check whether --with-tree was given. -if test "${with_tree+set}" = set; then - withval=$with_tree; -fi -# Check whether --with-valid was given. -if test "${with_valid+set}" = set; then - withval=$with_valid; -fi -# Check whether --with-writer was given. -if test "${with_writer+set}" = set; then - withval=$with_writer; -fi -# Check whether --with-xinclude was given. -if test "${with_xinclude+set}" = set; then - withval=$with_xinclude; -fi -# Check whether --with-xpath was given. -if test "${with_xpath+set}" = set; then - withval=$with_xpath; -fi -# Check whether --with-xptr was given. -if test "${with_xptr+set}" = set; then - withval=$with_xptr; -fi -# Check whether --with-modules was given. -if test "${with_modules+set}" = set; then - withval=$with_modules; -fi -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then - withval=$with_zlib; - if test "$withval" != "no" -a "$withval" != "yes"; then - Z_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" - fi -fi -# Check whether --with-coverage was given. -if test "${with_coverage+set}" = set; then - withval=$with_coverage; -fi -# Check whether --enable-rebuild-docs was given. -if test "${enable_rebuild_docs+set}" = set; then - enableval=$enable_rebuild_docs; -fi - if test "$enable_rebuild_docs" = "no"; then - REBUILD_DOCS_TRUE= - REBUILD_DOCS_FALSE='#' -else - REBUILD_DOCS_TRUE='#' - REBUILD_DOCS_FALSE= -fi -if test "$with_schemas" = "yes" -then - with_pattern=yes - with_regexps=yes -fi -if test "$with_schematron" = "yes" -then - with_pattern=yes - with_xpath=yes -fi -if test "$with_reader" = "yes" -then - with_push=yes -fi -if test "$with_xptr" = "yes" -then - with_xpath=yes -fi -if test "$with_minimum" = "yes" -then - echo "Configuring for a minimal library" - if test "$with_c14n" = "" - then - with_c14n=no - fi - if test "$with_catalog" = "" - then - with_catalog=no - fi - echo So far so good! - if test "$with_debug" = "" - then - with_debug=no - fi - if test "$with_docbook" = "" - then - with_docbook=no - fi - if test "$with_fexceptions" = "" - then - with_fexceptions=no - fi - if test "$with_ftp" = "" - then - with_ftp=no - fi - if test "$with_history" = "" - then - with_history=no - fi - if test "$with_html" = "" - then - with_html=no - fi - if test "$with_http" = "" - then - with_http=no - fi - if test "$with_iconv" = "" - then - with_iconv=no - fi - if test "$with_iso8859x" = "" - then - with_iso8859x=no - fi - if test "$with_legacy" = "" - then - with_legacy=no - fi - if test "$with_mem_debug" = "" - then - with_mem_debug=no - fi - if test "$with_output" = "" - then - with_output=no - fi - if test "$with_pattern" = "" - then - with_pattern=no - fi - if test "$with_push" = "" - then - with_push=no - fi - if test "$with_python" = "" - then - with_python=no - fi - if test "$with_reader" = "" - then - with_reader=no - fi - if test "$with_readline" = "" - then - with_readline=no - fi - if test "$with_regexps" = "" - then - with_regexps=no - fi - if test "$with_run_debug" = "" - then - with_run_debug=no - fi - if test "$with_sax1" = "" - then - with_sax1=no - fi - if test "$with_schemas" = "" - then - with_schemas=no - fi - if test "$with_schematron" = "" - then - with_schematron=no - fi - if test "$with_threads" = "" - then - with_threads=no - fi - if test "$with_thread_alloc" = "" - then - with_thread_alloc=no - fi - if test "$with_tree" = "" - then - with_tree=no - fi - if test "$with_valid" = "" - then - with_valid=no - fi - if test "$with_writer" = "" - then - with_writer=no - fi - if test "$with_xinclude" = "" - then - with_xinclude=no - fi - if test "$with_xpath" = "" - then - with_xpath=no - fi - if test "$with_xptr" = "" - then - with_xptr=no - fi - if test "$with_zlib" = "" - then - with_zlib=no - fi - if test "$with_modules" = "" - then - with_modules=no - fi -fi -echo Checking zlib -WITH_ZLIB=0 -if test "$with_zlib" = "no"; then - echo "Disabling compression support" -else -for ac_header in zlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - { $as_echo "$as_me:$LINENO: checking for gzread in -lz" >&5 -$as_echo_n "checking for gzread in -lz... " >&6; } -if test "${ac_cv_lib_z_gzread+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzread (); -int -main () -{ -return gzread (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_z_gzread=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_z_gzread=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzread" >&5 -$as_echo "$ac_cv_lib_z_gzread" >&6; } -if test "x$ac_cv_lib_z_gzread" = x""yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBZ 1 -_ACEOF - WITH_ZLIB=1 - if test "x${Z_DIR}" != "x"; then - Z_CFLAGS="-I${Z_DIR}/include" - Z_LIBS="-L${Z_DIR}/lib -lz" - case ${host} in - *-*-solaris*) - Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" - ;; - esac - else - Z_LIBS="-lz" - fi -fi -fi -done -fi -CPPFLAGS=${_cppflags} -LDFLAGS=${_ldflags} -echo Checking headers -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF -ac_header_dirent=$ac_hdr; break -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -fi -else - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -fi -fi -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF -fi -for ac_header in fcntl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else - eval "$as_ac_Header=\$ac_header_preproc" + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown -fi +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH -done + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; -for ac_header in unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; - ac_header_compiler=no -fi +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no - ac_header_preproc=no -fi + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -for ac_header in ctype.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - ac_header_compiler=no -fi +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +freebsd1*) + dynamic_linker=no + ;; -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; - ac_header_preproc=no -fi +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -fi +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -done +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no -for ac_header in dirent.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + # Some binutils ld are patched to set DT_RUNPATH + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +int +main () +{ -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir fi -done - + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath -for ac_header in errno.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes - ac_header_compiler=no -fi + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + fi - ac_header_preproc=no -fi + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -fi +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -done +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; +rdos*) + dynamic_linker=no + ;; -for ac_header in malloc.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; - ac_header_compiler=no -fi +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - ac_header_preproc=no -fi +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - ;; +*) + dynamic_linker=no + ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi -done -for ac_header in stdarg.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in sys/stat.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in sys/types.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in stdint.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in inttypes.h.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in time.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in ansidecl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in ieeefp.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } - ac_header_preproc=no +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} _ACEOF - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else -done + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes +fi -for ac_header in nan.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + ac_cv_lib_dld_shl_load=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + ac_cv_lib_dl_dlopen=no fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} _ACEOF - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no fi - -done - - -for ac_header in math.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + - ac_header_compiler=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi + - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +fi ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + esac -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi -fi + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -done + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" -for ac_header in limits.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +#if HAVE_DLFCN_H +#include +#endif -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +#include - ac_header_preproc=no -fi +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi fi +rm -fr conftest* -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } -for ac_header in fp_class.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" - ac_header_compiler=no -fi +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi fi +rm -fr conftest* -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + esac -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac fi -done - -for ac_header in float.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in sys/socket.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_SYS_TYPES_H -# include -# endif -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; -done + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } -for ac_header in netinet/in.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_SYS_TYPES_H -# include -# endif -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +CC="$lt_save_CC" -fi -done -for ac_header in arpa/inet.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_ARPA_INET_H -# include -# endif -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in netdb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi + ac_config_commands="$ac_config_commands libtool" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +# Only expand once: -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + +VERSION_SCRIPT_FLAGS= +# lt_cv_prog_gnu_ld is from libtool 2.+ +if test "$lt_cv_prog_gnu_ld" = yes; then + VERSION_SCRIPT_FLAGS=-Wl,--version-script= else - eval "$as_ac_Header=\$ac_header_preproc" + case $host in + *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; + esac fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + if test -z "$VERSION_SCRIPT_FLAGS"; then + USE_VERSION_SCRIPT_TRUE= + USE_VERSION_SCRIPT_FALSE='#' +else + USE_VERSION_SCRIPT_TRUE='#' + USE_VERSION_SCRIPT_FALSE= fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +_cppflags="${CPPFLAGS}" +_ldflags="${LDFLAGS}" -for ac_header in sys/time.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +# Check whether --with-c14n was given. +if test "${with_c14n+set}" = set; then : + withval=$with_c14n; fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +# Check whether --with-catalog was given. +if test "${with_catalog+set}" = set; then : + withval=$with_catalog; fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +# Check whether --with-debug was given. +if test "${with_debug+set}" = set; then : + withval=$with_debug; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +# Check whether --with-docbook was given. +if test "${with_docbook+set}" = set; then : + withval=$with_docbook; fi -done - - -for ac_header in sys/select.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +# Check whether --with-fexceptions was given. +if test "${with_fexceptions+set}" = set; then : + withval=$with_fexceptions; fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Check whether --with-ftp was given. +if test "${with_ftp+set}" = set; then : + withval=$with_ftp; +fi - ac_header_preproc=no + +# Check whether --with-history was given. +if test "${with_history+set}" = set; then : + withval=$with_history; fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +# Check whether --with-html was given. +if test "${with_html+set}" = set; then : + withval=$with_html; +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; HTML_DIR=$withval else - eval "$as_ac_Header=\$ac_header_preproc" + HTML_DIR='$(datadir)/doc' fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + + +# Check whether --with-html-subdir was given. +if test "${with_html_subdir+set}" = set; then : + withval=$with_html_subdir; test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval" +else + HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html" fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + + +# Check whether --with-http was given. +if test "${with_http+set}" = set; then : + withval=$with_http; fi -done +# Check whether --with-iconv was given. +if test "${with_iconv+set}" = set; then : + withval=$with_iconv; +fi -for ac_header in poll.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + +# Check whether --with-icu was given. +if test "${with_icu+set}" = set; then : + withval=$with_icu; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + +# Check whether --with-iso8859x was given. +if test "${with_iso8859x+set}" = set; then : + withval=$with_iso8859x; fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Check whether --with-legacy was given. +if test "${with_legacy+set}" = set; then : + withval=$with_legacy; +fi - ac_header_preproc=no + +# Check whether --with-mem_debug was given. +if test "${with_mem_debug+set}" = set; then : + withval=$with_mem_debug; fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +# Check whether --with-minimum was given. +if test "${with_minimum+set}" = set; then : + withval=$with_minimum; +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" + +# Check whether --with-output was given. +if test "${with_output+set}" = set; then : + withval=$with_output; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + +# Check whether --with-pattern was given. +if test "${with_pattern+set}" = set; then : + withval=$with_pattern; fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + +# Check whether --with-push was given. +if test "${with_push+set}" = set; then : + withval=$with_push; fi -done +# Check whether --with-python was given. +if test "${with_python+set}" = set; then : + withval=$with_python; +fi -for ac_header in sys/mman.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + +# Check whether --with-reader was given. +if test "${with_reader+set}" = set; then : + withval=$with_reader; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + +# Check whether --with-readline was given. +if test "${with_readline+set}" = set; then : + withval=$with_readline; + if test "$withval" != "no" -a "$withval" != "yes"; then + RDL_DIR=$withval + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LDFLAGS="${LDFLAGS} -L$withval/lib" + fi + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Check whether --with-regexps was given. +if test "${with_regexps+set}" = set; then : + withval=$with_regexps; +fi - ac_header_preproc=no + +# Check whether --with-run_debug was given. +if test "${with_run_debug+set}" = set; then : + withval=$with_run_debug; fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +# Check whether --with-sax1 was given. +if test "${with_sax1+set}" = set; then : + withval=$with_sax1; +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" + +# Check whether --with-schemas was given. +if test "${with_schemas+set}" = set; then : + withval=$with_schemas; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + +# Check whether --with-schematron was given. +if test "${with_schematron+set}" = set; then : + withval=$with_schematron; fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + +# Check whether --with-threads was given. +if test "${with_threads+set}" = set; then : + withval=$with_threads; fi -done +# Check whether --with-thread-alloc was given. +if test "${with_thread_alloc+set}" = set; then : + withval=$with_thread_alloc; +fi -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + +# Check whether --with-tree was given. +if test "${with_tree+set}" = set; then : + withval=$with_tree; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + +# Check whether --with-valid was given. +if test "${with_valid+set}" = set; then : + withval=$with_valid; fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +# Check whether --with-writer was given. +if test "${with_writer+set}" = set; then : + withval=$with_writer; fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +# Check whether --with-xinclude was given. +if test "${with_xinclude+set}" = set; then : + withval=$with_xinclude; +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" + +# Check whether --with-xpath was given. +if test "${with_xpath+set}" = set; then : + withval=$with_xpath; fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + +# Check whether --with-xptr was given. +if test "${with_xptr+set}" = set; then : + withval=$with_xptr; fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + +# Check whether --with-modules was given. +if test "${with_modules+set}" = set; then : + withval=$with_modules; fi -done +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; + if test "$withval" != "no" -a "$withval" != "yes"; then + Z_DIR=$withval + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LDFLAGS="${LDFLAGS} -L$withval/lib" + fi -for ac_header in signal.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + +# Check whether --with-coverage was given. +if test "${with_coverage+set}" = set; then : + withval=$with_coverage; fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes +# Check whether --enable-rebuild-docs was given. +if test "${enable_rebuild_docs+set}" = set; then : + enableval=$enable_rebuild_docs; +fi + + if test "$enable_rebuild_docs" = "no"; then + REBUILD_DOCS_TRUE= + REBUILD_DOCS_FALSE='#' else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + REBUILD_DOCS_TRUE='#' + REBUILD_DOCS_FALSE= +fi - ac_header_preproc=no + +if test "$with_schemas" = "yes" +then + with_pattern=yes + with_regexps=yes +fi +if test "$with_schematron" = "yes" +then + with_pattern=yes + with_xpath=yes +fi +if test "$with_reader" = "yes" +then + with_push=yes +fi +if test "$with_xptr" = "yes" +then + with_xpath=yes +fi +if test "$with_minimum" = "yes" +then + echo "Configuring for a minimal library" + if test "$with_c14n" = "" + then + with_c14n=no + fi + if test "$with_catalog" = "" + then + with_catalog=no + fi + echo So far so good! + if test "$with_debug" = "" + then + with_debug=no + fi + if test "$with_docbook" = "" + then + with_docbook=no + fi + if test "$with_fexceptions" = "" + then + with_fexceptions=no + fi + if test "$with_ftp" = "" + then + with_ftp=no + fi + if test "$with_history" = "" + then + with_history=no + fi + if test "$with_html" = "" + then + with_html=no + fi + if test "$with_http" = "" + then + with_http=no + fi + if test "$with_iconv" = "" + then + with_iconv=no + fi + if test "$with_iso8859x" = "" + then + with_iso8859x=no + fi + if test "$with_legacy" = "" + then + with_legacy=no + fi + if test "$with_mem_debug" = "" + then + with_mem_debug=no + fi + if test "$with_output" = "" + then + with_output=no + fi + if test "$with_pattern" = "" + then + with_pattern=no + fi + if test "$with_push" = "" + then + with_push=no + fi + if test "$with_python" = "" + then + with_python=no + fi + if test "$with_reader" = "" + then + with_reader=no + fi + if test "$with_readline" = "" + then + with_readline=no + fi + if test "$with_regexps" = "" + then + with_regexps=no + fi + if test "$with_run_debug" = "" + then + with_run_debug=no + fi + if test "$with_sax1" = "" + then + with_sax1=no + fi + if test "$with_schemas" = "" + then + with_schemas=no + fi + if test "$with_schematron" = "" + then + with_schematron=no + fi + if test "$with_threads" = "" + then + with_threads=no + fi + if test "$with_thread_alloc" = "" + then + with_thread_alloc=no + fi + if test "$with_tree" = "" + then + with_tree=no + fi + if test "$with_valid" = "" + then + with_valid=no + fi + if test "$with_writer" = "" + then + with_writer=no + fi + if test "$with_xinclude" = "" + then + with_xinclude=no + fi + if test "$with_xpath" = "" + then + with_xpath=no + fi + if test "$with_xptr" = "" + then + with_xptr=no + fi + if test "$with_zlib" = "" + then + with_zlib=no + fi + if test "$with_modules" = "" + then + with_modules=no + fi fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +echo Checking zlib -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +WITH_ZLIB=0 +if test "$with_zlib" = "no"; then + echo "Disabling compression support" else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_ZLIB_H 1 _ACEOF - -fi - -done - - -for ac_header in arpa/nameser.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 +$as_echo_n "checking for gzread in -lz... " >&6; } +if test "${ac_cv_lib_z_gzread+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if HAVE_SYS_TYPES_H -# include -# endif - -#include <$ac_header> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzread=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" + ac_cv_lib_z_gzread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 +$as_echo "$ac_cv_lib_z_gzread" >&6; } +if test "x$ac_cv_lib_z_gzread" = x""yes; then : -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +$as_echo "#define HAVE_LIBZ 1" >>confdefs.h + + WITH_ZLIB=1 + if test "x${Z_DIR}" != "x"; then + Z_CFLAGS="-I${Z_DIR}/include" + Z_LIBS="-L${Z_DIR}/lib -lz" + case ${host} in + *-*-solaris*) + Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" + ;; + esac + else + Z_LIBS="-lz" + fi fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF fi done +fi -for ac_header in resolv.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + + + + +CPPFLAGS=${_cppflags} +LDFLAGS=${_ldflags} + +echo Checking headers + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval "test \"\${$as_ac_Header+set}\"" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_NETINET_IN_H -# include -# endif -#if HAVE_ARPA_NAMESER_H -# include -# endif - +#include +#include <$ac_hdr> -#include <$ac_header> +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF +ac_header_dirent=$ac_hdr; break fi done - - -for ac_header in dl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then : + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then : + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_search_opendir=no fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -done - +fi -for ac_header in dlfcn.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <$ac_header> +#include + _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest* - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_header_stdc=no fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + +for ac_header in fcntl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_FCNTL_H 1 _ACEOF fi done +for ac_header in unistd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNISTD_H 1 +_ACEOF +fi -echo Checking libraries - +done -for ac_func in strftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in ctype.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" +if test "x$ac_cv_header_ctype_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CTYPE_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi -#ifdef __STDC__ -# include -#else -# include -#endif +done -#undef $ac_func +for ac_header in dirent.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" +if test "x$ac_cv_header_dirent_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DIRENT_H 1 +_ACEOF -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +fi -int -main () -{ -return $ac_func (); - ; - return 0; -} +done + +for ac_header in errno.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ERRNO_H 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +done + +for ac_header in malloc.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MALLOC_H 1 _ACEOF -else - # strftime is in -lintl on SCO UNIX. -{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 -$as_echo_n "checking for strftime in -lintl... " >&6; } -if test "${ac_cv_lib_intl_strftime+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strftime (); -int -main () -{ -return strftime (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_intl_strftime=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +done + +for ac_header in stdarg.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDARG_H 1 +_ACEOF - ac_cv_lib_intl_strftime=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 -$as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = x""yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_STRFTIME 1 +done + +for ac_header in sys/stat.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_STAT_H 1 _ACEOF -LIBS="-lintl $LIBS" fi +done + +for ac_header in sys/types.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TYPES_H 1 +_ACEOF + fi + done +for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF +fi +done -for ac_func in strdup strndup strerror -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in inttypes.h.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h.h" "ac_cv_header_inttypes_h_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi -#ifdef __STDC__ -# include -#else -# include -#endif +done -#undef $ac_func +for ac_header in time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" +if test "x$ac_cv_header_time_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TIME_H 1 +_ACEOF -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +fi -int -main () -{ -return $ac_func (); - ; - return 0; -} +done + +for ac_header in ansidecl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ansidecl.h" "ac_cv_header_ansidecl_h" "$ac_includes_default" +if test "x$ac_cv_header_ansidecl_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ANSIDECL_H 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +done + +for ac_header in ieeefp.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" +if test "x$ac_cv_header_ieeefp_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IEEEFP_H 1 +_ACEOF + fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + +done + +for ac_header in nan.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nan.h" "ac_cv_header_nan_h" "$ac_includes_default" +if test "x$ac_cv_header_nan_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_NAN_H 1 _ACEOF fi + done +for ac_header in math.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" +if test "x$ac_cv_header_math_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MATH_H 1 +_ACEOF + +fi +done +for ac_header in limits.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF +fi +done -for ac_func in finite isnand fp_class class fpclass -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in fp_class.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fp_class.h" "ac_cv_header_fp_class_h" "$ac_includes_default" +if test "x$ac_cv_header_fp_class_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FP_CLASS_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi -#ifdef __STDC__ -# include -#else -# include -#endif +done -#undef $ac_func +for ac_header in float.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" +if test "x$ac_cv_header_float_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FLOAT_H 1 +_ACEOF -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +fi -int -main () -{ -return $ac_func (); - ; - return 0; -} +done + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +done + +for ac_header in sys/socket.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "#if HAVE_SYS_TYPES_H +# include +# endif + +" +if test "x$ac_cv_header_sys_socket_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SOCKET_H 1 +_ACEOF + fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + +done + +for ac_header in netinet/in.h +do : + ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "#if HAVE_SYS_TYPES_H +# include +# endif + +" +if test "x$ac_cv_header_netinet_in_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_NETINET_IN_H 1 _ACEOF fi + done +for ac_header in arpa/inet.h +do : + ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "#if HAVE_SYS_TYPES_H +# include +# endif +#if HAVE_ARPA_INET_H +# include +# endif +" +if test "x$ac_cv_header_arpa_inet_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARPA_INET_H 1 +_ACEOF +fi +done -for ac_func in strftime localtime gettimeofday ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in netdb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETDB_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +fi -#ifdef __STDC__ -# include -#else -# include -#endif +done -#undef $ac_func +for ac_header in sys/time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +fi -int -main () -{ -return $ac_func (); - ; - return 0; -} +done + +for ac_header in sys/select.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SELECT_H 1 +_ACEOF + +fi + +done + +for ac_header in poll.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POLL_H 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +done + +for ac_header in sys/mman.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SYS_MMAN_H 1 _ACEOF fi + done +for ac_header in sys/timeb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIMEB_H 1 +_ACEOF +fi +done -for ac_func in stat _stat signal -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in signal.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNAL_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif +fi -#undef $ac_func +done -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +for ac_header in arpa/nameser.h +do : + ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "#if HAVE_SYS_TYPES_H +# include +# endif -int -main () -{ -return $ac_func (); - ; - return 0; -} +" +if test "x$ac_cv_header_arpa_nameser_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARPA_NAMESER_H 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +done + +for ac_header in resolv.h +do : + ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#if HAVE_SYS_TYPES_H +# include +# endif +#if HAVE_NETINET_IN_H +# include +# endif +#if HAVE_ARPA_NAMESER_H +# include +# endif + +" +if test "x$ac_cv_header_resolv_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_RESOLV_H 1 _ACEOF fi + done +for ac_header in dl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" +if test "x$ac_cv_header_dl_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DL_H 1 +_ACEOF + +fi +done +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF +fi +done +echo Checking libraries +for ac_func in strftime +do : + ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF -for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if test "${ac_cv_lib_intl_strftime+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -18484,62 +12675,89 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char strftime (); int main () { -return $ac_func (); +return strftime (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = x""yes; then : + $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h - eval "$as_ac_var=no" +LIBS="-lintl $LIBS" fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +done + +for ac_func in strdup strndup strerror +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in finite isnand fp_class class fpclass +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in strftime localtime gettimeofday ftime +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in stat _stat signal +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -18550,13 +12768,9 @@ fi done -{ $as_echo "$as_me:$LINENO: checking for va_copy" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 $as_echo_n "checking for va_copy... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include va_list ap1,ap2; @@ -18568,54 +12782,23 @@ va_copy(ap1,ap2); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : have_va_copy=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have_va_copy=no + have_va_copy=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_va_copy" >&5 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_va_copy" >&5 $as_echo "$have_va_copy" >&6; } if test x"$have_va_copy" = x"yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_VA_COPY 1 -_ACEOF +$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h else - { $as_echo "$as_me:$LINENO: checking for __va_copy" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 $as_echo_n "checking for __va_copy... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include va_list ap1,ap2; @@ -18627,60 +12810,29 @@ __va_copy(ap1,ap2); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : have___va_copy=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have___va_copy=no + have___va_copy=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $have___va_copy" >&5 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have___va_copy" >&5 $as_echo "$have___va_copy" >&6; } if test x"$have___va_copy" = x"yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE___VA_COPY 1 -_ACEOF +$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h fi fi -{ $as_echo "$as_me:$LINENO: checking for library containing gethostent" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 $as_echo_n "checking for library containing gethostent... " >&6; } -if test "${ac_cv_search_gethostent+set}" = set; then +if test "${ac_cv_search_gethostent+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -18705,69 +12857,38 @@ for ac_lib in '' nsl; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gethostent=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_gethostent+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_gethostent+set}" = set; then : break fi done -if test "${ac_cv_search_gethostent+set}" = set; then - : +if test "${ac_cv_search_gethostent+set}" = set; then : + else ac_cv_search_gethostent=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gethostent" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 $as_echo "$ac_cv_search_gethostent" >&6; } ac_res=$ac_cv_search_gethostent -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:$LINENO: checking for library containing setsockopt" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 $as_echo_n "checking for library containing setsockopt... " >&6; } -if test "${ac_cv_search_setsockopt+set}" = set; then +if test "${ac_cv_search_setsockopt+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -18790,71 +12911,40 @@ for ac_lib in '' socket net network; do ac_res="none required" else ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_setsockopt=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_setsockopt+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_setsockopt+set}" = set; then : break fi done -if test "${ac_cv_search_setsockopt+set}" = set; then - : +if test "${ac_cv_search_setsockopt+set}" = set; then : + else ac_cv_search_setsockopt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_setsockopt" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 $as_echo "$ac_cv_search_setsockopt" >&6; } ac_res=$ac_cv_search_setsockopt -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:$LINENO: checking for library containing connect" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5 $as_echo_n "checking for library containing connect... " >&6; } -if test "${ac_cv_search_connect+set}" = set; then +if test "${ac_cv_search_connect+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -18879,63 +12969,36 @@ for ac_lib in '' inet; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_connect=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_connect+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_connect+set}" = set; then : break fi done -if test "${ac_cv_search_connect+set}" = set; then - : +if test "${ac_cv_search_connect+set}" = set; then : + else ac_cv_search_connect=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_connect" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5 $as_echo "$ac_cv_search_connect" >&6; } ac_res=$ac_cv_search_connect -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5 $as_echo_n "checking for type of socket length (socklen_t)... " >&6; } cat > conftest.$ac_ext < @@ -18946,10 +13009,10 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:18949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* - { $as_echo "$as_me:$LINENO: result: socklen_t *" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t *" >&5 $as_echo "socklen_t *" >&6; } XML_SOCKLEN_T=socklen_t else @@ -18958,7 +13021,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -18969,10 +13032,10 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:18972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* - { $as_echo "$as_me:$LINENO: result: size_t *" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t *" >&5 $as_echo "size_t *" >&6; } XML_SOCKLEN_T=size_t else @@ -18981,7 +13044,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -18992,10 +13055,10 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:18995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:13058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* - { $as_echo "$as_me:$LINENO: result: int *" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: int *" >&5 $as_echo "int *" >&6; } XML_SOCKLEN_T=int else @@ -19003,7 +13066,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* - { $as_echo "$as_me:$LINENO: WARNING: could not determine" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine" >&5 $as_echo "$as_me: WARNING: could not determine" >&2;} XML_SOCKLEN_T="int" fi @@ -19019,10 +13082,10 @@ _ACEOF -{ $as_echo "$as_me:$LINENO: checking whether to enable IPv6" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 $as_echo_n "checking whether to enable IPv6... " >&6; } # Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then +if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; else enable_ipv6=yes @@ -19034,11 +13097,7 @@ then fi if test $enable_ipv6 = yes; then have_ipv6=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -19055,52 +13114,25 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : have_ipv6=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have_ipv6=no + have_ipv6=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $have_ipv6" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipv6" >&5 $as_echo "$have_ipv6" >&6; } if test $have_ipv6 = yes; then -cat >>confdefs.h <<\_ACEOF -#define SUPPORT_IP6 /**/ -_ACEOF +$as_echo "#define SUPPORT_IP6 /**/" >>confdefs.h have_broken_ss_family=no - { $as_echo "$as_me:$LINENO: checking struct sockaddr::ss_family" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr::ss_family" >&5 $as_echo_n "checking struct sockaddr::ss_family... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -19117,44 +13149,19 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : have_ss_family=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have_ss_family=no + have_ss_family=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $have_ss_family" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ss_family" >&5 $as_echo "$have_ss_family" >&6; } if test x$have_ss_family = xno ; then - { $as_echo "$as_me:$LINENO: checking broken struct sockaddr::ss_family" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking broken struct sockaddr::ss_family" >&5 $as_echo_n "checking broken struct sockaddr::ss_family... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -19171,337 +13178,45 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : have_broken_ss_family=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have_broken_ss_family=no + have_broken_ss_family=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $have_broken_ss_family" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_broken_ss_family" >&5 $as_echo "$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 - - else - { $as_echo "$as_me:$LINENO: WARNING: ss_family and __ss_family not found" >&5 -$as_echo "$as_me: WARNING: ss_family and __ss_family not found" >&2;} - fi - fi - - have_getaddrinfo=no - { $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -$as_echo_n "checking for getaddrinfo... " >&6; } -if test "${ac_cv_func_getaddrinfo+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define getaddrinfo to an innocuous variant, in case declares getaddrinfo. - For example, HP-UX 11i declares gettimeofday. */ -#define getaddrinfo innocuous_getaddrinfo - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char getaddrinfo (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef getaddrinfo - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getaddrinfo (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_getaddrinfo || defined __stub___getaddrinfo -choke me -#endif - -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_getaddrinfo=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_getaddrinfo=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5 -$as_echo "$ac_cv_func_getaddrinfo" >&6; } -if test "x$ac_cv_func_getaddrinfo" = x""yes; then - have_getaddrinfo=yes -fi - - if test $have_getaddrinfo != yes; then - for lib in bsd socket inet; do - as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_getaddrinfo" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for getaddrinfo in -l$lib" >&5 -$as_echo_n "checking for getaddrinfo in -l$lib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$lib $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getaddrinfo (); -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_Lib=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break -fi - - done - fi - - if test $have_getaddrinfo = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETADDRINFO /**/ -_ACEOF - - fi - fi -fi - - -{ $as_echo "$as_me:$LINENO: checking for isnan" >&5 -$as_echo_n "checking for isnan... " >&6; } -if test "${ac_cv_func_isnan+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define isnan to an innocuous variant, in case declares isnan. - For example, HP-UX 11i declares gettimeofday. */ -#define isnan innocuous_isnan - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char isnan (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef isnan - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char isnan (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_isnan || defined __stub___isnan -choke me -#endif - -int -main () -{ -return isnan (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_isnan=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define HAVE_BROKEN_SS_FAMILY /**/" >>confdefs.h - ac_cv_func_isnan=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_isnan" >&5 -$as_echo "$ac_cv_func_isnan" >&6; } -if test "x$ac_cv_func_isnan" = x""yes; then +$as_echo "#define ss_family __ss_family" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN /**/ -_ACEOF + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ss_family and __ss_family not found" >&5 +$as_echo "$as_me: WARNING: ss_family and __ss_family not found" >&2;} + fi + fi -else - { $as_echo "$as_me:$LINENO: checking for isnan in -lm" >&5 -$as_echo_n "checking for isnan in -lm... " >&6; } -if test "${ac_cv_lib_m_isnan+set}" = set; then + have_getaddrinfo=no + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = x""yes; then : + have_getaddrinfo=yes +fi + + if test $have_getaddrinfo != yes; then + for lib in bsd socket inet; do + as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_getaddrinfo" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -l$lib" >&5 +$as_echo_n "checking for getaddrinfo in -l$lib... " >&6; } +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-l$lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -19510,89 +13225,58 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char isnan (); +char getaddrinfo (); int main () { -return isnan (); +return getaddrinfo (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_m_isnan=yes +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_isnan=no + eval "$as_ac_Lib=no" fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_isnan" >&5 -$as_echo "$ac_cv_lib_m_isnan" >&6; } -if test "x$ac_cv_lib_m_isnan" = x""yes; then +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN /**/ -_ACEOF + done + fi -fi + if test $have_getaddrinfo = yes; then +$as_echo "#define HAVE_GETADDRINFO /**/" >>confdefs.h + + fi + fi fi -{ $as_echo "$as_me:$LINENO: checking for isinf" >&5 -$as_echo_n "checking for isinf... " >&6; } -if test "${ac_cv_func_isinf+set}" = set; then +ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan" +if test "x$ac_cv_func_isnan" = x""yes; then : + +$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan in -lm" >&5 +$as_echo_n "checking for isnan in -lm... " >&6; } +if test "${ac_cv_lib_m_isnan+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define isinf to an innocuous variant, in case declares isinf. - For example, HP-UX 11i declares gettimeofday. */ -#define isinf innocuous_isinf - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char isinf (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef isinf /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -19600,76 +13284,49 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char isinf (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_isinf || defined __stub___isinf -choke me -#endif - +char isnan (); int main () { -return isinf (); +return isnan (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_isinf=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_isnan=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_m_isnan=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnan" >&5 +$as_echo "$ac_cv_lib_m_isnan" >&6; } +if test "x$ac_cv_lib_m_isnan" = x""yes; then : + +$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h - ac_cv_func_isinf=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_isinf" >&5 -$as_echo "$ac_cv_func_isinf" >&6; } -if test "x$ac_cv_func_isinf" = x""yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF /**/ -_ACEOF + +ac_fn_c_check_func "$LINENO" "isinf" "ac_cv_func_isinf" +if test "x$ac_cv_func_isinf" = x""yes; then : + +$as_echo "#define HAVE_ISINF /**/" >>confdefs.h else - { $as_echo "$as_me:$LINENO: checking for isinf in -lm" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 $as_echo_n "checking for isinf in -lm... " >&6; } -if test "${ac_cv_lib_m_isinf+set}" = set; then +if test "${ac_cv_lib_m_isinf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -19687,47 +13344,20 @@ return isinf (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_isinf=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_isinf=no + ac_cv_lib_m_isinf=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_isinf" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 $as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = x""yes; then +if test "x$ac_cv_lib_m_isinf" = x""yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF /**/ -_ACEOF +$as_echo "#define HAVE_ISINF /**/" >>confdefs.h fi @@ -19805,21 +13435,26 @@ if test "$with_python" != "no" ; then echo Found python in $with_python/bin/python PYTHON="$with_python/bin/python" else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` - else - # Extract the first word of "python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args. + if test -x "$with_python/python.exe" + then + echo Found python in $with_python/python.exe + PYTHON="$with_python/python.exe" + else + if test -x "$with_python" + then + echo Found python in $with_python + PYTHON="$with_python" + else + if test -x "$PYTHON" + then + echo Found python in environment PYTHON=$PYTHON + with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` + else + # Extract the first word of "python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args. set dummy python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then +if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -19832,14 +13467,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -19847,14 +13482,15 @@ esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + fi fi fi fi @@ -19881,7 +13517,14 @@ fi PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages else - echo could not find python$PYTHON_VERSION/Python.h + if test -r $with_python/include/Python.h -a \ + -d $with_python/lib/site-packages + then + PYTHON_INCLUDES=$with_python/include + PYTHON_SITE_PACKAGES=$with_python/lib/site-packages + else + echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h + fi fi fi if test ! -d "$PYTHON_SITE_PACKAGES" @@ -19925,18 +13568,14 @@ if test "$with_modules" != "no" ; then case "$host" in *-*-cygwin*) MODULE_EXTENSION=".dll" - { $as_echo "$as_me:$LINENO: checking for dlopen in -lcygwin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lcygwin" >&5 $as_echo_n "checking for dlopen in -lcygwin... " >&6; } -if test "${ac_cv_lib_cygwin_dlopen+set}" = set; then +if test "${ac_cv_lib_cygwin_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcygwin $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -19954,247 +13593,47 @@ return dlopen (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cygwin_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_cygwin_dlopen=no + ac_cv_lib_cygwin_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cygwin_dlopen" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygwin_dlopen" >&5 $as_echo "$ac_cv_lib_cygwin_dlopen" >&6; } -if test "x$ac_cv_lib_cygwin_dlopen" = x""yes; then +if test "x$ac_cv_lib_cygwin_dlopen" = x""yes; then : WITH_MODULES=1 MODULE_PLATFORM_LIBS= -cat >>confdefs.h <<\_ACEOF -#define HAVE_DLOPEN /**/ -_ACEOF - - -fi - - ;; - *-*-mingw*) - MODULE_EXTENSION=".dll" - WITH_MODULES=1 - ;; - *) - { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 -$as_echo_n "checking for shl_load... " >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load -choke me -#endif - -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -$as_echo "$ac_cv_func_shl_load" >&6; } -if test "x$ac_cv_func_shl_load" = x""yes; then - libxml_have_shl_load=yes -else - - { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dld_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h - ac_cv_lib_dld_shl_load=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then - MODULE_PLATFORM_LIBS="-ldld" - libxml_have_shl_load=yes + ;; + *-*-mingw*) + MODULE_EXTENSION=".dll" + WITH_MODULES=1 + ;; + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + libxml_have_shl_load=yes else - { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 -$as_echo_n "checking for dlopen... " >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -20202,73 +13641,45 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_dlopen || defined __stub___dlopen -choke me -#endif - +char shl_load (); int main () { -return dlopen (); +return shl_load (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_dlopen=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_dlopen=no + ac_cv_lib_dld_shl_load=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -$as_echo "$ac_cv_func_dlopen" >&6; } -if test "x$ac_cv_func_dlopen" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + + MODULE_PLATFORM_LIBS="-ldld" + libxml_have_shl_load=yes +else + + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : libxml_have_dlopen=yes else - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -20286,43 +13697,18 @@ return dlopen (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : MODULE_PLATFORM_LIBS="-ldl" libxml_have_dlopen=yes @@ -20339,9 +13725,7 @@ fi MODULE_EXTENSION=".sl" WITH_MODULES=1 -cat >>confdefs.h <<\_ACEOF -#define HAVE_SHLLOAD /**/ -_ACEOF +$as_echo "#define HAVE_SHLLOAD /**/" >>confdefs.h fi @@ -20357,9 +13741,7 @@ _ACEOF WITH_MODULES=1 -cat >>confdefs.h <<\_ACEOF -#define HAVE_DLOPEN /**/ -_ACEOF +$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h fi ;; @@ -20431,146 +13813,16 @@ if test "$with_threads" = "no" ; then else echo Enabling multithreaded support if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - if test "${ac_cv_header_pthread_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5 -$as_echo_n "checking pthread.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5 -$as_echo_n "checking pthread.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_pthread_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } - -fi -if test "x$ac_cv_header_pthread_h" = x""yes; then - { $as_echo "$as_me:$LINENO: checking for pthread_join in -lpthread" >&5 + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 $as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_join+set}" = set; then +if test "${ac_cv_lib_pthread_pthread_join+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -20588,54 +13840,25 @@ return pthread_join (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_join=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_pthread_join=no + ac_cv_lib_pthread_pthread_join=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_join" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 $as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = x""yes; then +if test "x$ac_cv_lib_pthread_pthread_join" = x""yes; then : THREAD_LIBS="-lpthread" -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBPTHREAD /**/ -_ACEOF +$as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_H /**/ -_ACEOF +$as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h WITH_THREADS="1" fi @@ -20695,227 +13918,65 @@ fi -if test "$with_history" = "yes" ; then - echo Enabling xmllint shell history - unset tcap - for termlib in ncurses curses termcap terminfo termlib; do - as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tputs" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for tputs in -l${termlib}" >&5 -$as_echo_n "checking for tputs in -l${termlib}... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${termlib} $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_Lib=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - tcap="-l$termlib" -fi - - test -n "$tcap" && break - done - - if test "${ac_cv_header_readline_history_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for readline/history.h" >&5 -$as_echo_n "checking for readline/history.h... " >&6; } -if test "${ac_cv_header_readline_history_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_history_h" >&5 -$as_echo "$ac_cv_header_readline_history_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking readline/history.h usability" >&5 -$as_echo_n "checking readline/history.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking readline/history.h presence" >&5 -$as_echo_n "checking readline/history.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: readline/history.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: readline/history.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: readline/history.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: readline/history.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: readline/history.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: readline/history.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: readline/history.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/history.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: readline/history.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for readline/history.h" >&5 -$as_echo_n "checking for readline/history.h... " >&6; } -if test "${ac_cv_header_readline_history_h+set}" = set; then +if test "$with_history" = "yes" ; then + echo Enabling xmllint shell history + unset tcap + for termlib in ncurses curses termcap terminfo termlib; do + as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tputs" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -l${termlib}" >&5 +$as_echo_n "checking for tputs in -l${termlib}... " >&6; } +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else - ac_cv_header_readline_history_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_history_h" >&5 -$as_echo "$ac_cv_header_readline_history_h" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${termlib} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tputs (); +int +main () +{ +return tputs (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + tcap="-l$termlib" fi -if test "x$ac_cv_header_readline_history_h" = x""yes; then - { $as_echo "$as_me:$LINENO: checking for append_history in -lhistory" >&5 + + test -n "$tcap" && break + done + + ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_history_h" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lhistory" >&5 $as_echo_n "checking for append_history in -lhistory... " >&6; } -if test "${ac_cv_lib_history_append_history+set}" = set; then +if test "${ac_cv_lib_history_append_history+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhistory $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -20933,195 +13994,38 @@ return append_history (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_history_append_history=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_history_append_history=no + ac_cv_lib_history_append_history=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_history_append_history" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_append_history" >&5 $as_echo "$ac_cv_lib_history_append_history" >&6; } -if test "x$ac_cv_lib_history_append_history" = x""yes; then +if test "x$ac_cv_lib_history_append_history" = x""yes; then : RDL_LIBS="-lhistory" -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBHISTORY /**/ -_ACEOF - -fi - -fi - - - if test "${ac_cv_header_readline_readline_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for readline/readline.h" >&5 -$as_echo_n "checking for readline/readline.h... " >&6; } -if test "${ac_cv_header_readline_readline_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_readline_h" >&5 -$as_echo "$ac_cv_header_readline_readline_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking readline/readline.h usability" >&5 -$as_echo_n "checking readline/readline.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define HAVE_LIBHISTORY /**/" >>confdefs.h - ac_header_compiler=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking readline/readline.h presence" >&5 -$as_echo_n "checking readline/readline.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline/readline.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: readline/readline.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for readline/readline.h" >&5 -$as_echo_n "checking for readline/readline.h... " >&6; } -if test "${ac_cv_header_readline_readline_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_readline_readline_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_readline_h" >&5 -$as_echo "$ac_cv_header_readline_readline_h" >&6; } -fi -if test "x$ac_cv_header_readline_readline_h" = x""yes; then - { $as_echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 + ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } -if test "${ac_cv_lib_readline_readline+set}" = set; then +if test "${ac_cv_lib_readline_readline+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $tcap $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -21139,49 +14043,22 @@ return readline (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_readline_readline=no + ac_cv_lib_readline_readline=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = x""yes; then +if test "x$ac_cv_lib_readline_readline" = x""yes; then : RDL_LIBS="-lreadline $RDL_LIBS $tcap" -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBREADLINE /**/ -_ACEOF +$as_echo "#define HAVE_LIBREADLINE /**/" >>confdefs.h fi @@ -21447,141 +14324,11 @@ else ICONV_LIBS="-L$with_iconv/lib" fi - if test "${ac_cv_header_iconv_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for iconv.h" >&5 -$as_echo_n "checking for iconv.h... " >&6; } -if test "${ac_cv_header_iconv_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 -$as_echo "$ac_cv_header_iconv_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking iconv.h usability" >&5 -$as_echo_n "checking iconv.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking iconv.h presence" >&5 -$as_echo_n "checking iconv.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for iconv.h" >&5 -$as_echo_n "checking for iconv.h... " >&6; } -if test "${ac_cv_header_iconv_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_iconv_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 -$as_echo "$ac_cv_header_iconv_h" >&6; } - -fi -if test "x$ac_cv_header_iconv_h" = x""yes; then - { $as_echo "$as_me:$LINENO: checking for iconv" >&5 + ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" +if test "x$ac_cv_header_iconv_h" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -21595,39 +14342,16 @@ iconv (cd, NULL, NULL, NULL, NULL); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } WITH_ICONV=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { $as_echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } _ldflags="${LDFLAGS}" @@ -21635,11 +14359,7 @@ $as_echo_n "checking for iconv in -liconv... " >&6; } LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" LIBS="${LIBS} -liconv" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -21653,69 +14373,38 @@ iconv (cd, NULL, NULL, NULL, NULL); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } WITH_ICONV=1 ICONV_LIBS="${ICONV_LIBS} -liconv" LIBS="${_libs}" LDFLAGS="${_ldflags}" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS="${_libs}" LDFLAGS="${_ldflags}" fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi if test "$WITH_ICONV" = "1" ; then - { $as_echo "$as_me:$LINENO: checking for iconv declaration" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } - if test "${xml_cv_iconv_arg2+set}" = set; then + if test "${xml_cv_iconv_arg2+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -21737,38 +14426,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : xml_cv_iconv_arg2="" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - xml_cv_iconv_arg2="const" + xml_cv_iconv_arg2="const" fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" - { $as_echo "$as_me:$LINENO: result: ${xml_xxx:- + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${xml_xxx:- }$xml_cv_iconv_decl" >&5 $as_echo "${xml_xxx:- }$xml_cv_iconv_decl" >&6; } @@ -21793,6 +14461,23 @@ XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" XML_LIBTOOLLIBS="libxml2.la" +WITH_ICU=0 +if test "$with_icu" != "yes" ; then + echo Disabling ICU support +else + ICU_CONFIG=icu-config + if ${ICU_CONFIG} --cflags >/dev/null 2>&1 + then + ICU_LIBS=`icu-config --ldflags` + LDFLAGS="$LDFLAGS $ICU_LIBS" + WITH_ICU=1 + echo Enabling ICU support + else + as_fn_error $? "libicu config program icu-config not found" "$LINENO" 5 + fi +fi + + WITH_ISO8859X=1 if test "$WITH_ICONV" != "1" ; then if test "$with_iso8859x" = "no" ; then @@ -21882,26 +14567,25 @@ WIN32_EXTRA_LIBADD= WIN32_EXTRA_LDFLAGS= CYGWIN_EXTRA_LDFLAGS= CYGWIN_EXTRA_PYTHON_LIBADD= +WIN32_EXTRA_PYTHON_LIBADD= case "$host" in *-*-mingw*) CPPFLAGS="$CPPFLAGS -DWIN32" WIN32_EXTRA_LIBADD="-lws2_32" WIN32_EXTRA_LDFLAGS="-no-undefined" -cat >>confdefs.h <<\_ACEOF -#define _WINSOCKAPI_ 1 -_ACEOF +$as_echo "#define _WINSOCKAPI_ 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define snprintf _snprintf -_ACEOF +$as_echo "#define snprintf _snprintf" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define vsnprintf _vsnprintf -_ACEOF +$as_echo "#define vsnprintf _vsnprintf" >>confdefs.h + if test "${PYTHON}" != "" + then + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}" + fi ;; *-*-cygwin*) CYGWIN_EXTRA_LDFLAGS="-no-undefined" @@ -21916,6 +14600,7 @@ esac + if test "$with_coverage" = "yes" -a "${GCC}" = "yes" then echo Enabling code coverage for GCC @@ -21983,13 +14668,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -21997,8 +14682,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -22021,11 +14706,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -22045,8 +14730,8 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -22062,55 +14747,38 @@ else fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_VERSION_SCRIPT_TRUE}" && test -z "${USE_VERSION_SCRIPT_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"USE_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"USE_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"USE_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${REBUILD_DOCS_TRUE}" && test -z "${REBUILD_DOCS_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"REBUILD_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"REBUILD_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"REBUILD_DOCS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_PYTHON_TRUE}" && test -z "${WITH_PYTHON_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"WITH_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"WITH_PYTHON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_TRIO_SOURCES_TRUE}" && test -z "${WITH_TRIO_SOURCES_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_TRIO_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"WITH_TRIO_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"WITH_TRIO_SOURCES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -22120,17 +14788,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -22138,23 +14807,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -22162,7 +14823,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -22173,7 +14840,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -22196,13 +14863,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -22212,15 +14872,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -22232,12 +14892,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -22249,7 +14913,89 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -22263,8 +15009,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -22284,76 +15034,25 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -22382,8 +15081,56 @@ fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -22402,10 +15149,10 @@ else if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -22420,13 +15167,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.66. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -22458,13 +15211,15 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -22483,16 +15238,17 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.66, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -22528,6 +15284,8 @@ do ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) @@ -22535,20 +15293,19 @@ do case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -22556,11 +15313,10 @@ Try \`$0 --help' for more information." >&2 ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -22611,133 +15367,148 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -22760,8 +15531,6 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ @@ -22791,12 +15560,13 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22823,9 +15593,9 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -22833,12 +15603,6 @@ sys_lib_dlsearch_path_spec; do esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -22887,9 +15651,7 @@ do "libxml-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES libxml-2.0-uninstalled.pc" ;; "python/setup.py") CONFIG_FILES="$CONFIG_FILES python/setup.py" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -22916,7 +15678,7 @@ $debug || trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -22927,11 +15689,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -22939,7 +15697,13 @@ $debug || if test -n "$CONFIG_FILES"; then -ac_cr=' ' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -22956,24 +15720,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -22995,7 +15753,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -23009,7 +15767,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -23062,22 +15820,28 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -23105,9 +15869,7 @@ for ac_last_try in false false :; do if test -z "$ac_t"; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -23192,9 +15954,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -23207,9 +15967,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -23237,12 +15995,10 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -23253,7 +16009,7 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -23266,9 +16022,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -23296,47 +16050,7 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -23393,7 +16107,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -23403,12 +16116,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -23418,7 +16130,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -23447,26 +16159,22 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -23477,25 +16185,19 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;} $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -23533,7 +16235,7 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -23628,47 +16330,7 @@ $as_echo X"$file" | q } s/.*/./; q'` - { as_dir=$dirpart/$fdir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done @@ -23696,7 +16358,8 @@ $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -23729,13 +16392,13 @@ available_tags="" # ### BEGIN LIBTOOL CONFIG # Assembler program. -AS=$AS +AS=$lt_AS # DLL creation program. -DLLTOOL=$DLLTOOL +DLLTOOL=$lt_DLLTOOL # Object dumper program. -OBJDUMP=$OBJDUMP +OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version @@ -23753,6 +16416,12 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -23802,10 +16471,6 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -23824,6 +16489,9 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -23845,12 +16513,6 @@ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name # The name of the directory that contains temporary libtool files. objdir=$objdir -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO - # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -23913,6 +16575,9 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -23952,6 +16617,10 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -24211,7 +16880,7 @@ _LT_EOF func_dirname () { # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else @@ -24222,7 +16891,7 @@ func_dirname () # func_basename file func_basename () { - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + func_basename_result=`$ECHO "${1}" | $SED "$basename"` } @@ -24235,10 +16904,8 @@ func_basename () func_stripname () { case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } @@ -24249,20 +16916,20 @@ my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... @@ -24321,15 +16988,12 @@ _LT_EOF done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -24350,10 +17014,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/configure.in b/configure.in index 17c11cd..59d0629 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,5 @@ dnl Process this file with autoconf to produce a configure script. +AC_PREREQ(2.59) AC_INIT(entities.c) AM_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) @@ -6,7 +7,7 @@ AC_CANONICAL_HOST LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=7 +LIBXML_MICRO_VERSION=8 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 @@ -52,6 +53,7 @@ AM_INIT_AUTOMAKE(libxml2, $VERSION) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL +AC_PROG_MKDIR_P AC_PROG_CPP AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(MV, mv, /bin/mv) @@ -82,7 +84,7 @@ else esac fi AC_SUBST(VERSION_SCRIPT_FLAGS) -AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) +AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -z "$VERSION_SCRIPT_FLAGS"]) dnl dnl We process the AC_ARG_WITH first so that later we can modify @@ -126,6 +128,8 @@ AC_ARG_WITH(http, [ --with-http add the HTTP support (on)]) AC_ARG_WITH(iconv, [ --with-iconv[[=DIR]] add ICONV support (on)]) +AC_ARG_WITH(icu, +[ --with-icu add ICU support (off)]) AC_ARG_WITH(iso8859x, [ --with-iso8859x add ISO8859X support if no iconv (on)]) AC_ARG_WITH(legacy, @@ -702,17 +706,23 @@ if test "$with_python" != "no" ; then echo Found python in $with_python/bin/python PYTHON="$with_python/bin/python" else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` - else - AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) + if test -x "$with_python/python.exe" + then + echo Found python in $with_python/python.exe + PYTHON="$with_python/python.exe" + else + if test -x "$with_python" + then + echo Found python in $with_python + PYTHON="$with_python" + else + if test -x "$PYTHON" + then + echo Found python in environment PYTHON=$PYTHON + with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` + else + AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) + fi fi fi fi @@ -739,7 +749,14 @@ if test "$with_python" != "no" ; then PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages else - echo could not find python$PYTHON_VERSION/Python.h + if test -r $with_python/include/Python.h -a \ + -d $with_python/lib/site-packages + then + PYTHON_INCLUDES=$with_python/include + PYTHON_SITE_PACKAGES=$with_python/lib/site-packages + else + echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h + fi fi fi if test ! -d "$PYTHON_SITE_PACKAGES" @@ -1306,6 +1323,23 @@ XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" XML_LIBTOOLLIBS="libxml2.la" AC_SUBST(WITH_ICONV) +WITH_ICU=0 +if test "$with_icu" != "yes" ; then + echo Disabling ICU support +else + ICU_CONFIG=icu-config + if ${ICU_CONFIG} --cflags >/dev/null 2>&1 + then + ICU_LIBS=`icu-config --ldflags` + LDFLAGS="$LDFLAGS $ICU_LIBS" + WITH_ICU=1 + echo Enabling ICU support + else + AC_MSG_ERROR([libicu config program icu-config not found]) + fi +fi +AC_SUBST(WITH_ICU) + WITH_ISO8859X=1 if test "$WITH_ICONV" != "1" ; then if test "$with_iso8859x" = "no" ; then @@ -1395,6 +1429,7 @@ WIN32_EXTRA_LIBADD= WIN32_EXTRA_LDFLAGS= CYGWIN_EXTRA_LDFLAGS= CYGWIN_EXTRA_PYTHON_LIBADD= +WIN32_EXTRA_PYTHON_LIBADD= case "$host" in *-*-mingw*) CPPFLAGS="$CPPFLAGS -DWIN32" @@ -1403,6 +1438,10 @@ case "$host" in AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) + if test "${PYTHON}" != "" + then + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}" + fi ;; *-*-cygwin*) CYGWIN_EXTRA_LDFLAGS="-no-undefined" @@ -1414,6 +1453,7 @@ case "$host" in esac AC_SUBST(WIN32_EXTRA_LIBADD) AC_SUBST(WIN32_EXTRA_LDFLAGS) +AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD) AC_SUBST(CYGWIN_EXTRA_LDFLAGS) AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) diff --git a/debugXML.c b/debugXML.c index 415889a..c26217a 100644 --- a/debugXML.c +++ b/debugXML.c @@ -2941,7 +2941,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, xmlGenericError(xmlGenericErrorContext, "Write command requires a filename argument\n"); else - xmlShellWrite(ctxt, arg, NULL, NULL); + xmlShellWrite(ctxt, arg, ctxt->node, NULL); #endif /* LIBXML_OUTPUT_ENABLED */ } else if (!strcmp(command, "grep")) { xmlShellGrep(ctxt, arg, ctxt->node, NULL); diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index e116c35..417e202 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -1,6 +1,6 @@ - + -List of constructors for libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  The XML C parser and toolkit of Gnome

                                  List of constructors for libxml2

                                  Developer Menu
                                  API Indexes
                                  Related links

                                  Type const htmlElemDesc *:

                                  htmlTagLookup
                                  +List of constructors for libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  The XML C parser and toolkit of Gnome

                                  List of constructors for libxml2

                                  Developer Menu
                                  API Indexes
                                  Related links

                                  Type SOCKET:

                                  xmlNanoFTPGetConnection
                                  +xmlNanoFTPGetSocket
                                  +

                                  Type const htmlElemDesc *:

                                  htmlTagLookup

                                  Type const htmlEntityDesc *:

                                  htmlEntityLookup
                                  htmlEntityValueLookup
                                  htmlParseEntityRef
                                  diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 33ac7f9..8f95296 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -1,6 +1,6 @@ - + -Module encoding from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module encoding from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  interface for the encoding conversion functions needed for XML basic encoding and iconv() support. Related specs are rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies [ISO-10646] UTF-8 and UTF-16 in Annexes [ISO-8859-1] ISO Latin-1 characters codes. [UNICODE] The Unicode Consortium, "The Unicode Standard -- Worldwide Character Encoding -- Version 1.0", Addison- Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is described in Unicode Technical Report #4. [US-ASCII] Coded Character Set--7-bit American Standard Code for Information Interchange, ANSI X3.4-1986.

                                  Table of Contents

                                  Enum xmlCharEncoding
                                  +    Module encoding from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module encoding from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  interface for the encoding conversion functions needed for XML basic encoding and iconv() support. Related specs are rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies [ISO-10646] UTF-8 and UTF-16 in Annexes [ISO-8859-1] ISO Latin-1 characters codes. [UNICODE] The Unicode Consortium, "The Unicode Standard -- Worldwide Character Encoding -- Version 1.0", Addison- Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is described in Unicode Technical Report #4. [US-ASCII] Coded Character Set--7-bit American Standard Code for Information Interchange, ANSI X3.4-1986.

                                  Table of Contents

                                  Structure uconv_t
                                  struct _uconv_t +
                                  Enum xmlCharEncoding
                                   
                                  Structure xmlCharEncodingHandler
                                  struct _xmlCharEncodingHandler
                                  Typedef xmlCharEncodingHandler * xmlCharEncodingHandlerPtr
                                   
                                  int	UTF8Toisolat1			(unsigned char * out, 
                                  int * outlen,
                                  const unsigned char * in,
                                  int * inlen)
                                  @@ -39,7 +40,10 @@ int xmlCharEncodingOutputFunc (unsigned
                                  xmlCharEncoding	xmlParseCharEncoding	(const char * name)
                                  void	xmlRegisterCharEncodingHandler	(xmlCharEncodingHandlerPtr handler)

                                  Description

                                  -

                                  Enum xmlCharEncoding

                                  Enum xmlCharEncoding {
                                  +

                                  Structure uconv_t

                                  Structure uconv_t
                                  struct _uconv_t { + UConverter * uconv : for conversion between an encoding and + UConverter * utf8 : for conversion between UTF-8 and UTF-16 +}

                                  Enum xmlCharEncoding

                                  Enum xmlCharEncoding {
                                       XML_CHAR_ENCODING_ERROR = -1 : No char encoding detected
                                       XML_CHAR_ENCODING_NONE = 0 : No char encoding detected
                                       XML_CHAR_ENCODING_UTF8 = 1 : UTF-8
                                  @@ -71,6 +75,8 @@ int	xmlCharEncodingOutputFunc	(unsigned
                                       xmlCharEncodingOutputFunc	output
                                       iconv_t	iconv_in
                                       iconv_t	iconv_out
                                  +    uconv_t *	uconv_in
                                  +    uconv_t *	uconv_out
                                   }

                                  Function: UTF8Toisolat1

                                  int	UTF8Toisolat1			(unsigned char * out, 
                                  int * outlen,
                                  const unsigned char * in,
                                  int * inlen)

                                  Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.

                                  out:a pointer to an array of bytes to store the result
                                  outlen:the length of @out
                                  in:a pointer to an array of UTF-8 chars
                                  inlen:the length of @in
                                  Returns:the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.

                                  Function: isolat1ToUTF8

                                  int	isolat1ToUTF8			(unsigned char * out, 
                                  int * outlen,
                                  const unsigned char * in,
                                  int * inlen)
                                  diff --git a/doc/html/libxml-entities.html b/doc/html/libxml-entities.html index 2f975e8..8493d1a 100644 --- a/doc/html/libxml-entities.html +++ b/doc/html/libxml-entities.html @@ -1,6 +1,6 @@ - + -Module nanoftp from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module nanoftp from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  minimal FTP implementation allowing to fetch resources like external subset.

                                  Table of Contents

                                  Function type: ftpDataCallback
                                  +    Module nanoftp from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module nanoftp from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  minimal FTP implementation allowing to fetch resources like external subset.

                                  Table of Contents

                                  #define INVALID_SOCKET
                                  #define SOCKET
                                  Function type: ftpDataCallback
                                   void	ftpDataCallback			(void * userData, 
                                  const char * data,
                                  int len)
                                  Function type: ftpListCallback
                                  @@ -26,9 +26,9 @@ void	ftpListCallback			(void * userData, 
                                  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)
                                  +
                                  SOCKET	xmlNanoFTPGetConnection		(void * ctx)
                                  int	xmlNanoFTPGetResponse		(void * ctx)
                                  -
                                  int	xmlNanoFTPGetSocket		(void * ctx, 
                                  const char * filename)
                                  +
                                  SOCKET	xmlNanoFTPGetSocket		(void * ctx, 
                                  const char * filename)
                                  void	xmlNanoFTPInit			(void)
                                  int	xmlNanoFTPList			(void * ctx, 
                                  ftpListCallback callback,
                                  void * userData,
                                  const char * filename)
                                  void *	xmlNanoFTPNewCtxt		(const char * URL)
                                  @@ -39,6 +39,8 @@ void ftpListCallback (void * userData,
                                  void	xmlNanoFTPScanProxy		(const char * URL)
                                  int	xmlNanoFTPUpdateURL		(void * ctx, 
                                  const char * URL)

                                  Description

                                  +

                                  Macro: INVALID_SOCKET

                                  #define INVALID_SOCKET

                                  macro used to provide portability of code to windows sockets the value to be used when the socket is not valid

                                  +

                                  Macro: SOCKET

                                  #define SOCKET

                                  macro used to provide portability of code to windows sockets

                                  Function type: ftpDataCallback

                                  Function type: ftpDataCallback
                                   void	ftpDataCallback			(void * userData, 
                                  const char * data,
                                  int len)

                                  A callback for the xmlNanoFTPGet command.

                                  userData:the user provided context
                                  data:the data received
                                  len:its size in bytes

                                  @@ -65,11 +67,11 @@ void ftpListCallback (void * userData,
                                  const char * filename,

                                  Frees the context after closing the connection.

                                  ctx:an FTP context

                                  Function: xmlNanoFTPGet

                                  int	xmlNanoFTPGet			(void * ctx, 
                                  ftpDataCallback callback,
                                  void * userData,
                                  const char * filename)

                                  Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.

                                  -
                                  ctx:an FTP context
                                  callback:the user callback
                                  userData:the user callback data
                                  filename:the file to retrieve
                                  Returns:-1 incase of error, 0 otherwise

                                  Function: xmlNanoFTPGetConnection

                                  int	xmlNanoFTPGetConnection		(void * ctx)
                                  +
                                  ctx:an FTP context
                                  callback:the user callback
                                  userData:the user callback data
                                  filename:the file to retrieve
                                  Returns:-1 incase of error, 0 otherwise

                                  Function: xmlNanoFTPGetConnection

                                  SOCKET	xmlNanoFTPGetConnection		(void * ctx)

                                  Try to open a data connection to the server. Currently only passive mode is supported.

                                  ctx:an FTP context
                                  Returns:-1 incase of error, 0 otherwise

                                  Function: xmlNanoFTPGetResponse

                                  int	xmlNanoFTPGetResponse		(void * ctx)

                                  Get the response from the FTP server after a command.

                                  -
                                  ctx:an FTP context
                                  Returns:the code number

                                  Function: xmlNanoFTPGetSocket

                                  int	xmlNanoFTPGetSocket		(void * ctx, 
                                  const char * filename)
                                  +
                                  ctx:an FTP context
                                  Returns:the code number

                                  Function: xmlNanoFTPGetSocket

                                  SOCKET	xmlNanoFTPGetSocket		(void * ctx, 
                                  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

                                  diff --git a/doc/html/libxml-nanohttp.html b/doc/html/libxml-nanohttp.html index b1cd9df..8d6f78e 100644 --- a/doc/html/libxml-nanohttp.html +++ b/doc/html/libxml-nanohttp.html @@ -1,6 +1,6 @@ - + -Module xmlversion from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module xmlversion from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  compile-time version informations for the XML library

                                  Table of Contents

                                  #define ATTRIBUTE_UNUSED
                                  #define DEBUG_MEMORY_LOCATION
                                  #define LIBXML_ATTR_ALLOC_SIZE
                                  #define LIBXML_ATTR_FORMAT
                                  #define LIBXML_AUTOMATA_ENABLED
                                  #define LIBXML_C14N_ENABLED
                                  #define LIBXML_CATALOG_ENABLED
                                  #define LIBXML_DEBUG_ENABLED
                                  #define LIBXML_DEBUG_RUNTIME
                                  #define LIBXML_DOCB_ENABLED
                                  #define LIBXML_DOTTED_VERSION
                                  #define LIBXML_EXPR_ENABLED
                                  #define LIBXML_FTP_ENABLED
                                  #define LIBXML_HTML_ENABLED
                                  #define LIBXML_HTTP_ENABLED
                                  #define LIBXML_ICONV_ENABLED
                                  #define LIBXML_ISO8859X_ENABLED
                                  #define LIBXML_LEGACY_ENABLED
                                  #define LIBXML_MODULES_ENABLED
                                  #define LIBXML_MODULE_EXTENSION
                                  #define LIBXML_OUTPUT_ENABLED
                                  #define LIBXML_PATTERN_ENABLED
                                  #define LIBXML_PUSH_ENABLED
                                  #define LIBXML_READER_ENABLED
                                  #define LIBXML_REGEXP_ENABLED
                                  #define LIBXML_SAX1_ENABLED
                                  #define LIBXML_SCHEMAS_ENABLED
                                  #define LIBXML_SCHEMATRON_ENABLED
                                  #define LIBXML_TEST_VERSION
                                  #define LIBXML_THREAD_ENABLED
                                  #define LIBXML_TREE_ENABLED
                                  #define LIBXML_UNICODE_ENABLED
                                  #define LIBXML_VALID_ENABLED
                                  #define LIBXML_VERSION
                                  #define LIBXML_VERSION_EXTRA
                                  #define LIBXML_VERSION_STRING
                                  #define LIBXML_WRITER_ENABLED
                                  #define LIBXML_XINCLUDE_ENABLED
                                  #define LIBXML_XPATH_ENABLED
                                  #define LIBXML_XPTR_ENABLED
                                  #define LIBXML_ZLIB_ENABLED
                                  #define WITHOUT_TRIO
                                  #define WITH_TRIO
                                  void	xmlCheckVersion			(int version)
                                  + Module xmlversion from libxml2
                                  Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
                                  Made with Libxml2 Logo

                                  Module xmlversion from libxml2

                                  API Menu
                                  API Indexes
                                  Related links

                                  compile-time version informations for the XML library

                                  Table of Contents

                                  #define ATTRIBUTE_UNUSED
                                  #define DEBUG_MEMORY_LOCATION
                                  #define LIBXML_ATTR_ALLOC_SIZE
                                  #define LIBXML_ATTR_FORMAT
                                  #define LIBXML_AUTOMATA_ENABLED
                                  #define LIBXML_C14N_ENABLED
                                  #define LIBXML_CATALOG_ENABLED
                                  #define LIBXML_DEBUG_ENABLED
                                  #define LIBXML_DEBUG_RUNTIME
                                  #define LIBXML_DOCB_ENABLED
                                  #define LIBXML_DOTTED_VERSION
                                  #define LIBXML_EXPR_ENABLED
                                  #define LIBXML_FTP_ENABLED
                                  #define LIBXML_HTML_ENABLED
                                  #define LIBXML_HTTP_ENABLED
                                  #define LIBXML_ICONV_ENABLED
                                  #define LIBXML_ICU_ENABLED
                                  #define LIBXML_ISO8859X_ENABLED
                                  #define LIBXML_LEGACY_ENABLED
                                  #define LIBXML_MODULES_ENABLED
                                  #define LIBXML_MODULE_EXTENSION
                                  #define LIBXML_OUTPUT_ENABLED
                                  #define LIBXML_PATTERN_ENABLED
                                  #define LIBXML_PUSH_ENABLED
                                  #define LIBXML_READER_ENABLED
                                  #define LIBXML_REGEXP_ENABLED
                                  #define LIBXML_SAX1_ENABLED
                                  #define LIBXML_SCHEMAS_ENABLED
                                  #define LIBXML_SCHEMATRON_ENABLED
                                  #define LIBXML_TEST_VERSION
                                  #define LIBXML_THREAD_ENABLED
                                  #define LIBXML_TREE_ENABLED
                                  #define LIBXML_UNICODE_ENABLED
                                  #define LIBXML_VALID_ENABLED
                                  #define LIBXML_VERSION
                                  #define LIBXML_VERSION_EXTRA
                                  #define LIBXML_VERSION_STRING
                                  #define LIBXML_WRITER_ENABLED
                                  #define LIBXML_XINCLUDE_ENABLED
                                  #define LIBXML_XPATH_ENABLED
                                  #define LIBXML_XPTR_ENABLED
                                  #define LIBXML_ZLIB_ENABLED
                                  #define WITHOUT_TRIO
                                  #define WITH_TRIO
                                  void	xmlCheckVersion			(int version)

                                  Description

                                  Macro: ATTRIBUTE_UNUSED

                                  #define ATTRIBUTE_UNUSED

                                  Macro used to signal to GCC unused function parameters

                                  Macro: DEBUG_MEMORY_LOCATION

                                  #define DEBUG_MEMORY_LOCATION

                                  Whether the memory debugging is configured in

                                  @@ -28,6 +28,7 @@ A:link, A:visited, A:active { text-decoration: underline }

                                  Macro: LIBXML_HTML_ENABLED

                                  #define LIBXML_HTML_ENABLED

                                  Whether the HTML support is configured in

                                  Macro: LIBXML_HTTP_ENABLED

                                  #define LIBXML_HTTP_ENABLED

                                  Whether the HTTP support is configured in

                                  Macro: LIBXML_ICONV_ENABLED

                                  #define LIBXML_ICONV_ENABLED

                                  Whether iconv support is available

                                  +

                                  Macro: LIBXML_ICU_ENABLED

                                  #define LIBXML_ICU_ENABLED

                                  Whether icu support is available

                                  Macro: LIBXML_ISO8859X_ENABLED

                                  #define LIBXML_ISO8859X_ENABLED

                                  Whether ISO-8859-* support is made available in case iconv is not

                                  Macro: LIBXML_LEGACY_ENABLED

                                  #define LIBXML_LEGACY_ENABLED

                                  Whether the deprecated APIs are compiled in for compatibility

                                  Macro: LIBXML_MODULES_ENABLED

                                  #define LIBXML_MODULES_ENABLED

                                  Whether the module interfaces are compiled in

                                  diff --git a/doc/html/libxml-xmlwriter.html b/doc/html/libxml-xmlwriter.html index 7804ce0..661dbd7 100644 --- a/doc/html/libxml-xmlwriter.html +++ b/doc/html/libxml-xmlwriter.html @@ -1,6 +1,6 @@ - + -