From 8285ba172641308c6d4775cc38d637ceacb0422a Mon Sep 17 00:00:00 2001 From: scottmg Date: Tue, 23 Jun 2015 12:00:06 -0700 Subject: Upgrade to libxml 2.9.2 and libxslt 1.1.28 The previous version of libxml was released in 2008, so this is a large jump. One notable functionality change is that the parser no longer accepts (with no space between the end quote of "a" and the xmlns= attribute). This seems correct to not accept, but could potentially cause some minor compatibility differences. This is the change in xmpp_login_handler_unittest.js. A second difference is that the column number reported in error conditions has changed in some cases. This causes some expected-error LayoutTests to differ in textual output. These seem reasonable and should hopefully not cause any major compatibility issues. Blink suppressions at https://codereview.chromium.org/1181403003/ which need to land first. BUG=463958,502468 Review URL: https://codereview.chromium.org/1193533007 Cr-Commit-Position: refs/heads/master@{#335721} --- third_party/libxml/BUILD.gn | 2 + third_party/libxml/README.chromium | 93 +- .../libxml/build/generate-win32-headers.bat | 9 - third_party/libxml/libxml.gyp | 2 + third_party/libxml/linux/config.h | 80 +- .../libxml/linux/include/libxml/xmlversion.h | 32 +- third_party/libxml/linux/xml2-config | 8 +- third_party/libxml/mac/config.h | 82 +- third_party/libxml/mac/include/libxml/xmlversion.h | 32 +- third_party/libxml/patches/LoadLibraryA | 16 - third_party/libxml/patches/bug_651202 | 13 - third_party/libxml/patches/icu | 453 - third_party/libxml/patches/icu-configure | 28 - third_party/libxml/patches/icu-win32 | 68 - third_party/libxml/patches/snprintf_config | 14 - third_party/libxml/patches/snprintf_win32config | 14 - third_party/libxml/patches/win32-clobber-makefile | 19 - .../libxml/patches/win32-no-posix-error-codes | 14 - third_party/libxml/patches/xmlregexp-bogus-cast | 15 - third_party/libxml/src/ChangeLog | 2 +- third_party/libxml/src/Copyright | 14 +- third_party/libxml/src/DOCBparser.c | 12 +- third_party/libxml/src/HTMLparser.c | 324 +- third_party/libxml/src/HTMLtree.c | 171 +- third_party/libxml/src/INSTALL | 365 - third_party/libxml/src/Makefile.am | 1279 ++ third_party/libxml/src/Makefile.tests | 41 + third_party/libxml/src/NEWS | 658 +- third_party/libxml/src/README | 2 +- third_party/libxml/src/README.tests | 15 +- third_party/libxml/src/SAX.c | 2 +- third_party/libxml/src/SAX2.c | 246 +- third_party/libxml/src/acconfig.h | 16 - third_party/libxml/src/acinclude.m4 | 8 +- third_party/libxml/src/aclocal.m4 | 8956 ---------- third_party/libxml/src/bakefile/Bakefiles.bkgen | 15 + third_party/libxml/src/bakefile/Readme.txt | 92 + third_party/libxml/src/bakefile/libxml2.bkl | 749 + third_party/libxml/src/buf.c | 1304 ++ third_party/libxml/src/buf.h | 72 + third_party/libxml/src/c14n.c | 641 +- third_party/libxml/src/catalog.c | 119 +- third_party/libxml/src/chvalid.c | 164 +- third_party/libxml/src/config.guess | 1501 -- third_party/libxml/src/config.h.in | 311 - third_party/libxml/src/config.sub | 1705 -- third_party/libxml/src/configure | 16827 ------------------- third_party/libxml/src/configure.ac | 1664 ++ third_party/libxml/src/configure.in | 1462 -- third_party/libxml/src/debugXML.c | 204 +- third_party/libxml/src/depcomp | 630 - third_party/libxml/src/dict.c | 339 +- third_party/libxml/src/elfgcchack.h | 206 +- third_party/libxml/src/enc.h | 32 + third_party/libxml/src/encoding.c | 1221 +- third_party/libxml/src/entities.c | 151 +- third_party/libxml/src/error.c | 109 +- third_party/libxml/src/globals.c | 53 +- third_party/libxml/src/hash.c | 81 +- third_party/libxml/src/include/Makefile.am | 5 + third_party/libxml/src/include/libxml/DOCBparser.h | 18 +- third_party/libxml/src/include/libxml/HTMLparser.h | 48 +- third_party/libxml/src/include/libxml/HTMLtree.h | 38 +- third_party/libxml/src/include/libxml/Makefile.am | 54 + third_party/libxml/src/include/libxml/SAX.h | 74 +- third_party/libxml/src/include/libxml/SAX2.h | 74 +- third_party/libxml/src/include/libxml/c14n.h | 2 +- third_party/libxml/src/include/libxml/catalog.h | 70 +- third_party/libxml/src/include/libxml/debugXML.h | 52 +- third_party/libxml/src/include/libxml/dict.h | 21 +- third_party/libxml/src/include/libxml/encoding.h | 45 +- third_party/libxml/src/include/libxml/entities.h | 9 +- third_party/libxml/src/include/libxml/globals.h | 17 +- third_party/libxml/src/include/libxml/hash.h | 48 +- third_party/libxml/src/include/libxml/list.h | 52 +- third_party/libxml/src/include/libxml/nanoftp.h | 163 + third_party/libxml/src/include/libxml/nanohttp.h | 81 + third_party/libxml/src/include/libxml/parser.h | 151 +- .../libxml/src/include/libxml/parserInternals.h | 179 +- third_party/libxml/src/include/libxml/relaxng.h | 8 +- .../libxml/src/include/libxml/schemasInternals.h | 4 +- third_party/libxml/src/include/libxml/schematron.h | 22 +- third_party/libxml/src/include/libxml/tree.h | 441 +- third_party/libxml/src/include/libxml/valid.h | 144 +- third_party/libxml/src/include/libxml/xlink.h | 14 +- third_party/libxml/src/include/libxml/xmlIO.h | 138 +- .../libxml/src/include/libxml/xmlautomata.h | 44 +- third_party/libxml/src/include/libxml/xmlerror.h | 16 +- third_party/libxml/src/include/libxml/xmlexports.h | 4 +- third_party/libxml/src/include/libxml/xmlmodule.h | 2 +- third_party/libxml/src/include/libxml/xmlreader.h | 44 +- third_party/libxml/src/include/libxml/xmlsave.h | 3 +- third_party/libxml/src/include/libxml/xmlschemas.h | 32 +- .../libxml/src/include/libxml/xmlschemastypes.h | 40 +- third_party/libxml/src/include/libxml/xmlstring.h | 6 +- .../libxml/src/include/libxml/xmlversion.h.in | 24 +- third_party/libxml/src/include/libxml/xmlwriter.h | 5 +- third_party/libxml/src/include/libxml/xpath.h | 97 +- .../libxml/src/include/libxml/xpathInternals.h | 160 +- third_party/libxml/src/include/libxml/xpointer.h | 46 +- third_party/libxml/src/include/win32config.h | 2 + third_party/libxml/src/include/wsockcompat.h | 7 +- third_party/libxml/src/install-sh | 520 - third_party/libxml/src/legacy.c | 32 +- .../libxml/src/libxml-2.0-uninstalled.pc.in | 2 +- third_party/libxml/src/libxml-2.0.pc.in | 2 +- third_party/libxml/src/libxml.3 | 71 + third_party/libxml/src/libxml.h | 21 +- third_party/libxml/src/libxml.spec.in | 61 +- third_party/libxml/src/libxml2-config.cmake.in | 50 + third_party/libxml/src/libxml2.spec | 132 - third_party/libxml/src/libxml2.syms | 2281 +++ third_party/libxml/src/list.c | 76 +- third_party/libxml/src/ltmain.sh | 8406 --------- third_party/libxml/src/macos/README | 8 + .../libxml/src/macos/libxml2.mcp.xml.sit.hqx | 1 + third_party/libxml/src/macos/src/XMLTestPrefix.h | 1 + third_party/libxml/src/macos/src/XMLTestPrefix2.h | 1 + third_party/libxml/src/macos/src/config-mac.h | 192 + .../libxml/src/macos/src/libxml2_GUSIConfig.cp | 1 + third_party/libxml/src/macos/src/macos_main.c | 1 + third_party/libxml/src/missing | 376 - third_party/libxml/src/mkinstalldirs | 162 - third_party/libxml/src/nanoftp.c | 2121 +++ third_party/libxml/src/nanohttp.c | 1890 +++ third_party/libxml/src/parser.c | 1617 +- third_party/libxml/src/parserInternals.c | 238 +- third_party/libxml/src/pattern.c | 184 +- third_party/libxml/src/relaxng.c | 184 +- third_party/libxml/src/runsuite.c | 42 +- third_party/libxml/src/runtest.c | 143 +- third_party/libxml/src/runxmlconf.c | 607 + third_party/libxml/src/save.h | 35 + third_party/libxml/src/schematron.c | 36 +- third_party/libxml/src/testAutomata.c | 4 +- third_party/libxml/src/testC14N.c | 104 +- third_party/libxml/src/testHTML.c | 30 +- third_party/libxml/src/testModule.c | 4 +- third_party/libxml/src/testRegexp.c | 18 +- third_party/libxml/src/testRelax.c | 10 +- third_party/libxml/src/testSAX.c | 22 +- third_party/libxml/src/testSchemas.c | 10 +- third_party/libxml/src/testThreads.c | 6 +- third_party/libxml/src/testThreadsWin32.c | 6 +- third_party/libxml/src/testXPath.c | 16 +- third_party/libxml/src/testapi.c | 997 +- third_party/libxml/src/testchar.c | 617 + third_party/libxml/src/testdict.c | 444 + third_party/libxml/src/testlimits.c | 1637 ++ third_party/libxml/src/testrecurse.c | 965 ++ third_party/libxml/src/threads.c | 19 +- third_party/libxml/src/timsort.h | 514 + third_party/libxml/src/tree.c | 617 +- third_party/libxml/src/trio.c | 436 +- third_party/libxml/src/trio.h | 16 +- third_party/libxml/src/triodef.h | 6 + third_party/libxml/src/trionan.c | 74 +- third_party/libxml/src/trionan.h | 2 +- third_party/libxml/src/triostr.c | 154 +- third_party/libxml/src/uri.c | 433 +- third_party/libxml/src/valid.c | 239 +- third_party/libxml/src/win32/Makefile | 465 - third_party/libxml/src/win32/Makefile.bcb | 24 +- third_party/libxml/src/win32/Makefile.mingw | 38 +- third_party/libxml/src/win32/Makefile.msvc | 46 +- third_party/libxml/src/win32/VC10/README.vc10 | 27 + third_party/libxml/src/win32/VC10/RuleSet1.ruleset | 3 + third_party/libxml/src/win32/configure.js | 18 +- third_party/libxml/src/win32/libxml2.def.src | 26 + third_party/libxml/src/win32/wince/libxml2.vcb | 1 + third_party/libxml/src/win32/wince/libxml2.vcl | 122 + third_party/libxml/src/win32/wince/libxml2.vco | 1 + third_party/libxml/src/win32/wince/libxml2.vcp | 5273 ++++++ third_party/libxml/src/win32/wince/libxml2.vcw | 41 + third_party/libxml/src/win32/wince/wincecompat.c | 68 + third_party/libxml/src/win32/wince/wincecompat.h | 50 + third_party/libxml/src/xinclude.c | 151 +- third_party/libxml/src/xlink.c | 12 +- third_party/libxml/src/xml2-config.1 | 1 - third_party/libxml/src/xml2-config.in | 6 +- third_party/libxml/src/xmlIO.c | 414 +- third_party/libxml/src/xmlcatalog.c | 35 +- third_party/libxml/src/xmllint.c | 155 +- third_party/libxml/src/xmlmemory.c | 32 +- third_party/libxml/src/xmlmodule.c | 21 +- third_party/libxml/src/xmlreader.c | 400 +- third_party/libxml/src/xmlregexp.c | 266 +- third_party/libxml/src/xmlsave.c | 441 +- third_party/libxml/src/xmlschemas.c | 849 +- third_party/libxml/src/xmlschemastypes.c | 366 +- third_party/libxml/src/xmlstring.c | 34 +- third_party/libxml/src/xmlunicode.c | 1270 +- third_party/libxml/src/xmlwriter.c | 70 +- third_party/libxml/src/xpath.c | 1972 ++- third_party/libxml/src/xpointer.c | 137 +- third_party/libxml/src/xstc/Makefile.am | 132 + third_party/libxml/src/xstc/xstc.py | 693 + third_party/libxml/src/xzlib.c | 798 + third_party/libxml/src/xzlib.h | 19 + third_party/libxml/win32/config.h | 2 + .../libxml/win32/include/libxml/xmlversion.h | 32 +- 201 files changed, 36724 insertions(+), 49942 deletions(-) delete mode 100755 third_party/libxml/build/generate-win32-headers.bat delete mode 100644 third_party/libxml/patches/LoadLibraryA delete mode 100644 third_party/libxml/patches/bug_651202 delete mode 100644 third_party/libxml/patches/icu delete mode 100644 third_party/libxml/patches/icu-configure delete mode 100644 third_party/libxml/patches/icu-win32 delete mode 100644 third_party/libxml/patches/snprintf_config delete mode 100644 third_party/libxml/patches/snprintf_win32config delete mode 100644 third_party/libxml/patches/win32-clobber-makefile delete mode 100644 third_party/libxml/patches/win32-no-posix-error-codes delete mode 100644 third_party/libxml/patches/xmlregexp-bogus-cast delete mode 100644 third_party/libxml/src/INSTALL create mode 100644 third_party/libxml/src/Makefile.am create mode 100644 third_party/libxml/src/Makefile.tests delete mode 100644 third_party/libxml/src/acconfig.h delete mode 100644 third_party/libxml/src/aclocal.m4 create mode 100644 third_party/libxml/src/bakefile/Bakefiles.bkgen create mode 100644 third_party/libxml/src/bakefile/Readme.txt create mode 100644 third_party/libxml/src/bakefile/libxml2.bkl create mode 100644 third_party/libxml/src/buf.c create mode 100644 third_party/libxml/src/buf.h delete mode 100755 third_party/libxml/src/config.guess delete mode 100644 third_party/libxml/src/config.h.in delete mode 100755 third_party/libxml/src/config.sub delete mode 100755 third_party/libxml/src/configure create mode 100644 third_party/libxml/src/configure.ac delete mode 100644 third_party/libxml/src/configure.in delete mode 100755 third_party/libxml/src/depcomp create mode 100644 third_party/libxml/src/enc.h create mode 100644 third_party/libxml/src/include/Makefile.am create mode 100644 third_party/libxml/src/include/libxml/Makefile.am create mode 100644 third_party/libxml/src/include/libxml/nanoftp.h create mode 100644 third_party/libxml/src/include/libxml/nanohttp.h delete mode 100755 third_party/libxml/src/install-sh create mode 100644 third_party/libxml/src/libxml.3 create mode 100644 third_party/libxml/src/libxml2-config.cmake.in delete mode 100644 third_party/libxml/src/libxml2.spec create mode 100644 third_party/libxml/src/libxml2.syms delete mode 100755 third_party/libxml/src/ltmain.sh create mode 100644 third_party/libxml/src/macos/README create mode 100644 third_party/libxml/src/macos/libxml2.mcp.xml.sit.hqx create mode 100644 third_party/libxml/src/macos/src/XMLTestPrefix.h create mode 100644 third_party/libxml/src/macos/src/XMLTestPrefix2.h create mode 100644 third_party/libxml/src/macos/src/config-mac.h create mode 100644 third_party/libxml/src/macos/src/libxml2_GUSIConfig.cp create mode 100644 third_party/libxml/src/macos/src/macos_main.c delete mode 100755 third_party/libxml/src/missing delete mode 100755 third_party/libxml/src/mkinstalldirs create mode 100644 third_party/libxml/src/nanoftp.c create mode 100644 third_party/libxml/src/nanohttp.c create mode 100644 third_party/libxml/src/runxmlconf.c create mode 100644 third_party/libxml/src/save.h create mode 100644 third_party/libxml/src/testchar.c create mode 100644 third_party/libxml/src/testdict.c create mode 100644 third_party/libxml/src/testlimits.c create mode 100644 third_party/libxml/src/testrecurse.c create mode 100644 third_party/libxml/src/timsort.h delete mode 100644 third_party/libxml/src/win32/Makefile create mode 100644 third_party/libxml/src/win32/VC10/README.vc10 create mode 100644 third_party/libxml/src/win32/VC10/RuleSet1.ruleset create mode 100644 third_party/libxml/src/win32/wince/libxml2.vcb create mode 100644 third_party/libxml/src/win32/wince/libxml2.vcl create mode 100644 third_party/libxml/src/win32/wince/libxml2.vco create mode 100644 third_party/libxml/src/win32/wince/libxml2.vcp create mode 100644 third_party/libxml/src/win32/wince/libxml2.vcw create mode 100644 third_party/libxml/src/win32/wince/wincecompat.c create mode 100644 third_party/libxml/src/win32/wince/wincecompat.h create mode 100644 third_party/libxml/src/xstc/Makefile.am create mode 100755 third_party/libxml/src/xstc/xstc.py create mode 100644 third_party/libxml/src/xzlib.c create mode 100644 third_party/libxml/src/xzlib.h (limited to 'third_party/libxml') diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn index a12d13d..e6e1089 100644 --- a/third_party/libxml/BUILD.gn +++ b/third_party/libxml/BUILD.gn @@ -39,6 +39,8 @@ static_library("libxml") { "src/SAX.c", "src/SAX2.c", "src/acconfig.h", + "src/buf.c", + "src/buf.h", "src/c14n.c", "src/catalog.c", "src/chvalid.c", diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index 1f3162f..682c659 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium @@ -1,62 +1,51 @@ Name: libxml URL: http://xmlsoft.org -Version: 2.7.7 +Version: 2.9.2 License: MIT License File: src/Copyright Security Critical: yes Description: -The src/ directory contains a partial snapshot of the libxml library -with the patches in the patches/ directories applied. -See the files in that directory for discussion of their effects. -Current version: 2.7.7. +libxml2 from libxml.org. Modifications: -- Converted to utf-8 with: vim +"argdo write ++enc=utf-8" *.c -- Import XPath fix http://git.gnome.org/browse/libxml2/commit/?id=91d19754d46acd4a639a8b9e31f50f31c78f8c9c -- Import follow-on for above commit: http://git.gnome.org/browse/libxml2/commit/?id=ea90b894146030c214a7df6d8375310174f134b9 -- Import additional XPath fix http://git.gnome.org/browse/libxml2/commit/?id=df83c17e5a2646bd923f75e5e507bc80d73c9722 -- Import follow-on fix for above commit: http://git.gnome.org/browse/libxml2/commit/?id=fec31bcd452e77c10579467ca87a785b41115de6 -- And a follow-on fix to the previous two fixes, committed upstream: http://git.gnome.org/browse/libxml2/commit/?id=f5048b3e71fc30ad096970b8df6e7af073bae4cb (slightly differently, but we can drop our local fix on the next roll). -- Add a fix for handling of unknown namespaces, commit upstream is pending. -- Add fixes for ending the parse properly if a SAX callback calls xmlStopParser(), commit upstream is pending. -- Add fix for entities, commit upstream is http://git.gnome.org/browse/libxml2/commit/?id=5bd3c061823a8499b27422aee04ea20aae24f03e -- Import UTF-8 fix from upstream: http://git.gnome.org/browse/libxml2/commit/?id=0795348aeb86648723bc391e4d02e20631c10bca -- Import XPath fix http://git.gnome.org/browse/libxml2/commit/xpath.c?id=2ddecc23862bab1a9a9e51e097aefc92ec305e28 -- Merge clang warning fix http://git.gnome.org/browse/libxml2/commit/?id=aae48e64dfbf2b46b157a4c1857e30645116388f -- Add a fix for proper escaping of xpointer expressions, commit upstream is pending. -- Add helper classes in chromium/libxml_utils.cc and chromium/include/libxml/libxml_utils.h. -- Add a tweak to limit problems caused by excessive strings and buffers. -- Change the xmlNs struct a little bit, so it looks like it has no children - if treated as a generic xmlNode object. -- Fix pretty harmless use-after-free in generate-id function. -- Merge a clang warning fix http://git.gnome.org/browse/libxml2/commit/?id=713434d2309da469d64b35e163ea6556dadccada -- Import attribute normalization fix http://git.gnome.org/browse/libxml2/commit/?id=6a36fbe3b3e001a8a840b5c1fdd81cefc9947f0d -- Merge a redundant comparison fix http://git.gnome.org/browse/libxml2/commit/?id=2af19f985b911b6dc6ada478ba8d201d2ddc9309 -- Merge a redundant comparisons fix https://git.gnome.org/browse/libxml2/commit/?id=eea38159be421dbafbee38f40e239f91734bc713 -- Merge XML_PARSER_EOF checks https://git.gnome.org/browse/libxml2/commit/?id=48b4cdde3483e054af8ea02e0cd7ee467b0e9a50 and https://git.gnome.org/browse/libxml2/commit/?id=e50ba8164eee06461c73cd8abb9b46aa0be81869 -- Prevent snprintf from being defined as _snprintf on VS 2015. -- Make ucrt of Win10 SDK not define POSIX error codes. -- Delete/disable nanoftp and nanohttp. - -To import a new snapshot of libxml: - -- Visit http://xmlsoft.org/downloads.html and download the latest source - distribution. -- Copy the files into this directory, omitting files which have been omitted - here. E.g.: for i in $(find . -type f); do cp ../libxml-newver/$i $i; done - This should clobber all local changes to this directory. -- Apply the patches in patches/ and fix any problems. - UPDATE THOSE PATCHES OR EVAN WILL HUNT YOU DOWN. -- On a Linux system, - $ cd linux - $ ../configure --without-iconv --without-ftp --without-http - to generate config.h and include/libxml/xmlversion.h for Linux. -- On a Mac, - $ cd mac - $ ../configure --without-iconv --without-ftp --without-http - to generate config.h and include/libxml/xmlversion.h for Macs. -- On Windows, run build/generate-win32-headers.bat to re-generate config.h and - include/libxml/xmlversion.h for Windows builds. -- Update this README to reflect the new version number. +- Add helper classes in chromium/libxml_utils.cc and + chromium/include/libxml/libxml_utils.h. +- Import https://git.gnome.org/browse/libxml2/commit/?id=7580ce0a7f53891de520fed2c0e360266c286da6 + from upstream. + + +To import a new snapshot: + +On Linux, get the latest tar, untar, and replace src/ with libxml2-X.Y.Z/. + +Remove: + src/doc/ + src/example/ + src/os400/ + src/python/ + src/result/ + src/test/ + src/vms/ + src/VxWorks/ + +Generate config.h, include/libxml/xmlversion.h, and xml2-config: + +cd linux +../src/configure --without-iconv --with-icu --without-ftp --without-http +cd .. +Patch config.h to not define HAVE_RAND_R since we use this file on Android +and it does not have it. + +On a Mac, do the same in the mac/ subdir for config.h and +include/libxml/xmlversion.h and copy those to the Linux box in mac/ + +On a Windows box: +cd libxml2-2.9.2\win32 +cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes ftp=no http=no +Then copy config.h and include/libxml/xmlversion.h to win32/ on Linux. + + +Update BUILD.gn and libxml.gyp as necessary to add/remove files, etc. + diff --git a/third_party/libxml/build/generate-win32-headers.bat b/third_party/libxml/build/generate-win32-headers.bat deleted file mode 100755 index 1d0f85d..0000000 --- a/third_party/libxml/build/generate-win32-headers.bat +++ /dev/null @@ -1,9 +0,0 @@ -REM Generate config.h and xmlversion.h. We put the generated files in -REM win32 so they don't get included on other platforms. - -cd %~dp0\..\win32 -cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes -move ..\config.h . - -md include\libxml -move ..\include\libxml\xmlversion.h include\libxml\ diff --git a/third_party/libxml/libxml.gyp b/third_party/libxml/libxml.gyp index a3cfea9..dc4c501 100644 --- a/third_party/libxml/libxml.gyp +++ b/third_party/libxml/libxml.gyp @@ -132,6 +132,8 @@ 'src/include/win32config.h', 'src/include/wsockcompat.h', 'src/acconfig.h', + 'src/buf.c', + 'src/buf.h', 'src/c14n.c', 'src/catalog.c', 'src/chvalid.c', diff --git a/third_party/libxml/linux/config.h b/third_party/libxml/linux/config.h index ca2f440..393906f 100644 --- a/third_party/libxml/linux/config.h +++ b/third_party/libxml/linux/config.h @@ -1,21 +1,8 @@ /* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ -#define PACKAGE "libxml2" -#define VERSION "2.7.7" -#define HAVE_LIBZ 1 -/* #undef HAVE_LIBM */ -#define HAVE_ISINF /**/ -#define HAVE_ISNAN /**/ -/* #undef HAVE_LIBHISTORY */ -/* #undef HAVE_LIBREADLINE */ -#define HAVE_LIBPTHREAD /**/ -#define HAVE_PTHREAD_H /**/ +/* config.h.in. Generated from configure.ac by autoheader. */ -/* Define if IPV6 support is there */ -#define SUPPORT_IP6 /**/ - -/* Define if getaddrinfo is there */ -#define HAVE_GETADDRINFO /**/ +/* Type cast for the gethostbyname() argument */ +#define GETHOSTBYNAME_ARG_CAST /**/ /* Define to 1 if you have the header file. */ /* #undef HAVE_ANSIDECL_H */ @@ -86,8 +73,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the header file. */ -/* #undef HAVE_INTTYPES_H_H */ +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 /* Define if isinf is there */ #define HAVE_ISINF /**/ @@ -101,6 +88,9 @@ /* Define if history library is there (-lhistory) */ /* #undef HAVE_LIBHISTORY */ +/* Have compression library */ +/* #undef HAVE_LIBLZMA */ + /* Define if pthread library is there (-lpthread) */ #define HAVE_LIBPTHREAD /**/ @@ -116,6 +106,9 @@ /* Define to 1 if you have the `localtime' function. */ #define HAVE_LOCALTIME 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LZMA_H */ + /* Define to 1 if you have the header file. */ #define HAVE_MALLOC_H 1 @@ -125,6 +118,17 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `munmap' function. */ +#define HAVE_MUNMAP 1 + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + /* Define to 1 if you have the header file. */ /* #undef HAVE_NAN_H */ @@ -146,6 +150,15 @@ /* Define if is there */ #define HAVE_PTHREAD_H /**/ +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `rand_r' function. */ +/* #undef HAVE_RAND_R */ + /* Define to 1 if you have the header file. */ #define HAVE_RESOLV_H 1 @@ -164,6 +177,9 @@ /* Define to 1 if you have the `sprintf' function. */ #define HAVE_SPRINTF 1 +/* Define to 1 if you have the `srand' function. */ +#define HAVE_SRAND 1 + /* Define to 1 if you have the `sscanf' function. */ #define HAVE_SSCANF 1 @@ -226,6 +242,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 +/* Define to 1 if you have the `time' function. */ +#define HAVE_TIME 1 + /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 @@ -281,8 +300,8 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "" -/* Define to 1 if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 +/* Type cast for the send() function 2nd arg */ +#define SEND_ARG2_CAST /**/ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -290,23 +309,26 @@ /* Support for IPv6 */ #define SUPPORT_IP6 /**/ +/* Define if va_list is an array type */ +#define VA_LIST_IS_ARRAY 1 + /* Version number of package */ -#define VERSION "2.7.7" +#define VERSION "2.9.2" /* Determine what socket length (socklen_t) data type is */ #define XML_SOCKLEN_T socklen_t +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT32_T */ + /* Using the Win32 Socket implementation */ /* #undef _WINSOCKAPI_ */ -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Win32 Std C name mangling work-around */ -/* #undef snprintf */ - /* ss_family is not defined here, use __ss_family instead */ /* #undef ss_family */ -/* Win32 Std C name mangling work-around */ -/* #undef vsnprintf */ +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint32_t */ diff --git a/third_party/libxml/linux/include/libxml/xmlversion.h b/third_party/libxml/linux/include/libxml/xmlversion.h index 9e849fa..6fd386d 100644 --- a/third_party/libxml/linux/include/libxml/xmlversion.h +++ b/third_party/libxml/linux/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.7" +#define LIBXML_DOTTED_VERSION "2.9.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20707 +#define LIBXML_VERSION 20902 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20707" +#define LIBXML_VERSION_STRING "20902" /** * 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(20707); +#define LIBXML_TEST_VERSION xmlCheckVersion(20902); #ifndef VMS #if 0 @@ -98,6 +98,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_THREAD_ALLOC_ENABLED: + * + * Whether the allocation hooks are per-thread + */ +#if 0 +#define LIBXML_THREAD_ALLOC_ENABLED +#endif + +/** * LIBXML_TREE_ENABLED: * * Whether the DOM like tree manipulation API support is configured in @@ -391,6 +400,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_ZLIB_ENABLED #endif +/** + * LIBXML_LZMA_ENABLED: + * + * Whether the Lzma support is compiled in + */ +#if 0 +#define LIBXML_LZMA_ENABLED +#endif + #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include @@ -403,7 +421,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__((unused)) +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif #endif /** diff --git a/third_party/libxml/linux/xml2-config b/third_party/libxml/linux/xml2-config index 799fc11..d874f80 100755 --- a/third_party/libxml/linux/xml2-config +++ b/third_party/libxml/linux/xml2-config @@ -58,7 +58,7 @@ while test $# -gt 0; do ;; --version) - echo 2.7.7 + echo 2.9.2 exit 0 ;; @@ -86,12 +86,12 @@ while test $# -gt 0; do then if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ] then - echo -lxml2 -lz -lm + echo -lxml2 -lz -lm -ldl else - echo -L${libdir} -lxml2 -lz -lm + echo -L${libdir} -lxml2 -lz -lm -ldl fi else - echo -L${libdir} -lxml2 -lz -lm + echo -L${libdir} -lxml2 -lz -lm -ldl fi ;; diff --git a/third_party/libxml/mac/config.h b/third_party/libxml/mac/config.h index d647bf0..36606f0 100644 --- a/third_party/libxml/mac/config.h +++ b/third_party/libxml/mac/config.h @@ -1,21 +1,8 @@ /* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ -#define PACKAGE "libxml2" -#define VERSION "2.7.7" -#define HAVE_LIBZ 1 -/* #undef HAVE_LIBM */ -#define HAVE_ISINF /**/ -#define HAVE_ISNAN /**/ -/* #undef HAVE_LIBHISTORY */ -/* #undef HAVE_LIBREADLINE */ -#define HAVE_LIBPTHREAD /**/ -#define HAVE_PTHREAD_H /**/ +/* config.h.in. Generated from configure.ac by autoheader. */ -/* Define if IPV6 support is there */ -#define SUPPORT_IP6 /**/ - -/* Define if getaddrinfo is there */ -#define HAVE_GETADDRINFO /**/ +/* Type cast for the gethostbyname() argument */ +#define GETHOSTBYNAME_ARG_CAST /**/ /* Define to 1 if you have the header file. */ /* #undef HAVE_ANSIDECL_H */ @@ -86,8 +73,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the header file. */ -/* #undef HAVE_INTTYPES_H_H */ +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 /* Define if isinf is there */ #define HAVE_ISINF /**/ @@ -101,6 +88,9 @@ /* Define if history library is there (-lhistory) */ /* #undef HAVE_LIBHISTORY */ +/* Have compression library */ +/* #undef HAVE_LIBLZMA */ + /* Define if pthread library is there (-lpthread) */ #define HAVE_LIBPTHREAD /**/ @@ -116,6 +106,9 @@ /* Define to 1 if you have the `localtime' function. */ #define HAVE_LOCALTIME 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LZMA_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_MALLOC_H */ @@ -125,6 +118,17 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `munmap' function. */ +#define HAVE_MUNMAP 1 + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + /* Define to 1 if you have the header file. */ /* #undef HAVE_NAN_H */ @@ -146,6 +150,15 @@ /* Define if is there */ #define HAVE_PTHREAD_H /**/ +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `rand_r' function. */ +#define HAVE_RAND_R 1 + /* Define to 1 if you have the header file. */ #define HAVE_RESOLV_H 1 @@ -164,6 +177,9 @@ /* Define to 1 if you have the `sprintf' function. */ #define HAVE_SPRINTF 1 +/* Define to 1 if you have the `srand' function. */ +#define HAVE_SRAND 1 + /* Define to 1 if you have the `sscanf' function. */ #define HAVE_SSCANF 1 @@ -195,7 +211,7 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strndup' function. */ -/* #undef HAVE_STRNDUP */ +#define HAVE_STRNDUP 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ @@ -226,6 +242,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 +/* Define to 1 if you have the `time' function. */ +#define HAVE_TIME 1 + /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 @@ -281,8 +300,8 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "" -/* Define to 1 if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 +/* Type cast for the send() function 2nd arg */ +#define SEND_ARG2_CAST /**/ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -290,23 +309,26 @@ /* Support for IPv6 */ #define SUPPORT_IP6 /**/ +/* Define if va_list is an array type */ +#define VA_LIST_IS_ARRAY 1 + /* Version number of package */ -#define VERSION "2.7.7" +#define VERSION "2.9.2" /* Determine what socket length (socklen_t) data type is */ #define XML_SOCKLEN_T socklen_t +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT32_T */ + /* Using the Win32 Socket implementation */ /* #undef _WINSOCKAPI_ */ -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Win32 Std C name mangling work-around */ -/* #undef snprintf */ - /* ss_family is not defined here, use __ss_family instead */ /* #undef ss_family */ -/* Win32 Std C name mangling work-around */ -/* #undef vsnprintf */ +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint32_t */ diff --git a/third_party/libxml/mac/include/libxml/xmlversion.h b/third_party/libxml/mac/include/libxml/xmlversion.h index 9e849fa..6fd386d 100644 --- a/third_party/libxml/mac/include/libxml/xmlversion.h +++ b/third_party/libxml/mac/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.7" +#define LIBXML_DOTTED_VERSION "2.9.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20707 +#define LIBXML_VERSION 20902 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20707" +#define LIBXML_VERSION_STRING "20902" /** * 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(20707); +#define LIBXML_TEST_VERSION xmlCheckVersion(20902); #ifndef VMS #if 0 @@ -98,6 +98,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif /** + * LIBXML_THREAD_ALLOC_ENABLED: + * + * Whether the allocation hooks are per-thread + */ +#if 0 +#define LIBXML_THREAD_ALLOC_ENABLED +#endif + +/** * LIBXML_TREE_ENABLED: * * Whether the DOM like tree manipulation API support is configured in @@ -391,6 +400,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_ZLIB_ENABLED #endif +/** + * LIBXML_LZMA_ENABLED: + * + * Whether the Lzma support is compiled in + */ +#if 0 +#define LIBXML_LZMA_ENABLED +#endif + #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include @@ -403,7 +421,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__((unused)) +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif #endif /** diff --git a/third_party/libxml/patches/LoadLibraryA b/third_party/libxml/patches/LoadLibraryA deleted file mode 100644 index 89fff15..0000000 --- a/third_party/libxml/patches/LoadLibraryA +++ /dev/null @@ -1,16 +0,0 @@ -Change 'LoadLibrary' to 'LoadLibraryA' (used with 'const char*' as an -argument) - -Index: libxml/xmlmodule.c -=================================================================== ---- libxml.orig/xmlmodule.c 2010-07-09 14:17:46.959288280 -0700 -+++ libxml/xmlmodule.c 2010-07-09 14:17:55.419051003 -0700 -@@ -300,7 +300,7 @@ - static void * - xmlModulePlatformOpen(const char *name) - { -- return LoadLibrary(name); -+ return LoadLibraryA(name); - } - - /* diff --git a/third_party/libxml/patches/bug_651202 b/third_party/libxml/patches/bug_651202 deleted file mode 100644 index 5f93fd7..0000000 --- a/third_party/libxml/patches/bug_651202 +++ /dev/null @@ -1,13 +0,0 @@ -Fix for https://bugzilla.gnome.org/show_bug.cgi?id=651202 - ---- libxml/xmlschemas.c.orig Thu May 26 20:21:54 2011 -+++ libxml/xmlschemas.c Thu May 26 20:22:02 2011 -@@ -13946,7 +13946,7 @@ - */ - if ((sub->negNsSet != NULL) && - (super->negNsSet != NULL) && -- (sub->negNsSet->value == sub->negNsSet->value)) -+ (sub->negNsSet->value == super->negNsSet->value)) - return (0); - /* - * 3.1 sub must be a set whose members are either namespace names or �absent�. diff --git a/third_party/libxml/patches/icu b/third_party/libxml/patches/icu deleted file mode 100644 index 4503f92..0000000 --- a/third_party/libxml/patches/icu +++ /dev/null @@ -1,453 +0,0 @@ -Add code support for ICU. - -diff --git a/third_party/libxml/encoding.c b/third_party/libxml/encoding.c -index b86a547..0f41df9 100644 ---- a/third_party/libxml/encoding.c -+++ b/third_party/libxml/encoding.c -@@ -58,7 +58,7 @@ static xmlCharEncodingAliasPtr xmlCharEncodingAliases = NULL; - static int xmlCharEncodingAliasesNb = 0; - static int xmlCharEncodingAliasesMax = 0; - --#ifdef LIBXML_ICONV_ENABLED -+#if defined(LIBXML_ICONV_ENABLED) || defined(LIBXML_ICU_ENABLED) - #if 0 - #define DEBUG_ENCODING /* Define this to get encoding traces */ - #endif -@@ -97,6 +97,54 @@ xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val) - NULL, 0, val, NULL, NULL, 0, 0, msg, val); - } - -+#ifdef LIBXML_ICU_ENABLED -+static uconv_t* -+openIcuConverter(const char* name, int toUnicode) -+{ -+ UErrorCode status = U_ZERO_ERROR; -+ uconv_t *conv = (uconv_t *) xmlMalloc(sizeof(uconv_t)); -+ if (conv == NULL) -+ return NULL; -+ -+ conv->uconv = ucnv_open(name, &status); -+ if (U_FAILURE(status)) -+ goto error; -+ -+ status = U_ZERO_ERROR; -+ if (toUnicode) { -+ ucnv_setToUCallBack(conv->uconv, UCNV_TO_U_CALLBACK_STOP, -+ NULL, NULL, NULL, &status); -+ } -+ else { -+ ucnv_setFromUCallBack(conv->uconv, UCNV_FROM_U_CALLBACK_STOP, -+ NULL, NULL, NULL, &status); -+ } -+ if (U_FAILURE(status)) -+ goto error; -+ -+ status = U_ZERO_ERROR; -+ conv->utf8 = ucnv_open("UTF-8", &status); -+ if (U_SUCCESS(status)) -+ return conv; -+ -+error: -+ if (conv->uconv) -+ ucnv_close(conv->uconv); -+ xmlFree(conv); -+ return NULL; -+} -+ -+static void -+closeIcuConverter(uconv_t *conv) -+{ -+ if (conv != NULL) { -+ ucnv_close(conv->uconv); -+ ucnv_close(conv->utf8); -+ xmlFree(conv); -+ } -+} -+#endif /* LIBXML_ICU_ENABLED */ -+ - /************************************************************************ - * * - * Conversions To/From UTF8 encoding * -@@ -1306,7 +1354,11 @@ xmlNewCharEncodingHandler(const char *name, - #ifdef LIBXML_ICONV_ENABLED - handler->iconv_in = NULL; - handler->iconv_out = NULL; --#endif /* LIBXML_ICONV_ENABLED */ -+#endif -+#ifdef LIBXML_ICU_ENABLED -+ handler->uconv_in = NULL; -+ handler->uconv_out = NULL; -+#endif - - /* - * registers and returns the handler. -@@ -1371,7 +1423,7 @@ xmlInitCharEncodingHandlers(void) { - xmlNewCharEncodingHandler("ASCII", asciiToUTF8, NULL); - xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, NULL); - #endif /* LIBXML_OUTPUT_ENABLED */ --#ifndef LIBXML_ICONV_ENABLED -+#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) - #ifdef LIBXML_ISO8859X_ENABLED - xmlRegisterCharEncodingHandlersISO8859x (); - #endif -@@ -1578,6 +1630,10 @@ xmlFindCharEncodingHandler(const char *name) { - xmlCharEncodingHandlerPtr enc; - iconv_t icv_in, icv_out; - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ xmlCharEncodingHandlerPtr enc; -+ uconv_t *ucv_in, *ucv_out; -+#endif /* LIBXML_ICU_ENABLED */ - char upper[100]; - int i; - -@@ -1647,6 +1703,35 @@ xmlFindCharEncodingHandler(const char *name) { - "iconv : problems with filters for '%s'\n", name); - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ /* check whether icu can handle this */ -+ ucv_in = openIcuConverter(name, 1); -+ ucv_out = openIcuConverter(name, 0); -+ if (ucv_in != NULL && ucv_out != NULL) { -+ enc = (xmlCharEncodingHandlerPtr) -+ xmlMalloc(sizeof(xmlCharEncodingHandler)); -+ if (enc == NULL) { -+ closeIcuConverter(ucv_in); -+ closeIcuConverter(ucv_out); -+ return(NULL); -+ } -+ enc->name = xmlMemStrdup(name); -+ enc->input = NULL; -+ enc->output = NULL; -+ enc->uconv_in = ucv_in; -+ enc->uconv_out = ucv_out; -+#ifdef DEBUG_ENCODING -+ xmlGenericError(xmlGenericErrorContext, -+ "Found ICU converter handler for encoding %s\n", name); -+#endif -+ return enc; -+ } else if (ucv_in != NULL || ucv_out != NULL) { -+ closeIcuConverter(ucv_in); -+ closeIcuConverter(ucv_out); -+ xmlEncodingErr(XML_ERR_INTERNAL_ERROR, -+ "ICU converter : problems with filters for '%s'\n", name); -+ } -+#endif /* LIBXML_ICU_ENABLED */ - - #ifdef DEBUG_ENCODING - xmlGenericError(xmlGenericErrorContext, -@@ -1737,6 +1822,75 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, - - /************************************************************************ - * * -+ * ICU based generic conversion functions * -+ * * -+ ************************************************************************/ -+ -+#ifdef LIBXML_ICU_ENABLED -+/** -+ * xmlUconvWrapper: -+ * @cd: ICU uconverter data structure -+ * @toUnicode : non-zero if toUnicode. 0 otherwise. -+ * @out: a pointer to an array of bytes to store the result -+ * @outlen: the length of @out -+ * @in: a pointer to an array of ISO Latin 1 chars -+ * @inlen: the length of @in -+ * -+ * Returns 0 if success, or -+ * -1 by lack of space, or -+ * -2 if the transcoding fails (for *in is not valid utf8 string or -+ * the result of transformation can't fit into the encoding we want), or -+ * -3 if there the last byte can't form a single output char. -+ * -+ * The value of @inlen after return is the number of octets consumed -+ * as the return value is positive, else unpredictable. -+ * The value of @outlen after return is the number of ocetes consumed. -+ */ -+static int -+xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, -+ const unsigned char *in, int *inlen) { -+ const char *ucv_in = (const char *) in; -+ char *ucv_out = (char *) out; -+ UErrorCode err = U_ZERO_ERROR; -+ -+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) { -+ if (outlen != NULL) *outlen = 0; -+ return(-1); -+ } -+ -+ /* -+ * TODO(jungshik) -+ * 1. is ucnv_convert(To|From)Algorithmic better? -+ * 2. had we better use an explicit pivot buffer? -+ * 3. error returned comes from 'fromUnicode' only even -+ * when toUnicode is true ! -+ */ -+ if (toUnicode) { -+ /* encoding => UTF-16 => UTF-8 */ -+ ucnv_convertEx(cd->utf8, cd->uconv, &ucv_out, ucv_out + *outlen, -+ &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL, -+ 0, TRUE, &err); -+ } else { -+ /* UTF-8 => UTF-16 => encoding */ -+ ucnv_convertEx(cd->uconv, cd->utf8, &ucv_out, ucv_out + *outlen, -+ &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL, -+ 0, TRUE, &err); -+ } -+ *inlen = ucv_in - (const char*) in; -+ *outlen = ucv_out - (char *) out; -+ if (U_SUCCESS(err)) -+ return 0; -+ if (err == U_BUFFER_OVERFLOW_ERROR) -+ return -1; -+ if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND) -+ return -2; -+ /* if (err == U_TRUNCATED_CHAR_FOUND) */ -+ return -3; -+} -+#endif /* LIBXML_ICU_ENABLED */ -+ -+/************************************************************************ -+ * * - * The real API used by libxml for on-the-fly conversion * - * * - ************************************************************************/ -@@ -1810,6 +1964,16 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, - if (ret == -1) ret = -3; - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ else if (handler->uconv_in != NULL) { -+ ret = xmlUconvWrapper(handler->uconv_in, 1, &out->content[out->use], -+ &written, in->content, &toconv); -+ xmlBufferShrink(in, toconv); -+ out->use += written; -+ out->content[out->use] = 0; -+ if (ret == -1) ret = -3; -+ } -+#endif /* LIBXML_ICU_ENABLED */ - #ifdef DEBUG_ENCODING - switch (ret) { - case 0: -@@ -1915,6 +2079,17 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, - ret = -3; - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ else if (handler->uconv_in != NULL) { -+ ret = xmlUconvWrapper(handler->uconv_in, 1, &out->content[out->use], -+ &written, in->content, &toconv); -+ xmlBufferShrink(in, toconv); -+ out->use += written; -+ out->content[out->use] = 0; -+ if (ret == -1) -+ ret = -3; -+ } -+#endif /* LIBXML_ICU_ENABLED */ - switch (ret) { - case 0: - #ifdef DEBUG_ENCODING -@@ -2015,6 +2190,15 @@ retry: - out->content[out->use] = 0; - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ else if (handler->uconv_out != NULL) { -+ ret = xmlUconvWrapper(handler->uconv_out, 0, -+ &out->content[out->use], -+ &written, NULL, &toconv); -+ out->use += written; -+ out->content[out->use] = 0; -+ } -+#endif /* LIBXML_ICU_ENABLED */ - #ifdef DEBUG_ENCODING - xmlGenericError(xmlGenericErrorContext, - "initialized encoder\n"); -@@ -2061,6 +2245,26 @@ retry: - } - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ else if (handler->uconv_out != NULL) { -+ ret = xmlUconvWrapper(handler->uconv_out, 0, -+ &out->content[out->use], -+ &written, in->content, &toconv); -+ xmlBufferShrink(in, toconv); -+ out->use += written; -+ writtentot += written; -+ out->content[out->use] = 0; -+ if (ret == -1) { -+ if (written > 0) { -+ /* -+ * Can be a limitation of iconv -+ */ -+ goto retry; -+ } -+ ret = -3; -+ } -+ } -+#endif /* LIBXML_ICU_ENABLED */ - else { - xmlEncodingErr(XML_I18N_NO_OUTPUT, - "xmlCharEncOutFunc: no output function !\n", NULL); -@@ -2173,6 +2377,22 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { - xmlFree(handler); - } - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { -+ if (handler->name != NULL) -+ xmlFree(handler->name); -+ handler->name = NULL; -+ if (handler->uconv_out != NULL) { -+ closeIcuConverter(handler->uconv_out); -+ handler->uconv_out = NULL; -+ } -+ if (handler->uconv_in != NULL) { -+ closeIcuConverter(handler->uconv_in); -+ handler->uconv_in = NULL; -+ } -+ xmlFree(handler); -+ } -+#endif - #ifdef DEBUG_ENCODING - if (ret) - xmlGenericError(xmlGenericErrorContext, -@@ -2248,6 +2468,22 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) { - cur += toconv; - } while (ret == -2); - #endif -+#ifdef LIBXML_ICU_ENABLED -+ } else if (handler->uconv_out != NULL) { -+ do { -+ toconv = in->end - cur; -+ written = 32000; -+ ret = xmlUconvWrapper(handler->uconv_out, 0, &convbuf[0], -+ &written, cur, &toconv); -+ if (ret < 0) { -+ if (written > 0) -+ ret = -2; -+ else -+ return(-1); -+ } -+ unused += written; -+ cur += toconv; -+ } while (ret == -2); - } else { - /* could not find a converter */ - return(-1); -@@ -2259,8 +2495,9 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) { - } - return(in->consumed + (in->cur - in->base)); - } -+#endif - --#ifndef LIBXML_ICONV_ENABLED -+#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) - #ifdef LIBXML_ISO8859X_ENABLED - - /** -diff --git a/third_party/libxml/include/libxml/encoding.h b/third_party/libxml/include/libxml/encoding.h -index c74b25f..b5f8b48 100644 ---- a/third_party/libxml/include/libxml/encoding.h -+++ b/third_party/libxml/include/libxml/encoding.h -@@ -26,6 +26,24 @@ - - #ifdef LIBXML_ICONV_ENABLED - #include -+#else -+#ifdef LIBXML_ICU_ENABLED -+#include -+#if 0 -+/* Forward-declare UConverter here rather than pulling in -+ * to prevent unwanted ICU symbols being exposed to users of libxml2. -+ * One particular case is Qt4 conflicting on UChar32. -+ */ -+#include -+struct UConverter; -+typedef struct UConverter UConverter; -+#ifdef _MSC_VER -+typedef wchar_t UChar; -+#else -+typedef uint16_t UChar; -+#endif -+#endif -+#endif - #endif - #ifdef __cplusplus - extern "C" { -@@ -125,6 +143,13 @@ typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, - * Block defining the handlers for non UTF-8 encodings. - * If iconv is supported, there are two extra fields. - */ -+#ifdef LIBXML_ICU_ENABLED -+struct _uconv_t { -+ UConverter *uconv; /* for conversion between an encoding and UTF-16 */ -+ UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ -+}; -+typedef struct _uconv_t uconv_t; -+#endif - - typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; - typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; -@@ -136,6 +161,10 @@ struct _xmlCharEncodingHandler { - iconv_t iconv_in; - iconv_t iconv_out; - #endif /* LIBXML_ICONV_ENABLED */ -+#ifdef LIBXML_ICU_ENABLED -+ uconv_t *uconv_in; -+ uconv_t *uconv_out; -+#endif /* LIBXML_ICU_ENABLED */ - }; - - #ifdef __cplusplus -diff --git a/third_party/libxml/include/libxml/parser.h b/third_party/libxml/include/libxml/parser.h -index dd79c42..3580b63 100644 ---- a/third_party/libxml/include/libxml/parser.h -+++ b/third_party/libxml/include/libxml/parser.h -@@ -1222,6 +1222,7 @@ typedef enum { - XML_WITH_DEBUG_MEM = 29, - XML_WITH_DEBUG_RUN = 30, - XML_WITH_ZLIB = 31, -+ XML_WITH_ICU = 32, - XML_WITH_NONE = 99999 /* just to be sure of allocation size */ - } xmlFeature; - -diff --git a/third_party/libxml/include/libxml/xmlversion.h.in b/third_party/libxml/include/libxml/xmlversion.h.in -index 4739f3a..de310ab 100644 ---- a/third_party/libxml/include/libxml/xmlversion.h.in -+++ b/third_party/libxml/include/libxml/xmlversion.h.in -@@ -269,6 +269,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); - #endif - - /** -+ * LIBXML_ICU_ENABLED: -+ * -+ * Whether icu support is available -+ */ -+#if @WITH_ICU@ -+#define LIBXML_ICU_ENABLED -+#endif -+ -+/** - * LIBXML_ISO8859X_ENABLED: - * - * Whether ISO-8859-* support is made available in case iconv is not -diff --git a/third_party/libxml/parser.c b/third_party/libxml/parser.c -index 85e7599..3ba2a06 100644 ---- a/third_party/libxml/parser.c -+++ b/third_party/libxml/parser.c -@@ -954,6 +954,12 @@ xmlHasFeature(xmlFeature feature) - #else - return(0); - #endif -+ case XML_WITH_ICU: -+#ifdef LIBXML_ICU_ENABLED -+ return(1); -+#else -+ return(0); -+#endif - default: - break; - } diff --git a/third_party/libxml/patches/icu-configure b/third_party/libxml/patches/icu-configure deleted file mode 100644 index f7e2395..0000000 --- a/third_party/libxml/patches/icu-configure +++ /dev/null @@ -1,28 +0,0 @@ -Modifications to configure.in: -- set the WITH_ICU flag unconditionally -- only output files we use - -Index: libxml/configure.in -=================================================================== ---- libxml.orig/configure.in 2010-07-09 15:00:21.600113911 -0700 -+++ libxml/configure.in 2010-07-09 15:02:50.299108047 -0700 -@@ -1229,6 +1229,9 @@ - fi - AC_SUBST(WITH_OUTPUT) - -+WITH_ICU=1 -+AC_SUBST(WITH_ICU) -+ - WITH_ICONV=0 - if test "$with_iconv" = "no" ; then - echo Disabling ICONV support -@@ -1456,7 +1459,7 @@ - ln -s Copyright COPYING - - # keep on one line for cygwin c.f. #130896 --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) -+AC_OUTPUT(include/libxml/xmlversion.h xml2-config) - --chmod +x xml2-config python/setup.py -+chmod +x xml2-config - echo Done configuring diff --git a/third_party/libxml/patches/icu-win32 b/third_party/libxml/patches/icu-win32 deleted file mode 100644 index 2ea8f21..0000000 --- a/third_party/libxml/patches/icu-win32 +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/third_party/libxml/win32/Makefile.msvc b/third_party/libxml/win32/Makefile.msvc -index 2409905..253c46e 100644 ---- a/third_party/libxml/win32/Makefile.msvc -+++ b/third_party/libxml/win32/Makefile.msvc -@@ -71,6 +71,9 @@ LIBS = $(LIBS) wsock32.lib ws2_32.lib - !if "$(WITH_ICONV)" == "1" - LIBS = $(LIBS) iconv.lib - !endif -+!if "$(WITH_ICU)" == "1" -+LIBS = $(LIBS) icu.lib -+!endif - !if "$(WITH_ZLIB)" == "1" - LIBS = $(LIBS) zdll.lib - !endif -diff --git a/third_party/libxml/win32/configure.js b/third_party/libxml/win32/configure.js -index e71d2af..75def3f 100644 ---- a/third_party/libxml/win32/configure.js -+++ b/third_party/libxml/win32/configure.js -@@ -40,6 +40,7 @@ var withXpath = true; - var withXptr = true; - var withXinclude = true; - var withIconv = true; -+var withIcu = false; - var withIso8859x = false; - var withZlib = false; - var withDebug = true; -@@ -124,6 +125,7 @@ function usage() - txt += " xptr: Enable XPointer support (" + (withXptr? "yes" : "no") + ")\n"; - txt += " xinclude: Enable XInclude support (" + (withXinclude? "yes" : "no") + ")\n"; - txt += " iconv: Enable iconv support (" + (withIconv? "yes" : "no") + ")\n"; -+ txt += " icu: Enable icu support (" + (withIcu? "yes" : "no") + ")\n"; - txt += " iso8859x: Enable ISO8859X support (" + (withIso8859x? "yes" : "no") + ")\n"; - txt += " zlib: Enable zlib support (" + (withZlib? "yes" : "no") + ")\n"; - txt += " xml_debug: Enable XML debbugging module (" + (withDebug? "yes" : "no") + ")\n"; -@@ -233,6 +235,7 @@ function discoverVersion() - vf.WriteLine("WITH_XPTR=" + (withXptr? "1" : "0")); - vf.WriteLine("WITH_XINCLUDE=" + (withXinclude? "1" : "0")); - vf.WriteLine("WITH_ICONV=" + (withIconv? "1" : "0")); -+ vf.WriteLine("WITH_ICU=" + (withIcu? "1" : "0")); - vf.WriteLine("WITH_ISO8859X=" + (withIso8859x? "1" : "0")); - vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); - vf.WriteLine("WITH_DEBUG=" + (withDebug? "1" : "0")); -@@ -319,6 +322,8 @@ function configureLibxml() - of.WriteLine(s.replace(/\@WITH_XINCLUDE\@/, withXinclude? "1" : "0")); - } else if (s.search(/\@WITH_ICONV\@/) != -1) { - of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0")); -+ } else if (s.search(/\@WITH_ICU\@/) != -1) { -+ of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0")); - } else if (s.search(/\@WITH_ISO8859X\@/) != -1) { - of.WriteLine(s.replace(/\@WITH_ISO8859X\@/, withIso8859x? "1" : "0")); - } else if (s.search(/\@WITH_ZLIB\@/) != -1) { -@@ -462,6 +467,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { - withXinclude = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "iconv") - withIconv = strToBool(arg.substring(opt.length + 1, arg.length)); -+ else if (opt == "icu") -+ withIcu = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "iso8859x") - withIso8859x = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "zlib") -@@ -646,6 +653,7 @@ txtOut += " XPath support: " + boolToStr(withXpath) + "\n"; - txtOut += " XPointer support: " + boolToStr(withXptr) + "\n"; - txtOut += " XInclude support: " + boolToStr(withXinclude) + "\n"; - txtOut += " iconv support: " + boolToStr(withIconv) + "\n"; -+txtOut += " icu support: " + boolToStr(withIcu) + "\n"; - txtOut += " iso8859x support: " + boolToStr(withIso8859x) + "\n"; - txtOut += " zlib support: " + boolToStr(withZlib) + "\n"; - txtOut += " Debugging module: " + boolToStr(withDebug) + "\n"; diff --git a/third_party/libxml/patches/snprintf_config b/third_party/libxml/patches/snprintf_config deleted file mode 100644 index 9d1ca62..0000000 --- a/third_party/libxml/patches/snprintf_config +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/third_party/libxml/win32/config.h b/third_party/libxml/win32/config.h -index 3fc9be5..5112ce6 100644 ---- a/third_party/libxml/win32/config.h -+++ b/third_party/libxml/win32/config.h -@@ -95,7 +95,9 @@ static int isnan (double d) { - - #if defined(_MSC_VER) - #define mkdir(p,m) _mkdir(p) -+#if _MSC_VER < 1900 - #define snprintf _snprintf -+#endif - #if _MSC_VER < 1500 - #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) - #endif diff --git a/third_party/libxml/patches/snprintf_win32config b/third_party/libxml/patches/snprintf_win32config deleted file mode 100644 index 3fec790..0000000 --- a/third_party/libxml/patches/snprintf_win32config +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/third_party/libxml/src/include/win32config.h b/third_party/libxml/src/include/win32config.h -index 3fc9be5..5112ce6 100644 ---- a/third_party/libxml/src/include/win32config.h -+++ b/third_party/libxml/src/include/win32config.h -@@ -95,7 +95,9 @@ static int isnan (double d) { - - #if defined(_MSC_VER) - #define mkdir(p,m) _mkdir(p) -+#if _MSC_VER < 1900 - #define snprintf _snprintf -+#endif - #if _MSC_VER < 1500 - #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) - #endif diff --git a/third_party/libxml/patches/win32-clobber-makefile b/third_party/libxml/patches/win32-clobber-makefile deleted file mode 100644 index 2f7fbb4..0000000 --- a/third_party/libxml/patches/win32-clobber-makefile +++ /dev/null @@ -1,19 +0,0 @@ -Index: libxml/win32/configure.js -=================================================================== ---- libxml.orig/win32/configure.js 2010-07-09 14:56:07.769093841 -0700 -+++ libxml/win32/configure.js 2010-07-09 15:36:48.590268611 -0700 -@@ -611,7 +611,13 @@ - makefile = ".\\Makefile.mingw"; - else if (compiler == "bcb") - makefile = ".\\Makefile.bcb"; --fso.CopyFile(makefile, ".\\Makefile", true); -+var new_makefile = ".\\Makefile"; -+var f = fso.FileExists(new_makefile); -+if (f) { -+ var t = fso.GetFile(new_makefile); -+ t.Attributes = 0; -+} -+fso.CopyFile(makefile, new_makefile, true); - WScript.Echo("Created Makefile."); - // Create the config.h. - var confighsrc = "..\\include\\win32config.h"; diff --git a/third_party/libxml/patches/win32-no-posix-error-codes b/third_party/libxml/patches/win32-no-posix-error-codes deleted file mode 100644 index 38be7f7c..0000000 --- a/third_party/libxml/patches/win32-no-posix-error-codes +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/third_party/libxml/src/libxml.h b/third_party/libxml/src/libxml.h -index 1656ac2..f8a368c 100644 ---- a/third_party/libxml/src/libxml.h -+++ b/third_party/libxml/src/libxml.h -@@ -17,6 +17,9 @@ - #define _FILE_OFFSET_BITS 64 - #endif - #endif -+#ifndef _CRT_NO_POSIX_ERROR_CODES -+#define _CRT_NO_POSIX_ERROR_CODES -+#endif - - #if defined(macintosh) - #include "config-mac.h" diff --git a/third_party/libxml/patches/xmlregexp-bogus-cast b/third_party/libxml/patches/xmlregexp-bogus-cast deleted file mode 100644 index aaebfaa..0000000 --- a/third_party/libxml/patches/xmlregexp-bogus-cast +++ /dev/null @@ -1,15 +0,0 @@ -Change bogus '(unsigned long)' cast to '(unsigned short)' - -Index: libxml/xmlregexp.c -=================================================================== ---- libxml.orig/xmlregexp.c 2010-07-09 14:16:36.990430641 -0700 -+++ libxml/xmlregexp.c 2010-07-09 14:16:40.939742007 -0700 -@@ -6470,7 +6470,7 @@ - if (name != NULL) { - value += 30 * (*name); - while ((ch = *name++) != 0) { -- value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); -+ value = value ^ ((value << 5) + (value >> 3) + (unsigned short)ch); - } - } - return (value); diff --git a/third_party/libxml/src/ChangeLog b/third_party/libxml/src/ChangeLog index 36045e6..08725dd 100644 --- a/third_party/libxml/src/ChangeLog +++ b/third_party/libxml/src/ChangeLog @@ -8139,7 +8139,7 @@ Wed Dec 10 11:16:29 CET 2003 Daniel Veillard Tue Dec 9 23:50:23 CET 2003 Daniel Veillard - * entities.c: fixed an XML entites content serialization + * entities.c: fixed an XML entities content serialization potentially triggered by XInclude, see #126817 Tue Dec 9 16:12:50 CET 2003 Daniel Veillard diff --git a/third_party/libxml/src/Copyright b/third_party/libxml/src/Copyright index 417e955..d613185 100644 --- a/third_party/libxml/src/Copyright +++ b/third_party/libxml/src/Copyright @@ -2,7 +2,7 @@ Except where otherwise noted in the source code (e.g. the files hash.c, list.c and the trio files, which are covered by a similar licence but with different Copyright notices) all the files are: - Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. + Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -17,11 +17,7 @@ all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- -NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Daniel Veillard shall not -be used in advertising or otherwise to promote the sale, use or other deal- -ings in this Software without prior written authorization from him. - +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/third_party/libxml/src/DOCBparser.c b/third_party/libxml/src/DOCBparser.c index 3573743..f12511b 100644 --- a/third_party/libxml/src/DOCBparser.c +++ b/third_party/libxml/src/DOCBparser.c @@ -53,7 +53,7 @@ docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED, /** * docbParseDocument: * @ctxt: an SGML parser context - * + * * parse an SGML document (and build a tree if using the standard SAX * interface). * @@ -163,12 +163,12 @@ docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, * @cur: a pointer to an array of xmlChar * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML in-memory document and build a tree. * It use the given SAX function block to handle the parsing callback. * If sax is NULL, fallback to the default DOM tree building routines. - * + * * Returns the resulting document tree */ @@ -196,7 +196,7 @@ docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, * @encoding: a free form C string describing the SGML document encoding, or NULL * * parse an SGML in-memory document and build a tree. - * + * * Returns the resulting document tree */ @@ -221,7 +221,7 @@ docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, * @filename: the filename * @encoding: the SGML document encoding, or NULL * - * Create a parser context for a file content. + * Create a parser context for a file content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * @@ -247,7 +247,7 @@ docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED, * @filename: the filename * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML file and build a tree. Automatic support for ZLIB/Compress * compressed document is provided by default if found at compile-time. diff --git a/third_party/libxml/src/HTMLparser.c b/third_party/libxml/src/HTMLparser.c index 42dc776..d329d3b 100644 --- a/third_party/libxml/src/HTMLparser.c +++ b/third_party/libxml/src/HTMLparser.c @@ -44,6 +44,9 @@ #include #include +#include "buf.h" +#include "enc.h" + #define HTML_MAX_NAMELEN 1000 #define HTML_PARSER_BIG_BUFFER_SIZE 1000 #define HTML_PARSER_BUFFER_SIZE 100 @@ -727,7 +730,7 @@ 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 meta_attrs[] = { I18N, "http-equiv", "name", "scheme", "charset", 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 } ; @@ -1080,9 +1083,9 @@ static const char * const htmlStartClose[] = { "menu", "p", "head", "ul", NULL, "p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL, "div", "p", "head", NULL, -"noscript", "p", "head", NULL, +"noscript", "p", NULL, "center", "font", "b", "i", "p", "head", NULL, -"a", "a", NULL, +"a", "a", "head", NULL, "caption", "p", NULL, "colgroup", "caption", "colgroup", "col", "p", NULL, "col", "caption", "col", "p", NULL, @@ -1100,6 +1103,43 @@ static const char * const htmlStartClose[] = { "option", "option", NULL, "fieldset", "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "listing", "xmp", "a", NULL, +/* most tags in in FONTSTYLE, PHRASE and SPECIAL should close */ +"tt", "head", NULL, +"i", "head", NULL, +"b", "head", NULL, +"u", "head", NULL, +"s", "head", NULL, +"strike", "head", NULL, +"big", "head", NULL, +"small", "head", NULL, + +"em", "head", NULL, +"strong", "head", NULL, +"dfn", "head", NULL, +"code", "head", NULL, +"samp", "head", NULL, +"kbd", "head", NULL, +"var", "head", NULL, +"cite", "head", NULL, +"abbr", "head", NULL, +"acronym", "head", NULL, + +/* "a" */ +"img", "head", NULL, +/* "applet" */ +/* "embed" */ +/* "object" */ +"font", "head", NULL, +/* "basefont" */ +"br", "head", NULL, +/* "script" */ +"map", "head", NULL, +"q", "head", NULL, +"sub", "head", NULL, +"sup", "head", NULL, +"span", "head", NULL, +"bdo", "head", NULL, +"iframe", "head", NULL, NULL }; @@ -1137,7 +1177,7 @@ static const char *const htmlScriptAttributes[] = { "onfocus", "onblur", "onsubmit", - "onrest", + "onreset", "onchange", "onselect" }; @@ -2887,9 +2927,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)) { @@ -2939,9 +2981,14 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { */ if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if (areBlanks(ctxt, buf, nbchar)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - buf, nbchar); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, nbchar); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace(ctxt->userData, + buf, nbchar); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -2972,8 +3019,14 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { */ if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if (areBlanks(ctxt, buf, nbchar)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, buf, nbchar); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, nbchar); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace(ctxt->userData, + buf, nbchar); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -3275,7 +3328,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 +3343,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; } @@ -3433,34 +3486,26 @@ htmlParseAttribute(htmlParserCtxtPtr ctxt, xmlChar **value) { } /** - * htmlCheckEncoding: + * htmlCheckEncodingDirect: * @ctxt: an HTML parser context * @attvalue: the attribute value * - * Checks an http-equiv attribute from a Meta tag to detect + * Checks an attribute value to detect * the encoding * If a new encoding is detected the parser is switched to decode * it and pass UTF8 */ static void -htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { - const xmlChar *encoding; +htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) { - if ((ctxt == NULL) || (attvalue == NULL)) + if ((ctxt == NULL) || (encoding == NULL) || + (ctxt->options & HTML_PARSE_IGNORE_ENC)) return; /* do not change encoding */ if (ctxt->input->encoding != NULL) return; - encoding = xmlStrcasestr(attvalue, BAD_CAST"charset="); - if (encoding != NULL) { - encoding += 8; - } else { - encoding = xmlStrcasestr(attvalue, BAD_CAST"charset ="); - if (encoding != NULL) - encoding += 9; - } if (encoding != NULL) { xmlCharEncoding enc; xmlCharEncodingHandlerPtr handler; @@ -3498,7 +3543,9 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { xmlSwitchToEncoding(ctxt, handler); ctxt->charset = XML_CHAR_ENCODING_UTF8; } else { - ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; + htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING, + "htmlCheckEncoding: unknown encoding %s\n", + encoding, NULL); } } @@ -3513,24 +3560,51 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { * convert as much as possible to the parser reading buffer. */ processed = ctxt->input->cur - ctxt->input->base; - xmlBufferShrink(ctxt->input->buf->buffer, processed); - nbchars = xmlCharEncInFunc(ctxt->input->buf->encoder, - ctxt->input->buf->buffer, - ctxt->input->buf->raw); + xmlBufShrink(ctxt->input->buf->buffer, processed); + nbchars = xmlCharEncInput(ctxt->input->buf, 1); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "htmlCheckEncoding: encoder error\n", NULL, NULL); } - ctxt->input->base = - ctxt->input->cur = ctxt->input->buf->buffer->content; - ctxt->input->end = - &ctxt->input->base[ctxt->input->buf->buffer->use]; + xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input); } } } /** + * htmlCheckEncoding: + * @ctxt: an HTML parser context + * @attvalue: the attribute value + * + * Checks an http-equiv attribute from a Meta tag to detect + * the encoding + * If a new encoding is detected the parser is switched to decode + * it and pass UTF8 + */ +static void +htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { + const xmlChar *encoding; + + if (!attvalue) + return; + + encoding = xmlStrcasestr(attvalue, BAD_CAST"charset"); + if (encoding != NULL) { + encoding += 7; + } + /* + * skip blank + */ + if (encoding && IS_BLANK_CH(*encoding)) + encoding = xmlStrcasestr(attvalue, BAD_CAST"="); + if (encoding && *encoding == '=') { + encoding ++; + htmlCheckEncodingDirect(ctxt, encoding); + } +} + +/** * htmlCheckMeta: * @ctxt: an HTML parser context * @atts: the attributes values @@ -3554,6 +3628,8 @@ htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) { if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"http-equiv")) && (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) http = 1; + else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"charset"))) + htmlCheckEncodingDirect(ctxt, value); else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"content"))) content = value; att = atts[i++]; @@ -3595,13 +3671,13 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) { int i; int discardtag = 0; - if (ctxt->instate == XML_PARSER_EOF) - return(-1); if ((ctxt == NULL) || (ctxt->input == NULL)) { htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR, "htmlParseStartTag: context error\n", NULL, NULL); return -1; } + if (ctxt->instate == XML_PARSER_EOF) + return(-1); if (CUR != '<') return -1; NEXT; @@ -3883,6 +3959,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt) if ((oldname != NULL) && (xmlStrEqual(oldname, name))) { if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) ctxt->sax->endElement(ctxt->userData, name); + htmlNodeInfoPop(ctxt); htmlnamePop(ctxt); ret = 1; } else { @@ -4289,7 +4366,7 @@ static void htmlParseElementInternal(htmlParserCtxtPtr ctxt) { const xmlChar *name; const htmlElemDesc * info; - htmlParserNodeInfo node_info; + htmlParserNodeInfo node_info = { 0, }; int failed; if ((ctxt == NULL) || (ctxt->input == NULL)) { @@ -4670,7 +4747,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 = @@ -4875,9 +4952,7 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) { input->filename = NULL; input->buf = buf; - input->base = input->buf->buffer->content; - input->cur = input->buf->buffer->content; - input->end = &input->buf->buffer->content[input->buf->buffer->use]; + xmlBufResetInput(buf->buffer, input); inputPush(ctxt, input); return(ctxt); @@ -4994,8 +5069,8 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, buf = in->base; len = in->length; } else { - buf = in->buf->buffer->content; - len = in->buf->buffer->use; + buf = xmlBufContent(in->buf->buffer); + len = xmlBufUse(in->buf->buffer); } /* take into account the sequence length */ @@ -5087,13 +5162,13 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, * @stop: Array of chars, which stop the lookup. * @stopLen: Length of stop-Array * - * Try to find if any char of the stop-Array is available in the input + * Try to find if any char of the stop-Array is available in the input * stream. * This function has a side effect of (possibly) incrementing ctxt->checkIndex * to avoid rescanning sequences of bytes, it DOES change the state of the * parser, do not use liberally. * - * Returns the index to the current parsing point if a stopChar + * Returns the index to the current parsing point if a stopChar * is available, -1 otherwise. */ static int @@ -5121,8 +5196,8 @@ htmlParseLookupChars(htmlParserCtxtPtr ctxt, const xmlChar * stop, buf = in->base; len = in->length; } else { - buf = in->buf->buffer->content; - len = in->buf->buffer->use; + buf = xmlBufContent(in->buf->buffer); + len = xmlBufUse(in->buf->buffer); } for (; base < len; base++) { @@ -5171,6 +5246,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { int avail = 0; xmlChar cur, next; + htmlParserNodeInfo node_info; + #ifdef DEBUG_PUSH switch (ctxt->instate) { case XML_PARSER_EOF: @@ -5231,7 +5308,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if ((avail == 0) && (terminate)) { htmlAutoCloseOnEnd(ctxt); if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { @@ -5267,7 +5344,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); } if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, @@ -5309,11 +5386,24 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); - if (avail < 2) + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); + /* + * no chars in buffer + */ + if (avail < 1) goto done; + /* + * not enouth chars in buffer + */ + if (avail < 2) { + if (!terminate) + goto done; + else + next = ' '; + } else { + next = in->cur[1]; + } cur = in->cur[0]; - next = in->cur[1]; if ((cur == '<') && (next == '!') && (in->cur[2] == '-') && (in->cur[3] == '-')) { if ((!terminate) && @@ -5369,7 +5459,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if (avail < 2) goto done; cur = in->cur[0]; @@ -5410,7 +5500,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if (in->buf == NULL) avail = in->length - (in->cur - in->base); else - avail = in->buf->buffer->use - (in->cur - in->base); + avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base); if (avail < 1) goto done; cur = in->cur[0]; @@ -5463,8 +5553,22 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { int failed; const htmlElemDesc * info; - if (avail < 2) + /* + * no chars in buffer + */ + if (avail < 1) goto done; + /* + * not enouth chars in buffer + */ + if (avail < 2) { + if (!terminate) + goto done; + else + next = ' '; + } else { + next = in->cur[1]; + } cur = in->cur[0]; if (cur != '<') { ctxt->instate = XML_PARSER_CONTENT; @@ -5474,7 +5578,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { #endif break; } - if (in->cur[1] == '/') { + if (next == '/') { ctxt->instate = XML_PARSER_END_TAG; ctxt->checkIndex = 0; #ifdef DEBUG_PUSH @@ -5487,6 +5591,14 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0)) goto done; + /* Capture start position */ + if (ctxt->record_info) { + node_info.begin_pos = ctxt->input->consumed + + (CUR_PTR - ctxt->input->base); + node_info.begin_line = ctxt->input->line; + } + + failed = htmlParseStartTag(ctxt); name = ctxt->name; if ((failed == -1) || @@ -5536,6 +5648,9 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { htmlnamePop(ctxt); } + if (ctxt->record_info) + htmlNodeInfoPush(ctxt, &node_info); + ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, @@ -5552,6 +5667,10 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { ctxt->sax->endElement(ctxt->userData, name); htmlnamePop(ctxt); } + + if (ctxt->record_info) + htmlNodeInfoPush(ctxt, &node_info); + ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, @@ -5579,9 +5698,15 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { if ((cur != '<') && (cur != '&')) { if (ctxt->sax != NULL) { if (IS_BLANK_CH(cur)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace( - ctxt->userData, &cur, 1); + if (ctxt->keepBlanks) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters( + ctxt->userData, &cur, 1); + } else { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace( + ctxt->userData, &cur, 1); + } } else { htmlCheckParagraph(ctxt); if (ctxt->sax->characters != NULL) @@ -5609,7 +5734,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]; @@ -5866,7 +5991,7 @@ done: ctxt->sax->endDocument(ctxt->userData); } } - if ((ctxt->myDoc != NULL) && + if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) && ((terminate) || (ctxt->instate == XML_PARSER_EOF) || (ctxt->instate == XML_PARSER_EPILOG))) { xmlDtdPtr dtd; @@ -5904,8 +6029,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, } if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && (ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) { - int base = ctxt->input->base - ctxt->input->buf->buffer->content; - int cur = ctxt->input->cur - ctxt->input->base; + size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input); + size_t cur = ctxt->input->cur - ctxt->input->base; int res; res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk); @@ -5914,10 +6039,7 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, ctxt->disableSAX = 1; return (XML_PARSER_EOF); } - ctxt->input->base = ctxt->input->buf->buffer->content + base; - ctxt->input->cur = ctxt->input->base + cur; - ctxt->input->end = - &ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use]; + xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif @@ -5932,13 +6054,16 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, if ((in->encoder != NULL) && (in->buffer != NULL) && (in->raw != NULL)) { int nbchars; + size_t base = xmlBufGetInputBase(in->buffer, ctxt->input); + size_t current = ctxt->input->cur - ctxt->input->base; - nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); + nbchars = xmlCharEncInput(in, terminate); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "encoder error\n", NULL, NULL); return(XML_ERR_INVALID_ENCODING); } + xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current); } } } @@ -6032,24 +6157,18 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, inputStream->filename = (char *) xmlCanonicPath((const xmlChar *) filename); inputStream->buf = buf; - inputStream->base = inputStream->buf->buffer->content; - inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = - &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; + xmlBufResetInput(buf->buffer, inputStream); inputPush(ctxt, inputStream); if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && (ctxt->input->buf != NULL)) { - int base = ctxt->input->base - ctxt->input->buf->buffer->content; - int cur = ctxt->input->cur - ctxt->input->base; + size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input); + size_t cur = ctxt->input->cur - ctxt->input->base; xmlParserInputBufferPush(ctxt->input->buf, size, chunk); - ctxt->input->base = ctxt->input->buf->buffer->content + base; - ctxt->input->cur = ctxt->input->base + cur; - ctxt->input->end = - &ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use]; + xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur); #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif @@ -6169,12 +6288,16 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) /* set encoding */ if (encoding) { - content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1); - if (content) { - strcpy ((char *)content, (char *)content_line); - strcat ((char *)content, (char *)encoding); - htmlCheckEncoding (ctxt, content); - xmlFree (content); + size_t l = strlen(encoding); + + if (l < 1000) { + content = xmlMallocAtomic (xmlStrlen(content_line) + l + 1); + if (content) { + strcpy ((char *)content, (char *)content_line); + strcat ((char *)content, (char *)encoding); + htmlCheckEncoding (ctxt, content); + xmlFree (content); + } } } @@ -6451,6 +6574,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 +6654,18 @@ 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; + } + if (options & HTML_PARSE_IGNORE_ENC) { + ctxt->options |= HTML_PARSE_IGNORE_ENC; + options -= HTML_PARSE_IGNORE_ENC; + } + if (options & HTML_PARSE_NOIMPLIED) { + ctxt->options |= HTML_PARSE_NOIMPLIED; + options -= HTML_PARSE_NOIMPLIED; + } ctxt->dictNames = 0; return (options); } @@ -6676,6 +6812,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) if (fd < 0) return (NULL); + xmlInitParser(); xmlInitParser(); input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); @@ -6723,8 +6860,11 @@ htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (NULL); + } ctxt = htmlNewParserCtxt(); if (ctxt == NULL) { xmlFreeParserInputBuffer(input); @@ -6763,6 +6903,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, return (NULL); if (ctxt == NULL) return (NULL); + xmlInitParser(); htmlCtxtReset(ctxt); @@ -6796,6 +6937,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, return (NULL); if (ctxt == NULL) return (NULL); + xmlInitParser(); htmlCtxtReset(ctxt); @@ -6832,6 +6974,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, return (NULL); if (buffer == NULL) return (NULL); + xmlInitParser(); htmlCtxtReset(ctxt); @@ -6874,6 +7017,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, return (NULL); if (ctxt == NULL) return (NULL); + xmlInitParser(); htmlCtxtReset(ctxt); @@ -6918,13 +7062,17 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, return (NULL); if (ctxt == NULL) return (NULL); + xmlInitParser(); htmlCtxtReset(ctxt); input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, XML_CHAR_ENCODING_NONE); - if (input == NULL) + if (input == NULL) { + if (ioclose != NULL) + ioclose(ioctx); return (NULL); + } stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE); if (stream == NULL) { xmlFreeParserInputBuffer(input); diff --git a/third_party/libxml/src/HTMLtree.c b/third_party/libxml/src/HTMLtree.c index b508583..5c57fc5 100644 --- a/third_party/libxml/src/HTMLtree.c +++ b/third_party/libxml/src/HTMLtree.c @@ -30,16 +30,18 @@ #include #include +#include "buf.h" + /************************************************************************ * * - * Getting/Setting encoding meta tags * + * Getting/Setting encoding meta tags * * * ************************************************************************/ /** * htmlGetMetaEncoding: * @doc: the document - * + * * Encoding definition lookup in the Meta tags * * Returns the current encoding as flagged in the HTML source @@ -126,17 +128,17 @@ found_meta: found_content: encoding = xmlStrstr(content, BAD_CAST"charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET="); if (encoding != NULL) { encoding += 8; } else { encoding = xmlStrstr(content, BAD_CAST"charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET ="); if (encoding != NULL) encoding += 9; @@ -151,7 +153,7 @@ found_content: * htmlSetMetaEncoding: * @doc: the document * @encoding: the encoding string - * + * * Sets the current encoding in the Meta tags * NOTE: this will not change the document content encoding, just * the META flag associated. @@ -164,6 +166,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) { const xmlChar *content = NULL; char newcontent[100]; + newcontent[0] = 0; if (doc == NULL) return(-1); @@ -244,7 +247,7 @@ found_meta: http = 1; else { - if ((value != NULL) && + if ((value != NULL) && (!xmlStrcasecmp(attr->name, BAD_CAST"content"))) content = value; } @@ -278,8 +281,13 @@ create: xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent); } } else { + /* remove the meta tag if NULL is passed */ + if (encoding == NULL) { + xmlUnlinkNode(meta); + xmlFreeNode(meta); + } /* change the document only if there is a real encoding change */ - if (xmlStrcasestr(content, encoding) == NULL) { + else if (xmlStrcasestr(content, encoding) == NULL) { xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent); } } @@ -308,7 +316,7 @@ static const char* htmlBooleanAttrs[] = { * @name: the name of the attribute to check * * Determine if a given attribute is a boolean attribute. - * + * * returns: false if the attribute is not boolean, true otherwise. */ int @@ -332,7 +340,7 @@ xmlOutputBufferPtr xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder); /************************************************************************ * * - * Output error handlers * + * Output error handlers * * * ************************************************************************/ /** @@ -381,17 +389,13 @@ htmlSaveErr(int code, xmlNodePtr node, const char *extra) /************************************************************************ * * - * Dumping HTML tree content to a simple buffer * + * Dumping HTML tree content to a simple buffer * * * ************************************************************************/ -static int -htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, - int format); - /** - * htmlNodeDumpFormat: - * @buf: the HTML buffer output + * htmlBufNodeDumpFormat: + * @buf: the xmlBufPtr output * @doc: the document * @cur: the current node * @format: should formatting spaces been added @@ -400,10 +404,10 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, * * Returns the number of byte written or -1 in case of error */ -static int -htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, +static size_t +htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int format) { - unsigned int use; + size_t use; int ret; xmlOutputBufferPtr outbuf; @@ -426,10 +430,10 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, outbuf->context = NULL; outbuf->written = 0; - use = buf->use; + use = xmlBufUse(buf); htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format); xmlFree(outbuf); - ret = buf->use - use; + ret = xmlBufUse(buf) - use; return (ret); } @@ -446,9 +450,24 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, */ int htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { + xmlBufPtr buffer; + size_t ret; + + if ((buf == NULL) || (cur == NULL)) + return(-1); + xmlInitParser(); + buffer = xmlBufFromBuffer(buf); + if (buffer == NULL) + return(-1); + + ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1); - return(htmlNodeDumpFormat(buf, doc, cur, 1)); + xmlBufBackToBuffer(buffer); + + if (ret > INT_MAX) + return(-1); + return((int) ret); } /** @@ -481,7 +500,7 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc, if (enc != XML_CHAR_ENCODING_UTF8) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } } @@ -493,7 +512,7 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc, if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFile(out, handler); @@ -562,11 +581,9 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { } handler = xmlFindCharEncodingHandler(encoding); - if (handler == NULL) { - *mem = NULL; - *size = 0; - return; - } + if (handler == NULL) + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); + } else { handler = xmlFindCharEncodingHandler(encoding); } @@ -587,15 +604,15 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { return; } - htmlDocContentDumpFormatOutput(buf, cur, NULL, format); + htmlDocContentDumpFormatOutput(buf, cur, NULL, format); xmlOutputBufferFlush(buf); if (buf->conv != NULL) { - *size = buf->conv->use; - *mem = xmlStrndup(buf->conv->content, *size); + *size = xmlBufUse(buf->conv); + *mem = xmlStrndup(xmlBufContent(buf->conv), *size); } else { - *size = buf->buffer->use; - *mem = xmlStrndup(buf->buffer->content, *size); + *size = xmlBufUse(buf->buffer); + *mem = xmlStrndup(xmlBufContent(buf->buffer), *size); } (void)xmlOutputBufferClose(buf); } @@ -617,7 +634,7 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { /************************************************************************ * * - * Dumping HTML tree content to an I/O output buffer * + * Dumping HTML tree content to an I/O output buffer * * * ************************************************************************/ @@ -628,7 +645,7 @@ void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur); * @buf: the HTML buffer output * @doc: the document * @encoding: the encoding string - * + * * TODO: check whether encoding is needed * * Dump the HTML document DTD, if any. @@ -646,14 +663,14 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlOutputBufferWriteString(buf, (const char *)cur->name); if (cur->ExternalID != NULL) { xmlOutputBufferWriteString(buf, " PUBLIC "); - xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID); + xmlBufWriteQuotedString(buf->buffer, cur->ExternalID); if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " "); - xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); - } + xmlBufWriteQuotedString(buf->buffer, cur->SystemID); + } } else if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " SYSTEM "); - xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); + xmlBufWriteQuotedString(buf->buffer, cur->SystemID); } xmlOutputBufferWriteString(buf, ">\n"); } @@ -673,9 +690,10 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, xmlChar *value; /* - * TODO: The html output method should not escape a & character - * occurring in an attribute value immediately followed by - * a { character (see Section B.7.1 of the HTML 4.0 Recommendation). + * The html output method should not escape a & character + * occurring in an attribute value immediately followed by + * a { character (see Section B.7.1 of the HTML 4.0 Recommendation). + * This is implemented in xmlEncodeEntitiesReentrant */ if (cur == NULL) { @@ -698,20 +716,51 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, (!xmlStrcasecmp(cur->name, BAD_CAST "src")) || ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { - xmlChar *escaped; xmlChar *tmp = value; + /* xmlURIEscapeStr() escapes '"' so it can be safely used. */ + xmlBufCCat(buf->buffer, "\""); while (IS_BLANK_CH(*tmp)) tmp++; - escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+"); - if (escaped != NULL) { - xmlBufferWriteQuotedString(buf->buffer, escaped); - xmlFree(escaped); - } else { - xmlBufferWriteQuotedString(buf->buffer, value); + /* URI Escape everything, except server side includes. */ + for ( ; ; ) { + xmlChar *escaped; + xmlChar endChar; + xmlChar *end = NULL; + xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST ""); + if (end != NULL) { + *start = '\0'; + } + } + + /* Escape the whole string, or until start (set to '\0'). */ + escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+"); + if (escaped != NULL) { + xmlBufCat(buf->buffer, escaped); + xmlFree(escaped); + } else { + xmlBufCat(buf->buffer, tmp); + } + + if (end == NULL) { /* Everything has been written. */ + break; + } + + /* Do not escape anything within server side includes. */ + *start = '<'; /* Restore the first character of "") */ + endChar = *end; + *end = '\0'; + xmlBufCat(buf->buffer, start); + *end = endChar; + tmp = end; } + + xmlBufCCat(buf->buffer, "\""); } else { - xmlBufferWriteQuotedString(buf->buffer, value); + xmlBufWriteQuotedString(buf->buffer, value); } xmlFree(value); } else { @@ -1061,7 +1110,7 @@ htmlDocDump(FILE *f, xmlDocPtr cur) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } else { handler = xmlFindCharEncodingHandler(encoding); } @@ -1101,7 +1150,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { if ((cur == NULL) || (filename == NULL)) return(-1); - + xmlInitParser(); encoding = (const char *) htmlGetMetaEncoding(cur); @@ -1120,7 +1169,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } } @@ -1132,7 +1181,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); @@ -1152,7 +1201,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { * @encoding: the document encoding * * Dump an HTML document to a file using a given encoding. - * + * * returns: the number of byte written or -1 in case of failure. */ int @@ -1181,7 +1230,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) - return(-1); + htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); } htmlSetMetaEncoding(cur, (const xmlChar *) encoding); } else { @@ -1196,7 +1245,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, 0); @@ -1216,7 +1265,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, * * Dump an HTML document to a file using a given encoding * and formatting returns/spaces are added. - * + * * returns: the number of byte written or -1 in case of failure. */ int diff --git a/third_party/libxml/src/INSTALL b/third_party/libxml/src/INSTALL deleted file mode 100644 index 7d1c323..0000000 --- a/third_party/libxml/src/INSTALL +++ /dev/null @@ -1,365 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/third_party/libxml/src/Makefile.am b/third_party/libxml/src/Makefile.am new file mode 100644 index 0000000..70720f3 --- /dev/null +++ b/third_party/libxml/src/Makefile.am @@ -0,0 +1,1279 @@ +## Process this file with automake to produce Makefile.in + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) + +DIST_SUBDIRS = include . doc example python xstc + +AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include + +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) + +noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ + testThreads testC14N testAutomata testRegexp \ + testReader testapi testModule runtest runsuite testchar \ + testdict runxmlconf testrecurse testlimits + +bin_PROGRAMS = xmllint xmlcatalog + +bin_SCRIPTS=xml2-config + +lib_LTLIBRARIES = libxml2.la +libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) + +if USE_VERSION_SCRIPT +LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms +else +LIBXML2_VERSION_SCRIPT = +endif + +libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ + $(LIBXML2_VERSION_SCRIPT) \ + -version-info $(LIBXML_VERSION_INFO) \ + $(MODULE_PLATFORM_LIBS) + +if WITH_SAX1_SOURCES +docb_sources = DOCBparser.c +else +docb_sources = +endif + +if WITH_TRIO_SOURCES +trio_sources = triostr.c trio.c +else +trio_sources = +endif + +libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ + parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ + valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ + xpointer.c xinclude.c nanohttp.c nanoftp.c \ + $(docb_sources) \ + catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ + xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ + $(trio_sources) \ + xmlreader.c relaxng.c dict.c SAX2.c \ + xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ + xmlmodule.c schematron.c xzlib.c + +DEPS = $(top_builddir)/libxml2.la +LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) + + +man_MANS = xml2-config.1 libxml.3 + +m4datadir = $(datadir)/aclocal +m4data_DATA = libxml.m4 + +runtest_SOURCES=runtest.c +runtest_LDFLAGS = +runtest_DEPENDENCIES = $(DEPS) +runtest_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) + +testrecurse_SOURCES=testrecurse.c +testrecurse_LDFLAGS = +testrecurse_DEPENDENCIES = $(DEPS) +testrecurse_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) + +testlimits_SOURCES=testlimits.c +testlimits_LDFLAGS = +testlimits_DEPENDENCIES = $(DEPS) +testlimits_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) + +testchar_SOURCES=testchar.c +testchar_LDFLAGS = +testchar_DEPENDENCIES = $(DEPS) +testchar_LDADD= $(RDL_LIBS) $(LDADDS) + +testdict_SOURCES=testdict.c +testdict_LDFLAGS = +testdict_DEPENDENCIES = $(DEPS) +testdict_LDADD= $(RDL_LIBS) $(LDADDS) + +runsuite_SOURCES=runsuite.c +runsuite_LDFLAGS = +runsuite_DEPENDENCIES = $(DEPS) +runsuite_LDADD= $(RDL_LIBS) $(LDADDS) + +xmllint_SOURCES=xmllint.c +xmllint_LDFLAGS = +xmllint_DEPENDENCIES = $(DEPS) +xmllint_LDADD= $(RDL_LIBS) $(LDADDS) + +testSAX_SOURCES=testSAX.c +testSAX_LDFLAGS = +testSAX_DEPENDENCIES = $(DEPS) +testSAX_LDADD= $(LDADDS) + +testHTML_SOURCES=testHTML.c +testHTML_LDFLAGS = +testHTML_DEPENDENCIES = $(DEPS) +testHTML_LDADD= $(LDADDS) + +xmlcatalog_SOURCES=xmlcatalog.c +xmlcatalog_LDFLAGS = +xmlcatalog_DEPENDENCIES = $(DEPS) +xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) + +testXPath_SOURCES=testXPath.c +testXPath_LDFLAGS = +testXPath_DEPENDENCIES = $(DEPS) +testXPath_LDADD= $(LDADDS) + +testC14N_SOURCES=testC14N.c +testC14N_LDFLAGS = +testC14N_DEPENDENCIES = $(DEPS) +testC14N_LDADD= $(LDADDS) + +if THREADS_W32 +testThreads_SOURCES = testThreadsWin32.c +else +testThreads_SOURCES = testThreads.c +endif +testThreads_LDFLAGS = +testThreads_DEPENDENCIES = $(DEPS) +testThreads_LDADD= $(BASE_THREAD_LIBS) $(LDADDS) + +testURI_SOURCES=testURI.c +testURI_LDFLAGS = +testURI_DEPENDENCIES = $(DEPS) +testURI_LDADD= $(LDADDS) + +testRegexp_SOURCES=testRegexp.c +testRegexp_LDFLAGS = +testRegexp_DEPENDENCIES = $(DEPS) +testRegexp_LDADD= $(LDADDS) + +testAutomata_SOURCES=testAutomata.c +testAutomata_LDFLAGS = +testAutomata_DEPENDENCIES = $(DEPS) +testAutomata_LDADD= $(LDADDS) + +testSchemas_SOURCES=testSchemas.c +testSchemas_LDFLAGS = +testSchemas_DEPENDENCIES = $(DEPS) +testSchemas_LDADD= $(LDADDS) + +testRelax_SOURCES=testRelax.c +testRelax_LDFLAGS = +testRelax_DEPENDENCIES = $(DEPS) +testRelax_LDADD= $(LDADDS) + +testReader_SOURCES=testReader.c +testReader_LDFLAGS = +testReader_DEPENDENCIES = $(DEPS) +testReader_LDADD= $(LDADDS) + +testModule_SOURCES=testModule.c +testModule_LDFLAGS = +testModule_DEPENDENCIES = $(DEPS) +testModule_LDADD= $(LDADDS) + +noinst_LTLIBRARIES = testdso.la +testdso_la_SOURCES = testdso.c +testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir) + +# that one forces the rebuild when "make rebuild" is run on doc/ +rebuild_testapi: + -@(if [ "$(PYTHON)" != "" ] ; then \ + $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) + +# that one is just to make sure it is rebuilt if missing +# but adding the dependances generate mess +testapi.c: $(srcdir)/gentest.py + -@(if [ "$(PYTHON)" != "" ] ; then \ + $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) + +BUILT_SOURCES = testapi.c + +testapi_SOURCES=testapi.c +testapi_LDFLAGS = +testapi_DEPENDENCIES = $(DEPS) +testapi_LDADD= $(LDADDS) + +runxmlconf_SOURCES=runxmlconf.c +runxmlconf_LDFLAGS = +runxmlconf_DEPENDENCIES = $(DEPS) +runxmlconf_LDADD= $(LDADDS) + +#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c +#testOOM_LDFLAGS = +#testOOM_DEPENDENCIES = $(DEPS) +#testOOM_LDADD= $(LDADDS) + +runtests: + [ -d test ] || $(LN_S) $(srcdir)/test . + [ -d result ] || $(LN_S) $(srcdir)/result . + $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + +check: all runtests + +check-valgrind valgrind: all + @echo '## Running the regression tests under Valgrind' + @echo '## Go get a cup of coffee it is gonna take a while ...' + $(MAKE) CHECKER='valgrind -q' runtests + +testall : tests SVGtests SAXtests + +tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) + @(cd doc/examples ; $(MAKE) tests) + +APItests: testapi$(EXEEXT) + @echo "## Running the API regression tests this may take a little while" + -@($(CHECKER) $(top_builddir)/testapi -q) + +HTMLtests : testHTML$(EXEEXT) + @(echo > .memdump) + @echo "## HTML regression tests" + -@(for i in $(srcdir)/test/HTML/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ + else \ + log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/HTML/$$name result.$$name ; \ + diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \ + $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \ + diff result.$$name result2.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result2.$$name error.$$name ; \ + fi ; fi ; done) + +HTMLPushtests : testHTML$(EXEEXT) + @echo "## Push HTML regression tests" + -@(for i in $(srcdir)/test/HTML/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ + else \ + log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/HTML/$$name result.$$name ; \ + cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \ + cut -b 1-15 error.$$name > errorcut2.$$name; \ + diff -b errorcut.$$name errorcut2.$$name ; \ + $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \ + diff result.$$name result2.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \ + fi ; fi ; done) + @echo "## HTML SAX regression tests" + -@(for i in $(srcdir)/test/HTML/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ + else \ + log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name.sax ; \ + fi ; fi ; done) + @echo "## Push HTML SAX regression tests" + -@(for i in $(srcdir)/test/HTML/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ + else \ + log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name.sax ; \ + fi ; fi ; done) + +XMLtests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## XML regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/$$name result.$$name ; \ + $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff result.$$name result2.$$name` ;\ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result2.$$name ; \ + fi ; fi ; done) + @echo "## XML regression tests on memory" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name result.$$name ; \ + $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + diff result.$$name result2.$$name ; \ + rm result.$$name result2.$$name ; \ + fi ; fi ; done) + +XMLPushtests: xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## XML push regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/$$name result.$$name ; \ + $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff result.$$name result2.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result2.$$name ; \ + fi ; fi ; done) + +NStests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## XML Namespaces regression tests" + -@(for i in $(srcdir)/test/namespaces/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint $$i \ + 2> $(srcdir)/result/namespaces/$$name.err \ + > $(srcdir)/result/namespaces/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/namespaces/$$name result.$$name ; \ + diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + +IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT) + @(echo > .memdump) + @echo "## xml:id regression tests" + -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \ + 2> $(srcdir)/result/xmlid/$$name.err \ + > $(srcdir)/result/xmlid/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/xmlid/$$name result.$$name ; \ + diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + +Errtests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Error cases regression tests" + -@(for i in $(srcdir)/test/errors/*.xml ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/errors/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint $$i \ + 2> $(srcdir)/result/errors/$$name.err \ + > $(srcdir)/result/errors/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/errors/$$name result.$$name ; \ + diff $(srcdir)/result/errors/$$name.err error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + @echo "## Error cases stream regression tests" + -@(for i in $(srcdir)/test/errors/*.xml ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --stream $$i \ + 2> $(srcdir)/result/errors/$$name.str \ + > /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/errors/$$name.str error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm error.$$name ; \ + fi ; fi ; done) + +Docbtests : xmllint$(EXEEXT) + +XMLenttests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## XML entity subst regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/noent/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff $(srcdir)/result/noent/$$name result.$$name ; \ + $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff result.$$name result2.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result2.$$name ; \ + fi ; fi ; done) + +URItests : testURI$(EXEEXT) + @(echo > .memdump) + @echo "## URI module regression tests" + -@(for i in $(srcdir)/test/URI/*.data ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/URI/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + -@(for i in $(srcdir)/test/URI/*.uri ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/URI/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + +XPathtests : testXPath$(EXEEXT) + @(echo > .memdump) + @echo "## XPath regression tests" + -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ + then echo Skipping debug not compiled in ; exit 0 ; fi ; \ + for i in $(srcdir)/test/XPath/expr/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done ; \ + for i in $(srcdir)/test/XPath/docs/* ; do \ + if [ ! -d $$i ] ; then \ + doc=`basename $$i`; \ + for j in $(srcdir)/test/XPath/tests/$$doc* ; do \ + if [ ! -f $$j ] ; then continue ; fi ; \ + name=`basename $$j`; \ + if [ ! -d $$j ] ; then \ + if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done ; fi ; done) + +XPtrtests : testXPath$(EXEEXT) + @(echo > .memdump) + @echo "## XPointer regression tests" + -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ + then echo Skipping debug not compiled in ; exit 0 ; fi ; \ + for i in $(srcdir)/test/XPath/docs/* ; do \ + if [ ! -d $$i ] ; then \ + doc=`basename $$i`; \ + for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \ + if [ ! -f $$j ] ; then continue ; fi ; \ + name=`basename $$j`; \ + if [ ! -d $$j ] ; then \ + if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + else \ + log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done ; fi ; done) + +XIncludetests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## XInclude regression tests" + -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XInclude/$$name result.$$name ; \ + diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XInclude/$$name result.$$name ; \ + diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + @(echo > .memdump) + @echo "## XInclude xmlReader regression tests" + -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ + diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ + diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + +Scripttests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Scripts regression tests" + @echo "## Some of the base computations may be different if srcdir != ." + -@(for i in $(srcdir)/test/scripts/*.script ; do \ + name=`basename $$i .script`; \ + xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \ + if [ -f $$xml ] ; then \ + if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/scripts/$$name result.$$name ; \ + diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name result.$$name.err ; \ + fi ; fi ; done) + +Catatests : xmlcatalog$(EXEEXT) + @(echo > .memdump) + @echo "## Catalog regression tests" + -@(for i in $(srcdir)/test/catalogs/*.script ; do \ + name=`basename $$i .script`; \ + xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \ + if [ -f $$xml ] ; then \ + if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + -@(for i in $(srcdir)/test/catalogs/*.script ; do \ + name=`basename $$i .script`; \ + sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \ + if [ -f $$sgml ] ; then \ + if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## Add and del operations on XML Catalogs" + -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + rm -f $(srcdir)/result/catalogs/mycatalog) + +SVGtests : xmllint$(EXEEXT) + @echo "## SVG parsing regression tests" + -@(for i in $(srcdir)/test/SVG/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + echo Testing $$name ; \ + $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/SVG/$$name result.$$name ; \ + $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff result.$$name result2.$$name ; \ + rm result.$$name result2.$$name ; \ + fi ; fi ; done) + +Threadtests : testThreads$(EXEEXT) + @echo "## Threaded regression tests" + -@($(CHECKER) $(top_builddir)/testThreads ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ + exit 0) + +Readertests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Reader regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.rdr result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## Reader on memory regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.rdr result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @(echo > .memdump) + @echo "## Walker regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.rdr result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## Reader entities substitution regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.rde ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.rde result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + +SAXtests : testSAX$(EXEEXT) + @(echo > .memdump) + @echo "## SAX1 callbacks regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.sax ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.sax result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## SAX2 callbacks regression tests" + -@(for i in $(srcdir)/test/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/$$name.sax2 result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + +Validtests : xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Valid documents regression tests" + -@(for i in $(srcdir)/test/VCM/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + fi ; done ; exit 0) + @echo "## Validity checking regression tests" + -@(for i in $(srcdir)/test/VC/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/VC/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/VC/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## General documents valid regression tests" + -@(for i in $(srcdir)/test/valid/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/valid/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/valid/$$name result.$$name ; \ + diff $(srcdir)/result/valid/$$name.err error.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name error.$$name ; \ + fi ; fi ; done) + +Regexptests: testRegexp$(EXEEXT) + @(echo > .memdump) + @echo "## Regexp regression tests" + -@(for i in $(srcdir)/test/regexp/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/regexp/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + @echo "## Formal expresssions regression tests" + -@(for i in $(srcdir)/test/expr/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/expr/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/expr/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + +Automatatests: testAutomata$(EXEEXT) + @(echo > .memdump) + @echo "## Automata regression tests" + -@(for i in $(srcdir)/test/automata/* ; do \ + name=`basename $$i`; \ + if [ ! -d $$i ] ; then \ + if [ ! -f $(srcdir)/result/automata/$$name ] ; then \ + echo New test file $$name ; \ + $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/automata/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done) + +dba100000.xml: dbgenattr.pl + @echo "## generating dba100000.xml" + @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml) + +Timingtests: xmllint$(EXEEXT) dba100000.xml + @echo "## Timing tests to try to detect performance" + @echo "## as well a memory usage breakage when streaming" + @echo "## 1/ using the file interface" + @echo "## 2/ using the memory interface" + @echo "## 3/ repeated DOM parsing" + @echo "## 4/ repeated DOM validation" + -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \ + MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ + if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + exit 0) + -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \ + MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ + if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + exit 0) + -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ + MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ + if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + exit 0) + +VTimingtests: xmllint$(EXEEXT) + -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ + MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ + if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + exit 0) + +C14Ntests : testC14N$(EXEEXT) + @echo "## C14N and XPath regression tests" + -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \ + for i in $(srcdir)/test/c14n/$$m/*.xml ; do \ + if [ ! -d $$i ] ; then \ + name=`basename $$i .xml`; \ + cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \ + if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \ + cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \ + if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \ + cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \ + fi; \ + fi; \ + $$cmdline > $(srcdir)/test/c14n/test.tmp; \ + if [ $$? -eq 0 ]; then \ + diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \ + if [ $$? -ne 0 ]; then \ + echo "Test $$m/$$name failed"; \ + cat $(srcdir)/test/c14n/test.tmp; \ + fi; \ + else \ + echo "C14N failed"; \ + fi; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + fi; \ + rm -f $(srcdir)/test/c14n/test.tmp; \ + done; \ + done) + +Schemastests: testSchemas$(EXEEXT) + @(echo > .memdump) + @echo "## Schemas regression tests" + -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \ + name=`basename $$i | sed 's+_.*++'`; \ + sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \ + for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \ + if [ -f $$j ] ; then \ + xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ + if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \ + then \ + echo New test file "$$name"_"$$sno"_"$$xno" ; \ + $(CHECKER) $(top_builddir)/testSchemas $$i $$j \ + > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ + 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ + > res.$$name 2> err.$$name;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ + res.$$name;\ + diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \ + err.$$name;\ + grep Unimplemented err.$$name`; \ + if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \ + rm res.$$name err.$$name ; \ + fi ; fi ;\ + done; done) + +Relaxtests: xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Relax-NG regression tests" + -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ + name=`basename $$i | sed 's+\.rng++'`; \ + if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \ + echo New schemas $$name ; \ + $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ + > $(srcdir)/result/relaxng/"$$name"_valid \ + 2> $(srcdir)/result/relaxng/"$$name"_err; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ + > res.$$name 2> err.$$name;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/relaxng/"$$name"_valid \ + res.$$name;\ + diff $(srcdir)/result/relaxng/"$$name"_err \ + err.$$name | grep -v "error detected at";\ + grep Unimplemented err.$$name`; \ + if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \ + rm res.$$name err.$$name ; \ + fi; \ + for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ + if [ -f $$j ] ; then \ + xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ + if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ + then \ + echo New test file "$$name"_"$$xno" ; \ + $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ + > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ + 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ + > res.$$name 2> err.$$name;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \ + res.$$name;\ + diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ + err.$$name | grep -v "error detected at";\ + grep Unimplemented err.$$name`; \ + if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ + rm res.$$name err.$$name ; \ + fi ; fi ; \ + done; done) + @echo "## Relax-NG streaming regression tests" + -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ + name=`basename $$i | sed 's+\.rng++'`; \ + for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ + if [ -f $$j ] ; then \ + xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ + if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ + then \ + echo New test file "$$name"_"$$xno" ; \ + $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ + > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ + 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \ + > res.$$name 2> err.$$name;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\ + if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \ + diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ + err.$$name | grep -v "error detected at";\ + fi ; grep Unimplemented err.$$name`; \ + if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ + rm res.$$name err.$$name ; \ + fi ; fi ; \ + done; done) + +Schematrontests: xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Schematron regression tests" + -@(for i in $(srcdir)/test/schematron/*.sct ; do \ + name=`basename $$i | sed 's+\.sct++'`; \ + for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \ + if [ -f $$j ] ; then \ + xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ + if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \ + then \ + echo New test file "$$name"_"$$xno" ; \ + $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ + > $(srcdir)/result/schematron/"$$name"_"$$xno" \ + 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + else \ + log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ + > res.$$name 2> err.$$name;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + diff $(srcdir)/result/schematron/"$$name"_"$$xno" \ + res.$$name;\ + diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \ + err.$$name | grep -v "error detected at";\ + grep Unimplemented err.$$name`; \ + if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ + rm res.$$name err.$$name ; \ + fi ; fi ; \ + done; done) + +RelaxNGPythonTests: + @(if [ -x $(PYTHON) ] ; then \ + PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \ + export PYTHONPATH; \ + LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ + export LD_LIBRARY_PATH; \ + echo "## Relax-NG Python based test suite 1" ; \ + $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \ + echo "## Relax-NG Python based test suite 2" ; \ + $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \ + fi) + +SchemasPythonTests: + @(if [ -x $(PYTHON) ] ; then \ + PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \ + export PYTHONPATH; \ + 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 11 errors reported" ; \ + $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ + fi) + @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) + +Patterntests: xmllint$(EXEEXT) + @(echo > .memdump) + @echo "## Pattern regression tests" + -@(for i in $(srcdir)/test/pattern/*.pat ; do \ + name=`basename $$i .pat`; \ + if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \ + if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \ + rm -f result.$$name ; \ + echo New test file $$name ; \ + for pat in `cat $$i` ; do \ + $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + done ;\ + else \ + rm -f result.$$name ; \ + lst=`cat $$i` ; \ + log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ + done ;\ + diff $(srcdir)/result/pattern/$$name result.$$name` ; \ + if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ + rm result.$$name ; \ + fi ; fi ; done ;) + +ModuleTests: testModule$(EXEEXT) testdso.la + @echo "## Module tests" + @(./testModule$(EXEEXT)) + +cleanup: + -@(find . -name .\#\* -exec rm {} \;) + -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) + -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) + +dist-hook: cleanup libxml2.spec + -cp libxml2.spec $(distdir) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos os400 vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) + +dist-source: distdir + $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz + +dist-test: distdir + (mkdir -p $(distdir)) + (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) + tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz + @(rm -rf $(distdir)/xstc/Test) + +cleantar: + @(rm -f libxml*.tar.gz COPYING.LIB) + +rpm: cleanup cleantar + @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz) + +## We create xml2Conf.sh here and not from configure because we want +## to get the paths expanded correctly. Macros like srcdir are given +## the value NONE in configure if the user doesn't specify them (this +## is an autoconf feature, not a bug). + +xml2Conf.sh: xml2Conf.sh.in Makefile +## Use sed and then mv to avoid problems if the user interrupts. + sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \ + -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \ + -e 's?\@VERSION\@?$(VERSION)?g' \ + -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \ + < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ + && mv xml2Conf.tmp xml2Conf.sh + +CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res +DISTCLEANFILES = COPYING missing.lst + +confexecdir=$(libdir) +confexec_DATA = xml2Conf.sh +CVS_EXTRA_DIST= +EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \ + libxml.m4 Copyright check-xml-test-suite.py gentest.py \ + check-relaxng-test-suite.py check-relaxng-test-suite2.py \ + check-xsddata-test-suite.py check-xinclude-test-suite.py \ + example/Makefile.am example/gjobread.c example/gjobs.xml \ + $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ + libxml2-config.cmake.in \ + trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ + triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ + enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ + dbgen.pl dbgenattr.pl regressions.py regressions.xml \ + README.tests Makefile.tests libxml2.syms timsort.h \ + $(CVS_EXTRA_DIST) + + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libxml-2.0.pc + +cmakedir = $(libdir)/cmake/libxml2 +cmake_DATA = libxml2-config.cmake + +# +# Install the tests program sources as examples +# +BASE_DIR=$(datadir)/doc +DOC_MODULE=libxml2-$(VERSION) +EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples + +install-data-local: + $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + $(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) + -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) + +uninstall-local: + rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c + rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c + rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c + rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c + rm -rf $(DESTDIR)$(EXAMPLES_DIR) + rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright + rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) + +tst: tst.c + $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma + +sparse: clean + $(MAKE) CC=cgcc + +# +# Coverage support, largely borrowed from libvirt +# Both binaries comes from the lcov package in Fedora +# +LCOV = /usr/bin/lcov +GENHTML = /usr/bin/genhtml + +cov: clean-cov + if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \ + echo not configured with coverage; exit 1 ; fi + if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \ + echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi + -@($(MAKE) check) + -@(./runsuite$(EXEEXT)) + mkdir $(top_builddir)/coverage + $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir) + $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr* + rm $(top_builddir)/coverage/libxml2.info.tmp + $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info + echo "Coverage report is in $(top_builddir)/coverage/index.html" + +clean-cov: + rm -rf $(top_builddir)/coverage + diff --git a/third_party/libxml/src/Makefile.tests b/third_party/libxml/src/Makefile.tests new file mode 100644 index 0000000..619cbfb --- /dev/null +++ b/third_party/libxml/src/Makefile.tests @@ -0,0 +1,41 @@ +# +# You may have to ajust to call the right compiler, or other oprions +# for compiling and linking +# + +CFLAGS=`xml2-config --cflags` +LIBS=`xml2-config --libs` +THREADLIB= -lpthread +EXEEXT= + +all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) testchar$(EXEEXT) + +clean: + $(RM) runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) + +check: do_runtest do_testchar do_testapi do_runsuite + +runtest$(EXEEXT): runtest.c + $(CC) -o runtest$(EXEEXT) $(CFLAGS) runtest.c $(LIBS) $(THREADLIB) + +do_runtest: runtest$(EXEEXT) + ./runtest + +runsuite$(EXEEXT): runsuite.c + $(CC) -o runsuite$(EXEEXT) $(CFLAGS) runsuite.c $(LIBS) + +do_runsuite: runsuite$(EXEEXT) + ./runsuite + +testapi$(EXEEXT): testapi.c + $(CC) -o testapi$(EXEEXT) $(CFLAGS) testapi.c $(LIBS) + +do_testapi: testapi$(EXEEXT) + ./testapi + +testchar$(EXEEXT): testchar.c + $(CC) -o testchar$(EXEEXT) $(CFLAGS) testchar.c $(LIBS) + +do_testchar: testchar$(EXEEXT) + ./testchar + diff --git a/third_party/libxml/src/NEWS b/third_party/libxml/src/NEWS index cdfdda6..8027d55 100644 --- a/third_party/libxml/src/NEWS +++ b/third_party/libxml/src/NEWS @@ -4,17 +4,647 @@ Note that this is automatically generated from the news webpage at: http://xmlsoft.org/news.html -Items not finished and worked on, get in touch with the list if you want -to help those - More testing on RelaxNG - - Finishing up XML - Schemas - The change log at ChangeLog.html describes the recents commits -to the SVN at -http://svn.gnome.org/viewvc/libxml2/trunk/ +to the GIT at +http://git.gnome.org/browse/libxml2/ code base.Here is the list of public releases: +2.9.2: Oct 16 2014: + - Security: + Fix for CVE-2014-3660 billion laugh variant (Daniel Veillard), + CVE-2014-0191 Do not fetch external parameter entities (Daniel Veillard) + + - Bug Fixes: + fix memory leak xml header encoding field with XML_PARSE_IGNORE_ENC (Bart De Schuymer), + xmlmemory: handle realloc properly (Yegor Yefremov), + Python generator bug raised by the const change (Daniel Veillard), + Windows Critical sections not released correctly (Daniel Veillard), + Parser error on repeated recursive entity expansion containing < (Daniel Veillard), + xpointer : fixing Null Pointers (Gaurav Gupta), + Remove Unnecessary Null check in xpointer.c (Gaurav Gupta), + parser bug on misformed namespace attributes (Dennis Filder), + Pointer dereferenced before null check (Daniel Veillard), + Leak of struct addrinfo in xmlNanoFTPConnect() (Gaurav Gupta), + Possible overflow in HTMLParser.c (Daniel Veillard), + python/tests/sync.py assumes Python dictionaries are ordered (John Beck), + Fix Enum check and missing break (Gaurav Gupta), + xmlIO: Handle error returns from dup() (Philip Withnall), + Fix a problem properly saving URIs (Daniel Veillard), + wrong error column in structured error when parsing attribute values (Juergen Keil), + wrong error column in structured error when skipping whitespace in xml decl (Juergen Keil), + no error column in structured error handler for xml schema validation errors (Juergen Keil), + Couple of Missing Null checks (Gaurav Gupta), + Add couple of missing Null checks (Daniel Veillard), + xmlschemastypes: Fix potential array overflow (Philip Withnall), + runtest: Fix a memory leak on parse failure (Philip Withnall), + xmlIO: Fix an FD leak on gzdopen() failure (Philip Withnall), + xmlcatalog: Fix a memory leak on quit (Philip Withnall), + HTMLparser: Correctly initialise a stack allocated structure (Philip Withnall), + Check for tmon in _xmlSchemaDateAdd() is incorrect (David Kilzer), + Avoid Possible Null Pointer in trio.c (Gaurav Gupta), + Fix processing in SAX2 in case of an allocation failure (Daniel Veillard), + XML Shell command "cd" does not handle "/" at end of path (Daniel Veillard), + Fix various Missing Null checks (Gaurav Gupta), + Fix a potential NULL dereference (Daniel Veillard), + Add a couple of misisng check in xmlRelaxNGCleanupTree (Gaurav Gupta), + Add a missing argument check (Gaurav Gupta), + Adding a check in case of allocation error (Gaurav Gupta), + xmlSaveUri() incorrectly recomposes URIs with rootless paths (Dennis Filder), + Adding some missing NULL checks (Gaurav), + Fixes for xmlInitParserCtxt (Daniel Veillard), + Fix regressions introduced by CVE-2014-0191 patch (Daniel Veillard), + erroneously ignores a validation error if no error callback set (Daniel Veillard), + xmllint was not parsing the --c14n11 flag (Sérgio Batista), + Avoid Possible null pointer dereference in memory debug mode (Gaurav), + Avoid Double Null Check (Gaurav), + Restore context size and position after XPATH_OP_ARG (Nick Wellnhofer), + Fix xmlParseInNodeContext() if node is not element (Daniel Veillard), + Avoid a possible NULL pointer dereference (Gaurav), + Fix xmlTextWriterWriteElement when a null content is given (Daniel Veillard), + Fix an typo 'onrest' in htmlScriptAttributes (Daniel Veillard), + fixing a ptotential uninitialized access (Daniel Veillard), + Fix an fd leak in an error case (Daniel Veillard), + Missing initialization for the catalog module (Daniel Veillard), + Handling of XPath function arguments in error case (Nick Wellnhofer), + Fix a couple of missing NULL checks (Gaurav), + Avoid a possibility of dangling encoding handler (Gaurav), + Fix HTML push parser to accept HTML_PARSE_NODEFDTD (Arnold Hendriks), + Fix a bug loading some compressed files (Mike Alexander), + Fix XPath node comparison bug (Gaurav), + Type mismatch in xmlschemas.c (Gaurav), + Type mismatch in xmlschemastypes.c (Gaurav), + Avoid a deadcode in catalog.c (Daniel Veillard), + run close socket on Solaris, same as we do on other platforms (Denis Pauk), + Fix pointer dereferenced before null check (Gaurav), + Fix a potential NULL dereference in tree code (Daniel Veillard), + Fix potential NULL pointer dereferences in regexp code (Gaurav), + xmllint --pretty crashed without following numeric argument (Tim Galeckas), + Fix XPath expressions of the form '@ns:*' (Nick Wellnhofer), + Fix XPath '//' optimization with predicates (Nick Wellnhofer), + Clear up a potential NULL dereference (Daniel Veillard), + Fix a possible NULL dereference (Gaurav), + Avoid crash if allocation fails (Daniel Veillard), + Remove occasional leading space in XPath number formatting (Daniel Veillard), + Fix handling of mmap errors (Daniel Veillard), + Catch malloc error and exit accordingly (Daniel Veillard), + missing else in xlink.c (Ami Fischman), + Fix a parsing bug on non-ascii element and CR/LF usage (Daniel Veillard), + Fix a regression in xmlGetDocCompressMode() (Daniel Veillard), + properly quote the namespace uris written out during c14n (Aleksey Sanin), + Remove premature XInclude check on URI being relative (Alexey Neyman), + Fix missing break on last() function for attributes (dcb), + Do not URI escape in server side includes (Romain Bondue), + Fix an error in xmlCleanupParser (Alexander Pastukhov) + + - Documentation: + typo in error messages "colon are forbidden from..." (Daniel Veillard), + Fix a link to James SAX documentation old page (Daniel Veillard), + Fix typos in relaxng.c (Jan Pokorný), + Fix a doc typo (Daniel Veillard), + Fix typos in {tree,xpath}.c (errror) (Jan Pokorný), + Add limitations about encoding conversion (Daniel Veillard), + Fix typos in xmlschemas{,types}.c (Jan Pokorný), + Fix incorrect spelling entites->entities (Jan Pokorný), + Forgot to document 2.9.1 release, regenerate docs (Daniel Veillard) + + - Portability: + AC_CONFIG_FILES and executable bit (Roumen Petrov), + remove HAVE_CONFIG_H dependency in testlimits.c (Roumen Petrov), + fix some tabs mixing incompatible with python3 (Roumen Petrov), + Visual Studio 14 CTP defines snprintf() (Francis Dupont), + OS400: do not try to copy unexisting doc files (Patrick Monnerat), + OS400: use either configure.ac or configure.in. (Patrick Monnerat), + os400: make-src.sh: create physical file with target CCSID (Patrick Monnerat), + OS400: Add some more C macros equivalent procedures. (Patrick Monnerat), + OS400: use C macros to implement equivalent RPG support procedures. (Patrick Monnerat), + OS400: implement XPath macros as procedures for ILE/RPG support. (Patrick Monnerat), + OS400: include in distribution tarball. (Patrick Monnerat), + OS400: Add README: compilation directives and OS/400 specific stuff. (Patrick Monnerat), + OS400: Add compilation scripts. (Patrick Monnerat), + OS400: ILE RPG language header files. (Patrick Monnerat), + OS400: implement some macros as functions for ILE/RPG language support (that as no macros). (Patrick Monnerat), + OS400: UTF8<-->EBCDIC wrappers for system and external library calls (Patrick Monnerat), + OS400: Easy character transcoding support (Patrick Monnerat), + OS400: iconv functions compatibility wrappers and table builder. (Patrick Monnerat), + OS400: create architecture directory. Implement dlfcn emulation. (Patrick Monnerat), + Fix building when configuring without xpath and xptr (Daniel Veillard), + configure: Add --with-python-install-dir (Jonas Eriksson), + Fix compilation with minimum and xinclude. (Nicolas Le Cam), + Compile out use of xmlValidateNCName() when not available. (Nicolas Le Cam), + Fix compilation with minimum and schematron. (Nicolas Le Cam), + Legacy needs xmlSAX2StartElement() and xmlSAX2EndElement(). (Nicolas Le Cam), + Don't use xmlValidateName() when not available. (Nicolas Le Cam), + Fix a portability issue on Windows (Longstreth Jon), + Various portability patches for OpenVMS (Jacob (Jouk) Jansen), + Use specific macros for portability to OS/400 (Patrick Monnerat), + Add macros needed for OS/400 portability (Patrick Monnerat), + Portability patch for fopen on OS/400 (Patrick Monnerat), + Portability fixes for OS/400 (Patrick Monnerat), + Improve va_list portability (Patrick Monnerat), + Portability fix (Patrick Monnerat), + Portability fix (Patrick Monnerat), + Generic portability fix (Patrick Monnerat), + Shortening lines in headers (Patrick Monnerat), + build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB (Philip Withnall), + build: Add @LZMA_LIBS@ to libxml’s pkg-config files (Philip Withnall), + fix some tabs mixing incompatible with python3 (Daniel Veillard), + add additional defines checks for support "./configure --with-minimum" (Denis Pauk), + Another round of fixes for older versions of Python (Arfrever Frehtes Taifersar Arahesis), + python: fix drv_libxml2.py for python3 compatibility (Alexandre Rostovtsev), + python: Fix compiler warnings when building python3 bindings (Armin K), + Fix for compilation with python 2.6.8 (Petr Sumbera) + + - Improvements: + win32/libxml2.def.src after rebuild in doc (Roumen Petrov), + elfgcchack.h: more legacy needs xmlSAX2StartElement() and xmlSAX2EndElement() (Roumen Petrov), + elfgcchack.h: add xmlXPathNodeEval and xmlXPathSetContextNode (Roumen Petrov), + Provide cmake module (Samuel Martin), + Fix a couple of issues raised by make dist (Daniel Veillard), + Fix and add const qualifiers (Kurt Roeckx), + Preparing for upcoming release of 2.9.2 (Daniel Veillard), + Fix zlib and lzma libraries check via command line (Dmitriy), + wrong error column in structured error when parsing end tag (Juergen Keil), + doc/news.html: small update to avoid line join while generating NEWS. (Patrick Monnerat), + Add methods for python3 iterator (Ron Angeles), + Support element node traversal in document fragments. (Kyle VanderBeek), + xmlNodeSetName: Allow setting the name to a substring of the currently set name (Tristan Van Berkom), + Added macros for argument casts (Eric Zurcher), + adding init calls to xml and html Read parsing entry points (Daniel Veillard), + Get rid of 'REPLACEMENT CHARACTER' Unicode chars in xmlschemas.c (Jan Pokorný), + Implement choice for name classes on attributes (Shaun McCance), + Two small namespace tweaks (Daniel Veillard), + xmllint --memory should fail on empty files (Daniel Veillard), + Cast encoding name to char pointer to match arg type (Nikolay Sivov) + + - Cleanups: + Removal of old configure.in (Daniel Veillard), + Unreachable code in tree.c (Gaurav Gupta), + Remove a couple of dead conditions (Gaurav Gupta), + Avoid some dead code and cleanup in relaxng.c (Gaurav), + Drop not needed checks (Denis Pauk), + Fix a wrong test (Daniel Veillard) + + + +2.9.1: Apr 19 2013: + - Features: + Support for Python3 (Daniel Veillard), + Add xmlXPathSetContextNode and xmlXPathNodeEval (Alex Bligh) + + - Documentation: + Add documentation for xmllint --xpath (Daniel Veillard), + Fix the URL of the SAX documentation from James (Daniel Veillard), + Fix spelling of "length". (Michael Wood) + + - Portability: + Fix python bindings with versions older than 2.7 (Daniel Veillard), + rebuild docs:Makefile.am (Roumen Petrov), + elfgcchack.h after rebuild in doc (Roumen Petrov), + elfgcchack for buf module (Roumen Petrov), + Fix a uneeded and wrong extra link parameter (Daniel Veillard), + Few cleanup patches for Windows (Denis Pauk), + Fix rpmbuild --nocheck (Mark Salter), + Fix for win32/configure.js and WITH_THREAD_ALLOC (Daniel Richard), + Fix Broken multi-arch support in xml2-config (Daniel Veillard), + Fix a portability issue for GCC < 3.4.0 (Daniel Veillard), + Windows build fixes (Daniel Richard), + Fix a thread portability problem (Friedrich Haubensak), + Downgrade autoconf requirement to 2.63 (Daniel Veillard) + + - Bug Fixes: + Fix a linking error for python bindings (Daniel Veillard), + Fix a couple of return without value (Jüri Aedla), + Improve the hashing functions (Daniel Franke), + Improve handling of xmlStopParser() (Daniel Veillard), + Remove risk of lockup in dictionary initialization (Daniel Veillard), + Activate detection of encoding in external subset (Daniel Veillard), + Fix an output buffer flushing conversion bug (Mikhail Titov), + Fix an old bug in xmlSchemaValidateOneElement (Csaba László), + Fix configure cannot remove messages (Gilles Espinasse), + fix schema validation in combination with xsi:nil (Daniel Veillard), + xmlCtxtReadFile doesn't work with literal IPv6 URLs (Steve Wolf), + Fix a few problems with setEntityLoader (Alexey Neyman), + Detect excessive entities expansion upon replacement (Daniel Veillard), + Fix the flushing out of raw buffers on encoding conversions (Daniel, +Veillard), + Fix some buffer conversion issues (Daniel Veillard), + When calling xmlNodeDump make sure we grow the buffer quickly (Daniel, +Veillard), + Fix an error in the progressive DTD parsing code (Dan Winship), + xmllint should not load DTD by default when using the reader (Daniel, +Veillard), + Try IBM-037 when looking for EBCDIC handlers (Petr Sumbera), + Fix potential out of bound access (Daniel Veillard), + Fix large parse of file from memory (Daniel Veillard), + Fix a bug in the nsclean option of the parser (Daniel Veillard), + Fix a regression in 2.9.0 breaking validation while streaming (Daniel, +Veillard), + Remove potential calls to exit() (Daniel Veillard) + + - Improvements: + Regenerated API, and testapi, rebuild documentation (Daniel Veillard), + Fix tree iterators broken by 2to3 script (Daniel Veillard), + update all tests for Python3 and Python2 (Daniel Veillard), + A few more fixes for python 3 affecting libxml2.py (Daniel Veillard), + Fix compilation on Python3 (Daniel Veillard), + Converting apibuild.py to python3 (Daniel Veillard), + First pass at starting porting to python3 (Daniel Veillard), + updated configure.in for python3 (Daniel Veillard), + Add support for xpathRegisterVariable in Python (Shaun McCance), + Added a regression tests from bug 694228 data (Daniel Veillard), + Cache presence of '<' in entities content (Daniel Veillard), + Avoid extra processing on entities (Daniel Veillard), + Python binding for xmlRegisterInputCallback (Alexey Neyman), + Python bindings: DOM casts everything to xmlNode (Alexey Neyman), + Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h (Tim Starling), + Adding streaming validation to runtest checks (Daniel Veillard), + Add a --pushsmall option to xmllint (Daniel Veillard) + + - Cleanups: + Switched comment in file to UTF-8 encoding (Daniel Veillard), + Extend gitignore (Daniel Veillard), + Silent the new python test on input (Alexey Neyman), + Cleanup of a duplicate test (Daniel Veillard), + Cleanup on duplicate test expressions (Daniel Veillard), + Fix compiler warning after 153cf15905cf4ec080612ada6703757d10caba1e (Patrick, +Gansterer), + Spec cleanups and a fix for multiarch support (Daniel Veillard), + Silence a clang warning (Daniel Veillard), + Cleanup the Copyright to be pure MIT Licence wording (Daniel Veillard), + rand_seed should be static in dict.c (Wouter Van Rooy), + Fix typos in parser comments (Jan Pokorný) + + + +2.9.0: Sep 11 2012: + - Features: + A few new API entry points, + More resilient push parser mode, + A lot of portability improvement, + Faster XPath evaluation + + - Documentation: + xml2-config.1 markup error (Christian Weisgerber), + libxml(3) manpage typo fix (John Bradshaw), + More cleanups to the documentation part of libxml2 (Daniel Richard G) + + - Portability: + Bug 676544 - fails to build with --without-sax1 (Akira TAGOH), + fix builds not having stdint.h (Rob Richards), + GetProcAddressA is available only on WinCE (Daniel Veillard), + More updates and cleanups on autotools and Makefiles (Daniel Richard G), + More changes for Win32 compilation (Eric Zurcher), + Basic changes for Win32 builds of release 2.9.0: compile buf.c (Eric Zurcher), + Bundles all generated files for python into the distribution (Daniel Richard G), + Fix compiler warnings of wincecompat.c (Patrick Gansterer), + Fix non __GNUC__ build (Patrick Gansterer), + Fix windows unicode build (Patrick Gansterer), + clean redefinition of {v}snprintf in C-source (Roumen Petrov), + use xmlBuf... if DEBUG_INPUT is defined (Roumen Petrov), + fix runtests to use pthreads support for various Unix platforms (Daniel Richard G), + Various "make distcheck" and portability fixups 2nd part (Daniel Richard G), + Various "make distcheck" and portability fixups (Daniel Richard G), + Fix compilation on older Visual Studio (Daniel Veillard) + + - Bug Fixes: + Change the XPath code to percolate allocation errors (Daniel Veillard), + Fix reuse of xmlInitParser (Daniel Veillard), + Fix potential crash on entities errors (Daniel Veillard), + initialize var (Rob Richards), + Fix the XPath arity check to also check the XPath stack limits (Daniel Veillard), + Fix problem with specific and generic error handlers (Pietro Cerutti), + Avoid a potential infinite recursion (Daniel Veillard), + Fix an XSD error when generating internal automata (Daniel Veillard), + Patch for xinclude of text using multibyte characters (Vitaly Ostanin), + Fix a segfault on XSD validation on pattern error (Daniel Veillard), + Fix missing xmlsave.h module which was ignored in recent builds (Daniel Veillard), + Add a missing element check (Daniel Veillard), + Adding various checks on node type though the API (Daniel Veillard), + Namespace nodes can't be unlinked with xmlUnlinkNode (Daniel Veillard), + Fix make dist to include new private header files (Daniel Veillard), + More fixups on the push parser behaviour (Daniel Veillard), + Strengthen behaviour of the push parser in problematic situations (Daniel Veillard), + Enforce XML_PARSER_EOF state handling through the parser (Daniel Veillard), + Fixup limits parser (Daniel Veillard), + Do not fetch external parsed entities (Daniel Veillard), + Fix an error in previous commit (Aron Xu), + Fix entities local buffers size problems (Daniel Veillard), + Fix parser local buffers size problems (Daniel Veillard), + Fix a failure to report xmlreader parsing failures (Daniel Veillard) + + - Improvements: + Keep libxml2.syms when running "make distclean" (Daniel Veillard), + Allow to set the quoting character of an xmlWriter (Csaba Raduly), + Keep non-significant blanks node in HTML parser (Daniel Veillard), + Add a forbidden variable error number and message to XPath (Daniel Veillard), + Support long path names on WNT (Michael Stahl), + Improve HTML escaping of attribute on output (Daniel Veillard), + Handle ICU_LIBS as LIBADD, not LDFLAGS to prevent linking errors (Arfrever Frehtes Taifersar Arahesis), + Switching XPath node sorting to Timsort (Vojtech Fried), + Optimizing '//' in XPath expressions (Nick Wellnhofer), + Expose xmlBufShrink in the public tree API (Daniel Veillard), + Visible HTML elements close the head tag (Conrad Irwin), + Fix file and line report for XSD SAX and reader streaming validation (Daniel Veillard), + Fix const qualifyer to definition of xmlBufferDetach (Daniel Veillard), + minimize use of HAVE_CONFIG_H (Roumen Petrov), + fixup regression in Various "make distcheck" and portability fixups (Roumen Petrov), + Add support for big line numbers in error reporting (Daniel Veillard), + Avoid using xmlBuffer for serialization (Daniel Veillard), + Improve compatibility between xmlBuf and xmlBuffer (Daniel Veillard), + Provide new accessors for xmlOutputBuffer (Daniel Veillard), + Improvements for old buffer compatibility (Daniel Veillard), + Expand the limit test program (Daniel Veillard), + Improve error reporting on parser errors (Daniel Veillard), + Implement some default limits in the XPath module (Daniel Veillard), + Introduce some default parser limits (Daniel Veillard), + Cleanups and new limit APIs for dictionaries (Daniel Veillard), + Fixup for buf.c (Daniel Veillard), + Cleanup URI module memory allocation code (Daniel Veillard), + Extend testlimits (Daniel Veillard), + More avoid quadratic behaviour (Daniel Veillard), + Impose a reasonable limit on PI size (Daniel Veillard), + first version of testlimits new test (Daniel Veillard), + Avoid quadratic behaviour in some push parsing cases (Daniel Veillard), + Impose a reasonable limit on comment size (Daniel Veillard), + Impose a reasonable limit on attribute size (Daniel Veillard), + Harden the buffer code and make it more compatible (Daniel Veillard), + More cleanups for input/buffers code (Daniel Veillard), + Cleanup function xmlBufResetInput(), to set input from Buffer (Daniel Veillard) + Swicth the test program for characters to new input buffers (Daniel Veillard), + Convert the HTML tree module to the new buffers (Daniel Veillard), + Convert of the HTML parser to new input buffers (Daniel Veillard), + Convert the writer to new output buffer and save APIs (Daniel Veillard), + Convert XMLReader to the new input buffers (Daniel Veillard), + New saving functions using xmlBuf and conversion (Daniel Veillard), + Provide new xmlBuf based saving functions (Daniel Veillard), + Convert XInclude to the new input buffers (Daniel Veillard), + Convert catalog code to the new input buffers (Daniel Veillard), + Convert C14N to the new Input buffer (Daniel Veillard), + Convert xmlIO.c to the new input and output buffers (Daniel Veillard), + Convert XML parser to the new input buffers (Daniel Veillard), + Incompatible change to the Input and Output buffers (Daniel Veillard), + Adding new encoding function to deal with the new structures (Daniel Veillard), + Convert XPath to xmlBuf (Daniel Veillard), + Adding a new buf module for buffers (Daniel Veillard), + Memory error within SAX2 reuse common framework (Daniel Veillard), + Fix xmllint --xpath node initialization (Daniel Veillard) + + - Cleanups: + Various cleanups to avoid compiler warnings (Daniel Veillard), + Big space and tab cleanup (Daniel Veillard), + Followup to LibXML2 docs/examples cleanup patch (Daniel Veillard), + Second round of cleanups for LibXML2 docs/examples (Daniel Richard), + Remove all .cvsignore as they are not used anymore (Daniel Veillard), + Fix a Timsort function helper comment (Daniel Veillard), + Small cleanup for valgrind target (Daniel Veillard), + Patch for portability of latin characters in C files (Daniel Veillard), + Cleanup some of the parser code (Daniel Veillard), + Fix a variable name in comment (Daniel Veillard), + Regenerated testapi.c (Daniel Veillard), + Regenerating docs and API files (Daniel Veillard), + Small cleanup of unused variables in test (Daniel Veillard), + Expand .gitignore with more files (Daniel Veillard) + + + +2.8.0: May 23 2012: + - Features: + add lzma compression support (Anders F Bjorklund) + + - Documentation: + xmlcatalog: Add uri and delegateURI to possible add types in man page. (Ville Skyttä), + Update README.tests (Daniel Veillard), + URI handling code is not OOM resilient (Daniel Veillard), + Fix an error in comment (Daniel Veillard), + Fixed bug #617016 (Daniel Mustieles), + Fixed two typos in the README document (Daniel Neel), + add generated html files (Anders F Bjorklund), + Clarify the need to use xmlFreeNode after xmlUnlinkNode (Daniel Veillard), + Improve documentation a bit (Daniel Veillard), + Updated URL for lxml python bindings (Daniel Veillard) + + - Portability: + Restore code for Windows compilation (Daniel Veillard), + Remove git error message during configure (Christian Dywan), + xmllint: Build fix for endTimer if !defined(HAVE_GETTIMEOFDAY) (Patrick R. Gansterer), + remove a bashism in confgure.in (John Hein), + undef ERROR if already defined (Patrick R. Gansterer), + Fix library problems with mingw-w64 (Michael Cronenworth), + fix windows build. ifdef addition from bug 666491 makes no sense (Rob Richards), + prefer native threads on win32 (Sam Thursfield), + Allow to compile with Visual Studio 2010 (Thomas Lemm), + Fix mingw's snprintf configure check (Andoni Morales), + fixed a 64bit big endian issue (Marcus Meissner), + Fix portability failure if netdb.h lacks NO_ADDRESS (Daniel Veillard), + Fix windows build from lzma addition (Rob Richards), + autogen: Only check for libtoolize (Colin Walters), + Fix the Windows build files (Patrick von Reth), + 634846 Remove a linking option breaking Windows VC10 (Daniel Veillard), + 599241 fix an initialization problem on Win64 (Andrew W. Nosenko), + fix win build (Rob Richards) + + - Bug fixes: + Part for rand_r checking missing (Daniel Veillard), + Cleanup on randomization (Daniel Veillard), + Fix undefined reference in python module (Pacho Ramos), + Fix a race in xmlNewInputStream (Daniel Veillard), + Fix weird streaming RelaxNG errors (Noam), + Fix various bugs in new code raised by the API checking (Daniel Veillard), + Fix various problems with "make dist" (Daniel Veillard), + Fix a memory leak in the xzlib code (Daniel Veillard), + HTML parser error with