Updated libxml.

Change-Id: I4f2315f10227e6b8c2545b81ea1adcf388c37cee
This commit is contained in:
Thomas Inskip 2016-07-31 13:48:31 -07:00
parent 1fbc410489
commit f169bccdc9
186 changed files with 55741 additions and 24637 deletions

View File

@ -4,7 +4,7 @@
# Define an "os_include" variable that points at the OS-specific generated # Define an "os_include" variable that points at the OS-specific generated
# headers. These were generated by running the configure script offline. # headers. These were generated by running the configure script offline.
if (is_linux || is_android) { if (is_linux || is_android || is_nacl) {
os_include = "linux" os_include = "linux"
} else if (is_mac || is_ios) { } else if (is_mac || is_ios) {
os_include = "mac" os_include = "mac"
@ -24,36 +24,92 @@ config("libxml_config") {
] ]
} }
config("libxml_warnings") {
if (is_win) {
cflags_c = [
"/wd4018", # Signed/unsigned mismatch in comparison.
"/wd4267", # TODO(brucedawson): http://crbug.com/554200 fix C4267
"/wd4311", # and C4311 warnings.
]
}
if (is_clang) {
cflags = [
# libxml passes `const unsigned char*` through `const char*`.
"-Wno-pointer-sign",
# pattern.c and uri.c both have an intentional `for (...);` /
# `while(...);` loop. I submitted a patch to move the `'` to its own
# line, but until that's landed suppress the warning:
"-Wno-empty-body",
# debugXML.c compares array 'arg' to NULL.
"-Wno-tautological-pointer-compare",
# threads.c attempts to forward declare a pthread_equal which doesn't
# match the prototype in pthreads.h
"-Wno-ignored-attributes",
# libxml casts from int to long to void*.
"-Wno-int-to-void-pointer-cast",
# libxml passes a volatile LPCRITICAL_SECTION* to a function expecting
# a void* volatile*.
"-Wno-incompatible-pointer-types",
# trio_is_special_quantity and trio_is_negative are only
# used with certain preprocessor defines set.
"-Wno-unused-function",
]
}
}
static_library("libxml") { static_library("libxml") {
output_name = "libxml2" output_name = "libxml2"
sources = [ sources = [
"chromium/libxml_utils.h",
"chromium/libxml_utils.cc", "chromium/libxml_utils.cc",
"chromium/libxml_utils.h",
"linux/config.h", "linux/config.h",
"linux/include/libxml/xmlversion.h", "linux/include/libxml/xmlversion.h",
"mac/config.h", "mac/config.h",
"mac/include/libxml/xmlversion.h", "mac/include/libxml/xmlversion.h",
"src/DOCBparser.c",
"src/HTMLparser.c",
"src/HTMLtree.c",
"src/SAX.c",
"src/SAX2.c",
"src/buf.c",
"src/buf.h",
"src/c14n.c",
"src/catalog.c",
"src/chvalid.c",
"src/debugXML.c",
"src/dict.c",
"src/elfgcchack.h",
"src/enc.h",
"src/encoding.c",
"src/entities.c",
"src/error.c",
"src/globals.c",
"src/hash.c",
"src/include/libxml/DOCBparser.h",
"src/include/libxml/HTMLparser.h",
"src/include/libxml/HTMLtree.h",
"src/include/libxml/SAX.h",
"src/include/libxml/SAX2.h",
"src/include/libxml/c14n.h", "src/include/libxml/c14n.h",
"src/include/libxml/catalog.h", "src/include/libxml/catalog.h",
"src/include/libxml/chvalid.h", "src/include/libxml/chvalid.h",
"src/include/libxml/debugXML.h", "src/include/libxml/debugXML.h",
"src/include/libxml/dict.h", "src/include/libxml/dict.h",
"src/include/libxml/DOCBparser.h",
"src/include/libxml/encoding.h", "src/include/libxml/encoding.h",
"src/include/libxml/entities.h", "src/include/libxml/entities.h",
"src/include/libxml/globals.h", "src/include/libxml/globals.h",
"src/include/libxml/hash.h", "src/include/libxml/hash.h",
"src/include/libxml/HTMLparser.h",
"src/include/libxml/HTMLtree.h",
"src/include/libxml/list.h", "src/include/libxml/list.h",
"src/include/libxml/nanoftp.h",
"src/include/libxml/nanohttp.h",
"src/include/libxml/parser.h", "src/include/libxml/parser.h",
"src/include/libxml/parserInternals.h", "src/include/libxml/parserInternals.h",
"src/include/libxml/pattern.h", "src/include/libxml/pattern.h",
"src/include/libxml/relaxng.h", "src/include/libxml/relaxng.h",
"src/include/libxml/SAX.h",
"src/include/libxml/SAX2.h",
"src/include/libxml/schemasInternals.h", "src/include/libxml/schemasInternals.h",
"src/include/libxml/schematron.h", "src/include/libxml/schematron.h",
"src/include/libxml/threads.h", "src/include/libxml/threads.h",
@ -62,10 +118,10 @@ static_library("libxml") {
"src/include/libxml/valid.h", "src/include/libxml/valid.h",
"src/include/libxml/xinclude.h", "src/include/libxml/xinclude.h",
"src/include/libxml/xlink.h", "src/include/libxml/xlink.h",
"src/include/libxml/xmlIO.h",
"src/include/libxml/xmlautomata.h", "src/include/libxml/xmlautomata.h",
"src/include/libxml/xmlerror.h", "src/include/libxml/xmlerror.h",
"src/include/libxml/xmlexports.h", "src/include/libxml/xmlexports.h",
"src/include/libxml/xmlIO.h",
"src/include/libxml/xmlmemory.h", "src/include/libxml/xmlmemory.h",
"src/include/libxml/xmlmodule.h", "src/include/libxml/xmlmodule.h",
"src/include/libxml/xmlreader.h", "src/include/libxml/xmlreader.h",
@ -81,35 +137,19 @@ static_library("libxml") {
"src/include/libxml/xpointer.h", "src/include/libxml/xpointer.h",
"src/include/win32config.h", "src/include/win32config.h",
"src/include/wsockcompat.h", "src/include/wsockcompat.h",
"src/acconfig.h",
"src/c14n.c",
"src/catalog.c",
"src/chvalid.c",
"src/debugXML.c",
"src/dict.c",
"src/DOCBparser.c",
"src/elfgcchack.h",
"src/encoding.c",
"src/entities.c",
"src/error.c",
"src/globals.c",
"src/hash.c",
"src/HTMLparser.c",
"src/HTMLtree.c",
"src/legacy.c", "src/legacy.c",
"src/libxml.h", "src/libxml.h",
"src/list.c", "src/list.c",
"src/nanoftp.c",
"src/nanohttp.c",
"src/parser.c", "src/parser.c",
"src/parserInternals.c", "src/parserInternals.c",
"src/pattern.c", "src/pattern.c",
"src/relaxng.c", "src/relaxng.c",
"src/SAX.c", "src/save.h",
"src/SAX2.c",
"src/schematron.c", "src/schematron.c",
"src/threads.c", "src/threads.c",
"src/timsort.h",
"src/tree.c", "src/tree.c",
#"src/trio.c", #"src/trio.c",
#"src/trio.h", #"src/trio.h",
#"src/triodef.h", #"src/triodef.h",
@ -135,26 +175,30 @@ static_library("libxml") {
"src/xmlwriter.c", "src/xmlwriter.c",
"src/xpath.c", "src/xpath.c",
"src/xpointer.c", "src/xpointer.c",
#"src/xzlib.c",
"src/xzlib.h",
"win32/config.h", "win32/config.h",
"win32/include/libxml/xmlversion.h", "win32/include/libxml/xmlversion.h",
] ]
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ] configs += [
"//build/config/compiler:no_chromium_code",
direct_dependent_configs = [ ":libxml_config" ] # Must be after no_chromium_code for warning flags to be ordered correctly.
forward_dependent_configs_from = [ "//third_party/icu:icuuc" ] ":libxml_warnings",
]
deps = [ public_configs = [ ":libxml_config" ]
public_deps = [
"//third_party/icu:icuuc", "//third_party/icu:icuuc",
]
deps = [
"//third_party/zlib", "//third_party/zlib",
] ]
if (is_win) { if (is_mac || is_ios || is_android) {
cflags_c = [
"/wd4101", # Unreferenced local variable.
]
} else if (is_mac || is_android) {
# http://www.xmlsoft.org/threads.html says that this is required when using # http://www.xmlsoft.org/threads.html says that this is required when using
# libxml from several threads, which can possibly happen in chrome. On # libxml from several threads, which can possibly happen in chrome. On
# linux, this is picked up by transitivity from pkg-config output from # linux, this is picked up by transitivity from pkg-config output from
@ -162,22 +206,5 @@ static_library("libxml") {
defines = [ "_REENTRANT" ] defines = [ "_REENTRANT" ]
} }
if (is_clang) { include_dirs = [ "$os_include" ]
cflags = [
# libxml passes `const unsigned char*` through `const char*`.
"-Wno-pointer-sign",
# pattern.c and uri.c both have an intentional `for (...);` /
# `while(...);` loop. I submitted a patch to move the `'` to its own
# line, but until that's landed suppress the warning:
"-Wno-empty-body",
# debugXML.c compares array 'arg' to NULL.
"-Wno-tautological-pointer-compare",
]
}
include_dirs = [
"$os_include",
]
} }

3
packager/third_party/libxml/DEPS vendored Normal file
View File

@ -0,0 +1,3 @@
include_rules = [
'+libxml',
]

5
packager/third_party/libxml/OWNERS vendored Normal file
View File

@ -0,0 +1,5 @@
# There's no real owners here. If you're familiar with the code please send
# a CL to add yourself here.
cpu@chromium.org
dominicc@chromium.org
scottmg@chromium.org

View File

@ -1,59 +1,55 @@
Name: libxml Name: libxml
URL: http://xmlsoft.org URL: http://xmlsoft.org
Version: 2.7.7 Version: bdec2183f34b37ee89ae1d330c6ad2bb4d76605f
License: MIT License: MIT
License File: src/Copyright License File: src/Copyright
Security Critical: yes Security Critical: yes
Description: 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: Modifications:
- Converted to utf-8 with: vim +"argdo write ++enc=utf-8" *.c - Add helper classes in chromium/libxml_utils.cc and
- Import XPath fix http://git.gnome.org/browse/libxml2/commit/?id=91d19754d46acd4a639a8b9e31f50f31c78f8c9c chromium/include/libxml/libxml_utils.h.
- Import follow-on for above commit: http://git.gnome.org/browse/libxml2/commit/?id=ea90b894146030c214a7df6d8375310174f134b9 - Fix printf format specifiers, https://chromium.googlesource.com/chromium/src/+/d31995076e55f1aac2f935c53b585a90ece27a11
- Import additional XPath fix http://git.gnome.org/browse/libxml2/commit/?id=df83c17e5a2646bd923f75e5e507bc80d73c9722 - Add second workaround for VS 2015 Update 2 code-gen bug - crbug.com/599427
- Import follow-on fix for above commit: http://git.gnome.org/browse/libxml2/commit/?id=fec31bcd452e77c10579467ca87a785b41115de6 - Apply patch contributed here: https://crbug.com/623378#c7
- 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). - Apply patch contributed here: https://crbug.com/624011
- 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
To import a new snapshot of libxml: This import was generated by this script: https://goo.gl/72CTWf
- Visit http://xmlsoft.org/downloads.html and download the latest source To import a new snapshot:
distribution.
- Copy the files into this directory, omitting files which have been omitted On Linux, get the latest tar, untar, and replace src/ with libxml2-X.Y.Z/.
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. Generate config.h, include/libxml/xmlversion.h, and xml2-config:
- Apply the patches in patches/ and fix any problems.
UPDATE THOSE PATCHES OR EVAN WILL HUNT YOU DOWN. cd linux
- On a Linux system, ../src/configure --without-iconv --with-icu --without-ftp --without-http \
$ cd linux --without-lzma
$ ../configure --without-iconv --without-ftp --without-http cd ..
to generate config.h and include/libxml/xmlversion.h for Linux. Patch config.h to not define HAVE_RAND_R since we use this file on Android
- On a Mac, and it does not have it.
$ cd mac
$ ../configure --without-iconv --without-ftp --without-http On a Mac, do the same in the mac/ subdir for config.h and
to generate config.h and include/libxml/xmlversion.h for Macs. include/libxml/xmlversion.h and copy those to the Linux box in mac/
- On Windows, run build/generate-win32-headers.bat to re-generate config.h and
include/libxml/xmlversion.h for Windows builds. On a Windows box:
- Update this README to reflect the new version number. cd libxml2-2.9.2\win32
cscript //E:jscript configure.js compiler=msvc iconv=no icu=yes ftp=no http=no
Then copy VC10/config.h and include/libxml/xmlversion.h to win32/ on Linux.
Remove:
src/doc/
src/example/
src/macos/libxml2.mcp.xml.sit.hqx
src/os400/
src/python/
src/result/
src/test/
src/vms/
src/win32/wince
src/VxWorks/
Update BUILD.gn and libxml.gyp as necessary to add/remove files, etc.

View File

@ -51,7 +51,14 @@
}, },
}], }],
['OS == "ios"', { ['OS == "ios"', {
'type': 'none', 'type': 'static_library',
'sources': [
'chromium/libxml_utils.h',
'chromium/libxml_utils.cc',
],
'include_dirs': [
'$(SDKROOT)/usr/include/libxml2',
],
'all_dependent_settings': { 'all_dependent_settings': {
'defines': [ 'defines': [
'USE_SYSTEM_LIBXML', 'USE_SYSTEM_LIBXML',
@ -61,9 +68,11 @@
], ],
}, },
'link_settings': { 'link_settings': {
'libraries': [ 'xcode_settings': {
'$(SDKROOT)/usr/lib/libxml2.dylib', 'OTHER_LDFLAGS': [
], '-lxml2',
],
},
}, },
}], }],
], ],
@ -89,8 +98,6 @@
'src/include/libxml/HTMLparser.h', 'src/include/libxml/HTMLparser.h',
'src/include/libxml/HTMLtree.h', 'src/include/libxml/HTMLtree.h',
'src/include/libxml/list.h', 'src/include/libxml/list.h',
'src/include/libxml/nanoftp.h',
'src/include/libxml/nanohttp.h',
'src/include/libxml/parser.h', 'src/include/libxml/parser.h',
'src/include/libxml/parserInternals.h', 'src/include/libxml/parserInternals.h',
'src/include/libxml/pattern.h', 'src/include/libxml/pattern.h',
@ -124,7 +131,8 @@
'src/include/libxml/xpointer.h', 'src/include/libxml/xpointer.h',
'src/include/win32config.h', 'src/include/win32config.h',
'src/include/wsockcompat.h', 'src/include/wsockcompat.h',
'src/acconfig.h', 'src/buf.c',
'src/buf.h',
'src/c14n.c', 'src/c14n.c',
'src/catalog.c', 'src/catalog.c',
'src/chvalid.c', 'src/chvalid.c',
@ -132,6 +140,7 @@
'src/dict.c', 'src/dict.c',
'src/DOCBparser.c', 'src/DOCBparser.c',
'src/elfgcchack.h', 'src/elfgcchack.h',
'src/enc.h',
'src/encoding.c', 'src/encoding.c',
'src/entities.c', 'src/entities.c',
'src/error.c', 'src/error.c',
@ -142,16 +151,16 @@
'src/legacy.c', 'src/legacy.c',
'src/libxml.h', 'src/libxml.h',
'src/list.c', 'src/list.c',
'src/nanoftp.c',
'src/nanohttp.c',
'src/parser.c', 'src/parser.c',
'src/parserInternals.c', 'src/parserInternals.c',
'src/pattern.c', 'src/pattern.c',
'src/relaxng.c', 'src/relaxng.c',
'src/save.h',
'src/SAX.c', 'src/SAX.c',
'src/SAX2.c', 'src/SAX2.c',
'src/schematron.c', 'src/schematron.c',
'src/threads.c', 'src/threads.c',
'src/timsort.h',
'src/tree.c', 'src/tree.c',
#'src/trio.c', #'src/trio.c',
#'src/trio.h', #'src/trio.h',
@ -178,6 +187,8 @@
'src/xmlwriter.c', 'src/xmlwriter.c',
'src/xpath.c', 'src/xpath.c',
'src/xpointer.c', 'src/xpointer.c',
#'src/xzlib.c',
'src/xzlib.h',
'win32/config.h', 'win32/config.h',
'win32/include/libxml/xmlversion.h', 'win32/include/libxml/xmlversion.h',
], ],
@ -201,6 +212,14 @@
'-Wno-tautological-pointer-compare', '-Wno-tautological-pointer-compare',
# See http://crbug.com/138571#c8 # See http://crbug.com/138571#c8
'-Wno-ignored-attributes', '-Wno-ignored-attributes',
# libxml casts from int to long to void*.
'-Wno-int-to-void-pointer-cast',
# libxml passes a volatile LPCRITICAL_SECTION* to a function
# expecting a void* volatile*.
'-Wno-incompatible-pointer-types',
# trio_is_special_quantity and trio_is_negative are only
# used with certain preprocessor defines set.
'-Wno-unused-function',
], ],
}, },
'include_dirs': [ 'include_dirs': [
@ -230,6 +249,7 @@
'libraries': [ 'libraries': [
# We need dl for dlopen() and friends. # We need dl for dlopen() and friends.
'-ldl', '-ldl',
'-lm',
], ],
}, },
}], }],
@ -240,16 +260,19 @@
['OS=="mac" or OS=="android"', {'defines': ['_REENTRANT']}], ['OS=="mac" or OS=="android"', {'defines': ['_REENTRANT']}],
['OS=="win"', { ['OS=="win"', {
'product_name': 'libxml2', 'product_name': 'libxml2',
# Disable unimportant 'unused variable' warning, and # Disable unimportant 'unused variable' warning.
# signed/unsigned comparison warning. The signed/unsigned (4101)
# is fixed upstream and can be removed eventually.
# TODO(jschuh): http://crbug.com/167187 size_t -> int # TODO(jschuh): http://crbug.com/167187 size_t -> int
'msvs_disabled_warnings': [ 4018, 4101, 4267 ], # TODO(brucedawson): http://crbug.com/554200 fix C4311 warnings
# C4311 is a VS 2015 64-bit warning for pointer truncation
'msvs_disabled_warnings': [ 4018, 4267, 4311, ],
}, { # else: OS!="win" }, { # else: OS!="win"
'product_name': 'xml2', 'product_name': 'xml2',
}], }],
], ],
}], }],
['OS == "ios"', {
'toolsets': ['host', 'target'],
}],
], ],
}, },
], ],

View File

@ -1,21 +1,8 @@
/* config.h. Generated from config.h.in by configure. */ /* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.ac 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 /**/
/* Define if IPV6 support is there */ /* Type cast for the gethostbyname() argument */
#define SUPPORT_IP6 /**/ #define GETHOSTBYNAME_ARG_CAST /**/
/* Define if getaddrinfo is there */
#define HAVE_GETADDRINFO /**/
/* Define to 1 if you have the <ansidecl.h> header file. */ /* Define to 1 if you have the <ansidecl.h> header file. */
/* #undef HAVE_ANSIDECL_H */ /* #undef HAVE_ANSIDECL_H */
@ -86,8 +73,8 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <inttypes.h.h> header file. */ /* Define to 1 if you have the `isascii' function. */
/* #undef HAVE_INTTYPES_H_H */ #define HAVE_ISASCII 1
/* Define if isinf is there */ /* Define if isinf is there */
#define HAVE_ISINF /**/ #define HAVE_ISINF /**/
@ -101,6 +88,9 @@
/* Define if history library is there (-lhistory) */ /* Define if history library is there (-lhistory) */
/* #undef HAVE_LIBHISTORY */ /* #undef HAVE_LIBHISTORY */
/* Have compression library */
/* #undef HAVE_LIBLZMA */
/* Define if pthread library is there (-lpthread) */ /* Define if pthread library is there (-lpthread) */
#define HAVE_LIBPTHREAD /**/ #define HAVE_LIBPTHREAD /**/
@ -116,6 +106,9 @@
/* Define to 1 if you have the `localtime' function. */ /* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1 #define HAVE_LOCALTIME 1
/* Define to 1 if you have the <lzma.h> header file. */
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1
@ -125,6 +118,17 @@
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1 #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 <nan.h> header file. */ /* Define to 1 if you have the <nan.h> header file. */
/* #undef HAVE_NAN_H */ /* #undef HAVE_NAN_H */
@ -146,6 +150,15 @@
/* Define if <pthread.h> is there */ /* Define if <pthread.h> is there */
#define HAVE_PTHREAD_H /**/ #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 to 1 if you have the <resolv.h> header file. */ /* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1 #define HAVE_RESOLV_H 1
@ -164,6 +177,9 @@
/* Define to 1 if you have the `sprintf' function. */ /* Define to 1 if you have the `sprintf' function. */
#define HAVE_SPRINTF 1 #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 to 1 if you have the `sscanf' function. */
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
@ -226,6 +242,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1 #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 <time.h> header file. */ /* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1 #define HAVE_TIME_H 1
@ -281,8 +300,8 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "" #define PACKAGE_VERSION ""
/* Define to 1 if the C compiler supports function prototypes. */ /* Type cast for the send() function 2nd arg */
#define PROTOTYPES 1 #define SEND_ARG2_CAST /**/
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
@ -290,23 +309,26 @@
/* Support for IPv6 */ /* Support for IPv6 */
#define SUPPORT_IP6 /**/ #define SUPPORT_IP6 /**/
/* Define if va_list is an array type */
#define VA_LIST_IS_ARRAY 1
/* Version number of package */ /* Version number of package */
#define VERSION "2.7.7" #define VERSION "2.9.4"
/* Determine what socket length (socklen_t) data type is */ /* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t #define XML_SOCKLEN_T socklen_t
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Using the Win32 Socket implementation */ /* Using the Win32 Socket implementation */
/* #undef _WINSOCKAPI_ */ /* #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 */ /* ss_family is not defined here, use __ss_family instead */
/* #undef ss_family */ /* #undef ss_family */
/* Win32 Std C name mangling work-around */ /* Define to the type of an unsigned integer type of width exactly 32 bits if
/* #undef vsnprintf */ such a type exists and the standard includes do not define it. */
/* #undef uint32_t */

View File

@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* *
* the version string like "1.2.3" * the version string like "1.2.3"
*/ */
#define LIBXML_DOTTED_VERSION "2.7.7" #define LIBXML_DOTTED_VERSION "2.9.4"
/** /**
* LIBXML_VERSION: * LIBXML_VERSION:
* *
* the version number: 1.2.3 value is 10203 * the version number: 1.2.3 value is 10203
*/ */
#define LIBXML_VERSION 20707 #define LIBXML_VERSION 20904
/** /**
* LIBXML_VERSION_STRING: * LIBXML_VERSION_STRING:
* *
* the version number string, 1.2.3 value is "10203" * the version number string, 1.2.3 value is "10203"
*/ */
#define LIBXML_VERSION_STRING "20707" #define LIBXML_VERSION_STRING "20904"
/** /**
* LIBXML_VERSION_EXTRA: * 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 * Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against * the version the software has been compiled against
*/ */
#define LIBXML_TEST_VERSION xmlCheckVersion(20707); #define LIBXML_TEST_VERSION xmlCheckVersion(20904);
#ifndef VMS #ifndef VMS
#if 0 #if 0
@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif #endif
#endif #endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if 0
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/** /**
* LIBXML_TREE_ENABLED: * LIBXML_TREE_ENABLED:
* *
@ -391,6 +400,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#define LIBXML_ZLIB_ENABLED #define LIBXML_ZLIB_ENABLED
#endif #endif
/**
* LIBXML_LZMA_ENABLED:
*
* Whether the Lzma support is compiled in
*/
#if 0
#define LIBXML_LZMA_ENABLED
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H #ifdef HAVE_ANSIDECL_H
#include <ansidecl.h> #include <ansidecl.h>
@ -403,7 +421,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef ATTRIBUTE_UNUSED #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 #endif
/** /**
@ -413,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef LIBXML_ATTR_ALLOC_SIZE #ifndef LIBXML_ATTR_ALLOC_SIZE
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) # if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else # else
# define LIBXML_ATTR_ALLOC_SIZE(x) # define LIBXML_ATTR_ALLOC_SIZE(x)

View File

@ -58,7 +58,7 @@ while test $# -gt 0; do
;; ;;
--version) --version)
echo 2.7.7 echo 2.9.4
exit 0 exit 0
;; ;;
@ -86,12 +86,12 @@ while test $# -gt 0; do
then then
if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ] if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ]
then then
echo -lxml2 -lz -lm echo -lxml2 -lz -licui18n -licuuc -licudata -lm -ldl
else else
echo -L${libdir} -lxml2 -lz -lm echo -L${libdir} -lxml2 -lz -licui18n -licuuc -licudata -lm -ldl
fi fi
else else
echo -L${libdir} -lxml2 -lz -lm echo -L${libdir} -lxml2 -lz -licui18n -licuuc -licudata -lm -ldl
fi fi
;; ;;

View File

@ -1,21 +1,8 @@
/* config.h. Generated from config.h.in by configure. */ /* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.ac 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 /**/
/* Define if IPV6 support is there */ /* Type cast for the gethostbyname() argument */
#define SUPPORT_IP6 /**/ #define GETHOSTBYNAME_ARG_CAST /**/
/* Define if getaddrinfo is there */
#define HAVE_GETADDRINFO /**/
/* Define to 1 if you have the <ansidecl.h> header file. */ /* Define to 1 if you have the <ansidecl.h> header file. */
/* #undef HAVE_ANSIDECL_H */ /* #undef HAVE_ANSIDECL_H */
@ -86,8 +73,8 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <inttypes.h.h> header file. */ /* Define to 1 if you have the `isascii' function. */
/* #undef HAVE_INTTYPES_H_H */ #define HAVE_ISASCII 1
/* Define if isinf is there */ /* Define if isinf is there */
#define HAVE_ISINF /**/ #define HAVE_ISINF /**/
@ -101,6 +88,9 @@
/* Define if history library is there (-lhistory) */ /* Define if history library is there (-lhistory) */
/* #undef HAVE_LIBHISTORY */ /* #undef HAVE_LIBHISTORY */
/* Have compression library */
/* #undef HAVE_LIBLZMA */
/* Define if pthread library is there (-lpthread) */ /* Define if pthread library is there (-lpthread) */
#define HAVE_LIBPTHREAD /**/ #define HAVE_LIBPTHREAD /**/
@ -116,6 +106,9 @@
/* Define to 1 if you have the `localtime' function. */ /* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1 #define HAVE_LOCALTIME 1
/* Define to 1 if you have the <lzma.h> header file. */
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
/* #undef HAVE_MALLOC_H */ /* #undef HAVE_MALLOC_H */
@ -125,6 +118,17 @@
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1 #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 <nan.h> header file. */ /* Define to 1 if you have the <nan.h> header file. */
/* #undef HAVE_NAN_H */ /* #undef HAVE_NAN_H */
@ -146,6 +150,15 @@
/* Define if <pthread.h> is there */ /* Define if <pthread.h> is there */
#define HAVE_PTHREAD_H /**/ #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 to 1 if you have the <resolv.h> header file. */ /* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1 #define HAVE_RESOLV_H 1
@ -164,6 +177,9 @@
/* Define to 1 if you have the `sprintf' function. */ /* Define to 1 if you have the `sprintf' function. */
#define HAVE_SPRINTF 1 #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 to 1 if you have the `sscanf' function. */
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
@ -195,7 +211,7 @@
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */ /* Define to 1 if you have the `strndup' function. */
/* #undef HAVE_STRNDUP */ #define HAVE_STRNDUP 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/ */
@ -226,6 +242,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1 #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 <time.h> header file. */ /* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1 #define HAVE_TIME_H 1
@ -256,8 +275,7 @@
/* Define as const if the declaration of iconv() needs const. */ /* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */ /* #undef ICONV_CONST */
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory where libtool stores uninstalled libraries. */
*/
#define LT_OBJDIR ".libs/" #define LT_OBJDIR ".libs/"
/* Name of package */ /* Name of package */
@ -281,8 +299,8 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "" #define PACKAGE_VERSION ""
/* Define to 1 if the C compiler supports function prototypes. */ /* Type cast for the send() function 2nd arg */
#define PROTOTYPES 1 #define SEND_ARG2_CAST /**/
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
@ -290,23 +308,26 @@
/* Support for IPv6 */ /* Support for IPv6 */
#define SUPPORT_IP6 /**/ #define SUPPORT_IP6 /**/
/* Define if va_list is an array type */
#define VA_LIST_IS_ARRAY 1
/* Version number of package */ /* Version number of package */
#define VERSION "2.7.7" #define VERSION "2.9.4"
/* Determine what socket length (socklen_t) data type is */ /* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t #define XML_SOCKLEN_T socklen_t
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Using the Win32 Socket implementation */ /* Using the Win32 Socket implementation */
/* #undef _WINSOCKAPI_ */ /* #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 */ /* ss_family is not defined here, use __ss_family instead */
/* #undef ss_family */ /* #undef ss_family */
/* Win32 Std C name mangling work-around */ /* Define to the type of an unsigned integer type of width exactly 32 bits if
/* #undef vsnprintf */ such a type exists and the standard includes do not define it. */
/* #undef uint32_t */

View File

@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* *
* the version string like "1.2.3" * the version string like "1.2.3"
*/ */
#define LIBXML_DOTTED_VERSION "2.7.7" #define LIBXML_DOTTED_VERSION "2.9.4"
/** /**
* LIBXML_VERSION: * LIBXML_VERSION:
* *
* the version number: 1.2.3 value is 10203 * the version number: 1.2.3 value is 10203
*/ */
#define LIBXML_VERSION 20707 #define LIBXML_VERSION 20904
/** /**
* LIBXML_VERSION_STRING: * LIBXML_VERSION_STRING:
* *
* the version number string, 1.2.3 value is "10203" * the version number string, 1.2.3 value is "10203"
*/ */
#define LIBXML_VERSION_STRING "20707" #define LIBXML_VERSION_STRING "20904"
/** /**
* LIBXML_VERSION_EXTRA: * 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 * Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against * the version the software has been compiled against
*/ */
#define LIBXML_TEST_VERSION xmlCheckVersion(20707); #define LIBXML_TEST_VERSION xmlCheckVersion(20904);
#ifndef VMS #ifndef VMS
#if 0 #if 0
@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif #endif
#endif #endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if 0
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/** /**
* LIBXML_TREE_ENABLED: * LIBXML_TREE_ENABLED:
* *
@ -391,6 +400,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#define LIBXML_ZLIB_ENABLED #define LIBXML_ZLIB_ENABLED
#endif #endif
/**
* LIBXML_LZMA_ENABLED:
*
* Whether the Lzma support is compiled in
*/
#if 0
#define LIBXML_LZMA_ENABLED
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H #ifdef HAVE_ANSIDECL_H
#include <ansidecl.h> #include <ansidecl.h>
@ -403,7 +421,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef ATTRIBUTE_UNUSED #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 #endif
/** /**
@ -413,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef LIBXML_ATTR_ALLOC_SIZE #ifndef LIBXML_ATTR_ALLOC_SIZE
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) # if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else # else
# define LIBXML_ATTR_ALLOC_SIZE(x) # define LIBXML_ATTR_ALLOC_SIZE(x)

23
packager/third_party/libxml/src/COPYING vendored Normal file
View File

@ -0,0 +1,23 @@
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-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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
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
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.

View File

@ -593,7 +593,7 @@ Thu Apr 24 13:56:53 CEST 2008 Daniel Veillard <daniel@veillard.com>
Tue Apr 22 10:27:17 CEST 2008 Daniel Veillard <daniel@veillard.com> Tue Apr 22 10:27:17 CEST 2008 Daniel Veillard <daniel@veillard.com>
* dict.c: improvement on the hashing of the dictionnary, with visible * dict.c: improvement on the hashing of the dictionary, with visible
speed up as the number of strings in the hash increases, work from speed up as the number of strings in the hash increases, work from
Stefan Behnel Stefan Behnel
@ -5017,7 +5017,7 @@ Mon Jan 24 00:47:41 CET 2005 Daniel Veillard <daniel@veillard.com>
Sun Jan 23 23:54:39 CET 2005 Daniel Veillard <daniel@veillard.com> Sun Jan 23 23:54:39 CET 2005 Daniel Veillard <daniel@veillard.com>
* hash.c include/libxml/hash.h: added xmlHashCreateDict where * hash.c include/libxml/hash.h: added xmlHashCreateDict where
the hash reuses the dictionnary for internal strings the hash reuses the dictionary for internal strings
* entities.c valid.c parser.c: reuse that new API, leads to a decent * entities.c valid.c parser.c: reuse that new API, leads to a decent
speedup when parsing for example DocBook documents. speedup when parsing for example DocBook documents.
@ -5371,7 +5371,7 @@ Fri Nov 26 11:44:36 CET 2004 Daniel Veillard <daniel@veillard.com>
Wed Nov 24 13:41:52 CET 2004 Daniel Veillard <daniel@veillard.com> Wed Nov 24 13:41:52 CET 2004 Daniel Veillard <daniel@veillard.com>
* dict.c include/libxml/dict.h: added xmlDictExists() to the * dict.c include/libxml/dict.h: added xmlDictExists() to the
dictionnary interface. dictionary interface.
* xmlreader.c: applying xmlTextReaderHasAttributes fix for namespaces * xmlreader.c: applying xmlTextReaderHasAttributes fix for namespaces
from Rob Richards from Rob Richards
@ -5697,7 +5697,7 @@ Tue Oct 26 23:57:02 CEST 2004 Daniel Veillard <daniel@veillard.com>
Tue Oct 26 18:09:59 CEST 2004 Daniel Veillard <daniel@veillard.com> Tue Oct 26 18:09:59 CEST 2004 Daniel Veillard <daniel@veillard.com>
* debugXML.c include/libxml/xmlerror.h: added checking for names * debugXML.c include/libxml/xmlerror.h: added checking for names
values and dictionnaries generates a tons of errors values and dictionaries generates a tons of errors
* SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c * SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c
include/libxml/tree.h: fixing the errors in the regression tests include/libxml/tree.h: fixing the errors in the regression tests
@ -7746,14 +7746,14 @@ Fri Jan 23 14:03:21 CET 2004 Daniel Veillard <daniel@veillard.com>
make tests make tests
* xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to * xpath.c include/libxml/xpath.h: added xmlXPathCtxtCompile() to
compile an XPath expression within a context, currently the goal compile an XPath expression within a context, currently the goal
is to be able to reuse the XSLT stylesheet dictionnary, but this is to be able to reuse the XSLT stylesheet dictionary, but this
opens the door to others possible optimizations. opens the door to others possible optimizations.
* dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows * dict.c include/libxml/dict.h: added xmlDictCreateSub() which allows
to build a new dictionnary based on another read-only dictionnary. to build a new dictionary based on another read-only dictionary.
This is needed for XSLT to keep the stylesheet dictionnary read-only This is needed for XSLT to keep the stylesheet dictionary read-only
while being able to reuse the strings for the transformation while being able to reuse the strings for the transformation
dictionnary. dictionary.
* xinclude.c: fixed a dictionnar reference counting problem occuring * xinclude.c: fixed a dictionary reference counting problem occuring
when document parsing failed. when document parsing failed.
* testSAX.c: adding option --repeat for timing 100times the parsing * testSAX.c: adding option --repeat for timing 100times the parsing
* doc/* : rebuilt all the docs * doc/* : rebuilt all the docs
@ -7806,7 +7806,7 @@ Mon Jan 12 17:22:57 CET 2004 Daniel Veillard <daniel@veillard.com>
Thu Jan 8 17:57:50 CET 2004 Daniel Veillard <daniel@veillard.com> Thu Jan 8 17:57:50 CET 2004 Daniel Veillard <daniel@veillard.com>
* xmlschemas.c: removed a memory leak remaining from the switch * xmlschemas.c: removed a memory leak remaining from the switch
to a dictionnary for string allocations c.f. #130891 to a dictionary for string allocations c.f. #130891
Thu Jan 8 17:48:46 CET 2004 Daniel Veillard <daniel@veillard.com> Thu Jan 8 17:48:46 CET 2004 Daniel Veillard <daniel@veillard.com>
@ -7928,7 +7928,7 @@ Fri Jan 2 22:58:29 HKT 2004 William Brack <wbrack@mmm.com.hk>
Fri Jan 2 11:40:06 CET 2004 Daniel Veillard <daniel@veillard.com> Fri Jan 2 11:40:06 CET 2004 Daniel Veillard <daniel@veillard.com>
* SAX2.c: found and fixed a bug misallocating some non * SAX2.c: found and fixed a bug misallocating some non
blank text node strings from the dictionnary. blank text node strings from the dictionary.
* xmlmemory.c: fixed a problem with the memory debug mutex * xmlmemory.c: fixed a problem with the memory debug mutex
release. release.
@ -8139,7 +8139,7 @@ Wed Dec 10 11:16:29 CET 2003 Daniel Veillard <daniel@veillard.com>
Tue Dec 9 23:50:23 CET 2003 Daniel Veillard <daniel@veillard.com> Tue Dec 9 23:50:23 CET 2003 Daniel Veillard <daniel@veillard.com>
* entities.c: fixed an XML entites content serialization * entities.c: fixed an XML entities content serialization
potentially triggered by XInclude, see #126817 potentially triggered by XInclude, see #126817
Tue Dec 9 16:12:50 CET 2003 Daniel Veillard <daniel@veillard.com> Tue Dec 9 16:12:50 CET 2003 Daniel Veillard <daniel@veillard.com>
@ -9386,7 +9386,7 @@ Sat Sep 27 01:25:39 CEST 2003 Daniel Veillard <daniel@veillard.com>
* parser.c: William's change allowed to spot a nasty bug in xmlDoRead * parser.c: William's change allowed to spot a nasty bug in xmlDoRead
if the result is not well formed that ctxt->myDoc is not NULL if the result is not well formed that ctxt->myDoc is not NULL
and uses the context dictionnary. and uses the context dictionary.
Fri Sep 26 21:09:34 CEST 2003 Daniel Veillard <daniel@veillard.com> Fri Sep 26 21:09:34 CEST 2003 Daniel Veillard <daniel@veillard.com>

View File

@ -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 list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are: 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal 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 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. OUT OF OR IN CONNECTION 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.

View File

@ -44,6 +44,9 @@
#include <libxml/globals.h> #include <libxml/globals.h>
#include <libxml/uri.h> #include <libxml/uri.h>
#include "buf.h"
#include "enc.h"
#define HTML_MAX_NAMELEN 1000 #define HTML_MAX_NAMELEN 1000
#define HTML_PARSER_BIG_BUFFER_SIZE 1000 #define HTML_PARSER_BIG_BUFFER_SIZE 1000
#define HTML_PARSER_BUFFER_SIZE 100 #define HTML_PARSER_BUFFER_SIZE 100
@ -102,7 +105,7 @@ htmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
* *
* Handle a fatal parser error, i.e. violating Well-Formedness constraints * Handle a fatal parser error, i.e. violating Well-Formedness constraints
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1, const xmlChar *str2) const char *msg, const xmlChar *str1, const xmlChar *str2)
{ {
@ -129,7 +132,7 @@ htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
* *
* Handle a fatal parser error, i.e. violating Well-Formedness constraints * Handle a fatal parser error, i.e. violating Well-Formedness constraints
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, int val) const char *msg, int val)
{ {
@ -300,6 +303,7 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt)
#define UPP(val) (toupper(ctxt->input->cur[(val)])) #define UPP(val) (toupper(ctxt->input->cur[(val)]))
#define CUR_PTR ctxt->input->cur #define CUR_PTR ctxt->input->cur
#define BASE_PTR ctxt->input->base
#define SHRINK if ((ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \ #define SHRINK if ((ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
(ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \ (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
@ -727,7 +731,7 @@ static const char* const map_contents[] = { BLOCK, "area", NULL } ;
static const char* const name_attr[] = { "name", NULL } ; static const char* const name_attr[] = { "name", NULL } ;
static const char* const action_attr[] = { "action", NULL } ; static const char* const action_attr[] = { "action", NULL } ;
static const char* const blockli_elt[] = { BLOCK, "li", 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 content_attr[] = { "content", NULL } ;
static const char* const type_attr[] = { "type", NULL } ; static const char* const type_attr[] = { "type", NULL } ;
static const char* const noframes_content[] = { "body", FLOW MODIFIER, NULL } ; static const char* const noframes_content[] = { "body", FLOW MODIFIER, NULL } ;
@ -1080,9 +1084,9 @@ static const char * const htmlStartClose[] = {
"menu", "p", "head", "ul", NULL, "menu", "p", "head", "ul", NULL,
"p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL, "p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL,
"div", "p", "head", NULL, "div", "p", "head", NULL,
"noscript", "p", "head", NULL, "noscript", "p", NULL,
"center", "font", "b", "i", "p", "head", NULL, "center", "font", "b", "i", "p", "head", NULL,
"a", "a", NULL, "a", "a", "head", NULL,
"caption", "p", NULL, "caption", "p", NULL,
"colgroup", "caption", "colgroup", "col", "p", NULL, "colgroup", "caption", "colgroup", "col", "p", NULL,
"col", "caption", "col", "p", NULL, "col", "caption", "col", "p", NULL,
@ -1100,6 +1104,43 @@ static const char * const htmlStartClose[] = {
"option", "option", NULL, "option", "option", NULL,
"fieldset", "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "fieldset", "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6",
"pre", "listing", "xmp", "a", NULL, "pre", "listing", "xmp", "a", NULL,
/* most tags in in FONTSTYLE, PHRASE and SPECIAL should close <head> */
"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 NULL
}; };
@ -1137,7 +1178,7 @@ static const char *const htmlScriptAttributes[] = {
"onfocus", "onfocus",
"onblur", "onblur",
"onsubmit", "onsubmit",
"onrest", "onreset",
"onchange", "onchange",
"onselect" "onselect"
}; };
@ -2431,6 +2472,10 @@ htmlParseName(htmlParserCtxtPtr ctxt) {
(*in == '_') || (*in == '-') || (*in == '_') || (*in == '-') ||
(*in == ':') || (*in == '.')) (*in == ':') || (*in == '.'))
in++; in++;
if (in == ctxt->input->end)
return(NULL);
if ((*in > 0) && (*in < 0x80)) { if ((*in > 0) && (*in < 0x80)) {
count = in - ctxt->input->cur; count = in - ctxt->input->cur;
ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count); ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
@ -2448,6 +2493,7 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l; int len = 0, l;
int c; int c;
int count = 0; int count = 0;
const xmlChar *base = ctxt->input->base;
/* /*
* Handler for more complex cases * Handler for more complex cases
@ -2473,7 +2519,18 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
len += l; len += l;
NEXTL(l); NEXTL(l);
c = CUR_CHAR(l); c = CUR_CHAR(l);
if (ctxt->input->base != base) {
/*
* We changed encoding from an unknown encoding
* Input buffer changed location, so we better start again
*/
return(htmlParseNameComplex(ctxt));
}
} }
if (ctxt->input->base > ctxt->input->cur - len)
return(NULL);
return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
} }
@ -2725,31 +2782,43 @@ htmlParseAttValue(htmlParserCtxtPtr ctxt) {
static xmlChar * static xmlChar *
htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) { htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
const xmlChar *q; size_t len = 0, startPosition = 0;
xmlChar *ret = NULL; xmlChar *ret = NULL;
if (CUR == '"') { if (CUR == '"') {
NEXT; NEXT;
q = CUR_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '"')) if (CUR_PTR < BASE_PTR)
return(ret);
startPosition = CUR_PTR - BASE_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '"')) {
NEXT; NEXT;
len++;
}
if (!IS_CHAR_CH(CUR)) { if (!IS_CHAR_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL); "Unfinished SystemLiteral\n", NULL, NULL);
} else { } else {
ret = xmlStrndup(q, CUR_PTR - q); ret = xmlStrndup((BASE_PTR+startPosition), len);
NEXT; NEXT;
} }
} else if (CUR == '\'') { } else if (CUR == '\'') {
NEXT; NEXT;
q = CUR_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) if (CUR_PTR < BASE_PTR)
return(ret);
startPosition = CUR_PTR - BASE_PTR;
while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) {
NEXT; NEXT;
len++;
}
if (!IS_CHAR_CH(CUR)) { if (!IS_CHAR_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL); "Unfinished SystemLiteral\n", NULL, NULL);
} else { } else {
ret = xmlStrndup(q, CUR_PTR - q); ret = xmlStrndup((BASE_PTR+startPosition), len);
NEXT; NEXT;
} }
} else { } else {
@ -2773,32 +2842,47 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
static xmlChar * static xmlChar *
htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) { htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
const xmlChar *q; size_t len = 0, startPosition = 0;
xmlChar *ret = NULL; xmlChar *ret = NULL;
/* /*
* Name ::= (Letter | '_') (NameChar)* * Name ::= (Letter | '_') (NameChar)*
*/ */
if (CUR == '"') { if (CUR == '"') {
NEXT; NEXT;
q = CUR_PTR;
while (IS_PUBIDCHAR_CH(CUR)) NEXT; if (CUR_PTR < BASE_PTR)
return(ret);
startPosition = CUR_PTR - BASE_PTR;
while (IS_PUBIDCHAR_CH(CUR)) {
len++;
NEXT;
}
if (CUR != '"') { if (CUR != '"') {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished PubidLiteral\n", NULL, NULL); "Unfinished PubidLiteral\n", NULL, NULL);
} else { } else {
ret = xmlStrndup(q, CUR_PTR - q); ret = xmlStrndup((BASE_PTR + startPosition), len);
NEXT; NEXT;
} }
} else if (CUR == '\'') { } else if (CUR == '\'') {
NEXT; NEXT;
q = CUR_PTR;
while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')) if (CUR_PTR < BASE_PTR)
NEXT; return(ret);
startPosition = CUR_PTR - BASE_PTR;
while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')){
len++;
NEXT;
}
if (CUR != '\'') { if (CUR != '\'') {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished PubidLiteral\n", NULL, NULL); "Unfinished PubidLiteral\n", NULL, NULL);
} else { } else {
ret = xmlStrndup(q, CUR_PTR - q); ret = xmlStrndup((BASE_PTR + startPosition), len);
NEXT; NEXT;
} }
} else { } else {
@ -2887,9 +2971,11 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
} }
if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) { if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in CDATA 0x%X\n", cur); "Invalid char in CDATA 0x%X\n", cur);
NEXT; if (ctxt->input->cur < ctxt->input->end) {
NEXT;
}
} }
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) { if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
@ -2906,8 +2992,9 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
/** /**
* htmlParseCharData: * htmlParseCharDataInternal:
* @ctxt: an HTML parser context * @ctxt: an HTML parser context
* @readahead: optional read ahead character in ascii range
* *
* parse a CharData section. * parse a CharData section.
* if we are within a CDATA section ']]>' marks an end of section. * if we are within a CDATA section ']]>' marks an end of section.
@ -2916,12 +3003,15 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
*/ */
static void static void
htmlParseCharData(htmlParserCtxtPtr ctxt) { htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5]; xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6];
int nbchar = 0; int nbchar = 0;
int cur, l; int cur, l;
int chunk = 0; int chunk = 0;
if (readahead)
buf[nbchar++] = readahead;
SHRINK; SHRINK;
cur = CUR_CHAR(l); cur = CUR_CHAR(l);
while (((cur != '<') || (ctxt->token == '<')) && while (((cur != '<') || (ctxt->token == '<')) &&
@ -2939,9 +3029,14 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
*/ */
if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
if (areBlanks(ctxt, buf, nbchar)) { if (areBlanks(ctxt, buf, nbchar)) {
if (ctxt->sax->ignorableWhitespace != NULL) if (ctxt->keepBlanks) {
ctxt->sax->ignorableWhitespace(ctxt->userData, if (ctxt->sax->characters != NULL)
buf, nbchar); ctxt->sax->characters(ctxt->userData, buf, nbchar);
} else {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(ctxt->userData,
buf, nbchar);
}
} else { } else {
htmlCheckParagraph(ctxt); htmlCheckParagraph(ctxt);
if (ctxt->sax->characters != NULL) if (ctxt->sax->characters != NULL)
@ -2972,8 +3067,14 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
*/ */
if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
if (areBlanks(ctxt, buf, nbchar)) { if (areBlanks(ctxt, buf, nbchar)) {
if (ctxt->sax->ignorableWhitespace != NULL) if (ctxt->keepBlanks) {
ctxt->sax->ignorableWhitespace(ctxt->userData, buf, nbchar); 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 { } else {
htmlCheckParagraph(ctxt); htmlCheckParagraph(ctxt);
if (ctxt->sax->characters != NULL) if (ctxt->sax->characters != NULL)
@ -2989,6 +3090,21 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
} }
} }
/**
* htmlParseCharData:
* @ctxt: an HTML parser context
*
* parse a CharData section.
* if we are within a CDATA section ']]>' marks an end of section.
*
* [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
*/
static void
htmlParseCharData(htmlParserCtxtPtr ctxt) {
htmlParseCharDataInternal(ctxt, 0);
}
/** /**
* htmlParseExternalID: * htmlParseExternalID:
* @ctxt: an HTML parser context * @ctxt: an HTML parser context
@ -3192,12 +3308,17 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
ctxt->instate = state; ctxt->instate = state;
return; return;
} }
len = 0;
buf[len] = 0;
q = CUR_CHAR(ql); q = CUR_CHAR(ql);
if (!IS_CHAR(q))
goto unfinished;
NEXTL(ql); NEXTL(ql);
r = CUR_CHAR(rl); r = CUR_CHAR(rl);
if (!IS_CHAR(r))
goto unfinished;
NEXTL(rl); NEXTL(rl);
cur = CUR_CHAR(l); cur = CUR_CHAR(l);
len = 0;
while (IS_CHAR(cur) && while (IS_CHAR(cur) &&
((cur != '>') || ((cur != '>') ||
(r != '-') || (q != '-'))) { (r != '-') || (q != '-'))) {
@ -3228,18 +3349,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
} }
} }
buf[len] = 0; buf[len] = 0;
if (!IS_CHAR(cur)) { if (IS_CHAR(cur)) {
htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
"Comment not terminated \n<!--%.50s\n", buf, NULL);
xmlFree(buf);
} else {
NEXT; NEXT;
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) && if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
(!ctxt->disableSAX)) (!ctxt->disableSAX))
ctxt->sax->comment(ctxt->userData, buf); ctxt->sax->comment(ctxt->userData, buf);
xmlFree(buf); xmlFree(buf);
ctxt->instate = state;
return;
} }
ctxt->instate = state;
unfinished:
htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
"Comment not terminated \n<!--%.50s\n", buf, NULL);
xmlFree(buf);
} }
/** /**
@ -3275,7 +3398,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
val = val * 16 + (CUR - 'A') + 10; val = val * 16 + (CUR - 'A') + 10;
else { else {
htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF,
"htmlParseCharRef: missing semicolumn\n", "htmlParseCharRef: missing semicolon\n",
NULL, NULL); NULL, NULL);
break; break;
} }
@ -3290,7 +3413,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
val = val * 10 + (CUR - '0'); val = val * 10 + (CUR - '0');
else { else {
htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF,
"htmlParseCharRef: missing semicolumn\n", "htmlParseCharRef: missing semicolon\n",
NULL, NULL); NULL, NULL);
break; break;
} }
@ -3433,34 +3556,26 @@ htmlParseAttribute(htmlParserCtxtPtr ctxt, xmlChar **value) {
} }
/** /**
* htmlCheckEncoding: * htmlCheckEncodingDirect:
* @ctxt: an HTML parser context * @ctxt: an HTML parser context
* @attvalue: the attribute value * @attvalue: the attribute value
* *
* Checks an http-equiv attribute from a Meta tag to detect * Checks an attribute value to detect
* the encoding * the encoding
* If a new encoding is detected the parser is switched to decode * If a new encoding is detected the parser is switched to decode
* it and pass UTF8 * it and pass UTF8
*/ */
static void static void
htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
const xmlChar *encoding;
if ((ctxt == NULL) || (attvalue == NULL)) if ((ctxt == NULL) || (encoding == NULL) ||
(ctxt->options & HTML_PARSE_IGNORE_ENC))
return; return;
/* do not change encoding */ /* do not change encoding */
if (ctxt->input->encoding != NULL) if (ctxt->input->encoding != NULL)
return; 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) { if (encoding != NULL) {
xmlCharEncoding enc; xmlCharEncoding enc;
xmlCharEncodingHandlerPtr handler; xmlCharEncodingHandlerPtr handler;
@ -3498,7 +3613,9 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) {
xmlSwitchToEncoding(ctxt, handler); xmlSwitchToEncoding(ctxt, handler);
ctxt->charset = XML_CHAR_ENCODING_UTF8; ctxt->charset = XML_CHAR_ENCODING_UTF8;
} else { } else {
ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING; htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
"htmlCheckEncoding: unknown encoding %s\n",
encoding, NULL);
} }
} }
@ -3513,23 +3630,50 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) {
* convert as much as possible to the parser reading buffer. * convert as much as possible to the parser reading buffer.
*/ */
processed = ctxt->input->cur - ctxt->input->base; processed = ctxt->input->cur - ctxt->input->base;
xmlBufferShrink(ctxt->input->buf->buffer, processed); xmlBufShrink(ctxt->input->buf->buffer, processed);
nbchars = xmlCharEncInFunc(ctxt->input->buf->encoder, nbchars = xmlCharEncInput(ctxt->input->buf, 1);
ctxt->input->buf->buffer,
ctxt->input->buf->raw);
if (nbchars < 0) { if (nbchars < 0) {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"htmlCheckEncoding: encoder error\n", "htmlCheckEncoding: encoder error\n",
NULL, NULL); NULL, NULL);
} }
ctxt->input->base = xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input);
ctxt->input->cur = ctxt->input->buf->buffer->content;
ctxt->input->end =
&ctxt->input->base[ctxt->input->buf->buffer->use];
} }
} }
} }
/**
* 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: * htmlCheckMeta:
* @ctxt: an HTML parser context * @ctxt: an HTML parser context
@ -3554,6 +3698,8 @@ htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) {
if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"http-equiv")) if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"http-equiv"))
&& (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) && (!xmlStrcasecmp(value, BAD_CAST"Content-Type")))
http = 1; http = 1;
else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"charset")))
htmlCheckEncodingDirect(ctxt, value);
else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"content"))) else if ((value != NULL) && (!xmlStrcasecmp(att, BAD_CAST"content")))
content = value; content = value;
att = atts[i++]; att = atts[i++];
@ -3595,13 +3741,13 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
int i; int i;
int discardtag = 0; int discardtag = 0;
if (ctxt->instate == XML_PARSER_EOF)
return(-1);
if ((ctxt == NULL) || (ctxt->input == NULL)) { if ((ctxt == NULL) || (ctxt->input == NULL)) {
htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR, htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
"htmlParseStartTag: context error\n", NULL, NULL); "htmlParseStartTag: context error\n", NULL, NULL);
return -1; return -1;
} }
if (ctxt->instate == XML_PARSER_EOF)
return(-1);
if (CUR != '<') return -1; if (CUR != '<') return -1;
NEXT; NEXT;
@ -3614,6 +3760,14 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED, htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
"htmlParseStartTag: invalid element name\n", "htmlParseStartTag: invalid element name\n",
NULL, NULL); NULL, NULL);
/* if recover preserve text on classic misconstructs */
if ((ctxt->recovery) && ((IS_BLANK_CH(CUR)) || (CUR == '<') ||
(CUR == '=') || (CUR == '>') || (((CUR >= '0') && (CUR <= '9'))))) {
htmlParseCharDataInternal(ctxt, '<');
return(-1);
}
/* Dump the bogus tag like browsers do */ /* Dump the bogus tag like browsers do */
while ((IS_CHAR_CH(CUR)) && (CUR != '>') && while ((IS_CHAR_CH(CUR)) && (CUR != '>') &&
(ctxt->instate != XML_PARSER_EOF)) (ctxt->instate != XML_PARSER_EOF))
@ -3883,6 +4037,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
if ((oldname != NULL) && (xmlStrEqual(oldname, name))) { if ((oldname != NULL) && (xmlStrEqual(oldname, name))) {
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, name); ctxt->sax->endElement(ctxt->userData, name);
htmlNodeInfoPop(ctxt);
htmlnamePop(ctxt); htmlnamePop(ctxt);
ret = 1; ret = 1;
} else { } else {
@ -4289,7 +4444,7 @@ static void
htmlParseElementInternal(htmlParserCtxtPtr ctxt) { htmlParseElementInternal(htmlParserCtxtPtr ctxt) {
const xmlChar *name; const xmlChar *name;
const htmlElemDesc * info; const htmlElemDesc * info;
htmlParserNodeInfo node_info; htmlParserNodeInfo node_info = { 0, };
int failed; int failed;
if ((ctxt == NULL) || (ctxt->input == NULL)) { if ((ctxt == NULL) || (ctxt->input == NULL)) {
@ -4670,7 +4825,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
ctxt->sax->endDocument(ctxt->userData); ctxt->sax->endDocument(ctxt->userData);
if (ctxt->myDoc != NULL) { if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL)) {
dtd = xmlGetIntSubset(ctxt->myDoc); dtd = xmlGetIntSubset(ctxt->myDoc);
if (dtd == NULL) if (dtd == NULL)
ctxt->myDoc->intSubset = ctxt->myDoc->intSubset =
@ -4875,9 +5030,7 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) {
input->filename = NULL; input->filename = NULL;
input->buf = buf; input->buf = buf;
input->base = input->buf->buffer->content; xmlBufResetInput(buf->buffer, input);
input->cur = input->buf->buffer->content;
input->end = &input->buf->buffer->content[input->buf->buffer->use];
inputPush(ctxt, input); inputPush(ctxt, input);
return(ctxt); return(ctxt);
@ -4994,8 +5147,8 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
buf = in->base; buf = in->base;
len = in->length; len = in->length;
} else { } else {
buf = in->buf->buffer->content; buf = xmlBufContent(in->buf->buffer);
len = in->buf->buffer->use; len = xmlBufUse(in->buf->buffer);
} }
/* take into account the sequence length */ /* take into account the sequence length */
@ -5121,8 +5274,8 @@ htmlParseLookupChars(htmlParserCtxtPtr ctxt, const xmlChar * stop,
buf = in->base; buf = in->base;
len = in->length; len = in->length;
} else { } else {
buf = in->buf->buffer->content; buf = xmlBufContent(in->buf->buffer);
len = in->buf->buffer->use; len = xmlBufUse(in->buf->buffer);
} }
for (; base < len; base++) { for (; base < len; base++) {
@ -5171,6 +5324,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
int avail = 0; int avail = 0;
xmlChar cur, next; xmlChar cur, next;
htmlParserNodeInfo node_info;
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
switch (ctxt->instate) { switch (ctxt->instate) {
case XML_PARSER_EOF: case XML_PARSER_EOF:
@ -5231,7 +5386,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (in->buf == NULL) if (in->buf == NULL)
avail = in->length - (in->cur - in->base); avail = in->length - (in->cur - in->base);
else else
avail = in->buf->buffer->use - (in->cur - in->base); avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
if ((avail == 0) && (terminate)) { if ((avail == 0) && (terminate)) {
htmlAutoCloseOnEnd(ctxt); htmlAutoCloseOnEnd(ctxt);
if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) {
@ -5267,7 +5422,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (in->buf == NULL) if (in->buf == NULL)
avail = in->length - (in->cur - in->base); avail = in->length - (in->cur - in->base);
else 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)) if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
ctxt->sax->setDocumentLocator(ctxt->userData, ctxt->sax->setDocumentLocator(ctxt->userData,
@ -5309,11 +5464,24 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (in->buf == NULL) if (in->buf == NULL)
avail = in->length - (in->cur - in->base); avail = in->length - (in->cur - in->base);
else else
avail = in->buf->buffer->use - (in->cur - in->base); avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
if (avail < 2) /*
* no chars in buffer
*/
if (avail < 1)
goto done; 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]; cur = in->cur[0];
next = in->cur[1];
if ((cur == '<') && (next == '!') && if ((cur == '<') && (next == '!') &&
(in->cur[2] == '-') && (in->cur[3] == '-')) { (in->cur[2] == '-') && (in->cur[3] == '-')) {
if ((!terminate) && if ((!terminate) &&
@ -5369,7 +5537,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (in->buf == NULL) if (in->buf == NULL)
avail = in->length - (in->cur - in->base); avail = in->length - (in->cur - in->base);
else else
avail = in->buf->buffer->use - (in->cur - in->base); avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
if (avail < 2) if (avail < 2)
goto done; goto done;
cur = in->cur[0]; cur = in->cur[0];
@ -5410,7 +5578,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (in->buf == NULL) if (in->buf == NULL)
avail = in->length - (in->cur - in->base); avail = in->length - (in->cur - in->base);
else else
avail = in->buf->buffer->use - (in->cur - in->base); avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
if (avail < 1) if (avail < 1)
goto done; goto done;
cur = in->cur[0]; cur = in->cur[0];
@ -5463,8 +5631,22 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
int failed; int failed;
const htmlElemDesc * info; const htmlElemDesc * info;
if (avail < 2) /*
* no chars in buffer
*/
if (avail < 1)
goto done; 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]; cur = in->cur[0];
if (cur != '<') { if (cur != '<') {
ctxt->instate = XML_PARSER_CONTENT; ctxt->instate = XML_PARSER_CONTENT;
@ -5474,7 +5656,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
#endif #endif
break; break;
} }
if (in->cur[1] == '/') { if (next == '/') {
ctxt->instate = XML_PARSER_END_TAG; ctxt->instate = XML_PARSER_END_TAG;
ctxt->checkIndex = 0; ctxt->checkIndex = 0;
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
@ -5487,6 +5669,14 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
(htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0)) (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
goto done; 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); failed = htmlParseStartTag(ctxt);
name = ctxt->name; name = ctxt->name;
if ((failed == -1) || if ((failed == -1) ||
@ -5536,6 +5726,9 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
htmlnamePop(ctxt); htmlnamePop(ctxt);
} }
if (ctxt->record_info)
htmlNodeInfoPush(ctxt, &node_info);
ctxt->instate = XML_PARSER_CONTENT; ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
@ -5552,6 +5745,10 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
ctxt->sax->endElement(ctxt->userData, name); ctxt->sax->endElement(ctxt->userData, name);
htmlnamePop(ctxt); htmlnamePop(ctxt);
} }
if (ctxt->record_info)
htmlNodeInfoPush(ctxt, &node_info);
ctxt->instate = XML_PARSER_CONTENT; ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
@ -5579,14 +5776,20 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if ((cur != '<') && (cur != '&')) { if ((cur != '<') && (cur != '&')) {
if (ctxt->sax != NULL) { if (ctxt->sax != NULL) {
if (IS_BLANK_CH(cur)) { if (IS_BLANK_CH(cur)) {
if (ctxt->sax->ignorableWhitespace != NULL) if (ctxt->keepBlanks) {
ctxt->sax->ignorableWhitespace( if (ctxt->sax->characters != NULL)
ctxt->userData, &cur, 1); ctxt->sax->characters(
ctxt->userData, &in->cur[0], 1);
} else {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(
ctxt->userData, &in->cur[0], 1);
}
} else { } else {
htmlCheckParagraph(ctxt); htmlCheckParagraph(ctxt);
if (ctxt->sax->characters != NULL) if (ctxt->sax->characters != NULL)
ctxt->sax->characters( ctxt->sax->characters(
ctxt->userData, &cur, 1); ctxt->userData, &in->cur[0], 1);
} }
} }
ctxt->token = 0; ctxt->token = 0;
@ -5609,7 +5812,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
int idx; int idx;
xmlChar val; xmlChar val;
idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 1); idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 0);
if (idx < 0) if (idx < 0)
goto done; goto done;
val = in->cur[idx + 2]; val = in->cur[idx + 2];
@ -5866,7 +6069,7 @@ done:
ctxt->sax->endDocument(ctxt->userData); ctxt->sax->endDocument(ctxt->userData);
} }
} }
if ((ctxt->myDoc != NULL) && if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) &&
((terminate) || (ctxt->instate == XML_PARSER_EOF) || ((terminate) || (ctxt->instate == XML_PARSER_EOF) ||
(ctxt->instate == XML_PARSER_EPILOG))) { (ctxt->instate == XML_PARSER_EPILOG))) {
xmlDtdPtr dtd; xmlDtdPtr dtd;
@ -5904,8 +6107,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
} }
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) { (ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
int base = ctxt->input->base - ctxt->input->buf->buffer->content; size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
int cur = ctxt->input->cur - ctxt->input->base; size_t cur = ctxt->input->cur - ctxt->input->base;
int res; int res;
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk); res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
@ -5914,10 +6117,7 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
ctxt->disableSAX = 1; ctxt->disableSAX = 1;
return (XML_PARSER_EOF); return (XML_PARSER_EOF);
} }
ctxt->input->base = ctxt->input->buf->buffer->content + base; xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
ctxt->input->cur = ctxt->input->base + cur;
ctxt->input->end =
&ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use];
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
#endif #endif
@ -5932,13 +6132,16 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
if ((in->encoder != NULL) && (in->buffer != NULL) && if ((in->encoder != NULL) && (in->buffer != NULL) &&
(in->raw != NULL)) { (in->raw != NULL)) {
int nbchars; 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) { if (nbchars < 0) {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"encoder error\n", NULL, NULL); "encoder error\n", NULL, NULL);
return(XML_ERR_INVALID_ENCODING); return(XML_ERR_INVALID_ENCODING);
} }
xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
} }
} }
} }
@ -6032,24 +6235,18 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
inputStream->filename = (char *) inputStream->filename = (char *)
xmlCanonicPath((const xmlChar *) filename); xmlCanonicPath((const xmlChar *) filename);
inputStream->buf = buf; inputStream->buf = buf;
inputStream->base = inputStream->buf->buffer->content; xmlBufResetInput(buf->buffer, inputStream);
inputStream->cur = inputStream->buf->buffer->content;
inputStream->end =
&inputStream->buf->buffer->content[inputStream->buf->buffer->use];
inputPush(ctxt, inputStream); inputPush(ctxt, inputStream);
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL)) { (ctxt->input->buf != NULL)) {
int base = ctxt->input->base - ctxt->input->buf->buffer->content; size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
int cur = ctxt->input->cur - ctxt->input->base; size_t cur = ctxt->input->cur - ctxt->input->base;
xmlParserInputBufferPush(ctxt->input->buf, size, chunk); xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
ctxt->input->base = ctxt->input->buf->buffer->content + base; xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
ctxt->input->cur = ctxt->input->base + cur;
ctxt->input->end =
&ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use];
#ifdef DEBUG_PUSH #ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
#endif #endif
@ -6169,12 +6366,16 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
/* set encoding */ /* set encoding */
if (encoding) { if (encoding) {
content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1); size_t l = strlen(encoding);
if (content) {
strcpy ((char *)content, (char *)content_line); if (l < 1000) {
strcat ((char *)content, (char *)encoding); content = xmlMallocAtomic (xmlStrlen(content_line) + l + 1);
htmlCheckEncoding (ctxt, content); if (content) {
xmlFree (content); strcpy ((char *)content, (char *)content_line);
strcat ((char *)content, (char *)encoding);
htmlCheckEncoding (ctxt, content);
xmlFree (content);
}
} }
} }
@ -6380,7 +6581,7 @@ htmlNodeStatus(const htmlNodePtr node, int legacy) {
* DICT_FREE: * DICT_FREE:
* @str: a string * @str: a string
* *
* Free a string if it is not owned by the "dict" dictionnary in the * Free a string if it is not owned by the "dict" dictionary in the
* current scope * current scope
*/ */
#define DICT_FREE(str) \ #define DICT_FREE(str) \
@ -6451,6 +6652,7 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
ctxt->wellFormed = 1; ctxt->wellFormed = 1;
ctxt->nsWellFormed = 1; ctxt->nsWellFormed = 1;
ctxt->disableSAX = 0;
ctxt->valid = 1; ctxt->valid = 1;
ctxt->vctxt.userData = ctxt; ctxt->vctxt.userData = ctxt;
ctxt->vctxt.error = xmlParserValidityError; ctxt->vctxt.error = xmlParserValidityError;
@ -6530,6 +6732,18 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
ctxt->options |= XML_PARSE_HUGE; ctxt->options |= XML_PARSE_HUGE;
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; ctxt->dictNames = 0;
return (options); return (options);
} }
@ -6676,6 +6890,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options)
if (fd < 0) if (fd < 0)
return (NULL); return (NULL);
xmlInitParser();
xmlInitParser(); xmlInitParser();
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
@ -6723,8 +6938,11 @@ htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose,
input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
XML_CHAR_ENCODING_NONE); XML_CHAR_ENCODING_NONE);
if (input == NULL) if (input == NULL) {
if (ioclose != NULL)
ioclose(ioctx);
return (NULL); return (NULL);
}
ctxt = htmlNewParserCtxt(); ctxt = htmlNewParserCtxt();
if (ctxt == NULL) { if (ctxt == NULL) {
xmlFreeParserInputBuffer(input); xmlFreeParserInputBuffer(input);
@ -6763,6 +6981,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur,
return (NULL); return (NULL);
if (ctxt == NULL) if (ctxt == NULL)
return (NULL); return (NULL);
xmlInitParser();
htmlCtxtReset(ctxt); htmlCtxtReset(ctxt);
@ -6796,6 +7015,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename,
return (NULL); return (NULL);
if (ctxt == NULL) if (ctxt == NULL)
return (NULL); return (NULL);
xmlInitParser();
htmlCtxtReset(ctxt); htmlCtxtReset(ctxt);
@ -6832,6 +7052,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size,
return (NULL); return (NULL);
if (buffer == NULL) if (buffer == NULL)
return (NULL); return (NULL);
xmlInitParser();
htmlCtxtReset(ctxt); htmlCtxtReset(ctxt);
@ -6874,6 +7095,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd,
return (NULL); return (NULL);
if (ctxt == NULL) if (ctxt == NULL)
return (NULL); return (NULL);
xmlInitParser();
htmlCtxtReset(ctxt); htmlCtxtReset(ctxt);
@ -6918,13 +7140,17 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread,
return (NULL); return (NULL);
if (ctxt == NULL) if (ctxt == NULL)
return (NULL); return (NULL);
xmlInitParser();
htmlCtxtReset(ctxt); htmlCtxtReset(ctxt);
input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
XML_CHAR_ENCODING_NONE); XML_CHAR_ENCODING_NONE);
if (input == NULL) if (input == NULL) {
if (ioclose != NULL)
ioclose(ioctx);
return (NULL); return (NULL);
}
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE); stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
if (stream == NULL) { if (stream == NULL) {
xmlFreeParserInputBuffer(input); xmlFreeParserInputBuffer(input);

View File

@ -30,9 +30,11 @@
#include <libxml/globals.h> #include <libxml/globals.h>
#include <libxml/uri.h> #include <libxml/uri.h>
#include "buf.h"
/************************************************************************ /************************************************************************
* * * *
* Getting/Setting encoding meta tags * * Getting/Setting encoding meta tags *
* * * *
************************************************************************/ ************************************************************************/
@ -164,6 +166,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
const xmlChar *content = NULL; const xmlChar *content = NULL;
char newcontent[100]; char newcontent[100];
newcontent[0] = 0;
if (doc == NULL) if (doc == NULL)
return(-1); return(-1);
@ -278,8 +281,13 @@ create:
xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent); xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent);
} }
} else { } 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 */ /* 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); xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent);
} }
} }
@ -332,7 +340,7 @@ xmlOutputBufferPtr
xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder); 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: * htmlBufNodeDumpFormat:
* @buf: the HTML buffer output * @buf: the xmlBufPtr output
* @doc: the document * @doc: the document
* @cur: the current node * @cur: the current node
* @format: should formatting spaces been added * @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 * Returns the number of byte written or -1 in case of error
*/ */
static int static size_t
htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, htmlBufNodeDumpFormat(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur,
int format) { int format) {
unsigned int use; size_t use;
int ret; int ret;
xmlOutputBufferPtr outbuf; xmlOutputBufferPtr outbuf;
@ -426,10 +430,10 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
outbuf->context = NULL; outbuf->context = NULL;
outbuf->written = 0; outbuf->written = 0;
use = buf->use; use = xmlBufUse(buf);
htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format); htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format);
xmlFree(outbuf); xmlFree(outbuf);
ret = buf->use - use; ret = xmlBufUse(buf) - use;
return (ret); return (ret);
} }
@ -446,9 +450,24 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
*/ */
int int
htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) { htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
xmlInitParser(); xmlBufPtr buffer;
size_t ret;
return(htmlNodeDumpFormat(buf, doc, cur, 1)); if ((buf == NULL) || (cur == NULL))
return(-1);
xmlInitParser();
buffer = xmlBufFromBuffer(buf);
if (buffer == NULL)
return(-1);
ret = htmlBufNodeDumpFormat(buffer, 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) { if (enc != XML_CHAR_ENCODING_UTF8) {
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) if (handler == NULL)
return(-1); htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
} }
} }
@ -562,11 +581,9 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
} }
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) { if (handler == NULL)
*mem = NULL; htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
*size = 0;
return;
}
} else { } else {
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
} }
@ -587,15 +604,15 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
return; return;
} }
htmlDocContentDumpFormatOutput(buf, cur, NULL, format); htmlDocContentDumpFormatOutput(buf, cur, NULL, format);
xmlOutputBufferFlush(buf); xmlOutputBufferFlush(buf);
if (buf->conv != NULL) { if (buf->conv != NULL) {
*size = buf->conv->use; *size = xmlBufUse(buf->conv);
*mem = xmlStrndup(buf->conv->content, *size); *mem = xmlStrndup(xmlBufContent(buf->conv), *size);
} else { } else {
*size = buf->buffer->use; *size = xmlBufUse(buf->buffer);
*mem = xmlStrndup(buf->buffer->content, *size); *mem = xmlStrndup(xmlBufContent(buf->buffer), *size);
} }
(void)xmlOutputBufferClose(buf); (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 *
* * * *
************************************************************************/ ************************************************************************/
@ -646,14 +663,15 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlOutputBufferWriteString(buf, (const char *)cur->name); xmlOutputBufferWriteString(buf, (const char *)cur->name);
if (cur->ExternalID != NULL) { if (cur->ExternalID != NULL) {
xmlOutputBufferWriteString(buf, " PUBLIC "); xmlOutputBufferWriteString(buf, " PUBLIC ");
xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID); xmlBufWriteQuotedString(buf->buffer, cur->ExternalID);
if (cur->SystemID != NULL) { if (cur->SystemID != NULL) {
xmlOutputBufferWriteString(buf, " "); xmlOutputBufferWriteString(buf, " ");
xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); xmlBufWriteQuotedString(buf->buffer, cur->SystemID);
} }
} else if (cur->SystemID != NULL) { } else if (cur->SystemID != NULL &&
xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) {
xmlOutputBufferWriteString(buf, " SYSTEM "); xmlOutputBufferWriteString(buf, " SYSTEM ");
xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); xmlBufWriteQuotedString(buf->buffer, cur->SystemID);
} }
xmlOutputBufferWriteString(buf, ">\n"); xmlOutputBufferWriteString(buf, ">\n");
} }
@ -673,9 +691,10 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
xmlChar *value; xmlChar *value;
/* /*
* TODO: The html output method should not escape a & character * The html output method should not escape a & character
* occurring in an attribute value immediately followed by * occurring in an attribute value immediately followed by
* a { character (see Section B.7.1 of the HTML 4.0 Recommendation). * a { character (see Section B.7.1 of the HTML 4.0 Recommendation).
* This is implemented in xmlEncodeEntitiesReentrant
*/ */
if (cur == NULL) { if (cur == NULL) {
@ -698,20 +717,51 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
(!xmlStrcasecmp(cur->name, BAD_CAST "src")) || (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
((!xmlStrcasecmp(cur->name, BAD_CAST "name")) && ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
(!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) { (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
xmlChar *escaped;
xmlChar *tmp = value; xmlChar *tmp = value;
/* xmlURIEscapeStr() escapes '"' so it can be safely used. */
xmlBufCCat(buf->buffer, "\"");
while (IS_BLANK_CH(*tmp)) tmp++; while (IS_BLANK_CH(*tmp)) tmp++;
escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+"); /* URI Escape everything, except server side includes. */
if (escaped != NULL) { for ( ; ; ) {
xmlBufferWriteQuotedString(buf->buffer, escaped); xmlChar *escaped;
xmlFree(escaped); xmlChar endChar;
} else { xmlChar *end = NULL;
xmlBufferWriteQuotedString(buf->buffer, value); xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
if (start != NULL) {
end = (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 "<!--". */
end += 3; /* strlen("-->") */
endChar = *end;
*end = '\0';
xmlBufCat(buf->buffer, start);
*end = endChar;
tmp = end;
} }
xmlBufCCat(buf->buffer, "\"");
} else { } else {
xmlBufferWriteQuotedString(buf->buffer, value); xmlBufWriteQuotedString(buf->buffer, value);
} }
xmlFree(value); xmlFree(value);
} else { } else {
@ -1061,7 +1111,7 @@ htmlDocDump(FILE *f, xmlDocPtr cur) {
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) if (handler == NULL)
return(-1); htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
} else { } else {
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
} }
@ -1120,7 +1170,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) {
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) if (handler == NULL)
return(-1); htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
} }
} }
@ -1181,7 +1231,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
handler = xmlFindCharEncodingHandler(encoding); handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) if (handler == NULL)
return(-1); htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
} }
htmlSetMetaEncoding(cur, (const xmlChar *) encoding); htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
} else { } else {

View File

@ -1,8 +1,8 @@
Installation Instructions Installation Instructions
************************* *************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
2006, 2007, 2008, 2009 Free Software Foundation, Inc. Inc.
Copying and distribution of this file, with or without modification, Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright are permitted in any medium without royalty provided the copyright
@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation Basic Installation
================== ==================
Briefly, the shell commands `./configure; make; make install' should Briefly, the shell command `./configure && make && make install'
configure, build, and install this package. The following should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented `INSTALL' file but do not implement all of the features documented
@ -226,6 +226,11 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX. and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended a workaround. If GNU CC is not installed, it is therefore recommended
@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround: an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation `configure' Invocation
====================== ======================
@ -362,4 +368,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details. `configure --help' for more details.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -4,17 +4,647 @@
Note that this is automatically generated from the news webpage at: Note that this is automatically generated from the news webpage at:
http://xmlsoft.org/news.html 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 The change log at
ChangeLog.html ChangeLog.html
describes the recents commits describes the recents commits
to the SVN at to the GIT at
http://svn.gnome.org/viewvc/libxml2/trunk/ http://git.gnome.org/browse/libxml2/
code base.Here is the list of public releases: 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 &lt; (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 libxmls 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 <noscript> in the <head> (Denis Pauk),
XSD: optional element in complex type extension (Remi Gacogne),
Fix html serialization error and htmlSetMetaEncoding() (Daniel Veillard),
Fix a wrong return value in previous patch (Daniel Veillard),
Fix an uninitialized variable use (Daniel Veillard),
Fix a compilation problem with --minimum (Brandon Slack),
Remove redundant and ungarded include of resolv.h (Daniel Veillard),
xinclude with parse="text" does not use the entity loader (Shaun McCance),
Allow to parse 1 byte HTML files (Denis Pauk),
Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag (Martin Schröder),
Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
xmlParseNodeInContext problems with an empty document (Tim Elliott),
HTML element position is not detected propperly (Pavel Andrejs),
Fix an off by one pointer access (Jüri Aedla),
Try to fix a problem with entities in SAX mode (Daniel Veillard),
Fix a crash with xmllint --path on empty results (Daniel Veillard),
Fixed bug #667946 (Daniel Mustieles),
Fix a logic error in Schemas Component Constraints (Ryan Sleevi),
Fix a wrong enum type use in Schemas Types (Nico Weber),
Fix SAX2 builder in case of undefined attributes namespace (Daniel Veillard),
Fix SAX2 builder in case of undefined element namespaces (Daniel Veillard),
fix reference to STDOUT_FILENO on MSVC (Tay Ray Chuan),
fix a pair of possible out of array char references (Daniel Veillard),
Fix an allocation error when copying entities (Daniel Veillard),
Make sure the parser returns when getting a Stop order (Chris Evans),
Fix some potential problems on reallocation failures(parser.c) (Xia Xinfeng),
Fix a schema type duration comparison overflow (Daniel Veillard),
Fix an unimplemented part in RNG value validation (Daniel Veillard),
Fix missing error status in XPath evaluation (Daniel Veillard),
Hardening of XPath evaluation (Daniel Veillard),
Fix an off by one error in encoding (Daniel Veillard),
Fix RELAX NG include bug #655288 (Shaun McCance),
Fix XSD validation bug #630130 (Toyoda Eizi),
Fix some potential problems on reallocation failures (Chris Evans),
__xmlRaiseError: fix use of the structured callback channel (Dmitry V. Levin),
__xmlRaiseError: fix the structured callback channel's data initialization (Dmitry V. Levin),
Fix memory corruption when xmlParseBalancedChunkMemoryInternal is called from xmlParseBalancedChunk (Rob Richards),
Small fix for previous commit (Daniel Veillard),
Fix a potential freeing error in XPath (Daniel Veillard),
Fix a potential memory access error (Daniel Veillard),
Reactivate the shared library versionning script (Daniel Veillard)
- Improvements:
use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime (Roumen Petrov),
New symbols added for the next release (Daniel Veillard),
xmlTextReader bails too quickly on error (Andy Lutomirski),
Use a hybrid allocation scheme in xmlNodeSetContent (Conrad Irwin),
Use buffers when constructing string node lists. (Conrad Irwin),
Add HTML parser support for HTML5 meta charset encoding declaration (Denis Pauk),
wrong message for double hyphen in comment XML error (Bryan Henderson),
Fix "make tst" to grab lzma lib too (Daniel Veillard),
Add "whereis" command to xmllint shell (Ryan),
Improve xmllint shell (Ryan),
add function xmlTextReaderRelaxNGValidateCtxt() (Noam Postavsky),
Add --system support to autogen.sh (Daniel Veillard),
Add hash randomization to hash and dict structures (Daniel Veillard),
included xzlib in dist (Anders F Bjorklund),
move xz/lzma helpers to separate included files (Anders F Bjorklund),
add generated devhelp files (Anders F Bjorklund),
add XML_WITH_LZMA to api (Anders F Bjorklund),
autogen.sh: Honor NOCONFIGURE environment variable (Colin Walters),
Improve the error report on undefined REFs (Daniel Veillard),
Add exception for new W3C PI xml-model (Daniel Veillard),
Add options to ignore the internal encoding (Daniel Veillard),
testapi: use the right type for the check (Stefan Kost),
various: handle return values of write calls (Stefan Kost),
testWriter: xmlTextWriterWriteFormatElement wants an int instead of a long int (Stefan Kost),
runxmlconf: update to latest testsuite version (Stefan Kost),
configure: add -Wno-long-long to CFLAGS (Stefan Kost),
configure: support silent automake rules if possible (Stefan Kost),
xmlmemory: add a cast as size_t has no portable printf modifier (Stefan Kost),
__xmlRaiseError: remove redundant schannel initialization (Dmitry V. Levin),
__xmlRaiseError: do cheap code check early (Dmitry V. Levin)
- Cleanups:
Cleanups before 2.8.0-rc2 (Daniel Veillard),
Avoid an extra operation (Daniel Veillard),
Remove vestigial de-ANSI-fication support. (Javier Jardón),
autogen.sh: Fix typo (Javier Jardón),
Do not use unsigned but unsigned int (Daniel Veillard),
Remove two references to u_short (Daniel Veillard),
Fix -Wempty-body warning from clang (Nico Weber),
Cleanups of lzma support (Daniel Veillard),
Augment the list of ignored files (Daniel Veillard),
python: remove unused variable (Stefan Kost),
python: flag two unused args (Stefan Kost),
configure: acconfig.h is deprecated since autoconf-2.50 (Stefan Kost),
xpath: remove unused variable (Stefan Kost)
2.7.8: Nov 4 2010:
- Features:
480323 add code to plug in ICU converters by default (Giuseppe Iuculano),
Add xmlSaveOption XML_SAVE_WSNONSIG (Adam Spragg)
- Documentation:
Fix devhelp documentation installation (Mike Hommey),
Fix web site encoding problems (Daniel Veillard),
Fix a couple of typo in HTML parser error messages (Michael Day),
Forgot to update the news page for 0.7.7 (Daniel Veillard)
- Portability:
607273 Fix python detection on MSys/Windows (LRN),
614087 Fix Socket API usage to allow Windows64 compilation (Ozkan Sezer),
Fix compilation with Clang (Koop Mast),
Fix Win32 build (Rob Richards)
- Bug Fixes:
595789 fix a remaining potential Solaris problem (Daniel Veillard),
617468 fix progressive HTML parsing with style using "'" (Denis Pauk),
616478 Fix xmllint shell write command (Gwenn Kahz),
614005 Possible erroneous HTML parsing on unterminated script (Pierre Belzile),
627987 Fix XSD IDC errors in imported schemas (Jim Panetta),
629325 XPath rounding errors first cleanup (Phil Shafer),
630140 fix iso995x encoding error (Daniel Veillard),
make sure htmlCtxtReset do reset the disableSAX field (Daniel Veillard),
Fix a change of semantic on XPath preceding and following axis (Daniel Veillard),
Fix a potential segfault due to weak symbols on pthreads (Mike Hommey),
Fix a leak in XPath compilation (Daniel Veillard),
Fix the semantic of XPath axis for namespace/attribute context nodes (Daniel Veillard),
Avoid a descriptor leak in catalog loading code (Carlo Bramini),
Fix a small bug in XPath evaluation code (Marius Wachtler),
Fix handling of XML-1.0 XML namespace declaration (Daniel Veillard),
Fix errors in XSD double validation check (Csaba Raduly),
Fix handling of apos in URIs (Daniel Veillard),
xmlTextReaderReadOuterXml should handle DTD (Rob Richards),
Autogen.sh needs to create m4 directory (Rob Richards)
- Improvements:
606592 update language ID parser to RFC 5646 (Daniel Veillard),
Sort python generated stubs (Mike Hommey),
Add an HTML parser option to avoid a default doctype (Daniel Veillard)
- Cleanups:
618831 don't ship generated files in git (Adrian Bunk),
Switch from the obsolete mkinstalldirs to AC_PROG_MKDIR_P (Adrian Bunk),
Various cleanups on encoding handling (Daniel Veillard),
Fix xmllint to use format=1 for default formatting (Adam Spragg),
Force _xmlSaveCtxt.format to be 0 or 1 (Adam Spragg),
Cleanup encoding pointer comparison (Nikolay Sivov),
Small code cleanup on previous patch (Daniel Veillard)
2.7.7: Mar 15 2010:
- Improvements:
Adding a --xpath option to xmllint (Daniel Veillard),
Make HTML parser non-recursive (Eugene Pimenov)
- Portability:
relaxng.c: cast to allow compilation with sun studio 11 (Ben Walton),
Fix build failure on Sparc solaris (Roumen Petrov),
use autoreconf in autogen.sh (Daniel Veillard),
Fix build with mingw (Roumen Petrov),
Upgrade some of the configure and autogen (Daniel Veillard),
Fix relaxNG tests in runtest for Windows runtest.c: initialize ret (Rob Richards),
Fix a const warning in xmlNodeSetBase (Martin Trappel),
Fix python generator to not use deprecated xmllib (Daniel Veillard),
Update some automake files (Daniel Veillard),
598785 Fix nanohttp on Windows (spadix)
- Bug Fixes:
libxml violates the zlib interface and crashes (Mark Adler),
Fix broken escape behaviour in regexp ranges (Daniel Veillard),
Fix missing win32 libraries in libxml-2.0.pc (Volker Grabsch),
Fix detection of python linker flags (Daniel Macks),
fix build error in libxml2/python (Paul Smith),
ChunkParser: Incorrect decoding of small xml files (Raul Hudea),
htmlCheckEncoding doesn't update input-end after shrink (Eugene Pimenov),
Fix a missing #ifdef (Daniel Veillard),
Fix encoding selection for xmlParseInNodeContext (Daniel Veillard),
xmlPreviousElementSibling mistake (François Delyon),
608773 add a missing check in xmlGROW (Daniel Veillard),
Fix xmlParseInNodeContext for HTML content (Daniel Veillard),
Fix lost namespace when copying node * tree.c: reconcile namespace if not found (Rob Richards),
Fix some missing commas in HTML element lists (Eugene Pimenov),
Correct variable type to unsigned (Nikolay Sivov),
Recognize ID attribute in HTML without DOCTYPE (Daniel Veillard),
Fix memory leak in xmlXPathEvalExpression() (Martin),
Fix an init bug in global.c (Kai Henning),
Fix xmlNodeSetBase() comment (Daniel Veillard),
Fix broken escape behaviour in regexp ranges (Daniel Veillard),
Don't give default HTML boolean attribute values in parser (Daniel Veillard),
xmlCtxtResetLastError should reset ctxt-errNo (Daniel Veillard)
- Cleanups:
Cleanup a couple of weirdness in HTML parser (Eugene Pimenov)
2.7.6: Oct 6 2009: 2.7.6: Oct 6 2009:
- Bug Fixes: - Bug Fixes:
Restore thread support in default configuration (Andrew W. Nosenko), Restore thread support in default configuration (Andrew W. Nosenko),
@ -215,7 +845,7 @@ http://svn.gnome.org/viewvc/libxml2/trunk/
- Improvement: switch parser to XML-1.0 5th edition, add parsing flags - Improvement: switch parser to XML-1.0 5th edition, add parsing flags
for old versions, switch URI parsing to RFC 3986, for old versions, switch URI parsing to RFC 3986,
add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer), add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
new hashing functions for dictionnaries (based on Stefan Behnel work), new hashing functions for dictionaries (based on Stefan Behnel work),
improve handling of misplaced html/head/body in HTML parser, better improve handling of misplaced html/head/body in HTML parser, better
regression test tools and code coverage display, better algorithms regression test tools and code coverage display, better algorithms
to detect various versions of the billion laughts attacks, make to detect various versions of the billion laughts attacks, make
@ -601,7 +1231,7 @@ Do not use or package 2.6.25
Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed), Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
some gcc4 fixes, HP-UX portability fixes (Rick Jones). some gcc4 fixes, HP-UX portability fixes (Rick Jones).
- bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and - bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
xmlreader stopping on non-fatal errors, thread support for dictionnaries xmlreader stopping on non-fatal errors, thread support for dictionaries
reference counting (Gary Coady), internal subset and push problem, URL reference counting (Gary Coady), internal subset and push problem, URL
saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
@ -614,7 +1244,7 @@ Do not use or package 2.6.25
Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug
(Rob Richards), Schemas decimal type fixes (William Brack), (Rob Richards), Schemas decimal type fixes (William Brack),
xmlByteConsumed static buffer (Ben Maurer). xmlByteConsumed static buffer (Ben Maurer).
- improvement: speedup parsing comments and DTDs, dictionnary support for - improvement: speedup parsing comments and DTDs, dictionary support for
hash tables, Schemas Identity constraints (Kasimier), streaming XPath hash tables, Schemas Identity constraints (Kasimier), streaming XPath
subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical
values handling (Kasimier), add xmlTextReaderByteConsumed (Aron values handling (Kasimier), add xmlTextReaderByteConsumed (Aron
@ -824,7 +1454,7 @@ Do not use or package 2.6.25
URI on SYSTEM lookup failure, XInclude parse flags inheritance (William), URI on SYSTEM lookup failure, XInclude parse flags inheritance (William),
XInclude and XPointer fixes for entities (William), XML parser bug XInclude and XPointer fixes for entities (William), XML parser bug
reported by Holger Rauch, nanohttp fd leak (William), regexps char reported by Holger Rauch, nanohttp fd leak (William), regexps char
groups '-' handling (William), dictionnary reference counting problems, groups '-' handling (William), dictionary reference counting problems,
do not close stderr. do not close stderr.
- performance patches from Petr Pajas - performance patches from Petr Pajas
- Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey) - Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)
@ -852,7 +1482,7 @@ Do not use or package 2.6.25
William) reported by Yuuichi Teranishi William) reported by Yuuichi Teranishi
- bugfixes: make test and path issues, xmlWriter attribute serialization - bugfixes: make test and path issues, xmlWriter attribute serialization
(William Brack), xmlWriter indentation (William), schemas validation (William Brack), xmlWriter indentation (William), schemas validation
(Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
Paraschenko), XInclude empty fallback (William), HTML warnings (William), Paraschenko), XInclude empty fallback (William), HTML warnings (William),
XPointer in XInclude (William), Python namespace serialization, XPointer in XInclude (William), Python namespace serialization,
isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
@ -873,7 +1503,7 @@ Do not use or package 2.6.25
2.6.5: Jan 25 2004: 2.6.5: Jan 25 2004:
- Bugfixes: dictionnaries for schemas (William Brack), regexp segfault - Bugfixes: dictionaries for schemas (William Brack), regexp segfault
(William), xs:all problem (William), a number of XPointer bugfixes (William), xs:all problem (William), a number of XPointer bugfixes
(William), xmllint error go to stderr, DTD validation problem with (William), xmllint error go to stderr, DTD validation problem with
namespace, memory leak (William), SAX1 cleanup and minimal options fixes namespace, memory leak (William), SAX1 cleanup and minimal options fixes
@ -885,14 +1515,14 @@ Do not use or package 2.6.25
Fleck), doc (Sven Zimmerman), I/O example. Fleck), doc (Sven Zimmerman), I/O example.
- Python bindings: fixes (William), enum support (Stéphane Bidoul), - Python bindings: fixes (William), enum support (Stéphane Bidoul),
structured error reporting (Stéphane Bidoul) structured error reporting (Stéphane Bidoul)
- XInclude: various fixes for conformance, problem related to dictionnary - XInclude: various fixes for conformance, problem related to dictionary
references (William & me), recursion (William) references (William & me), recursion (William)
- xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred - xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred
Mickautsch), Mickautsch),
- xmlSchemas: normalizedString datatype (John Belmonte) - xmlSchemas: normalizedString datatype (John Belmonte)
- code cleanup for strings functions (William) - code cleanup for strings functions (William)
- Windows: compiler patches (Mark Vakoc) - Windows: compiler patches (Mark Vakoc)
- Parser optimizations, a few new XPath and dictionnary APIs for future - Parser optimizations, a few new XPath and dictionary APIs for future
XSLT optimizations. XSLT optimizations.
@ -987,8 +1617,8 @@ Do not use or package 2.6.25
of change of change
- Increased the library modularity, far more options can be stripped out, - Increased the library modularity, far more options can be stripped out,
a --with-minimum configuration will weight around 160KBytes a --with-minimum configuration will weight around 160KBytes
- Use per parser and per document dictionnary, allocate names and small - Use per parser and per document dictionary, allocate names and small
text nodes from the dictionnary text nodes from the dictionary
- Switch to a SAX2 like parser rewrote most of the XML parser core, - Switch to a SAX2 like parser rewrote most of the XML parser core,
provides namespace resolution and defaulted attributes, minimize memory provides namespace resolution and defaulted attributes, minimize memory
allocations and copies, namespace checking and specific error handling, allocations and copies, namespace checking and specific error handling,
@ -1035,7 +1665,7 @@ Do not use or package 2.6.25
(William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
error handling. error handling.
- xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat - xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
testing, --nodict for building without tree dictionnary, --nocdata to testing, --nodict for building without tree dictionary, --nocdata to
replace CDATA by text, --nsclean to remove surperfluous namespace replace CDATA by text, --nsclean to remove surperfluous namespace
declarations declarations
- added xml2-config --libtool-libs option from Kevin P. Fleming - added xml2-config --libtool-libs option from Kevin P. Fleming
@ -1325,7 +1955,8 @@ http://www.w3.org/TR/xmlschema-2/
code, beware, all code, beware, all
interfaces are likely to change, there is huge holes, it is clearly a work in interfaces are likely to change, there is huge holes, it is clearly a work in
progress and don't even think of putting this code in a production system, progress and don't even think of putting this code in a production system,
it's actually not compiled in by default. The real fixes are: - a couple of bugs or limitations introduced in 2.4.20 it's actually not compiled in by default. The real fixes are:
- a couple of bugs or limitations introduced in 2.4.20
- patches for Borland C++ and MSC by Igor - patches for Borland C++ and MSC by Igor
- some fixes on XPath strings and conformance patches by Richard - some fixes on XPath strings and conformance patches by Richard
Jinks Jinks
@ -1567,7 +2198,8 @@ it's actually not compiled in by default. The real fixes are: - a couple of bu
2.3.9: May 19 2001: 2.3.9: May 19 2001:
Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #54891 and another patch from Jonas Borgström Lots of bugfixes, and added a basic SGML catalog support:
- HTML push bugfix #54891 and another patch from Jonas Borgstrom
- some serious speed optimization again - some serious speed optimization again
- some documentation cleanups - some documentation cleanups
- trying to get better linking on Solaris (-R) - trying to get better linking on Solaris (-R)
@ -1809,7 +2441,8 @@ Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #
about &#38; charref parsing about &#38; charref parsing
- 2.1.0 also ease the upgrade from libxml v1 to the recent version. it - 2.1.0 also ease the upgrade from libxml v1 to the recent version. it
also contains numerous fixes and enhancements: also contains numerous fixes and enhancements:
added xmlStopParser() to stop parsing
added xmlStopParser() to stop parsing
improved a lot parsing speed when there is large CDATA blocs improved a lot parsing speed when there is large CDATA blocs
includes XPath patches provided by Picdar Technology includes XPath patches provided by Picdar Technology
tried to fix as much as possible DTD validation and namespace tried to fix as much as possible DTD validation and namespace
@ -1817,6 +2450,7 @@ Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #
output to a given encoding has been added/tested output to a given encoding has been added/tested
lot of various fixes lot of various fixes
- added xmlStopParser() to stop parsing - added xmlStopParser() to stop parsing
- improved a lot parsing speed when there is large CDATA blocs - improved a lot parsing speed when there is large CDATA blocs
- includes XPath patches provided by Picdar Technology - includes XPath patches provided by Picdar Technology
@ -1865,7 +2499,8 @@ Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #
upgrade page upgrade page
- Some interfaces may changes (especially a bit about encoding). - Some interfaces may changes (especially a bit about encoding).
- the updates includes: - the updates includes:
fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now handled now
Better handling of entities, especially well-formedness checking Better handling of entities, especially well-formedness checking
and proper PEref extensions in external subsets and proper PEref extensions in external subsets
@ -1874,6 +2509,7 @@ Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #
change change
structures to accommodate DOM structures to accommodate DOM
- fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly - fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now handled now
- Better handling of entities, especially well-formedness checking - Better handling of entities, especially well-formedness checking

View File

@ -31,7 +31,7 @@ The list archive is at:
http://mail.gnome.org/archives/xml/ http://mail.gnome.org/archives/xml/
All technical answers asked privately will be automatically answered on All technical answers asked privately will be automatically answered on
the list and archived for public access unless pricacy is explicitely the list and archived for public access unless privacy is explicitly
required and justified. required and justified.
Daniel Veillard Daniel Veillard

View File

@ -14,17 +14,26 @@ program has a different testing purpose:
The command: The command:
make check
or
make -f Makefile.tests check make -f Makefile.tests check
should be sufficient on an Unix system to build and exercise the tests should be sufficient on an Unix system to build and exercise the tests
for the version of the library installed on the system. Note however for the version of the library installed on the system. Note however
that there isn't backward compatibility provided so if the installed that there isn't backward compatibility provided so if the installed
version is older to the testsuite one, failing to compile or run the tests version is older than the testsuite one, failing to compile or run the tests
is likely. In any event this won't work with an installed libxml2 older is likely. In any event this won't work with an installed libxml2 older
than 2.6.20. than 2.6.20.
Building on other platfroms should be a matter of compiling the C files
Building on other platforms should be a matter of compiling the C files
like any other program using libxml2, running the test should be done like any other program using libxml2, running the test should be done
simply by launching the resulting executables. simply by launching the resulting executables.
Also note the availability of a "make valgrind" target which will run the
above tests under valgrind to check for memory errors (but this relies
on the availability of the valgrind command and take far more time to
complete).
Daniel Veillard Daniel Veillard
Thu Jul 24 2008 Mon May 7 2012

View File

@ -45,7 +45,7 @@
*> values "system" and "public". I have made the default be "system" to *> values "system" and "public". I have made the default be "system" to
*> match yours. *> match yours.
*/ */
#define TODO \ #define TODO \
xmlGenericError(xmlGenericErrorContext, \ xmlGenericError(xmlGenericErrorContext, \
"Unimplemented block at %s:%d\n", \ "Unimplemented block at %s:%d\n", \
__FILE__, __LINE__); __FILE__, __LINE__);
@ -55,14 +55,31 @@
* @ctxt: an XML validation parser context * @ctxt: an XML validation parser context
* @msg: a string to accompany the error message * @msg: a string to accompany the error message
*/ */
static void static void LIBXML_ATTR_FORMAT(2,0)
xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) { xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
xmlStructuredErrorFunc schannel = NULL;
const char *str1 = "out of memory\n";
if (ctxt != NULL) { if (ctxt != NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->errNo = XML_ERR_NO_MEMORY;
ctxt->sax->error(ctxt->userData, "%s: out of memory\n", msg); if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC))
schannel = ctxt->sax->serror;
__xmlRaiseError(schannel,
ctxt->vctxt.error, ctxt->vctxt.userData,
ctxt, NULL, XML_FROM_PARSER, XML_ERR_NO_MEMORY,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
NULL, NULL, 0, 0,
msg, (const char *) str1, NULL);
ctxt->errNo = XML_ERR_NO_MEMORY; ctxt->errNo = XML_ERR_NO_MEMORY;
ctxt->instate = XML_PARSER_EOF; ctxt->instate = XML_PARSER_EOF;
ctxt->disableSAX = 1; ctxt->disableSAX = 1;
} else {
__xmlRaiseError(schannel,
NULL, NULL,
ctxt, NULL, XML_FROM_PARSER, XML_ERR_NO_MEMORY,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
NULL, NULL, 0, 0,
msg, (const char *) str1, NULL);
} }
} }
@ -76,7 +93,7 @@ xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
* *
* Handle a validation error * Handle a validation error
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const char *str1, const char *str2) const char *msg, const char *str1, const char *str2)
{ {
@ -116,7 +133,7 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
* *
* Handle a fatal parser error, i.e. violating Well-Formedness constraints * Handle a fatal parser error, i.e. violating Well-Formedness constraints
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1, const xmlChar *str2) const char *msg, const xmlChar *str1, const xmlChar *str2)
{ {
@ -147,7 +164,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
* *
* Handle a parser warning * Handle a parser warning
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1) const char *msg, const xmlChar *str1)
{ {
@ -172,7 +189,7 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
* *
* Handle a namespace error * Handle a namespace error
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1, const xmlChar *str2) const char *msg, const xmlChar *str1, const xmlChar *str2)
{ {
@ -196,7 +213,7 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
* *
* Handle a namespace warning * Handle a namespace warning
*/ */
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1, const xmlChar *str2) const char *msg, const xmlChar *str1, const xmlChar *str2)
{ {
@ -394,6 +411,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
xmlParserInputPtr input = NULL; xmlParserInputPtr input = NULL;
xmlCharEncoding enc; xmlCharEncoding enc;
int oldcharset; int oldcharset;
const xmlChar *oldencoding;
/* /*
* Ask the Entity resolver to load the damn thing * Ask the Entity resolver to load the damn thing
@ -415,6 +433,8 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
oldinputMax = ctxt->inputMax; oldinputMax = ctxt->inputMax;
oldinputTab = ctxt->inputTab; oldinputTab = ctxt->inputTab;
oldcharset = ctxt->charset; oldcharset = ctxt->charset;
oldencoding = ctxt->encoding;
ctxt->encoding = NULL;
ctxt->inputTab = (xmlParserInputPtr *) ctxt->inputTab = (xmlParserInputPtr *)
xmlMalloc(5 * sizeof(xmlParserInputPtr)); xmlMalloc(5 * sizeof(xmlParserInputPtr));
@ -425,6 +445,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
ctxt->inputMax = oldinputMax; ctxt->inputMax = oldinputMax;
ctxt->inputTab = oldinputTab; ctxt->inputTab = oldinputTab;
ctxt->charset = oldcharset; ctxt->charset = oldcharset;
ctxt->encoding = oldencoding;
return; return;
} }
ctxt->inputNr = 0; ctxt->inputNr = 0;
@ -470,6 +491,11 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
ctxt->inputMax = oldinputMax; ctxt->inputMax = oldinputMax;
ctxt->inputTab = oldinputTab; ctxt->inputTab = oldinputTab;
ctxt->charset = oldcharset; ctxt->charset = oldcharset;
if ((ctxt->encoding != NULL) &&
((ctxt->dict == NULL) ||
(!xmlDictOwns(ctxt->dict, ctxt->encoding))))
xmlFree((xmlChar *) ctxt->encoding);
ctxt->encoding = oldencoding;
/* ctxt->wellFormed = oldwellFormed; */ /* ctxt->wellFormed = oldwellFormed; */
} }
} }
@ -574,6 +600,7 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
* parse the external entity * parse the external entity
*/ */
xmlNodePtr children; xmlNodePtr children;
unsigned long oldnbent = ctxt->nbentities;
val = xmlParseCtxtExternalEntity(ctxt, ret->URI, val = xmlParseCtxtExternalEntity(ctxt, ret->URI,
ret->ExternalID, &children); ret->ExternalID, &children);
@ -586,8 +613,11 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
return(NULL); return(NULL);
} }
ret->owner = 1; ret->owner = 1;
if (ret->checked == 0) if (ret->checked == 0) {
ret->checked = 1; ret->checked = (ctxt->nbentities - oldnbent + 1) * 2;
if ((ret->content != NULL) && (xmlStrchr(ret->content, '<')))
ret->checked |= 1;
}
} }
return(ret); return(ret);
} }
@ -964,12 +994,12 @@ xmlSAX2StartDocument(void *ctx)
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
if (ctxt->myDoc == NULL) if (ctxt->myDoc == NULL)
ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
ctxt->myDoc->properties = XML_DOC_HTML;
ctxt->myDoc->parseFlags = ctxt->options;
if (ctxt->myDoc == NULL) { if (ctxt->myDoc == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument"); xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
return; return;
} }
ctxt->myDoc->properties = XML_DOC_HTML;
ctxt->myDoc->parseFlags = ctxt->options;
#else #else
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"libxml2 built without HTML support\n"); "libxml2 built without HTML support\n");
@ -1048,7 +1078,7 @@ xmlSAX2EndDocument(void *ctx)
} }
} }
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
/** /**
* xmlSAX2AttributeInternal: * xmlSAX2AttributeInternal:
* @ctx: the user data (XML parser context) * @ctx: the user data (XML parser context)
@ -1147,6 +1177,12 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF, val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF,
0,0,0); 0,0,0);
ctxt->depth--; ctxt->depth--;
if (val == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElement");
if (name != NULL)
xmlFree(name);
return;
}
} else { } else {
val = (xmlChar *) value; val = (xmlChar *) value;
} }
@ -1756,7 +1792,6 @@ void
xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
{ {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserNodeInfo node_info;
xmlNodePtr cur; xmlNodePtr cur;
if (ctx == NULL) return; if (ctx == NULL) return;
@ -1770,10 +1805,10 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
/* Capture end position and add node */ /* Capture end position and add node */
if (cur != NULL && ctxt->record_info) { if (cur != NULL && ctxt->record_info) {
node_info.end_pos = ctxt->input->cur - ctxt->input->base; ctxt->nodeInfo->end_pos = ctxt->input->cur - ctxt->input->base;
node_info.end_line = ctxt->input->line; ctxt->nodeInfo->end_line = ctxt->input->line;
node_info.node = cur; ctxt->nodeInfo->node = cur;
xmlParserAddNodeInfo(ctxt, &node_info); xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
} }
ctxt->nodemem = -1; ctxt->nodemem = -1;
@ -1793,7 +1828,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
#endif #endif
nodePop(ctxt); nodePop(ctxt);
} }
#endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLE */ #endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLED || LIBXML_LEGACY_ENABLED */
/* /*
* xmlSAX2TextNode: * xmlSAX2TextNode:
@ -1801,7 +1836,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
* @str: the input string * @str: the input string
* @len: the string length * @len: the string length
* *
* Remove the entities from an attribute value * Callback for a text node
* *
* Returns the newly allocated string or NULL if not needed or error * Returns the newly allocated string or NULL if not needed or error
*/ */
@ -1834,7 +1869,7 @@ xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
if ((len < (int) (2 * sizeof(void *))) && if ((len < (int) (2 * sizeof(void *))) &&
(ctxt->options & XML_PARSE_COMPACT)) { (ctxt->options & XML_PARSE_COMPACT)) {
/* store the string in the node overrithing properties and nsDef */ /* store the string in the node overriding properties and nsDef */
xmlChar *tmp = (xmlChar *) &(ret->properties); xmlChar *tmp = (xmlChar *) &(ret->properties);
memcpy(tmp, str, len); memcpy(tmp, str, len);
tmp[len] = 0; tmp[len] = 0;
@ -1866,8 +1901,17 @@ skip:
} else } else
ret->content = (xmlChar *) intern; ret->content = (xmlChar *) intern;
if (ctxt->input != NULL) if (ctxt->linenumbers) {
ret->line = ctxt->input->line; if (ctxt->input != NULL) {
if (ctxt->input->line < 65535)
ret->line = (short) ctxt->input->line;
else {
ret->line = 65535;
if (ctxt->options & XML_PARSE_BIG_LINES)
ret->psvi = (void *) (long) ctxt->input->line;
}
}
}
if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue)) if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
xmlRegisterNodeDefaultValue(ret); xmlRegisterNodeDefaultValue(ret);
@ -2107,12 +2151,14 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
*/ */
if (dup == NULL) if (dup == NULL)
dup = xmlStrndup(value, valueend - value); dup = xmlStrndup(value, valueend - value);
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef LIBXML_VALID_ENABLED #ifdef LIBXML_VALID_ENABLED
if (xmlValidateNCName(dup, 1) != 0) { if (xmlValidateNCName(dup, 1) != 0) {
xmlErrValid(ctxt, XML_DTD_XMLID_VALUE, xmlErrValid(ctxt, XML_DTD_XMLID_VALUE,
"xml:id : attribute value %s is not an NCName\n", "xml:id : attribute value %s is not an NCName\n",
(const char *) dup, NULL); (const char *) dup, NULL);
} }
#endif
#endif #endif
xmlAddID(&ctxt->vctxt, ctxt->myDoc, dup, ret); xmlAddID(&ctxt->vctxt, ctxt->myDoc, dup, ret);
} else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) { } else if (xmlIsID(ctxt->myDoc, ctxt->node, ret)) {
@ -2163,6 +2209,7 @@ xmlSAX2StartElementNs(void *ctx,
xmlNodePtr parent; xmlNodePtr parent;
xmlNsPtr last = NULL, ns; xmlNsPtr last = NULL, ns;
const xmlChar *uri, *pref; const xmlChar *uri, *pref;
xmlChar *lname = NULL;
int i, j; int i, j;
if (ctx == NULL) return; if (ctx == NULL) return;
@ -2176,11 +2223,25 @@ xmlSAX2StartElementNs(void *ctx,
(ctxt->myDoc->intSubset->elements == NULL) && (ctxt->myDoc->intSubset->elements == NULL) &&
(ctxt->myDoc->intSubset->attributes == NULL) && (ctxt->myDoc->intSubset->attributes == NULL) &&
(ctxt->myDoc->intSubset->entities == NULL)))) { (ctxt->myDoc->intSubset->entities == NULL)))) {
xmlErrValid(ctxt, XML_ERR_NO_DTD, xmlErrValid(ctxt, XML_DTD_NO_DTD,
"Validation failed: no DTD found !", NULL, NULL); "Validation failed: no DTD found !", NULL, NULL);
ctxt->validate = 0; ctxt->validate = 0;
} }
/*
* Take care of the rare case of an undefined namespace prefix
*/
if ((prefix != NULL) && (URI == NULL)) {
if (ctxt->dictNames) {
const xmlChar *fullname;
fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
if (fullname != NULL)
localname = fullname;
} else {
lname = xmlBuildQName(localname, prefix, NULL, 0);
}
}
/* /*
* allocate the node * allocate the node
*/ */
@ -2194,7 +2255,10 @@ xmlSAX2StartElementNs(void *ctx,
if (ctxt->dictNames) if (ctxt->dictNames)
ret->name = localname; ret->name = localname;
else { else {
ret->name = xmlStrdup(localname); if (lname == NULL)
ret->name = xmlStrdup(localname);
else
ret->name = lname;
if (ret->name == NULL) { if (ret->name == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
return; return;
@ -2206,8 +2270,11 @@ xmlSAX2StartElementNs(void *ctx,
if (ctxt->dictNames) if (ctxt->dictNames)
ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
(xmlChar *) localname, NULL); (xmlChar *) localname, NULL);
else else if (lname == NULL)
ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL); ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
else
ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
(xmlChar *) lname, NULL);
if (ret == NULL) { if (ret == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
return; return;
@ -2222,7 +2289,7 @@ xmlSAX2StartElementNs(void *ctx,
} }
} }
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { if (parent == NULL) {
xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret); xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret);
} }
/* /*
@ -2242,8 +2309,12 @@ xmlSAX2StartElementNs(void *ctx,
if ((URI != NULL) && (prefix == pref)) if ((URI != NULL) && (prefix == pref))
ret->ns = ns; ret->ns = ns;
} else { } else {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs"); /*
return; * any out of memory error would already have been raised
* but we can't be garanteed it's the actual error due to the
* API, best is to skip in this case
*/
continue;
} }
#ifdef LIBXML_VALID_ENABLED #ifdef LIBXML_VALID_ENABLED
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed && if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
@ -2310,8 +2381,33 @@ xmlSAX2StartElementNs(void *ctx,
*/ */
if (nb_attributes > 0) { if (nb_attributes > 0) {
for (j = 0,i = 0;i < nb_attributes;i++,j+=5) { for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
/*
* Handle the rare case of an undefined atribute prefix
*/
if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
if (ctxt->dictNames) {
const xmlChar *fullname;
fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
attributes[j]);
if (fullname != NULL) {
xmlSAX2AttributeNs(ctxt, fullname, NULL,
attributes[j+3], attributes[j+4]);
continue;
}
} else {
lname = xmlBuildQName(attributes[j], attributes[j+1],
NULL, 0);
if (lname != NULL) {
xmlSAX2AttributeNs(ctxt, lname, NULL,
attributes[j+3], attributes[j+4]);
xmlFree(lname);
continue;
}
}
}
xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1], xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
attributes[j+3], attributes[j+4]); attributes[j+3], attributes[j+4]);
} }
} }
@ -2482,6 +2578,10 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
(xmlDictOwns(ctxt->dict, lastChild->content))) { (xmlDictOwns(ctxt->dict, lastChild->content))) {
lastChild->content = xmlStrdup(lastChild->content); lastChild->content = xmlStrdup(lastChild->content);
} }
if (lastChild->content == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: xmlStrdup returned NULL");
return;
}
if (((size_t)ctxt->nodelen + (size_t)len > XML_MAX_TEXT_LENGTH) && if (((size_t)ctxt->nodelen + (size_t)len > XML_MAX_TEXT_LENGTH) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) { ((ctxt->options & XML_PARSE_HUGE) == 0)) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: huge text node"); xmlSAX2ErrMemory(ctxt, "xmlSAX2Characters: huge text node");
@ -2591,7 +2691,7 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
xmlAddChild((xmlNodePtr) ctxt->myDoc->extSubset, ret); xmlAddChild((xmlNodePtr) ctxt->myDoc->extSubset, ret);
return; return;
} }
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { if (parent == NULL) {
#ifdef DEBUG_SAX_TREE #ifdef DEBUG_SAX_TREE
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Setting PI %s as root\n", target); "Setting PI %s as root\n", target);
@ -2652,7 +2752,7 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
xmlAddChild((xmlNodePtr) ctxt->myDoc->extSubset, ret); xmlAddChild((xmlNodePtr) ctxt->myDoc->extSubset, ret);
return; return;
} }
if ((ctxt->myDoc->children == NULL) || (parent == NULL)) { if (parent == NULL) {
#ifdef DEBUG_SAX_TREE #ifdef DEBUG_SAX_TREE
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Setting xmlSAX2Comment as root\n"); "Setting xmlSAX2Comment as root\n");

View File

@ -2,8 +2,8 @@ dnl Like AC_TRY_EVAL but also errors out if the compiler generates
dnl _any_ output. Some compilers might issue warnings which we want dnl _any_ output. Some compilers might issue warnings which we want
dnl to catch. dnl to catch.
AC_DEFUN([AC_TRY_EVAL2], AC_DEFUN([AC_TRY_EVAL2],
[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl [{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl
(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) (eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
AC_DEFUN([AC_TRY_COMPILE2], AC_DEFUN([AC_TRY_COMPILE2],
@ -19,8 +19,8 @@ if AC_TRY_EVAL2(ac_compile); then
ifelse([$3], , :, [rm -rf conftest* ifelse([$3], , :, [rm -rf conftest*
$3]) $3])
else else
echo "configure: failed program was:" >&AC_FD_CC echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&AC_FD_CC cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
ifelse([$4], , , [ rm -rf conftest* ifelse([$4], , , [ rm -rf conftest*
$4 $4
])dnl ])dnl

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<bakefile-gen>
<disable-formats>gnu,dmars,cbx_unix,cbuilderx</disable-formats>
<input>libxml2.bkl</input>
<!-- List of output formats to generate: -->
<add-formats>
borland,dmars,mingw,msvc,msvc6prj,watcom,cbuilderx,cbx_unix,gnu
</add-formats>
</bakefile-gen>

View File

@ -0,0 +1,92 @@
LIBXML2 build system for Win32 README
-------------------------------------
In this folder are stored all the files required to compile LIBXML2 with win32 compilers.
Bakefile (http://bakefile.sourceforge.net) is used as makefile generator.
Supported makefiles:
- makefile.vc for Microsoft NMAKE
- makefile.bcc for Borland MAKE
- makefile.wat for OpenWatcom MAKE
- makefile.gcc for MinGW MINGW32-MAKE
- all DSP & DSW for Microsoft VisualC++ 6.0 (can be used also with VS.NET AFAIK)
This readme is organized as:
1.0 HOWTO compile LIBXML2 using makefiles <-- for users who want to build the library using *command-line*
1.1 HOWTO compile LIBXML2 using an IDE <-- for users who want to build the library using an *IDE*
1.2 HOWTO regenerate makefiles for LIBXML2 <-- for libxml2 mantainers/developers/advanced users
If you just want to compile the library (and the test programs) you should definitely avoid the
section 1.1 and focus on the 1.0.
1.0 HOWTO compile LIBXML2 using makefiles
-----------------------------------------
Choose your preferred compiler among those actually supported (see above) and then run
mycompilermake -fmakefile.makefileext [options]
for a full list of the available options you should open with a notepad (or something like that)
the makefile you want to use; at the beginning you should see a section which starts as:
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
here you can find all the options actually used by that makefile.
They can be customized when running the makefile writing something like:
nmake -fmakefile.vc BUILD=release
mingw32-make -fmakefile.gcc BUILD=debug ICONV_DIR=c:\myiconv
or they can be permanently changed modifying the makefile.
That's all: for any problem/compile-error/suggestion, write to
frm@users.sourceforge.net with the word "libxml2" in the subject.
1.1 HOWTO compile LIBXML2 using an IDE
--------------------------------------
Actually only the Microsoft VisualC++ 6.0 project files are generated.
In future other Integrated Development Environments (IDEs) will be supported as well.
With MSVC++ 6.0, you should open the DSW file and then set as the active project the
"libxml2" project, if you want to build the library or one of the test projects if you
want to run them.
Using the command "Build->Set Active Configuration" you can choose one of the predefined
configuration.
1.2 HOWTO regenerate makefiles for LIBXML2
------------------------------------------
Be sure to have installed Bakefile (http://bakefile.sourceforge.net).
Just run the "bakefile_gen" command inside the folder containing the "libxml2.bkl" file.
NOTE: if you want to remove all the makefiles, you can use the "bakefile_gen -c" command.
The template files used to generate all makefiles are only two:
- libxml2.bkl (the main one)
- Bakefiles.bkgen
All the other files can be dinamically regenerated.
If you have problems with the compilation of LIBXML2 under windows (using one of the supported compiler)
please write to:
Francesco Montorsi <frm@users.sourceforge.net>

View File

@ -0,0 +1,749 @@
<?xml version="1.0" ?>
<!-- Author: Francesco Montorsi <frm@users.sourceforge.net> -->
<!-- Date: 30/8/2004 -->
<!-- Last revision: 26/1/2005 -->
<!-- LIBXML2 BAKEFILE -->
<!-- -->
<!-- The bakefile used to build the library and the test -->
<!-- programs. The makefiles output is put: -->
<!-- -->
<!-- - in the ..\LIB folder -->
<!-- - in the ..\BIN folder -->
<!-- -->
<makefile>
<using module="datafiles"/>
<requires version="0.1.5"/>
<!-- This is a bakefile, that is, a generic template used to -->
<!-- generate makefiles ALL supported compilers. -->
<!-- To use this project file you need Bakefile installed. -->
<!-- With the command "bakefile_gen" you can regen all the -->
<!-- makefiles and project files. -->
<!-- See http://bakefile.sourceforge.net for more info. -->
<!--
This file is divided in:
- generic options
- generic variables
- libxml2 options
- libxml2 variables
- about config.h creation
- templates
- libxml2 library target
- libxml2 test program targets
-->
<!-- -->
<!-- GENERIC OPTIONS -->
<!-- -->
<!-- This is a standard option that determines -->
<!-- whether the user wants to build this library as -->
<!-- a dll or as a static library. -->
<option name="SHARED">
<values>0,1</values>
<values-description>,DLL</values-description>
<default-value>0</default-value>
<description>If set to zero a STATIC libxml library will be built</description>
</option>
<!-- Configuration for building the bakefile with -->
<!-- unicode strings or not (unicode or ansi). -->
<option name="UNICODE">
<values>0,1</values>
<values-description>,Unicode</values-description>
<default-value>0</default-value>
<description>Compile Unicode build?</description>
</option>
<!-- There are several options that deal with build -->
<!-- types. First, there's this one, BUILD. -->
<!-- -->
<!-- BUILD determines whether or not we want to build -->
<!-- in release or debug mode. Note that in practice -->
<!-- this means modifying the optimize tag, which by -->
<!-- default is set to off. In this case debug means -->
<!-- off (no optimizations), and release means speed -->
<!-- (fast with inlining). There is also a size option -->
<!-- that is not addressed in this example bakefile. -->
<option name="BUILD">
<values>debug,release</values>
<values-description>Debug,Release</values-description>
<default-value>release</default-value>
<description>
Type of compiled binaries
</description>
</option>
<!-- -->
<!-- GENERIC VARIABLES -->
<!-- -->
<!-- Set the ISDLL variable, so that we can use it -->
<!-- inside an if statement later on (options not -->
<!-- allowed in if statements). -->
<set var="ISDLL" cond="SHARED=='1'">1</set>
<set var="ISDLL" cond="SHARED=='0'">0</set>
<!-- The unicode define we want. By default bakefile -->
<!-- makes variables an empty string, so if unicode -->
<!-- is not defined $(UNICODE_DEFINE) would expand -->
<!-- to nothing (literally). -->
<set var="UNICODE_DEFINE">
<if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
</set>
<!-- The debug define we need with win32 compilers -->
<!-- (on Linux, the wx-config program is used). -->
<set var="DEBUG_DEFINE">
<if cond="FORMAT!='autoconf' and BUILD=='debug'">
__WXDEBUG__
</if>
</set>
<!-- Value we will use later on for the debug-info -->
<!-- tag inside our templates. -->
<set var="DEBUGINFO">
<if cond="BUILD=='debug'">on</if>
<if cond="BUILD=='release'">off</if>
</set>
<!-- Value we will use later on for the debug-runtime -->
<!-- tag inside our templates. -->
<set var="DEBUGRUNTIME">
<if cond="BUILD=='debug'">on</if>
<if cond="BUILD=='release'">off</if>
</set>
<!-- Value for optimize tag. -->
<set var="OPTIMIZEFLAG">
<if cond="BUILD=='debug'">off</if>
<if cond="BUILD=='release'">speed</if>
</set>
<!-- Level of warnings. Here we max it out in debug -->
<!-- mode, and turn them off in release mode. -->
<set var="WARNINGS">
<if cond="BUILD=='debug'">max</if>
<if cond="BUILD=='release'">no</if>
</set>
<!-- Set MYCPPFLAGS as empty; maybe it will be filled later... -->
<set var="MYCPPFLAGS"></set>
<if cond="FORMAT=='mingw' or FORMAT=='autoconf'">
<!-- With GCC, settings warnings to MAX would force -->
<!-- Bakefile to call GCC with "-W -Wall" which generates -->
<!-- a *lot* of warnings about wxWidgets headers... -->
<!-- this is why "-W -Wall" is here replaced by "-Wall". -->
<set var="WARNINGS">default</set>
<set var="MYCPPFLAGS">-Wall</set>
</if>
<!-- -->
<!-- LIBXML2 OPTIONS -->
<!-- -->
<!-- Note #1: not all of them are used by win32 makefiles -->
<!-- -->
<!-- Note #2: since all combinations of non-path options are -->
<!-- translated into different 'configurations' by -->
<!-- Bakefile when using the MSVC6PRJ output, we must -->
<!-- avoid to create a 10 MB libxml2.dsp file forcing -->
<!-- some options to their default values... this -->
<!-- behaviour can be overridden by the -->
<!-- FULL_OPTIONS_SUPPORT -->
<!-- variable defined below... -->
<set var="FULL_OPTIONS_SUPPORT">
<if cond="FORMAT=='msvc6prj'">0</if>
<if cond="FORMAT!='msvc6prj'">1</if>
</set>
<option name="ICONV_DIR" category="path">
<default-value>c:\iconv</default-value>
<description>The iconv library main folder</description>
</option>
<option name="WITH_TRIO">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable TRIO string manipulator</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_THREADS">native</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_THREADS">
<values>no,ctls,native,posix</values>
<default-value>native</default-value>
<description>Enable thread safety</description>
</option>
</if>
<option name="WITH_FTP">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable FTP client</description>
</option>
<option name="WITH_HTTP">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable HTTP client</description>
</option>
<option name="WITH_C14N">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable C14N support</description>
</option>
<option name="WITH_CATALOG">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable catalog support</description>
</option>
<option name="WITH_DOCB">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable DocBook support</description>
</option>
<option name="WITH_XPATH">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XPath support</description>
</option>
<option name="WITH_XPTR">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XPointer support</description>
</option>
<option name="WITH_XINCLUDE">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XInclude support</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_ICONV">1</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_ICONV">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable iconv support</description>
</option>
</if>
<option name="WITH_ISO8859X">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable iso8859x support</description>
</option>
<!-- see the note #2 -->
<if cond="FULL_OPTIONS_SUPPORT=='0'">
<set var="WITH_ZLIB">0</set>
</if>
<if cond="FULL_OPTIONS_SUPPORT=='1'">
<option name="WITH_ZLIB">
<values>0,1</values>
<default-value>0</default-value>
<description>Enable ZLIB support</description>
</option>
</if>
<option name="WITH_REGEXPS">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable regular expressions</description>
</option>
<option name="WITH_TREE">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable tree api</description>
</option>
<option name="WITH_READER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlReader api</description>
</option>
<option name="WITH_WRITER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlWriter api</description>
</option>
<option name="WITH_WALKER">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlDocWalker api</description>
</option>
<option name="WITH_PATTERN">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable xmlPattern api</description>
</option>
<option name="WITH_PUSH">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable push api</description>
</option>
<option name="WITH_VALID">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable DTD validation support</description>
</option>
<option name="WITH_SAX1">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable SAX1 api</description>
</option>
<option name="WITH_SCHEMAS">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable XML Schema support</description>
</option>
<option name="WITH_LEGACY">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable deprecated APIs</description>
</option>
<option name="WITH_OUTPUT">
<values>0,1</values>
<default-value>1</default-value>
<description>Enable serialization support</description>
</option>
<option name="WITH_PYTHON">
<values>0,1</values>
<default-value>0</default-value>
<description>Build Python bindings</description>
</option>
<!-- -->
<!-- LIBXML2 VARIABLES -->
<!-- -->
<!-- Put all the objects files generated by -->
<!-- the compilation in a subfolder of BUILD -->
<set var="BUILDDIR">$(FORMAT)</set>
<!-- This variable is set to 1 when the current output writer supports -->
<!-- the __DEFINE_ARG variable. Otherwise it's set to zero. -->
<set var="HAS_DEFINE_ARG">
<if cond="FORMAT!='msvc6prj'">1</if>
<if cond="FORMAT=='msvc6prj'">0</if>
</set>
<!-- The root directory of libxml2 -->
<set var="XMLBASEDIR">..</set>
<!-- The directory where libxml2' tests will be put -->
<set var="XMLTESTDIR">$(XMLBASEDIR)$(DIRSEP)bin</set>
<set var="LIBXML_MAJOR_VERSION">2</set>
<set var="LIBXML_MINOR_VERSION">6</set>
<set var="LIBXML_MICRO_VERSION">16</set>
<!-- some defines related to threads -->
<set var="THREADS_DEF">
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='native'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS
</if>
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='ctls'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS $(__DEFINE_ARG)HAVE_COMPILER_TLS
</if>
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='posix'">
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_PTHREAD_H
</if>
</set>
<if cond="FORMAT=='borland'">
<set var="THREADS_DEF">
<if cond="WITH_THREADS=='native'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
<if cond="WITH_THREADS=='ctls'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
<if cond="WITH_THREADS=='posix'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
</set>
</if>
<!-- some other conditional defines -->
<set var="ZLIB_DEF"><if cond="WITH_ZLIB=='1'">HAVE_ZLIB_H</if></set>
<set var="DEBUG_DEF"><if cond="BUILD=='debug'">_DEBUG</if></set>
<set var="DEBUG_DEF"><if cond="BUILD=='release'">NDEBUG</if></set>
<!-- this is very very important when compiling with MINGW: without this line,
the test programs (and all the programs built with libxml2 which use xmlFree)
won't build because of "undefined references to __xmlFree" -->
<set var="STATIC_DEF"><if cond="SHARED=='0'">LIBXML_STATIC</if></set>
<!-- some conditional libraries dependencies -->
<set var="ICONV_LIB"><if cond="WITH_ICONV=='1'">iconv</if></set>
<set var="WSOCK32_LIB"><if cond="WITH_THREADS=='native'">wsock32</if></set>
<set var="ZLIB_LIB"><if cond="WITH_ZLIB=='1'">zdll</if></set>
<set var="POSIX_LIB"><if cond="WITH_THREADS=='posix'">pthreadVC</if></set>
<set var="XMLINCLUDEDIR">$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)libxml$(DIRSEP)</set>
<!-- -->
<!-- ABOUT CONFIG.H HEADER CREATION -->
<!-- -->
<set var="CONFIG_SRCNAME">win32config.h</set>
<set var="CONFIG_DSTNAME">config.h</set>
<if cond="FORMAT!='msvc6prj' and FORMAT!='autoconf' and FORMAT!='gnu'">
<copy-file-to-file id="setup">
<!-- On win32 we need to manually copy a default config.h file -->
<!-- from the include/mc/msw folder to include/mc -->
<src>../include/$(CONFIG_SRCNAME)</src>
<dst>../$(CONFIG_DSTNAME)</dst>
<dependency-of>all</dependency-of>
<!-- With autoconf, we will use the configure script to translate -->
<!-- include/mc/config.h.in to include/mc/config.h and thus we do -->
<!-- not need to do anything here... -->
</copy-file-to-file>
</if>
<if cond="FORMAT!='msvc6prj'">
<mkdir id="setuplibdir"><dir>$(XMLBASEDIR)$(DIRSEP)lib</dir></mkdir>
<mkdir id="setupbindir"><dir>$(XMLBASEDIR)$(DIRSEP)bin</dir></mkdir>
<!-- Creates all output folders -->
<phony id="setupdirs">
<dependency-of>all</dependency-of>
<depends>setuplibdir</depends>
<depends>setupbindir</depends>
</phony>
</if>
<!-- This defines a tag which includes headers on MSVC -->
<!-- Note that $(value) is stuck in there by bakefile, -->
<!-- and is the value between the beginning and end tag. -->
<define-tag name="headers" rules="dll,lib,exe">
<if cond="FORMAT=='msvc6prj'">
<msvc-project-files>
$(value)
</msvc-project-files>
</if>
</define-tag>
<!-- Creates the following custom build rule for MSVC6PRJ file:
copies ..\include\win32config.h into ..\config.h
NOTE: this tag must be used before the <sources> tag if you want that the configuration
file will be created before any other source file is compiled... -->
<define-tag name="msvc-copy-setup-h" rules="dll,lib,action">
<if cond="FORMAT=='msvc6prj'">
<headers>$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</headers>
<set var="__subdir">$(value)</set>
<set var="_custom_build_files" append="1">$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</set>
<set var="_custom_build____include_win32config_h">
Creating the configuration file ..\$(CONFIG_DSTNAME) from ..\include\$(CONFIG_SRCNAME)
InputPath=..\include\$(CONFIG_SRCNAME)
"..\$(CONFIG_DSTNAME)" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
$(TAB)copy "$(DOLLAR)(InputPath)" ..\$(CONFIG_DSTNAME)
</set>
</if>
</define-tag>
<!-- -->
<!-- TEMPLATES -->
<!-- -->
<!-- The basic template: used by all the targets -->
<template id="base">
<if cond="FORMAT=='mingw'">
<define>HAVE_W32API_H</define>
<ldflags>-mthreads</ldflags>
</if>
<cxxflags>$(MYCPPFLAGS)</cxxflags>
<warnings>$(WARNINGS)</warnings>
<define>$(UNICODE_DEFINE)</define>
<optimize>$(OPTIMIZEFLAG)</optimize>
<debug-info>$(DEBUGINFO)</debug-info>
<debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
</template>
<!-- The template used both by the library and by the test programs -->
<template id="xml2" template="base">
<!-- -I & -L equivalents -->
<include>$(XMLBASEDIR)$(DIRSEP)include</include>
<include>$(ICONV_DIR)$(DIRSEP)include</include>
<lib-path>$(ICONV_DIR)$(DIRSEP)lib</lib-path>
<!-- some conditional define flags -->
<cflags>$(THREADS_DEF)</cflags>
<define>$(ZLIB_DEF)</define>
<define>$(DEBUG_DEF)</define>
<define>$(STATIC_DEF)</define>
<if cond="HAS_DEFINE_ARG=='0'">
<!-- we are probably using an IDE output: defaults to WITH_THREADS=='native' -->
<define>_REENTRANT</define>
<define>HAVE_WIN32_THREADS</define>
</if>
<!-- these must always be defined on win32 -->
<define>WIN32</define>
<define>_WINDOWS</define>
<define>_MBCS</define>
<if cond="FORMAT=='borland'">
<define>_NO_VCL</define>
<define>EILSEQ=2</define>
</if>
</template>
<!-- The template used by libxml2 test programs -->
<template id="xml2test" template="xml2">
<dirname>$(XMLTESTDIR)</dirname>
<app-type>console</app-type>
<library>libxml2</library>
<sys-lib>$(ICONV_LIB)</sys-lib>
<sys-lib>$(WSOCK32_LIB)</sys-lib>
<sys-lib>$(ZLIB_LIB)</sys-lib>
<sys-lib>$(POSIX_LIB)</sys-lib>
</template>
<!-- -->
<!-- LIBXML2 LIBRARY TARGET -->
<!-- -->
<lib id="libxml2" template="xml2">
<!-- this is useful only when using MSVC6PRJ -->
<if cond="FORMAT=='msvc6prj'">
<msvc-copy-setup-h/>
<msvc-file-group>Config headers:*config.h</msvc-file-group>
</if>
<if cond="FORMAT!='msvc6prj'">
<depends>setup</depends>
<depends>setuplibdir</depends>
</if>
<!-- output folder -->
<dirname>$(XMLBASEDIR)$(DIRSEP)lib</dirname>
<!-- The output name must be "libxml2.lib" with all compilers.
Since mingw format autoadds the "lib" prefix to the library
name, we must intercept that case to avoid to get "liblibxml2.a" -->
<if cond="FORMAT!='mingw'">
<libname>libxml2</libname>
</if>
<if cond="FORMAT=='mingw'">
<libname>xml2</libname>
</if>
<!-- the list of source files to compile -->
<sources>
$(XMLBASEDIR)$(DIRSEP)c14n.c
$(XMLBASEDIR)$(DIRSEP)catalog.c
$(XMLBASEDIR)$(DIRSEP)chvalid.c
$(XMLBASEDIR)$(DIRSEP)debugXML.c
$(XMLBASEDIR)$(DIRSEP)dict.c
$(XMLBASEDIR)$(DIRSEP)DOCBparser.c
$(XMLBASEDIR)$(DIRSEP)encoding.c
$(XMLBASEDIR)$(DIRSEP)entities.c
$(XMLBASEDIR)$(DIRSEP)error.c
$(XMLBASEDIR)$(DIRSEP)globals.c
$(XMLBASEDIR)$(DIRSEP)hash.c
$(XMLBASEDIR)$(DIRSEP)HTMLparser.c
$(XMLBASEDIR)$(DIRSEP)HTMLtree.c
$(XMLBASEDIR)$(DIRSEP)legacy.c
$(XMLBASEDIR)$(DIRSEP)list.c
$(XMLBASEDIR)$(DIRSEP)nanoftp.c
$(XMLBASEDIR)$(DIRSEP)nanohttp.c
$(XMLBASEDIR)$(DIRSEP)parser.c
$(XMLBASEDIR)$(DIRSEP)parserInternals.c
$(XMLBASEDIR)$(DIRSEP)pattern.c
$(XMLBASEDIR)$(DIRSEP)relaxng.c
$(XMLBASEDIR)$(DIRSEP)SAX2.c
$(XMLBASEDIR)$(DIRSEP)SAX.c
$(XMLBASEDIR)$(DIRSEP)threads.c
$(XMLBASEDIR)$(DIRSEP)tree.c
$(XMLBASEDIR)$(DIRSEP)uri.c
$(XMLBASEDIR)$(DIRSEP)valid.c
$(XMLBASEDIR)$(DIRSEP)xinclude.c
$(XMLBASEDIR)$(DIRSEP)xlink.c
$(XMLBASEDIR)$(DIRSEP)xmlIO.c
$(XMLBASEDIR)$(DIRSEP)xmlmemory.c
$(XMLBASEDIR)$(DIRSEP)xmlreader.c
$(XMLBASEDIR)$(DIRSEP)xmlregexp.c
$(XMLBASEDIR)$(DIRSEP)xmlsave.c
$(XMLBASEDIR)$(DIRSEP)xmlschemas.c
$(XMLBASEDIR)$(DIRSEP)xmlschemastypes.c
$(XMLBASEDIR)$(DIRSEP)xmlunicode.c
$(XMLBASEDIR)$(DIRSEP)xmlwriter.c
$(XMLBASEDIR)$(DIRSEP)xpath.c
$(XMLBASEDIR)$(DIRSEP)xpointer.c
$(XMLBASEDIR)$(DIRSEP)xmlstring.c
</sources>
<!-- the list of header files (for IDE projects) -->
<headers>
$(XMLINCLUDEDIR)c14n.h
$(XMLINCLUDEDIR)catalog.h
$(XMLINCLUDEDIR)chvalid.h
$(XMLINCLUDEDIR)debugXML.h
$(XMLINCLUDEDIR)dict.h
$(XMLINCLUDEDIR)DOCBparser.h
$(XMLINCLUDEDIR)encoding.h
$(XMLINCLUDEDIR)entities.h
$(XMLINCLUDEDIR)globals.h
$(XMLINCLUDEDIR)hash.h
$(XMLINCLUDEDIR)HTMLparser.h
$(XMLINCLUDEDIR)HTMLtree.h
$(XMLINCLUDEDIR)list.h
$(XMLINCLUDEDIR)nanoftp.h
$(XMLINCLUDEDIR)nanohttp.h
$(XMLINCLUDEDIR)parser.h
$(XMLINCLUDEDIR)parserInternals.h
$(XMLINCLUDEDIR)pattern.h
$(XMLINCLUDEDIR)relaxng.h
$(XMLINCLUDEDIR)SAX.h
$(XMLINCLUDEDIR)SAX2.h
$(XMLINCLUDEDIR)schemasInternals.h
$(XMLINCLUDEDIR)threads.h
$(XMLINCLUDEDIR)tree.h
$(XMLINCLUDEDIR)uri.h
$(XMLINCLUDEDIR)valid.h
$(XMLINCLUDEDIR)xinclude.h
$(XMLINCLUDEDIR)xlink.h
$(XMLINCLUDEDIR)xmlautomata.h
$(XMLINCLUDEDIR)xmlerror.h
$(XMLINCLUDEDIR)xmlexports.h
$(XMLINCLUDEDIR)xmlIO.h
$(XMLINCLUDEDIR)xmlmemory.h
$(XMLINCLUDEDIR)xmlmodule.h
$(XMLINCLUDEDIR)xmlreader.h
$(XMLINCLUDEDIR)xmlregexp.h
$(XMLINCLUDEDIR)xmlsave.h
$(XMLINCLUDEDIR)xmlschemas.h
$(XMLINCLUDEDIR)xmlschemastypes.h
$(XMLINCLUDEDIR)xmlstring.h
$(XMLINCLUDEDIR)xmlunicode.h
$(XMLINCLUDEDIR)xmlversion.h
$(XMLINCLUDEDIR)xmlwriter.h
$(XMLINCLUDEDIR)xpath.h
$(XMLINCLUDEDIR)xpathInternals.h
$(XMLINCLUDEDIR)xpointer.h
</headers>
<!-- these ones are not inside the include/libxml folder -->
<headers>
$(XMLBASEDIR)$(DIRSEP)libxml.h
$(XMLBASEDIR)$(DIRSEP)triodef.h
$(XMLBASEDIR)$(DIRSEP)trionan.h
$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)wsockcompat.h
</headers>
</lib>
<!-- -->
<!-- LIBXML2 test programs -->
<!-- -->
<set var="BUILD_ALL_TESTS">
<!-- when using full options support with MSVC6PRJ we should
avoid to create all the DSP files required for the test
programs: they would take a _lot_ of space !! -->
<if cond="FORMAT=='msvc6prj' and FULL_OPTIONS_SUPPORT=='1'">0</if>
<!-- when creating a makefile or using MSVC6PRJ with limited
options support, then we can build all the tests safely -->
<if cond="FORMAT!='msvc6prj' or FULL_OPTIONS_SUPPORT=='0'">1</if>
</set>
<if cond="BUILD_ALL_TESTS=='1'">
<exe id="testAutomata" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testAutomata.c</sources></exe>
<exe id="testC14N" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testC14N.c</sources></exe>
<exe id="testHTML" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testHTML.c</sources></exe>
<exe id="testReader" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testReader.c</sources></exe>
<exe id="testRegexp" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRegexp.c</sources></exe>
<exe id="testRelax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRelax.c</sources></exe>
<exe id="testSax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSax.c</sources></exe>
<exe id="testSchemas" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSchemas.c</sources></exe>
<exe id="testURI" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testURI.c</sources></exe>
<exe id="testXPath" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testXPath.c</sources></exe>
<exe id="xmllint" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)xmllint.c</sources></exe>
<if cond="FORMAT=='autoconf'">
<exe id="testdso" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testdso.c</sources></exe>
</if>
<!-- FIXME:
<exe id="testModule" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testModule.c</sources></exe>
<if cond="WITH_THREADS=='posix'">
<exe id="testThreads" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreads.c</sources></exe>
</if>
<if cond="WITH_THREADS=='ctls' or WITH_THREADS=='native'">
<exe id="testThreadsWin32" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreadsWin32.c</sources></exe>
</if>
-->
</if>
</makefile>

1345
packager/third_party/libxml/src/buf.c vendored Normal file

File diff suppressed because it is too large Load Diff

72
packager/third_party/libxml/src/buf.h vendored Normal file
View File

@ -0,0 +1,72 @@
/*
* Summary: Internal Interfaces for memory buffers in libxml2
* Description: this module describes most of the new xmlBuf buffer
* entry points, those are private routines, with a
* few exceptions exported in tree.h. This was added
* in 2.9.0.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_BUF_H__
#define __XML_BUF_H__
#include <libxml/tree.h>
#ifdef __cplusplus
extern "C" {
#endif
xmlBufPtr xmlBufCreate(void);
xmlBufPtr xmlBufCreateSize(size_t size);
xmlBufPtr xmlBufCreateStatic(void *mem, size_t size);
int xmlBufSetAllocationScheme(xmlBufPtr buf,
xmlBufferAllocationScheme scheme);
int xmlBufGetAllocationScheme(xmlBufPtr buf);
void xmlBufFree(xmlBufPtr buf);
void xmlBufEmpty(xmlBufPtr buf);
/* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */
int xmlBufGrow(xmlBufPtr buf, int len);
int xmlBufInflate(xmlBufPtr buf, size_t len);
int xmlBufResize(xmlBufPtr buf, size_t len);
int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len);
int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
int xmlBufCCat(xmlBufPtr buf, const char *str);
int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string);
int xmlBufWriteChar(xmlBufPtr buf, const char *string);
int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
size_t xmlBufAvail(const xmlBufPtr buf);
size_t xmlBufLength(const xmlBufPtr buf);
/* size_t xmlBufUse(const xmlBufPtr buf); */
int xmlBufIsEmpty(const xmlBufPtr buf);
int xmlBufAddLen(xmlBufPtr buf, size_t len);
int xmlBufErase(xmlBufPtr buf, size_t len);
/* const xmlChar * xmlBufContent(const xmlBuf *buf); */
/* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
xmlChar * xmlBufDetach(xmlBufPtr buf);
size_t xmlBufDump(FILE *file, xmlBufPtr buf);
xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input);
int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
size_t base, size_t cur);
#ifdef __cplusplus
}
#endif
#endif /* __XML_BUF_H__ */

View File

@ -27,6 +27,8 @@
#include <libxml/xpathInternals.h> #include <libxml/xpathInternals.h>
#include <libxml/c14n.h> #include <libxml/c14n.h>
#include "buf.h"
/************************************************************************ /************************************************************************
* * * *
* Some declaration better left private ATM * * Some declaration better left private ATM *
@ -44,7 +46,7 @@ typedef struct _xmlC14NVisibleNsStack {
int nsPrevStart; /* the begginning of the stack for previous visible node */ int nsPrevStart; /* the begginning of the stack for previous visible node */
int nsPrevEnd; /* the end of the stack for previous visible node */ int nsPrevEnd; /* the end of the stack for previous visible node */
int nsMax; /* size of the array as allocated */ int nsMax; /* size of the array as allocated */
xmlNsPtr *nsTab; /* array of ns in no particular order */ xmlNsPtr *nsTab; /* array of ns in no particular order */
xmlNodePtr *nodeTab; /* array of nodes in no particular order */ xmlNodePtr *nodeTab; /* array of nodes in no particular order */
} xmlC14NVisibleNsStack, *xmlC14NVisibleNsStackPtr; } xmlC14NVisibleNsStack, *xmlC14NVisibleNsStackPtr;
@ -76,11 +78,11 @@ static void xmlC14NVisibleNsStackDestroy (xmlC14NVisibleNsStackPtr cur);
static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur,
xmlNsPtr ns, xmlNsPtr ns,
xmlNodePtr node); xmlNodePtr node);
static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur,
xmlC14NVisibleNsStackPtr state); xmlC14NVisibleNsStackPtr state);
static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur,
xmlC14NVisibleNsStackPtr state); xmlC14NVisibleNsStackPtr state);
static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur);
static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
xmlNsPtr ns); xmlNsPtr ns);
static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
@ -105,26 +107,26 @@ typedef enum {
static xmlChar *xmlC11NNormalizeString(const xmlChar * input, static xmlChar *xmlC11NNormalizeString(const xmlChar * input,
xmlC14NNormalizationMode mode); xmlC14NNormalizationMode mode);
#define xmlC11NNormalizeAttr( a ) \ #define xmlC11NNormalizeAttr( a ) \
xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_ATTR) xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_ATTR)
#define xmlC11NNormalizeComment( a ) \ #define xmlC11NNormalizeComment( a ) \
xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_COMMENT) xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_COMMENT)
#define xmlC11NNormalizePI( a ) \ #define xmlC11NNormalizePI( a ) \
xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_PI) xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_PI)
#define xmlC11NNormalizeText( a ) \ #define xmlC11NNormalizeText( a ) \
xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_TEXT) xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_TEXT)
#define xmlC14NIsVisible( ctx, node, parent ) \ #define xmlC14NIsVisible( ctx, node, parent ) \
(((ctx)->is_visible_callback != NULL) ? \ (((ctx)->is_visible_callback != NULL) ? \
(ctx)->is_visible_callback((ctx)->user_data, \ (ctx)->is_visible_callback((ctx)->user_data, \
(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1) (xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
#define xmlC14NIsExclusive( ctx ) \ #define xmlC14NIsExclusive( ctx ) \
( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 ) ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 )
/************************************************************************ /************************************************************************
* * * *
* Some factorized error routines * * Some factorized error routines *
* * * *
************************************************************************/ ************************************************************************/
@ -468,7 +470,7 @@ xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NC
if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) {
if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) { if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) {
return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i]));
} else { } else {
return(0); return(0);
} }
@ -483,7 +485,7 @@ xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NC
/** /**
* xmlC14NIsXmlNs: * xmlC14NIsXmlNs:
* @ns: the namespace to check * @ns: the namespace to check
* *
* Checks whether the given namespace is a default "xml:" namespace * Checks whether the given namespace is a default "xml:" namespace
* with href="http://www.w3.org/XML/1998/namespace" * with href="http://www.w3.org/XML/1998/namespace"
@ -504,7 +506,7 @@ xmlC14NIsXmlNs(xmlNsPtr ns)
/** /**
* xmlC14NNsCompare: * xmlC14NNsCompare:
* @ns1: the pointer to first namespace * @ns1: the pointer to first namespace
* @ns2: the pointer to second namespace * @ns2: the pointer to second namespace
* *
* Compares the namespaces by names (prefixes). * Compares the namespaces by names (prefixes).
* *
@ -527,7 +529,7 @@ xmlC14NNsCompare(xmlNsPtr ns1, xmlNsPtr ns2)
/** /**
* xmlC14NPrintNamespaces: * xmlC14NPrintNamespaces:
* @ns: the pointer to namespace * @ns: the pointer to namespace
* @ctx: the C14N context * @ctx: the C14N context
* *
* Prints the given namespace to the output buffer from C14N context. * Prints the given namespace to the output buffer from C14N context.
* *
@ -545,20 +547,21 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx)
if (ns->prefix != NULL) { if (ns->prefix != NULL) {
xmlOutputBufferWriteString(ctx->buf, " xmlns:"); xmlOutputBufferWriteString(ctx->buf, " xmlns:");
xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix); xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix);
xmlOutputBufferWriteString(ctx->buf, "=\""); xmlOutputBufferWriteString(ctx->buf, "=");
} else { } else {
xmlOutputBufferWriteString(ctx->buf, " xmlns=\""); xmlOutputBufferWriteString(ctx->buf, " xmlns=");
} }
if(ns->href != NULL) { if(ns->href != NULL) {
xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href); xmlBufWriteQuotedString(ctx->buf->buffer, ns->href);
} else {
xmlOutputBufferWriteString(ctx->buf, "\"\"");
} }
xmlOutputBufferWriteString(ctx->buf, "\"");
return (1); return (1);
} }
/** /**
* xmlC14NProcessNamespacesAxis: * xmlC14NProcessNamespacesAxis:
* @ctx: the C14N context * @ctx: the C14N context
* @node: the current node * @node: the current node
* *
* Prints out canonical namespace axis of the current node to the * Prints out canonical namespace axis of the current node to the
@ -626,12 +629,12 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns);
if(visible) { if(visible) {
xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
} }
if(!already_rendered) { if(!already_rendered) {
xmlListInsert(list, ns); xmlListInsert(list, ns);
} }
if(xmlStrlen(ns->prefix) == 0) { if(xmlStrlen(ns->prefix) == 0) {
has_empty_ns = 1; has_empty_ns = 1;
} }
} }
@ -652,7 +655,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
memset(&ns_default, 0, sizeof(ns_default)); memset(&ns_default, 0, sizeof(ns_default));
if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
xmlC14NPrintNamespaces(&ns_default, ctx); xmlC14NPrintNamespaces(&ns_default, ctx);
} }
} }
@ -672,7 +675,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
/** /**
* xmlExcC14NProcessNamespacesAxis: * xmlExcC14NProcessNamespacesAxis:
* @ctx: the C14N context * @ctx: the C14N context
* @node: the current node * @node: the current node
* *
* Prints out exclusive canonical namespace axis of the current node to the * Prints out exclusive canonical namespace axis of the current node to the
@ -755,12 +758,12 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns);
if(visible) { if(visible) {
xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
} }
if(!already_rendered) { if(!already_rendered) {
xmlListInsert(list, ns); xmlListInsert(list, ns);
} }
if(xmlStrlen(ns->prefix) == 0) { if(xmlStrlen(ns->prefix) == 0) {
has_empty_ns = 1; has_empty_ns = 1;
} }
} }
@ -781,7 +784,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
} }
} }
if(visible) { if(visible) {
xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
} }
if(xmlStrlen(ns->prefix) == 0) { if(xmlStrlen(ns->prefix) == 0) {
has_empty_ns = 1; has_empty_ns = 1;
@ -794,7 +797,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
/* /*
* we need to check that attribute is visible and has non * we need to check that attribute is visible and has non
* default namespace (XML Namespaces: "default namespaces * default namespace (XML Namespaces: "default namespaces
* do not apply directly to attributes") * do not apply directly to attributes")
*/ */
if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) { if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) {
already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx); already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx);
@ -821,14 +824,14 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx); already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx);
if(!already_rendered) { if(!already_rendered) {
xmlC14NPrintNamespaces(&ns_default, ctx); xmlC14NPrintNamespaces(&ns_default, ctx);
} }
} else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) { } else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) {
static xmlNs ns_default; static xmlNs ns_default;
memset(&ns_default, 0, sizeof(ns_default)); memset(&ns_default, 0, sizeof(ns_default));
if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
xmlC14NPrintNamespaces(&ns_default, ctx); xmlC14NPrintNamespaces(&ns_default, ctx);
} }
} }
@ -849,7 +852,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
/** /**
* xmlC14NIsXmlAttr: * xmlC14NIsXmlAttr:
* @attr: the attr to check * @attr: the attr to check
* *
* Checks whether the given attribute is a default "xml:" namespace * Checks whether the given attribute is a default "xml:" namespace
* with href="http://www.w3.org/XML/1998/namespace" * with href="http://www.w3.org/XML/1998/namespace"
@ -869,7 +872,7 @@ xmlC14NIsXmlAttr(xmlAttrPtr attr)
/** /**
* xmlC14NAttrsCompare: * xmlC14NAttrsCompare:
* @attr1: the pointer tls o first attr * @attr1: the pointer tls o first attr
* @attr2: the pointer to second attr * @attr2: the pointer to second attr
* *
* Prints the given attribute to the output buffer from C14N context. * Prints the given attribute to the output buffer from C14N context.
* *
@ -918,7 +921,7 @@ xmlC14NAttrsCompare(xmlAttrPtr attr1, xmlAttrPtr attr2)
/** /**
* xmlC14NPrintAttrs: * xmlC14NPrintAttrs:
* @attr: the pointer to attr * @attr: the pointer to attr
* @ctx: the C14N context * @ctx: the C14N context
* *
* Prints out canonical attribute urrent node to the * Prints out canonical attribute urrent node to the
* buffer from C14N context as follows * buffer from C14N context as follows
@ -1088,7 +1091,7 @@ xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr)
/** /**
* xmlC14NProcessAttrsAxis: * xmlC14NProcessAttrsAxis:
* @ctx: the C14N context * @ctx: the C14N context
* @cur: the current node * @cur: the current node
* @parent_visible: the visibility of parent node * @parent_visible: the visibility of parent node
* @all_parents_visible: the visibility of all parent nodes * @all_parents_visible: the visibility of all parent nodes
@ -1388,7 +1391,7 @@ xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur)
/** /**
* xmlC14NProcessElementNode: * xmlC14NProcessElementNode:
* @ctx: the pointer to C14N context object * @ctx: the pointer to C14N context object
* @cur: the node to process * @cur: the node to process
* @visible: this node is visible * @visible: this node is visible
* @all_parents_visible: whether all the parents of this node are visible * @all_parents_visible: whether all the parents of this node are visible
@ -1472,7 +1475,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
ret = xmlC14NProcessAttrsAxis(ctx, cur, visible); ret = xmlC14NProcessAttrsAxis(ctx, cur, visible);
if (ret < 0) { if (ret < 0) {
xmlC14NErrInternal("processing attributes axis"); xmlC14NErrInternal("processing attributes axis");
return (-1); return (-1);
} }
if (visible) { if (visible) {
@ -1510,7 +1513,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
/** /**
* xmlC14NProcessNode: * xmlC14NProcessNode:
* @ctx: the pointer to C14N context object * @ctx: the pointer to C14N context object
* @cur: the node to process * @cur: the node to process
* *
* Processes the given node * Processes the given node
@ -1701,7 +1704,7 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur)
/** /**
* xmlC14NProcessNodeList: * xmlC14NProcessNodeList:
* @ctx: the pointer to C14N context object * @ctx: the pointer to C14N context object
* @cur: the node to start from * @cur: the node to start from
* *
* Processes all nodes in the row starting from cur. * Processes all nodes in the row starting from cur.
@ -1748,18 +1751,18 @@ xmlC14NFreeCtx(xmlC14NCtxPtr ctx)
/** /**
* xmlC14NNewCtx: * xmlC14NNewCtx:
* @doc: the XML document for canonization * @doc: the XML document for canonization
* @is_visible_callback:the function to use to determine is node visible * @is_visible_callback:the function to use to determine is node visible
* or not * or not
* @user_data: the first parameter for @is_visible_callback function * @user_data: the first parameter for @is_visible_callback function
* (in most cases, it is nodes set) * (in most cases, it is nodes set)
* @mode: the c14n mode (see @xmlC14NMode) * @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixe the list of inclusive namespace prefixes * @inclusive_ns_prefixe the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no * ended with a NULL or NULL if there is no
* inclusive namespaces (only for ` * inclusive namespaces (only for `
* canonicalization) * canonicalization)
* @with_comments: include comments in the result (!=0) or not (==0) * @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this * @buf: the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires * buffer MUST have encoder==NULL because C14N requires
* UTF-8 output * UTF-8 output
* *
@ -1840,18 +1843,18 @@ xmlC14NNewCtx(xmlDocPtr doc,
/** /**
* xmlC14NExecute: * xmlC14NExecute:
* @doc: the XML document for canonization * @doc: the XML document for canonization
* @is_visible_callback:the function to use to determine is node visible * @is_visible_callback:the function to use to determine is node visible
* or not * or not
* @user_data: the first parameter for @is_visible_callback function * @user_data: the first parameter for @is_visible_callback function
* (in most cases, it is nodes set) * (in most cases, it is nodes set)
* @mode: the c14n mode (see @xmlC14NMode) * @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes * @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no * ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive * inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise) * canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0) * @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this * @buf: the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires * buffer MUST have encoder==NULL because C14N requires
* UTF-8 output * UTF-8 output
* *
@ -1944,16 +1947,16 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback,
/** /**
* xmlC14NDocSaveTo: * xmlC14NDocSaveTo:
* @doc: the XML document for canonization * @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image * @nodes: the nodes set to be included in the canonized image
* or NULL if all document nodes should be included * or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode) * @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes * @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no * ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive * inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise) * canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0) * @with_comments: include comments in the result (!=0) or not (==0)
* @buf: the output buffer to store canonical XML; this * @buf: the output buffer to store canonical XML; this
* buffer MUST have encoder==NULL because C14N requires * buffer MUST have encoder==NULL because C14N requires
* UTF-8 output * UTF-8 output
* *
@ -1979,16 +1982,16 @@ xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes,
/** /**
* xmlC14NDocDumpMemory: * xmlC14NDocDumpMemory:
* @doc: the XML document for canonization * @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image * @nodes: the nodes set to be included in the canonized image
* or NULL if all document nodes should be included * or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode) * @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes * @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no * ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive * inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise) * canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0) * @with_comments: include comments in the result (!=0) or not (==0)
* @doc_txt_ptr: the memory pointer for allocated canonical XML text; * @doc_txt_ptr: the memory pointer for allocated canonical XML text;
* the caller of this functions is responsible for calling * the caller of this functions is responsible for calling
* xmlFree() to free allocated memory * xmlFree() to free allocated memory
* *
@ -2033,9 +2036,9 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
return (-1); return (-1);
} }
ret = buf->buffer->use; ret = xmlBufUse(buf->buffer);
if (ret > 0) { if (ret > 0) {
*doc_txt_ptr = xmlStrndup(buf->buffer->content, ret); *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret);
} }
(void) xmlOutputBufferClose(buf); (void) xmlOutputBufferClose(buf);
@ -2048,16 +2051,16 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
/** /**
* xmlC14NDocSave: * xmlC14NDocSave:
* @doc: the XML document for canonization * @doc: the XML document for canonization
* @nodes: the nodes set to be included in the canonized image * @nodes: the nodes set to be included in the canonized image
* or NULL if all document nodes should be included * or NULL if all document nodes should be included
* @mode: the c14n mode (see @xmlC14NMode) * @mode: the c14n mode (see @xmlC14NMode)
* @inclusive_ns_prefixes: the list of inclusive namespace prefixes * @inclusive_ns_prefixes: the list of inclusive namespace prefixes
* ended with a NULL or NULL if there is no * ended with a NULL or NULL if there is no
* inclusive namespaces (only for exclusive * inclusive namespaces (only for exclusive
* canonicalization, ignored otherwise) * canonicalization, ignored otherwise)
* @with_comments: include comments in the result (!=0) or not (==0) * @with_comments: include comments in the result (!=0) or not (==0)
* @filename: the filename to store canonical XML image * @filename: the filename to store canonical XML image
* @compression: the compression level (zlib requred): * @compression: the compression level (zlib requred):
* -1 - libxml default, * -1 - libxml default,
* 0 - uncompressed, * 0 - uncompressed,
@ -2121,7 +2124,7 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes,
#define growBufferReentrant() { \ #define growBufferReentrant() { \
buffer_size *= 2; \ buffer_size *= 2; \
buffer = (xmlChar *) \ buffer = (xmlChar *) \
xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
if (buffer == NULL) { \ if (buffer == NULL) { \
xmlC14NErrMemory("growing buffer"); \ xmlC14NErrMemory("growing buffer"); \
return(NULL); \ return(NULL); \

View File

@ -41,13 +41,15 @@
#include <libxml/threads.h> #include <libxml/threads.h>
#include <libxml/globals.h> #include <libxml/globals.h>
#include "buf.h"
#define MAX_DELEGATE 50 #define MAX_DELEGATE 50
#define MAX_CATAL_DEPTH 50 #define MAX_CATAL_DEPTH 50
#ifdef _WIN32 #ifdef _WIN32
# define PATH_SEAPARATOR ';' # define PATH_SEPARATOR ';'
#else #else
# define PATH_SEAPARATOR ':' # define PATH_SEPARATOR ':'
#endif #endif
/** /**
@ -60,7 +62,7 @@
*> values "system" and "public". I have made the default be "system" to *> values "system" and "public". I have made the default be "system" to
*> match yours. *> match yours.
*/ */
#define TODO \ #define TODO \
xmlGenericError(xmlGenericErrorContext, \ xmlGenericError(xmlGenericErrorContext, \
"Unimplemented block at %s:%d\n", \ "Unimplemented block at %s:%d\n", \
__FILE__, __LINE__); __FILE__, __LINE__);
@ -82,10 +84,12 @@ static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog";
#define GetModuleHandleA GetModuleHandle #define GetModuleHandleA GetModuleHandle
#define GetModuleFileNameA GetModuleFileName #define GetModuleFileNameA GetModuleFileName
#else #else
#if !defined(_WINDOWS_)
void* __stdcall GetModuleHandleA(const char*); void* __stdcall GetModuleHandleA(const char*);
unsigned long __stdcall GetModuleFileNameA(void*, char*, unsigned long); unsigned long __stdcall GetModuleFileNameA(void*, char*, unsigned long);
#endif #endif
#endif #endif
#endif
static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID); static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID);
static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename); static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename);
@ -206,7 +210,7 @@ static int xmlCatalogInitialized = 0;
/************************************************************************ /************************************************************************
* * * *
* Catalog error handlers * * Catalog error handlers *
* * * *
************************************************************************/ ************************************************************************/
@ -234,7 +238,7 @@ xmlCatalogErrMemory(const char *extra)
* *
* Handle a catalog error * Handle a catalog error
*/ */
static void static void LIBXML_ATTR_FORMAT(4,0)
xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error, xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error,
const char *msg, const xmlChar *str1, const xmlChar *str2, const char *msg, const xmlChar *str1, const xmlChar *str2,
const xmlChar *str3) const xmlChar *str3)
@ -567,7 +571,7 @@ static void xmlDumpXMLCatalogNode(xmlCatalogEntryPtr catal, xmlNodePtr catalog,
xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE); xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE);
if (xns != NULL) if (xns != NULL)
xmlSetNsProp(node, xns, BAD_CAST "base", xmlSetNsProp(node, xns, BAD_CAST "base",
cur->value); cur->value);
} }
switch (cur->prefer) { switch (cur->prefer) {
case XML_CATA_PREFER_NONE: case XML_CATA_PREFER_NONE:
@ -912,10 +916,7 @@ xmlParseCatalogFile(const char *filename) {
inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename); inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename);
inputStream->buf = buf; inputStream->buf = buf;
inputStream->base = inputStream->buf->buffer->content; xmlBufResetInput(buf->buffer, inputStream);
inputStream->cur = inputStream->buf->buffer->content;
inputStream->end =
&inputStream->buf->buffer->content[inputStream->buf->buffer->use];
inputPush(ctxt, inputStream); inputPush(ctxt, inputStream);
if ((ctxt->directory == NULL) && (directory == NULL)) if ((ctxt->directory == NULL) && (directory == NULL))
@ -990,25 +991,27 @@ xmlLoadFileContent(const char *filename)
return (NULL); return (NULL);
} }
#endif #endif
content = xmlMallocAtomic(size + 10); content = (xmlChar*)xmlMallocAtomic(size + 10);
if (content == NULL) { if (content == NULL) {
xmlCatalogErrMemory("allocating catalog data"); xmlCatalogErrMemory("allocating catalog data");
#ifdef HAVE_STAT
close(fd);
#else
fclose(fd);
#endif
return (NULL); return (NULL);
} }
#ifdef HAVE_STAT #ifdef HAVE_STAT
len = read(fd, content, size); len = read(fd, content, size);
close(fd);
#else #else
len = fread(content, 1, size, fd); len = fread(content, 1, size, fd);
fclose(fd);
#endif #endif
if (len < 0) { if (len < 0) {
xmlFree(content); xmlFree(content);
return (NULL); return (NULL);
} }
#ifdef HAVE_STAT
close(fd);
#else
fclose(fd);
#endif
content[len] = 0; content[len] = 0;
return(content); return(content);
@ -1410,8 +1413,6 @@ xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) {
return(-1); return(-1);
if (catal->URL == NULL) if (catal->URL == NULL)
return(-1); return(-1);
if (catal->children != NULL)
return(-1);
/* /*
* lock the whole catalog for modification * lock the whole catalog for modification
@ -1553,7 +1554,7 @@ xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type,
NULL, catal->prefer, NULL); NULL, catal->prefer, NULL);
if (doregister) { if (doregister) {
catal->type = XML_CATA_CATALOG; catal->type = XML_CATA_CATALOG;
cur = xmlHashLookup(xmlCatalogXMLFiles, catal->URL); cur = (xmlCatalogEntryPtr)xmlHashLookup(xmlCatalogXMLFiles, catal->URL);
if (cur != NULL) if (cur != NULL)
cur->children = catal->children; cur->children = catal->children;
} }
@ -3135,7 +3136,7 @@ xmlInitializeCatalog(void) {
if (p != buf) { if (p != buf) {
xmlChar* uri; xmlChar* uri;
strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf));
uri = xmlCanonicPath(buf); uri = xmlCanonicPath((const xmlChar*)buf);
if (uri != NULL) { if (uri != NULL) {
strncpy(XML_XML_DEFAULT_CATALOG, uri, 255); strncpy(XML_XML_DEFAULT_CATALOG, uri, 255);
xmlFree(uri); xmlFree(uri);
@ -3246,11 +3247,11 @@ xmlLoadCatalogs(const char *pathss) {
while (xmlIsBlank_ch(*cur)) cur++; while (xmlIsBlank_ch(*cur)) cur++;
if (*cur != 0) { if (*cur != 0) {
paths = cur; paths = cur;
while ((*cur != 0) && (*cur != PATH_SEAPARATOR) && (!xmlIsBlank_ch(*cur))) while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur)))
cur++; cur++;
path = xmlStrndup((const xmlChar *)paths, cur - paths); path = xmlStrndup((const xmlChar *)paths, cur - paths);
#ifdef _WIN32 #ifdef _WIN32
iLen = strlen(path); iLen = strlen((const char*)path);
for(i = 0; i < iLen; i++) { for(i = 0; i < iLen; i++) {
if(path[i] == '\\') { if(path[i] == '\\') {
path[i] = '/'; path[i] = '/';
@ -3262,7 +3263,7 @@ xmlLoadCatalogs(const char *pathss) {
xmlFree(path); xmlFree(path);
} }
} }
while (*cur == PATH_SEAPARATOR) while (*cur == PATH_SEPARATOR)
cur++; cur++;
} }
} }
@ -3554,8 +3555,8 @@ xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer) {
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Setting catalog preference to SYSTEM\n"); "Setting catalog preference to SYSTEM\n");
break; break;
case XML_CATA_PREFER_NONE: default:
break; return(ret);
} }
} }
xmlCatalogDefaultPrefer = prefer; xmlCatalogDefaultPrefer = prefer;

347
packager/third_party/libxml/src/compile vendored Executable file
View File

@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,14 +1,12 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright 1992-2013 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2009-11-20' timestamp='2013-06-10'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, but # This program is distributed in the hope that it will be useful, but
@ -17,26 +15,22 @@ timestamp='2009-11-20'
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Originally written by Per Bothner. Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
# #
# This script attempts to guess a canonical system name similar to # Originally written by Per Bothner.
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
# #
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
@ -56,8 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, Copyright 1992-2013 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
;;
esac
# Note: order is significant - the case branches are not exclusive. # Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*) *:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or # NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old # switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward # object file format. This provides both forward
@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi fi
;; ;;
*) *)
os=netbsd os=netbsd
;; ;;
esac esac
# The OS release # The OS release
@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}" echo "${machine}-${os}${release}"
exit ;; exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*) *:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;; ;;
*5.*) *5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;; ;;
esac esac
# According to Compaq, /usr/sbin/psrinfo has been available on # According to Compaq, /usr/sbin/psrinfo has been available on
@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;; # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe echo s390-ibm-zvmoe
exit ;; exit ;;
*:OS400:*:*) *:OS400:*:*)
echo powerpc-ibm-os400 echo powerpc-ibm-os400
exit ;; exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE} echo arm-acorn-riscix${UNAME_RELEASE}
exit ;; exit ;;
arm:riscos:*:*|arm:RISCOS:*:*) arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos echo arm-unknown-riscos
exit ;; exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@ -394,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should # MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem. # be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE} echo m68k-atari-mint${UNAME_RELEASE}
exit ;; exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE} echo m68k-milan-mint${UNAME_RELEASE}
exit ;; exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE} echo m68k-hades-mint${UNAME_RELEASE}
exit ;; exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE} echo m68k-unknown-mint${UNAME_RELEASE}
exit ;; exit ;;
m68k:machten:*:*) m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE} echo m68k-apple-machten${UNAME_RELEASE}
exit ;; exit ;;
@ -480,8 +501,8 @@ EOF
echo m88k-motorola-sysv3 echo m88k-motorola-sysv3
exit ;; exit ;;
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@ -494,7 +515,7 @@ EOF
else else
echo i586-dg-dgux${UNAME_RELEASE} echo i586-dg-dgux${UNAME_RELEASE}
fi fi
exit ;; exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3) M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3 echo m88k-dolphin-sysv3
exit ;; exit ;;
@ -551,7 +572,7 @@ EOF
echo rs6000-ibm-aix3.2 echo rs6000-ibm-aix3.2
fi fi
exit ;; exit ;;
*:AIX:*:[456]) *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000 IBM_ARCH=rs6000
@ -594,52 +615,52 @@ EOF
9000/[678][0-9][0-9]) 9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0 532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;; 32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;; 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;; esac ;;
esac esac
fi fi
if [ "${HP_ARCH}" = "" ]; then if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE #define _HPUX_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main () int main ()
{ {
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS); long bits = sysconf(_SC_KERNEL_BITS);
#endif #endif
long cpu = sysconf (_SC_CPU_VERSION); long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu) switch (cpu)
{ {
case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0: case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
switch (bits) switch (bits)
{ {
case 64: puts ("hppa2.0w"); break; case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break; case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break; default: puts ("hppa2.0"); break;
} break; } break;
#else /* !defined(_SC_KERNEL_BITS) */ #else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break; puts ("hppa2.0"); break;
#endif #endif
default: puts ("hppa1.0"); break; default: puts ("hppa1.0"); break;
} }
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa test -z "$HP_ARCH" && HP_ARCH=hppa
@ -730,22 +751,22 @@ EOF
exit ;; exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd echo c1-convex-bsd
exit ;; exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc if getsysinfo -f scalar_acc
then echo c32-convex-bsd then echo c32-convex-bsd
else echo c2-convex-bsd else echo c2-convex-bsd
fi fi
exit ;; exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd echo c34-convex-bsd
exit ;; exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd echo c38-convex-bsd
exit ;; exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd echo c4-convex-bsd
exit ;; exit ;;
CRAY*Y-MP:*:*:*) CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;; exit ;;
@ -769,14 +790,14 @@ EOF
exit ;; exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
5000:UNIX_System_V:4.*:*) 5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@ -788,30 +809,35 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;; exit ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
case ${UNAME_MACHINE} in UNAME_PROCESSOR=`/usr/bin/uname -p`
pc98) case ${UNAME_PROCESSOR} in
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64) amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*) *)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac esac
exit ;; exit ;;
i*:CYGWIN*:*) i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin echo ${UNAME_MACHINE}-pc-cygwin
exit ;; exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*) *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit ;; exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*) i*:windows32*:*)
# uname -m includes "-pc" on this system. # uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32 echo ${UNAME_MACHINE}-mingw32
exit ;; exit ;;
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit ;; exit ;;
*:Interix*:*) *:Interix*:*)
case ${UNAME_MACHINE} in case ${UNAME_MACHINE} in
x86) x86)
echo i586-pc-interix${UNAME_RELEASE} echo i586-pc-interix${UNAME_RELEASE}
exit ;; exit ;;
@ -848,15 +874,22 @@ EOF
exit ;; exit ;;
*:GNU:*:*) *:GNU:*:*)
# the GNU system # the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;; exit ;;
*:GNU/*:*:*) *:GNU/*:*:*)
# other systems with GNU libc and userland # other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;; exit ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit ;; exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;; EV5) UNAME_MACHINE=alphaev5 ;;
@ -866,52 +899,56 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;; EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;; EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;; EV68*) UNAME_MACHINE=alphaev68 ;;
esac esac
objdump --private-headers /bin/sh | grep -q ld.so.1 objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
arm*:Linux:*:*) arm*:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__ | grep -q __ARM_EABI__
then then
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi fi
exit ;; exit ;;
avr32*:Linux:*:*) avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
cris:Linux:*:*) cris:Linux:*:*)
echo cris-axis-linux-gnu echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;; exit ;;
crisv32:Linux:*:*) crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;; exit ;;
frv:Linux:*:*) frv:Linux:*:*)
echo frv-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
i*86:Linux:*:*) i*86:Linux:*:*)
LIBC=gnu echo ${UNAME_MACHINE}-pc-linux-${LIBC}
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;; exit ;;
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
m32r*:Linux:*:*) m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
m68*:Linux:*:*) m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
mips:Linux:*:* | mips64:Linux:*:*) mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
@ -930,51 +967,63 @@ EOF
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;; ;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*) or32:Linux:*:*)
echo or32-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
echo sparc-unknown-linux-gnu echo sparc-unknown-linux-${LIBC}
exit ;; exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*) parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu echo hppa64-unknown-linux-${LIBC}
exit ;; exit ;;
parisc:Linux:*:* | hppa:Linux:*:*) parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level # Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;; PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-gnu ;; *) echo hppa-unknown-linux-${LIBC} ;;
esac esac
exit ;; exit ;;
ppc64:Linux:*:*) ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu echo powerpc64-unknown-linux-${LIBC}
exit ;; exit ;;
ppc:Linux:*:*) ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;; exit ;;
s390:Linux:*:* | s390x:Linux:*:*) s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;; exit ;;
sh64*:Linux:*:*) sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
sh*:Linux:*:*) sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*) sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
vax:Linux:*:*) vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;; exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
i*86:DYNIX/ptx:4*:*) i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@ -983,11 +1032,11 @@ EOF
echo i386-sequent-sysv4 echo i386-sequent-sysv4
exit ;; exit ;;
i*86:UNIX_SV:4.2MP:2.*) i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version # Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2... # number series starting with 2...
# I am not positive that other SVR4 systems won't match this, # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms. # I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it. # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;; exit ;;
i*86:OS/2:*:*) i*86:OS/2:*:*)
@ -1019,7 +1068,7 @@ EOF
fi fi
exit ;; exit ;;
i*86:*:5:[678]*) i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6. # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;; *486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;; *Pentium) UNAME_MACHINE=i586 ;;
@ -1047,13 +1096,13 @@ EOF
exit ;; exit ;;
pc:*:*:*) pc:*:*:*)
# Left here for compatibility: # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586. # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub # Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that # prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build. # this is a cross-build.
echo i586-pc-msdosdjgpp echo i586-pc-msdosdjgpp
exit ;; exit ;;
Intel:Mach:3*:*) Intel:Mach:3*:*)
echo i386-pc-mach3 echo i386-pc-mach3
exit ;; exit ;;
@ -1088,8 +1137,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;; && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*) NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3' OS_REL='.3'
test -r /etc/.relid \ test -r /etc/.relid \
@ -1132,10 +1181,10 @@ EOF
echo ns32k-sni-sysv echo ns32k-sni-sysv
fi fi
exit ;; exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV> # says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4 echo i586-unisys-sysv4
exit ;; exit ;;
*:UNIX_System_V:4*:FTX*) *:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>. # From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm # How about differentiating between stratus architectures? -djm
@ -1161,11 +1210,11 @@ EOF
exit ;; exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE} echo mips-nec-sysv${UNAME_RELEASE}
else else
echo mips-unknown-sysv${UNAME_RELEASE} echo mips-unknown-sysv${UNAME_RELEASE}
fi fi
exit ;; exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos echo powerpc-be-beos
exit ;; exit ;;
@ -1178,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku echo i586-pc-haiku
exit ;; exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*) SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE} echo sx4-nec-superux${UNAME_RELEASE}
exit ;; exit ;;
@ -1204,19 +1256,21 @@ EOF
exit ;; exit ;;
*:Darwin:*:*) *:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in eval $set_cc_for_build
i386) if test "$UNAME_PROCESSOR" = unknown ; then
eval $set_cc_for_build UNAME_PROCESSOR=powerpc
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then fi
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
grep IS_64BIT_ARCH >/dev/null (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
then grep IS_64BIT_ARCH >/dev/null
UNAME_PROCESSOR="x86_64" then
fi case $UNAME_PROCESSOR in
fi ;; i386) UNAME_PROCESSOR=x86_64 ;;
unknown) UNAME_PROCESSOR=powerpc ;; powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac esac
fi
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;; exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
@ -1230,7 +1284,10 @@ EOF
*:QNX:*:4*) *:QNX:*:4*)
echo i386-pc-qnx echo i386-pc-qnx
exit ;; exit ;;
NSE-?:NONSTOP_KERNEL:*:*) NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE} echo nse-tandem-nsk${UNAME_RELEASE}
exit ;; exit ;;
NSR-?:NONSTOP_KERNEL:*:*) NSR-?:NONSTOP_KERNEL:*:*)
@ -1275,13 +1332,13 @@ EOF
echo pdp10-unknown-its echo pdp10-unknown-its
exit ;; exit ;;
SEI:*:*:SEIUX) SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE} echo mips-sei-seiux${UNAME_RELEASE}
exit ;; exit ;;
*:DragonFly:*:*) *:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;; exit ;;
*:*VMS:*:*) *:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null` UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;; A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;;
@ -1299,11 +1356,11 @@ EOF
i*86:AROS:*:*) i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros echo ${UNAME_MACHINE}-pc-aros
exit ;; exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build eval $set_cc_for_build
cat >$dummy.c <<EOF cat >$dummy.c <<EOF
#ifdef _SEQUENT_ #ifdef _SEQUENT_
@ -1321,11 +1378,11 @@ main ()
#include <sys/param.h> #include <sys/param.h>
printf ("m68k-sony-newsos%s\n", printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4 #ifdef NEWSOS4
"4" "4"
#else #else
"" ""
#endif #endif
); exit (0); ); exit (0);
#endif #endif
#endif #endif

View File

@ -1,20 +1,7 @@
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.ac by autoheader. */
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
#undef HAVE_LIBM
#undef HAVE_ISINF
#undef HAVE_ISNAN
#undef HAVE_LIBHISTORY
#undef HAVE_LIBREADLINE
#undef HAVE_LIBPTHREAD
#undef HAVE_PTHREAD_H
/* Define if IPV6 support is there */ /* Type cast for the gethostbyname() argument */
#undef SUPPORT_IP6 #undef GETHOSTBYNAME_ARG_CAST
/* Define if getaddrinfo is there */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the <ansidecl.h> header file. */ /* Define to 1 if you have the <ansidecl.h> header file. */
#undef HAVE_ANSIDECL_H #undef HAVE_ANSIDECL_H
@ -85,8 +72,8 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define to 1 if you have the <inttypes.h.h> header file. */ /* Define to 1 if you have the `isascii' function. */
#undef HAVE_INTTYPES_H_H #undef HAVE_ISASCII
/* Define if isinf is there */ /* Define if isinf is there */
#undef HAVE_ISINF #undef HAVE_ISINF
@ -100,6 +87,9 @@
/* Define if history library is there (-lhistory) */ /* Define if history library is there (-lhistory) */
#undef HAVE_LIBHISTORY #undef HAVE_LIBHISTORY
/* Have compression library */
#undef HAVE_LIBLZMA
/* Define if pthread library is there (-lpthread) */ /* Define if pthread library is there (-lpthread) */
#undef HAVE_LIBPTHREAD #undef HAVE_LIBPTHREAD
@ -115,6 +105,9 @@
/* Define to 1 if you have the `localtime' function. */ /* Define to 1 if you have the `localtime' function. */
#undef HAVE_LOCALTIME #undef HAVE_LOCALTIME
/* Define to 1 if you have the <lzma.h> header file. */
#undef HAVE_LZMA_H
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H #undef HAVE_MALLOC_H
@ -124,6 +117,17 @@
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* mmap() is no good without munmap() */
#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
# undef /**/ HAVE_MMAP
#endif
/* Define to 1 if you have the <nan.h> header file. */ /* Define to 1 if you have the <nan.h> header file. */
#undef HAVE_NAN_H #undef HAVE_NAN_H
@ -145,6 +149,15 @@
/* Define if <pthread.h> is there */ /* Define if <pthread.h> is there */
#undef HAVE_PTHREAD_H #undef HAVE_PTHREAD_H
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
/* Define to 1 if you have the `rand' function. */
#undef HAVE_RAND
/* Define to 1 if you have the `rand_r' function. */
#undef HAVE_RAND_R
/* Define to 1 if you have the <resolv.h> header file. */ /* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H #undef HAVE_RESOLV_H
@ -163,6 +176,9 @@
/* Define to 1 if you have the `sprintf' function. */ /* Define to 1 if you have the `sprintf' function. */
#undef HAVE_SPRINTF #undef HAVE_SPRINTF
/* Define to 1 if you have the `srand' function. */
#undef HAVE_SRAND
/* Define to 1 if you have the `sscanf' function. */ /* Define to 1 if you have the `sscanf' function. */
#undef HAVE_SSCANF #undef HAVE_SSCANF
@ -225,6 +241,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME
/* Define to 1 if you have the <time.h> header file. */ /* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H #undef HAVE_TIME_H
@ -255,8 +274,7 @@
/* Define as const if the declaration of iconv() needs const. */ /* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST #undef ICONV_CONST
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory where libtool stores uninstalled libraries. */
*/
#undef LT_OBJDIR #undef LT_OBJDIR
/* Name of package */ /* Name of package */
@ -280,8 +298,8 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* Define to 1 if the C compiler supports function prototypes. */ /* Type cast for the send() function 2nd arg */
#undef PROTOTYPES #undef SEND_ARG2_CAST
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
@ -289,23 +307,26 @@
/* Support for IPv6 */ /* Support for IPv6 */
#undef SUPPORT_IP6 #undef SUPPORT_IP6
/* Define if va_list is an array type */
#undef VA_LIST_IS_ARRAY
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Determine what socket length (socklen_t) data type is */ /* Determine what socket length (socklen_t) data type is */
#undef XML_SOCKLEN_T #undef XML_SOCKLEN_T
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Using the Win32 Socket implementation */ /* Using the Win32 Socket implementation */
#undef _WINSOCKAPI_ #undef _WINSOCKAPI_
/* Define like PROTOTYPES; this can be used by system headers. */
#undef __PROTOTYPES
/* Win32 Std C name mangling work-around */
#undef snprintf
/* ss_family is not defined here, use __ss_family instead */ /* ss_family is not defined here, use __ss_family instead */
#undef ss_family #undef ss_family
/* Win32 Std C name mangling work-around */ /* Define to the type of an unsigned integer type of width exactly 32 bits if
#undef vsnprintf such a type exists and the standard includes do not define it. */
#undef uint32_t

View File

@ -1,38 +1,31 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright 1992-2013 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
timestamp='2009-11-20' timestamp='2013-08-10'
# This file is (in principle) common to ALL GNU software. # This file is free software; you can redistribute it and/or modify it
# The presence of a machine in this file suggests that SOME GNU software # under the terms of the GNU General Public License as published by
# can handle that machine. It does not imply ALL GNU software can. # the Free Software Foundation; either version 3 of the License, or
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful, but
# but WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# GNU General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to <config-patches@gnu.org>. Submit a context # Please send patches with a ChangeLog entry to config-patches@gnu.org.
# diff and a properly formatted GNU ChangeLog entry.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
@ -75,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, Copyright 1992-2013 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -123,13 +115,18 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*) *)
basic_machine=`echo $1 | sed 's/-[^-]*$//'` basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ] if [ $basic_machine != $1 ]
@ -152,12 +149,12 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze) -apple | -axis | -knuth | -cray | -microblaze*)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
-bluegene*) -bluegene*)
os=-cnk os=-cnk
;; ;;
-sim | -cisco | -oki | -wec | -winbond) -sim | -cisco | -oki | -wec | -winbond)
os= os=
@ -173,10 +170,10 @@ case $os in
os=-chorusos os=-chorusos
basic_machine=$1 basic_machine=$1
;; ;;
-chorusrdb) -chorusrdb)
os=-chorusrdb os=-chorusrdb
basic_machine=$1 basic_machine=$1
;; ;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
@ -221,6 +218,12 @@ case $os in
-isc*) -isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*) -lynx*)
os=-lynxos os=-lynxos
;; ;;
@ -245,20 +248,27 @@ case $basic_machine in
# Some are omitted here because they have special meanings below. # Some are omitted here because they have special meanings below.
1750a | 580 \ 1750a | 580 \
| a29k \ | a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \ | am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \ | bfin \
| c4x | clipper \ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \ | fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \ | ip2k | iq2000 \
| le32 | le64 \
| lm32 \ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \ | m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \ | mips16 \
| mips64 | mips64el \ | mips64 | mips64el \
@ -276,34 +286,45 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \ | mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| moxie \ | moxie \
| mt \ | mt \
| msp430 \ | msp430 \
| nios | nios2 \ | nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| or32 \ | open8 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
| rx \ | rl78 | rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \ | spu \
| tahoe | thumb | tic4x | tic80 | tron \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \ | ubicom32 \
| v850 | v850e \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \ | we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip) c54x)
# Motorola 68HC11/12. basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
@ -313,6 +334,21 @@ case $basic_machine in
basic_machine=mt-unknown basic_machine=mt-unknown
;; ;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
@ -327,25 +363,30 @@ case $basic_machine in
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
580-* \ 580-* \
| a29k-* \ | a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \ | avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \ | ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \ | lm32-* \
| m32c-* | m32r-* | m32rle-* \ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \ | mips16-* \
| mips64-* | mips64el-* \ | mips64-* | mips64el-* \
@ -363,29 +404,34 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \ | mipstx39-* | mipstx39el-* \
| mmix-* \ | mmix-* \
| mt-* \ | mt-* \
| msp430-* \ | msp430-* \
| nios-* | nios2-* \ | nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* | rx-* \ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \ | tron-* \
| ubicom32-* \ | ubicom32-* \
| v850-* | v850e-* | vax-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
| ymp-* \ | ymp-* \
| z8k-* | z80-*) | z8k-* | z80-*)
@ -410,7 +456,7 @@ case $basic_machine in
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
abacus) abacus)
basic_machine=abacus-unknown basic_machine=abacus-unknown
;; ;;
adobe68k) adobe68k)
@ -480,11 +526,20 @@ case $basic_machine in
basic_machine=powerpc-ibm basic_machine=powerpc-ibm
os=-cnk os=-cnk
;; ;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90) c90)
basic_machine=c90-cray basic_machine=c90-cray
os=-unicos os=-unicos
;; ;;
cegcc) cegcc)
basic_machine=arm-unknown basic_machine=arm-unknown
os=-cegcc os=-cegcc
;; ;;
@ -516,7 +571,7 @@ case $basic_machine in
basic_machine=craynv-cray basic_machine=craynv-cray
os=-unicosmp os=-unicosmp
;; ;;
cr16) cr16 | cr16-*)
basic_machine=cr16-unknown basic_machine=cr16-unknown
os=-elf os=-elf
;; ;;
@ -674,7 +729,6 @@ case $basic_machine in
i370-ibm* | ibm*) i370-ibm* | ibm*)
basic_machine=i370-ibm basic_machine=i370-ibm
;; ;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32) i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32 os=-sysv32
@ -732,11 +786,15 @@ case $basic_machine in
basic_machine=ns32k-utek basic_machine=ns32k-utek
os=-sysv os=-sysv
;; ;;
microblaze) microblaze*)
basic_machine=microblaze-xilinx basic_machine=microblaze-xilinx
;; ;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32) mingw32)
basic_machine=i386-pc basic_machine=i686-pc
os=-mingw32 os=-mingw32
;; ;;
mingw32ce) mingw32ce)
@ -771,10 +829,18 @@ case $basic_machine in
ms1-*) ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;; ;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs) mvs)
basic_machine=i370-ibm basic_machine=i370-ibm
os=-mvs os=-mvs
;; ;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000) ncr3000)
basic_machine=i486-ncr basic_machine=i486-ncr
os=-sysv4 os=-sysv4
@ -839,6 +905,12 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
@ -921,9 +993,10 @@ case $basic_machine in
;; ;;
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc | ppcbe) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
@ -948,7 +1021,11 @@ case $basic_machine in
basic_machine=i586-unknown basic_machine=i586-unknown
os=-pw32 os=-pw32
;; ;;
rdos) rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc basic_machine=i386-pc
os=-rdos os=-rdos
;; ;;
@ -1017,6 +1094,9 @@ case $basic_machine in
basic_machine=i860-stratus basic_machine=i860-stratus
os=-sysv4 os=-sysv4
;; ;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
;; ;;
@ -1073,20 +1153,8 @@ case $basic_machine in
basic_machine=t90-cray basic_machine=t90-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tile*) tile*)
basic_machine=tile-unknown basic_machine=$basic_machine-unknown
os=-linux-gnu os=-linux-gnu
;; ;;
tx39) tx39)
@ -1156,6 +1224,9 @@ case $basic_machine in
xps | xps100) xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp) ymp)
basic_machine=ymp-cray basic_machine=ymp-cray
os=-unicos os=-unicos
@ -1253,11 +1324,11 @@ esac
if [ x"$os" != x"" ] if [ x"$os" != x"" ]
then then
case $os in case $os in
# First match some system type aliases # First match some system type aliases
# that might get confused with valid system types. # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux) -auroraux)
os=-auroraux os=-auroraux
;; ;;
-solaris1 | -solaris1.*) -solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'` os=`echo $os | sed -e 's|solaris1|sunos4|'`
@ -1281,20 +1352,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1341,7 +1413,7 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-os400*) -os400*)
os=-os400 os=-os400
;; ;;
-wince*) -wince*)
@ -1390,7 +1462,7 @@ case $os in
-sinix*) -sinix*)
os=-sysv4 os=-sysv4
;; ;;
-tpf*) -tpf*)
os=-tpf os=-tpf
;; ;;
-triton*) -triton*)
@ -1426,15 +1498,14 @@ case $os in
-aros*) -aros*)
os=-aros os=-aros
;; ;;
-kaos*)
os=-kaos
;;
-zvmoe) -zvmoe)
os=-zvmoe os=-zvmoe
;; ;;
-dicos*) -dicos*)
os=-dicos os=-dicos
;; ;;
-nacl*)
;;
-none) -none)
;; ;;
*) *)
@ -1457,10 +1528,10 @@ else
# system, and we'll never get to this point. # system, and we'll never get to this point.
case $basic_machine in case $basic_machine in
score-*) score-*)
os=-elf os=-elf
;; ;;
spu-*) spu-*)
os=-elf os=-elf
;; ;;
*-acorn) *-acorn)
@ -1472,8 +1543,23 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
c4x-* | tic4x-*) c4x-* | tic4x-*)
os=-coff os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;; ;;
# This must come before the *-dec entry. # This must come before the *-dec entry.
pdp10-*) pdp10-*)
@ -1493,14 +1579,11 @@ case $basic_machine in
;; ;;
m68000-sun) m68000-sun)
os=-sunos3 os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;; ;;
m68*-cisco) m68*-cisco)
os=-aout os=-aout
;; ;;
mep-*) mep-*)
os=-elf os=-elf
;; ;;
mips*-cisco) mips*-cisco)
@ -1509,6 +1592,9 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or1k-*)
os=-elf
;;
or32-*) or32-*)
os=-coff os=-coff
;; ;;
@ -1527,7 +1613,7 @@ case $basic_machine in
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
*-knuth) *-knuth)
os=-mmixware os=-mmixware
;; ;;
*-wec) *-wec)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,10 +44,10 @@ struct _xmlDebugCtxt {
int depth; /* current depth */ int depth; /* current depth */
xmlDocPtr doc; /* current document */ xmlDocPtr doc; /* current document */
xmlNodePtr node; /* current node */ xmlNodePtr node; /* current node */
xmlDictPtr dict; /* the doc dictionnary */ xmlDictPtr dict; /* the doc dictionary */
int check; /* do just checkings */ int check; /* do just checkings */
int errors; /* number of errors found */ int errors; /* number of errors found */
int nodict; /* if the document has no dictionnary */ int nodict; /* if the document has no dictionary */
int options; /* options */ int options; /* options */
}; };
@ -164,7 +164,7 @@ xmlDebugErr(xmlDebugCtxtPtr ctxt, int error, const char *msg)
NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 0, 0,
"%s", msg); "%s", msg);
} }
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra) xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
{ {
ctxt->errors++; ctxt->errors++;
@ -174,7 +174,7 @@ xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 0, 0,
msg, extra); msg, extra);
} }
static void static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra) xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra)
{ {
ctxt->errors++; ctxt->errors++;
@ -243,7 +243,7 @@ xmlCtxtCheckString(xmlDebugCtxtPtr ctxt, const xmlChar * str)
* @ctxt: the debug context * @ctxt: the debug context
* @name: the name * @name: the name
* *
* Do debugging on the name, for example the dictionnary status and * Do debugging on the name, for example the dictionary status and
* conformance to the Name production. * conformance to the Name production.
*/ */
static void static void
@ -254,16 +254,18 @@ xmlCtxtCheckName(xmlDebugCtxtPtr ctxt, const xmlChar * name)
xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL"); xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
return; return;
} }
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
if (xmlValidateName(name, 0)) { if (xmlValidateName(name, 0)) {
xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME, xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
"Name is not an NCName '%s'", (const char *) name); "Name is not an NCName '%s'", (const char *) name);
} }
#endif
if ((ctxt->dict != NULL) && if ((ctxt->dict != NULL) &&
(!xmlDictOwns(ctxt->dict, name)) && (!xmlDictOwns(ctxt->dict, name)) &&
((ctxt->doc == NULL) || ((ctxt->doc == NULL) ||
((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) { ((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) {
xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT, xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT,
"Name is not from the document dictionnary '%s'", "Name is not from the document dictionary '%s'",
(const char *) name); (const char *) name);
} }
} }
@ -290,7 +292,7 @@ xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) {
/* desactivated right now as it raises too many errors */ /* desactivated right now as it raises too many errors */
if (doc->type == XML_DOCUMENT_NODE) if (doc->type == XML_DOCUMENT_NODE)
xmlDebugErr(ctxt, XML_CHECK_NO_DICT, xmlDebugErr(ctxt, XML_CHECK_NO_DICT,
"Document has no dictionnary\n"); "Document has no dictionary\n");
#endif #endif
ctxt->nodict = 1; ctxt->nodict = 1;
} }
@ -1723,8 +1725,11 @@ xmlLsOneNode(FILE *output, xmlNodePtr node) {
switch (node->type) { switch (node->type) {
case XML_ELEMENT_NODE: case XML_ELEMENT_NODE:
if (node->name != NULL) if (node->name != NULL) {
if ((node->ns != NULL) && (node->ns->prefix != NULL))
fprintf(output, "%s:", node->ns->prefix);
fprintf(output, "%s", (const char *) node->name); fprintf(output, "%s", (const char *) node->name);
}
break; break;
case XML_ATTRIBUTE_NODE: case XML_ATTRIBUTE_NODE:
if (node->name != NULL) if (node->name != NULL)
@ -1798,7 +1803,7 @@ xmlBoolToText(int boolval)
#ifdef LIBXML_XPATH_ENABLED #ifdef LIBXML_XPATH_ENABLED
/**************************************************************** /****************************************************************
* * * *
* The XML shell related functions * * The XML shell related functions *
* * * *
****************************************************************/ ****************************************************************/
@ -2695,6 +2700,8 @@ xmlShellDu(xmlShellCtxtPtr ctxt,
} else if (node->type == XML_ELEMENT_NODE) { } else if (node->type == XML_ELEMENT_NODE) {
for (i = 0; i < indent; i++) for (i = 0; i < indent; i++)
fprintf(ctxt->output, " "); fprintf(ctxt->output, " ");
if ((node->ns) && (node->ns->prefix))
fprintf(ctxt->output, "%s:", node->ns->prefix);
fprintf(ctxt->output, "%s\n", node->name); fprintf(ctxt->output, "%s\n", node->name);
} else { } else {
} }
@ -2836,6 +2843,10 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
while (1) { while (1) {
if (ctxt->node == (xmlNodePtr) ctxt->doc) if (ctxt->node == (xmlNodePtr) ctxt->doc)
snprintf(prompt, sizeof(prompt), "%s > ", "/"); snprintf(prompt, sizeof(prompt), "%s > ", "/");
else if ((ctxt->node != NULL) && (ctxt->node->name) &&
(ctxt->node->ns) && (ctxt->node->ns->prefix))
snprintf(prompt, sizeof(prompt), "%s:%s > ",
(ctxt->node->ns->prefix), ctxt->node->name);
else if ((ctxt->node != NULL) && (ctxt->node->name)) else if ((ctxt->node != NULL) && (ctxt->node->name))
snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name); snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name);
else else
@ -2910,6 +2921,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
fprintf(ctxt->output, "\t the default namespace if any uses 'defaultns' prefix\n"); fprintf(ctxt->output, "\t the default namespace if any uses 'defaultns' prefix\n");
#endif /* LIBXML_XPATH_ENABLED */ #endif /* LIBXML_XPATH_ENABLED */
fprintf(ctxt->output, "\tpwd display current working directory\n"); fprintf(ctxt->output, "\tpwd display current working directory\n");
fprintf(ctxt->output, "\twhereis display absolute path of [path] or current working directory\n");
fprintf(ctxt->output, "\tquit leave shell\n"); fprintf(ctxt->output, "\tquit leave shell\n");
#ifdef LIBXML_OUTPUT_ENABLED #ifdef LIBXML_OUTPUT_ENABLED
fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n"); fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n");
@ -2936,11 +2948,11 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} else if (!strcmp(command, "save")) { } else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL); xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) { } else if (!strcmp(command, "write")) {
if ((arg == NULL) || (arg[0] == 0)) if (arg[0] == 0)
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Write command requires a filename argument\n"); "Write command requires a filename argument\n");
else else
xmlShellWrite(ctxt, arg, NULL, NULL); xmlShellWrite(ctxt, arg, ctxt->node, NULL);
#endif /* LIBXML_OUTPUT_ENABLED */ #endif /* LIBXML_OUTPUT_ENABLED */
} else if (!strcmp(command, "grep")) { } else if (!strcmp(command, "grep")) {
xmlShellGrep(ctxt, arg, ctxt->node, NULL); xmlShellGrep(ctxt, arg, ctxt->node, NULL);
@ -2959,7 +2971,79 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL)) if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
fprintf(ctxt->output, "%s\n", dir); fprintf(ctxt->output, "%s\n", dir);
} else if (!strcmp(command, "du")) { } else if (!strcmp(command, "du")) {
xmlShellDu(ctxt, NULL, ctxt->node, NULL); if (arg[0] == 0) {
xmlShellDu(ctxt, NULL, ctxt->node, NULL);
} else {
ctxt->pctxt->node = ctxt->node;
#ifdef LIBXML_XPATH_ENABLED
ctxt->pctxt->node = ctxt->node;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else
list = NULL;
#endif /* LIBXML_XPATH_ENABLED */
if (list != NULL) {
switch (list->type) {
case XPATH_UNDEFINED:
xmlGenericError(xmlGenericErrorContext,
"%s: no such node\n", arg);
break;
case XPATH_NODESET:{
int indx;
if (list->nodesetval == NULL)
break;
for (indx = 0;
indx < list->nodesetval->nodeNr;
indx++)
xmlShellDu(ctxt, NULL,
list->nodesetval->
nodeTab[indx], NULL);
break;
}
case XPATH_BOOLEAN:
xmlGenericError(xmlGenericErrorContext,
"%s is a Boolean\n", arg);
break;
case XPATH_NUMBER:
xmlGenericError(xmlGenericErrorContext,
"%s is a number\n", arg);
break;
case XPATH_STRING:
xmlGenericError(xmlGenericErrorContext,
"%s is a string\n", arg);
break;
case XPATH_POINT:
xmlGenericError(xmlGenericErrorContext,
"%s is a point\n", arg);
break;
case XPATH_RANGE:
xmlGenericError(xmlGenericErrorContext,
"%s is a range\n", arg);
break;
case XPATH_LOCATIONSET:
xmlGenericError(xmlGenericErrorContext,
"%s is a range\n", arg);
break;
case XPATH_USERS:
xmlGenericError(xmlGenericErrorContext,
"%s is user-defined\n", arg);
break;
case XPATH_XSLT_TREE:
xmlGenericError(xmlGenericErrorContext,
"%s is an XSLT value tree\n",
arg);
break;
}
#ifdef LIBXML_XPATH_ENABLED
xmlXPathFreeObject(list);
#endif
} else {
xmlGenericError(xmlGenericErrorContext,
"%s: no such node\n", arg);
}
ctxt->pctxt->node = NULL;
}
} else if (!strcmp(command, "base")) { } else if (!strcmp(command, "base")) {
xmlShellBase(ctxt, NULL, ctxt->node, NULL); xmlShellBase(ctxt, NULL, ctxt->node, NULL);
} else if (!strcmp(command, "set")) { } else if (!strcmp(command, "set")) {
@ -3070,6 +3154,83 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} }
#ifdef LIBXML_XPATH_ENABLED #ifdef LIBXML_XPATH_ENABLED
xmlXPathFreeObject(list); xmlXPathFreeObject(list);
#endif
} else {
xmlGenericError(xmlGenericErrorContext,
"%s: no such node\n", arg);
}
ctxt->pctxt->node = NULL;
}
} else if (!strcmp(command, "whereis")) {
char dir[500];
if (arg[0] == 0) {
if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
fprintf(ctxt->output, "%s\n", dir);
} else {
ctxt->pctxt->node = ctxt->node;
#ifdef LIBXML_XPATH_ENABLED
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else
list = NULL;
#endif /* LIBXML_XPATH_ENABLED */
if (list != NULL) {
switch (list->type) {
case XPATH_UNDEFINED:
xmlGenericError(xmlGenericErrorContext,
"%s: no such node\n", arg);
break;
case XPATH_NODESET:{
int indx;
if (list->nodesetval == NULL)
break;
for (indx = 0;
indx < list->nodesetval->nodeNr;
indx++) {
if (!xmlShellPwd(ctxt, dir, list->nodesetval->
nodeTab[indx], NULL))
fprintf(ctxt->output, "%s\n", dir);
}
break;
}
case XPATH_BOOLEAN:
xmlGenericError(xmlGenericErrorContext,
"%s is a Boolean\n", arg);
break;
case XPATH_NUMBER:
xmlGenericError(xmlGenericErrorContext,
"%s is a number\n", arg);
break;
case XPATH_STRING:
xmlGenericError(xmlGenericErrorContext,
"%s is a string\n", arg);
break;
case XPATH_POINT:
xmlGenericError(xmlGenericErrorContext,
"%s is a point\n", arg);
break;
case XPATH_RANGE:
xmlGenericError(xmlGenericErrorContext,
"%s is a range\n", arg);
break;
case XPATH_LOCATIONSET:
xmlGenericError(xmlGenericErrorContext,
"%s is a range\n", arg);
break;
case XPATH_USERS:
xmlGenericError(xmlGenericErrorContext,
"%s is user-defined\n", arg);
break;
case XPATH_XSLT_TREE:
xmlGenericError(xmlGenericErrorContext,
"%s is an XSLT value tree\n",
arg);
break;
}
#ifdef LIBXML_XPATH_ENABLED
xmlXPathFreeObject(list);
#endif #endif
} else { } else {
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
@ -3082,7 +3243,12 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
ctxt->node = (xmlNodePtr) ctxt->doc; ctxt->node = (xmlNodePtr) ctxt->doc;
} else { } else {
#ifdef LIBXML_XPATH_ENABLED #ifdef LIBXML_XPATH_ENABLED
int l;
ctxt->pctxt->node = ctxt->node; ctxt->pctxt->node = ctxt->node;
l = strlen(arg);
if ((l >= 2) && (arg[l - 1] == '/'))
arg[l - 1] = 0;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else #else
list = NULL; list = NULL;

View File

@ -1,10 +1,9 @@
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2009-04-28.21; # UTC scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
case $1 in case $1 in
'') '')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2 echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1; exit 1;
;; ;;
-h | --h*) -h | --h*)
cat <<\EOF cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS] Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@ -40,11 +39,11 @@ as side-effects.
Environment variables: Environment variables:
depmode Dependency tracking mode. depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'. source Source file read by 'PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies. DEPDIR directory where to store dependencies.
depfile Dependency file to output. depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies. tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no). libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>. Report bugs to <bug-automake@gnu.org>.
@ -57,6 +56,66 @@ EOF
;; ;;
esac esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2 echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1 exit 1
@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We # Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below, # parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case # to make depend.m4 easier to write. Note that we *cannot* use a case
@ -80,18 +142,32 @@ if test "$depmode" = hp; then
fi fi
if test "$depmode" = dashXmstdout; then if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument. # This is just like dashmstdout with a different argument.
dashmflag=-xM dashmflag=-xM
depmode=dashmstdout depmode=dashmstdout
fi fi
cygpath_u="cygpath -u -f -" cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation. # This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward # Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4 # slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g" cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi fi
case "$depmode" in case "$depmode" in
@ -114,8 +190,7 @@ gcc3)
done done
"$@" "$@"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -123,13 +198,17 @@ gcc3)
;; ;;
gcc) gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's ## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method: ## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end ## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly. ## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.) ## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). ## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse ## - Using -M directly means running the compiler twice (even worse
## than renaming). ## than renaming).
if test -z "$gccflag"; then if test -z "$gccflag"; then
@ -137,31 +216,31 @@ gcc)
fi fi
"$@" -Wp,"$gccflag$tmpdepfile" "$@" -Wp,"$gccflag$tmpdepfile"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz # The second -e expression handles DOS-style file names with drive
## The second -e expression handles DOS-style file names with drive letters. # letters.
sed -e 's/^[^:]*: / /' \ sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem. ## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file ## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is ## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding ## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do ## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly. ## this for us directly.
tr ' ' ' ## Some versions of gcc put a space before the ':'. On the theory
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as ## that the space means something, we add a space to the output as
## well. ## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation ## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround. ## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -179,8 +258,7 @@ sgi)
"$@" -MDupdate "$tmpdepfile" "$@" -MDupdate "$tmpdepfile"
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -188,43 +266,41 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be # Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle # clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in # lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the # the IRIX cc adds comments like '#:fec' to the end of the
# dependency line. # dependency line.
tr ' ' ' tr ' ' "$nl" < "$tmpdepfile" \
' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ | tr "$nl" ' ' >> "$depfile"
tr '
' ' ' >> "$depfile"
echo >> "$depfile" echo >> "$depfile"
# The second pass generates a dummy entry for each header file. # The second pass generates a dummy entry for each header file.
tr ' ' ' tr ' ' "$nl" < "$tmpdepfile" \
' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile"
>> "$depfile"
else else
# The sourcefile does not contain any dependencies, so just make_dummy_depfile
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi fi
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix) aix)
# The C for AIX Compiler uses -M and outputs the dependencies # The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the # in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the # current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information. # start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases. # Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u tmpdepfile2=$base.u
@ -237,9 +313,7 @@ aix)
"$@" -M "$@" -M
fi fi
stat=$? stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat exit $stat
fi fi
@ -248,44 +322,100 @@ aix)
do do
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then aix_post_process_depfile
# Each line is of the form `foo.o: dependent.h'. ;;
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'. tcc)
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# That's a tab and a space in the []. # FIXME: That version still under development at the moment of writing.
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" # Make that this statement remains true also for stable, released
else # versions.
# The sourcefile does not contain any dependencies, so just # It will wrap lines (doesn't matter whether long or short) with a
# store a dummy comment line, to avoid errors with the Makefile # trailing '\', as in:
# "include basename.Plo" scheme. #
echo "#dummy" > "$depfile" # foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
icc) ## The order of this option in the case statement is important, since the
# Intel's C compiler understands `-MD -MF file'. However on ## shell code in configure will try each of these formats in the order
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c ## listed in this file. A plain '-MD' option would be understood by many
# ICC 7.0 will fill foo.d with something like ## compilers, so we must ensure this comes after the gcc and icc options.
# foo.o: sub/foo.c pgcc)
# foo.o: sub/foo.h # Portland's C compiler understands '-MD'.
# which is wrong. We want: # Will always output deps to 'file.d' where file is the root name of the
# sub/foo.o: sub/foo.c # source file under compilation, even if file resides in a subdirectory.
# sub/foo.o: sub/foo.h # The object file name does not affect the name of the '.d' file.
# sub/foo.c: # pgcc 10.2 will output
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h # foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ : # and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \ # foo.o: sub/foo.c ... \
# sub/foo.h ... \ # sub/foo.h ... \
# ... # ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
"$@" -MD -MF "$tmpdepfile" # For projects that build the same source file twice into different object
stat=$? # files, the pgcc approach of using the *source* file root name can cause
if test $stat -eq 0; then : # problems in parallel builds. Use a locking strategy to avoid stomping on
else # the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -297,8 +427,8 @@ icc)
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation # Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround. # correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
sed -e 's/$/ :/' >> "$depfile" | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -309,9 +439,8 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that # 'foo.d', which lands next to the object file, wherever that
# happens to be. # happens to be.
# Much of this is similar to the tru64 case; see comments there. # Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d tmpdepfile2=$dir.libs/$base.d
@ -322,8 +451,7 @@ hp2)
"$@" +Maked "$@" +Maked
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile1" "$tmpdepfile2" rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat exit $stat
fi fi
@ -333,77 +461,107 @@ hp2)
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines. # Add 'dependent.h:' lines.
sed -ne '2,${ sed -ne '2,${
s/^ *// s/^ *//
s/ \\*$// s/ \\*$//
s/$/:/ s/$/:/
p p
}' "$tmpdepfile" >> "$depfile" }' "$tmpdepfile" >> "$depfile"
else else
echo "#dummy" > "$depfile" make_dummy_depfile
fi fi
rm -f "$tmpdepfile" "$tmpdepfile2" rm -f "$tmpdepfile" "$tmpdepfile2"
;; ;;
tru64) tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side # The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too. # dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected. # Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a # Libtool generates 2 separate objects for the 2 libraries. These
# static library. This mechanism is used in libtool 1.4 series to # two compilations output dependencies in $dir.libs/$base.o.d and
# handle both shared and static libraries in a single compilation. # in $dir$base.o.d. We have to check for both files, because
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # one of the two compilations can be disabled. We should prefer
# # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# With libtool 1.5 this exception was removed, and libtool now # automatically cleaned when .libs/ is deleted, while ignoring
# generates 2 separate objects for the 2 libraries. These two # the former would cause a distcleancheck panic.
# compilations output dependencies in $dir.libs/$base.o.d and tmpdepfile1=$dir$base.o.d # libtool 1.5
# in $dir$base.o.d. We have to check for both files, because tmpdepfile2=$dir.libs/$base.o.d # Likewise.
# one of the two compilations can be disabled. We should prefer tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is "$@" -Wc,-MD
# automatically cleaned when .libs/ is deleted, while ignoring else
# the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.d
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.d
tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir$base.d
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 "$@" -MD
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 fi
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat
exit $stat fi
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do do
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then # Same post-processing that is required for AIX mode.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" aix_post_process_depfile
# That's a tab and a space in the []. ;;
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else msvc7)
echo "#dummy" > "$depfile" if test "$libtool" = yes; then
fi showIncludes=-Wc,-showIncludes
rm -f "$tmpdepfile" else
;; showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect) #nosideeffect)
# This comment above is used by automake to tell side-effect # This comment above is used by automake to tell side-effect
@ -422,7 +580,7 @@ dashmstdout)
shift shift
fi fi
# Remove `-o $object'. # Remove '-o $object'.
IFS=" " IFS=" "
for arg for arg
do do
@ -442,18 +600,18 @@ dashmstdout)
done done
test -z "$dashmflag" && dashmflag=-M test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:' # Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames: # in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag | "$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" cat < "$tmpdepfile" > "$depfile"
tr ' ' ' # Some versions of the HPUX 10.20 sed can't process this sed invocation
' < "$tmpdepfile" | \ # correctly. Breaking it into two sed invocations is a workaround.
## Some versions of the HPUX 10.20 sed can't process this invocation tr ' ' "$nl" < "$tmpdepfile" \
## correctly. Breaking it into two sed invocations is a workaround. | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -503,12 +661,15 @@ makedepend)
touch "$tmpdepfile" touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" # makedepend may prepend the VPATH from the source file name to the object.
sed '1,2d' "$tmpdepfile" | tr ' ' ' # No need to regex-escape $object, excess matching of '.' is harmless.
' | \ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
## Some versions of the HPUX 10.20 sed can't process this invocation # Some versions of the HPUX 10.20 sed can't process the last invocation
## correctly. Breaking it into two sed invocations is a workaround. # correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak rm -f "$tmpdepfile" "$tmpdepfile".bak
;; ;;
@ -525,7 +686,7 @@ cpp)
shift shift
fi fi
# Remove `-o $object'. # Remove '-o $object'.
IFS=" " IFS=" "
for arg for arg
do do
@ -544,10 +705,10 @@ cpp)
esac esac
done done
"$@" -E | "$@" -E \
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
sed '$ s: \\$::' > "$tmpdepfile" | sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile" cat < "$tmpdepfile" >> "$depfile"
@ -579,23 +740,23 @@ msvisualcpp)
shift shift
;; ;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@" set fnord "$@"
shift shift
shift shift
;; ;;
*) *)
set fnord "$@" "$arg" set fnord "$@" "$arg"
shift shift
shift shift
;; ;;
esac esac
done done
"$@" -E 2>/dev/null | "$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo " " >> "$depfile" echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;

View File

@ -2,7 +2,7 @@
* dict.c: dictionary of reusable strings, just used to avoid allocation * dict.c: dictionary of reusable strings, just used to avoid allocation
* and freeing operations. * and freeing operations.
* *
* Copyright (C) 2003 Daniel Veillard. * Copyright (C) 2003-2012 Daniel Veillard.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -19,6 +19,29 @@
#define IN_LIBXML #define IN_LIBXML
#include "libxml.h" #include "libxml.h"
#include <limits.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
/*
* Following http://www.ocert.org/advisories/ocert-2011-003.html
* it seems that having hash randomization might be a good idea
* when using XML with untrusted data
* Note1: that it works correctly only if compiled with WITH_BIG_KEY
* which is the default.
* Note2: the fast function used for a small dict won't protect very
* well but since the attack is based on growing a very big hash
* list we will use the BigKey algo as soon as the hash size grows
* over MIN_DICT_SIZE so this actually works
*/
#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
#define DICT_RANDOMIZATION
#endif
#include <string.h> #include <string.h>
#ifdef HAVE_STDINT_H #ifdef HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
@ -44,34 +67,34 @@ typedef unsigned __int32 uint32_t;
#define WITH_BIG_KEY #define WITH_BIG_KEY
#ifdef WITH_BIG_KEY #ifdef WITH_BIG_KEY
#define xmlDictComputeKey(dict, name, len) \ #define xmlDictComputeKey(dict, name, len) \
(((dict)->size == MIN_DICT_SIZE) ? \ (((dict)->size == MIN_DICT_SIZE) ? \
xmlDictComputeFastKey(name, len) : \ xmlDictComputeFastKey(name, len, (dict)->seed) : \
xmlDictComputeBigKey(name, len)) xmlDictComputeBigKey(name, len, (dict)->seed))
#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ #define xmlDictComputeQKey(dict, prefix, plen, name, len) \
(((prefix) == NULL) ? \ (((prefix) == NULL) ? \
(xmlDictComputeKey(dict, name, len)) : \ (xmlDictComputeKey(dict, name, len)) : \
(((dict)->size == MIN_DICT_SIZE) ? \ (((dict)->size == MIN_DICT_SIZE) ? \
xmlDictComputeFastQKey(prefix, plen, name, len) : \ xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) : \
xmlDictComputeBigQKey(prefix, plen, name, len))) xmlDictComputeBigQKey(prefix, plen, name, len, (dict)->seed)))
#else /* !WITH_BIG_KEY */ #else /* !WITH_BIG_KEY */
#define xmlDictComputeKey(dict, name, len) \ #define xmlDictComputeKey(dict, name, len) \
xmlDictComputeFastKey(name, len) xmlDictComputeFastKey(name, len, (dict)->seed)
#define xmlDictComputeQKey(dict, prefix, plen, name, len) \ #define xmlDictComputeQKey(dict, prefix, plen, name, len) \
xmlDictComputeFastQKey(prefix, plen, name, len) xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed)
#endif /* WITH_BIG_KEY */ #endif /* WITH_BIG_KEY */
/* /*
* An entry in the dictionnary * An entry in the dictionary
*/ */
typedef struct _xmlDictEntry xmlDictEntry; typedef struct _xmlDictEntry xmlDictEntry;
typedef xmlDictEntry *xmlDictEntryPtr; typedef xmlDictEntry *xmlDictEntryPtr;
struct _xmlDictEntry { struct _xmlDictEntry {
struct _xmlDictEntry *next; struct _xmlDictEntry *next;
const xmlChar *name; const xmlChar *name;
int len; unsigned int len;
int valid; int valid;
unsigned long okey; unsigned long okey;
}; };
@ -82,22 +105,26 @@ struct _xmlDictStrings {
xmlDictStringsPtr next; xmlDictStringsPtr next;
xmlChar *free; xmlChar *free;
xmlChar *end; xmlChar *end;
int size; size_t size;
int nbStrings; size_t nbStrings;
xmlChar array[1]; xmlChar array[1];
}; };
/* /*
* The entire dictionnary * The entire dictionary
*/ */
struct _xmlDict { struct _xmlDict {
int ref_counter; int ref_counter;
struct _xmlDictEntry *dict; struct _xmlDictEntry *dict;
int size; size_t size;
int nbElems; unsigned int nbElems;
xmlDictStringsPtr strings; xmlDictStringsPtr strings;
struct _xmlDict *subdict; struct _xmlDict *subdict;
/* used for randomization */
int seed;
/* used to impose a limit on size */
size_t limit;
}; };
/* /*
@ -111,28 +138,84 @@ static xmlRMutexPtr xmlDictMutex = NULL;
*/ */
static int xmlDictInitialized = 0; static int xmlDictInitialized = 0;
#ifdef DICT_RANDOMIZATION
#ifdef HAVE_RAND_R
/*
* Internal data for random function, protected by xmlDictMutex
*/
static unsigned int rand_seed = 0;
#endif
#endif
/** /**
* xmlInitializeDict: * xmlInitializeDict:
* *
* Do the dictionary mutex initialization. * Do the dictionary mutex initialization.
* this function is not thread safe, initialization should * this function is deprecated
* preferably be done once at startup *
* Returns 0 if initialization was already done, and 1 if that
* call led to the initialization
*/ */
static int xmlInitializeDict(void) { int xmlInitializeDict(void) {
return(0);
}
/**
* __xmlInitializeDict:
*
* This function is not public
* Do the dictionary mutex initialization.
* this function is not thread safe, initialization should
* normally be done once at setup when called from xmlOnceInit()
* we may also land in this code if thread support is not compiled in
*
* Returns 0 if initialization was already done, and 1 if that
* call led to the initialization
*/
int __xmlInitializeDict(void) {
if (xmlDictInitialized) if (xmlDictInitialized)
return(1); return(1);
if ((xmlDictMutex = xmlNewRMutex()) == NULL) if ((xmlDictMutex = xmlNewRMutex()) == NULL)
return(0); return(0);
xmlRMutexLock(xmlDictMutex);
#ifdef DICT_RANDOMIZATION
#ifdef HAVE_RAND_R
rand_seed = time(NULL);
rand_r(& rand_seed);
#else
srand(time(NULL));
#endif
#endif
xmlDictInitialized = 1; xmlDictInitialized = 1;
xmlRMutexUnlock(xmlDictMutex);
return(1); return(1);
} }
#ifdef DICT_RANDOMIZATION
int __xmlRandom(void) {
int ret;
if (xmlDictInitialized == 0)
__xmlInitializeDict();
xmlRMutexLock(xmlDictMutex);
#ifdef HAVE_RAND_R
ret = rand_r(& rand_seed);
#else
ret = rand();
#endif
xmlRMutexUnlock(xmlDictMutex);
return(ret);
}
#endif
/** /**
* xmlDictCleanup: * xmlDictCleanup:
* *
* Free the dictionary mutex. * Free the dictionary mutex. Do not call unless sure the library
* is not in use anymore !
*/ */
void void
xmlDictCleanup(void) { xmlDictCleanup(void) {
@ -146,19 +229,20 @@ xmlDictCleanup(void) {
/* /*
* xmlDictAddString: * xmlDictAddString:
* @dict: the dictionnary * @dict: the dictionary
* @name: the name of the userdata * @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed * @len: the length of the name
* *
* Add the string to the array[s] * Add the string to the array[s]
* *
* Returns the pointer of the local string, or NULL in case of error. * Returns the pointer of the local string, or NULL in case of error.
*/ */
static const xmlChar * static const xmlChar *
xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) { xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
xmlDictStringsPtr pool; xmlDictStringsPtr pool;
const xmlChar *ret; const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
size_t limit = 0;
#ifdef DICT_DEBUG_PATTERNS #ifdef DICT_DEBUG_PATTERNS
fprintf(stderr, "-"); fprintf(stderr, "-");
@ -168,12 +252,17 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) {
if (pool->end - pool->free > namelen) if (pool->end - pool->free > namelen)
goto found_pool; goto found_pool;
if (pool->size > size) size = pool->size; if (pool->size > size) size = pool->size;
limit += pool->size;
pool = pool->next; pool = pool->next;
} }
/* /*
* Not found, need to allocate * Not found, need to allocate
*/ */
if (pool == NULL) { if (pool == NULL) {
if ((dict->limit > 0) && (limit > dict->limit)) {
return(NULL);
}
if (size == 0) size = 1000; if (size == 0) size = 1000;
else size *= 4; /* exponential growth */ else size *= 4; /* exponential growth */
if (size < 4 * namelen) if (size < 4 * namelen)
@ -202,23 +291,24 @@ found_pool:
/* /*
* xmlDictAddQString: * xmlDictAddQString:
* @dict: the dictionnary * @dict: the dictionary
* @prefix: the prefix of the userdata * @prefix: the prefix of the userdata
* @plen: the prefix length * @plen: the prefix length
* @name: the name of the userdata * @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed * @len: the length of the name
* *
* Add the QName to the array[s] * Add the QName to the array[s]
* *
* Returns the pointer of the local string, or NULL in case of error. * Returns the pointer of the local string, or NULL in case of error.
*/ */
static const xmlChar * static const xmlChar *
xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, int plen, xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen,
const xmlChar *name, int namelen) const xmlChar *name, unsigned int namelen)
{ {
xmlDictStringsPtr pool; xmlDictStringsPtr pool;
const xmlChar *ret; const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */ size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
size_t limit = 0;
if (prefix == NULL) return(xmlDictAddString(dict, name, namelen)); if (prefix == NULL) return(xmlDictAddString(dict, name, namelen));
@ -230,12 +320,17 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, int plen,
if (pool->end - pool->free > namelen + plen + 1) if (pool->end - pool->free > namelen + plen + 1)
goto found_pool; goto found_pool;
if (pool->size > size) size = pool->size; if (pool->size > size) size = pool->size;
limit += pool->size;
pool = pool->next; pool = pool->next;
} }
/* /*
* Not found, need to allocate * Not found, need to allocate
*/ */
if (pool == NULL) { if (pool == NULL) {
if ((dict->limit > 0) && (limit > dict->limit)) {
return(NULL);
}
if (size == 0) size = 1000; if (size == 0) size = 1000;
else size *= 4; /* exponential growth */ else size *= 4; /* exponential growth */
if (size < 4 * (namelen + plen + 1)) if (size < 4 * (namelen + plen + 1))
@ -277,13 +372,13 @@ found_pool:
*/ */
static uint32_t static uint32_t
xmlDictComputeBigKey(const xmlChar* data, int namelen) { xmlDictComputeBigKey(const xmlChar* data, int namelen, int seed) {
uint32_t hash; uint32_t hash;
int i; int i;
if (namelen <= 0 || data == NULL) return(0); if (namelen <= 0 || data == NULL) return(0);
hash = 0; hash = seed;
for (i = 0;i < namelen; i++) { for (i = 0;i < namelen; i++) {
hash += data[i]; hash += data[i];
@ -310,12 +405,12 @@ xmlDictComputeBigKey(const xmlChar* data, int namelen) {
*/ */
static unsigned long static unsigned long
xmlDictComputeBigQKey(const xmlChar *prefix, int plen, xmlDictComputeBigQKey(const xmlChar *prefix, int plen,
const xmlChar *name, int len) const xmlChar *name, int len, int seed)
{ {
uint32_t hash; uint32_t hash;
int i; int i;
hash = 0; hash = seed;
for (i = 0;i < plen; i++) { for (i = 0;i < plen; i++) {
hash += prefix[i]; hash += prefix[i];
@ -346,8 +441,8 @@ xmlDictComputeBigQKey(const xmlChar *prefix, int plen,
* for low hash table fill. * for low hash table fill.
*/ */
static unsigned long static unsigned long
xmlDictComputeFastKey(const xmlChar *name, int namelen) { xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) {
unsigned long value = 0L; unsigned long value = seed;
if (name == NULL) return(0); if (name == NULL) return(0);
value = *name; value = *name;
@ -381,9 +476,9 @@ xmlDictComputeFastKey(const xmlChar *name, int namelen) {
*/ */
static unsigned long static unsigned long
xmlDictComputeFastQKey(const xmlChar *prefix, int plen, xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
const xmlChar *name, int len) const xmlChar *name, int len, int seed)
{ {
unsigned long value = 0L; unsigned long value = (unsigned long) seed;
if (plen == 0) if (plen == 0)
value += 30 * (unsigned long) ':'; value += 30 * (unsigned long) ':';
@ -391,7 +486,10 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
value += 30 * (*prefix); value += 30 * (*prefix);
if (len > 10) { if (len > 10) {
value += name[len - (plen + 1 + 1)]; int offset = len - (plen + 1 + 1);
if (offset < 0)
offset = len - (10 + 1);
value += name[offset];
len = 10; len = 10;
if (plen > 10) if (plen > 10)
plen = 10; plen = 10;
@ -435,14 +533,14 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
* *
* Create a new dictionary * Create a new dictionary
* *
* Returns the newly created dictionnary, or NULL if an error occured. * Returns the newly created dictionary, or NULL if an error occured.
*/ */
xmlDictPtr xmlDictPtr
xmlDictCreate(void) { xmlDictCreate(void) {
xmlDictPtr dict; xmlDictPtr dict;
if (!xmlDictInitialized) if (!xmlDictInitialized)
if (!xmlInitializeDict()) if (!__xmlInitializeDict())
return(NULL); return(NULL);
#ifdef DICT_DEBUG_PATTERNS #ifdef DICT_DEBUG_PATTERNS
@ -452,6 +550,7 @@ xmlDictCreate(void) {
dict = xmlMalloc(sizeof(xmlDict)); dict = xmlMalloc(sizeof(xmlDict));
if (dict) { if (dict) {
dict->ref_counter = 1; dict->ref_counter = 1;
dict->limit = 0;
dict->size = MIN_DICT_SIZE; dict->size = MIN_DICT_SIZE;
dict->nbElems = 0; dict->nbElems = 0;
@ -460,6 +559,11 @@ xmlDictCreate(void) {
dict->subdict = NULL; dict->subdict = NULL;
if (dict->dict) { if (dict->dict) {
memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry)); memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));
#ifdef DICT_RANDOMIZATION
dict->seed = __xmlRandom();
#else
dict->seed = 0;
#endif
return(dict); return(dict);
} }
xmlFree(dict); xmlFree(dict);
@ -469,14 +573,14 @@ xmlDictCreate(void) {
/** /**
* xmlDictCreateSub: * xmlDictCreateSub:
* @sub: an existing dictionnary * @sub: an existing dictionary
* *
* Create a new dictionary, inheriting strings from the read-only * Create a new dictionary, inheriting strings from the read-only
* dictionnary @sub. On lookup, strings are first searched in the * dictionary @sub. On lookup, strings are first searched in the
* new dictionnary, then in @sub, and if not found are created in the * new dictionary, then in @sub, and if not found are created in the
* new dictionnary. * new dictionary.
* *
* Returns the newly created dictionnary, or NULL if an error occured. * Returns the newly created dictionary, or NULL if an error occured.
*/ */
xmlDictPtr xmlDictPtr
xmlDictCreateSub(xmlDictPtr sub) { xmlDictCreateSub(xmlDictPtr sub) {
@ -486,6 +590,7 @@ xmlDictCreateSub(xmlDictPtr sub) {
#ifdef DICT_DEBUG_PATTERNS #ifdef DICT_DEBUG_PATTERNS
fprintf(stderr, "R"); fprintf(stderr, "R");
#endif #endif
dict->seed = sub->seed;
dict->subdict = sub; dict->subdict = sub;
xmlDictReference(dict->subdict); xmlDictReference(dict->subdict);
} }
@ -494,7 +599,7 @@ xmlDictCreateSub(xmlDictPtr sub) {
/** /**
* xmlDictReference: * xmlDictReference:
* @dict: the dictionnary * @dict: the dictionary
* *
* Increment the reference counter of a dictionary * Increment the reference counter of a dictionary
* *
@ -503,7 +608,7 @@ xmlDictCreateSub(xmlDictPtr sub) {
int int
xmlDictReference(xmlDictPtr dict) { xmlDictReference(xmlDictPtr dict) {
if (!xmlDictInitialized) if (!xmlDictInitialized)
if (!xmlInitializeDict()) if (!__xmlInitializeDict())
return(-1); return(-1);
if (dict == NULL) return -1; if (dict == NULL) return -1;
@ -515,17 +620,17 @@ xmlDictReference(xmlDictPtr dict) {
/** /**
* xmlDictGrow: * xmlDictGrow:
* @dict: the dictionnary * @dict: the dictionary
* @size: the new size of the dictionnary * @size: the new size of the dictionary
* *
* resize the dictionnary * resize the dictionary
* *
* Returns 0 in case of success, -1 in case of failure * Returns 0 in case of success, -1 in case of failure
*/ */
static int static int
xmlDictGrow(xmlDictPtr dict, int size) { xmlDictGrow(xmlDictPtr dict, size_t size) {
unsigned long key, okey; unsigned long key, okey;
int oldsize, i; size_t oldsize, i;
xmlDictEntryPtr iter, next; xmlDictEntryPtr iter, next;
struct _xmlDictEntry *olddict; struct _xmlDictEntry *olddict;
#ifdef DEBUG_GROW #ifdef DEBUG_GROW
@ -642,7 +747,7 @@ xmlDictGrow(xmlDictPtr dict, int size) {
#ifdef DEBUG_GROW #ifdef DEBUG_GROW
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"xmlDictGrow : from %d to %d, %d elems\n", oldsize, size, nbElem); "xmlDictGrow : from %lu to %lu, %u elems\n", oldsize, size, nbElem);
#endif #endif
return(ret); return(ret);
@ -650,14 +755,14 @@ xmlDictGrow(xmlDictPtr dict, int size) {
/** /**
* xmlDictFree: * xmlDictFree:
* @dict: the dictionnary * @dict: the dictionary
* *
* Free the hash @dict and its contents. The userdata is * Free the hash @dict and its contents. The userdata is
* deallocated with @f if provided. * deallocated with @f if provided.
*/ */
void void
xmlDictFree(xmlDictPtr dict) { xmlDictFree(xmlDictPtr dict) {
int i; size_t i;
xmlDictEntryPtr iter; xmlDictEntryPtr iter;
xmlDictEntryPtr next; xmlDictEntryPtr next;
int inside_dict = 0; int inside_dict = 0;
@ -667,7 +772,7 @@ xmlDictFree(xmlDictPtr dict) {
return; return;
if (!xmlDictInitialized) if (!xmlDictInitialized)
if (!xmlInitializeDict()) if (!__xmlInitializeDict())
return; return;
/* decrement the counter, it may be shared by a parser and docs */ /* decrement the counter, it may be shared by a parser and docs */
@ -712,11 +817,11 @@ xmlDictFree(xmlDictPtr dict) {
/** /**
* xmlDictLookup: * xmlDictLookup:
* @dict: the dictionnary * @dict: the dictionary
* @name: the name of the userdata * @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed * @len: the length of the name, if -1 it is recomputed
* *
* Add the @name to the dictionnary @dict if not present. * Add the @name to the dictionary @dict if not present.
* *
* Returns the internal copy of the name or NULL in case of internal error * Returns the internal copy of the name or NULL in case of internal error
*/ */
@ -726,17 +831,24 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
xmlDictEntryPtr entry; xmlDictEntryPtr entry;
xmlDictEntryPtr insert; xmlDictEntryPtr insert;
const xmlChar *ret; const xmlChar *ret;
unsigned int l;
if ((dict == NULL) || (name == NULL)) if ((dict == NULL) || (name == NULL))
return(NULL); return(NULL);
if (len < 0) if (len < 0)
len = strlen((const char *) name); l = strlen((const char *) name);
else
l = len;
if (((dict->limit > 0) && (l >= dict->limit)) ||
(l > INT_MAX / 2))
return(NULL);
/* /*
* Check for duplicate and insertion location. * Check for duplicate and insertion location.
*/ */
okey = xmlDictComputeKey(dict, name, len); okey = xmlDictComputeKey(dict, name, l);
key = okey % dict->size; key = okey % dict->size;
if (dict->dict[key].valid == 0) { if (dict->dict[key].valid == 0) {
insert = NULL; insert = NULL;
@ -744,25 +856,25 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
for (insert = &(dict->dict[key]); insert->next != NULL; for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) { insert = insert->next) {
#ifdef __GNUC__ #ifdef __GNUC__
if ((insert->okey == okey) && (insert->len == len)) { if ((insert->okey == okey) && (insert->len == l)) {
if (!memcmp(insert->name, name, len)) if (!memcmp(insert->name, name, l))
return(insert->name); return(insert->name);
} }
#else #else
if ((insert->okey == okey) && (insert->len == len) && if ((insert->okey == okey) && (insert->len == l) &&
(!xmlStrncmp(insert->name, name, len))) (!xmlStrncmp(insert->name, name, l)))
return(insert->name); return(insert->name);
#endif #endif
nbi++; nbi++;
} }
#ifdef __GNUC__ #ifdef __GNUC__
if ((insert->okey == okey) && (insert->len == len)) { if ((insert->okey == okey) && (insert->len == l)) {
if (!memcmp(insert->name, name, len)) if (!memcmp(insert->name, name, l))
return(insert->name); return(insert->name);
} }
#else #else
if ((insert->okey == okey) && (insert->len == len) && if ((insert->okey == okey) && (insert->len == l) &&
(!xmlStrncmp(insert->name, name, len))) (!xmlStrncmp(insert->name, name, l)))
return(insert->name); return(insert->name);
#endif #endif
} }
@ -775,7 +887,7 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
(dict->subdict->size != MIN_DICT_SIZE)) || (dict->subdict->size != MIN_DICT_SIZE)) ||
((dict->size != MIN_DICT_SIZE) && ((dict->size != MIN_DICT_SIZE) &&
(dict->subdict->size == MIN_DICT_SIZE))) (dict->subdict->size == MIN_DICT_SIZE)))
skey = xmlDictComputeKey(dict->subdict, name, len); skey = xmlDictComputeKey(dict->subdict, name, l);
else else
skey = okey; skey = okey;
@ -786,32 +898,32 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL; for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) { tmp = tmp->next) {
#ifdef __GNUC__ #ifdef __GNUC__
if ((tmp->okey == skey) && (tmp->len == len)) { if ((tmp->okey == skey) && (tmp->len == l)) {
if (!memcmp(tmp->name, name, len)) if (!memcmp(tmp->name, name, l))
return(tmp->name); return(tmp->name);
} }
#else #else
if ((tmp->okey == skey) && (tmp->len == len) && if ((tmp->okey == skey) && (tmp->len == l) &&
(!xmlStrncmp(tmp->name, name, len))) (!xmlStrncmp(tmp->name, name, l)))
return(tmp->name); return(tmp->name);
#endif #endif
nbi++; nbi++;
} }
#ifdef __GNUC__ #ifdef __GNUC__
if ((tmp->okey == skey) && (tmp->len == len)) { if ((tmp->okey == skey) && (tmp->len == l)) {
if (!memcmp(tmp->name, name, len)) if (!memcmp(tmp->name, name, l))
return(tmp->name); return(tmp->name);
} }
#else #else
if ((tmp->okey == skey) && (tmp->len == len) && if ((tmp->okey == skey) && (tmp->len == l) &&
(!xmlStrncmp(tmp->name, name, len))) (!xmlStrncmp(tmp->name, name, l)))
return(tmp->name); return(tmp->name);
#endif #endif
} }
key = okey % dict->size; key = okey % dict->size;
} }
ret = xmlDictAddString(dict, name, len); ret = xmlDictAddString(dict, name, l);
if (ret == NULL) if (ret == NULL)
return(NULL); return(NULL);
if (insert == NULL) { if (insert == NULL) {
@ -822,7 +934,7 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
return(NULL); return(NULL);
} }
entry->name = ret; entry->name = ret;
entry->len = len; entry->len = l;
entry->next = NULL; entry->next = NULL;
entry->valid = 1; entry->valid = 1;
entry->okey = okey; entry->okey = okey;
@ -845,11 +957,11 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
/** /**
* xmlDictExists: * xmlDictExists:
* @dict: the dictionnary * @dict: the dictionary
* @name: the name of the userdata * @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed * @len: the length of the name, if -1 it is recomputed
* *
* Check if the @name exists in the dictionnary @dict. * Check if the @name exists in the dictionary @dict.
* *
* Returns the internal copy of the name or NULL if not found. * Returns the internal copy of the name or NULL if not found.
*/ */
@ -857,17 +969,23 @@ const xmlChar *
xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) { xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
unsigned long key, okey, nbi = 0; unsigned long key, okey, nbi = 0;
xmlDictEntryPtr insert; xmlDictEntryPtr insert;
unsigned int l;
if ((dict == NULL) || (name == NULL)) if ((dict == NULL) || (name == NULL))
return(NULL); return(NULL);
if (len < 0) if (len < 0)
len = strlen((const char *) name); l = strlen((const char *) name);
else
l = len;
if (((dict->limit > 0) && (l >= dict->limit)) ||
(l > INT_MAX / 2))
return(NULL);
/* /*
* Check for duplicate and insertion location. * Check for duplicate and insertion location.
*/ */
okey = xmlDictComputeKey(dict, name, len); okey = xmlDictComputeKey(dict, name, l);
key = okey % dict->size; key = okey % dict->size;
if (dict->dict[key].valid == 0) { if (dict->dict[key].valid == 0) {
insert = NULL; insert = NULL;
@ -875,25 +993,25 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
for (insert = &(dict->dict[key]); insert->next != NULL; for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) { insert = insert->next) {
#ifdef __GNUC__ #ifdef __GNUC__
if ((insert->okey == okey) && (insert->len == len)) { if ((insert->okey == okey) && (insert->len == l)) {
if (!memcmp(insert->name, name, len)) if (!memcmp(insert->name, name, l))
return(insert->name); return(insert->name);
} }
#else #else
if ((insert->okey == okey) && (insert->len == len) && if ((insert->okey == okey) && (insert->len == l) &&
(!xmlStrncmp(insert->name, name, len))) (!xmlStrncmp(insert->name, name, l)))
return(insert->name); return(insert->name);
#endif #endif
nbi++; nbi++;
} }
#ifdef __GNUC__ #ifdef __GNUC__
if ((insert->okey == okey) && (insert->len == len)) { if ((insert->okey == okey) && (insert->len == l)) {
if (!memcmp(insert->name, name, len)) if (!memcmp(insert->name, name, l))
return(insert->name); return(insert->name);
} }
#else #else
if ((insert->okey == okey) && (insert->len == len) && if ((insert->okey == okey) && (insert->len == l) &&
(!xmlStrncmp(insert->name, name, len))) (!xmlStrncmp(insert->name, name, l)))
return(insert->name); return(insert->name);
#endif #endif
} }
@ -906,7 +1024,7 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
(dict->subdict->size != MIN_DICT_SIZE)) || (dict->subdict->size != MIN_DICT_SIZE)) ||
((dict->size != MIN_DICT_SIZE) && ((dict->size != MIN_DICT_SIZE) &&
(dict->subdict->size == MIN_DICT_SIZE))) (dict->subdict->size == MIN_DICT_SIZE)))
skey = xmlDictComputeKey(dict->subdict, name, len); skey = xmlDictComputeKey(dict->subdict, name, l);
else else
skey = okey; skey = okey;
@ -917,25 +1035,25 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL; for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) { tmp = tmp->next) {
#ifdef __GNUC__ #ifdef __GNUC__
if ((tmp->okey == skey) && (tmp->len == len)) { if ((tmp->okey == skey) && (tmp->len == l)) {
if (!memcmp(tmp->name, name, len)) if (!memcmp(tmp->name, name, l))
return(tmp->name); return(tmp->name);
} }
#else #else
if ((tmp->okey == skey) && (tmp->len == len) && if ((tmp->okey == skey) && (tmp->len == l) &&
(!xmlStrncmp(tmp->name, name, len))) (!xmlStrncmp(tmp->name, name, l)))
return(tmp->name); return(tmp->name);
#endif #endif
nbi++; nbi++;
} }
#ifdef __GNUC__ #ifdef __GNUC__
if ((tmp->okey == skey) && (tmp->len == len)) { if ((tmp->okey == skey) && (tmp->len == l)) {
if (!memcmp(tmp->name, name, len)) if (!memcmp(tmp->name, name, l))
return(tmp->name); return(tmp->name);
} }
#else #else
if ((tmp->okey == skey) && (tmp->len == len) && if ((tmp->okey == skey) && (tmp->len == l) &&
(!xmlStrncmp(tmp->name, name, len))) (!xmlStrncmp(tmp->name, name, l)))
return(tmp->name); return(tmp->name);
#endif #endif
} }
@ -947,7 +1065,7 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
/** /**
* xmlDictQLookup: * xmlDictQLookup:
* @dict: the dictionnary * @dict: the dictionary
* @prefix: the prefix * @prefix: the prefix
* @name: the name * @name: the name
* *
@ -961,7 +1079,7 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
xmlDictEntryPtr entry; xmlDictEntryPtr entry;
xmlDictEntryPtr insert; xmlDictEntryPtr insert;
const xmlChar *ret; const xmlChar *ret;
int len, plen, l; unsigned int len, plen, l;
if ((dict == NULL) || (name == NULL)) if ((dict == NULL) || (name == NULL))
return(NULL); return(NULL);
@ -1052,7 +1170,7 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
/** /**
* xmlDictOwns: * xmlDictOwns:
* @dict: the dictionnary * @dict: the dictionary
* @str: the string * @str: the string
* *
* check if a string is owned by the disctionary * check if a string is owned by the disctionary
@ -1079,11 +1197,11 @@ xmlDictOwns(xmlDictPtr dict, const xmlChar *str) {
/** /**
* xmlDictSize: * xmlDictSize:
* @dict: the dictionnary * @dict: the dictionary
* *
* Query the number of elements installed in the hash @dict. * Query the number of elements installed in the hash @dict.
* *
* Returns the number of elements in the dictionnary or * Returns the number of elements in the dictionary or
* -1 in case of error * -1 in case of error
*/ */
int int
@ -1095,6 +1213,50 @@ xmlDictSize(xmlDictPtr dict) {
return(dict->nbElems); return(dict->nbElems);
} }
/**
* xmlDictSetLimit:
* @dict: the dictionary
* @limit: the limit in bytes
*
* Set a size limit for the dictionary
* Added in 2.9.0
*
* Returns the previous limit of the dictionary or 0
*/
size_t
xmlDictSetLimit(xmlDictPtr dict, size_t limit) {
size_t ret;
if (dict == NULL)
return(0);
ret = dict->limit;
dict->limit = limit;
return(ret);
}
/**
* xmlDictGetUsage:
* @dict: the dictionary
*
* Get how much memory is used by a dictionary for strings
* Added in 2.9.0
*
* Returns the amount of strings allocated
*/
size_t
xmlDictGetUsage(xmlDictPtr dict) {
xmlDictStringsPtr pool;
size_t limit = 0;
if (dict == NULL)
return(0);
pool = dict->strings;
while (pool != NULL) {
limit += pool->size;
pool = pool->next;
}
return(limit);
}
#define bottom_dict #define bottom_dict
#include "elfgcchack.h" #include "elfgcchack.h"

View File

@ -1061,7 +1061,7 @@ extern __typeof (xmlAddNotationDecl) xmlAddNotationDecl__internal_alias __attrib
#endif #endif
#endif #endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
#ifdef bottom_tree #ifdef bottom_tree
#undef xmlAddPrevSibling #undef xmlAddPrevSibling
extern __typeof (xmlAddPrevSibling) xmlAddPrevSibling __attribute((alias("xmlAddPrevSibling__internal_alias"))); extern __typeof (xmlAddPrevSibling) xmlAddPrevSibling __attribute((alias("xmlAddPrevSibling__internal_alias")));
@ -1343,6 +1343,68 @@ extern __typeof (xmlBoolToText) xmlBoolToText__internal_alias __attribute((visib
#endif #endif
#endif #endif
#ifdef bottom_buf
#undef xmlBufContent
extern __typeof (xmlBufContent) xmlBufContent __attribute((alias("xmlBufContent__internal_alias")));
#else
#ifndef xmlBufContent
extern __typeof (xmlBufContent) xmlBufContent__internal_alias __attribute((visibility("hidden")));
#define xmlBufContent xmlBufContent__internal_alias
#endif
#endif
#ifdef bottom_buf
#undef xmlBufEnd
extern __typeof (xmlBufEnd) xmlBufEnd __attribute((alias("xmlBufEnd__internal_alias")));
#else
#ifndef xmlBufEnd
extern __typeof (xmlBufEnd) xmlBufEnd__internal_alias __attribute((visibility("hidden")));
#define xmlBufEnd xmlBufEnd__internal_alias
#endif
#endif
#ifdef bottom_tree
#undef xmlBufGetNodeContent
extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent __attribute((alias("xmlBufGetNodeContent__internal_alias")));
#else
#ifndef xmlBufGetNodeContent
extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent__internal_alias __attribute((visibility("hidden")));
#define xmlBufGetNodeContent xmlBufGetNodeContent__internal_alias
#endif
#endif
#if defined(LIBXML_OUTPUT_ENABLED)
#ifdef bottom_xmlsave
#undef xmlBufNodeDump
extern __typeof (xmlBufNodeDump) xmlBufNodeDump __attribute((alias("xmlBufNodeDump__internal_alias")));
#else
#ifndef xmlBufNodeDump
extern __typeof (xmlBufNodeDump) xmlBufNodeDump__internal_alias __attribute((visibility("hidden")));
#define xmlBufNodeDump xmlBufNodeDump__internal_alias
#endif
#endif
#endif
#ifdef bottom_buf
#undef xmlBufShrink
extern __typeof (xmlBufShrink) xmlBufShrink __attribute((alias("xmlBufShrink__internal_alias")));
#else
#ifndef xmlBufShrink
extern __typeof (xmlBufShrink) xmlBufShrink__internal_alias __attribute((visibility("hidden")));
#define xmlBufShrink xmlBufShrink__internal_alias
#endif
#endif
#ifdef bottom_buf
#undef xmlBufUse
extern __typeof (xmlBufUse) xmlBufUse __attribute((alias("xmlBufUse__internal_alias")));
#else
#ifndef xmlBufUse
extern __typeof (xmlBufUse) xmlBufUse__internal_alias __attribute((visibility("hidden")));
#define xmlBufUse xmlBufUse__internal_alias
#endif
#endif
#ifdef bottom_tree #ifdef bottom_tree
#undef xmlBufferAdd #undef xmlBufferAdd
extern __typeof (xmlBufferAdd) xmlBufferAdd __attribute((alias("xmlBufferAdd__internal_alias"))); extern __typeof (xmlBufferAdd) xmlBufferAdd __attribute((alias("xmlBufferAdd__internal_alias")));
@ -1423,6 +1485,16 @@ extern __typeof (xmlBufferCreateStatic) xmlBufferCreateStatic__internal_alias __
#endif #endif
#endif #endif
#ifdef bottom_tree
#undef xmlBufferDetach
extern __typeof (xmlBufferDetach) xmlBufferDetach __attribute((alias("xmlBufferDetach__internal_alias")));
#else
#ifndef xmlBufferDetach
extern __typeof (xmlBufferDetach) xmlBufferDetach__internal_alias __attribute((visibility("hidden")));
#define xmlBufferDetach xmlBufferDetach__internal_alias
#endif
#endif
#ifdef bottom_tree #ifdef bottom_tree
#undef xmlBufferDump #undef xmlBufferDump
extern __typeof (xmlBufferDump) xmlBufferDump __attribute((alias("xmlBufferDump__internal_alias"))); extern __typeof (xmlBufferDump) xmlBufferDump __attribute((alias("xmlBufferDump__internal_alias")));
@ -2839,6 +2911,16 @@ extern __typeof (xmlDictFree) xmlDictFree__internal_alias __attribute((visibilit
#endif #endif
#endif #endif
#ifdef bottom_dict
#undef xmlDictGetUsage
extern __typeof (xmlDictGetUsage) xmlDictGetUsage __attribute((alias("xmlDictGetUsage__internal_alias")));
#else
#ifndef xmlDictGetUsage
extern __typeof (xmlDictGetUsage) xmlDictGetUsage__internal_alias __attribute((visibility("hidden")));
#define xmlDictGetUsage xmlDictGetUsage__internal_alias
#endif
#endif
#ifdef bottom_dict #ifdef bottom_dict
#undef xmlDictLookup #undef xmlDictLookup
extern __typeof (xmlDictLookup) xmlDictLookup __attribute((alias("xmlDictLookup__internal_alias"))); extern __typeof (xmlDictLookup) xmlDictLookup __attribute((alias("xmlDictLookup__internal_alias")));
@ -2879,6 +2961,16 @@ extern __typeof (xmlDictReference) xmlDictReference__internal_alias __attribute(
#endif #endif
#endif #endif
#ifdef bottom_dict
#undef xmlDictSetLimit
extern __typeof (xmlDictSetLimit) xmlDictSetLimit __attribute((alias("xmlDictSetLimit__internal_alias")));
#else
#ifndef xmlDictSetLimit
extern __typeof (xmlDictSetLimit) xmlDictSetLimit__internal_alias __attribute((visibility("hidden")));
#define xmlDictSetLimit xmlDictSetLimit__internal_alias
#endif
#endif
#ifdef bottom_dict #ifdef bottom_dict
#undef xmlDictSize #undef xmlDictSize
extern __typeof (xmlDictSize) xmlDictSize __attribute((alias("xmlDictSize__internal_alias"))); extern __typeof (xmlDictSize) xmlDictSize __attribute((alias("xmlDictSize__internal_alias")));
@ -4601,6 +4693,16 @@ extern __typeof (xmlInitializeCatalog) xmlInitializeCatalog__internal_alias __at
#endif #endif
#endif #endif
#ifdef bottom_dict
#undef xmlInitializeDict
extern __typeof (xmlInitializeDict) xmlInitializeDict __attribute((alias("xmlInitializeDict__internal_alias")));
#else
#ifndef xmlInitializeDict
extern __typeof (xmlInitializeDict) xmlInitializeDict__internal_alias __attribute((visibility("hidden")));
#define xmlInitializeDict xmlInitializeDict__internal_alias
#endif
#endif
#ifdef bottom_globals #ifdef bottom_globals
#undef xmlInitializeGlobalState #undef xmlInitializeGlobalState
extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState __attribute((alias("xmlInitializeGlobalState__internal_alias"))); extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState __attribute((alias("xmlInitializeGlobalState__internal_alias")));
@ -6755,6 +6857,30 @@ extern __typeof (xmlOutputBufferFlush) xmlOutputBufferFlush__internal_alias __at
#endif #endif
#endif #endif
#if defined(LIBXML_OUTPUT_ENABLED)
#ifdef bottom_xmlIO
#undef xmlOutputBufferGetContent
extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent __attribute((alias("xmlOutputBufferGetContent__internal_alias")));
#else
#ifndef xmlOutputBufferGetContent
extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent__internal_alias __attribute((visibility("hidden")));
#define xmlOutputBufferGetContent xmlOutputBufferGetContent__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_OUTPUT_ENABLED)
#ifdef bottom_xmlIO
#undef xmlOutputBufferGetSize
extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize __attribute((alias("xmlOutputBufferGetSize__internal_alias")));
#else
#ifndef xmlOutputBufferGetSize
extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize__internal_alias __attribute((visibility("hidden")));
#define xmlOutputBufferGetSize xmlOutputBufferGetSize__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_OUTPUT_ENABLED) #if defined(LIBXML_OUTPUT_ENABLED)
#ifdef bottom_xmlIO #ifdef bottom_xmlIO
#undef xmlOutputBufferWrite #undef xmlOutputBufferWrite
@ -8759,7 +8885,7 @@ extern __typeof (xmlSAX2EndDocument) xmlSAX2EndDocument__internal_alias __attrib
#endif #endif
#endif #endif
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_SAX2 #ifdef bottom_SAX2
#undef xmlSAX2EndElement #undef xmlSAX2EndElement
extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement __attribute((alias("xmlSAX2EndElement__internal_alias"))); extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement __attribute((alias("xmlSAX2EndElement__internal_alias")));
@ -9005,7 +9131,7 @@ extern __typeof (xmlSAX2StartDocument) xmlSAX2StartDocument__internal_alias __at
#endif #endif
#endif #endif
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_SAX2 #ifdef bottom_SAX2
#undef xmlSAX2StartElement #undef xmlSAX2StartElement
extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement __attribute((alias("xmlSAX2StartElement__internal_alias"))); extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement __attribute((alias("xmlSAX2StartElement__internal_alias")));
@ -10041,6 +10167,30 @@ extern __typeof (xmlSchemaValidatePredefinedType) xmlSchemaValidatePredefinedTyp
#endif #endif
#endif #endif
#if defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlschemas
#undef xmlSchemaValidateSetFilename
extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename __attribute((alias("xmlSchemaValidateSetFilename__internal_alias")));
#else
#ifndef xmlSchemaValidateSetFilename
extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename__internal_alias __attribute((visibility("hidden")));
#define xmlSchemaValidateSetFilename xmlSchemaValidateSetFilename__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlschemas
#undef xmlSchemaValidateSetLocator
extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator __attribute((alias("xmlSchemaValidateSetLocator__internal_alias")));
#else
#ifndef xmlSchemaValidateSetLocator
extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator__internal_alias __attribute((visibility("hidden")));
#define xmlSchemaValidateSetLocator xmlSchemaValidateSetLocator__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_SCHEMAS_ENABLED) #if defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlschemas #ifdef bottom_xmlschemas
#undef xmlSchemaValidateStream #undef xmlSchemaValidateStream
@ -11713,6 +11863,18 @@ extern __typeof (xmlTextReaderRelaxNGValidate) xmlTextReaderRelaxNGValidate__int
#endif #endif
#endif #endif
#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlreader
#undef xmlTextReaderRelaxNGValidateCtxt
extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt __attribute((alias("xmlTextReaderRelaxNGValidateCtxt__internal_alias")));
#else
#ifndef xmlTextReaderRelaxNGValidateCtxt
extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt__internal_alias __attribute((visibility("hidden")));
#define xmlTextReaderRelaxNGValidateCtxt xmlTextReaderRelaxNGValidateCtxt__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlreader #ifdef bottom_xmlreader
#undef xmlTextReaderSchemaValidate #undef xmlTextReaderSchemaValidate
@ -12001,6 +12163,18 @@ extern __typeof (xmlTextWriterSetIndentString) xmlTextWriterSetIndentString__int
#endif #endif
#endif #endif
#if defined(LIBXML_WRITER_ENABLED)
#ifdef bottom_xmlwriter
#undef xmlTextWriterSetQuoteChar
extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar __attribute((alias("xmlTextWriterSetQuoteChar__internal_alias")));
#else
#ifndef xmlTextWriterSetQuoteChar
extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar__internal_alias __attribute((visibility("hidden")));
#define xmlTextWriterSetQuoteChar xmlTextWriterSetQuoteChar__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_WRITER_ENABLED) #if defined(LIBXML_WRITER_ENABLED)
#ifdef bottom_xmlwriter #ifdef bottom_xmlwriter
#undef xmlTextWriterStartAttribute #undef xmlTextWriterStartAttribute
@ -15189,7 +15363,7 @@ extern __typeof (xmlValidateElementDecl) xmlValidateElementDecl__internal_alias
#endif #endif
#endif #endif
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef bottom_tree #ifdef bottom_tree
#undef xmlValidateNCName #undef xmlValidateNCName
extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias"))); extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias")));
@ -16593,6 +16767,18 @@ extern __typeof (xmlXPathNextSelf) xmlXPathNextSelf__internal_alias __attribute(
#endif #endif
#endif #endif
#if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath
#undef xmlXPathNodeEval
extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval __attribute((alias("xmlXPathNodeEval__internal_alias")));
#else
#ifndef xmlXPathNodeEval
extern __typeof (xmlXPathNodeEval) xmlXPathNodeEval__internal_alias __attribute((visibility("hidden")));
#define xmlXPathNodeEval xmlXPathNodeEval__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_XPATH_ENABLED) #if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath #ifdef bottom_xpath
#undef xmlXPathNodeLeading #undef xmlXPathNodeLeading
@ -17097,6 +17283,18 @@ extern __typeof (xmlXPathRoundFunction) xmlXPathRoundFunction__internal_alias __
#endif #endif
#endif #endif
#if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath
#undef xmlXPathSetContextNode
extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode __attribute((alias("xmlXPathSetContextNode__internal_alias")));
#else
#ifndef xmlXPathSetContextNode
extern __typeof (xmlXPathSetContextNode) xmlXPathSetContextNode__internal_alias __attribute((visibility("hidden")));
#define xmlXPathSetContextNode xmlXPathSetContextNode__internal_alias
#endif
#endif
#endif
#if defined(LIBXML_XPATH_ENABLED) #if defined(LIBXML_XPATH_ENABLED)
#ifdef bottom_xpath #ifdef bottom_xpath
#undef xmlXPathStartsWithFunction #undef xmlXPathStartsWithFunction

32
packager/third_party/libxml/src/enc.h vendored Normal file
View File

@ -0,0 +1,32 @@
/*
* Summary: Internal Interfaces for encoding in libxml2
* Description: this module describes a few interfaces which were
* addded along with the API changes in 2.9.0
* those are private routines at this point
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_ENC_H__
#define __XML_ENC_H__
#include <libxml/tree.h>
#ifdef __cplusplus
extern "C" {
#endif
int xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
xmlBufferPtr in, int len);
int xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len);
int xmlCharEncInput(xmlParserInputBufferPtr input, int flush);
int xmlCharEncOutput(xmlOutputBufferPtr output, int init);
#ifdef __cplusplus
}
#endif
#endif /* __XML_ENC_H__ */

View File

@ -24,6 +24,7 @@
#include "libxml.h" #include "libxml.h"
#include <string.h> #include <string.h>
#include <limits.h>
#ifdef HAVE_CTYPE_H #ifdef HAVE_CTYPE_H
#include <ctype.h> #include <ctype.h>
@ -44,6 +45,9 @@
#include <libxml/globals.h> #include <libxml/globals.h>
#include <libxml/xmlerror.h> #include <libxml/xmlerror.h>
#include "buf.h"
#include "enc.h"
static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL; static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL;
static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL; static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL;
@ -89,7 +93,7 @@ xmlEncodingErrMemory(const char *extra)
* *
* n encoding error * n encoding error
*/ */
static void static void LIBXML_ATTR_FORMAT(2,0)
xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val) xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val)
{ {
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, __xmlRaiseError(NULL, NULL, NULL, NULL, NULL,
@ -312,18 +316,18 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
inend = in + (*inlen); inend = in + (*inlen);
instop = inend; instop = inend;
while (in < inend && out < outend - 1) { while ((in < inend) && (out < outend - 1)) {
if (*in >= 0x80) { if (*in >= 0x80) {
*out++ = (((*in) >> 6) & 0x1F) | 0xC0; *out++ = (((*in) >> 6) & 0x1F) | 0xC0;
*out++ = ((*in) & 0x3F) | 0x80; *out++ = ((*in) & 0x3F) | 0x80;
++in; ++in;
} }
if (instop - in > outend - out) instop = in + (outend - out); if ((instop - in) > (outend - out)) instop = in + (outend - out);
while (in < instop && *in < 0x80) { while ((in < instop) && (*in < 0x80)) {
*out++ = *in++; *out++ = *in++;
} }
} }
if (in < inend && out < outend && *in < 0x80) { if ((in < inend) && (out < outend) && (*in < 0x80)) {
*out++ = *in++; *out++ = *in++;
} }
*outlen = out - outstart; *outlen = out - outstart;
@ -1347,6 +1351,7 @@ xmlNewCharEncodingHandler(const char *name,
xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n"); xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
return(NULL); return(NULL);
} }
memset(handler, 0, sizeof(xmlCharEncodingHandler));
handler->input = input; handler->input = input;
handler->output = output; handler->output = output;
handler->name = up; handler->name = up;
@ -1512,6 +1517,8 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) {
if (handler != NULL) return(handler); if (handler != NULL) return(handler);
handler = xmlFindCharEncodingHandler("EBCDIC-US"); handler = xmlFindCharEncodingHandler("EBCDIC-US");
if (handler != NULL) return(handler); if (handler != NULL) return(handler);
handler = xmlFindCharEncodingHandler("IBM-037");
if (handler != NULL) return(handler);
break; break;
case XML_CHAR_ENCODING_UCS4BE: case XML_CHAR_ENCODING_UCS4BE:
handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4"); handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4");
@ -1631,7 +1638,7 @@ xmlFindCharEncodingHandler(const char *name) {
iconv_t icv_in, icv_out; iconv_t icv_in, icv_out;
#endif /* LIBXML_ICONV_ENABLED */ #endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED #ifdef LIBXML_ICU_ENABLED
xmlCharEncodingHandlerPtr enc; xmlCharEncodingHandlerPtr encu;
uconv_t *ucv_in, *ucv_out; uconv_t *ucv_in, *ucv_out;
#endif /* LIBXML_ICU_ENABLED */ #endif /* LIBXML_ICU_ENABLED */
char upper[100]; char upper[100];
@ -1688,6 +1695,7 @@ xmlFindCharEncodingHandler(const char *name) {
iconv_close(icv_out); iconv_close(icv_out);
return(NULL); return(NULL);
} }
memset(enc, 0, sizeof(xmlCharEncodingHandler));
enc->name = xmlMemStrdup(name); enc->name = xmlMemStrdup(name);
enc->input = NULL; enc->input = NULL;
enc->output = NULL; enc->output = NULL;
@ -1708,23 +1716,24 @@ xmlFindCharEncodingHandler(const char *name) {
ucv_in = openIcuConverter(name, 1); ucv_in = openIcuConverter(name, 1);
ucv_out = openIcuConverter(name, 0); ucv_out = openIcuConverter(name, 0);
if (ucv_in != NULL && ucv_out != NULL) { if (ucv_in != NULL && ucv_out != NULL) {
enc = (xmlCharEncodingHandlerPtr) encu = (xmlCharEncodingHandlerPtr)
xmlMalloc(sizeof(xmlCharEncodingHandler)); xmlMalloc(sizeof(xmlCharEncodingHandler));
if (enc == NULL) { if (encu == NULL) {
closeIcuConverter(ucv_in); closeIcuConverter(ucv_in);
closeIcuConverter(ucv_out); closeIcuConverter(ucv_out);
return(NULL); return(NULL);
} }
enc->name = xmlMemStrdup(name); memset(encu, 0, sizeof(xmlCharEncodingHandler));
enc->input = NULL; encu->name = xmlMemStrdup(name);
enc->output = NULL; encu->input = NULL;
enc->uconv_in = ucv_in; encu->output = NULL;
enc->uconv_out = ucv_out; encu->uconv_in = ucv_in;
encu->uconv_out = ucv_out;
#ifdef DEBUG_ENCODING #ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Found ICU converter handler for encoding %s\n", name); "Found ICU converter handler for encoding %s\n", name);
#endif #endif
return enc; return encu;
} else if (ucv_in != NULL || ucv_out != NULL) { } else if (ucv_in != NULL || ucv_out != NULL) {
closeIcuConverter(ucv_in); closeIcuConverter(ucv_in);
closeIcuConverter(ucv_out); closeIcuConverter(ucv_out);
@ -1822,7 +1831,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
/************************************************************************ /************************************************************************
* * * *
* ICU based generic conversion functions * * ICU based generic conversion functions *
* * * *
************************************************************************/ ************************************************************************/
@ -1894,9 +1903,6 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
* The real API used by libxml for on-the-fly conversion * * The real API used by libxml for on-the-fly conversion *
* * * *
************************************************************************/ ************************************************************************/
int
xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
xmlBufferPtr in, int len);
/** /**
* xmlCharEncFirstLineInt: * xmlCharEncFirstLineInt:
@ -1925,7 +1931,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
if (in == NULL) return(-1); if (in == NULL) return(-1);
/* calculate space available */ /* calculate space available */
written = out->size - out->use; written = out->size - out->use - 1; /* count '\0' */
toconv = in->use; toconv = in->use;
/* /*
* echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38 * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
@ -1943,7 +1949,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
toconv = 180; toconv = 180;
} }
if (toconv * 2 >= written) { if (toconv * 2 >= written) {
xmlBufferGrow(out, toconv); xmlBufferGrow(out, toconv * 2);
written = out->size - out->use - 1; written = out->size - out->use - 1;
} }
@ -2025,6 +2031,252 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
return(xmlCharEncFirstLineInt(handler, out, in, -1)); return(xmlCharEncFirstLineInt(handler, out, in, -1));
} }
/**
* xmlCharEncFirstLineInput:
* @input: a parser input buffer
* @len: number of bytes to convert for the first line, or -1
*
* Front-end for the encoding handler input function, but handle only
* the very first line. Point is that this is based on autodetection
* of the encoding and once that first line is converted we may find
* out that a different decoder is needed to process the input.
*
* Returns the number of byte written if success, or
* -1 general error
* -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
*/
int
xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
{
int ret = -2;
size_t written;
size_t toconv;
int c_in;
int c_out;
xmlBufPtr in;
xmlBufPtr out;
if ((input == NULL) || (input->encoder == NULL) ||
(input->buffer == NULL) || (input->raw == NULL))
return (-1);
out = input->buffer;
in = input->raw;
toconv = xmlBufUse(in);
if (toconv == 0)
return (0);
written = xmlBufAvail(out) - 1; /* count '\0' */
/*
* echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
* 45 chars should be sufficient to reach the end of the encoding
* declaration without going too far inside the document content.
* on UTF-16 this means 90bytes, on UCS4 this means 180
* The actual value depending on guessed encoding is passed as @len
* if provided
*/
if (len >= 0) {
if (toconv > (unsigned int) len)
toconv = len;
} else {
if (toconv > 180)
toconv = 180;
}
if (toconv * 2 >= written) {
xmlBufGrow(out, toconv * 2);
written = xmlBufAvail(out) - 1;
}
if (written > 360)
written = 360;
c_in = toconv;
c_out = written;
if (input->encoder->input != NULL) {
ret = input->encoder->input(xmlBufEnd(out), &c_out,
xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
}
#ifdef LIBXML_ICONV_ENABLED
else if (input->encoder->iconv_in != NULL) {
ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
if (ret == -1)
ret = -3;
}
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
else if (input->encoder->uconv_in != NULL) {
ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
if (ret == -1)
ret = -3;
}
#endif /* LIBXML_ICU_ENABLED */
switch (ret) {
case 0:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input\n",
c_in, c_out);
#endif
break;
case -1:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input, %d left\n",
c_in, c_out, (int)xmlBufUse(in));
#endif
break;
case -3:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input, %d left\n",
c_in, c_out, (int)xmlBufUse(in));
#endif
break;
case -2: {
char buf[50];
const xmlChar *content = xmlBufContent(in);
snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
content[0], content[1],
content[2], content[3]);
buf[49] = 0;
xmlEncodingErr(XML_I18N_CONV_FAILED,
"input conversion failed due to input error, bytes %s\n",
buf);
}
}
/*
* Ignore when input buffer is not on a boundary
*/
if (ret == -3) ret = 0;
if (ret == -1) ret = 0;
return(ret);
}
/**
* xmlCharEncInput:
* @input: a parser input buffer
* @flush: try to flush all the raw buffer
*
* Generic front-end for the encoding handler on parser input
*
* Returns the number of byte written if success, or
* -1 general error
* -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
*/
int
xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
{
int ret = -2;
size_t written;
size_t toconv;
int c_in;
int c_out;
xmlBufPtr in;
xmlBufPtr out;
if ((input == NULL) || (input->encoder == NULL) ||
(input->buffer == NULL) || (input->raw == NULL))
return (-1);
out = input->buffer;
in = input->raw;
toconv = xmlBufUse(in);
if (toconv == 0)
return (0);
if ((toconv > 64 * 1024) && (flush == 0))
toconv = 64 * 1024;
written = xmlBufAvail(out);
if (written > 0)
written--; /* count '\0' */
if (toconv * 2 >= written) {
xmlBufGrow(out, toconv * 2);
written = xmlBufAvail(out);
if (written > 0)
written--; /* count '\0' */
}
if ((written > 128 * 1024) && (flush == 0))
written = 128 * 1024;
c_in = toconv;
c_out = written;
if (input->encoder->input != NULL) {
ret = input->encoder->input(xmlBufEnd(out), &c_out,
xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
}
#ifdef LIBXML_ICONV_ENABLED
else if (input->encoder->iconv_in != NULL) {
ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
if (ret == -1)
ret = -3;
}
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
else if (input->encoder->uconv_in != NULL) {
ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
if (ret == -1)
ret = -3;
}
#endif /* LIBXML_ICU_ENABLED */
switch (ret) {
case 0:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input\n",
c_in, c_out);
#endif
break;
case -1:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input, %d left\n",
c_in, c_out, (int)xmlBufUse(in));
#endif
break;
case -3:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of input, %d left\n",
c_in, c_out, (int)xmlBufUse(in));
#endif
break;
case -2: {
char buf[50];
const xmlChar *content = xmlBufContent(in);
snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
content[0], content[1],
content[2], content[3]);
buf[49] = 0;
xmlEncodingErr(XML_I18N_CONV_FAILED,
"input conversion failed due to input error, bytes %s\n",
buf);
}
}
/*
* Ignore when input buffer is not on a boundary
*/
if (ret == -3)
ret = 0;
return (c_out? c_out : ret);
}
/** /**
* xmlCharEncInFunc: * xmlCharEncInFunc:
* @handler: char encoding transformation data structure * @handler: char encoding transformation data structure
@ -2056,7 +2308,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
toconv = in->use; toconv = in->use;
if (toconv == 0) if (toconv == 0)
return (0); return (0);
written = out->size - out->use; written = out->size - out->use -1; /* count '\0' */
if (toconv * 2 >= written) { if (toconv * 2 >= written) {
xmlBufferGrow(out, out->size + toconv * 2); xmlBufferGrow(out, out->size + toconv * 2);
written = out->size - out->use - 1; written = out->size - out->use - 1;
@ -2132,6 +2384,237 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
return (written? written : ret); return (written? written : ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCharEncOutput:
* @output: a parser output buffer
* @init: is this an initialization call without data
*
* Generic front-end for the encoding handler on parser output
* a first call with @init == 1 has to be made first to initiate the
* output in case of non-stateless encoding needing to initiate their
* state or the output (like the BOM in UTF16).
* In case of UTF8 sequence conversion errors for the given encoder,
* the content will be automatically remapped to a CharRef sequence.
*
* Returns the number of byte written if success, or
* -1 general error
* -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
*/
int
xmlCharEncOutput(xmlOutputBufferPtr output, int init)
{
int ret = -2;
size_t written;
size_t writtentot = 0;
size_t toconv;
int c_in;
int c_out;
xmlBufPtr in;
xmlBufPtr out;
int charref_len = 0;
if ((output == NULL) || (output->encoder == NULL) ||
(output->buffer == NULL) || (output->conv == NULL))
return (-1);
out = output->conv;
in = output->buffer;
retry:
written = xmlBufAvail(out);
if (written > 0)
written--; /* count '\0' */
/*
* First specific handling of the initialization call
*/
if (init) {
c_in = 0;
c_out = written;
if (output->encoder->output != NULL) {
ret = output->encoder->output(xmlBufEnd(out), &c_out,
NULL, &c_in);
if (ret > 0) /* Gennady: check return value */
xmlBufAddLen(out, c_out);
}
#ifdef LIBXML_ICONV_ENABLED
else if (output->encoder->iconv_out != NULL) {
ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
&c_out, NULL, &c_in);
xmlBufAddLen(out, c_out);
}
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
else if (output->encoder->uconv_out != NULL) {
ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
&c_out, NULL, &c_in);
xmlBufAddLen(out, c_out);
}
#endif /* LIBXML_ICU_ENABLED */
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"initialized encoder\n");
#endif
return(0);
}
/*
* Conversion itself.
*/
toconv = xmlBufUse(in);
if (toconv == 0)
return (0);
if (toconv > 64 * 1024)
toconv = 64 * 1024;
if (toconv * 4 >= written) {
xmlBufGrow(out, toconv * 4);
written = xmlBufAvail(out) - 1;
}
if (written > 256 * 1024)
written = 256 * 1024;
c_in = toconv;
c_out = written;
if (output->encoder->output != NULL) {
ret = output->encoder->output(xmlBufEnd(out), &c_out,
xmlBufContent(in), &c_in);
if (c_out > 0) {
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
writtentot += c_out;
}
}
#ifdef LIBXML_ICONV_ENABLED
else if (output->encoder->iconv_out != NULL) {
ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
writtentot += c_out;
if (ret == -1) {
if (c_out > 0) {
/*
* Can be a limitation of iconv
*/
charref_len = 0;
goto retry;
}
ret = -3;
}
}
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
else if (output->encoder->uconv_out != NULL) {
ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
&c_out, xmlBufContent(in), &c_in);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
writtentot += c_out;
if (ret == -1) {
if (c_out > 0) {
/*
* Can be a limitation of uconv
*/
charref_len = 0;
goto retry;
}
ret = -3;
}
}
#endif /* LIBXML_ICU_ENABLED */
else {
xmlEncodingErr(XML_I18N_NO_OUTPUT,
"xmlCharEncOutFunc: no output function !\n", NULL);
return(-1);
}
if (ret >= 0) output += ret;
/*
* Attempt to handle error cases
*/
switch (ret) {
case 0:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"converted %d bytes to %d bytes of output\n",
c_in, c_out);
#endif
break;
case -1:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"output conversion failed by lack of space\n");
#endif
break;
case -3:
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of output %d left\n",
c_in, c_out, (int) xmlBufUse(in));
#endif
break;
case -2: {
int len = (int) xmlBufUse(in);
xmlChar *content = xmlBufContent(in);
int cur;
cur = xmlGetUTF8Char(content, &len);
if ((charref_len != 0) && (c_out < charref_len)) {
/*
* We attempted to insert a character reference and failed.
* Undo what was written and skip the remaining charref.
*/
xmlBufErase(out, c_out);
writtentot -= c_out;
xmlBufShrink(in, charref_len - c_out);
charref_len = 0;
ret = -1;
break;
} else if (cur > 0) {
xmlChar charref[20];
#ifdef DEBUG_ENCODING
xmlGenericError(xmlGenericErrorContext,
"handling output conversion error\n");
xmlGenericError(xmlGenericErrorContext,
"Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
content[0], content[1],
content[2], content[3]);
#endif
/*
* Removes the UTF8 sequence, and replace it by a charref
* and continue the transcoding phase, hoping the error
* did not mangle the encoder state.
*/
charref_len = snprintf((char *) &charref[0], sizeof(charref),
"&#%d;", cur);
xmlBufShrink(in, len);
xmlBufAddHead(in, charref, -1);
goto retry;
} else {
char buf[50];
snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
content[0], content[1],
content[2], content[3]);
buf[49] = 0;
xmlEncodingErr(XML_I18N_CONV_FAILED,
"output conversion failed due to conv error, bytes %s\n",
buf);
if (xmlBufGetAllocationScheme(in) != XML_BUFFER_ALLOC_IMMUTABLE)
content[0] = ' ';
}
break;
}
}
return(ret);
}
#endif
/** /**
* xmlCharEncOutFunc: * xmlCharEncOutFunc:
* @handler: char enconding transformation data structure * @handler: char enconding transformation data structure
@ -2158,6 +2641,7 @@ xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
int writtentot = 0; int writtentot = 0;
int toconv; int toconv;
int output = 0; int output = 0;
int charref_len = 0;
if (handler == NULL) return(-1); if (handler == NULL) return(-1);
if (out == NULL) return(-1); if (out == NULL) return(-1);
@ -2194,7 +2678,7 @@ retry:
else if (handler->uconv_out != NULL) { else if (handler->uconv_out != NULL) {
ret = xmlUconvWrapper(handler->uconv_out, 0, ret = xmlUconvWrapper(handler->uconv_out, 0,
&out->content[out->use], &out->content[out->use],
&written, NULL, &toconv); &written, NULL, &toconv);
out->use += written; out->use += written;
out->content[out->use] = 0; out->content[out->use] = 0;
} }
@ -2239,6 +2723,7 @@ retry:
/* /*
* Can be a limitation of iconv * Can be a limitation of iconv
*/ */
charref_len = 0;
goto retry; goto retry;
} }
ret = -3; ret = -3;
@ -2259,6 +2744,7 @@ retry:
/* /*
* Can be a limitation of iconv * Can be a limitation of iconv
*/ */
charref_len = 0;
goto retry; goto retry;
} }
ret = -3; ret = -3;
@ -2302,7 +2788,19 @@ retry:
int cur; int cur;
cur = xmlGetUTF8Char(utf, &len); cur = xmlGetUTF8Char(utf, &len);
if (cur > 0) { if ((charref_len != 0) && (written < charref_len)) {
/*
* We attempted to insert a character reference and failed.
* Undo what was written and skip the remaining charref.
*/
out->use -= written;
writtentot -= written;
xmlBufferShrink(in, charref_len - written);
charref_len = 0;
ret = -1;
break;
} else if (cur > 0) {
xmlChar charref[20]; xmlChar charref[20];
#ifdef DEBUG_ENCODING #ifdef DEBUG_ENCODING
@ -2318,7 +2816,8 @@ retry:
* and continue the transcoding phase, hoping the error * and continue the transcoding phase, hoping the error
* did not mangle the encoder state. * did not mangle the encoder state.
*/ */
snprintf((char *) &charref[0], sizeof(charref), "&#%d;", cur); charref_len = snprintf((char *) &charref[0], sizeof(charref),
"&#%d;", cur);
xmlBufferShrink(in, len); xmlBufferShrink(in, len);
xmlBufferAddHead(in, charref, -1); xmlBufferAddHead(in, charref, -1);
@ -2353,17 +2852,27 @@ retry:
int int
xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
int ret = 0; int ret = 0;
int tofree = 0;
int i, handler_in_list = 0;
if (handler == NULL) return(-1); if (handler == NULL) return(-1);
if (handler->name == NULL) return(-1); if (handler->name == NULL) return(-1);
if (handlers != NULL) {
for (i = 0;i < nbCharEncodingHandler; i++) {
if (handler == handlers[i]) {
handler_in_list = 1;
break;
}
}
}
#ifdef LIBXML_ICONV_ENABLED #ifdef LIBXML_ICONV_ENABLED
/* /*
* Iconv handlers can be used only once, free the whole block. * Iconv handlers can be used only once, free the whole block.
* and the associated icon resources. * and the associated icon resources.
*/ */
if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { if ((handler_in_list == 0) &&
if (handler->name != NULL) ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) {
xmlFree(handler->name); tofree = 1;
handler->name = NULL;
if (handler->iconv_out != NULL) { if (handler->iconv_out != NULL) {
if (iconv_close(handler->iconv_out)) if (iconv_close(handler->iconv_out))
ret = -1; ret = -1;
@ -2374,14 +2883,12 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
ret = -1; ret = -1;
handler->iconv_in = NULL; handler->iconv_in = NULL;
} }
xmlFree(handler);
} }
#endif /* LIBXML_ICONV_ENABLED */ #endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED #ifdef LIBXML_ICU_ENABLED
if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { if ((handler_in_list == 0) &&
if (handler->name != NULL) ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) {
xmlFree(handler->name); tofree = 1;
handler->name = NULL;
if (handler->uconv_out != NULL) { if (handler->uconv_out != NULL) {
closeIcuConverter(handler->uconv_out); closeIcuConverter(handler->uconv_out);
handler->uconv_out = NULL; handler->uconv_out = NULL;
@ -2390,9 +2897,15 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
closeIcuConverter(handler->uconv_in); closeIcuConverter(handler->uconv_in);
handler->uconv_in = NULL; handler->uconv_in = NULL;
} }
xmlFree(handler);
} }
#endif #endif
if (tofree) {
/* free up only dynamic handlers iconv/uconv */
if (handler->name != NULL)
xmlFree(handler->name);
handler->name = NULL;
xmlFree(handler);
}
#ifdef DEBUG_ENCODING #ifdef DEBUG_ENCODING
if (ret) if (ret)
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
@ -2484,6 +2997,7 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
unused += written; unused += written;
cur += toconv; cur += toconv;
} while (ret == -2); } while (ret == -2);
#endif
} else { } else {
/* could not find a converter */ /* could not find a converter */
return(-1); return(-1);
@ -2495,7 +3009,6 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
} }
return(in->consumed + (in->cur - in->base)); return(in->consumed + (in->cur - in->base));
} }
#endif
#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED)
#ifdef LIBXML_ISO8859X_ENABLED #ifdef LIBXML_ISO8859X_ENABLED
@ -2523,6 +3036,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
const unsigned char* outstart = out; const unsigned char* outstart = out;
const unsigned char* inend; const unsigned char* inend;
const unsigned char* instart = in; const unsigned char* instart = in;
const unsigned char* processed = in;
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
(xlattable == NULL)) (xlattable == NULL))
@ -2543,21 +3057,21 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
} else if (d < 0xC0) { } else if (d < 0xC0) {
/* trailing byte in leading position */ /* trailing byte in leading position */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 1; *inlen = processed - instart;
return(-2); return(-2);
} else if (d < 0xE0) { } else if (d < 0xE0) {
unsigned char c; unsigned char c;
if (!(in < inend)) { if (!(in < inend)) {
/* trailing byte not in input buffer */ /* trailing byte not in input buffer */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 1; *inlen = processed - instart;
return(-2); return(-3);
} }
c = *in++; c = *in++;
if ((c & 0xC0) != 0x80) { if ((c & 0xC0) != 0x80) {
/* not a trailing byte */ /* not a trailing byte */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 2; *inlen = processed - instart;
return(-2); return(-2);
} }
c = c & 0x3F; c = c & 0x3F;
@ -2566,7 +3080,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
if (d == 0) { if (d == 0) {
/* not in character set */ /* not in character set */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 2; *inlen = processed - instart;
return(-2); return(-2);
} }
*out++ = d; *out++ = d;
@ -2576,44 +3090,45 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
if (!(in < inend - 1)) { if (!(in < inend - 1)) {
/* trailing bytes not in input buffer */ /* trailing bytes not in input buffer */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 1; *inlen = processed - instart;
return(-2); return(-3);
} }
c1 = *in++; c1 = *in++;
if ((c1 & 0xC0) != 0x80) { if ((c1 & 0xC0) != 0x80) {
/* not a trailing byte (c1) */ /* not a trailing byte (c1) */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 2; *inlen = processed - instart;
return(-2); return(-2);
} }
c2 = *in++; c2 = *in++;
if ((c2 & 0xC0) != 0x80) { if ((c2 & 0xC0) != 0x80) {
/* not a trailing byte (c2) */ /* not a trailing byte (c2) */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 2; *inlen = processed - instart;
return(-2); return(-2);
} }
c1 = c1 & 0x3F; c1 = c1 & 0x3F;
c2 = c2 & 0x3F; c2 = c2 & 0x3F;
d = d & 0x0F; d = d & 0x0F;
d = xlattable [48 + c2 + xlattable [48 + c1 + d = xlattable [48 + c2 + xlattable [48 + c1 +
xlattable [32 + d] * 64] * 64]; xlattable [32 + d] * 64] * 64];
if (d == 0) { if (d == 0) {
/* not in character set */ /* not in character set */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 3; *inlen = processed - instart;
return(-2); return(-2);
} }
*out++ = d; *out++ = d;
} else { } else {
/* cannot transcode >= U+010000 */ /* cannot transcode >= U+010000 */
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart - 1; *inlen = processed - instart;
return(-2); return(-2);
} }
processed = in;
} }
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart; *inlen = processed - instart;
return(*outlen); return(*outlen);
} }
@ -2647,10 +3162,10 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
outend = out + *outlen; outend = out + *outlen;
inend = in + *inlen; inend = in + *inlen;
instop = inend; instop = inend;
c = *in;
while (in < inend && out < outend - 1) { while ((in < inend) && (out < outend - 2)) {
if (c >= 0x80) { if (*in >= 0x80) {
c = unicodetable [c - 0x80]; c = unicodetable [*in - 0x80];
if (c == 0) { if (c == 0) {
/* undefined code point */ /* undefined code point */
*outlen = out - outstart; *outlen = out - outstart;
@ -2666,18 +3181,17 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
*out++ = (c & 0x3F) | 0x80; *out++ = (c & 0x3F) | 0x80;
} }
++in; ++in;
c = *in;
} }
if (instop - in > outend - out) instop = in + (outend - out); if (instop - in > outend - out) instop = in + (outend - out);
while (c < 0x80 && in < instop) { while ((*in < 0x80) && (in < instop)) {
*out++ = c; *out++ = *in++;
++in;
c = *in;
} }
} }
if (in < inend && out < outend && c < 0x80) { if ((in < inend) && (out < outend) && (*in < 0x80)) {
*out++ = c; *out++ = *in++;
++in; }
if ((in < inend) && (out < outend) && (*in < 0x80)) {
*out++ = *in++;
} }
*outlen = out - outstart; *outlen = out - outstart;
*inlen = in - instart; *inlen = in - instart;
@ -3569,4 +4083,3 @@ xmlRegisterCharEncodingHandlersISO8859x (void) {
#define bottom_encoding #define bottom_encoding
#include "elfgcchack.h" #include "elfgcchack.h"

View File

@ -22,6 +22,8 @@
#include <libxml/globals.h> #include <libxml/globals.h>
#include <libxml/dict.h> #include <libxml/dict.h>
#include "save.h"
/* /*
* The XML predefined entities. * The XML predefined entities.
*/ */
@ -81,7 +83,7 @@ xmlEntitiesErrMemory(const char *extra)
* *
* Handle an out of memory condition * Handle an out of memory condition
*/ */
static void static void LIBXML_ATTR_FORMAT(2,0)
xmlEntitiesErr(xmlParserErrors code, const char *msg) xmlEntitiesErr(xmlParserErrors code, const char *msg)
{ {
__xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL); __xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL);
@ -500,7 +502,7 @@ xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) {
* Returns A pointer to the entity structure or NULL if not found. * Returns A pointer to the entity structure or NULL if not found.
*/ */
xmlEntityPtr xmlEntityPtr
xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) { xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
xmlEntityPtr cur; xmlEntityPtr cur;
xmlEntitiesTablePtr table; xmlEntitiesTablePtr table;
@ -528,20 +530,20 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
* Macro used to grow the current buffer. * Macro used to grow the current buffer.
*/ */
#define growBufferReentrant() { \ #define growBufferReentrant() { \
buffer_size *= 2; \ xmlChar *tmp; \
buffer = (xmlChar *) \ size_t new_size = buffer_size * 2; \
xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ if (new_size < buffer_size) goto mem_error; \
if (buffer == NULL) { \ tmp = (xmlChar *) xmlRealloc(buffer, new_size); \
xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed");\ if (tmp == NULL) goto mem_error; \
return(NULL); \ buffer = tmp; \
} \ buffer_size = new_size; \
} }
/** /**
* xmlEncodeEntitiesReentrant: * xmlEncodeEntitiesInternal:
* @doc: the document containing the string * @doc: the document containing the string
* @input: A string to convert to XML. * @input: A string to convert to XML.
* @attr: are we handling an atrbute value
* *
* Do a global encoding of a string, replacing the predefined entities * Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts. * and non ASCII values with their entities and CharRef counterparts.
@ -550,12 +552,12 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
* *
* Returns A newly allocated string with the substitution done. * Returns A newly allocated string with the substitution done.
*/ */
xmlChar * static xmlChar *
xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) { xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
const xmlChar *cur = input; const xmlChar *cur = input;
xmlChar *buffer = NULL; xmlChar *buffer = NULL;
xmlChar *out = NULL; xmlChar *out = NULL;
int buffer_size = 0; size_t buffer_size = 0;
int html = 0; int html = 0;
if (input == NULL) return(NULL); if (input == NULL) return(NULL);
@ -568,14 +570,14 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
buffer_size = 1000; buffer_size = 1000;
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar)); buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
if (buffer == NULL) { if (buffer == NULL) {
xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: malloc failed"); xmlEntitiesErrMemory("xmlEncodeEntities: malloc failed");
return(NULL); return(NULL);
} }
out = buffer; out = buffer;
while (*cur != '\0') { while (*cur != '\0') {
if (out - buffer > buffer_size - 100) { size_t indx = out - buffer;
int indx = out - buffer; if (indx + 100 > buffer_size) {
growBufferReentrant(); growBufferReentrant();
out = &buffer[indx]; out = &buffer[indx];
@ -585,6 +587,27 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
* By default one have to encode at least '<', '>', '"' and '&' ! * By default one have to encode at least '<', '>', '"' and '&' !
*/ */
if (*cur == '<') { if (*cur == '<') {
const xmlChar *end;
/*
* Special handling of server side include in HTML attributes
*/
if (html && attr &&
(cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') &&
((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) {
while (cur != end) {
*out++ = *cur++;
indx = out - buffer;
if (indx + 100 > buffer_size) {
growBufferReentrant();
out = &buffer[indx];
}
}
*out++ = *cur++;
*out++ = *cur++;
*out++ = *cur++;
continue;
}
*out++ = '&'; *out++ = '&';
*out++ = 'l'; *out++ = 'l';
*out++ = 't'; *out++ = 't';
@ -595,6 +618,23 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
*out++ = 't'; *out++ = 't';
*out++ = ';'; *out++ = ';';
} else if (*cur == '&') { } else if (*cur == '&') {
/*
* Special handling of &{...} construct from HTML 4, see
* http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
*/
if (html && attr && (cur[1] == '{') &&
(strchr((const char *) cur, '}'))) {
while (*cur != '}') {
*out++ = *cur++;
indx = out - buffer;
if (indx + 100 > buffer_size) {
growBufferReentrant();
out = &buffer[indx];
}
}
*out++ = *cur++;
continue;
}
*out++ = '&'; *out++ = '&';
*out++ = 'a'; *out++ = 'a';
*out++ = 'm'; *out++ = 'm';
@ -627,7 +667,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
if (*cur < 0xC0) { if (*cur < 0xC0) {
xmlEntitiesErr(XML_CHECK_NOT_UTF8, xmlEntitiesErr(XML_CHECK_NOT_UTF8,
"xmlEncodeEntitiesReentrant : input not UTF-8"); "xmlEncodeEntities: input not UTF-8");
if (doc != NULL) if (doc != NULL)
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
snprintf(buf, sizeof(buf), "&#%d;", *cur); snprintf(buf, sizeof(buf), "&#%d;", *cur);
@ -660,7 +700,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
} }
if ((l == 1) || (!IS_CHAR(val))) { if ((l == 1) || (!IS_CHAR(val))) {
xmlEntitiesErr(XML_ERR_INVALID_CHAR, xmlEntitiesErr(XML_ERR_INVALID_CHAR,
"xmlEncodeEntitiesReentrant : char out of range\n"); "xmlEncodeEntities: char out of range\n");
if (doc != NULL) if (doc != NULL)
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
snprintf(buf, sizeof(buf), "&#%d;", *cur); snprintf(buf, sizeof(buf), "&#%d;", *cur);
@ -692,6 +732,44 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
} }
*out = 0; *out = 0;
return(buffer); return(buffer);
mem_error:
xmlEntitiesErrMemory("xmlEncodeEntities: realloc failed");
xmlFree(buffer);
return(NULL);
}
/**
* xmlEncodeAttributeEntities:
* @doc: the document containing the string
* @input: A string to convert to XML.
*
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts for
* attribute values.
*
* Returns A newly allocated string with the substitution done.
*/
xmlChar *
xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input) {
return xmlEncodeEntitiesInternal(doc, input, 1);
}
/**
* xmlEncodeEntitiesReentrant:
* @doc: the document containing the string
* @input: A string to convert to XML.
*
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts.
* Contrary to xmlEncodeEntities, this routine is reentrant, and result
* must be deallocated.
*
* Returns A newly allocated string with the substitution done.
*/
xmlChar *
xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
return xmlEncodeEntitiesInternal(doc, input, 0);
} }
/** /**
@ -705,11 +783,11 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
* Returns A newly allocated string with the substitution done. * Returns A newly allocated string with the substitution done.
*/ */
xmlChar * xmlChar *
xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) { xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED, const xmlChar *input) {
const xmlChar *cur = input; const xmlChar *cur = input;
xmlChar *buffer = NULL; xmlChar *buffer = NULL;
xmlChar *out = NULL; xmlChar *out = NULL;
int buffer_size = 0; size_t buffer_size = 0;
if (input == NULL) return(NULL); if (input == NULL) return(NULL);
/* /*
@ -724,8 +802,8 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
out = buffer; out = buffer;
while (*cur != '\0') { while (*cur != '\0') {
if (out - buffer > buffer_size - 10) { size_t indx = out - buffer;
int indx = out - buffer; if (indx + 10 > buffer_size) {
growBufferReentrant(); growBufferReentrant();
out = &buffer[indx]; out = &buffer[indx];
@ -774,6 +852,11 @@ xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
} }
*out = 0; *out = 0;
return(buffer); return(buffer);
mem_error:
xmlEntitiesErrMemory("xmlEncodeSpecialChars: realloc failed");
xmlFree(buffer);
return(NULL);
} }
/** /**

View File

@ -18,7 +18,7 @@
void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
const char *msg, const char *msg,
...); ...) LIBXML_ATTR_FORMAT(2,3);
#define XML_GET_VAR_STR(msg, str) { \ #define XML_GET_VAR_STR(msg, str) { \
int size, prev_size = -1; \ int size, prev_size = -1; \
@ -33,7 +33,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
\ \
while (size < 64000) { \ while (size < 64000) { \
va_start(ap, msg); \ va_start(ap, msg); \
chars = vsnprintf(str, size, msg, ap); \ chars = vsnprintf(str, size, msg, ap); \
va_end(ap); \ va_end(ap); \
if ((chars > -1) && (chars < size)) { \ if ((chars > -1) && (chars < size)) { \
if (prev_size == chars) { \ if (prev_size == chars) { \
@ -54,9 +54,9 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
} }
/************************************************************************ /************************************************************************
* * * *
* Handling of out of context errors * * Handling of out of context errors *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -137,9 +137,9 @@ xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
} }
/************************************************************************ /************************************************************************
* * * *
* Handling of parsing errors * * Handling of parsing errors *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -177,7 +177,9 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
xmlChar content[81]; /* space for 80 chars + line terminator */ xmlChar content[81]; /* space for 80 chars + line terminator */
xmlChar *ctnt; xmlChar *ctnt;
if (input == NULL) return; if ((input == NULL) || (input->cur == NULL))
return;
cur = input->cur; cur = input->cur;
base = input->base; base = input->base;
/* skip backwards over any end-of-lines */ /* skip backwards over any end-of-lines */
@ -187,7 +189,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
n = 0; n = 0;
/* search backwards for beginning-of-line (to max buff size) */ /* search backwards for beginning-of-line (to max buff size) */
while ((n++ < (sizeof(content)-1)) && (cur > base) && while ((n++ < (sizeof(content)-1)) && (cur > base) &&
(*(cur) != '\n') && (*(cur) != '\r')) (*(cur) != '\n') && (*(cur) != '\r'))
cur--; cur--;
if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; if ((*(cur) == '\n') || (*(cur) == '\r')) cur++;
/* calculate the error position in terms of the current position */ /* calculate the error position in terms of the current position */
@ -197,7 +199,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
ctnt = content; ctnt = content;
/* copy selected text to our buffer */ /* copy selected text to our buffer */
while ((*cur != 0) && (*(cur) != '\n') && while ((*cur != 0) && (*(cur) != '\n') &&
(*(cur) != '\r') && (n < sizeof(content)-1)) { (*(cur) != '\r') && (n < sizeof(content)-1)) {
*ctnt++ = *cur++; *ctnt++ = *cur++;
n++; n++;
} }
@ -292,7 +294,10 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str,
} else { } else {
if (file != NULL) if (file != NULL)
channel(data, "%s:%d: ", file, line); channel(data, "%s:%d: ", file, line);
else if ((line != 0) && (domain == XML_FROM_PARSER)) else if ((line != 0) &&
((domain == XML_FROM_PARSER) || (domain == XML_FROM_SCHEMASV)||
(domain == XML_FROM_SCHEMASP)||(domain == XML_FROM_DTD) ||
(domain == XML_FROM_RELAXNGP)||(domain == XML_FROM_RELAXNGV)))
channel(data, "Entity: line %d: ", line); channel(data, "Entity: line %d: ", line);
} }
if (name != NULL) { if (name != NULL) {
@ -360,6 +365,15 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str,
case XML_FROM_I18N: case XML_FROM_I18N:
channel(data, "encoding "); channel(data, "encoding ");
break; break;
case XML_FROM_SCHEMATRONV:
channel(data, "schematron ");
break;
case XML_FROM_BUFFER:
channel(data, "internal buffer ");
break;
case XML_FROM_URI:
channel(data, "URI ");
break;
default: default:
break; break;
} }
@ -452,6 +466,8 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
xmlErrorPtr to = &xmlLastError; xmlErrorPtr to = &xmlLastError;
xmlNodePtr baseptr = NULL; xmlNodePtr baseptr = NULL;
if (code == XML_ERR_OK)
return;
if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING)) if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
return; return;
if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
@ -459,8 +475,11 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
ctxt = (xmlParserCtxtPtr) ctx; ctxt = (xmlParserCtxtPtr) ctx;
if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) && if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
(ctxt->sax->initialized == XML_SAX2_MAGIC)) (ctxt->sax->initialized == XML_SAX2_MAGIC) &&
(ctxt->sax->serror != NULL)) {
schannel = ctxt->sax->serror; schannel = ctxt->sax->serror;
data = ctxt->userData;
}
} }
/* /*
* Check if structured error handler set * Check if structured error handler set
@ -473,16 +492,6 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
if (schannel != NULL) if (schannel != NULL)
data = xmlStructuredErrorContext; data = xmlStructuredErrorContext;
} }
if ((domain == XML_FROM_VALID) &&
((channel == xmlParserValidityError) ||
(channel == xmlParserValidityWarning))) {
ctxt = (xmlParserCtxtPtr) ctx;
if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
(ctxt->sax->initialized == XML_SAX2_MAGIC))
schannel = ctxt->sax->serror;
}
if (code == XML_ERR_OK)
return;
/* /*
* Formatting the message * Formatting the message
*/ */
@ -526,6 +535,8 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
line = node->line; line = node->line;
if ((line == 0) || (line == 65535))
line = xmlGetLineNo(node);
} }
/* /*
@ -589,6 +600,11 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
if (to != &xmlLastError) if (to != &xmlLastError)
xmlCopyError(to,&xmlLastError); xmlCopyError(to,&xmlLastError);
if (schannel != NULL) {
schannel(data, to);
return;
}
/* /*
* Find the callback channel if channel param is NULL * Find the callback channel if channel param is NULL
*/ */
@ -600,20 +616,13 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
channel = ctxt->sax->error; channel = ctxt->sax->error;
data = ctxt->userData; data = ctxt->userData;
} else if (channel == NULL) { } else if (channel == NULL) {
if ((schannel == NULL) && (xmlStructuredError != NULL)) { channel = xmlGenericError;
schannel = xmlStructuredError; if (ctxt != NULL) {
data = xmlStructuredErrorContext; data = ctxt;
} else { } else {
channel = xmlGenericError; data = xmlGenericErrorContext;
if (!data) {
data = xmlGenericErrorContext;
}
} }
} }
if (schannel != NULL) {
schannel(data, to);
return;
}
if (channel == NULL) if (channel == NULL)
return; return;
@ -746,9 +755,9 @@ xmlParserWarning(void *ctx, const char *msg, ...)
} }
/************************************************************************ /************************************************************************
* * * *
* Handling of validation errors * * Handling of validation errors *
* * * *
************************************************************************/ ************************************************************************/
/** /**

View File

@ -65,9 +65,9 @@ void xmlCleanupGlobals(void)
} }
/************************************************************************ /************************************************************************
* * * *
* All the user accessible global variables of the library * * All the user accessible global variables of the library *
* * * *
************************************************************************/ ************************************************************************/
/* /*
@ -86,25 +86,6 @@ xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
#else #else
#define MAX_LIBXML_MALLOC (1024*1024*512)
static void* size_checked_malloc(size_t size) {
if (size > MAX_LIBXML_MALLOC) {
*(volatile char*)0 = '\0';
return NULL;
}
return malloc(size);
}
static void* size_checked_realloc(void* ptr, size_t size) {
if (size > MAX_LIBXML_MALLOC) {
*(volatile char*)0 = '\0';
return NULL;
}
return realloc(ptr, size);
}
/** /**
* xmlFree: * xmlFree:
* @mem: an already allocated block of memory * @mem: an already allocated block of memory
@ -120,7 +101,7 @@ xmlFreeFunc xmlFree = (xmlFreeFunc) free;
* *
* Returns a pointer to the newly allocated block or NULL in case of error * Returns a pointer to the newly allocated block or NULL in case of error
*/ */
xmlMallocFunc xmlMalloc = (xmlMallocFunc) size_checked_malloc; xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
/** /**
* xmlMallocAtomic: * xmlMallocAtomic:
* @size: the size requested in bytes * @size: the size requested in bytes
@ -131,7 +112,7 @@ xmlMallocFunc xmlMalloc = (xmlMallocFunc) size_checked_malloc;
* *
* Returns a pointer to the newly allocated block or NULL in case of error * Returns a pointer to the newly allocated block or NULL in case of error
*/ */
xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) size_checked_malloc; xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc;
/** /**
* xmlRealloc: * xmlRealloc:
* @mem: an already allocated block of memory * @mem: an already allocated block of memory
@ -141,7 +122,7 @@ xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) size_checked_malloc;
* *
* Returns a pointer to the newly reallocated block or NULL in case of error * Returns a pointer to the newly reallocated block or NULL in case of error
*/ */
xmlReallocFunc xmlRealloc = (xmlReallocFunc) size_checked_realloc; xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
/** /**
* xmlMemStrdup: * xmlMemStrdup:
* @str: a zero terminated string * @str: a zero terminated string
@ -528,7 +509,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
#if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED) #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
#endif #endif
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
#endif #endif
@ -751,7 +732,7 @@ __xmlMalloc(void){
if (IS_MAIN_THREAD) if (IS_MAIN_THREAD)
return (&xmlMalloc); return (&xmlMalloc);
else else
return (&xmlGetGlobalState()->xmlMalloc); return (&xmlGetGlobalState()->xmlMalloc);
} }
#undef xmlMallocAtomic #undef xmlMallocAtomic

View File

@ -3,7 +3,7 @@
* *
* Reference: Your favorite introductory book on algorithms * Reference: Your favorite introductory book on algorithms
* *
* Copyright (C) 2000 Bjorn Reese and Daniel Veillard. * Copyright (C) 2000,2012 Bjorn Reese and Daniel Veillard.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -21,6 +21,22 @@
#include "libxml.h" #include "libxml.h"
#include <string.h> #include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
/*
* Following http://www.ocert.org/advisories/ocert-2011-003.html
* it seems that having hash randomization might be a good idea
* when using XML with untrusted data
*/
#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
#define HASH_RANDOMIZATION
#endif
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/hash.h> #include <libxml/hash.h>
#include <libxml/xmlmemory.h> #include <libxml/xmlmemory.h>
@ -53,6 +69,9 @@ struct _xmlHashTable {
int size; int size;
int nbElems; int nbElems;
xmlDictPtr dict; xmlDictPtr dict;
#ifdef HASH_RANDOMIZATION
int random_seed;
#endif
}; };
/* /*
@ -65,17 +84,22 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name,
unsigned long value = 0L; unsigned long value = 0L;
char ch; char ch;
#ifdef HASH_RANDOMIZATION
value = table->random_seed;
#endif
if (name != NULL) { if (name != NULL) {
value += 30 * (*name); value += 30 * (*name);
while ((ch = *name++) != 0) { while ((ch = *name++) != 0) {
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
} }
} }
value = value ^ ((value << 5) + (value >> 3));
if (name2 != NULL) { if (name2 != NULL) {
while ((ch = *name2++) != 0) { while ((ch = *name2++) != 0) {
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
} }
} }
value = value ^ ((value << 5) + (value >> 3));
if (name3 != NULL) { if (name3 != NULL) {
while ((ch = *name3++) != 0) { while ((ch = *name3++) != 0) {
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
@ -92,6 +116,9 @@ xmlHashComputeQKey(xmlHashTablePtr table,
unsigned long value = 0L; unsigned long value = 0L;
char ch; char ch;
#ifdef HASH_RANDOMIZATION
value = table->random_seed;
#endif
if (prefix != NULL) if (prefix != NULL)
value += 30 * (*prefix); value += 30 * (*prefix);
else else
@ -108,6 +135,7 @@ xmlHashComputeQKey(xmlHashTablePtr table,
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
} }
} }
value = value ^ ((value << 5) + (value >> 3));
if (prefix2 != NULL) { if (prefix2 != NULL) {
while ((ch = *prefix2++) != 0) { while ((ch = *prefix2++) != 0) {
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
@ -119,6 +147,7 @@ xmlHashComputeQKey(xmlHashTablePtr table,
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
} }
} }
value = value ^ ((value << 5) + (value >> 3));
if (prefix3 != NULL) { if (prefix3 != NULL) {
while ((ch = *prefix3++) != 0) { while ((ch = *prefix3++) != 0) {
value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch);
@ -155,8 +184,11 @@ xmlHashCreate(int size) {
table->nbElems = 0; table->nbElems = 0;
table->table = xmlMalloc(size * sizeof(xmlHashEntry)); table->table = xmlMalloc(size * sizeof(xmlHashEntry));
if (table->table) { if (table->table) {
memset(table->table, 0, size * sizeof(xmlHashEntry)); memset(table->table, 0, size * sizeof(xmlHashEntry));
return(table); #ifdef HASH_RANDOMIZATION
table->random_seed = __xmlRandom();
#endif
return(table);
} }
xmlFree(table); xmlFree(table);
} }
@ -254,8 +286,8 @@ xmlHashGrow(xmlHashTablePtr table, int size) {
table->table[key].next = NULL; table->table[key].next = NULL;
xmlFree(iter); xmlFree(iter);
} else { } else {
iter->next = table->table[key].next; iter->next = table->table[key].next;
table->table[key].next = iter; table->table[key].next = iter;
} }
#ifdef DEBUG_GROW #ifdef DEBUG_GROW
@ -952,6 +984,9 @@ xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f) {
return(NULL); return(NULL);
ret = xmlHashCreate(table->size); ret = xmlHashCreate(table->size);
if (ret == NULL)
return(NULL);
if (table->table) { if (table->table) {
for(i = 0; i < table->size; i++) { for(i = 0; i < table->size; i++) {
if (table->table[i].valid == 0) if (table->table[i].valid == 0)

View File

@ -0,0 +1,5 @@
## Process this file with automake to produce Makefile.in
SUBDIRS=libxml
EXTRA_DIST = win32config.h wsockcompat.h

View File

@ -0,0 +1,733 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_THREAD_LIBS = @BASE_THREAD_LIBS@
C14N_OBJ = @C14N_OBJ@
CATALOG_OBJ = @CATALOG_OBJ@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@
CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@
DEBUG_OBJ = @DEBUG_OBJ@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCB_OBJ = @DOCB_OBJ@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FTP_OBJ = @FTP_OBJ@
GREP = @GREP@
HAVE_ISINF = @HAVE_ISINF@
HAVE_ISNAN = @HAVE_ISNAN@
HTML_DIR = @HTML_DIR@
HTML_OBJ = @HTML_OBJ@
HTTP_OBJ = @HTTP_OBJ@
ICONV_LIBS = @ICONV_LIBS@
ICU_CFLAGS = @ICU_CFLAGS@
ICU_LIBS = @ICU_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@
LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@
LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@
LIBXML_VERSION = @LIBXML_VERSION@
LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@
LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@
LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LZMA_CFLAGS = @LZMA_CFLAGS@
LZMA_LIBS = @LZMA_LIBS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MODULE_EXTENSION = @MODULE_EXTENSION@
MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@
MV = @MV@
M_LIBS = @M_LIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@
PYTHON_SUBDIR = @PYTHON_SUBDIR@
PYTHON_TESTS = @PYTHON_TESTS@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
RDL_LIBS = @RDL_LIBS@
READER_TEST = @READER_TEST@
RELDATE = @RELDATE@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATIC_BINARIES = @STATIC_BINARIES@
STRIP = @STRIP@
TAR = @TAR@
TEST_C14N = @TEST_C14N@
TEST_CATALOG = @TEST_CATALOG@
TEST_DEBUG = @TEST_DEBUG@
TEST_HTML = @TEST_HTML@
TEST_MODULES = @TEST_MODULES@
TEST_PATTERN = @TEST_PATTERN@
TEST_PHTML = @TEST_PHTML@
TEST_PUSH = @TEST_PUSH@
TEST_REGEXPS = @TEST_REGEXPS@
TEST_SAX = @TEST_SAX@
TEST_SCHEMAS = @TEST_SCHEMAS@
TEST_SCHEMATRON = @TEST_SCHEMATRON@
TEST_THREADS = @TEST_THREADS@
TEST_VALID = @TEST_VALID@
TEST_VTIME = @TEST_VTIME@
TEST_XINCLUDE = @TEST_XINCLUDE@
TEST_XPATH = @TEST_XPATH@
TEST_XPTR = @TEST_XPTR@
THREAD_CFLAGS = @THREAD_CFLAGS@
THREAD_LIBS = @THREAD_LIBS@
VERSION = @VERSION@
VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
WGET = @WGET@
WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@
WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@
WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@
WITH_C14N = @WITH_C14N@
WITH_CATALOG = @WITH_CATALOG@
WITH_DEBUG = @WITH_DEBUG@
WITH_DOCB = @WITH_DOCB@
WITH_FTP = @WITH_FTP@
WITH_HTML = @WITH_HTML@
WITH_HTTP = @WITH_HTTP@
WITH_ICONV = @WITH_ICONV@
WITH_ICU = @WITH_ICU@
WITH_ISO8859X = @WITH_ISO8859X@
WITH_LEGACY = @WITH_LEGACY@
WITH_LZMA = @WITH_LZMA@
WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
WITH_MODULES = @WITH_MODULES@
WITH_OUTPUT = @WITH_OUTPUT@
WITH_PATTERN = @WITH_PATTERN@
WITH_PUSH = @WITH_PUSH@
WITH_READER = @WITH_READER@
WITH_REGEXPS = @WITH_REGEXPS@
WITH_RUN_DEBUG = @WITH_RUN_DEBUG@
WITH_SAX1 = @WITH_SAX1@
WITH_SCHEMAS = @WITH_SCHEMAS@
WITH_SCHEMATRON = @WITH_SCHEMATRON@
WITH_THREADS = @WITH_THREADS@
WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@
WITH_TREE = @WITH_TREE@
WITH_TRIO = @WITH_TRIO@
WITH_VALID = @WITH_VALID@
WITH_WRITER = @WITH_WRITER@
WITH_XINCLUDE = @WITH_XINCLUDE@
WITH_XPATH = @WITH_XPATH@
WITH_XPTR = @WITH_XPTR@
WITH_ZLIB = @WITH_ZLIB@
XINCLUDE_OBJ = @XINCLUDE_OBJ@
XMLLINT = @XMLLINT@
XML_CFLAGS = @XML_CFLAGS@
XML_INCLUDEDIR = @XML_INCLUDEDIR@
XML_LIBDIR = @XML_LIBDIR@
XML_LIBS = @XML_LIBS@
XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@
XPATH_OBJ = @XPATH_OBJ@
XPTR_OBJ = @XPTR_OBJ@
XSLTPROC = @XSLTPROC@
Z_CFLAGS = @Z_CFLAGS@
Z_LIBS = @Z_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = libxml
EXTRA_DIST = win32config.h wsockcompat.h
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -177,13 +177,15 @@ XMLPUBFUN void XMLCALL
*/ */
typedef enum { typedef enum {
HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */ HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */
HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
HTML_PARSE_NONET = 1<<11,/* Forbid network access */ HTML_PARSE_NONET = 1<<11,/* Forbid network access */
HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */ HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
HTML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */
HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
} htmlParserOption; } htmlParserOption;
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL

View File

@ -0,0 +1,54 @@
## Process this file with automake to produce Makefile.in
xmlincdir = $(includedir)/libxml2/libxml
xmlinc_HEADERS = \
SAX.h \
entities.h \
encoding.h \
parser.h \
parserInternals.h \
xmlerror.h \
HTMLparser.h \
HTMLtree.h \
debugXML.h \
tree.h \
list.h \
hash.h \
xpath.h \
xpathInternals.h \
xpointer.h \
xinclude.h \
xmlIO.h \
xmlmemory.h \
nanohttp.h \
nanoftp.h \
uri.h \
valid.h \
xlink.h \
xmlversion.h \
DOCBparser.h \
catalog.h \
threads.h \
globals.h \
c14n.h \
xmlautomata.h \
xmlregexp.h \
xmlmodule.h \
xmlschemas.h \
schemasInternals.h \
xmlschemastypes.h \
xmlstring.h \
xmlunicode.h \
xmlreader.h \
relaxng.h \
dict.h \
SAX2.h \
xmlexports.h \
xmlwriter.h \
chvalid.h \
pattern.h \
xmlsave.h \
schematron.h
EXTRA_DIST = xmlversion.h.in

View File

@ -0,0 +1,724 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/libxml
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(xmlinc_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = xmlversion.h
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(xmlincdir)"
HEADERS = $(xmlinc_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xmlversion.h.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_THREAD_LIBS = @BASE_THREAD_LIBS@
C14N_OBJ = @C14N_OBJ@
CATALOG_OBJ = @CATALOG_OBJ@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@
CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@
DEBUG_OBJ = @DEBUG_OBJ@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOCB_OBJ = @DOCB_OBJ@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FTP_OBJ = @FTP_OBJ@
GREP = @GREP@
HAVE_ISINF = @HAVE_ISINF@
HAVE_ISNAN = @HAVE_ISNAN@
HTML_DIR = @HTML_DIR@
HTML_OBJ = @HTML_OBJ@
HTTP_OBJ = @HTTP_OBJ@
ICONV_LIBS = @ICONV_LIBS@
ICU_CFLAGS = @ICU_CFLAGS@
ICU_LIBS = @ICU_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@
LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@
LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@
LIBXML_VERSION = @LIBXML_VERSION@
LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@
LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@
LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LZMA_CFLAGS = @LZMA_CFLAGS@
LZMA_LIBS = @LZMA_LIBS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MODULE_EXTENSION = @MODULE_EXTENSION@
MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@
MV = @MV@
M_LIBS = @M_LIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@
PYTHON_SUBDIR = @PYTHON_SUBDIR@
PYTHON_TESTS = @PYTHON_TESTS@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
RDL_LIBS = @RDL_LIBS@
READER_TEST = @READER_TEST@
RELDATE = @RELDATE@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATIC_BINARIES = @STATIC_BINARIES@
STRIP = @STRIP@
TAR = @TAR@
TEST_C14N = @TEST_C14N@
TEST_CATALOG = @TEST_CATALOG@
TEST_DEBUG = @TEST_DEBUG@
TEST_HTML = @TEST_HTML@
TEST_MODULES = @TEST_MODULES@
TEST_PATTERN = @TEST_PATTERN@
TEST_PHTML = @TEST_PHTML@
TEST_PUSH = @TEST_PUSH@
TEST_REGEXPS = @TEST_REGEXPS@
TEST_SAX = @TEST_SAX@
TEST_SCHEMAS = @TEST_SCHEMAS@
TEST_SCHEMATRON = @TEST_SCHEMATRON@
TEST_THREADS = @TEST_THREADS@
TEST_VALID = @TEST_VALID@
TEST_VTIME = @TEST_VTIME@
TEST_XINCLUDE = @TEST_XINCLUDE@
TEST_XPATH = @TEST_XPATH@
TEST_XPTR = @TEST_XPTR@
THREAD_CFLAGS = @THREAD_CFLAGS@
THREAD_LIBS = @THREAD_LIBS@
VERSION = @VERSION@
VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
WGET = @WGET@
WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@
WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@
WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@
WITH_C14N = @WITH_C14N@
WITH_CATALOG = @WITH_CATALOG@
WITH_DEBUG = @WITH_DEBUG@
WITH_DOCB = @WITH_DOCB@
WITH_FTP = @WITH_FTP@
WITH_HTML = @WITH_HTML@
WITH_HTTP = @WITH_HTTP@
WITH_ICONV = @WITH_ICONV@
WITH_ICU = @WITH_ICU@
WITH_ISO8859X = @WITH_ISO8859X@
WITH_LEGACY = @WITH_LEGACY@
WITH_LZMA = @WITH_LZMA@
WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
WITH_MODULES = @WITH_MODULES@
WITH_OUTPUT = @WITH_OUTPUT@
WITH_PATTERN = @WITH_PATTERN@
WITH_PUSH = @WITH_PUSH@
WITH_READER = @WITH_READER@
WITH_REGEXPS = @WITH_REGEXPS@
WITH_RUN_DEBUG = @WITH_RUN_DEBUG@
WITH_SAX1 = @WITH_SAX1@
WITH_SCHEMAS = @WITH_SCHEMAS@
WITH_SCHEMATRON = @WITH_SCHEMATRON@
WITH_THREADS = @WITH_THREADS@
WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@
WITH_TREE = @WITH_TREE@
WITH_TRIO = @WITH_TRIO@
WITH_VALID = @WITH_VALID@
WITH_WRITER = @WITH_WRITER@
WITH_XINCLUDE = @WITH_XINCLUDE@
WITH_XPATH = @WITH_XPATH@
WITH_XPTR = @WITH_XPTR@
WITH_ZLIB = @WITH_ZLIB@
XINCLUDE_OBJ = @XINCLUDE_OBJ@
XMLLINT = @XMLLINT@
XML_CFLAGS = @XML_CFLAGS@
XML_INCLUDEDIR = @XML_INCLUDEDIR@
XML_LIBDIR = @XML_LIBDIR@
XML_LIBS = @XML_LIBS@
XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@
XPATH_OBJ = @XPATH_OBJ@
XPTR_OBJ = @XPTR_OBJ@
XSLTPROC = @XSLTPROC@
Z_CFLAGS = @Z_CFLAGS@
Z_LIBS = @Z_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
xmlincdir = $(includedir)/libxml2/libxml
xmlinc_HEADERS = \
SAX.h \
entities.h \
encoding.h \
parser.h \
parserInternals.h \
xmlerror.h \
HTMLparser.h \
HTMLtree.h \
debugXML.h \
tree.h \
list.h \
hash.h \
xpath.h \
xpathInternals.h \
xpointer.h \
xinclude.h \
xmlIO.h \
xmlmemory.h \
nanohttp.h \
nanoftp.h \
uri.h \
valid.h \
xlink.h \
xmlversion.h \
DOCBparser.h \
catalog.h \
threads.h \
globals.h \
c14n.h \
xmlautomata.h \
xmlregexp.h \
xmlmodule.h \
xmlschemas.h \
schemasInternals.h \
xmlschemastypes.h \
xmlstring.h \
xmlunicode.h \
xmlreader.h \
relaxng.h \
dict.h \
SAX2.h \
xmlexports.h \
xmlwriter.h \
chvalid.h \
pattern.h \
xmlsave.h \
schematron.h
EXTRA_DIST = xmlversion.h.in
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu include/libxml/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-xmlincHEADERS: $(xmlinc_HEADERS)
@$(NORMAL_INSTALL)
@list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(xmlincdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(xmlincdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmlincdir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(xmlincdir)" || exit $$?; \
done
uninstall-xmlincHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(xmlincdir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(xmlincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-xmlincHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-xmlincHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool cscopelist-am ctags ctags-am distclean \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
install-xmlincHEADERS installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-xmlincHEADERS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -98,7 +98,9 @@ XMLPUBFUN void XMLCALL
xmlSAX2StartDocument (void *ctx); xmlSAX2StartDocument (void *ctx);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2EndDocument (void *ctx); xmlSAX2EndDocument (void *ctx);
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || \
defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2StartElement (void *ctx, xmlSAX2StartElement (void *ctx,
const xmlChar *fullname, const xmlChar *fullname,
@ -106,7 +108,7 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2EndElement (void *ctx, xmlSAX2EndElement (void *ctx,
const xmlChar *name); const xmlChar *name);
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ #endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSAX2StartElementNs (void *ctx, xmlSAX2StartElementNs (void *ctx,
const xmlChar *localname, const xmlChar *localname,

View File

@ -63,7 +63,7 @@ XMLPUBFUN void XMLCALL
/**************************************************************** /****************************************************************
* * * *
* Checking routines * * Checking routines *
* * * *
****************************************************************/ ****************************************************************/
@ -73,7 +73,7 @@ XMLPUBFUN int XMLCALL
/**************************************************************** /****************************************************************
* * * *
* XML shell helpers * * XML shell helpers *
* * * *
****************************************************************/ ****************************************************************/

View File

@ -1,5 +1,5 @@
/* /*
* Summary: string dictionnary * Summary: string dictionary
* Description: dictionary of reusable strings, just used to avoid allocation * Description: dictionary of reusable strings, just used to avoid allocation
* and freeing operations. * and freeing operations.
* *
@ -11,6 +11,19 @@
#ifndef __XML_DICT_H__ #ifndef __XML_DICT_H__
#define __XML_DICT_H__ #define __XML_DICT_H__
#ifdef __cplusplus
#define __XML_EXTERNC extern "C"
#else
#define __XML_EXTERNC
#endif
/*
* The dictionary.
*/
__XML_EXTERNC typedef struct _xmlDict xmlDict;
__XML_EXTERNC typedef xmlDict *xmlDictPtr;
#include <limits.h>
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#include <libxml/tree.h> #include <libxml/tree.h>
@ -19,16 +32,20 @@ extern "C" {
#endif #endif
/* /*
* The dictionnary. * Initializer
*/ */
typedef struct _xmlDict xmlDict; XMLPUBFUN int XMLCALL xmlInitializeDict(void);
typedef xmlDict *xmlDictPtr;
/* /*
* Constructor and destructor. * Constructor and destructor.
*/ */
XMLPUBFUN xmlDictPtr XMLCALL XMLPUBFUN xmlDictPtr XMLCALL
xmlDictCreate (void); xmlDictCreate (void);
XMLPUBFUN size_t XMLCALL
xmlDictSetLimit (xmlDictPtr dict,
size_t limit);
XMLPUBFUN size_t XMLCALL
xmlDictGetUsage (xmlDictPtr dict);
XMLPUBFUN xmlDictPtr XMLCALL XMLPUBFUN xmlDictPtr XMLCALL
xmlDictCreateSub(xmlDictPtr sub); xmlDictCreateSub(xmlDictPtr sub);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
@ -37,7 +54,7 @@ XMLPUBFUN void XMLCALL
xmlDictFree (xmlDictPtr dict); xmlDictFree (xmlDictPtr dict);
/* /*
* Lookup of entry in the dictionnary. * Lookup of entry in the dictionary.
*/ */
XMLPUBFUN const xmlChar * XMLCALL XMLPUBFUN const xmlChar * XMLCALL
xmlDictLookup (xmlDictPtr dict, xmlDictLookup (xmlDictPtr dict,

View File

@ -26,24 +26,9 @@
#ifdef LIBXML_ICONV_ENABLED #ifdef LIBXML_ICONV_ENABLED
#include <iconv.h> #include <iconv.h>
#else #endif
#ifdef LIBXML_ICU_ENABLED #ifdef LIBXML_ICU_ENABLED
#include <unicode/ucnv.h> #include <unicode/ucnv.h>
#if 0
/* Forward-declare UConverter here rather than pulling in <unicode/ucnv.h>
* to prevent unwanted ICU symbols being exposed to users of libxml2.
* One particular case is Qt4 conflicting on UChar32.
*/
#include <stdint.h>
struct UConverter;
typedef struct UConverter UConverter;
#ifdef _MSC_VER
typedef wchar_t UChar;
#else
typedef uint16_t UChar;
#endif
#endif
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -190,8 +175,8 @@ XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
xmlFindCharEncodingHandler (const char *name); xmlFindCharEncodingHandler (const char *name);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
xmlNewCharEncodingHandler (const char *name, xmlNewCharEncodingHandler (const char *name,
xmlCharEncodingInputFunc input, xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output); xmlCharEncodingOutputFunc output);
/* /*
* Interfaces for encoding names and aliases. * Interfaces for encoding names and aliases.

View File

@ -57,8 +57,9 @@ struct _xmlEntity {
const xmlChar *URI; /* the full URI as computed */ const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */ int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */ int checked; /* was the entity content checked */
/* this is also used to count entites /* this is also used to count entities
* references done from that entity */ * references done from that entity
* and if it contains '<' */
}; };
/* /*
@ -102,7 +103,7 @@ XMLPUBFUN xmlEntityPtr XMLCALL
XMLPUBFUN xmlEntityPtr XMLCALL XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetPredefinedEntity (const xmlChar *name); xmlGetPredefinedEntity (const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetDocEntity (xmlDocPtr doc, xmlGetDocEntity (const xmlDoc *doc,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlEntityPtr XMLCALL XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetDtdEntity (xmlDocPtr doc, xmlGetDtdEntity (xmlDocPtr doc,
@ -119,7 +120,7 @@ XMLPUBFUN xmlChar * XMLCALL
xmlEncodeEntitiesReentrant(xmlDocPtr doc, xmlEncodeEntitiesReentrant(xmlDocPtr doc,
const xmlChar *input); const xmlChar *input);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlEncodeSpecialChars (xmlDocPtr doc, xmlEncodeSpecialChars (const xmlDoc *doc,
const xmlChar *input); const xmlChar *input);
XMLPUBFUN xmlEntitiesTablePtr XMLCALL XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCreateEntitiesTable (void); xmlCreateEntitiesTable (void);

View File

@ -39,7 +39,9 @@ XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
* Returns the new xmlParserInputBufferPtr in case of success or NULL if no * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
* method was found. * method was found.
*/ */
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc); typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI,
xmlCharEncoding enc);
/** /**
* xmlOutputBufferCreateFilenameFunc: * xmlOutputBufferCreateFilenameFunc:
@ -52,7 +54,9 @@ typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const
* Returns the new xmlOutputBufferPtr in case of success or NULL if no * Returns the new xmlOutputBufferPtr in case of success or NULL if no
* method was found. * method was found.
*/ */
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression); typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI,
xmlCharEncodingHandlerPtr encoder,
int compression);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
@ -185,7 +189,8 @@ XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregi
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func); xmlThrDefParserInputBufferCreateFilenameDefault(
xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */ /** DOC_DISABLE */
/* /*
@ -297,7 +302,8 @@ XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
#else #else
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme; XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
#endif #endif
XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v); XMLPUBFUN xmlBufferAllocationScheme XMLCALL
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void); XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
#ifdef LIBXML_THREAD_ENABLED #ifdef LIBXML_THREAD_ENABLED
@ -479,7 +485,8 @@ XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
#endif #endif
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void); XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \
__xmlParserInputBufferCreateFilenameValue(void);
#ifdef LIBXML_THREAD_ENABLED #ifdef LIBXML_THREAD_ENABLED
#define xmlParserInputBufferCreateFilenameValue \ #define xmlParserInputBufferCreateFilenameValue \
(*(__xmlParserInputBufferCreateFilenameValue())) (*(__xmlParserInputBufferCreateFilenameValue()))

View File

@ -1,7 +1,7 @@
/* /*
* Summary: Chained hash tables * Summary: Chained hash tables
* Description: This module implements the hash table support used in * Description: This module implements the hash table support used in
* various places in the library. * various places in the library.
* *
* Copy: See Copyright for the status of this software. * Copy: See Copyright for the status of this software.
* *

View File

@ -15,6 +15,26 @@
#ifdef LIBXML_FTP_ENABLED #ifdef LIBXML_FTP_ENABLED
/* Needed for portability to Windows 64 bits */
#if defined(__MINGW32__) || defined(_WIN32_WCE)
#include <winsock2.h>
#else
/**
* SOCKET:
*
* macro used to provide portability of code to windows sockets
*/
#define SOCKET int
/**
* INVALID_SOCKET:
*
* macro used to provide portability of code to windows sockets
* the value to be used when the socket is not valid
*/
#undef INVALID_SOCKET
#define INVALID_SOCKET (-1)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -114,7 +134,7 @@ XMLPUBFUN int XMLCALL
xmlNanoFTPDele (void *ctx, xmlNanoFTPDele (void *ctx,
const char *file); const char *file);
XMLPUBFUN int XMLCALL XMLPUBFUN SOCKET XMLCALL
xmlNanoFTPGetConnection (void *ctx); xmlNanoFTPGetConnection (void *ctx);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNanoFTPCloseConnection(void *ctx); xmlNanoFTPCloseConnection(void *ctx);
@ -123,7 +143,7 @@ XMLPUBFUN int XMLCALL
ftpListCallback callback, ftpListCallback callback,
void *userData, void *userData,
const char *filename); const char *filename);
XMLPUBFUN int XMLCALL XMLPUBFUN SOCKET XMLCALL
xmlNanoFTPGetSocket (void *ctx, xmlNanoFTPGetSocket (void *ctx,
const char *filename); const char *filename);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL

View File

@ -125,9 +125,9 @@ typedef enum {
XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
XML_PARSER_EPILOG, /* the Misc* after the last end tag */ XML_PARSER_EPILOG, /* the Misc* after the last end tag */
XML_PARSER_IGNORE, /* within an IGNORED section */ XML_PARSER_IGNORE, /* within an IGNORED section */
XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
} xmlParserInputState; } xmlParserInputState;
/** /**
@ -260,7 +260,7 @@ struct _xmlParserCtxt {
void *catalogs; /* document's own catalog */ void *catalogs; /* document's own catalog */
int recovery; /* run in recovery mode */ int recovery; /* run in recovery mode */
int progressive; /* is this a progressive parsing */ int progressive; /* is this a progressive parsing */
xmlDictPtr dict; /* dictionnary for the parser */ xmlDictPtr dict; /* dictionary for the parser */
const xmlChar * *atts; /* array for the attributes callbacks */ const xmlChar * *atts; /* array for the attributes callbacks */
int maxatts; /* the size of the array */ int maxatts; /* the size of the array */
int docdict; /* use strings from dict to build tree */ int docdict; /* use strings from dict to build tree */
@ -308,6 +308,9 @@ struct _xmlParserCtxt {
int nodeInfoNr; /* Depth of the parsing stack */ int nodeInfoNr; /* Depth of the parsing stack */
int nodeInfoMax; /* Max depth of the parsing stack */ int nodeInfoMax; /* Max depth of the parsing stack */
xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
int input_id; /* we need to label inputs */
unsigned long sizeentcopy; /* volume of entity copy */
}; };
/** /**
@ -891,12 +894,12 @@ XMLPUBFUN xmlDocPtr XMLCALL
XMLPUBFUN xmlDocPtr XMLCALL XMLPUBFUN xmlDocPtr XMLCALL
xmlSAXParseMemory (xmlSAXHandlerPtr sax, xmlSAXParseMemory (xmlSAXHandlerPtr sax,
const char *buffer, const char *buffer,
int size, int size,
int recovery); int recovery);
XMLPUBFUN xmlDocPtr XMLCALL XMLPUBFUN xmlDocPtr XMLCALL
xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
const char *buffer, const char *buffer,
int size, int size,
int recovery, int recovery,
void *data); void *data);
XMLPUBFUN xmlDocPtr XMLCALL XMLPUBFUN xmlDocPtr XMLCALL
@ -1096,7 +1099,7 @@ typedef enum {
XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */
XML_PARSE_NONET = 1<<11,/* Forbid network access */ XML_PARSE_NONET = 1<<11,/* Forbid network access */
XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */
XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */
XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
@ -1105,8 +1108,10 @@ typedef enum {
crash if you try to modify the tree) */ crash if you try to modify the tree) */
XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */
XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
XML_PARSE_HUGE = 1<<19, /* relax any hardcoded limit from the parser */ XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
XML_PARSE_OLDSAX = 1<<20 /* parse using SAX2 interface from before 2.7.0 */ XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */
} xmlParserOption; } xmlParserOption;
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
@ -1223,6 +1228,7 @@ typedef enum {
XML_WITH_DEBUG_RUN = 30, XML_WITH_DEBUG_RUN = 30,
XML_WITH_ZLIB = 31, XML_WITH_ZLIB = 31,
XML_WITH_ICU = 32, XML_WITH_ICU = 32,
XML_WITH_LZMA = 33,
XML_WITH_NONE = 99999 /* just to be sure of allocation size */ XML_WITH_NONE = 99999 /* just to be sure of allocation size */
} xmlFeature; } xmlFeature;
@ -1233,4 +1239,3 @@ XMLPUBFUN int XMLCALL
} }
#endif #endif
#endif /* __XML_PARSER_H__ */ #endif /* __XML_PARSER_H__ */

View File

@ -1,5 +1,5 @@
/* /*
* Summary: internals routines exported by the parser. * Summary: internals routines and limits exported by the parser.
* Description: this module exports a number of internal parsing routines * Description: this module exports a number of internal parsing routines
* they are not really all intended for applications but * they are not really all intended for applications but
* can prove useful doing low level processing. * can prove useful doing low level processing.
@ -36,9 +36,42 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
* Maximum size allowed for a single text node when building a tree. * Maximum size allowed for a single text node when building a tree.
* This is not a limitation of the parser but a safety boundary feature, * This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it. * use XML_PARSE_HUGE option to override it.
* Introduced in 2.9.0
*/ */
#define XML_MAX_TEXT_LENGTH 10000000 #define XML_MAX_TEXT_LENGTH 10000000
/**
* XML_MAX_NAME_LENGTH:
*
* Maximum size allowed for a markup identitier
* This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it.
* Note that with the use of parsing dictionaries overriding the limit
* may result in more runtime memory usage in face of "unfriendly' content
* Introduced in 2.9.0
*/
#define XML_MAX_NAME_LENGTH 50000
/**
* XML_MAX_DICTIONARY_LIMIT:
*
* Maximum size allowed by the parser for a dictionary by default
* This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it.
* Introduced in 2.9.0
*/
#define XML_MAX_DICTIONARY_LIMIT 10000000
/**
* XML_MAX_LOOKUP_LIMIT:
*
* Maximum size allowed by the parser for ahead lookup
* This is an upper boundary enforced by the parser to avoid bad
* behaviour on "unfriendly' content
* Introduced in 2.9.0
*/
#define XML_MAX_LOOKUP_LIMIT 10000000
/** /**
* XML_MAX_NAMELEN: * XML_MAX_NAMELEN:
* *
@ -57,7 +90,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
/************************************************************************ /************************************************************************
* * * *
* UNICODE version of the macros. * * UNICODE version of the macros. *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -251,7 +284,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
* *
* Skips the end of line chars. * Skips the end of line chars.
*/ */
#define SKIP_EOL(p) \ #define SKIP_EOL(p) \
if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
@ -318,7 +351,7 @@ XMLPUBFUN void XMLCALL
xmlParserErrors xmlerr, xmlParserErrors xmlerr,
const char *msg, const char *msg,
const xmlChar * str1, const xmlChar * str1,
const xmlChar * str2); const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
#endif #endif
/** /**
@ -483,7 +516,7 @@ XMLPUBFUN void XMLCALL
* *
* Both general and parameter entities need to be substituted. * Both general and parameter entities need to be substituted.
*/ */
#define XML_SUBSTITUTE_BOTH 3 #define XML_SUBSTITUTE_BOTH 3
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,

View File

@ -32,7 +32,9 @@ typedef xmlRelaxNG *xmlRelaxNGPtr;
* *
* Signature of an error callback from a Relax-NG validation * Signature of an error callback from a Relax-NG validation
*/ */
typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/** /**
* xmlRelaxNGValidityWarningFunc: * xmlRelaxNGValidityWarningFunc:
@ -42,7 +44,9 @@ typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg
* *
* Signature of a warning callback from a Relax-NG validation * Signature of a warning callback from a Relax-NG validation
*/ */
typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx,
const char *msg,
...) LIBXML_ATTR_FORMAT(2,3);
/** /**
* A schemas validation context * A schemas validation context

View File

@ -28,52 +28,52 @@ extern "C" {
typedef enum { typedef enum {
XML_SCHEMAS_UNKNOWN = 0, XML_SCHEMAS_UNKNOWN = 0,
XML_SCHEMAS_STRING, XML_SCHEMAS_STRING = 1,
XML_SCHEMAS_NORMSTRING, XML_SCHEMAS_NORMSTRING = 2,
XML_SCHEMAS_DECIMAL, XML_SCHEMAS_DECIMAL = 3,
XML_SCHEMAS_TIME, XML_SCHEMAS_TIME = 4,
XML_SCHEMAS_GDAY, XML_SCHEMAS_GDAY = 5,
XML_SCHEMAS_GMONTH, XML_SCHEMAS_GMONTH = 6,
XML_SCHEMAS_GMONTHDAY, XML_SCHEMAS_GMONTHDAY = 7,
XML_SCHEMAS_GYEAR, XML_SCHEMAS_GYEAR = 8,
XML_SCHEMAS_GYEARMONTH, XML_SCHEMAS_GYEARMONTH = 9,
XML_SCHEMAS_DATE, XML_SCHEMAS_DATE = 10,
XML_SCHEMAS_DATETIME, XML_SCHEMAS_DATETIME = 11,
XML_SCHEMAS_DURATION, XML_SCHEMAS_DURATION = 12,
XML_SCHEMAS_FLOAT, XML_SCHEMAS_FLOAT = 13,
XML_SCHEMAS_DOUBLE, XML_SCHEMAS_DOUBLE = 14,
XML_SCHEMAS_BOOLEAN, XML_SCHEMAS_BOOLEAN = 15,
XML_SCHEMAS_TOKEN, XML_SCHEMAS_TOKEN = 16,
XML_SCHEMAS_LANGUAGE, XML_SCHEMAS_LANGUAGE = 17,
XML_SCHEMAS_NMTOKEN, XML_SCHEMAS_NMTOKEN = 18,
XML_SCHEMAS_NMTOKENS, XML_SCHEMAS_NMTOKENS = 19,
XML_SCHEMAS_NAME, XML_SCHEMAS_NAME = 20,
XML_SCHEMAS_QNAME, XML_SCHEMAS_QNAME = 21,
XML_SCHEMAS_NCNAME, XML_SCHEMAS_NCNAME = 22,
XML_SCHEMAS_ID, XML_SCHEMAS_ID = 23,
XML_SCHEMAS_IDREF, XML_SCHEMAS_IDREF = 24,
XML_SCHEMAS_IDREFS, XML_SCHEMAS_IDREFS = 25,
XML_SCHEMAS_ENTITY, XML_SCHEMAS_ENTITY = 26,
XML_SCHEMAS_ENTITIES, XML_SCHEMAS_ENTITIES = 27,
XML_SCHEMAS_NOTATION, XML_SCHEMAS_NOTATION = 28,
XML_SCHEMAS_ANYURI, XML_SCHEMAS_ANYURI = 29,
XML_SCHEMAS_INTEGER, XML_SCHEMAS_INTEGER = 30,
XML_SCHEMAS_NPINTEGER, XML_SCHEMAS_NPINTEGER = 31,
XML_SCHEMAS_NINTEGER, XML_SCHEMAS_NINTEGER = 32,
XML_SCHEMAS_NNINTEGER, XML_SCHEMAS_NNINTEGER = 33,
XML_SCHEMAS_PINTEGER, XML_SCHEMAS_PINTEGER = 34,
XML_SCHEMAS_INT, XML_SCHEMAS_INT = 35,
XML_SCHEMAS_UINT, XML_SCHEMAS_UINT = 36,
XML_SCHEMAS_LONG, XML_SCHEMAS_LONG = 37,
XML_SCHEMAS_ULONG, XML_SCHEMAS_ULONG = 38,
XML_SCHEMAS_SHORT, XML_SCHEMAS_SHORT = 39,
XML_SCHEMAS_USHORT, XML_SCHEMAS_USHORT = 40,
XML_SCHEMAS_BYTE, XML_SCHEMAS_BYTE = 41,
XML_SCHEMAS_UBYTE, XML_SCHEMAS_UBYTE = 42,
XML_SCHEMAS_HEXBINARY, XML_SCHEMAS_HEXBINARY = 43,
XML_SCHEMAS_BASE64BINARY, XML_SCHEMAS_BASE64BINARY = 44,
XML_SCHEMAS_ANYTYPE, XML_SCHEMAS_ANYTYPE = 45,
XML_SCHEMAS_ANYSIMPLETYPE XML_SCHEMAS_ANYSIMPLETYPE = 46
} xmlSchemaValType; } xmlSchemaValType;
/* /*

View File

@ -127,7 +127,7 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
xmlSchematronNewValidCtxt (xmlSchematronPtr schema, xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
int options); int options);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL

View File

@ -13,6 +13,7 @@
#define __XML_TREE_H__ #define __XML_TREE_H__
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#include <libxml/xmlstring.h> #include <libxml/xmlstring.h>
@ -74,13 +75,16 @@ typedef enum {
XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */
XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */
XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */
XML_BUFFER_ALLOC_IO /* special allocation scheme used for I/O */ XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */
XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */
XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */
} xmlBufferAllocationScheme; } xmlBufferAllocationScheme;
/** /**
* xmlBuffer: * xmlBuffer:
* *
* A buffer structure. * A buffer structure, this old construct is limited to 2GB and
* is being deprecated, use API with xmlBuf instead
*/ */
typedef struct _xmlBuffer xmlBuffer; typedef struct _xmlBuffer xmlBuffer;
typedef xmlBuffer *xmlBufferPtr; typedef xmlBuffer *xmlBufferPtr;
@ -92,6 +96,41 @@ struct _xmlBuffer {
xmlChar *contentIO; /* in IO mode we may have a different base */ xmlChar *contentIO; /* in IO mode we may have a different base */
}; };
/**
* xmlBuf:
*
* A buffer structure, new one, the actual structure internals are not public
*/
typedef struct _xmlBuf xmlBuf;
/**
* xmlBufPtr:
*
* A pointer to a buffer structure, the actual structure internals are not
* public
*/
typedef xmlBuf *xmlBufPtr;
/*
* A few public routines for xmlBuf. As those are expected to be used
* mostly internally the bulk of the routines are internal in buf.h
*/
XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBuf* buf);
XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (xmlBufPtr buf);
XMLPUBFUN size_t XMLCALL xmlBufUse (const xmlBufPtr buf);
XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len);
/*
* LIBXML2_NEW_BUFFER:
*
* Macro used to express that the API use the new buffers for
* xmlParserInputBuffer and xmlOutputBuffer. The change was
* introduced in 2.9.0.
*/
#define LIBXML2_NEW_BUFFER
/** /**
* XML_XML_NAMESPACE: * XML_XML_NAMESPACE:
* *
@ -351,7 +390,6 @@ struct _xmlNs {
struct _xmlNs *next; /* next Ns link for this node */ struct _xmlNs *next; /* next Ns link for this node */
xmlNsType type; /* global or local */ xmlNsType type; /* global or local */
const xmlChar *href; /* URL for the namespace */ const xmlChar *href; /* URL for the namespace */
const char* dummy_children; /* lines up with node->children */
const xmlChar *prefix; /* prefix for the namespace */ const xmlChar *prefix; /* prefix for the namespace */
void *_private; /* application data */ void *_private; /* application data */
struct _xmlDoc *context; /* normally an xmlDoc */ struct _xmlDoc *context; /* normally an xmlDoc */
@ -617,7 +655,11 @@ struct _xmlDOMWrapCtxt {
/* /*
* Some helper functions * Some helper functions
*/ */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \
defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \
defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \
defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlValidateNCName (const xmlChar *value, xmlValidateNCName (const xmlChar *value,
int space); int space);
@ -648,7 +690,7 @@ XMLPUBFUN const xmlChar * XMLCALL
int *len); int *len);
/* /*
* Handling Buffers. * Handling Buffers, the old ones see @xmlBuf for the new ones.
*/ */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
@ -694,12 +736,14 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlBufferEmpty (xmlBufferPtr buf); xmlBufferEmpty (xmlBufferPtr buf);
XMLPUBFUN const xmlChar* XMLCALL XMLPUBFUN const xmlChar* XMLCALL
xmlBufferContent (const xmlBufferPtr buf); xmlBufferContent (const xmlBuffer *buf);
XMLPUBFUN xmlChar* XMLCALL
xmlBufferDetach (xmlBufferPtr buf);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferSetAllocationScheme(xmlBufferPtr buf,
xmlBufferAllocationScheme scheme); xmlBufferAllocationScheme scheme);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlBufferLength (const xmlBufferPtr buf); xmlBufferLength (const xmlBuffer *buf);
/* /*
* Creating/freeing new structures. * Creating/freeing new structures.
@ -715,7 +759,7 @@ XMLPUBFUN xmlDtdPtr XMLCALL
const xmlChar *ExternalID, const xmlChar *ExternalID,
const xmlChar *SystemID); const xmlChar *SystemID);
XMLPUBFUN xmlDtdPtr XMLCALL XMLPUBFUN xmlDtdPtr XMLCALL
xmlGetIntSubset (xmlDocPtr doc); xmlGetIntSubset (const xmlDoc *doc);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeDtd (xmlDtdPtr cur); xmlFreeDtd (xmlDtdPtr cur);
#ifdef LIBXML_LEGACY_ENABLED #ifdef LIBXML_LEGACY_ENABLED
@ -803,7 +847,7 @@ XMLPUBFUN xmlNodePtr XMLCALL
const xmlChar *content); const xmlChar *content);
#endif #endif
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlNewDocText (xmlDocPtr doc, xmlNewDocText (const xmlDoc *doc,
const xmlChar *content); const xmlChar *content);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlNewText (const xmlChar *content); xmlNewText (const xmlChar *content);
@ -834,20 +878,20 @@ XMLPUBFUN xmlNodePtr XMLCALL
xmlNewCharRef (xmlDocPtr doc, xmlNewCharRef (xmlDocPtr doc,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlNewReference (xmlDocPtr doc, xmlNewReference (const xmlDoc *doc,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlCopyNode (const xmlNodePtr node, xmlCopyNode (xmlNodePtr node,
int recursive); int recursive);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlDocCopyNode (const xmlNodePtr node, xmlDocCopyNode (xmlNodePtr node,
xmlDocPtr doc, xmlDocPtr doc,
int recursive); int recursive);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlDocCopyNodeList (xmlDocPtr doc, xmlDocCopyNodeList (xmlDocPtr doc,
const xmlNodePtr node); xmlNodePtr node);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlCopyNodeList (const xmlNodePtr node); xmlCopyNodeList (xmlNodePtr node);
#ifdef LIBXML_TREE_ENABLED #ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlNewTextChild (xmlNodePtr parent, xmlNewTextChild (xmlNodePtr parent,
@ -867,19 +911,19 @@ XMLPUBFUN xmlNodePtr XMLCALL
* Navigating. * Navigating.
*/ */
XMLPUBFUN long XMLCALL XMLPUBFUN long XMLCALL
xmlGetLineNo (xmlNodePtr node); xmlGetLineNo (const xmlNode *node);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlGetNodePath (xmlNodePtr node); xmlGetNodePath (const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlDocGetRootElement (xmlDocPtr doc); xmlDocGetRootElement (const xmlDoc *doc);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlGetLastChild (xmlNodePtr parent); xmlGetLastChild (const xmlNode *parent);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNodeIsText (xmlNodePtr node); xmlNodeIsText (const xmlNode *node);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIsBlankNode (xmlNodePtr node); xmlIsBlankNode (const xmlNode *node);
/* /*
* Changing the structure. * Changing the structure.
@ -906,7 +950,7 @@ XMLPUBFUN xmlNodePtr XMLCALL
xmlNodePtr cur); xmlNodePtr cur);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlAddPrevSibling (xmlNodePtr cur, xmlAddPrevSibling (xmlNodePtr cur,
xmlNodePtr elem); xmlNodePtr elem);
@ -947,10 +991,11 @@ XMLPUBFUN xmlNsPtr XMLCALL
xmlSearchNsByHref (xmlDocPtr doc, xmlSearchNsByHref (xmlDocPtr doc,
xmlNodePtr node, xmlNodePtr node,
const xmlChar *href); const xmlChar *href);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED)
XMLPUBFUN xmlNsPtr * XMLCALL XMLPUBFUN xmlNsPtr * XMLCALL
xmlGetNsList (xmlDocPtr doc, xmlGetNsList (const xmlDoc *doc,
xmlNodePtr node); const xmlNode *node);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
@ -964,7 +1009,8 @@ XMLPUBFUN xmlNsPtr XMLCALL
/* /*
* Changing the content. * Changing the content.
*/ */
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
XMLPUBFUN xmlAttrPtr XMLCALL XMLPUBFUN xmlAttrPtr XMLCALL
xmlSetProp (xmlNodePtr node, xmlSetProp (xmlNodePtr node,
const xmlChar *name, const xmlChar *name,
@ -974,39 +1020,40 @@ XMLPUBFUN xmlAttrPtr XMLCALL
xmlNsPtr ns, xmlNsPtr ns,
const xmlChar *name, const xmlChar *name,
const xmlChar *value); const xmlChar *value);
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlGetNoNsProp (xmlNodePtr node, xmlGetNoNsProp (const xmlNode *node,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlGetProp (xmlNodePtr node, xmlGetProp (const xmlNode *node,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL XMLPUBFUN xmlAttrPtr XMLCALL
xmlHasProp (xmlNodePtr node, xmlHasProp (const xmlNode *node,
const xmlChar *name); const xmlChar *name);
XMLPUBFUN xmlAttrPtr XMLCALL XMLPUBFUN xmlAttrPtr XMLCALL
xmlHasNsProp (xmlNodePtr node, xmlHasNsProp (const xmlNode *node,
const xmlChar *name, const xmlChar *name,
const xmlChar *nameSpace); const xmlChar *nameSpace);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlGetNsProp (xmlNodePtr node, xmlGetNsProp (const xmlNode *node,
const xmlChar *name, const xmlChar *name,
const xmlChar *nameSpace); const xmlChar *nameSpace);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlStringGetNodeList (xmlDocPtr doc, xmlStringGetNodeList (const xmlDoc *doc,
const xmlChar *value); const xmlChar *value);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlStringLenGetNodeList (xmlDocPtr doc, xmlStringLenGetNodeList (const xmlDoc *doc,
const xmlChar *value, const xmlChar *value,
int len); int len);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlNodeListGetString (xmlDocPtr doc, xmlNodeListGetString (xmlDocPtr doc,
xmlNodePtr list, const xmlNode *list,
int inLine); int inLine);
#ifdef LIBXML_TREE_ENABLED #ifdef LIBXML_TREE_ENABLED
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlNodeListGetRawString (xmlDocPtr doc, xmlNodeListGetRawString (const xmlDoc *doc,
xmlNodePtr list, const xmlNode *list,
int inLine); int inLine);
#endif /* LIBXML_TREE_ENABLED */ #endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
@ -1026,14 +1073,19 @@ XMLPUBFUN void XMLCALL
const xmlChar *content, const xmlChar *content,
int len); int len);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlNodeGetContent (xmlNodePtr cur); xmlNodeGetContent (const xmlNode *cur);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNodeBufGetContent (xmlBufferPtr buffer, xmlNodeBufGetContent (xmlBufferPtr buffer,
xmlNodePtr cur); const xmlNode *cur);
XMLPUBFUN xmlChar * XMLCALL
xmlNodeGetLang (xmlNodePtr cur);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNodeGetSpacePreserve (xmlNodePtr cur); xmlBufGetNodeContent (xmlBufPtr buf,
const xmlNode *cur);
XMLPUBFUN xmlChar * XMLCALL
xmlNodeGetLang (const xmlNode *cur);
XMLPUBFUN int XMLCALL
xmlNodeGetSpacePreserve (const xmlNode *cur);
#ifdef LIBXML_TREE_ENABLED #ifdef LIBXML_TREE_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlNodeSetLang (xmlNodePtr cur, xmlNodeSetLang (xmlNodePtr cur,
@ -1043,8 +1095,8 @@ XMLPUBFUN void XMLCALL
int val); int val);
#endif /* LIBXML_TREE_ENABLED */ #endif /* LIBXML_TREE_ENABLED */
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlNodeGetBase (xmlDocPtr doc, xmlNodeGetBase (const xmlDoc *doc,
xmlNodePtr cur); const xmlNode *cur);
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlNodeSetBase (xmlNodePtr cur, xmlNodeSetBase (xmlNodePtr cur,
@ -1137,6 +1189,12 @@ XMLPUBFUN int XMLCALL
xmlSaveFormatFile (const char *filename, xmlSaveFormatFile (const char *filename,
xmlDocPtr cur, xmlDocPtr cur,
int format); int format);
XMLPUBFUN size_t XMLCALL
xmlBufNodeDump (xmlBufPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
int level,
int format);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNodeDump (xmlBufferPtr buf, xmlNodeDump (xmlBufferPtr buf,
xmlDocPtr doc, xmlDocPtr doc,
@ -1184,7 +1242,7 @@ XMLPUBFUN int XMLCALL
* Compression. * Compression.
*/ */
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlGetDocCompressMode (xmlDocPtr doc); xmlGetDocCompressMode (const xmlDoc *doc);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSetDocCompressMode (xmlDocPtr doc, xmlSetDocCompressMode (xmlDocPtr doc,
int mode); int mode);

View File

@ -129,8 +129,8 @@ struct _xmlParserInputBuffer {
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */ xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
int error; int error;
unsigned long rawconsumed;/* amount consumed from raw */ unsigned long rawconsumed;/* amount consumed from raw */
@ -145,8 +145,8 @@ struct _xmlOutputBuffer {
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
xmlBufferPtr conv; /* if encoder != NULL buffer for output */ xmlBufPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */ int written; /* total number of byte written */
int error; int error;
}; };
@ -209,7 +209,7 @@ XMLPUBFUN int XMLCALL
xmlParserInputBufferPtr xmlParserInputBufferPtr
__xmlParserInputBufferCreateFilename(const char *URI, __xmlParserInputBufferCreateFilename(const char *URI,
xmlCharEncoding enc); xmlCharEncoding enc);
#ifdef LIBXML_OUTPUT_ENABLED #ifdef LIBXML_OUTPUT_ENABLED
/* /*
@ -245,6 +245,12 @@ XMLPUBFUN xmlOutputBufferPtr XMLCALL
void *ioctx, void *ioctx,
xmlCharEncodingHandlerPtr encoder); xmlCharEncodingHandlerPtr encoder);
/* Couple of APIs to get the output without digging into the buffers */
XMLPUBFUN const xmlChar * XMLCALL
xmlOutputBufferGetContent (xmlOutputBufferPtr out);
XMLPUBFUN size_t XMLCALL
xmlOutputBufferGetSize (xmlOutputBufferPtr out);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlOutputBufferWrite (xmlOutputBufferPtr out, xmlOutputBufferWrite (xmlOutputBufferPtr out,
int len, int len,
@ -306,24 +312,24 @@ XMLPUBFUN int XMLCALL
* Default 'file://' protocol callbacks * Default 'file://' protocol callbacks
*/ */
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlFileMatch (const char *filename); xmlFileMatch (const char *filename);
XMLPUBFUN void * XMLCALL XMLPUBFUN void * XMLCALL
xmlFileOpen (const char *filename); xmlFileOpen (const char *filename);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlFileRead (void * context, xmlFileRead (void * context,
char * buffer, char * buffer,
int len); int len);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlFileClose (void * context); xmlFileClose (void * context);
/** /**
* Default 'http://' protocol callbacks * Default 'http://' protocol callbacks
*/ */
#ifdef LIBXML_HTTP_ENABLED #ifdef LIBXML_HTTP_ENABLED
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIOHTTPMatch (const char *filename); xmlIOHTTPMatch (const char *filename);
XMLPUBFUN void * XMLCALL XMLPUBFUN void * XMLCALL
xmlIOHTTPOpen (const char *filename); xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED #ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void * XMLCALL XMLPUBFUN void * XMLCALL
xmlIOHTTPOpenW (const char * post_uri, xmlIOHTTPOpenW (const char * post_uri,
@ -334,7 +340,7 @@ XMLPUBFUN int XMLCALL
char * buffer, char * buffer,
int len); int len);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIOHTTPClose (void * context); xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */ #endif /* LIBXML_HTTP_ENABLED */
/** /**
@ -342,15 +348,15 @@ XMLPUBFUN int XMLCALL
*/ */
#ifdef LIBXML_FTP_ENABLED #ifdef LIBXML_FTP_ENABLED
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIOFTPMatch (const char *filename); xmlIOFTPMatch (const char *filename);
XMLPUBFUN void * XMLCALL XMLPUBFUN void * XMLCALL
xmlIOFTPOpen (const char *filename); xmlIOFTPOpen (const char *filename);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIOFTPRead (void * context, xmlIOFTPRead (void * context,
char * buffer, char * buffer,
int len); int len);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlIOFTPClose (void * context); xmlIOFTPClose (void * context);
#endif /* LIBXML_FTP_ENABLED */ #endif /* LIBXML_FTP_ENABLED */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -62,7 +62,9 @@ typedef enum {
XML_FROM_WRITER, /* The xmlwriter module */ XML_FROM_WRITER, /* The xmlwriter module */
XML_FROM_MODULE, /* The dynamically loaded module module*/ XML_FROM_MODULE, /* The dynamically loaded module module*/
XML_FROM_I18N, /* The module handling character conversion */ XML_FROM_I18N, /* The module handling character conversion */
XML_FROM_SCHEMATRONV /* The Schematron validator module */ XML_FROM_SCHEMATRONV,/* The Schematron validator module */
XML_FROM_BUFFER, /* The buffers module */
XML_FROM_URI /* The URI module */
} xmlErrorDomain; } xmlErrorDomain;
/** /**
@ -84,7 +86,7 @@ struct _xmlError {
char *str2; /* extra string information */ char *str2; /* extra string information */
char *str3; /* extra string information */ char *str3; /* extra string information */
int int1; /* extra number information */ int int1; /* extra number information */
int int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */ int int2; /* error column # or 0 if N/A (todo: rename field when we would brk ABI) */
void *ctxt; /* the parser context if available */ void *ctxt; /* the parser context if available */
void *node; /* the node in the tree */ void *node; /* the node in the tree */
}; };
@ -205,7 +207,8 @@ typedef enum {
XML_WAR_ENTITY_REDEFINED, /* 107 */ XML_WAR_ENTITY_REDEFINED, /* 107 */
XML_ERR_UNKNOWN_VERSION, /* 108 */ XML_ERR_UNKNOWN_VERSION, /* 108 */
XML_ERR_VERSION_MISMATCH, /* 109 */ XML_ERR_VERSION_MISMATCH, /* 109 */
XML_ERR_USER_STOP, /* 110 */ XML_ERR_NAME_TOO_LONG, /* 110 */
XML_ERR_USER_STOP, /* 111 */
XML_NS_ERR_XML_NAMESPACE = 200, XML_NS_ERR_XML_NAMESPACE = 200,
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
XML_NS_ERR_QNAME, /* 202 */ XML_NS_ERR_QNAME, /* 202 */
@ -826,11 +829,8 @@ typedef enum {
XML_I18N_NO_HANDLER, /* 6001 */ XML_I18N_NO_HANDLER, /* 6001 */
XML_I18N_EXCESS_HANDLER, /* 6002 */ XML_I18N_EXCESS_HANDLER, /* 6002 */
XML_I18N_CONV_FAILED, /* 6003 */ XML_I18N_CONV_FAILED, /* 6003 */
XML_I18N_NO_OUTPUT /* 6004 */ XML_I18N_NO_OUTPUT, /* 6004 */
#if 0 XML_BUF_OVERFLOW = 7000
XML_CHECK_, /* 5033 */
XML_CHECK_X /* 503 */
#endif
} xmlParserErrors; } xmlParserErrors;
/** /**
@ -937,7 +937,7 @@ XMLPUBFUN void XMLCALL
int code, int code,
xmlNodePtr node, xmlNodePtr node,
const char *msg, const char *msg,
const char *extra); const char *extra) LIBXML_ATTR_FORMAT(4,0);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -115,7 +115,7 @@
*/ */
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC) #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
#define XMLPUBFUN __declspec(dllexport) #define XMLPUBFUN __declspec(dllexport)
#define XMLPUBVAR __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) extern
#else #else
#define XMLPUBFUN #define XMLPUBFUN
#if !defined(LIBXML_STATIC) #if !defined(LIBXML_STATIC)

View File

@ -130,16 +130,16 @@ XMLPUBFUN int XMLCALL
#ifdef LIBXML_WRITER_ENABLED #ifdef LIBXML_WRITER_ENABLED
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
#endif #endif
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadString (xmlTextReaderPtr reader); xmlTextReaderReadString (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader); xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
/* /*
* Attributes of the node * Attributes of the node
@ -284,6 +284,11 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
const char *rng); const char *rng);
XMLPUBFUN int XMLCALL
xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
xmlRelaxNGValidCtxtPtr ctxt,
int options);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
xmlRelaxNGPtr schema); xmlRelaxNGPtr schema);
@ -392,27 +397,26 @@ typedef void * xmlTextReaderLocatorPtr;
* *
* Signature of an error callback from a reader parser * Signature of an error callback from a reader parser
*/ */
typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
const char *msg, const char *msg,
xmlParserSeverities severity, xmlParserSeverities severity,
xmlTextReaderLocatorPtr locator); xmlTextReaderLocatorPtr locator);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
xmlTextReaderErrorFunc f, xmlTextReaderErrorFunc f,
void *arg); void *arg);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
xmlStructuredErrorFunc f, xmlStructuredErrorFunc f,
void *arg); void *arg);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
xmlTextReaderErrorFunc *f, xmlTextReaderErrorFunc *f,
void **arg); void **arg);
#endif /* LIBXML_READER_ENABLED */ #endif /* LIBXML_READER_ENABLED */

View File

@ -33,7 +33,8 @@ typedef enum {
XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */ XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
} xmlSaveOption; } xmlSaveOption;

View File

@ -92,7 +92,8 @@ typedef xmlSchema *xmlSchemaPtr;
* *
* Signature of an error callback from an XSD validation * Signature of an error callback from an XSD validation
*/ */
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/** /**
* xmlSchemaValidityWarningFunc: * xmlSchemaValidityWarningFunc:
@ -102,7 +103,8 @@ typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg,
* *
* Signature of a warning callback from an XSD validation * Signature of a warning callback from an XSD validation
*/ */
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); typedef void (XMLCDECL *xmlSchemaValidityWarningFunc)
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
/** /**
* A schemas validation context * A schemas validation context
@ -113,6 +115,22 @@ typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
/**
* xmlSchemaValidityLocatorFunc:
* @ctx: user provided context
* @file: returned file information
* @line: returned line information
*
* A schemas validation locator, a callback called by the validator.
* This is used when file or node informations are not available
* to find out what file and line number are affected
*
* Returns: 0 in case of success and -1 in case of error
*/
typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx,
const char **file, unsigned long *line);
/* /*
* Interfaces for parsing. * Interfaces for parsing.
*/ */
@ -171,6 +189,9 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
int options); int options);
XMLPUBFUN void XMLCALL
xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
const char *filename);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
@ -210,6 +231,13 @@ XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
void **user_data); void **user_data);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
XMLPUBFUN void XMLCALL
xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
xmlSchemaValidityLocatorFunc f,
void *ctxt);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -31,7 +31,7 @@ typedef enum {
} xmlSchemaWhitespaceValueType; } xmlSchemaWhitespaceValueType;
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSchemaInitTypes (void); xmlSchemaInitTypes (void);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSchemaCleanupTypes (void); xmlSchemaCleanupTypes (void);
XMLPUBFUN xmlSchemaTypePtr XMLCALL XMLPUBFUN xmlSchemaTypePtr XMLCALL

View File

@ -97,13 +97,13 @@ XMLPUBFUN xmlChar * XMLCALL
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlStrPrintf (xmlChar *buf, xmlStrPrintf (xmlChar *buf,
int len, int len,
const xmlChar *msg, const char *msg,
...); ...) LIBXML_ATTR_FORMAT(3,4);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlStrVPrintf (xmlChar *buf, xmlStrVPrintf (xmlChar *buf,
int len, int len,
const xmlChar *msg, const char *msg,
va_list ap); va_list ap) LIBXML_ATTR_FORMAT(3,0);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlGetUTF8Char (const unsigned char *utf, xmlGetUTF8Char (const unsigned char *utf,

View File

@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif #endif
#endif #endif
/**
* LIBXML_THREAD_ALLOC_ENABLED:
*
* Whether the allocation hooks are per-thread
*/
#if @WITH_THREAD_ALLOC@
#define LIBXML_THREAD_ALLOC_ENABLED
#endif
/** /**
* LIBXML_TREE_ENABLED: * LIBXML_TREE_ENABLED:
* *
@ -391,6 +400,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#define LIBXML_ZLIB_ENABLED #define LIBXML_ZLIB_ENABLED
#endif #endif
/**
* LIBXML_LZMA_ENABLED:
*
* Whether the Lzma support is compiled in
*/
#if @WITH_LZMA@
#define LIBXML_LZMA_ENABLED
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef HAVE_ANSIDECL_H #ifdef HAVE_ANSIDECL_H
#include <ansidecl.h> #include <ansidecl.h>
@ -403,7 +421,11 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef ATTRIBUTE_UNUSED #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 #endif
/** /**
@ -413,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*/ */
#ifndef LIBXML_ATTR_ALLOC_SIZE #ifndef LIBXML_ATTR_ALLOC_SIZE
# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) # if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
# else # else
# define LIBXML_ATTR_ALLOC_SIZE(x) # define LIBXML_ATTR_ALLOC_SIZE(x)

View File

@ -1,4 +1,3 @@
/* /*
* Summary: text writing API for XML * Summary: text writing API for XML
* Description: text writing API for XML * Description: text writing API for XML
@ -471,6 +470,10 @@ extern "C" {
xmlTextWriterSetIndentString(xmlTextWriterPtr writer, xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
const xmlChar * str); const xmlChar * str);
XMLPUBFUN int XMLCALL
xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
/* /*
* misc * misc
*/ */

View File

@ -68,7 +68,9 @@ typedef enum {
XPATH_UNDEF_PREFIX_ERROR, XPATH_UNDEF_PREFIX_ERROR,
XPATH_ENCODING_ERROR, XPATH_ENCODING_ERROR,
XPATH_INVALID_CHAR_ERROR, XPATH_INVALID_CHAR_ERROR,
XPATH_INVALID_CTXT XPATH_INVALID_CTXT,
XPATH_STACK_ERROR,
XPATH_FORBID_VARIABLE_ERROR
} xmlXPathError; } xmlXPathError;
/* /*
@ -380,6 +382,8 @@ struct _xmlXPathParserContext {
xmlXPathCompExprPtr comp; /* the precompiled expression */ xmlXPathCompExprPtr comp; /* the precompiled expression */
int xptr; /* it this an XPointer expression */ int xptr; /* it this an XPointer expression */
xmlNodePtr ancestor; /* used for walking preceding axis */ xmlNodePtr ancestor; /* used for walking preceding axis */
int valueFrame; /* used to limit Pop on the stack */
}; };
/************************************************************************ /************************************************************************
@ -417,7 +421,7 @@ XMLPUBVAR double xmlXPathNINF;
* @index is out of range (0 to length-1) * @index is out of range (0 to length-1)
*/ */
#define xmlXPathNodeSetItem(ns, index) \ #define xmlXPathNodeSetItem(ns, index) \
((((ns) != NULL) && \ ((((ns) != NULL) && \
((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \
(ns)->nodeTab[(index)] \ (ns)->nodeTab[(index)] \
: NULL) : NULL)
@ -504,6 +508,13 @@ XMLPUBFUN int XMLCALL
*/ */
XMLPUBFUN long XMLCALL XMLPUBFUN long XMLCALL
xmlXPathOrderDocElems (xmlDocPtr doc); xmlXPathOrderDocElems (xmlDocPtr doc);
XMLPUBFUN int XMLCALL
xmlXPathSetContextNode (xmlNodePtr node,
xmlXPathContextPtr ctx);
XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathNodeEval (xmlNodePtr node,
const xmlChar *str,
xmlXPathContextPtr ctx);
XMLPUBFUN xmlXPathObjectPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathEval (const xmlChar *str, xmlXPathEval (const xmlChar *str,
xmlXPathContextPtr ctx); xmlXPathContextPtr ctx);
@ -520,7 +531,7 @@ XMLPUBFUN xmlXPathCompExprPtr XMLCALL
xmlXPathCompile (const xmlChar *str); xmlXPathCompile (const xmlChar *str);
XMLPUBFUN xmlXPathCompExprPtr XMLCALL XMLPUBFUN xmlXPathCompExprPtr XMLCALL
xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
const xmlChar *str); const xmlChar *str);
XMLPUBFUN xmlXPathObjectPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathCompiledEval (xmlXPathCompExprPtr comp, xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
xmlXPathContextPtr ctx); xmlXPathContextPtr ctx);

View File

@ -103,13 +103,13 @@ extern "C" {
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
XMLPUBFUN double XMLCALL XMLPUBFUN double XMLCALL
xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlXPathPopString (xmlXPathParserContextPtr ctxt); xmlXPathPopString (xmlXPathParserContextPtr ctxt);
XMLPUBFUN xmlNodeSetPtr XMLCALL XMLPUBFUN xmlNodeSetPtr XMLCALL
xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
XMLPUBFUN void * XMLCALL XMLPUBFUN void * XMLCALL
xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
/** /**
* xmlXPathReturnBoolean: * xmlXPathReturnBoolean:
@ -229,7 +229,7 @@ XMLPUBFUN void * XMLCALL
* Empties a node-set. * Empties a node-set.
*/ */
#define xmlXPathEmptyNodeSet(ns) \ #define xmlXPathEmptyNodeSet(ns) \
{ while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; } { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
/** /**
* CHECK_ERROR: * CHECK_ERROR:
@ -296,7 +296,9 @@ XMLPUBFUN void * XMLCALL
#define CHECK_ARITY(x) \ #define CHECK_ARITY(x) \
if (ctxt == NULL) return; \ if (ctxt == NULL) return; \
if (nargs != (x)) \ if (nargs != (x)) \
XP_ERROR(XPATH_INVALID_ARITY); XP_ERROR(XPATH_INVALID_ARITY); \
if (ctxt->valueNr < ctxt->valueFrame + (x)) \
XP_ERROR(XPATH_STACK_ERROR);
/** /**
* CAST_TO_STRING: * CAST_TO_STRING:
@ -471,7 +473,7 @@ XMLPUBFUN void XMLCALL
*/ */
XMLPUBFUN xmlXPathParserContextPtr XMLCALL XMLPUBFUN xmlXPathParserContextPtr XMLCALL
xmlXPathNewParserContext (const xmlChar *str, xmlXPathNewParserContext (const xmlChar *str,
xmlXPathContextPtr ctxt); xmlXPathContextPtr ctxt);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
@ -480,7 +482,7 @@ XMLPUBFUN xmlXPathObjectPtr XMLCALL
valuePop (xmlXPathParserContextPtr ctxt); valuePop (xmlXPathParserContextPtr ctxt);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
valuePush (xmlXPathParserContextPtr ctxt, valuePush (xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr value); xmlXPathObjectPtr value);
XMLPUBFUN xmlXPathObjectPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathNewString (const xmlChar *val); xmlXPathNewString (const xmlChar *val);
@ -498,13 +500,13 @@ XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathNewNodeSet (xmlNodePtr val); xmlXPathNewNodeSet (xmlNodePtr val);
XMLPUBFUN xmlXPathObjectPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathNewValueTree (xmlNodePtr val); xmlXPathNewValueTree (xmlNodePtr val);
XMLPUBFUN void XMLCALL XMLPUBFUN int XMLCALL
xmlXPathNodeSetAdd (xmlNodeSetPtr cur, xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
xmlNodePtr val); xmlNodePtr val);
XMLPUBFUN void XMLCALL XMLPUBFUN int XMLCALL
xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
xmlNodePtr val); xmlNodePtr val);
XMLPUBFUN void XMLCALL XMLPUBFUN int XMLCALL
xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
xmlNodePtr node, xmlNodePtr node,
xmlNsPtr ns); xmlNsPtr ns);

View File

@ -101,7 +101,7 @@ XMLPUBFUN xmlXPathObjectPtr XMLCALL
xmlXPathContextPtr ctx); xmlXPathContextPtr ctx);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XMLPUBFUN xmlNodePtr XMLCALL XMLPUBFUN xmlNodePtr XMLCALL
xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL

View File

@ -5,6 +5,8 @@
#define HAVE_STDARG_H #define HAVE_STDARG_H
#define HAVE_MALLOC_H #define HAVE_MALLOC_H
#define HAVE_ERRNO_H #define HAVE_ERRNO_H
#define SEND_ARG2_CAST
#define GETHOSTBYNAME_ARG_CAST
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
#undef HAVE_ERRNO_H #undef HAVE_ERRNO_H
@ -95,7 +97,9 @@ static int isnan (double d) {
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define mkdir(p,m) _mkdir(p) #define mkdir(p,m) _mkdir(p)
#if _MSC_VER < 1900
#define snprintf _snprintf #define snprintf _snprintf
#endif
#if _MSC_VER < 1500 #if _MSC_VER < 1500
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
#endif #endif

View File

@ -27,7 +27,7 @@
#endif #endif
#endif #endif
#ifdef __MINGW32__ #if defined( __MINGW32__ ) || defined( _MSC_VER )
/* Include <errno.h> here to ensure that it doesn't get included later /* Include <errno.h> here to ensure that it doesn't get included later
* (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */
#include <errno.h> #include <errno.h>
@ -39,6 +39,9 @@
#endif #endif
#define EWOULDBLOCK WSAEWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK
#define ESHUTDOWN WSAESHUTDOWN
#if (!defined(_MSC_VER) || (_MSC_VER < 1600))
#define EINPROGRESS WSAEINPROGRESS #define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY #define EALREADY WSAEALREADY
#define ENOTSOCK WSAENOTSOCK #define ENOTSOCK WSAENOTSOCK
@ -61,7 +64,6 @@
#define ENOBUFS WSAENOBUFS #define ENOBUFS WSAENOBUFS
#define EISCONN WSAEISCONN #define EISCONN WSAEISCONN
#define ENOTCONN WSAENOTCONN #define ENOTCONN WSAENOTCONN
#define ESHUTDOWN WSAESHUTDOWN
#define ETOOMANYREFS WSAETOOMANYREFS #define ETOOMANYREFS WSAETOOMANYREFS
#define ETIMEDOUT WSAETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED
@ -79,5 +81,6 @@
#define ENAMETOOLONG WSAENAMETOOLONG #define ENAMETOOLONG WSAENAMETOOLONG
#define ENOTEMPTY WSAENOTEMPTY #define ENOTEMPTY WSAENOTEMPTY
*/ */
#endif /* _MSC_VER */
#endif /* __XML_WSOCKCOMPAT_H__ */ #endif /* __XML_WSOCKCOMPAT_H__ */

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
# FSF changes to this file are in the public domain. # FSF changes to this file are in the public domain.
# #
# Calling this script install-sh is preferred over install.sh, to prevent # Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it # 'make' implicit rules from creating a file called install from it
# when there is no Makefile. # when there is no Makefile.
# #
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
@ -156,6 +156,10 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;; -s) stripcmd=$stripprog;;
-t) dst_arg=$2 -t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;; shift;;
-T) no_target_directory=true;; -T) no_target_directory=true;;
@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi fi
shift # arg shift # arg
dst_arg=$arg dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done done
fi fi
@ -194,13 +202,17 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2 echo "$0: no input file specified." >&2
exit 1 exit 1
fi fi
# It's OK to call `install-sh -d' without argument. # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories. # This can happen when creating conditional directories.
exit 0 exit 0
fi fi
if test -z "$dir_arg"; then if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15 do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes. # Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps. # However, 'strip' requires both read and write access to temps.
@ -228,9 +240,9 @@ fi
for src for src
do do
# Protect names starting with `-'. # Protect names problematic for 'test' and other utilities.
case $src in case $src in
-*) src=./$src;; -* | [=\(\)!]) src=./$src;;
esac esac
if test -n "$dir_arg"; then if test -n "$dir_arg"; then
@ -252,12 +264,7 @@ do
echo "$0: no destination specified." >&2 echo "$0: no destination specified." >&2
exit 1 exit 1
fi fi
dst=$dst_arg dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work # If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored. # if double slashes aren't ignored.
@ -347,7 +354,7 @@ do
if test -z "$dir_arg" || { if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m. # Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't. # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"` ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in case $ls_ld_tmpdir in
@ -385,7 +392,7 @@ do
case $dstdir in case $dstdir in
/*) prefix='/';; /*) prefix='/';;
-*) prefix='./';; [-=\(\)!]*) prefix='./';;
*) prefix='';; *) prefix='';;
esac esac
@ -403,7 +410,7 @@ do
for d for d
do do
test -z "$d" && continue test X"$d" = X && continue
prefix=$prefix$d prefix=$prefix$d
if test -d "$prefix"; then if test -d "$prefix"; then

View File

@ -740,7 +740,7 @@ xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
/************************************************************************ /************************************************************************
* * * *
* Old set of SAXv1 functions * * Old set of SAXv1 functions *
* * * *
************************************************************************/ ************************************************************************/
static int deprecated_v1_msg = 0; static int deprecated_v1_msg = 0;
@ -1151,7 +1151,7 @@ void
endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED) endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
{ {
DEPRECATED("endElement") DEPRECATED("endElement")
xmlSAX2EndElement(ctx, name); xmlSAX2EndElement(ctx, name);
} }
/** /**

View File

@ -8,5 +8,5 @@ Name: libXML
Version: @VERSION@ Version: @VERSION@
Description: libXML library version2. Description: libXML library version2.
Requires: Requires:
Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ Libs: -L${libdir} -lxml2 @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@ Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@

View File

@ -9,5 +9,5 @@ Version: @VERSION@
Description: libXML library version2. Description: libXML library version2.
Requires: Requires:
Libs: -L${libdir} -lxml2 Libs: -L${libdir} -lxml2
Libs.private: @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@

View File

@ -0,0 +1,71 @@
.TH libxml 3 "12 April 2000"
.SH NAME
libxml \- library used to parse XML files
.SH DESCRIPTION
The
.I libxml
library is used to parse XML files.
Its internal document representation is as close as possible to the
.I DOM
(Document Object Model) interface,
an API for accessing XML or HTML structured documents.
.LP
The
.I libxml
library also has a
.IR SAX -like
interface,
which is designed to be compatible with
.IR expat (1).
NOTE:
.IR SAX ,
the Simple API for XML,
is a standard interface for event-based XML parsing,
developed collaboratively by the members of the XML-DEV mailing list,
currently hosted by OASIS.
The
.I expat
library is a XML 1.0 parser written in C,
which aims to be fully conforming.
It is currently not a validating XML processor.
.LP
The
.I libxml
library now includes a nearly complete
.I XPath
implementation.
The
.I XPath
(XML Path Language) is a language for addressing parts of an
XML document,
designed to be used by both
.I XSLT
and
.IR XPointer .
.LP
The
.I libxml
library exports Push and Pull type parser interfaces for both XML and
.IR html .
.SH FILES
.TP 2.2i
.B /depot/lib/libxml_2.0.0/libxml.a
static library
.TP
.B /depot/lib/libxml_2.0.0/libxml.so
shared library
.TP
.B /depot/package/libxml_2.0.0/bin/xmllint
binary application for parsing XML files
.SH AUTHORS
Daniel Veillard (daniel@veillard.com).
Red Hat Inc.
Manual page by Ziying Sherwin (sherwin@nlm.nih.gov),
Lister Hill National Center for Biomedical Communications,
U.S. National Library of Medicine.
.SH SEE ALSO
.IR xmllint (1),
.IR libxslt (3),
.IR libexslt (3),
.IR xsltproc (1)
.\" end of manual page

View File

@ -9,6 +9,8 @@
#ifndef __XML_LIBXML_H__ #ifndef __XML_LIBXML_H__
#define __XML_LIBXML_H__ #define __XML_LIBXML_H__
#include <libxml/xmlstring.h>
#ifndef NO_LARGEFILE_SOURCE #ifndef NO_LARGEFILE_SOURCE
#ifndef _LARGEFILE_SOURCE #ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE
@ -29,6 +31,11 @@
#include <win32config.h> #include <win32config.h>
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#else #else
/*
* Currently supported platforms use either autoconf or
* copy to config.h own "preset" configuration file.
* As result ifdef HAVE_CONFIG_H is omited here.
*/
#include "config.h" #include "config.h"
#include <libxml/xmlversion.h> #include <libxml/xmlversion.h>
#endif #endif
@ -63,7 +70,7 @@ extern int __xmlRegisterCallbacks;
* internal error reporting routines, shared but not partof the API. * internal error reporting routines, shared but not partof the API.
*/ */
void __xmlIOErr(int domain, int code, const char *extra); void __xmlIOErr(int domain, int code, const char *extra);
void __xmlLoaderErr(void *ctx, const char *msg, const char *filename); void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0);
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
/* /*
* internal function of HTML parser needed for xmlParseInNodeContext * internal function of HTML parser needed for xmlParseInNodeContext
@ -79,6 +86,18 @@ void __xmlGlobalInitMutexLock(void);
void __xmlGlobalInitMutexUnlock(void); void __xmlGlobalInitMutexUnlock(void);
void __xmlGlobalInitMutexDestroy(void); void __xmlGlobalInitMutexDestroy(void);
int __xmlInitializeDict(void);
#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
/*
* internal thread safe random function
*/
int __xmlRandom(void);
#endif
XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg);
int xmlNop(void);
#ifdef IN_LIBXML #ifdef IN_LIBXML
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef PIC #ifdef PIC
@ -90,7 +109,7 @@ void __xmlGlobalInitMutexDestroy(void);
#endif #endif
#endif #endif
#endif #endif
#ifndef PIC #if !defined(PIC) && !defined(NOLIBTOOL)
# define LIBXML_STATIC # define LIBXML_STATIC
#endif #endif
#endif /* ! __XML_LIBXML_H__ */ #endif /* ! __XML_LIBXML_H__ */

View File

@ -1,12 +1,20 @@
%global with_python3 1
Summary: Library providing XML and HTML support Summary: Library providing XML and HTML support
Name: libxml2 Name: libxml2
Version: @VERSION@ Version: @VERSION@
Release: 1 Release: 1%{?dist}%{?extra_release}
License: MIT License: MIT
Group: Development/Libraries Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: python python-devel zlib-devel pkgconfig BuildRequires: python-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif # with_python3
BuildRequires: zlib-devel
BuildRequires: pkgconfig
BuildRequires: xz-devel
URL: http://xmlsoft.org/ URL: http://xmlsoft.org/
%description %description
@ -16,7 +24,7 @@ this includes parsing and validation even with complex DtDs, either
at parse time or later once the document has been modified. The output at parse time or later once the document has been modified. The output
can be a simple SAX stream or and in-memory DOM like representations. can be a simple SAX stream or and in-memory DOM like representations.
In this case one can use the built-in XPath and XPointer implementation In this case one can use the built-in XPath and XPointer implementation
to select subnodes or ranges. A flexible Input/Output mechanism is to select sub nodes or ranges. A flexible Input/Output mechanism is
available, with existing HTTP and FTP modules and combined to an available, with existing HTTP and FTP modules and combined to an
URI library. URI library.
@ -25,6 +33,7 @@ Summary: Libraries, includes, etc. to develop XML and HTML applications
Group: Development/Libraries Group: Development/Libraries
Requires: libxml2 = %{version}-%{release} Requires: libxml2 = %{version}-%{release}
Requires: zlib-devel Requires: zlib-devel
Requires: xz-devel
Requires: pkgconfig Requires: pkgconfig
%description devel %description devel
@ -35,19 +44,27 @@ this includes parsing and validation even with complex DtDs, either
at parse time or later once the document has been modified. The output at parse time or later once the document has been modified. The output
can be a simple SAX stream or and in-memory DOM like representations. can be a simple SAX stream or and in-memory DOM like representations.
In this case one can use the built-in XPath and XPointer implementation In this case one can use the built-in XPath and XPointer implementation
to select subnodes or ranges. A flexible Input/Output mechanism is to select sub nodes or ranges. A flexible Input/Output mechanism is
available, with existing HTTP and FTP modules and combined to an available, with existing HTTP and FTP modules and combined to an
URI library. URI library.
%package static
Summary: Static library for libxml2
Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
%description static
Static library for libxml2 provided for specific uses or shaving a few
microseconds when parsing, do not link to them for generic purpose packages.
%package python %package python
Summary: Python bindings for the libxml2 library Summary: Python bindings for the libxml2 library
Group: Development/Libraries Group: Development/Libraries
Requires: libxml2 = %{version}-%{release} Requires: libxml2 = %{version}-%{release}
Requires: python
%description python %description python
The libxml2-python package contains a module that permits applications The libxml2-python package contains a Python 2 module that permits applications
written in the Python programming language to use the interface written in the Python programming language, version 2, to use the interface
supplied by the libxml2 library to manipulate XML files. supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support This library allows to manipulate XML files. It includes support
@ -55,35 +72,64 @@ to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified. at parse time or later once the document has been modified.
%if 0%{?with_python3}
%package python3
Summary: Python 3 bindings for the libxml2 library
Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
%description python3
The libxml2-python3 package contains a Python 3 module that permits
applications written in the Python programming language, version 3, to use the
interface supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support
to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
%endif # with_python3
%prep %prep
%setup -q %setup -q
%build %build
%configure %configure
make %{_smp_mflags} make %{_smp_mflags}
gzip -9 ChangeLog
%install %install
rm -fr %{buildroot} rm -fr %{buildroot}
%makeinstall make install DESTDIR=%{buildroot}
(cd doc/examples ; make clean ; rm -rf .deps Makefile)
gzip -9 doc/libxml2-api.xml %if 0%{?with_python3}
make clean
%configure --with-python=%{__python3}
make install DESTDIR=%{buildroot}
%endif # with_python3
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
(cd doc/examples ; make clean ; rm -rf .deps Makefile)
gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
%check
make runtests
%clean %clean
rm -fr %{buildroot} rm -fr %{buildroot}
%post %post -p /sbin/ldconfig
/sbin/ldconfig
%postun %postun -p /sbin/ldconfig
/sbin/ldconfig
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO %doc AUTHORS NEWS README Copyright TODO
%doc %{_mandir}/man1/xmllint.1* %doc %{_mandir}/man1/xmllint.1*
%doc %{_mandir}/man1/xmlcatalog.1* %doc %{_mandir}/man1/xmlcatalog.1*
%doc %{_mandir}/man3/libxml.3* %doc %{_mandir}/man3/libxml.3*
@ -96,7 +142,7 @@ rm -fr %{buildroot}
%defattr(-, root, root) %defattr(-, root, root)
%doc %{_mandir}/man1/xml2-config.1* %doc %{_mandir}/man1/xml2-config.1*
%doc AUTHORS ChangeLog.gz NEWS README Copyright %doc AUTHORS NEWS README Copyright
%doc doc/*.html doc/html doc/*.gif doc/*.png %doc doc/*.html doc/html doc/*.gif doc/*.png
%doc doc/tutorial doc/libxml2-api.xml.gz %doc doc/tutorial doc/libxml2-api.xml.gz
%doc doc/examples %doc doc/examples
@ -107,25 +153,46 @@ rm -fr %{buildroot}
%doc %{_datadir}/gtk-doc/html/libxml2/*.css %doc %{_datadir}/gtk-doc/html/libxml2/*.css
%{_libdir}/lib*.so %{_libdir}/lib*.so
%{_libdir}/*a
%{_libdir}/*.sh %{_libdir}/*.sh
%{_includedir}/* %{_includedir}/*
%{_bindir}/xml2-config %{_bindir}/xml2-config
%{_datadir}/aclocal/libxml.m4 %{_datadir}/aclocal/libxml.m4
%{_libdir}/pkgconfig/libxml-2.0.pc %{_libdir}/pkgconfig/libxml-2.0.pc
%{_libdir}/cmake/libxml2/libxml2-config.cmake
%files static
%defattr(-, root, root)
%{_libdir}/*a
%files python %files python
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README Copyright %{_libdir}/python2*/site-packages/libxml2.py*
%{_libdir}/python*/site-packages/libxml2.py* %{_libdir}/python2*/site-packages/drv_libxml2.py*
%{_libdir}/python*/site-packages/drv_libxml2.py* %{_libdir}/python2*/site-packages/libxml2mod*
%{_libdir}/python*/site-packages/libxml2mod*
%doc python/TODO %doc python/TODO
%doc python/libxml2class.txt %doc python/libxml2class.txt
%doc python/tests/*.py %doc python/tests/*.py
%doc doc/*.py %doc doc/*.py
%doc doc/python.html %doc doc/python.html
%if 0%{?with_python3}
%files python3
%defattr(-, root, root)
%{_libdir}/python3*/site-packages/libxml2.py*
%{_libdir}/python3*/site-packages/drv_libxml2.py*
%{_libdir}/python3*/site-packages/__pycache__/libxml2.cpython-34.py*
%{_libdir}/python3*/site-packages/__pycache__/drv_libxml2.cpython-34.py*
%{_libdir}/python3*/site-packages/libxml2mod*
%doc python/TODO
%doc python/libxml2class.txt
%doc python/tests/*.py
%doc doc/*.py
%doc doc/python.html
%endif # with_python3
%changelog %changelog
* @RELDATE@ Daniel Veillard <veillard@redhat.com> * @RELDATE@ Daniel Veillard <veillard@redhat.com>
- upstream release @VERSION@ see http://xmlsoft.org/news.html - upstream release @VERSION@ see http://xmlsoft.org/news.html

View File

@ -0,0 +1,50 @@
# libxml2-config.cmake
# --------------------
#
# Libxml2 cmake module.
# THis module sets the following variables:
#
# ::
#
# LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located.
# LIBXML2_LIBRARIES - xml2 libraries to link against.
# LIBXML2_VERSION_MAJOR - The major version of libxml2.
# LIBXML2_VERSION_MINOR - The minor version of libxml2.
# LIBXML2_VERSION_PATCH - The patch version of libxml2.
# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
# LIBXML2_MODULES - whether libxml2 as dso support
get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@)
set(LIBXML2_VERSION_STRING "@VERSION@")
set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
set(LIBXML2_INCLUDE_DIRS ${_libxml2_rootdir}/include ${_libxml2_rootdir}/include/libxml2)
set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib)
set(LIBXML2_LIBRARIES -L${LIBXML2_LIBRARY_DIR} -lxml2)
if(@WITH_THREADS@)
find_package(Threads REQUIRED)
list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
if(@WITH_LZMA@)
find_package(LibLZMA REQUIRED)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS})
endif()
if(@WITH_ZLIB@)
find_package(ZLIB REQUIRED)
list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
endif()
list(APPEND LIBXML2_LIBRARIES @ICU_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@)
# whether libxml2 has dso support
set(LIBXML2_MODULES @WITH_MODULES@)
mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES )

View File

@ -1,12 +1,20 @@
%global with_python3 1
Summary: Library providing XML and HTML support Summary: Library providing XML and HTML support
Name: libxml2 Name: libxml2
Version: 2.7.7 Version: 2.9.4
Release: 1 Release: 1%{?dist}%{?extra_release}
License: MIT License: MIT
Group: Development/Libraries Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: python python-devel zlib-devel pkgconfig BuildRequires: python-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif # with_python3
BuildRequires: zlib-devel
BuildRequires: pkgconfig
BuildRequires: xz-devel
URL: http://xmlsoft.org/ URL: http://xmlsoft.org/
%description %description
@ -16,7 +24,7 @@ this includes parsing and validation even with complex DtDs, either
at parse time or later once the document has been modified. The output at parse time or later once the document has been modified. The output
can be a simple SAX stream or and in-memory DOM like representations. can be a simple SAX stream or and in-memory DOM like representations.
In this case one can use the built-in XPath and XPointer implementation In this case one can use the built-in XPath and XPointer implementation
to select subnodes or ranges. A flexible Input/Output mechanism is to select sub nodes or ranges. A flexible Input/Output mechanism is
available, with existing HTTP and FTP modules and combined to an available, with existing HTTP and FTP modules and combined to an
URI library. URI library.
@ -25,6 +33,7 @@ Summary: Libraries, includes, etc. to develop XML and HTML applications
Group: Development/Libraries Group: Development/Libraries
Requires: libxml2 = %{version}-%{release} Requires: libxml2 = %{version}-%{release}
Requires: zlib-devel Requires: zlib-devel
Requires: xz-devel
Requires: pkgconfig Requires: pkgconfig
%description devel %description devel
@ -35,19 +44,27 @@ this includes parsing and validation even with complex DtDs, either
at parse time or later once the document has been modified. The output at parse time or later once the document has been modified. The output
can be a simple SAX stream or and in-memory DOM like representations. can be a simple SAX stream or and in-memory DOM like representations.
In this case one can use the built-in XPath and XPointer implementation In this case one can use the built-in XPath and XPointer implementation
to select subnodes or ranges. A flexible Input/Output mechanism is to select sub nodes or ranges. A flexible Input/Output mechanism is
available, with existing HTTP and FTP modules and combined to an available, with existing HTTP and FTP modules and combined to an
URI library. URI library.
%package static
Summary: Static library for libxml2
Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
%description static
Static library for libxml2 provided for specific uses or shaving a few
microseconds when parsing, do not link to them for generic purpose packages.
%package python %package python
Summary: Python bindings for the libxml2 library Summary: Python bindings for the libxml2 library
Group: Development/Libraries Group: Development/Libraries
Requires: libxml2 = %{version}-%{release} Requires: libxml2 = %{version}-%{release}
Requires: python
%description python %description python
The libxml2-python package contains a module that permits applications The libxml2-python package contains a Python 2 module that permits applications
written in the Python programming language to use the interface written in the Python programming language, version 2, to use the interface
supplied by the libxml2 library to manipulate XML files. supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support This library allows to manipulate XML files. It includes support
@ -55,35 +72,64 @@ to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified. at parse time or later once the document has been modified.
%if 0%{?with_python3}
%package python3
Summary: Python 3 bindings for the libxml2 library
Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
%description python3
The libxml2-python3 package contains a Python 3 module that permits
applications written in the Python programming language, version 3, to use the
interface supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support
to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
%endif # with_python3
%prep %prep
%setup -q %setup -q
%build %build
%configure %configure
make %{_smp_mflags} make %{_smp_mflags}
gzip -9 ChangeLog
%install %install
rm -fr %{buildroot} rm -fr %{buildroot}
%makeinstall make install DESTDIR=%{buildroot}
(cd doc/examples ; make clean ; rm -rf .deps Makefile)
gzip -9 doc/libxml2-api.xml %if 0%{?with_python3}
make clean
%configure --with-python=%{__python3}
make install DESTDIR=%{buildroot}
%endif # with_python3
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
(cd doc/examples ; make clean ; rm -rf .deps Makefile)
gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
%check
make runtests
%clean %clean
rm -fr %{buildroot} rm -fr %{buildroot}
%post %post -p /sbin/ldconfig
/sbin/ldconfig
%postun %postun -p /sbin/ldconfig
/sbin/ldconfig
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO %doc AUTHORS NEWS README Copyright TODO
%doc %{_mandir}/man1/xmllint.1* %doc %{_mandir}/man1/xmllint.1*
%doc %{_mandir}/man1/xmlcatalog.1* %doc %{_mandir}/man1/xmlcatalog.1*
%doc %{_mandir}/man3/libxml.3* %doc %{_mandir}/man3/libxml.3*
@ -96,7 +142,7 @@ rm -fr %{buildroot}
%defattr(-, root, root) %defattr(-, root, root)
%doc %{_mandir}/man1/xml2-config.1* %doc %{_mandir}/man1/xml2-config.1*
%doc AUTHORS ChangeLog.gz NEWS README Copyright %doc AUTHORS NEWS README Copyright
%doc doc/*.html doc/html doc/*.gif doc/*.png %doc doc/*.html doc/html doc/*.gif doc/*.png
%doc doc/tutorial doc/libxml2-api.xml.gz %doc doc/tutorial doc/libxml2-api.xml.gz
%doc doc/examples %doc doc/examples
@ -107,26 +153,47 @@ rm -fr %{buildroot}
%doc %{_datadir}/gtk-doc/html/libxml2/*.css %doc %{_datadir}/gtk-doc/html/libxml2/*.css
%{_libdir}/lib*.so %{_libdir}/lib*.so
%{_libdir}/*a
%{_libdir}/*.sh %{_libdir}/*.sh
%{_includedir}/* %{_includedir}/*
%{_bindir}/xml2-config %{_bindir}/xml2-config
%{_datadir}/aclocal/libxml.m4 %{_datadir}/aclocal/libxml.m4
%{_libdir}/pkgconfig/libxml-2.0.pc %{_libdir}/pkgconfig/libxml-2.0.pc
%{_libdir}/cmake/libxml2/libxml2-config.cmake
%files static
%defattr(-, root, root)
%{_libdir}/*a
%files python %files python
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README Copyright %{_libdir}/python2*/site-packages/libxml2.py*
%{_libdir}/python*/site-packages/libxml2.py* %{_libdir}/python2*/site-packages/drv_libxml2.py*
%{_libdir}/python*/site-packages/drv_libxml2.py* %{_libdir}/python2*/site-packages/libxml2mod*
%{_libdir}/python*/site-packages/libxml2mod*
%doc python/TODO %doc python/TODO
%doc python/libxml2class.txt %doc python/libxml2class.txt
%doc python/tests/*.py %doc python/tests/*.py
%doc doc/*.py %doc doc/*.py
%doc doc/python.html %doc doc/python.html
%changelog %if 0%{?with_python3}
* Mon Mar 15 2010 Daniel Veillard <veillard@redhat.com> %files python3
- upstream release 2.7.7 see http://xmlsoft.org/news.html %defattr(-, root, root)
%{_libdir}/python3*/site-packages/libxml2.py*
%{_libdir}/python3*/site-packages/drv_libxml2.py*
%{_libdir}/python3*/site-packages/__pycache__/libxml2.cpython-34.py*
%{_libdir}/python3*/site-packages/__pycache__/drv_libxml2.cpython-34.py*
%{_libdir}/python3*/site-packages/libxml2mod*
%doc python/TODO
%doc python/libxml2class.txt
%doc python/tests/*.py
%doc doc/*.py
%doc doc/python.html
%endif # with_python3
%changelog
* Thu May 26 2016 Daniel Veillard <veillard@redhat.com>
- upstream release 2.9.4 see http://xmlsoft.org/news.html

File diff suppressed because it is too large Load Diff

8065
packager/third_party/libxml/src/ltmain.sh vendored Executable file → Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,437 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option '$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the 'shared' and
# 'disable-shared' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the 'static' and
# 'disable-static' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the 'fast-install'
# and 'disable-fast-install' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[pic_mode=m4_default([$1], [default])])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

View File

@ -0,0 +1,123 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

View File

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 4179 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View File

@ -0,0 +1,98 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

View File

@ -0,0 +1,8 @@
This is a MacOS port contribution (not to be used for MacOS-X)
for the CodeWarrior environment.
Please contact the author directly in case of problems:
Eric <erlavigne@wanadoo.fr>
thanks,
Daniel

View File

@ -0,0 +1 @@
int test_main(int argc, char **argv);

Some files were not shown because too many files have changed in this diff Show More