mirror of
https://github.com/openharmony/third_party_expat.git
synced 2026-07-01 08:12:30 -04:00
expat change to openEuler-expat
Signed-off-by: kangchongtao <kangchongtao@huawei.com>
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
Expat is brought to you by:
|
||||
|
||||
Clark Cooper
|
||||
Fred L. Drake, Jr.
|
||||
Greg Stein
|
||||
James Clark
|
||||
Karl Waclawek
|
||||
Rhodri James
|
||||
Sebastian Pipping
|
||||
Steven Solie
|
||||
@@ -1,5 +1,8 @@
|
||||
import("//build/ohos.gni")
|
||||
|
||||
expat_path = rebase_path("//third_party/expat")
|
||||
exec_script("install.sh", [ "$expat_path" ])
|
||||
|
||||
## Build expat.a {{{
|
||||
config("expat_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
== How to build expat with cmake (experimental) ==
|
||||
|
||||
The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
|
||||
Studio) and should work on all other platform cmake supports.
|
||||
|
||||
Assuming ~/expat-2.4.1 is the source directory of expat, add a subdirectory
|
||||
build and change into that directory:
|
||||
~/expat-2.4.1$ mkdir build && cd build
|
||||
~/expat-2.4.1/build$
|
||||
|
||||
From that directory, call cmake first, then call make, make test and
|
||||
make install in the usual way:
|
||||
~/expat-2.4.1/build$ cmake ..
|
||||
-- The C compiler identification is GNU
|
||||
-- The CXX compiler identification is GNU
|
||||
....
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: /home/patrick/expat-2.4.1/build
|
||||
|
||||
If you want to specify the install location for your files, append
|
||||
-DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
|
||||
|
||||
~/expat-2.4.1/build$ make && make test && make install
|
||||
Scanning dependencies of target expat
|
||||
[ 5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
|
||||
[ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
|
||||
....
|
||||
-- Installing: /usr/local/lib/pkgconfig/expat.pc
|
||||
-- Installing: /usr/local/bin/xmlwf
|
||||
-- Installing: /usr/local/share/man/man1/xmlwf.1
|
||||
|
||||
For Windows builds, you must make sure to call cmake from an environment where
|
||||
your compiler is reachable, that means either you call it from the
|
||||
Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and
|
||||
make sure that gcc can be called. On Windows, you also might want to specify a
|
||||
special Generator for CMake:
|
||||
for Visual Studio builds do:
|
||||
cmake .. -G "Visual Studio 15 2017" && msbuild /m expat.sln
|
||||
for mingw builds do:
|
||||
cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install
|
||||
&& gmake && gmake install
|
||||
-786
@@ -1,786 +0,0 @@
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2010 Patrick Spendrin <ps_ml@gmx.de>
|
||||
# Copyright (c) 2012 Karl Waclawek <karl@waclawek.net>
|
||||
# Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2016 Sergei Nikulov <sergey.nikulov@gmail.com>
|
||||
# Copyright (c) 2016 Björn Lindahl <bjorn.lindahl@foi.se>
|
||||
# Copyright (c) 2016 Tobias Taschner <github@tc84.de>
|
||||
# Copyright (c) 2016 Ben Boeckel <ben.boeckel@kitware.com>
|
||||
# Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
# Copyright (c) 2017 Rolf Eike Beer <eike@sf-mail.de>
|
||||
# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
|
||||
# Copyright (c) 2017 Franek Korta <fkorta@gmail.com>
|
||||
# Copyright (c) 2018 pedro-vicente <pedro.vicente@space-research.org>
|
||||
# Copyright (c) 2018 Frank Rast <frank.rast@gefeg.com>
|
||||
# Copyright (c) 2018 userwithuid <userwithuid@gmail.com>
|
||||
# Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
# Copyright (c) 2019 Kishore Kunche <kishore.kunche@intel.com>
|
||||
# Copyright (c) 2019 xantares <xantares09@hotmail.com>
|
||||
# Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com>
|
||||
# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
# Copyright (c) 2019 Bhargava Shastry <bhargava.shastry@ethereum.org>
|
||||
# Copyright (c) 2020 Maciej Sroczyński <macieksroczynski@poczta.fm>
|
||||
# Copyright (c) 2020 Gulliver <gulliver@traumkristalle.net>
|
||||
# Copyright (c) 2020 Thomas Beutlich <tc@tbeu.de>
|
||||
# Copyright (c) 2021 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
|
||||
# Unlike most of Expat,
|
||||
# this file is copyrighted under the BSD-license for buildsystem files of KDE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.1.3)
|
||||
|
||||
# This allows controlling documented build time switches
|
||||
# when Expat is pulled in using the add_subdirectory function, e.g.
|
||||
#
|
||||
# set(EXPAT_BUILD_DOCS OFF)
|
||||
# set(EXPAT_BUILD_TOOLS OFF)
|
||||
# add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR})
|
||||
#
|
||||
# would disable compilation of the xmlwf CLI and its man page.
|
||||
# Without activating behaviour NEW for policy CMP0077 here,
|
||||
# a user with -Wdev enabled would see warning
|
||||
#
|
||||
# Policy CMP0077 is not set: option() honors normal variables. Run "cmake
|
||||
# --help-policy CMP0077" for policy details. Use the cmake_policy command to
|
||||
# set the policy and suppress this warning.
|
||||
#
|
||||
# For compatibility with older versions of CMake, option is clearing the
|
||||
# normal variable 'EXPAT_BUILD_DOCS'.
|
||||
#
|
||||
# and effectively not be able to adjust option EXPAT_BUILD_DOCS.
|
||||
#
|
||||
# For more details please see:
|
||||
# - https://cmake.org/cmake/help/latest/policy/CMP0077.html
|
||||
# - https://github.com/libexpat/libexpat/pull/419
|
||||
#
|
||||
if(POLICY CMP0077)
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
endif()
|
||||
|
||||
project(expat
|
||||
VERSION
|
||||
2.4.1
|
||||
LANGUAGES
|
||||
C
|
||||
)
|
||||
|
||||
set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org")
|
||||
set(PACKAGE_NAME "expat")
|
||||
set(PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
set(PACKAGE_TARNAME "${PACKAGE_NAME}")
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
#
|
||||
# Configuration defaults
|
||||
#
|
||||
if(WINCE)
|
||||
set(_EXPAT_BUILD_TOOLS_DEFAULT OFF)
|
||||
else()
|
||||
set(_EXPAT_BUILD_TOOLS_DEFAULT ON)
|
||||
endif()
|
||||
if(MSVC OR NOT _EXPAT_BUILD_TOOLS_DEFAULT)
|
||||
set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
|
||||
else()
|
||||
find_program(DOCBOOK_TO_MAN NAMES docbook2x-man db2x_docbook2man docbook2man docbook-to-man)
|
||||
if(DOCBOOK_TO_MAN)
|
||||
set(_EXPAT_BUILD_DOCS_DEFAULT ON)
|
||||
else()
|
||||
set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
|
||||
endif()
|
||||
endif()
|
||||
if(MSVC)
|
||||
set(_EXPAT_BUILD_PKGCONFIG_DEFAULT OFF)
|
||||
else()
|
||||
set(_EXPAT_BUILD_PKGCONFIG_DEFAULT ON)
|
||||
endif()
|
||||
if(DEFINED BUILD_SHARED_LIBS)
|
||||
set(_EXPAT_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS})
|
||||
else()
|
||||
set(_EXPAT_SHARED_LIBS_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Configuration
|
||||
#
|
||||
option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT})
|
||||
option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON)
|
||||
option(EXPAT_BUILD_TESTS "build the tests for expat library" ON)
|
||||
option(EXPAT_SHARED_LIBS "build a shared expat library" ${_EXPAT_SHARED_LIBS_DEFAULT})
|
||||
option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT})
|
||||
option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF)
|
||||
option(EXPAT_BUILD_PKGCONFIG "build pkg-config file" ${_EXPAT_BUILD_PKGCONFIG_DEFAULT})
|
||||
option(EXPAT_OSSFUZZ_BUILD "build fuzzers via ossfuzz for the expat library" OFF)
|
||||
if(UNIX OR _EXPAT_HELP)
|
||||
option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF)
|
||||
endif()
|
||||
option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON)
|
||||
set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
|
||||
mark_as_advanced(EXPAT_CONTEXT_BYTES)
|
||||
option(EXPAT_DTD "Define to make parameter entity parsing functionality available" ON)
|
||||
mark_as_advanced(EXPAT_DTD)
|
||||
option(EXPAT_NS "Define to make XML Namespaces functionality available" ON)
|
||||
mark_as_advanced(EXPAT_NS)
|
||||
option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
|
||||
if(UNIX OR _EXPAT_HELP)
|
||||
option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
|
||||
set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING
|
||||
"Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
|
||||
set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING
|
||||
"Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
|
||||
mark_as_advanced(EXPAT_DEV_URANDOM)
|
||||
endif()
|
||||
set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]")
|
||||
option(EXPAT_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF)
|
||||
mark_as_advanced(EXPAT_ATTR_INFO)
|
||||
option(EXPAT_LARGE_SIZE "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>" OFF)
|
||||
mark_as_advanced(EXPAT_LARGE_SIZE)
|
||||
option(EXPAT_MIN_SIZE "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)" OFF)
|
||||
mark_as_advanced(EXPAT_MIN_SIZE)
|
||||
if(MSVC OR _EXPAT_HELP)
|
||||
set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
|
||||
endif()
|
||||
|
||||
if(EXPAT_BUILD_TESTS)
|
||||
# We have to call enable_language() before modifying any CMAKE_CXX_* variables
|
||||
enable_language(CXX)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Environment checks
|
||||
#
|
||||
if(EXPAT_WITH_LIBBSD)
|
||||
find_library(LIB_BSD NAMES bsd)
|
||||
if(NOT LIB_BSD)
|
||||
message(SEND_ERROR "EXPAT_WITH_LIBBSD option is enabled, but libbsd was not found")
|
||||
else()
|
||||
set(HAVE_LIBBSD TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# For the three types of MSVC version values, please see:
|
||||
# - https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
||||
# - https://sourceforge.net/p/predef/wiki/Compilers/
|
||||
# - https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
|
||||
set(_EXPAT_MSVC_REQUIRED_INT 1800) # i.e. 12.0/2013/1800; see PR #426
|
||||
set(_EXPAT_MSVC_SUPPORTED_INT 1910)
|
||||
set(_EXPAT_MSVC_SUPPORTED_DISPLAY "Visual Studio 15.0/2017/${_EXPAT_MSVC_SUPPORTED_INT}")
|
||||
|
||||
if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_SUPPORTED_INT})
|
||||
if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_REQUIRED_INT})
|
||||
message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is TOO OLD to compile Expat without errors.")
|
||||
message(SEND_ERROR "Please use officially supported ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!")
|
||||
else()
|
||||
message(WARNING "MSVC_VERSION ${MSVC_VERSION} is NOT OFFICIALLY SUPPORTED by Expat.")
|
||||
message(WARNING "Please use ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(_expat_copy_bool_int source_ref dest_ref)
|
||||
if(${source_ref})
|
||||
set(${dest_ref} 1)
|
||||
else()
|
||||
set(${dest_ref} 0)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(EXPAT_LARGE_SIZE)
|
||||
add_definitions(-DXML_LARGE_SIZE)
|
||||
endif()
|
||||
|
||||
if(EXPAT_MIN_SIZE)
|
||||
add_definitions(-DXML_MIN_SIZE)
|
||||
endif()
|
||||
|
||||
if(EXPAT_CHAR_TYPE STREQUAL "char")
|
||||
set(_EXPAT_UNICODE OFF)
|
||||
set(_EXPAT_UNICODE_WCHAR_T OFF)
|
||||
elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
|
||||
set(_EXPAT_UNICODE ON)
|
||||
set(_EXPAT_UNICODE_WCHAR_T OFF)
|
||||
if(EXPAT_BUILD_EXAMPLES)
|
||||
message(SEND_ERROR "Examples can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_EXAMPLES=OFF.")
|
||||
endif()
|
||||
if(EXPAT_BUILD_TESTS)
|
||||
message(SEND_ERROR "The testsuite can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TESTS=OFF.")
|
||||
endif()
|
||||
if(EXPAT_BUILD_TOOLS)
|
||||
message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TOOLS=OFF.")
|
||||
endif()
|
||||
elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
|
||||
set(_EXPAT_UNICODE ON)
|
||||
set(_EXPAT_UNICODE_WCHAR_T ON)
|
||||
if(NOT WIN32)
|
||||
string(FIND "${CMAKE_C_FLAGS}" "-fshort-wchar" _expat_short_wchar_found)
|
||||
if(${_expat_short_wchar_found} EQUAL "-1")
|
||||
message(SEND_ERROR "Configuration -DEXPAT_CHAR_TYPE=wchar_t requires -DCMAKE_{C,CXX}_FLAGS=-fshort-wchar (which was not found) and libc compiled with -fshort-wchar, too.")
|
||||
endif()
|
||||
if (EXPAT_BUILD_TOOLS)
|
||||
message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=wchar_t outside of Windows. Please pass -DEXPAT_CHAR_TYPE=char or -DEXPAT_BUILD_TOOLS=OFF.")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(SEND_ERROR "Option -DEXPAT_CHAR_TYPE=(char|ushort|wchar_t) cannot be \"${EXPAT_CHAR_TYPE}\".")
|
||||
endif()
|
||||
|
||||
if(_EXPAT_UNICODE)
|
||||
add_definitions(-DXML_UNICODE) # for unsigned short
|
||||
if(_EXPAT_UNICODE_WCHAR_T)
|
||||
add_definitions(-DXML_UNICODE_WCHAR_T) # for wchar_t
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake)
|
||||
|
||||
macro(evaluate_detection_results use_ref have_ref thing_lower thing_title)
|
||||
if(${use_ref} AND NOT (${use_ref} STREQUAL "AUTO") AND NOT ${have_ref})
|
||||
message(SEND_ERROR
|
||||
"Use of ${thing_lower} was enforced by ${use_ref}=ON but it could not be found.")
|
||||
elseif(NOT ${use_ref} AND ${have_ref})
|
||||
message("${thing_title} was found but it will not be used due to ${use_ref}=OFF.")
|
||||
set(${have_ref} 0)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT WIN32)
|
||||
evaluate_detection_results(EXPAT_WITH_GETRANDOM HAVE_GETRANDOM "function getrandom" "Function getrandom")
|
||||
evaluate_detection_results(EXPAT_WITH_SYS_GETRANDOM HAVE_SYSCALL_GETRANDOM "syscall SYS_getrandom" "Syscall SYS_getrandom")
|
||||
endif()
|
||||
|
||||
_expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO)
|
||||
_expat_copy_bool_int(EXPAT_DTD XML_DTD)
|
||||
_expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE)
|
||||
_expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE)
|
||||
_expat_copy_bool_int(EXPAT_NS XML_NS)
|
||||
if(NOT WIN32)
|
||||
_expat_copy_bool_int(EXPAT_DEV_URANDOM XML_DEV_URANDOM)
|
||||
endif()
|
||||
set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES})
|
||||
|
||||
macro(expat_install)
|
||||
if(EXPAT_ENABLE_INSTALL)
|
||||
install(${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
|
||||
expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
|
||||
set(EXTRA_COMPILE_FLAGS)
|
||||
if(FLAG_NO_STRICT_ALIASING)
|
||||
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")
|
||||
endif()
|
||||
if(FLAG_VISIBILITY)
|
||||
add_definitions(-DXML_ENABLE_VISIBILITY=1)
|
||||
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
|
||||
endif()
|
||||
if(MINGW)
|
||||
# Without __USE_MINGW_ANSI_STDIO the compiler produces a false positive
|
||||
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-pedantic-ms-format")
|
||||
endif()
|
||||
if (EXPAT_WARNINGS_AS_ERRORS)
|
||||
if(MSVC)
|
||||
add_definitions(/WX)
|
||||
else()
|
||||
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
|
||||
|
||||
if (MSVC)
|
||||
if (EXPAT_MSVC_STATIC_CRT)
|
||||
message("-- Using static CRT ${EXPAT_MSVC_STATIC_CRT}")
|
||||
foreach(flag_var
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
|
||||
endif()
|
||||
if(WIN32)
|
||||
if(_EXPAT_UNICODE_WCHAR_T)
|
||||
set(_POSTFIX_WIDE "w")
|
||||
endif()
|
||||
|
||||
if(MSVC AND NOT EXPAT_SHARED_LIBS)
|
||||
if(EXPAT_MSVC_STATIC_CRT)
|
||||
set(_POSTFIX_CRT "MT")
|
||||
else()
|
||||
set(_POSTFIX_CRT "MD")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(postfix_var
|
||||
CMAKE_DEBUG_POSTFIX
|
||||
CMAKE_RELEASE_POSTFIX
|
||||
CMAKE_MINSIZEREL_POSTFIX
|
||||
CMAKE_RELWITHDEBINFO_POSTFIX
|
||||
)
|
||||
if(postfix_var STREQUAL "CMAKE_DEBUG_POSTFIX")
|
||||
set(_POSTFIX_DEBUG "d")
|
||||
else()
|
||||
set(_POSTFIX_DEBUG "")
|
||||
endif()
|
||||
|
||||
set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat<postfix=[w][d][MD|MT]>.lib")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#
|
||||
# C library
|
||||
#
|
||||
set(expat_SRCS
|
||||
lib/xmlparse.c
|
||||
lib/xmlrole.c
|
||||
lib/xmltok.c
|
||||
# NOTE: ISO C forbids an empty translation unit
|
||||
# lib/xmltok_impl.c
|
||||
# lib/xmltok_ns.c
|
||||
)
|
||||
|
||||
if(EXPAT_SHARED_LIBS)
|
||||
set(_SHARED SHARED)
|
||||
if(MSVC)
|
||||
set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
|
||||
endif()
|
||||
else()
|
||||
set(_SHARED STATIC)
|
||||
endif()
|
||||
|
||||
# Avoid colliding with Expat.dll of Perl's XML::Parser::Expat
|
||||
if(WIN32 AND NOT MINGW)
|
||||
set(_EXPAT_OUTPUT_NAME libexpat) # CMAKE_*_POSTFIX applies, see above
|
||||
else()
|
||||
if(_EXPAT_UNICODE)
|
||||
set(_EXPAT_OUTPUT_NAME expatw)
|
||||
else()
|
||||
set(_EXPAT_OUTPUT_NAME expat)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(expat ${_SHARED} ${expat_SRCS})
|
||||
if(EXPAT_WITH_LIBBSD)
|
||||
target_link_libraries(expat ${LIB_BSD})
|
||||
endif()
|
||||
|
||||
set(LIBCURRENT 9) # sync
|
||||
set(LIBREVISION 1) # with
|
||||
set(LIBAGE 8) # configure.ac!
|
||||
math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
|
||||
|
||||
set_property(TARGET expat PROPERTY OUTPUT_NAME "${_EXPAT_OUTPUT_NAME}")
|
||||
if(NOT WIN32)
|
||||
set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
|
||||
set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
|
||||
set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
|
||||
endif()
|
||||
|
||||
target_include_directories(expat
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
if(NOT EXPAT_SHARED_LIBS AND WIN32)
|
||||
target_compile_definitions(expat PUBLIC -DXML_STATIC)
|
||||
endif()
|
||||
|
||||
expat_install(TARGETS expat EXPORT expat
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
#
|
||||
# pkg-config file
|
||||
#
|
||||
if(EXPAT_BUILD_PKGCONFIG)
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
|
||||
if(CMAKE_INSTALL_LIBDIR MATCHES "^/")
|
||||
set(libdir "${CMAKE_INSTALL_LIBDIR}")
|
||||
else()
|
||||
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/")
|
||||
set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
else()
|
||||
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
|
||||
expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
endif()
|
||||
|
||||
#
|
||||
# C command line tool xmlwf
|
||||
#
|
||||
if(EXPAT_BUILD_TOOLS)
|
||||
set(xmlwf_SRCS
|
||||
xmlwf/xmlwf.c
|
||||
xmlwf/xmlfile.c
|
||||
xmlwf/codepage.c
|
||||
xmlwf/readfilemap.c
|
||||
)
|
||||
|
||||
add_executable(xmlwf ${xmlwf_SRCS})
|
||||
set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
|
||||
target_link_libraries(xmlwf expat)
|
||||
expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
|
||||
# https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html
|
||||
set_target_properties(xmlwf PROPERTIES LINK_FLAGS -municode)
|
||||
endif()
|
||||
|
||||
if(EXPAT_BUILD_DOCS)
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
|
||||
add_custom_target(
|
||||
xmlwf-manpage
|
||||
COMMAND
|
||||
"${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1"
|
||||
BYPRODUCTS
|
||||
doc/xmlwf.1)
|
||||
add_dependencies(expat xmlwf-manpage)
|
||||
expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
elseif(EXISTS ${PROJECT_SOURCE_DIR}/doc/xmlwf.1)
|
||||
expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# C code examples
|
||||
#
|
||||
if(EXPAT_BUILD_EXAMPLES)
|
||||
add_executable(elements examples/elements.c)
|
||||
set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
|
||||
target_link_libraries(elements expat)
|
||||
|
||||
add_executable(outline examples/outline.c)
|
||||
set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
|
||||
target_link_libraries(outline expat)
|
||||
endif()
|
||||
|
||||
#
|
||||
# C/C++ test runners
|
||||
#
|
||||
if(EXPAT_BUILD_TESTS)
|
||||
## these are unittests that can be run on any platform
|
||||
enable_testing()
|
||||
|
||||
set(test_SRCS
|
||||
tests/chardata.c
|
||||
tests/memcheck.c
|
||||
tests/minicheck.c
|
||||
tests/structdata.c
|
||||
${expat_SRCS}
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
if(MINGW)
|
||||
set(host whatever-mingw32) # for nothing but run.sh
|
||||
endif()
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.sh.in run.sh @ONLY)
|
||||
endif()
|
||||
|
||||
function(expat_add_test _name _file)
|
||||
if(MSVC)
|
||||
add_test(NAME ${_name} COMMAND ${_file})
|
||||
else()
|
||||
add_test(NAME ${_name} COMMAND bash run.sh ${_file})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_executable(runtests tests/runtests.c ${test_SRCS})
|
||||
set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
|
||||
expat_add_test(runtests $<TARGET_FILE:runtests>)
|
||||
|
||||
add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
|
||||
set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
|
||||
expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
|
||||
|
||||
if(EXPAT_WITH_LIBBSD)
|
||||
target_link_libraries(runtests ${LIB_BSD})
|
||||
target_link_libraries(runtestspp ${LIB_BSD})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXPAT_BUILD_FUZZERS)
|
||||
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
message(SEND_ERROR
|
||||
"Building fuzz targets without Clang (but ${CMAKE_C_COMPILER_ID}) "
|
||||
"is not supported. Please set "
|
||||
"-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++.")
|
||||
endif()
|
||||
|
||||
string(FIND "${CMAKE_C_FLAGS}" "-fsanitize" sanitizer_present)
|
||||
if(${sanitizer_present} EQUAL "-1")
|
||||
message(WARNING
|
||||
"There was no sanitizer present when building the fuzz targets. "
|
||||
"This is likely in error - consider adding "
|
||||
"-DCMAKE_C_FLAGS='-fsanitize=<sanitizer>' and "
|
||||
"-DCMAKE_CXX_FLAGS='-fsanitize=<sanitizer>' and "
|
||||
"-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
|
||||
"-DCMAKE_MODULE_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS='-fsanitize=<sanitizer>' to your cmake "
|
||||
"execution.")
|
||||
endif()
|
||||
|
||||
if(EXPAT_OSSFUZZ_BUILD AND NOT DEFINED ENV{LIB_FUZZING_ENGINE})
|
||||
message(SEND_ERROR
|
||||
"OSS-Fuzz builds require the environment variable "
|
||||
"LIB_FUZZING_ENGINE to be set. If you are seeing this "
|
||||
"warning, it points to a deeper problem in the ossfuzz "
|
||||
"build setup.")
|
||||
endif()
|
||||
|
||||
set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE)
|
||||
set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer)
|
||||
|
||||
add_library(fuzzpat STATIC ${expat_SRCS})
|
||||
if(NOT EXPAT_OSSFUZZ_BUILD)
|
||||
target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link)
|
||||
endif()
|
||||
|
||||
foreach(fuzz_target ${fuzz_targets})
|
||||
foreach(encoding_type ${encoding_types})
|
||||
set(target_name ${fuzz_target}_${encoding_type})
|
||||
add_executable(${target_name} fuzz/${fuzz_target}.c)
|
||||
target_link_libraries(${target_name} fuzzpat)
|
||||
target_compile_definitions(${target_name}
|
||||
PRIVATE ENCODING_FOR_FUZZING=${encoding_type})
|
||||
if(NOT EXPAT_OSSFUZZ_BUILD)
|
||||
target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer-no-link)
|
||||
endif()
|
||||
# NOTE: Avoiding target_link_options here only because it needs CMake >=3.13
|
||||
if(EXPAT_OSSFUZZ_BUILD)
|
||||
set_target_properties(${target_name} PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
|
||||
set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE "CXX")
|
||||
else()
|
||||
set_target_properties(${target_name} PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
|
||||
endif()
|
||||
set_property(
|
||||
TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
if(EXPAT_OSSFUZZ_BUILD)
|
||||
message(SEND_ERROR
|
||||
"Attempting to perform an ossfuzz build without turning on the fuzzer build. "
|
||||
"This is likely in error - consider adding "
|
||||
"-DEXPAT_BUILD_FUZZERS=ON to your cmake execution.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Custom target "run-xmltest"
|
||||
#
|
||||
if(EXPAT_BUILD_TOOLS AND NOT MSVC)
|
||||
add_custom_target(
|
||||
xmlts-zip-downloaded
|
||||
COMMAND
|
||||
sh -c 'test -f xmlts.zip || wget --output-document=xmlts.zip https://www.w3.org/XML/Test/xmlts20080827.zip'
|
||||
BYPRODUCTS
|
||||
tests/xmlts.zip
|
||||
WORKING_DIRECTORY
|
||||
tests/)
|
||||
|
||||
add_custom_target(
|
||||
xmlts-zip-extracted
|
||||
COMMAND
|
||||
sh -c 'test -d xmlconf || unzip -q xmlts.zip'
|
||||
BYPRODUCTS
|
||||
tests/xmlconf
|
||||
WORKING_DIRECTORY
|
||||
tests/)
|
||||
add_dependencies(xmlts-zip-extracted xmlts-zip-downloaded)
|
||||
|
||||
add_custom_target(
|
||||
xmltest-sh-been-run
|
||||
COMMAND
|
||||
sh -c '${CMAKE_CURRENT_SOURCE_DIR}/tests/xmltest.sh "bash ${CMAKE_CURRENT_BINARY_DIR}/run.sh $<TARGET_FILE:xmlwf>" 2>&1 | tee tests/xmltest.log'
|
||||
BYPRODUCTS
|
||||
tests/xmltest.log)
|
||||
add_dependencies(xmltest-sh-been-run xmlts-zip-extracted xmlwf)
|
||||
|
||||
add_custom_target(
|
||||
xmltest-log-fixed
|
||||
COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fix-xmltest-log.sh tests/xmltest.log
|
||||
DEPENDS
|
||||
tests/xmltest.log)
|
||||
add_dependencies(xmltest-log-fixed xmltest-sh-been-run)
|
||||
|
||||
add_custom_target(
|
||||
xmltest-log-verified
|
||||
COMMAND
|
||||
diff -u ${CMAKE_CURRENT_SOURCE_DIR}/tests/xmltest.log.expected tests/xmltest.log)
|
||||
add_dependencies(xmltest-log-verified xmltest-log-fixed)
|
||||
|
||||
add_custom_target(run-xmltest)
|
||||
add_dependencies(run-xmltest xmltest-log-verified)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
configure_file(Changes changelog COPYONLY)
|
||||
expat_install(
|
||||
FILES
|
||||
AUTHORS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/changelog
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_DOCDIR})
|
||||
|
||||
#
|
||||
# CMake files for find_package(expat [..] CONFIG [..])
|
||||
#
|
||||
configure_package_config_file(
|
||||
cmake/expat-config.cmake.in
|
||||
cmake/expat-config.cmake
|
||||
INSTALL_DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
|
||||
)
|
||||
write_basic_package_version_file(
|
||||
cmake/expat-config-version.cmake
|
||||
COMPATIBILITY SameMajorVersion # i.e. semver
|
||||
)
|
||||
export(
|
||||
TARGETS
|
||||
expat
|
||||
FILE
|
||||
cmake/expat-targets.cmake # not going to be installed
|
||||
)
|
||||
expat_install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake/expat-config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake/expat-config-version.cmake
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
|
||||
)
|
||||
expat_install(
|
||||
EXPORT
|
||||
expat
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
|
||||
NAMESPACE
|
||||
expat::
|
||||
)
|
||||
|
||||
#
|
||||
# CPack
|
||||
#
|
||||
|
||||
# This effectively disables target "package_source".
|
||||
# That is done due to CPack's unfortunate choice of an exclusion list
|
||||
# rather than inclusion list. An exclusion list does not protect against
|
||||
# unwanted files ending up in the resulting archive in a way that's
|
||||
# safe to run from an Expat developer's machine.
|
||||
set(CPACK_SOURCE_GENERATOR '')
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
else()
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
#
|
||||
# Summary
|
||||
#
|
||||
if(EXPAT_CHAR_TYPE STREQUAL "char")
|
||||
set(_EXPAT_CHAR_TYPE_SUMMARY "char (UTF-8)")
|
||||
elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
|
||||
set(_EXPAT_CHAR_TYPE_SUMMARY "ushort (unsigned short, UTF-16)")
|
||||
elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
|
||||
if(WIN32)
|
||||
set(_EXPAT_CHAR_TYPE_SUMMARY "wchar_t (UTF-16)")
|
||||
else()
|
||||
set(_EXPAT_CHAR_TYPE_SUMMARY "wchar_t (UTF-32) // not implemented")
|
||||
endif()
|
||||
else()
|
||||
set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR")
|
||||
endif()
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER)
|
||||
|
||||
message(STATUS "===========================================================================")
|
||||
message(STATUS "")
|
||||
message(STATUS "Configuration")
|
||||
message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}")
|
||||
message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}")
|
||||
message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}")
|
||||
if(MSVC)
|
||||
message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}")
|
||||
endif()
|
||||
message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}")
|
||||
if(WIN32)
|
||||
message(STATUS " Binary postfix ............. ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
|
||||
endif()
|
||||
message(STATUS "")
|
||||
message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}")
|
||||
message(STATUS " Build examples ............. ${EXPAT_BUILD_EXAMPLES}")
|
||||
message(STATUS " Build fuzzers .............. ${EXPAT_BUILD_FUZZERS}")
|
||||
message(STATUS " Build tests ................ ${EXPAT_BUILD_TESTS}")
|
||||
message(STATUS " Build tools (xmlwf) ........ ${EXPAT_BUILD_TOOLS}")
|
||||
message(STATUS " Build pkg-config file ...... ${EXPAT_BUILD_PKGCONFIG}")
|
||||
message(STATUS " Install files .............. ${EXPAT_ENABLE_INSTALL}")
|
||||
message(STATUS "")
|
||||
message(STATUS " Features")
|
||||
message(STATUS " // Advanced options, changes not advised")
|
||||
message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}")
|
||||
message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}")
|
||||
message(STATUS " DTD support .............. ${EXPAT_DTD}")
|
||||
message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}")
|
||||
message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}")
|
||||
message(STATUS " Namespace support ........ ${EXPAT_NS}")
|
||||
message(STATUS "")
|
||||
message(STATUS " Entropy sources")
|
||||
if(WIN32)
|
||||
message(STATUS " rand_s ................... ON")
|
||||
else()
|
||||
message(STATUS " getrandom ................ ${HAVE_GETRANDOM}")
|
||||
message(STATUS " syscall SYS_getrandom .... ${HAVE_SYSCALL_GETRANDOM}")
|
||||
message(STATUS " libbsd ................... ${EXPAT_WITH_LIBBSD}")
|
||||
message(STATUS " /dev/random .............. ${EXPAT_DEV_URANDOM}")
|
||||
endif()
|
||||
message(STATUS "")
|
||||
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
message(STATUS "Continue with")
|
||||
message(STATUS " make")
|
||||
if(EXPAT_BUILD_TESTS)
|
||||
message(STATUS " make test")
|
||||
endif()
|
||||
if(EXPAT_ENABLE_INSTALL)
|
||||
message(STATUS " sudo make install")
|
||||
endif()
|
||||
message(STATUS "")
|
||||
endif()
|
||||
message(STATUS "===========================================================================")
|
||||
@@ -1,21 +0,0 @@
|
||||
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
|
||||
Copyright (c) 2001-2019 Expat maintainers
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
@@ -1,972 +0,0 @@
|
||||
NOTE: We are looking for help with a few things:
|
||||
https://github.com/libexpat/libexpat/labels/help%20wanted
|
||||
If you can help, please get in touch. Thanks!
|
||||
|
||||
Release 2.4.9 Thur Oct 27 2022
|
||||
Security fixes:
|
||||
#616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager
|
||||
destruction of a shared DTD in function
|
||||
XML_ExternalEntityParserCreate in out-of-memory situations
|
||||
|
||||
Release 2.4.9 Wed Sep 14 2022
|
||||
Security fixes:
|
||||
#629 #640 CVE-2022-40674 -- Heap use-after-free vulnerability in
|
||||
function doContent. Expected impact is denial of service
|
||||
or potentially arbitrary code execution.
|
||||
|
||||
Release 2.4.1 Sun May 23 2021
|
||||
Bug fixes:
|
||||
#488 #490 Autotools: Fix installed header expat_config.h for multilib
|
||||
systems; regression introduced in 2.4.0 by pull request #486
|
||||
|
||||
Other changes:
|
||||
#491 #492 Version info bumped from 9:0:8 to 9:1:8;
|
||||
see https://verbump.de/ for what these numbers do
|
||||
|
||||
Special thanks to:
|
||||
Gentoo's QA check "multilib_check_headers"
|
||||
|
||||
Release 2.4.0 Sun May 23 2021
|
||||
Security fixes:
|
||||
#34 #466 #484 CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks
|
||||
(denial-of-service; flavors targeting CPU time or RAM or both,
|
||||
leveraging general entities or parameter entities or both)
|
||||
by tracking and limiting the input amplification factor
|
||||
(<amplification> := (<direct> + <indirect>) / <direct>).
|
||||
By conservative default, amplification up to a factor of 100.0
|
||||
is tolerated and rejection only starts after 8 MiB of output bytes
|
||||
(=<direct> + <indirect>) have been processed.
|
||||
The fix adds the following to the API:
|
||||
- A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to
|
||||
signals this specific condition.
|
||||
- Two new API functions ..
|
||||
- XML_SetBillionLaughsAttackProtectionMaximumAmplification and
|
||||
- XML_SetBillionLaughsAttackProtectionActivationThreshold
|
||||
.. to further tighten billion laughs protection parameters
|
||||
when desired. Please see file "doc/reference.html" for details.
|
||||
If you ever need to increase the defaults for non-attack XML
|
||||
payload, please file a bug report with libexpat.
|
||||
- Two new XML_FEATURE_* constants ..
|
||||
- that can be queried using the XML_GetFeatureList function, and
|
||||
- that are shown in "xmlwf -v" output.
|
||||
- Two new environment variable switches ..
|
||||
- EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and
|
||||
- EXPAT_ENTITY_DEBUG=(0|1)
|
||||
.. for runtime debugging of accounting and entity processing.
|
||||
Specific behavior of these values may change in the future.
|
||||
- Two new command line arguments "-a FACTOR" and "-b BYTES"
|
||||
for xmlwf to further tighten billion laughs protection
|
||||
parameters when desired.
|
||||
If you ever need to increase the defaults for non-attack XML
|
||||
payload, please file a bug report with libexpat.
|
||||
|
||||
Bug fixes:
|
||||
#332 #470 For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake)
|
||||
or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault
|
||||
for UTF-16 payloads containing CDATA sections.
|
||||
#485 #486 Autotools: Fix generated CMake files for non-64bit and
|
||||
non-Linux platforms (e.g. macOS and MinGW in particular)
|
||||
that were introduced with release 2.3.0
|
||||
|
||||
Other changes:
|
||||
#468 #469 xmlwf: Improve help output and the xmlwf man page
|
||||
#463 xmlwf: Improve maintainability through some refactoring
|
||||
#477 xmlwf: Fix man page DocBook validity
|
||||
#458 #459 CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR
|
||||
and CMAKE_INSTALL_INCLUDEDIR
|
||||
#471 #481 CMake: Add support for standard variable BUILD_SHARED_LIBS
|
||||
#457 Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters
|
||||
#467 Resolve macro HAVE_EXPAT_CONFIG_H
|
||||
#472 Delete unused legacy helper file "conftools/PrintPath"
|
||||
#473 #483 Improve attribution
|
||||
#464 #465 #477 doc/reference.html: Fix XHTML validity
|
||||
#475 #478 doc/reference.html: Replace the 90s look by OK.css
|
||||
#479 Version info bumped from 8:0:7 to 9:0:8
|
||||
due to addition of new symbols and error codes;
|
||||
see https://verbump.de/ for what these numbers do
|
||||
|
||||
Infrastructure:
|
||||
#456 CI: Enable periodic runs
|
||||
#457 CI: Start covering the list of exported symbols
|
||||
#474 CI: Isolate coverage task
|
||||
#476 #482 CI: Adapt to breaking changes in image "ubuntu-18.04"
|
||||
#477 CI: Cover well-formedness and DocBook/XHTML validity
|
||||
of doc/reference.html and doc/xmlwf.xml
|
||||
|
||||
Special thanks to:
|
||||
Dimitry Andric
|
||||
Felix Wilhelm
|
||||
Eero Helenius
|
||||
Rhodri James
|
||||
Nick Wellnhofer
|
||||
Rhodri James
|
||||
Tomas Korbar
|
||||
Yury Gribov
|
||||
Google Project Zero
|
||||
and
|
||||
Clang LeakSan
|
||||
JetBrains
|
||||
OSS-Fuzz
|
||||
|
||||
Release 2.3.0 Thu March 25 2021
|
||||
Bug fixes:
|
||||
#438 When calling XML_ParseBuffer without a prior successful call to
|
||||
XML_GetBuffer as a user, no longer trigger undefined behavior
|
||||
(by adding an integer to a NULL pointer) but rather return
|
||||
XML_STATUS_ERROR and set the error code to (new) code
|
||||
XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer)
|
||||
of Clang 11 (but not Clang 9).
|
||||
#444 xmlwf: Exit status 2 was used for both:
|
||||
- malformed input files (documented) and
|
||||
- invalid command-line arguments (undocumented).
|
||||
The case of invalid command-line arguments now
|
||||
has its own exit status 4, resolving the ambiguity.
|
||||
|
||||
Other changes:
|
||||
#439 xmlwf: Add argument -k to allow continuing after
|
||||
non-fatal errors
|
||||
#439 xmlwf: Add section about exit status to the -h help output
|
||||
#422 #426 #447 Windows: Drop support for Visual Studio <=14.0/2015
|
||||
#434 Windows: CMake: Detect unsupported Visual Studio at
|
||||
configure time (rather than at compile time)
|
||||
#382 #428 testrunner: Make verbose mode (argument "-v") report
|
||||
about passed tests, and make default mode report about
|
||||
failures, as well.
|
||||
#442 CMake: Call "enable_language(CXX)" prior to tinkering
|
||||
with CMAKE_CXX_* variables
|
||||
#448 Document use of libexpat from a CMake-based project
|
||||
#451 Autotools: Install CMake files as generated by CMake 3.19.6
|
||||
so that users with "find_package(expat [..] CONFIG [..])"
|
||||
are served on distributions that are *not* using the CMake
|
||||
build system inside for libexpat packaging
|
||||
#436 #437 Autotools: Drop obsolescent macro AC_HEADER_STDC
|
||||
#450 #452 Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER
|
||||
#441 Address compiler warnings
|
||||
#443 Version info bumped from 7:12:6 to 8:0:7
|
||||
due to addition of error code XML_ERROR_NO_BUFFER
|
||||
(see https://verbump.de/ for what these numbers do)
|
||||
|
||||
Infrastructure:
|
||||
#435 #446 Replace Travis CI by GitHub Actions
|
||||
|
||||
Special thanks to:
|
||||
Alexander Richardson
|
||||
Oleksandr Popovych
|
||||
Thomas Beutlich
|
||||
Tim Bray
|
||||
and
|
||||
Clang LeakSan, Clang 11 UBSan and the Clang team
|
||||
|
||||
Release 2.2.10 Sat October 3 2020
|
||||
Bug fixes:
|
||||
#390 #395 #398 Fix undefined behavior during parsing caused by
|
||||
pointer arithmetic with NULL pointers
|
||||
#404 #405 Fix reading uninitialized variable during parsing
|
||||
#406 xmlwf: Add missing check for malloc NULL return
|
||||
|
||||
Other changes:
|
||||
#396 Windows: Drop support for Visual Studio <=8.0/2005
|
||||
#409 Windows: Add missing file "Changes" to the installer
|
||||
to fix compilation with CMake from installed sources
|
||||
#403 xmlwf: Document exit codes in xmlwf manpage and
|
||||
exit with code 3 (rather than code 1) for output errors
|
||||
when used with "-d DIRECTORY"
|
||||
#356 #359 MinGW: Provide declaration of rand_s for mingwrt <5.3.0
|
||||
#383 #392 Autotools: Use -Werror while configure tests the compiler
|
||||
for supported compile flags to avoid false positives
|
||||
#383 #393 #394 Autotools: Improve handling of user (C|CPP|CXX|LD)FLAGS,
|
||||
e.g. ensure that they have the last word over flags added
|
||||
while running ./configure
|
||||
#360 CMake: Create libexpatw.{dll,so} and expatw.pc (with emphasis
|
||||
on suffix "w") with -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
|
||||
#360 CMake: Detect and deny unsupported build combinations
|
||||
involving -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
|
||||
#360 CMake: Install pre-compiled shipped xmlwf.1 manpage in case
|
||||
of -DEXPAT_BUILD_DOCS=OFF
|
||||
#375 #380 #419 CMake: Fix use of Expat by means of add_subdirectory
|
||||
#407 #408 CMake: Keep expat target name constant at "expat"
|
||||
(i.e. refrain from using the target name to control
|
||||
build artifact filenames)
|
||||
#385 CMake: Fix compilation with -DEXPAT_SHARED_LIBS=OFF for
|
||||
Windows
|
||||
CMake: Expose man page compilation as target "xmlwf-manpage"
|
||||
#413 #414 CMake: Introduce option EXPAT_BUILD_PKGCONFIG
|
||||
to control generation of pkg-config file "expat.pc"
|
||||
#424 CMake: Add minimalistic support for building binary packages
|
||||
with CMake target "package"; based on CPack
|
||||
#366 CMake: Add option -DEXPAT_OSSFUZZ_BUILD=(ON|OFF) with
|
||||
default OFF to build fuzzer code against OSS-Fuzz and
|
||||
related environment variable LIB_FUZZING_ENGINE
|
||||
#354 Fix testsuite for -DEXPAT_DTD=OFF and -DEXPAT_NS=OFF, each
|
||||
#354 #355 ..
|
||||
#356 #412 Address compiler warnings
|
||||
#368 #369 Address pngcheck warnings with doc/*.png images
|
||||
#425 Version info bumped from 7:11:6 to 7:12:6
|
||||
|
||||
Special thanks to:
|
||||
asavah
|
||||
Ben Wagner
|
||||
Bhargava Shastry
|
||||
Frank Landgraf
|
||||
Jeffrey Walton
|
||||
Joe Orton
|
||||
Kleber Tarcísio
|
||||
Ma Lin
|
||||
Maciej Sroczyński
|
||||
Mohammed Khajapasha
|
||||
Vadim Zeitlin
|
||||
and
|
||||
Cppcheck 2.0 and the Cppcheck team
|
||||
|
||||
Release 2.2.9 Wed September 25 2019
|
||||
Other changes:
|
||||
examples: Drop executable bits from elements.c
|
||||
#349 Windows: Change the name of the Windows DLLs from expat*.dll
|
||||
to libexpat*.dll once more (regression from 2.2.8, first
|
||||
fixed in 1.95.3, issue #61 on SourceForge today,
|
||||
was issue #432456 back then); needs a fix due
|
||||
case-insensitive file systems on Windows and the fact that
|
||||
Perl's XML::Parser::Expat compiles into Expat.dll.
|
||||
#347 Windows: Only define _CRT_RAND_S if not defined
|
||||
Version info bumped from 7:10:6 to 7:11:6
|
||||
|
||||
Special thanks to:
|
||||
Ben Wagner
|
||||
|
||||
Release 2.2.8 Fri September 13 2019
|
||||
Security fixes:
|
||||
#317 #318 CVE-2019-15903 -- Fix heap overflow triggered by
|
||||
XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber),
|
||||
and deny internal entities closing the doctype;
|
||||
fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43
|
||||
|
||||
Bug fixes:
|
||||
#240 Fix cases where XML_StopParser did not have any effect
|
||||
when called from inside of an end element handler
|
||||
#341 xmlwf: Fix exit code for operation without "-d DIRECTORY";
|
||||
previously, only "-d DIRECTORY" would give you a proper
|
||||
exit code:
|
||||
# xmlwf -d . <<<'<not well-formed>' 2>/dev/null ; echo $?
|
||||
2
|
||||
# xmlwf <<<'<not well-formed>' 2>/dev/null ; echo $?
|
||||
0
|
||||
Now both cases return exit code 2.
|
||||
|
||||
Other changes:
|
||||
#299 #302 Windows: Replace LoadLibrary hack to access
|
||||
unofficial API function SystemFunction036 (RtlGenRandom)
|
||||
by using official API function rand_s (needs WinXP+)
|
||||
#325 Windows: Drop support for Visual Studio <=7.1/2003
|
||||
and document supported compilers in README.md
|
||||
#286 Windows: Remove COM code from xmlwf; in case it turns
|
||||
out needed later, there will be a dedicated repository
|
||||
below https://github.com/libexpat/ for that code
|
||||
#322 Windows: Remove explicit MSVC solution and project files.
|
||||
You can generate Visual Studio solution files through
|
||||
CMake, e.g.: cmake -G"Visual Studio 15 2017" .
|
||||
#338 xmlwf: Make "xmlwf -h" help output more friendly
|
||||
#339 examples: Improve elements.c
|
||||
#244 #264 Autotools: Add argument --enable-xml-attr-info
|
||||
#239 #301 Autotools: Add arguments
|
||||
--with-getrandom
|
||||
--without-getrandom
|
||||
--with-sys-getrandom
|
||||
--without-sys-getrandom
|
||||
#312 #343 Autotools: Fix linking issues with "./configure LD=clang"
|
||||
Autotools: Fix "make run-xmltest" for out-of-source builds
|
||||
#329 #336 CMake: Pull all options from Expat <=2.2.7 into namespace
|
||||
prefix EXPAT_ with the exception of DOCBOOK_TO_MAN:
|
||||
- BUILD_doc -> EXPAT_BUILD_DOCS (plural)
|
||||
- BUILD_examples -> EXPAT_BUILD_EXAMPLES
|
||||
- BUILD_shared -> EXPAT_SHARED_LIBS
|
||||
- BUILD_tests -> EXPAT_BUILD_TESTS
|
||||
- BUILD_tools -> EXPAT_BUILD_TOOLS
|
||||
- DOCBOOK_TO_MAN -> DOCBOOK_TO_MAN (unchanged)
|
||||
- INSTALL -> EXPAT_ENABLE_INSTALL
|
||||
- MSVC_USE_STATIC_CRT -> EXPAT_MSVC_STATIC_CRT
|
||||
- USE_libbsd -> EXPAT_WITH_LIBBSD
|
||||
- WARNINGS_AS_ERRORS -> EXPAT_WARNINGS_AS_ERRORS
|
||||
- XML_CONTEXT_BYTES -> EXPAT_CONTEXT_BYTES
|
||||
- XML_DEV_URANDOM -> EXPAT_DEV_URANDOM
|
||||
- XML_DTD -> EXPAT_DTD
|
||||
- XML_NS -> EXPAT_NS
|
||||
- XML_UNICODE -> EXPAT_CHAR_TYPE=ushort (!)
|
||||
- XML_UNICODE_WCHAR_T -> EXPAT_CHAR_TYPE=wchar_t (!)
|
||||
#244 #264 CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF),
|
||||
default OFF
|
||||
#326 CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF),
|
||||
default OFF
|
||||
#328 CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF),
|
||||
default OFF
|
||||
#239 #277 CMake: Add arguments
|
||||
-DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO
|
||||
-DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO
|
||||
#326 CMake: Install expat_config.h to include directory
|
||||
#326 CMake: Generate and install configuration files for
|
||||
future find_package(expat [..] CONFIG [..])
|
||||
CMake: Now produces a summary of applied configuration
|
||||
CMake: Require C++ compiler only when tests are enabled
|
||||
#330 CMake: Fix compilation for 16bit character types,
|
||||
i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON)
|
||||
#265 CMake: Fix linking with MinGW
|
||||
#330 CMake: Add full support for MinGW; to enable, use
|
||||
-DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake
|
||||
#330 CMake: Port "make run-xmltest" from GNU Autotools to CMake
|
||||
#316 CMake: Windows: Make binary postfix match MSVC
|
||||
Old: expat[d].lib
|
||||
New: expat[w][d][MD|MT].lib
|
||||
CMake: Migrate files from Windows to Unix line endings
|
||||
#308 CMake: Integrate OSS-Fuzz fuzzers, option
|
||||
-DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF
|
||||
#14 Drop an OpenVMS support leftover
|
||||
#235 #268 ..
|
||||
#270 #310 ..
|
||||
#313 #331 #333 Address compiler warnings
|
||||
#282 #283 ..
|
||||
#284 #285 Address cppcheck warnings
|
||||
#294 #295 Address Clang Static Analyzer warnings
|
||||
#24 #293 Mass-apply clang-format 9 (and ensure conformance during CI)
|
||||
Version info bumped from 7:9:6 to 7:10:6
|
||||
|
||||
Special thanks to:
|
||||
David Loffredo
|
||||
Joonun Jang
|
||||
Kishore Kunche
|
||||
Marco Maggi
|
||||
Mitch Phillips
|
||||
Mohammed Khajapasha
|
||||
Rolf Ade
|
||||
xantares
|
||||
Zhongyuan Zhou
|
||||
|
||||
Release 2.2.7 Wed June 19 2019
|
||||
Security fixes:
|
||||
#186 #262 CVE-2018-20843 -- Fix extraction of namespace prefixes from
|
||||
XML names; XML names with multiple colons could end up in
|
||||
the wrong namespace, and take a high amount of RAM and CPU
|
||||
resources while processing, opening the door to
|
||||
use for denial-of-service attacks
|
||||
|
||||
Other changes:
|
||||
#195 #197 Autotools/CMake: Utilize -fvisibility=hidden to stop
|
||||
exporting non-API symbols
|
||||
#227 Autotools: Add --without-examples and --without-tests
|
||||
#228 Autotools: Modernize configure.ac
|
||||
#245 #246 Autotools: Fix check for -fvisibility=hidden for Clang
|
||||
#247 #248 Autotools: Fix compilation for lack of docbook2x-man
|
||||
#236 #258 Autotools: Produce .tar.{gz,lz,xz} release archives
|
||||
#212 CMake: Make libdir of pkgconfig expat.pc support multilib
|
||||
#158 #263 CMake: Build man page in PROJECT_BINARY_DIR not _SOURCE_DIR
|
||||
#219 Remove fallback to bcopy, assume that memmove(3) exists
|
||||
#257 Use portable "/usr/bin/env bash" shebang (e.g. for OpenBSD)
|
||||
#243 Windows: Fix syntax of .def module definition files
|
||||
Version info bumped from 7:8:6 to 7:9:6
|
||||
|
||||
Special thanks to:
|
||||
Benjamin Peterson
|
||||
Caolán McNamara
|
||||
Hanno Böck
|
||||
KangLin
|
||||
Kishore Kunche
|
||||
Marco Maggi
|
||||
Rhodri James
|
||||
Sebastian Dröge
|
||||
userwithuid
|
||||
Yury Gribov
|
||||
|
||||
Release 2.2.6 Sun August 12 2018
|
||||
Bug fixes:
|
||||
#170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer
|
||||
#204 #205 Fix 2.2.5 regression with suspend-resume while parsing
|
||||
a document like '<root/>'
|
||||
|
||||
Other changes:
|
||||
#165 #168 Autotools: Fix docbook-related configure syntax error
|
||||
#166 Autotools: Avoid grep option `-q` for Solaris
|
||||
#167 Autotools: Support
|
||||
./configure DOCBOOK_TO_MAN="xmlto man --skip-validation"
|
||||
#159 #167 Autotools: Support DOCBOOK_TO_MAN command which produces
|
||||
xmlwf.1 rather than XMLWF.1; also covers case insensitive
|
||||
file systems
|
||||
#181 Autotools: Drop -rpath option passed to libtool
|
||||
#188 Autotools: Detect and deny SGML docbook2man as ours is XML
|
||||
#188 Autotools/CMake: Support command db2x_docbook2man as well
|
||||
#174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF
|
||||
#184 #185 CMake: Introduce option MSVC_USE_STATIC_CRT, defaults to OFF
|
||||
#207 #208 CMake: Introduce option XML_UNICODE and XML_UNICODE_WCHAR_T,
|
||||
both defaulting to OFF
|
||||
#175 CMake: Prefer check_symbol_exists over check_function_exists
|
||||
#176 CMake: Create the same pkg-config file as with GNU Autotools
|
||||
#178 #179 CMake: Use GNUInstallDirs module to set proper defaults for
|
||||
install directories
|
||||
#208 CMake: Utilize expat_config.h.cmake for XML_DEV_URANDOM
|
||||
#180 Windows: Fix compilation of test suite for Visual Studio 2008
|
||||
#131 #173 #202 Address compiler warnings
|
||||
#187 #190 #200 Fix miscellaneous typos
|
||||
Version info bumped from 7:7:6 to 7:8:6
|
||||
|
||||
Special thanks to:
|
||||
Anton Maklakov
|
||||
Benjamin Peterson
|
||||
Brad King
|
||||
Franek Korta
|
||||
Frank Rast
|
||||
Joe Orton
|
||||
luzpaz
|
||||
Pedro Vicente
|
||||
Rainer Jung
|
||||
Rhodri James
|
||||
Rolf Ade
|
||||
Rolf Eike Beer
|
||||
Thomas Beutlich
|
||||
Tomasz Kłoczko
|
||||
|
||||
Release 2.2.5 Tue October 31 2017
|
||||
Bug fixes:
|
||||
#8 If the parser runs out of memory, make sure its internal
|
||||
state reflects the memory it actually has, not the memory
|
||||
it wanted to have.
|
||||
#11 The default handler wasn't being called when it should for
|
||||
a SYSTEM or PUBLIC doctype if an entity declaration handler
|
||||
was registered.
|
||||
#137 #138 Fix a case of mistakenly reported parsing success where
|
||||
XML_StopParser was called from an element handler
|
||||
#162 Function XML_ErrorString was returning NULL rather than
|
||||
a message for code XML_ERROR_INVALID_ARGUMENT
|
||||
introduced with release 2.2.1
|
||||
|
||||
Other changes:
|
||||
#106 xmlwf: Add argument -N adding notation declarations
|
||||
#75 #106 Test suite: Resolve expected failure cases where xmlwf
|
||||
output was incomplete
|
||||
#127 Windows: Fix test suite compilation
|
||||
#126 #127 Windows: Fix compilation for Visual Studio 2012
|
||||
Windows: Upgrade shipped project files to Visual Studio 2017
|
||||
#33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T
|
||||
#129 examples: Fix compilation for XML_UNICODE_WCHAR_T
|
||||
#130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T
|
||||
#144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs
|
||||
Windows or MinGW for 2-byte wchar_t
|
||||
#9 Address two Clang Static Analyzer false positives
|
||||
#59 Resolve troublesome macros hiding parser struct membership
|
||||
and dereferencing that pointer
|
||||
#6 Resolve superfluous internal malloc/realloc switch
|
||||
#153 #155 Improve docbook2x-man detection
|
||||
#160 Undefine NDEBUG in the test suite (rather than rejecting it)
|
||||
#161 Address compiler warnings
|
||||
Version info bumped from 7:6:6 to 7:7:6
|
||||
|
||||
Special thanks to:
|
||||
Benbuck Nason
|
||||
Hans Wennborg
|
||||
José Gutiérrez de la Concha
|
||||
Pedro Monreal Gonzalez
|
||||
Rhodri James
|
||||
Rolf Ade
|
||||
Stephen Groat
|
||||
and
|
||||
Core Infrastructure Initiative
|
||||
|
||||
Release 2.2.4 Sat August 19 2017
|
||||
Bug fixes:
|
||||
#115 Fix copying of partial characters for UTF-8 input
|
||||
|
||||
Other changes:
|
||||
#109 Fix "make check" for non-x86 architectures that default
|
||||
to unsigned type char (-128..127 rather than 0..255)
|
||||
#109 coverage.sh: Cover -funsigned-char
|
||||
Autotools: Introduce --without-xmlwf argument
|
||||
#65 Autotools: Replace handwritten Makefile with GNU Automake
|
||||
#43 CMake: Auto-detect high quality entropy extractors, add new
|
||||
option USE_libbsd=ON to use arc4random_buf of libbsd
|
||||
#74 CMake: Add -fno-strict-aliasing only where supported
|
||||
#114 CMake: Always honor manually set BUILD_* options
|
||||
#114 CMake: Compile man page if docbook2x-man is available, only
|
||||
#117 Include file tests/xmltest.log.expected in source tarball
|
||||
(required for "make run-xmltest")
|
||||
#117 Include (existing) Visual Studio 2013 files in source tarball
|
||||
Improve test suite error output
|
||||
#111 Fix some typos in documentation
|
||||
Version info bumped from 7:5:6 to 7:6:6
|
||||
|
||||
Special thanks to:
|
||||
Jakub Wilk
|
||||
Joe Orton
|
||||
Lin Tian
|
||||
Rolf Eike Beer
|
||||
|
||||
Release 2.2.3 Wed August 2 2017
|
||||
Security fixes:
|
||||
#82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability
|
||||
using Steve Holme's LoadLibrary wrapper for/of cURL
|
||||
|
||||
Bug fixes:
|
||||
#85 Fix a dangling pointer issue related to realloc
|
||||
|
||||
Other changes:
|
||||
Increase code coverage
|
||||
#91 Linux: Allow getrandom to fail if nonblocking pool has not
|
||||
yet been initialized and read /dev/urandom then, instead.
|
||||
This is in line with what recent Python does.
|
||||
#81 Pre-10.7/Lion macOS: Support entropy from arc4random
|
||||
#86 Check that a UTF-16 encoding in an XML declaration has the
|
||||
right endianness
|
||||
#4 #5 #7 Recover correctly when some reallocations fail
|
||||
Repair "./configure && make" for systems without any
|
||||
provider of high quality entropy
|
||||
and try reading /dev/urandom on those
|
||||
Ensure that user-defined character encodings have converter
|
||||
functions when they are needed
|
||||
Fix mis-leading description of argument -c in xmlwf.1
|
||||
Rely on macro HAVE_ARC4RANDOM_BUF (rather than __CloudABI__)
|
||||
for CloudABI
|
||||
#100 Fix use of SIPHASH_MAIN in siphash.h
|
||||
#23 Test suite: Fix memory leaks
|
||||
Version info bumped from 7:4:6 to 7:5:6
|
||||
|
||||
Special thanks to:
|
||||
Chanho Park
|
||||
Joe Orton
|
||||
Pascal Cuoq
|
||||
Rhodri James
|
||||
Simon McVittie
|
||||
Vadim Zeitlin
|
||||
Viktor Szakats
|
||||
and
|
||||
Core Infrastructure Initiative
|
||||
|
||||
Release 2.2.2 Wed July 12 2017
|
||||
Security fixes:
|
||||
#43 Protect against compilation without any source of high
|
||||
quality entropy enabled, e.g. with CMake build system;
|
||||
commit ff0207e6076e9828e536b8d9cd45c9c92069b895
|
||||
#60 Windows with _UNICODE:
|
||||
Unintended use of LoadLibraryW with a non-wide string
|
||||
resulted in failure to load advapi32.dll and degradation
|
||||
in quality of used entropy when compiled with _UNICODE for
|
||||
Windows; you can launch existing binaries with
|
||||
EXPAT_ENTROPY_DEBUG=1 in the environment to inspect the
|
||||
quality of entropy used during runtime; commits
|
||||
* 95b95032f907ef1cd17ee7a9a1768010a825d61d
|
||||
* 73a5a2e9c081f49f2d775cf7ced864158b68dc80
|
||||
[MOX-006] Fix non-NULL parser parameter validation in XML_Parse;
|
||||
resulted in NULL dereference, previously;
|
||||
commit ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe
|
||||
|
||||
Bug fixes:
|
||||
#69 Fix improper use of unsigned long long integer literals
|
||||
|
||||
Other changes:
|
||||
#73 Start requiring a C99 compiler
|
||||
#49 Fix "==" Bashism in configure script
|
||||
#50 Fix too eager getrandom detection for Debian GNU/kFreeBSD
|
||||
#52 and macOS
|
||||
#51 Address lack of stdint.h in Visual Studio 2003 to 2008
|
||||
#58 Address compile warnings
|
||||
#68 Fix "./buildconf.sh && ./configure" for some versions
|
||||
of Dash for /bin/sh
|
||||
#72 CMake: Ease use of Expat in context of a parent project
|
||||
with multiple CMakeLists.txt files
|
||||
#72 CMake: Resolve mistaken executable permissions
|
||||
#76 Address compile warning with -DNDEBUG (not recommended!)
|
||||
#77 Address compile warning about macro redefinition
|
||||
|
||||
Special thanks to:
|
||||
Alexander Bluhm
|
||||
Ben Boeckel
|
||||
Cătălin Răceanu
|
||||
Kerin Millar
|
||||
László Böszörményi
|
||||
S. P. Zeidler
|
||||
Segev Finer
|
||||
Václav Slavík
|
||||
Victor Stinner
|
||||
Viktor Szakats
|
||||
and
|
||||
Radically Open Security
|
||||
|
||||
Release 2.2.1 Sat June 17 2017
|
||||
Security fixes:
|
||||
CVE-2017-9233 -- External entity infinite loop DoS
|
||||
Details: https://libexpat.github.io/doc/cve-2017-9233/
|
||||
Commit c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f
|
||||
[MOX-002] CVE-2016-9063 -- Detect integer overflow; commit
|
||||
d4f735b88d9932bd5039df2335eefdd0723dbe20
|
||||
(Fixed version of existing downstream patches!)
|
||||
(SF.net) #539 Fix regression from fix to CVE-2016-0718 cutting off
|
||||
longer tag names; commits
|
||||
* 896b6c1fd3b842f377d1b62135dccf0a579cf65d
|
||||
* af507cef2c93cb8d40062a0abe43a4f4e9158fb2
|
||||
#16 * 0dbbf43fdb20f593ddf4fa1ff67288000dd4a7fd
|
||||
#25 More integer overflow detection (function poolGrow); commits
|
||||
* 810b74e4703dcfdd8f404e3cb177d44684775143
|
||||
* 44178553f3539ce69d34abee77a05e879a7982ac
|
||||
[MOX-002] Detect overflow from len=INT_MAX call to XML_Parse; commits
|
||||
* 4be2cb5afcc018d996f34bbbce6374b7befad47f
|
||||
* 7e5b71b748491b6e459e5c9a1d090820f94544d8
|
||||
[MOX-005] #30 Use high quality entropy for hash initialization:
|
||||
* arc4random_buf on BSD, systems with libbsd
|
||||
(when configured with --with-libbsd), CloudABI
|
||||
* RtlGenRandom on Windows XP / Server 2003 and later
|
||||
* getrandom on Linux 3.17+
|
||||
In a way, that's still part of CVE-2016-5300.
|
||||
https://github.com/libexpat/libexpat/pull/30/commits
|
||||
[MOX-005] For the low quality entropy extraction fallback code,
|
||||
the parser instance address can no longer leak, commit
|
||||
04ad658bd3079dd15cb60fc67087900f0ff4b083
|
||||
[MOX-003] Prevent use of uninitialised variable; commit
|
||||
[MOX-004] a4dc944f37b664a3ca7199c624a98ee37babdb4b
|
||||
Add missing parameter validation to public API functions
|
||||
and dedicated error code XML_ERROR_INVALID_ARGUMENT:
|
||||
[MOX-006] * NULL checks; commits
|
||||
* d37f74b2b7149a3a95a680c4c4cd2a451a51d60a (merge/many)
|
||||
* 9ed727064b675b7180c98cb3d4f75efba6966681
|
||||
* 6a747c837c50114dfa413994e07c0ba477be4534
|
||||
* Negative length (XML_Parse); commit
|
||||
[MOX-002] 70db8d2538a10f4c022655d6895e4c3e78692e7f
|
||||
[MOX-001] #35 Change hash algorithm to William Ahern's version of SipHash
|
||||
to go further with fixing CVE-2012-0876.
|
||||
https://github.com/libexpat/libexpat/pull/39/commits
|
||||
|
||||
Bug fixes:
|
||||
#32 Fix sharing of hash salt across parsers;
|
||||
relevant where XML_ExternalEntityParserCreate is called
|
||||
prior to XML_Parse, in particular (e.g. FBReader)
|
||||
#28 xmlwf: Auto-disable use of memory-mapping (and parsing
|
||||
as a single chunk) for files larger than ~1 GB (2^30 bytes)
|
||||
rather than failing with error "out of memory"
|
||||
#3 Fix double free after malloc failure in DTD code; commit
|
||||
7ae9c3d3af433cd4defe95234eae7dc8ed15637f
|
||||
#17 Fix memory leak on parser error for unbound XML attribute
|
||||
prefix with new namespaces defined in the same tag;
|
||||
found by Google's OSS-Fuzz; commits
|
||||
* 16f87daae5a16132e479e4f71862128c7a915c73
|
||||
* b47dbc9745932c160893d433220e462bd605f8cd
|
||||
xmlwf on Windows: Add missing calls to CloseHandle
|
||||
|
||||
New features:
|
||||
#30 Introduced environment switch EXPAT_ENTROPY_DEBUG=1
|
||||
for runtime debugging of entropy extraction
|
||||
|
||||
Other changes:
|
||||
Increase code coverage
|
||||
#33 Reject use of XML_UNICODE_WCHAR_T with sizeof(wchar_t) != 2;
|
||||
XML_UNICODE_WCHAR_T was never meant to be used outside
|
||||
of Windows; 4-byte wchar_t is common on Linux
|
||||
(SF.net) #538 Start using -fno-strict-aliasing
|
||||
(SF.net) #540 Support compilation against cloudlibc of CloudABI
|
||||
Allow MinGW cross-compilation
|
||||
(SF.net) #534 CMake: Introduce option "BUILD_doc" (enabled by default)
|
||||
to bypass compilation of the xmlwf.1 man page
|
||||
(SF.net) pr2 CMake: Introduce option "INSTALL" (enabled by default)
|
||||
to bypass installation of expat files
|
||||
CMake: Fix ninja support
|
||||
Autotools: Add parameters --enable-xml-context [COUNT]
|
||||
and --disable-xml-context; default of context of 1024
|
||||
bytes enabled unchanged
|
||||
#14 Drop AmigaOS 4.x code and includes
|
||||
#14 Drop ancient build systems:
|
||||
* Borland C++ Builder
|
||||
* OpenVMS
|
||||
* Open Watcom
|
||||
* Visual Studio 6.0
|
||||
* Pre-X Mac OS (MPW Makefile)
|
||||
If you happen to rely on some of these, please get in
|
||||
touch for joining with maintenance.
|
||||
#10 Move from WIN32 to _WIN32
|
||||
#13 Fix "make run-xmltest" order instability
|
||||
Address compile warnings
|
||||
Bump version info from 7:2:6 to 7:3:6
|
||||
Add AUTHORS file
|
||||
|
||||
Infrastructure:
|
||||
#1 Migrate from SourceForge to GitHub (except downloads):
|
||||
https://github.com/libexpat/
|
||||
#1 Re-create http://libexpat.org/ project website
|
||||
Start utilizing Travis CI
|
||||
|
||||
Special thanks to:
|
||||
Andy Wang
|
||||
Don Lewis
|
||||
Ed Schouten
|
||||
Karl Waclawek
|
||||
Pascal Cuoq
|
||||
Rhodri James
|
||||
Sergei Nikulov
|
||||
Tobias Taschner
|
||||
Viktor Szakats
|
||||
and
|
||||
Core Infrastructure Initiative
|
||||
Mozilla Foundation (MOSS Track 3: Secure Open Source)
|
||||
Radically Open Security
|
||||
|
||||
Release 2.2.0 Tue June 21 2016
|
||||
Security fixes:
|
||||
#537 CVE-2016-0718 -- Fix crash on malformed input
|
||||
CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
|
||||
CVE-2015-2716 introduced with Expat 2.1.1
|
||||
#499 CVE-2016-5300 -- Use more entropy for hash initialization
|
||||
than the original fix to CVE-2012-0876
|
||||
#519 CVE-2012-6702 -- Resolve troublesome internal call to srand
|
||||
that was introduced with Expat 2.1.0
|
||||
when addressing CVE-2012-0876 (issue #496)
|
||||
|
||||
Bug fixes:
|
||||
Fix uninitialized reads of size 1
|
||||
(e.g. in little2_updatePosition)
|
||||
Fix detection of UTF-8 character boundaries
|
||||
|
||||
Other changes:
|
||||
#532 Fix compilation for Visual Studio 2010 (keyword "C99")
|
||||
Autotools: Resolve use of "$<" to better support bmake
|
||||
Autotools: Add QA script "qa.sh" (and make target "qa")
|
||||
Autotools: Respect CXXFLAGS if given
|
||||
Autotools: Fix "make run-xmltest"
|
||||
Autotools: Have "make run-xmltest" check for expected output
|
||||
p90 CMake: Fix static build (BUILD_shared=OFF) on Windows
|
||||
#536 CMake: Add soversion, support -DNO_SONAME=yes to bypass
|
||||
#323 CMake: Add suffix "d" to differentiate debug from release
|
||||
CMake: Define WIN32 with CMake on Windows
|
||||
Annotate memory allocators for GCC
|
||||
Address all currently known compile warnings
|
||||
Make sure that API symbols remain visible despite
|
||||
-fvisibility=hidden
|
||||
Remove executable flag from source files
|
||||
Resolve COMPILED_FROM_DSP in favor of WIN32
|
||||
|
||||
Special thanks to:
|
||||
Björn Lindahl
|
||||
Christian Heimes
|
||||
Cristian Rodríguez
|
||||
Daniel Krügler
|
||||
Gustavo Grieco
|
||||
Karl Waclawek
|
||||
László Böszörményi
|
||||
Marco Grassi
|
||||
Pascal Cuoq
|
||||
Sergei Nikulov
|
||||
Thomas Beutlich
|
||||
Warren Young
|
||||
Yann Droneaud
|
||||
|
||||
Release 2.1.1 Sat March 12 2016
|
||||
Security fixes:
|
||||
#582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer
|
||||
|
||||
Bug fixes:
|
||||
#502: Fix potential null pointer dereference
|
||||
#520: Symbol XML_SetHashSalt was not exported
|
||||
Output of "xmlwf -h" was incomplete
|
||||
|
||||
Other changes:
|
||||
#503: Document behavior of calling XML_SetHashSalt with salt 0
|
||||
Minor improvements to man page xmlwf(1)
|
||||
Improvements to the experimental CMake build system
|
||||
libtool now invoked with --verbose
|
||||
|
||||
Release 2.1.0 Sat March 24 2012
|
||||
- Security fixes:
|
||||
#2958794: CVE-2012-1148 - Memory leak in poolGrow.
|
||||
#2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
|
||||
#3496608: CVE-2012-0876 - Hash DOS attack.
|
||||
#2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
|
||||
#1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
|
||||
- Bug Fixes:
|
||||
#1742315: Harmful XML_ParserCreateNS suggestion.
|
||||
#1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
|
||||
#1983953, 2517952, 2517962, 2649838:
|
||||
Build modifications using autoreconf instead of buildconf.sh.
|
||||
#2815947, #2884086: OBJEXT and EXEEXT support while building.
|
||||
#2517938: xmlwf should return non-zero exit status if not well-formed.
|
||||
#2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
|
||||
#2855609: Dangling positionPtr after error.
|
||||
#2990652: CMake support.
|
||||
#3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
|
||||
#3206497: Uninitialized memory returned from XML_Parse.
|
||||
#3287849: make check fails on mingw-w64.
|
||||
- Patches:
|
||||
#1749198: pkg-config support.
|
||||
#3010222: Fix for bug #3010819.
|
||||
#3312568: CMake support.
|
||||
#3446384: Report byte offsets for attr names and values.
|
||||
- New Features / API changes:
|
||||
Added new API member XML_SetHashSalt() that allows setting an initial
|
||||
value (salt) for hash calculations. This is part of the fix for
|
||||
bug #3496608 to randomize hash parameters.
|
||||
When compiled with XML_ATTR_INFO defined, adds new API member
|
||||
XML_GetAttributeInfo() that allows retrieving the byte
|
||||
offsets for attribute names and values (patch #3446384).
|
||||
Added CMake build system.
|
||||
See bug #2990652 and patch #3312568.
|
||||
Added run-benchmark target to Makefile.in - relies on testdata module
|
||||
present in the same relative location as in the repository.
|
||||
|
||||
Release 2.0.1 Tue June 5 2007
|
||||
- Fixed bugs #1515266, #1515600: The character data handler's calling
|
||||
of XML_StopParser() was not handled properly; if the parser was
|
||||
stopped and the handler set to NULL, the parser would segfault.
|
||||
- Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed
|
||||
some character constants to be ASCII encoded.
|
||||
- Minor cleanups of the test harness.
|
||||
- Fixed xmlwf bug #1513566: "out of memory" error on file size zero.
|
||||
- Fixed outline.c bug #1543233: missing a final XML_ParserFree() call.
|
||||
- Fixes and improvements for Windows platform:
|
||||
bugs #1409451, #1476160, #1548182, #1602769, #1717322.
|
||||
- Build fixes for various platforms:
|
||||
HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180.
|
||||
All Unix: #1554618 (refreshed config.sub/config.guess).
|
||||
#1490371, #1613457: support both, DESTDIR and INSTALL_ROOT,
|
||||
without relying on GNU-Make specific features.
|
||||
#1647805: Patched configure.in to work better with Intel compiler.
|
||||
- Fixes to Makefile.in to have make check work correctly:
|
||||
bugs #1408143, #1535603, #1536684.
|
||||
- Added Open Watcom support: patch #1523242.
|
||||
|
||||
Release 2.0.0 Wed Jan 11 2006
|
||||
- We no longer use the "check" library for C unit testing; we
|
||||
always use the (partial) internal implementation of the API.
|
||||
- Report XML_NS setting via XML_GetFeatureList().
|
||||
- Fixed headers for use from C++.
|
||||
- XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber()
|
||||
now return unsigned integers.
|
||||
- Added XML_LARGE_SIZE switch to enable 64-bit integers for
|
||||
byte indexes and line/column numbers.
|
||||
- Updated to use libtool 1.5.22 (the most recent).
|
||||
- Added support for AmigaOS.
|
||||
- Some mostly minor bug fixes. SF issues include: #1006708,
|
||||
#1021776, #1023646, #1114960, #1156398, #1221160, #1271642.
|
||||
|
||||
Release 1.95.8 Fri Jul 23 2004
|
||||
- Major new feature: suspend/resume. Handlers can now request
|
||||
that a parse be suspended for later resumption or aborted
|
||||
altogether. See "Temporarily Stopping Parsing" in the
|
||||
documentation for more details.
|
||||
- Some mostly minor bug fixes, but compilation should no
|
||||
longer generate warnings on most platforms. SF issues
|
||||
include: #827319, #840173, #846309, #888329, #896188, #923913,
|
||||
#928113, #961698, #985192.
|
||||
|
||||
Release 1.95.7 Mon Oct 20 2003
|
||||
- Fixed enum XML_Status issue (reported on SourceForge many
|
||||
times), so compilers that are properly picky will be happy.
|
||||
- Introduced an XMLCALL macro to control the calling
|
||||
convention used by the Expat API; this macro should be used
|
||||
to annotate prototypes and definitions of callback
|
||||
implementations in code compiled with a calling convention
|
||||
other than the default convention for the host platform.
|
||||
- Improved ability to build without the configure-generated
|
||||
expat_config.h header. This is useful for applications
|
||||
which embed Expat rather than linking in the library.
|
||||
- Fixed a variety of bugs: see SF issues #458907, #609603,
|
||||
#676844, #679754, #692878, #692964, #695401, #699323, #699487,
|
||||
#820946.
|
||||
- Improved hash table lookups.
|
||||
- Added more regression tests and improved documentation.
|
||||
|
||||
Release 1.95.6 Tue Jan 28 2003
|
||||
- Added XML_FreeContentModel().
|
||||
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
|
||||
- Fixed a variety of bugs: see SF issues #615606, #616863,
|
||||
#618199, #653180, #673791.
|
||||
- Enhanced the regression test suite.
|
||||
- Man page improvements: includes SF issue #632146.
|
||||
|
||||
Release 1.95.5 Fri Sep 6 2002
|
||||
- Added XML_UseForeignDTD() for improved SAX2 support.
|
||||
- Added XML_GetFeatureList().
|
||||
- Defined XML_Bool type and the values XML_TRUE and XML_FALSE.
|
||||
- Use an incomplete struct instead of a void* for the parser
|
||||
(may not retain).
|
||||
- Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected.
|
||||
- Finally fixed bug where default handler would report DTD
|
||||
events that were already handled by another handler.
|
||||
Initial patch contributed by Darryl Miles.
|
||||
- Removed unnecessary DllMain() function that caused static
|
||||
linking into a DLL to be difficult.
|
||||
- Added VC++ projects for building static libraries.
|
||||
- Reduced line-length for all source code and headers to be
|
||||
no longer than 80 characters, to help with AS/400 support.
|
||||
- Reduced memory copying during parsing (SF patch #600964).
|
||||
- Fixed a variety of bugs: see SF issues #580793, #434664,
|
||||
#483514, #580503, #581069, #584041, #584183, #584832, #585537,
|
||||
#596555, #596678, #598352, #598944, #599715, #600479, #600971.
|
||||
|
||||
Release 1.95.4 Fri Jul 12 2002
|
||||
- Added support for VMS, contributed by Craig Berry. See
|
||||
vms/README.vms for more information.
|
||||
- Added Mac OS (classic) support, with a makefile for MPW,
|
||||
contributed by Thomas Wegner and Daryle Walker.
|
||||
- Added Borland C++ Builder 5 / BCC 5.5 support, contributed
|
||||
by Patrick McConnell (SF patch #538032).
|
||||
- Fixed a variety of bugs: see SF issues #441449, #563184,
|
||||
#564342, #566334, #566901, #569461, #570263, #575168, #579196.
|
||||
- Made skippedEntityHandler conform to SAX2 (see source comment)
|
||||
- Re-implemented WFC: Entity Declared from XML 1.0 spec and
|
||||
added a new error "entity declared in parameter entity":
|
||||
see SF bug report #569461 and SF patch #578161
|
||||
- Re-implemented section 5.1 from XML 1.0 spec:
|
||||
see SF bug report #570263 and SF patch #578161
|
||||
|
||||
Release 1.95.3 Mon Jun 3 2002
|
||||
- Added a project to the MSVC workspace to create a wchar_t
|
||||
version of the library; the DLLs are named libexpatw.dll.
|
||||
- Changed the name of the Windows DLLs from expat.dll to
|
||||
libexpat.dll; this fixes SF bug #432456.
|
||||
- Added the XML_ParserReset() API function.
|
||||
- Fixed XML_SetReturnNSTriplet() to work for element names.
|
||||
- Made the XML_UNICODE builds usable (thanks, Karl!).
|
||||
- Allow xmlwf to read from standard input.
|
||||
- Install a man page for xmlwf on Unix systems.
|
||||
- Fixed many bugs; see SF bug reports #231864, #461380, #464837,
|
||||
#466885, #469226, #477667, #484419, #487840, #494749, #496505,
|
||||
#547350. Other bugs which we can't test as easily may also
|
||||
have been fixed, especially in the area of build support.
|
||||
|
||||
Release 1.95.2 Fri Jul 27 2001
|
||||
- More changes to make MSVC happy with the build; add a single
|
||||
workspace to support both the library and xmlwf application.
|
||||
- Added a Windows installer for Windows users; includes
|
||||
xmlwf.exe.
|
||||
- Added compile-time constants that can be used to determine the
|
||||
Expat version
|
||||
- Removed a lot of GNU-specific dependencies to aide portability
|
||||
among the various Unix flavors.
|
||||
- Fix the UTF-8 BOM bug.
|
||||
- Cleaned up warning messages for several compilers.
|
||||
- Added the -Wall, -Wstrict-prototypes options for GCC.
|
||||
|
||||
Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000
|
||||
- Changes to get expat to build under Microsoft compiler
|
||||
- Removed all aborts and instead return an UNEXPECTED_STATE error.
|
||||
- Fixed a bug where a stray '%' in an entity value would cause an
|
||||
abort.
|
||||
- Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for
|
||||
finding this oversight.
|
||||
- Changed default patterns in lib/Makefile.in to fit non-GNU makes
|
||||
Thanks to robin@unrated.net for reporting and providing an
|
||||
account to test on.
|
||||
- The reference had the wrong label for XML_SetStartNamespaceDecl.
|
||||
Reported by an anonymous user.
|
||||
|
||||
Release 1.95.0 Fri Sep 29 2000
|
||||
- XML_ParserCreate_MM
|
||||
Allows you to set a memory management suite to replace the
|
||||
standard malloc,realloc, and free.
|
||||
- XML_SetReturnNSTriplet
|
||||
If you turn this feature on when namespace processing is in
|
||||
effect, then qualified, prefixed element and attribute names
|
||||
are returned as "uri|name|prefix" where '|' is whatever
|
||||
separator character is used in namespace processing.
|
||||
- Merged in features from perl-expat
|
||||
o XML_SetElementDeclHandler
|
||||
o XML_SetAttlistDeclHandler
|
||||
o XML_SetXmlDeclHandler
|
||||
o XML_SetEntityDeclHandler
|
||||
o StartDoctypeDeclHandler takes 3 additional parameters:
|
||||
sysid, pubid, has_internal_subset
|
||||
o Many paired handler setters (like XML_SetElementHandler)
|
||||
now have corresponding individual handler setters
|
||||
o XML_GetInputContext for getting the input context of
|
||||
the current parse position.
|
||||
- Added reference material
|
||||
- Packaged into a distribution that builds a sharable library
|
||||
@@ -1,66 +0,0 @@
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckSymbolExists)
|
||||
include(TestBigEndian)
|
||||
|
||||
check_include_file("dlfcn.h" HAVE_DLFCN_H)
|
||||
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
||||
check_include_file("inttypes.h" HAVE_INTTYPES_H)
|
||||
check_include_file("memory.h" HAVE_MEMORY_H)
|
||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
||||
check_include_file("stdlib.h" HAVE_STDLIB_H)
|
||||
check_include_file("strings.h" HAVE_STRINGS_H)
|
||||
check_include_file("string.h" HAVE_STRING_H)
|
||||
check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||
|
||||
check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE)
|
||||
check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP)
|
||||
check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM)
|
||||
|
||||
if(EXPAT_WITH_LIBBSD)
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}")
|
||||
set(_bsd "bsd/")
|
||||
else()
|
||||
set(_bsd "")
|
||||
endif()
|
||||
check_symbol_exists("arc4random_buf" "${_bsd}stdlib.h" HAVE_ARC4RANDOM_BUF)
|
||||
if(NOT HAVE_ARC4RANDOM_BUF)
|
||||
check_symbol_exists("arc4random" "${_bsd}stdlib.h" HAVE_ARC4RANDOM)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
#/* Define to 1 if you have the ANSI C header files. */
|
||||
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
|
||||
|
||||
test_big_endian(WORDS_BIGENDIAN)
|
||||
#/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
|
||||
if(WORDS_BIGENDIAN)
|
||||
set(BYTEORDER 4321)
|
||||
else(WORDS_BIGENDIAN)
|
||||
set(BYTEORDER 1234)
|
||||
endif(WORDS_BIGENDIAN)
|
||||
|
||||
if(HAVE_SYS_TYPES_H)
|
||||
check_symbol_exists("off_t" "sys/types.h" OFF_T)
|
||||
check_symbol_exists("size_t" "sys/types.h" SIZE_T)
|
||||
else(HAVE_SYS_TYPES_H)
|
||||
set(OFF_T "long")
|
||||
set(SIZE_T "unsigned")
|
||||
endif(HAVE_SYS_TYPES_H)
|
||||
|
||||
check_c_source_compiles("
|
||||
#include <stdlib.h> /* for NULL */
|
||||
#include <unistd.h> /* for syscall */
|
||||
#include <sys/syscall.h> /* for SYS_getrandom */
|
||||
int main() {
|
||||
syscall(SYS_getrandom, NULL, 0, 0);
|
||||
return 0;
|
||||
}"
|
||||
HAVE_SYSCALL_GETRANDOM)
|
||||
|
||||
check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
|
||||
check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
|
||||
-168
@@ -1,168 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2018 KangLin <kl222@126.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
AUTOMAKE_OPTIONS = \
|
||||
dist-bzip2 \
|
||||
dist-lzip \
|
||||
dist-xz \
|
||||
foreign \
|
||||
subdir-objects
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
LIBTOOLFLAGS = --verbose
|
||||
|
||||
SUBDIRS = lib # lib goes first to build first
|
||||
if WITH_EXAMPLES
|
||||
SUBDIRS += examples
|
||||
endif
|
||||
if WITH_TESTS
|
||||
SUBDIRS += tests
|
||||
endif
|
||||
if WITH_XMLWF
|
||||
SUBDIRS += xmlwf doc
|
||||
endif
|
||||
|
||||
pkgconfig_DATA = expat.pc
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
|
||||
dist_cmake_DATA = \
|
||||
cmake/autotools/expat.cmake
|
||||
|
||||
nodist_cmake_DATA = \
|
||||
cmake/autotools/expat-config-version.cmake \
|
||||
cmake/autotools/expat-noconfig.cmake \
|
||||
cmake/expat-config.cmake
|
||||
|
||||
cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
|
||||
|
||||
|
||||
_EXTRA_DIST_CMAKE = \
|
||||
cmake/autotools/expat-noconfig__linux.cmake.in \
|
||||
cmake/autotools/expat-noconfig__macos.cmake.in \
|
||||
cmake/autotools/expat-noconfig__windows.cmake.in \
|
||||
cmake/autotools/expat-package-init.cmake \
|
||||
cmake/mingw-toolchain.cmake \
|
||||
\
|
||||
CMakeLists.txt \
|
||||
CMake.README \
|
||||
ConfigureChecks.cmake \
|
||||
expat_config.h.cmake
|
||||
|
||||
_EXTRA_DIST_WINDOWS = \
|
||||
win32/build_expat_iss.bat \
|
||||
win32/expat.iss \
|
||||
win32/MANIFEST.txt \
|
||||
win32/README.txt
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(_EXTRA_DIST_CMAKE) \
|
||||
$(_EXTRA_DIST_WINDOWS) \
|
||||
\
|
||||
conftools/expat.m4 \
|
||||
conftools/get-version.sh \
|
||||
\
|
||||
xmlwf/xmlwf_helpgen.py \
|
||||
xmlwf/xmlwf_helpgen.sh \
|
||||
\
|
||||
Changes \
|
||||
README.md \
|
||||
\
|
||||
fix-xmltest-log.sh \
|
||||
test-driver-wrapper.sh
|
||||
|
||||
|
||||
.PHONY: buildlib
|
||||
buildlib:
|
||||
@echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2
|
||||
@echo 'ERROR: is no longer supported. INSTEAD please:' >&2
|
||||
@echo 'ERROR:' >&2
|
||||
@echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
|
||||
@echo 'ERROR: # find -name Makefile.am -exec sed \' >&2
|
||||
@echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
|
||||
@echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
|
||||
@echo 'ERROR: -i {} +' >&2
|
||||
@echo 'ERROR:' >&2
|
||||
@echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
|
||||
@echo 'ERROR:' >&2
|
||||
@echo 'ERROR: * Use "./configure --without-xmlwf" and/or' >&2
|
||||
@echo 'ERROR: "make -C lib all install" to bypass compilation' >&2
|
||||
@echo 'ERROR: of xmlwf (e.g. with -DXML_UNICODE)' >&2
|
||||
@echo 'ERROR:' >&2
|
||||
@false
|
||||
|
||||
|
||||
.PHONY: run-benchmark
|
||||
run-benchmark:
|
||||
$(MAKE) -C tests/benchmark
|
||||
./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
|
||||
|
||||
.PHONY: download-xmlts-zip
|
||||
download-xmlts-zip:
|
||||
if test "$(XMLTS_ZIP)" = ""; then \
|
||||
wget --output-document=tests/xmlts.zip \
|
||||
https://www.w3.org/XML/Test/xmlts20080827.zip; \
|
||||
else \
|
||||
cp $(XMLTS_ZIP) tests/xmlts.zip; \
|
||||
fi
|
||||
|
||||
tests/xmlts.zip:
|
||||
$(MAKE) download-xmlts-zip
|
||||
|
||||
.PHONY: extract-xmlts-zip
|
||||
extract-xmlts-zip: tests/xmlts.zip
|
||||
[ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround
|
||||
cd tests && unzip -q xmlts.zip
|
||||
|
||||
tests/xmlconf: tests/xmlts.zip
|
||||
$(MAKE) extract-xmlts-zip
|
||||
|
||||
.PHONY: run-xmltest
|
||||
run-xmltest: tests/xmlconf
|
||||
if WITH_XMLWF
|
||||
[ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround
|
||||
$(MAKE) -C lib
|
||||
$(MAKE) -C xmlwf
|
||||
$(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
|
||||
$(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
|
||||
diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
|
||||
else
|
||||
@echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
|
||||
@echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
|
||||
@false
|
||||
endif
|
||||
|
||||
.PHONY: qa
|
||||
qa:
|
||||
QA_COMPILER=clang QA_SANITIZER=address ./qa.sh
|
||||
QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh
|
||||
QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
|
||||
QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh
|
||||
-1130
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,9 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<licensefile>COPYING</licensefile>
|
||||
<policylist>
|
||||
<policy name="projectPolicy" desc="">
|
||||
<policyitem type="compatibility" name="LGPL" path="BUILD.gn" desc="They are used in dynamic link mode."/>
|
||||
<policyitem type="compatibility" name="LGPL" path="install.sh" desc="They are used in dynamic link mode."/>
|
||||
<policyitem type="compatibility" name="LGPL" path="libnl3.spec" desc="They are used in dynamic link mode."/>
|
||||
</policy>
|
||||
</policylist>
|
||||
<filefilterlist>
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
[
|
||||
{
|
||||
"Name": "Expat",
|
||||
"Name": "openEuler:expat",
|
||||
"License": "MIT License",
|
||||
"License File": "COPYING",
|
||||
"Version Number": "2.4.1",
|
||||
"Version Number": "2.4.1-5.oe2203",
|
||||
"Owner": "xiechengliang1@huawei.com",
|
||||
"Upstream URL": "http://www.libexpat.org",
|
||||
"Description": "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)."
|
||||
|
||||
@@ -1,269 +0,0 @@
|
||||
[](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
|
||||
[](https://ci.appveyor.com/project/libexpat/libexpat)
|
||||
[](https://repology.org/metapackage/expat/versions)
|
||||
[](https://sourceforge.net/projects/expat/files/)
|
||||
[](https://github.com/libexpat/libexpat/releases)
|
||||
|
||||
|
||||
# Expat, Release 2.4.1
|
||||
|
||||
This is Expat, a C library for parsing XML, started by
|
||||
[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997.
|
||||
Expat is a stream-oriented XML parser. This means that you register
|
||||
handlers with the parser before starting the parse. These handlers
|
||||
are called when the parser discovers the associated structures in the
|
||||
document being parsed. A start tag is an example of the kind of
|
||||
structures for which you may register handlers.
|
||||
|
||||
Expat supports the following compilers:
|
||||
|
||||
- GNU GCC >=4.5
|
||||
- LLVM Clang >=3.5
|
||||
- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`)
|
||||
|
||||
Windows users can use the
|
||||
[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases),
|
||||
which includes both pre-compiled libraries and executables, and source code for
|
||||
developers.
|
||||
|
||||
Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
|
||||
You may copy, distribute, and modify it under the terms of the License
|
||||
contained in the file
|
||||
[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING)
|
||||
distributed with this package.
|
||||
This license is the same as the MIT/X Consortium license.
|
||||
|
||||
|
||||
## Using libexpat in your CMake-Based Project
|
||||
|
||||
There are two ways of using libexpat with CMake:
|
||||
|
||||
### a) Module Mode
|
||||
|
||||
This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html).
|
||||
|
||||
Notice the *uppercase* `EXPAT` in the following example:
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.0) # or 3.10, see below
|
||||
|
||||
project(hello VERSION 1.0.0)
|
||||
|
||||
find_package(EXPAT 2.2.8 MODULE REQUIRED)
|
||||
|
||||
add_executable(hello
|
||||
hello.c
|
||||
)
|
||||
|
||||
# a) for CMake >=3.10 (see CMake's FindEXPAT docs)
|
||||
target_link_libraries(hello PUBLIC EXPAT::EXPAT)
|
||||
|
||||
# b) for CMake >=3.0
|
||||
target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
|
||||
target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
|
||||
```
|
||||
|
||||
### b) Config Mode
|
||||
|
||||
This approach requires files from…
|
||||
|
||||
- libexpat >=2.2.8 where packaging uses the CMake build system
|
||||
or
|
||||
- libexpat >=2.3.0 where packaging uses the GNU Autotools build system
|
||||
on Linux
|
||||
or
|
||||
- libexpat >=2.4.0 where packaging uses the GNU Autotools build system
|
||||
on macOS or MinGW.
|
||||
|
||||
Notice the *lowercase* `expat` in the following example:
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(hello VERSION 1.0.0)
|
||||
|
||||
find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns)
|
||||
|
||||
add_executable(hello
|
||||
hello.c
|
||||
)
|
||||
|
||||
target_link_libraries(hello PUBLIC expat::expat)
|
||||
```
|
||||
|
||||
|
||||
## Building from a Git Clone
|
||||
|
||||
If you are building Expat from a check-out from the
|
||||
[Git repository](https://github.com/libexpat/libexpat/),
|
||||
you need to run a script that generates the configure script using the
|
||||
GNU autoconf and libtool tools. To do this, you need to have
|
||||
autoconf 2.58 or newer. Run the script like this:
|
||||
|
||||
```console
|
||||
./buildconf.sh
|
||||
```
|
||||
|
||||
Once this has been done, follow the same instructions as for building
|
||||
from a source distribution.
|
||||
|
||||
|
||||
## Building from a Source Distribution
|
||||
|
||||
### a) Building with the configure script (i.e. GNU Autotools)
|
||||
|
||||
To build Expat from a source distribution, you first run the
|
||||
configuration shell script in the top level distribution directory:
|
||||
|
||||
```console
|
||||
./configure
|
||||
```
|
||||
|
||||
There are many options which you may provide to configure (which you
|
||||
can discover by running configure with the `--help` option). But the
|
||||
one of most interest is the one that sets the installation directory.
|
||||
By default, the configure script will set things up to install
|
||||
libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and
|
||||
`xmlwf` into `/usr/local/bin`. If, for example, you'd prefer to install
|
||||
into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and
|
||||
`/home/me/mystuff/bin`, you can tell `configure` about that with:
|
||||
|
||||
```console
|
||||
./configure --prefix=/home/me/mystuff
|
||||
```
|
||||
|
||||
Another interesting option is to enable 64-bit integer support for
|
||||
line and column numbers and the over-all byte index:
|
||||
|
||||
```console
|
||||
./configure CPPFLAGS=-DXML_LARGE_SIZE
|
||||
```
|
||||
|
||||
However, such a modification would be a breaking change to the ABI
|
||||
and is therefore not recommended for general use — e.g. as part of
|
||||
a Linux distribution — but rather for builds with special requirements.
|
||||
|
||||
After running the configure script, the `make` command will build
|
||||
things and `make install` will install things into their proper
|
||||
location. Have a look at the `Makefile` to learn about additional
|
||||
`make` options. Note that you need to have write permission into
|
||||
the directories into which things will be installed.
|
||||
|
||||
If you are interested in building Expat to provide document
|
||||
information in UTF-16 encoding rather than the default UTF-8, follow
|
||||
these instructions (after having run `make distclean`).
|
||||
Please note that we configure with `--without-xmlwf` as xmlwf does not
|
||||
support this mode of compilation (yet):
|
||||
|
||||
1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
|
||||
<br/>
|
||||
`find -name Makefile.am -exec sed
|
||||
-e 's,libexpat\.la,libexpatw.la,'
|
||||
-e 's,libexpat_la,libexpatw_la,'
|
||||
-i {} +`
|
||||
|
||||
1. Run `automake` to re-write `Makefile.in` files:<br/>
|
||||
`automake`
|
||||
|
||||
1. For UTF-16 output as unsigned short (and version/error strings as char),
|
||||
run:<br/>
|
||||
`./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`<br/>
|
||||
For UTF-16 output as `wchar_t` (incl. version/error strings), run:<br/>
|
||||
`./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T
|
||||
--without-xmlwf`
|
||||
<br/>Note: The latter requires libc compiled with `-fshort-wchar`, as well.
|
||||
|
||||
1. Run `make` (which excludes xmlwf).
|
||||
|
||||
1. Run `make install` (again, excludes xmlwf).
|
||||
|
||||
Using `DESTDIR` is supported. It works as follows:
|
||||
|
||||
```console
|
||||
make install DESTDIR=/path/to/image
|
||||
```
|
||||
|
||||
overrides the in-makefile set `DESTDIR`, because variable-setting priority is
|
||||
|
||||
1. commandline
|
||||
1. in-makefile
|
||||
1. environment
|
||||
|
||||
Note: This only applies to the Expat library itself, building UTF-16 versions
|
||||
of xmlwf and the tests is currently not supported.
|
||||
|
||||
When using Expat with a project using autoconf for configuration, you
|
||||
can use the probing macro in `conftools/expat.m4` to determine how to
|
||||
include Expat. See the comments at the top of that file for more
|
||||
information.
|
||||
|
||||
A reference manual is available in the file `doc/reference.html` in this
|
||||
distribution.
|
||||
|
||||
|
||||
### b) Building with CMake
|
||||
|
||||
The CMake build system is still *experimental* and may replace the primary
|
||||
build system based on GNU Autotools at some point when it is ready.
|
||||
|
||||
|
||||
#### Available Options
|
||||
|
||||
For an idea of the available (non-advanced) options for building with CMake:
|
||||
|
||||
```console
|
||||
# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,'
|
||||
// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
|
||||
CMAKE_BUILD_TYPE:STRING=
|
||||
|
||||
// Install path prefix, prepended onto install directories.
|
||||
CMAKE_INSTALL_PREFIX:PATH=/usr/local
|
||||
|
||||
// Path to a program.
|
||||
DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
|
||||
|
||||
// build man page for xmlwf
|
||||
EXPAT_BUILD_DOCS:BOOL=ON
|
||||
|
||||
// build the examples for expat library
|
||||
EXPAT_BUILD_EXAMPLES:BOOL=ON
|
||||
|
||||
// build fuzzers for the expat library
|
||||
EXPAT_BUILD_FUZZERS:BOOL=OFF
|
||||
|
||||
// build pkg-config file
|
||||
EXPAT_BUILD_PKGCONFIG:BOOL=ON
|
||||
|
||||
// build the tests for expat library
|
||||
EXPAT_BUILD_TESTS:BOOL=ON
|
||||
|
||||
// build the xmlwf tool for expat library
|
||||
EXPAT_BUILD_TOOLS:BOOL=ON
|
||||
|
||||
// Character type to use (char|ushort|wchar_t) [default=char]
|
||||
EXPAT_CHAR_TYPE:STRING=char
|
||||
|
||||
// install expat files in cmake install target
|
||||
EXPAT_ENABLE_INSTALL:BOOL=ON
|
||||
|
||||
// Use /MT flag (static CRT) when compiling in MSVC
|
||||
EXPAT_MSVC_STATIC_CRT:BOOL=OFF
|
||||
|
||||
// build fuzzers via ossfuzz for the expat library
|
||||
EXPAT_OSSFUZZ_BUILD:BOOL=OFF
|
||||
|
||||
// build a shared expat library
|
||||
EXPAT_SHARED_LIBS:BOOL=ON
|
||||
|
||||
// Treat all compiler warnings as errors
|
||||
EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
|
||||
|
||||
// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
|
||||
EXPAT_WITH_GETRANDOM:STRING=AUTO
|
||||
|
||||
// utilize libbsd (for arc4random_buf)
|
||||
EXPAT_WITH_LIBBSD:BOOL=OFF
|
||||
|
||||
// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
|
||||
EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO
|
||||
```
|
||||
@@ -1,12 +0,0 @@
|
||||
# acinclude.m4 --
|
||||
#
|
||||
|
||||
m4_include(conftools/ax-require-defined.m4)
|
||||
m4_include(conftools/ax-check-compile-flag.m4)
|
||||
m4_include(conftools/ax-check-link-flag.m4)
|
||||
m4_include(conftools/ax-append-flag.m4)
|
||||
m4_include(conftools/ax-append-compile-flags.m4)
|
||||
m4_include(conftools/ax-append-link-flags.m4)
|
||||
m4_include(conftools/expatcfg-compiler-supports-visibility.m4)
|
||||
|
||||
### end of file
|
||||
Vendored
-1198
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 8199488..8453289 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -88,9 +88,9 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "winconfig.h"
|
||||
-#endif
|
||||
-
|
||||
-#include <expat_config.h>
|
||||
+#elif defined(HAVE_EXPAT_CONFIG_H)
|
||||
+# include <expat_config.h>
|
||||
+#endif /* ndef _WIN32 */
|
||||
|
||||
#include "ascii.h"
|
||||
#include "expat.h"
|
||||
diff --git a/lib/xmlrole.c b/lib/xmlrole.c
|
||||
index 08173b0..ddb22ef 100644
|
||||
--- a/lib/xmlrole.c
|
||||
+++ b/lib/xmlrole.c
|
||||
@@ -41,9 +41,11 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "winconfig.h"
|
||||
-#endif
|
||||
-
|
||||
-#include <expat_config.h>
|
||||
+#else
|
||||
+# ifdef HAVE_EXPAT_CONFIG_H
|
||||
+# include <expat_config.h>
|
||||
+# endif
|
||||
+#endif /* ndef _WIN32 */
|
||||
|
||||
#include "expat_external.h"
|
||||
#include "internal.h"
|
||||
diff --git a/lib/xmltok.c b/lib/xmltok.c
|
||||
index 8d77d60..53ec1d0 100644
|
||||
--- a/lib/xmltok.c
|
||||
+++ b/lib/xmltok.c
|
||||
@@ -48,9 +48,11 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "winconfig.h"
|
||||
-#endif
|
||||
-
|
||||
-#include <expat_config.h>
|
||||
+#else
|
||||
+# ifdef HAVE_EXPAT_CONFIG_H
|
||||
+# include <expat_config.h>
|
||||
+# endif
|
||||
+#endif /* ndef _WIN32 */
|
||||
|
||||
#include "expat_external.h"
|
||||
#include "internal.h"
|
||||
@@ -0,0 +1,52 @@
|
||||
From 4a32da87e931ba54393d465bb77c40b5c33d343b Mon Sep 17 00:00:00 2001
|
||||
From: Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Date: Wed, 17 Aug 2022 18:26:18 +0100
|
||||
Subject: [PATCH] Ensure raw tagnames are safe exiting internalEntityParser
|
||||
|
||||
It is possible to concoct a situation in which parsing is
|
||||
suspended while substituting in an internal entity, so that
|
||||
XML_ResumeParser directly uses internalEntityProcessor as
|
||||
its processor. If the subsequent parse includes some unclosed
|
||||
tags, this will return without calling storeRawNames to ensure
|
||||
that the raw versions of the tag names are stored in memory other
|
||||
than the parse buffer itself. If the parse buffer is then changed
|
||||
or reallocated (for example if processing a file line by line),
|
||||
badness will ensue.
|
||||
|
||||
This patch ensures storeRawNames is always called when needed
|
||||
after calling doContent. The earlier call do doContent does
|
||||
not need the same protection; it only deals with entity
|
||||
substitution, which cannot leave unbalanced tags, and in any
|
||||
case the raw names will be pointing into the stored entity
|
||||
value not the parse buffer.
|
||||
---
|
||||
lib/xmlparse.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 7bcabf7f..d73f419c 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -5826,10 +5826,15 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
|
||||
{
|
||||
parser->m_processor = contentProcessor;
|
||||
/* see externalEntityContentProcessor vs contentProcessor */
|
||||
- return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding,
|
||||
- s, end, nextPtr,
|
||||
- (XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
- XML_ACCOUNT_DIRECT);
|
||||
+ result = doContent(parser, parser->m_parentParser ? 1 : 0,
|
||||
+ parser->m_encoding, s, end, nextPtr,
|
||||
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
+ XML_ACCOUNT_DIRECT);
|
||||
+ if (result == XML_ERROR_NONE) {
|
||||
+ if (! storeRawNames(parser))
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+ return result;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
From a7ce80a013f2a08cb1ac4aac368f2250eea03ebf Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sun, 11 Sep 2022 19:34:33 +0200
|
||||
Subject: [PATCH] tests: Cover heap use-after-free issue in doContent
|
||||
|
||||
---
|
||||
tests/runtests.c | 74 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 74 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index ea371b42..ab3aff65 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -4990,6 +4990,78 @@ START_TEST(test_suspend_resume_internal_entity) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+void
|
||||
+suspending_comment_handler(void *userData, const XML_Char *data) {
|
||||
+ UNUSED_P(data);
|
||||
+ XML_Parser parser = (XML_Parser)userData;
|
||||
+ XML_StopParser(parser, XML_TRUE);
|
||||
+}
|
||||
+
|
||||
+START_TEST(test_suspend_resume_internal_entity_issue_629) {
|
||||
+ const char *const text
|
||||
+ = "<!DOCTYPE a [<!ENTITY e '<!--COMMENT-->a'>]><a>&e;<b>\n"
|
||||
+ "<"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
+ "/>"
|
||||
+ "</b></a>";
|
||||
+ const size_t firstChunkSizeBytes = 54;
|
||||
+
|
||||
+ XML_Parser parser = XML_ParserCreate(NULL);
|
||||
+ XML_SetUserData(parser, parser);
|
||||
+ XML_SetCommentHandler(parser, suspending_comment_handler);
|
||||
+
|
||||
+ if (XML_Parse(parser, text, (int)firstChunkSizeBytes, XML_FALSE)
|
||||
+ != XML_STATUS_SUSPENDED)
|
||||
+ xml_failure(parser);
|
||||
+ if (XML_ResumeParser(parser) != XML_STATUS_OK)
|
||||
+ xml_failure(parser);
|
||||
+ if (XML_Parse(parser, text + firstChunkSizeBytes,
|
||||
+ (int)(strlen(text) - firstChunkSizeBytes), XML_TRUE)
|
||||
+ != XML_STATUS_OK)
|
||||
+ xml_failure(parser);
|
||||
+ XML_ParserFree(parser);
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
/* Test syntax error is caught at parse resumption */
|
||||
START_TEST(test_resume_entity_with_syntax_error) {
|
||||
const char *text = "<!DOCTYPE doc [\n"
|
||||
@@ -12016,6 +12088,8 @@ make_suite(void) {
|
||||
tcase_add_test(tc_basic, test_partial_char_in_epilog);
|
||||
tcase_add_test(tc_basic, test_hash_collision);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_internal_entity);
|
||||
+ tcase_add_test__ifdef_xml_dtd(tc_basic,
|
||||
+ test_suspend_resume_internal_entity_issue_629);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_resume_entity_with_syntax_error);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_suspend_resume_parameter_entity);
|
||||
tcase_add_test(tc_basic, test_restart_on_error);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 0adcb34c49bee5b19bd29b16a578c510c23597ea Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Mon, 27 Dec 2021 20:15:02 +0100
|
||||
Subject: [PATCH] lib: Detect and prevent troublesome left shifts in function
|
||||
storeAtts (CVE-2021-45960)
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 31 +++++++++++++++++++++++++++++--
|
||||
1 file changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index d730f41..b47c31b 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -3414,7 +3414,13 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
if (nPrefixes) {
|
||||
int j; /* hash table index */
|
||||
unsigned long version = parser->m_nsAttsVersion;
|
||||
- int nsAttsSize = (int)1 << parser->m_nsAttsPower;
|
||||
+
|
||||
+ /* Detect and prevent invalid shift */
|
||||
+ if (parser->m_nsAttsPower >= sizeof(unsigned int) * 8 /* bits per byte */) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ unsigned int nsAttsSize = 1u << parser->m_nsAttsPower;
|
||||
unsigned char oldNsAttsPower = parser->m_nsAttsPower;
|
||||
/* size of hash table must be at least 2 * (# of prefixed attributes) */
|
||||
if ((nPrefixes << 1)
|
||||
@@ -3425,7 +3431,28 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
;
|
||||
if (parser->m_nsAttsPower < 3)
|
||||
parser->m_nsAttsPower = 3;
|
||||
- nsAttsSize = (int)1 << parser->m_nsAttsPower;
|
||||
+
|
||||
+ /* Detect and prevent invalid shift */
|
||||
+ if (parser->m_nsAttsPower >= sizeof(nsAttsSize) * 8 /* bits per byte */) {
|
||||
+ /* Restore actual size of memory in m_nsAtts */
|
||||
+ parser->m_nsAttsPower = oldNsAttsPower;
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ nsAttsSize = 1u << parser->m_nsAttsPower;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if (nsAttsSize > (size_t)(-1) / sizeof(NS_ATT)) {
|
||||
+ /* Restore actual size of memory in m_nsAtts */
|
||||
+ parser->m_nsAttsPower = oldNsAttsPower;
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
temp = (NS_ATT *)REALLOC(parser, parser->m_nsAtts,
|
||||
nsAttsSize * sizeof(NS_ATT));
|
||||
if (! temp) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 85ae9a2d7d0e9358f356b33977b842df8ebaec2b Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sat, 25 Dec 2021 20:52:08 +0100
|
||||
Subject: [PATCH] lib: Prevent integer overflow on m_groupSize in function
|
||||
doProlog (CVE-2021-46143)
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index b47c31b..8f24312 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -5046,6 +5046,11 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
if (parser->m_prologState.level >= parser->m_groupSize) {
|
||||
if (parser->m_groupSize) {
|
||||
{
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (parser->m_groupSize > (unsigned int)(-1) / 2u) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
char *const new_connector = (char *)REALLOC(
|
||||
parser, parser->m_groupConnector, parser->m_groupSize *= 2);
|
||||
if (new_connector == NULL) {
|
||||
@@ -5056,6 +5061,16 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
}
|
||||
|
||||
if (dtd->scaffIndex) {
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if (parser->m_groupSize > (size_t)(-1) / sizeof(int)) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
int *const new_scaff_index = (int *)REALLOC(
|
||||
parser, dtd->scaffIndex, parser->m_groupSize * sizeof(int));
|
||||
if (new_scaff_index == NULL)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
From 9f93e8036e842329863bf20395b8fb8f73834d9e Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 30 Dec 2021 22:46:03 +0100
|
||||
Subject: [PATCH] lib: Prevent integer overflow at multiple places
|
||||
(CVE-2022-22822 to CVE-2022-22827)
|
||||
|
||||
The involved functions are:
|
||||
- addBinding (CVE-2022-22822)
|
||||
- build_model (CVE-2022-22823)
|
||||
- defineAttribute (CVE-2022-22824)
|
||||
- lookup (CVE-2022-22825)
|
||||
- nextScaffoldPart (CVE-2022-22826)
|
||||
- storeAtts (CVE-2022-22827)
|
||||
---
|
||||
lib/xmlparse.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 151 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 8f24312..575e73e 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -3261,13 +3261,38 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
|
||||
/* get the attributes from the tokenizer */
|
||||
n = XmlGetAttributes(enc, attStr, parser->m_attsSize, parser->m_atts);
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (n > INT_MAX - nDefaultAtts) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
if (n + nDefaultAtts > parser->m_attsSize) {
|
||||
int oldAttsSize = parser->m_attsSize;
|
||||
ATTRIBUTE *temp;
|
||||
#ifdef XML_ATTR_INFO
|
||||
XML_AttrInfo *temp2;
|
||||
#endif
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if ((nDefaultAtts > INT_MAX - INIT_ATTS_SIZE)
|
||||
+ || (n > INT_MAX - (nDefaultAtts + INIT_ATTS_SIZE))) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
parser->m_attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(ATTRIBUTE)) {
|
||||
+ parser->m_attsSize = oldAttsSize;
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
temp = (ATTRIBUTE *)REALLOC(parser, (void *)parser->m_atts,
|
||||
parser->m_attsSize * sizeof(ATTRIBUTE));
|
||||
if (temp == NULL) {
|
||||
@@ -3276,6 +3301,17 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
}
|
||||
parser->m_atts = temp;
|
||||
#ifdef XML_ATTR_INFO
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+# if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(XML_AttrInfo)) {
|
||||
+ parser->m_attsSize = oldAttsSize;
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+# endif
|
||||
+
|
||||
temp2 = (XML_AttrInfo *)REALLOC(parser, (void *)parser->m_attInfo,
|
||||
parser->m_attsSize * sizeof(XML_AttrInfo));
|
||||
if (temp2 == NULL) {
|
||||
@@ -3610,9 +3646,31 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
tagNamePtr->prefixLen = prefixLen;
|
||||
for (i = 0; localPart[i++];)
|
||||
; /* i includes null terminator */
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (binding->uriLen > INT_MAX - prefixLen
|
||||
+ || i > INT_MAX - (binding->uriLen + prefixLen)) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
n = i + binding->uriLen + prefixLen;
|
||||
if (n > binding->uriAlloc) {
|
||||
TAG *p;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (n > INT_MAX - EXPAND_SPARE) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)(n + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
uri = (XML_Char *)MALLOC(parser, (n + EXPAND_SPARE) * sizeof(XML_Char));
|
||||
if (! uri)
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
@@ -3708,6 +3766,21 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
|
||||
if (parser->m_freeBindingList) {
|
||||
b = parser->m_freeBindingList;
|
||||
if (len > b->uriAlloc) {
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (len > INT_MAX - EXPAND_SPARE) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
XML_Char *temp = (XML_Char *)REALLOC(
|
||||
parser, b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
|
||||
if (temp == NULL)
|
||||
@@ -3720,6 +3793,21 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
|
||||
b = (BINDING *)MALLOC(parser, sizeof(BINDING));
|
||||
if (! b)
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (len > INT_MAX - EXPAND_SPARE) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
b->uri
|
||||
= (XML_Char *)MALLOC(parser, sizeof(XML_Char) * (len + EXPAND_SPARE));
|
||||
if (! b->uri) {
|
||||
@@ -6141,7 +6229,24 @@ defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
|
||||
}
|
||||
} else {
|
||||
DEFAULT_ATTRIBUTE *temp;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (type->allocDefaultAtts > INT_MAX / 2) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
int count = type->allocDefaultAtts * 2;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if ((unsigned)count > (size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
temp = (DEFAULT_ATTRIBUTE *)REALLOC(parser, type->defaultAtts,
|
||||
(count * sizeof(DEFAULT_ATTRIBUTE)));
|
||||
if (temp == NULL)
|
||||
@@ -6792,8 +6897,20 @@ lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
|
||||
/* check for overflow (table is half full) */
|
||||
if (table->used >> (table->power - 1)) {
|
||||
unsigned char newPower = table->power + 1;
|
||||
+
|
||||
+ /* Detect and prevent invalid shift */
|
||||
+ if (newPower >= sizeof(unsigned long) * 8 /* bits per byte */) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
size_t newSize = (size_t)1 << newPower;
|
||||
unsigned long newMask = (unsigned long)newSize - 1;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (newSize > (size_t)(-1) / sizeof(NAMED *)) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
size_t tsize = newSize * sizeof(NAMED *);
|
||||
NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize);
|
||||
if (! newV)
|
||||
@@ -7143,6 +7260,20 @@ nextScaffoldPart(XML_Parser parser) {
|
||||
if (dtd->scaffCount >= dtd->scaffSize) {
|
||||
CONTENT_SCAFFOLD *temp;
|
||||
if (dtd->scaffold) {
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (dtd->scaffSize > UINT_MAX / 2u) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if (dtd->scaffSize > (size_t)(-1) / 2u / sizeof(CONTENT_SCAFFOLD)) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
temp = (CONTENT_SCAFFOLD *)REALLOC(
|
||||
parser, dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
|
||||
if (temp == NULL)
|
||||
@@ -7212,8 +7343,26 @@ build_model(XML_Parser parser) {
|
||||
XML_Content *ret;
|
||||
XML_Content *cpos;
|
||||
XML_Char *str;
|
||||
- int allocsize = (dtd->scaffCount * sizeof(XML_Content)
|
||||
- + (dtd->contentStringLen * sizeof(XML_Char)));
|
||||
+
|
||||
+ /* Detect and prevent integer overflow.
|
||||
+ * The preprocessor guard addresses the "always false" warning
|
||||
+ * from -Wtype-limits on platforms where
|
||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
||||
+#if UINT_MAX >= SIZE_MAX
|
||||
+ if (dtd->scaffCount > (size_t)(-1) / sizeof(XML_Content)) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if (dtd->contentStringLen > (size_t)(-1) / sizeof(XML_Char)) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+ if (dtd->scaffCount * sizeof(XML_Content)
|
||||
+ > (size_t)(-1) - dtd->contentStringLen * sizeof(XML_Char)) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ const size_t allocsize = (dtd->scaffCount * sizeof(XML_Content)
|
||||
+ + (dtd->contentStringLen * sizeof(XML_Char)));
|
||||
|
||||
ret = (XML_Content *)MALLOC(parser, allocsize);
|
||||
if (! ret)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 847a645152f5ebc10ac63b74b604d0c1a79fae40 Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Sat, 22 Jan 2022 17:48:00 +0100
|
||||
Subject: [PATCH] lib: Detect and prevent integer overflow in
|
||||
XML_GetBuffer (CVE-2022-23852)
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index d54af68..5ce3140 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -2067,6 +2067,11 @@ XML_GetBuffer(XML_Parser parser, int len) {
|
||||
keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
|
||||
if (keep > XML_CONTEXT_BYTES)
|
||||
keep = XML_CONTEXT_BYTES;
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (keep > INT_MAX - neededSize) {
|
||||
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
|
||||
+ return NULL;
|
||||
+ }
|
||||
neededSize += keep;
|
||||
#endif /* defined XML_CONTEXT_BYTES */
|
||||
if (neededSize
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From acf956f14bf79a5e6383a969aaffec98bfbc2e44 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sun, 23 Jan 2022 18:17:04 +0100
|
||||
Subject: [PATCH] tests: Cover integer overflow in XML_GetBuffer
|
||||
(CVE-2022-23852)
|
||||
|
||||
---
|
||||
tests/runtests.c | 27 +++++++++++++++++++++++++++
|
||||
1 file changed, 27 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index e89e822..579dad1 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -3847,6 +3847,30 @@ START_TEST(test_get_buffer_2) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+/* Test for signed integer overflow CVE-2022-23852 */
|
||||
+#if defined(XML_CONTEXT_BYTES)
|
||||
+START_TEST(test_get_buffer_3_overflow) {
|
||||
+ XML_Parser parser = XML_ParserCreate(NULL);
|
||||
+ assert(parser != NULL);
|
||||
+
|
||||
+ const char *const text = "\n";
|
||||
+ const int expectedKeepValue = (int)strlen(text);
|
||||
+
|
||||
+ // After this call, variable "keep" in XML_GetBuffer will
|
||||
+ // have value expectedKeepValue
|
||||
+ if (XML_Parse(parser, text, (int)strlen(text), XML_FALSE /* isFinal */)
|
||||
+ == XML_STATUS_ERROR)
|
||||
+ xml_failure(parser);
|
||||
+
|
||||
+ assert(expectedKeepValue > 0);
|
||||
+ if (XML_GetBuffer(parser, INT_MAX - expectedKeepValue + 1) != NULL)
|
||||
+ fail("enlarging buffer not failed");
|
||||
+
|
||||
+ XML_ParserFree(parser);
|
||||
+}
|
||||
+END_TEST
|
||||
+#endif // defined(XML_CONTEXT_BYTES)
|
||||
+
|
||||
/* Test position information macros */
|
||||
START_TEST(test_byte_info_at_end) {
|
||||
const char *text = "<doc></doc>";
|
||||
@@ -11731,6 +11755,9 @@ make_suite(void) {
|
||||
tcase_add_test(tc_basic, test_empty_parse);
|
||||
tcase_add_test(tc_basic, test_get_buffer_1);
|
||||
tcase_add_test(tc_basic, test_get_buffer_2);
|
||||
+#if defined(XML_CONTEXT_BYTES)
|
||||
+ tcase_add_test(tc_basic, test_get_buffer_3_overflow);
|
||||
+#endif
|
||||
tcase_add_test(tc_basic, test_byte_info_at_end);
|
||||
tcase_add_test(tc_basic, test_byte_info_at_error);
|
||||
tcase_add_test(tc_basic, test_byte_info_at_cdata);
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From ede41d1e186ed2aba88a06e84cac839b770af3a1 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Wed, 26 Jan 2022 02:36:43 +0100
|
||||
Subject: [PATCH] lib: Prevent integer overflow in doProlog
|
||||
(CVE-2022-23990)
|
||||
|
||||
The change from "int nameLen" to "size_t nameLen"
|
||||
addresses the overflow on "nameLen++" in code
|
||||
"for (; name[nameLen++];)" right above the second
|
||||
change in the patch.
|
||||
---
|
||||
lib/xmlparse.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 5ce3140..d1d1700 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -5372,7 +5372,7 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
if (dtd->in_eldecl) {
|
||||
ELEMENT_TYPE *el;
|
||||
const XML_Char *name;
|
||||
- int nameLen;
|
||||
+ size_t nameLen;
|
||||
const char *nxt
|
||||
= (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar);
|
||||
int myindex = nextScaffoldPart(parser);
|
||||
@@ -5388,7 +5388,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
nameLen = 0;
|
||||
for (; name[nameLen++];)
|
||||
;
|
||||
- dtd->contentStringLen += nameLen;
|
||||
+
|
||||
+ /* Detect and prevent integer overflow */
|
||||
+ if (nameLen > UINT_MAX - dtd->contentStringLen) {
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+ dtd->contentStringLen += (unsigned)nameLen;
|
||||
if (parser->m_elementDeclHandler)
|
||||
handleDefault = XML_FALSE;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 3f0a0cb644438d4d8e3294cd0b1245d0edb0c6c6 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Tue, 8 Feb 2022 04:32:20 +0100
|
||||
Subject: [PATCH] lib: Add missing validation of encoding (CVE-2022-25235)
|
||||
|
||||
---
|
||||
lib/xmltok_impl.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/xmltok_impl.c b/lib/xmltok_impl.c
|
||||
index 0430591b4..64a3b2c15 100644
|
||||
--- a/lib/xmltok_impl.c
|
||||
+++ b/lib/xmltok_impl.c
|
||||
@@ -69,7 +69,7 @@
|
||||
case BT_LEAD##n: \
|
||||
if (end - ptr < n) \
|
||||
return XML_TOK_PARTIAL_CHAR; \
|
||||
- if (! IS_NAME_CHAR(enc, ptr, n)) { \
|
||||
+ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NAME_CHAR(enc, ptr, n)) { \
|
||||
*nextTokPtr = ptr; \
|
||||
return XML_TOK_INVALID; \
|
||||
} \
|
||||
@@ -98,7 +98,7 @@
|
||||
case BT_LEAD##n: \
|
||||
if (end - ptr < n) \
|
||||
return XML_TOK_PARTIAL_CHAR; \
|
||||
- if (! IS_NMSTRT_CHAR(enc, ptr, n)) { \
|
||||
+ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NMSTRT_CHAR(enc, ptr, n)) { \
|
||||
*nextTokPtr = ptr; \
|
||||
return XML_TOK_INVALID; \
|
||||
} \
|
||||
@@ -1142,6 +1142,10 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
case BT_LEAD##n: \
|
||||
if (end - ptr < n) \
|
||||
return XML_TOK_PARTIAL_CHAR; \
|
||||
+ if (IS_INVALID_CHAR(enc, ptr, n)) { \
|
||||
+ *nextTokPtr = ptr; \
|
||||
+ return XML_TOK_INVALID; \
|
||||
+ } \
|
||||
if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
|
||||
ptr += n; \
|
||||
tok = XML_TOK_NAME; \
|
||||
@@ -0,0 +1,32 @@
|
||||
From a2fe525e660badd64b6c557c2b1ec26ddc07f6e4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sat, 12 Feb 2022 01:09:29 +0100
|
||||
Subject: [PATCH] lib: Protect against malicious namespace declarations
|
||||
(CVE-2022-25236)
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index c768f856..a3aef88c 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -3754,6 +3754,17 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
|
||||
if (! mustBeXML && isXMLNS
|
||||
&& (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
|
||||
isXMLNS = XML_FALSE;
|
||||
+
|
||||
+ // NOTE: While Expat does not validate namespace URIs against RFC 3986,
|
||||
+ // we have to at least make sure that the XML processor on top of
|
||||
+ // Expat (that is splitting tag names by namespace separator into
|
||||
+ // 2- or 3-tuples (uri-local or uri-local-prefix)) cannot be confused
|
||||
+ // by an attacker putting additional namespace separator characters
|
||||
+ // into namespace declarations. That would be ambiguous and not to
|
||||
+ // be expected.
|
||||
+ if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)) {
|
||||
+ return XML_ERROR_SYNTAX;
|
||||
+ }
|
||||
}
|
||||
isXML = isXML && len == xmlLen;
|
||||
isXMLNS = isXMLNS && len == xmlnsLen;
|
||||
@@ -0,0 +1,222 @@
|
||||
From 9b4ce651b26557f16103c3a366c91934ecd439ab Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Tue, 15 Feb 2022 11:54:29 +0000
|
||||
Subject: [PATCH] Prevent stack exhaustion in build_model
|
||||
|
||||
It is possible to trigger stack exhaustion in build_model function if
|
||||
depth of nested children in DTD element is large enough. This happens
|
||||
because build_node is a recursively called function within build_model.
|
||||
|
||||
The code has been adjusted to run iteratively. It uses the already
|
||||
allocated heap space as temporary stack (growing from top to bottom).
|
||||
|
||||
Output is identical to recursive version. No new fields in data
|
||||
structures were added, i.e. it keeps full API and ABI compatibility.
|
||||
Instead the numchildren variable is used to temporarily keep the
|
||||
index of items (uint vs int).
|
||||
|
||||
Documentation and readability improvements kindly added by Sebastian.
|
||||
|
||||
Proof of Concept:
|
||||
|
||||
1. Compile poc binary which parses XML file line by line
|
||||
|
||||
```
|
||||
cat > poc.c << EOF
|
||||
#include <err.h>
|
||||
#include <expat.h>
|
||||
#include <stdio.h>
|
||||
|
||||
XML_Parser parser;
|
||||
|
||||
static void XMLCALL
|
||||
dummy_element_decl_handler(void *userData, const XML_Char *name,
|
||||
XML_Content *model) {
|
||||
XML_FreeContentModel(parser, model);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
FILE *fp;
|
||||
char *p = NULL;
|
||||
size_t s = 0;
|
||||
ssize_t l;
|
||||
if (argc != 2)
|
||||
errx(1, "usage: poc poc.xml");
|
||||
if ((parser = XML_ParserCreate(NULL)) == NULL)
|
||||
errx(1, "XML_ParserCreate");
|
||||
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
|
||||
if ((fp = fopen(argv[1], "r")) == NULL)
|
||||
err(1, "fopen");
|
||||
while ((l = getline(&p, &s, fp)) > 0)
|
||||
if (XML_Parse(parser, p, (int)l, XML_FALSE) != XML_STATUS_OK)
|
||||
errx(1, "XML_Parse");
|
||||
XML_ParserFree(parser);
|
||||
free(p);
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
cc -std=c11 -D_POSIX_C_SOURCE=200809L -lexpat -o poc poc.c
|
||||
```
|
||||
|
||||
2. Create XML file with a lot of nested groups in DTD element
|
||||
|
||||
```
|
||||
cat > poc.xml.zst.b64 << EOF
|
||||
KLUv/aQkACAAPAEA+DwhRE9DVFlQRSB1d3UgWwo8IUVMRU1FTlQgdXd1CigBAHv/58AJAgAQKAIA
|
||||
ECgCABAoAgAQKAIAECgCABAoAgAQKHwAAChvd28KKQIA2/8gV24XBAIAECkCABApAgAQKQIAECkC
|
||||
ABApAgAQKQIAEClVAAAgPl0+CgEA4A4I2VwwnQ==
|
||||
EOF
|
||||
base64 -d poc.xml.zst.b64 | zstd -d > poc.xml
|
||||
```
|
||||
|
||||
3. Run Proof of Concept
|
||||
|
||||
```
|
||||
./poc poc.xml
|
||||
```
|
||||
|
||||
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
|
||||
---
|
||||
lib/xmlparse.c | 116 +++++++++++++++++++++++++++++--------------
|
||||
1 file changed, 79 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 4b43e613..594cf12c 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -7317,44 +7317,15 @@ nextScaffoldPart(XML_Parser parser) {
|
||||
return next;
|
||||
}
|
||||
|
||||
-static void
|
||||
-build_node(XML_Parser parser, int src_node, XML_Content *dest,
|
||||
- XML_Content **contpos, XML_Char **strpos) {
|
||||
- DTD *const dtd = parser->m_dtd; /* save one level of indirection */
|
||||
- dest->type = dtd->scaffold[src_node].type;
|
||||
- dest->quant = dtd->scaffold[src_node].quant;
|
||||
- if (dest->type == XML_CTYPE_NAME) {
|
||||
- const XML_Char *src;
|
||||
- dest->name = *strpos;
|
||||
- src = dtd->scaffold[src_node].name;
|
||||
- for (;;) {
|
||||
- *(*strpos)++ = *src;
|
||||
- if (! *src)
|
||||
- break;
|
||||
- src++;
|
||||
- }
|
||||
- dest->numchildren = 0;
|
||||
- dest->children = NULL;
|
||||
- } else {
|
||||
- unsigned int i;
|
||||
- int cn;
|
||||
- dest->numchildren = dtd->scaffold[src_node].childcnt;
|
||||
- dest->children = *contpos;
|
||||
- *contpos += dest->numchildren;
|
||||
- for (i = 0, cn = dtd->scaffold[src_node].firstchild; i < dest->numchildren;
|
||||
- i++, cn = dtd->scaffold[cn].nextsib) {
|
||||
- build_node(parser, cn, &(dest->children[i]), contpos, strpos);
|
||||
- }
|
||||
- dest->name = NULL;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static XML_Content *
|
||||
build_model(XML_Parser parser) {
|
||||
+ /* Function build_model transforms the existing parser->m_dtd->scaffold
|
||||
+ * array of CONTENT_SCAFFOLD tree nodes into a new array of
|
||||
+ * XML_Content tree nodes followed by a gapless list of zero-terminated
|
||||
+ * strings. */
|
||||
DTD *const dtd = parser->m_dtd; /* save one level of indirection */
|
||||
XML_Content *ret;
|
||||
- XML_Content *cpos;
|
||||
- XML_Char *str;
|
||||
+ XML_Char *str; /* the current string writing location */
|
||||
|
||||
/* Detect and prevent integer overflow.
|
||||
* The preprocessor guard addresses the "always false" warning
|
||||
@@ -7380,10 +7351,81 @@ build_model(XML_Parser parser) {
|
||||
if (! ret)
|
||||
return NULL;
|
||||
|
||||
- str = (XML_Char *)(&ret[dtd->scaffCount]);
|
||||
- cpos = &ret[1];
|
||||
+ /* What follows is an iterative implementation (of what was previously done
|
||||
+ * recursively in a dedicated function called "build_node". The old recursive
|
||||
+ * build_node could be forced into stack exhaustion from input as small as a
|
||||
+ * few megabyte, and so that was a security issue. Hence, a function call
|
||||
+ * stack is avoided now by resolving recursion.)
|
||||
+ *
|
||||
+ * The iterative approach works as follows:
|
||||
+ *
|
||||
+ * - We use space in the target array for building a temporary stack structure
|
||||
+ * while that space is still unused.
|
||||
+ * The stack grows from the array's end downwards and the "actual data"
|
||||
+ * grows from the start upwards, sequentially.
|
||||
+ * (Because stack grows downwards, pushing onto the stack is a decrement
|
||||
+ * while popping off the stack is an increment.)
|
||||
+ *
|
||||
+ * - A stack element appears as a regular XML_Content node on the outside,
|
||||
+ * but only uses a single field -- numchildren -- to store the source
|
||||
+ * tree node array index. These are the breadcrumbs leading the way back
|
||||
+ * during pre-order (node first) depth-first traversal.
|
||||
+ *
|
||||
+ * - The reason we know the stack will never grow into (or overlap with)
|
||||
+ * the area with data of value at the start of the array is because
|
||||
+ * the overall number of elements to process matches the size of the array,
|
||||
+ * and the sum of fully processed nodes and yet-to-be processed nodes
|
||||
+ * on the stack, cannot be more than the total number of nodes.
|
||||
+ * It is possible for the top of the stack and the about-to-write node
|
||||
+ * to meet, but that is safe because we get the source index out
|
||||
+ * before doing any writes on that node.
|
||||
+ */
|
||||
+ XML_Content *dest = ret; /* tree node writing location, moves upwards */
|
||||
+ XML_Content *const destLimit = &ret[dtd->scaffCount];
|
||||
+ XML_Content *const stackBottom = &ret[dtd->scaffCount];
|
||||
+ XML_Content *stackTop = stackBottom; /* i.e. stack is initially empty */
|
||||
+ str = (XML_Char *)&ret[dtd->scaffCount];
|
||||
+
|
||||
+ /* Push source tree root node index onto the stack */
|
||||
+ (--stackTop)->numchildren = 0;
|
||||
+
|
||||
+ for (; dest < destLimit; dest++) {
|
||||
+ /* Pop source tree node index off the stack */
|
||||
+ const int src_node = (int)(stackTop++)->numchildren;
|
||||
+
|
||||
+ /* Convert item */
|
||||
+ dest->type = dtd->scaffold[src_node].type;
|
||||
+ dest->quant = dtd->scaffold[src_node].quant;
|
||||
+ if (dest->type == XML_CTYPE_NAME) {
|
||||
+ const XML_Char *src;
|
||||
+ dest->name = str;
|
||||
+ src = dtd->scaffold[src_node].name;
|
||||
+ for (;;) {
|
||||
+ *str++ = *src;
|
||||
+ if (! *src)
|
||||
+ break;
|
||||
+ src++;
|
||||
+ }
|
||||
+ dest->numchildren = 0;
|
||||
+ dest->children = NULL;
|
||||
+ } else {
|
||||
+ unsigned int i;
|
||||
+ int cn;
|
||||
+ dest->name = NULL;
|
||||
+ dest->numchildren = dtd->scaffold[src_node].childcnt;
|
||||
+ dest->children = &dest[1];
|
||||
+
|
||||
+ /* Push children to the stack
|
||||
+ * in a way where the first child ends up at the top of the
|
||||
+ * (downwards growing) stack, in order to be processed first. */
|
||||
+ stackTop -= dest->numchildren;
|
||||
+ for (i = 0, cn = dtd->scaffold[src_node].firstchild;
|
||||
+ i < dest->numchildren; i++, cn = dtd->scaffold[cn].nextsib) {
|
||||
+ (stackTop + i)->numchildren = (unsigned int)cn;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- build_node(parser, 0, ret, &cpos, &str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From efcb347440ade24b9f1054671e6bd05e60b4cafd Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Tue, 15 Feb 2022 11:56:57 +0000
|
||||
Subject: [PATCH] Prevent integer overflow in copyString
|
||||
|
||||
The copyString function is only used for encoding string supplied by
|
||||
the library user.
|
||||
---
|
||||
lib/xmlparse.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 4b43e613..a39377c2 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -7412,7 +7412,7 @@ getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr,
|
||||
|
||||
static XML_Char *
|
||||
copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {
|
||||
- int charsRequired = 0;
|
||||
+ size_t charsRequired = 0;
|
||||
XML_Char *result;
|
||||
|
||||
/* First determine how long the string is */
|
||||
@@ -0,0 +1,138 @@
|
||||
From eb0362808b4f9f1e2345a0cf203b8cc196d776d9 Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Tue, 15 Feb 2022 11:55:46 +0000
|
||||
Subject: [PATCH] Prevent integer overflow in storeRawNames
|
||||
|
||||
It is possible to use an integer overflow in storeRawNames for out of
|
||||
boundary heap writes. Default configuration is affected. If compiled
|
||||
with XML_UNICODE then the attack does not work. Compiling with
|
||||
-fsanitize=address confirms the following proof of concept.
|
||||
|
||||
The problem can be exploited by abusing the m_buffer expansion logic.
|
||||
Even though the initial size of m_buffer is a power of two, eventually
|
||||
it can end up a little bit lower, thus allowing allocations very close
|
||||
to INT_MAX (since INT_MAX/2 can be surpassed). This means that tag
|
||||
names can be parsed which are almost INT_MAX in size.
|
||||
|
||||
Unfortunately (from an attacker point of view) INT_MAX/2 is also a
|
||||
limitation in string pools. Having a tag name of INT_MAX/2 characters
|
||||
or more is not possible.
|
||||
|
||||
Expat can convert between different encodings. UTF-16 documents which
|
||||
contain only ASCII representable characters are twice as large as their
|
||||
ASCII encoded counter-parts.
|
||||
|
||||
The proof of concept works by taking these three considerations into
|
||||
account:
|
||||
|
||||
1. Move the m_buffer size slightly below a power of two by having a
|
||||
short root node <a>. This allows the m_buffer to grow very close
|
||||
to INT_MAX.
|
||||
2. The string pooling forbids tag names longer than or equal to
|
||||
INT_MAX/2, so keep the attack tag name smaller than that.
|
||||
3. To be able to still overflow INT_MAX even though the name is
|
||||
limited at INT_MAX/2-1 (nul byte) we use UTF-16 encoding and a tag
|
||||
which only contains ASCII characters. UTF-16 always stores two
|
||||
bytes per character while the tag name is converted to using only
|
||||
one. Our attack node byte count must be a bit higher than
|
||||
2/3 INT_MAX so the converted tag name is around INT_MAX/3 which
|
||||
in sum can overflow INT_MAX.
|
||||
|
||||
Thanks to our small root node, m_buffer can handle 2/3 INT_MAX bytes
|
||||
without running into INT_MAX boundary check. The string pooling is
|
||||
able to store INT_MAX/3 as tag name because the amount is below
|
||||
INT_MAX/2 limitation. And creating the sum of both eventually overflows
|
||||
in storeRawNames.
|
||||
|
||||
Proof of Concept:
|
||||
|
||||
1. Compile expat with -fsanitize=address.
|
||||
|
||||
2. Create Proof of Concept binary which iterates through input
|
||||
file 16 MB at once for better performance and easier integer
|
||||
calculations:
|
||||
|
||||
```
|
||||
cat > poc.c << EOF
|
||||
#include <err.h>
|
||||
#include <expat.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHUNK (16 * 1024 * 1024)
|
||||
int main(int argc, char *argv[]) {
|
||||
XML_Parser parser;
|
||||
FILE *fp;
|
||||
char *buf;
|
||||
int i;
|
||||
|
||||
if (argc != 2)
|
||||
errx(1, "usage: poc file.xml");
|
||||
if ((parser = XML_ParserCreate(NULL)) == NULL)
|
||||
errx(1, "failed to create expat parser");
|
||||
if ((fp = fopen(argv[1], "r")) == NULL) {
|
||||
XML_ParserFree(parser);
|
||||
err(1, "failed to open file");
|
||||
}
|
||||
if ((buf = malloc(CHUNK)) == NULL) {
|
||||
fclose(fp);
|
||||
XML_ParserFree(parser);
|
||||
err(1, "failed to allocate buffer");
|
||||
}
|
||||
i = 0;
|
||||
while (fread(buf, CHUNK, 1, fp) == 1) {
|
||||
printf("iteration %d: XML_Parse returns %d\n", ++i,
|
||||
XML_Parse(parser, buf, CHUNK, XML_FALSE));
|
||||
}
|
||||
free(buf);
|
||||
fclose(fp);
|
||||
XML_ParserFree(parser);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
gcc -fsanitize=address -lexpat -o poc poc.c
|
||||
```
|
||||
|
||||
3. Construct specially prepared UTF-16 XML file:
|
||||
|
||||
```
|
||||
dd if=/dev/zero bs=1024 count=794624 | tr '\0' 'a' > poc-utf8.xml
|
||||
echo -n '<a><' | dd conv=notrunc of=poc-utf8.xml
|
||||
echo -n '><' | dd conv=notrunc of=poc-utf8.xml bs=1 seek=805306368
|
||||
iconv -f UTF-8 -t UTF-16LE poc-utf8.xml > poc-utf16.xml
|
||||
```
|
||||
|
||||
4. Run proof of concept:
|
||||
|
||||
```
|
||||
./poc poc-utf16.xml
|
||||
```
|
||||
---
|
||||
lib/xmlparse.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 4b43e613..f34d6ab5 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -2563,6 +2563,7 @@ storeRawNames(XML_Parser parser) {
|
||||
while (tag) {
|
||||
int bufSize;
|
||||
int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
|
||||
+ size_t rawNameLen;
|
||||
char *rawNameBuf = tag->buf + nameLen;
|
||||
/* Stop if already stored. Since m_tagStack is a stack, we can stop
|
||||
at the first entry that has already been copied; everything
|
||||
@@ -2574,7 +2575,11 @@ storeRawNames(XML_Parser parser) {
|
||||
/* For re-use purposes we need to ensure that the
|
||||
size of tag->buf is a multiple of sizeof(XML_Char).
|
||||
*/
|
||||
- bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
|
||||
+ rawNameLen = ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
|
||||
+ /* Detect and prevent integer overflow. */
|
||||
+ if (rawNameLen > (size_t)INT_MAX - nameLen)
|
||||
+ return XML_FALSE;
|
||||
+ bufSize = nameLen + (int)rawNameLen;
|
||||
if (bufSize > tag->bufEnd - tag->buf) {
|
||||
char *temp = (char *)REALLOC(parser, tag->buf, bufSize);
|
||||
if (temp == NULL)
|
||||
@@ -0,0 +1,29 @@
|
||||
From 5290462a7ea1278a8d5c0d5b2860d4e244f997e4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Tue, 20 Sep 2022 02:44:34 +0200
|
||||
Subject: [PATCH] lib: Fix overeager DTD destruction in
|
||||
XML_ExternalEntityParserCreate
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index aacd6e7fc..57bf103cc 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -1068,6 +1068,14 @@ parserCreate(const XML_Char *encodingName,
|
||||
parserInit(parser, encodingName);
|
||||
|
||||
if (encodingName && ! parser->m_protocolEncodingName) {
|
||||
+ if (dtd) {
|
||||
+ // We need to stop the upcoming call to XML_ParserFree from happily
|
||||
+ // destroying parser->m_dtd because the DTD is shared with the parent
|
||||
+ // parser and the only guard that keeps XML_ParserFree from destroying
|
||||
+ // parser->m_dtd is parser->m_isParamEntity but it will be set to
|
||||
+ // XML_TRUE only later in XML_ExternalEntityParserCreate (or not at all).
|
||||
+ parser->m_dtd = NULL;
|
||||
+ }
|
||||
XML_ParserFree(parser);
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
From b12f34fe32821a69dc12ff9a021daca0856de238 Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Sat, 19 Feb 2022 23:59:25 +0000
|
||||
Subject: [PATCH] Fix build_model regression.
|
||||
|
||||
The iterative approach in build_model failed to fill children arrays
|
||||
correctly. A preorder traversal is not required and turned out to be the
|
||||
culprit. Use an easier algorithm:
|
||||
|
||||
Add nodes from scaffold tree starting at index 0 (root) to the target
|
||||
array whenever children are encountered. This ensures that children
|
||||
are adjacent to each other. This complies with the recursive version.
|
||||
|
||||
Store only the scaffold index in numchildren field to prevent a direct
|
||||
processing of these children, which would require a recursive solution.
|
||||
This allows the algorithm to iterate through the target array from start
|
||||
to end without jumping back and forth, converting on the fly.
|
||||
|
||||
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
|
||||
---
|
||||
lib/xmlparse.c | 79 +++++++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 47 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index c479a25..84885b5 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -7373,39 +7373,58 @@ build_model(XML_Parser parser) {
|
||||
*
|
||||
* The iterative approach works as follows:
|
||||
*
|
||||
- * - We use space in the target array for building a temporary stack structure
|
||||
- * while that space is still unused.
|
||||
- * The stack grows from the array's end downwards and the "actual data"
|
||||
- * grows from the start upwards, sequentially.
|
||||
- * (Because stack grows downwards, pushing onto the stack is a decrement
|
||||
- * while popping off the stack is an increment.)
|
||||
+ * - We have two writing pointers, both walking up the result array; one does
|
||||
+ * the work, the other creates "jobs" for its colleague to do, and leads
|
||||
+ * the way:
|
||||
*
|
||||
- * - A stack element appears as a regular XML_Content node on the outside,
|
||||
- * but only uses a single field -- numchildren -- to store the source
|
||||
- * tree node array index. These are the breadcrumbs leading the way back
|
||||
- * during pre-order (node first) depth-first traversal.
|
||||
+ * - The faster one, pointer jobDest, always leads and writes "what job
|
||||
+ * to do" by the other, once they reach that place in the
|
||||
+ * array: leader "jobDest" stores the source node array index (relative
|
||||
+ * to array dtd->scaffold) in field "numchildren".
|
||||
*
|
||||
- * - The reason we know the stack will never grow into (or overlap with)
|
||||
- * the area with data of value at the start of the array is because
|
||||
- * the overall number of elements to process matches the size of the array,
|
||||
- * and the sum of fully processed nodes and yet-to-be processed nodes
|
||||
- * on the stack, cannot be more than the total number of nodes.
|
||||
- * It is possible for the top of the stack and the about-to-write node
|
||||
- * to meet, but that is safe because we get the source index out
|
||||
- * before doing any writes on that node.
|
||||
+ * - The slower one, pointer dest, looks at the value stored in the
|
||||
+ * "numchildren" field (which actually holds a source node array index
|
||||
+ * at that time) and puts the real data from dtd->scaffold in.
|
||||
+ *
|
||||
+ * - Before the loop starts, jobDest writes source array index 0
|
||||
+ * (where the root node is located) so that dest will have something to do
|
||||
+ * when it starts operation.
|
||||
+ *
|
||||
+ * - Whenever nodes with children are encountered, jobDest appends
|
||||
+ * them as new jobs, in order. As a result, tree node siblings are
|
||||
+ * adjacent in the resulting array, for example:
|
||||
+ *
|
||||
+ * [0] root, has two children
|
||||
+ * [1] first child of 0, has three children
|
||||
+ * [3] first child of 1, does not have children
|
||||
+ * [4] second child of 1, does not have children
|
||||
+ * [5] third child of 1, does not have children
|
||||
+ * [2] second child of 0, does not have children
|
||||
+ *
|
||||
+ * Or (the same data) presented in flat array view:
|
||||
+ *
|
||||
+ * [0] root, has two children
|
||||
+ *
|
||||
+ * [1] first child of 0, has three children
|
||||
+ * [2] second child of 0, does not have children
|
||||
+ *
|
||||
+ * [3] first child of 1, does not have children
|
||||
+ * [4] second child of 1, does not have children
|
||||
+ * [5] third child of 1, does not have children
|
||||
+ *
|
||||
+ * - The algorithm repeats until all target array indices have been processed.
|
||||
*/
|
||||
XML_Content *dest = ret; /* tree node writing location, moves upwards */
|
||||
XML_Content *const destLimit = &ret[dtd->scaffCount];
|
||||
- XML_Content *const stackBottom = &ret[dtd->scaffCount];
|
||||
- XML_Content *stackTop = stackBottom; /* i.e. stack is initially empty */
|
||||
+ XML_Content *jobDest = ret; /* next free writing location in target array */
|
||||
str = (XML_Char *)&ret[dtd->scaffCount];
|
||||
|
||||
- /* Push source tree root node index onto the stack */
|
||||
- (--stackTop)->numchildren = 0;
|
||||
+ /* Add the starting job, the root node (index 0) of the source tree */
|
||||
+ (jobDest++)->numchildren = 0;
|
||||
|
||||
for (; dest < destLimit; dest++) {
|
||||
- /* Pop source tree node index off the stack */
|
||||
- const int src_node = (int)(stackTop++)->numchildren;
|
||||
+ /* Retrieve source tree array index from job storage */
|
||||
+ const int src_node = (int)dest->numchildren;
|
||||
|
||||
/* Convert item */
|
||||
dest->type = dtd->scaffold[src_node].type;
|
||||
@@ -7427,16 +7446,12 @@ build_model(XML_Parser parser) {
|
||||
int cn;
|
||||
dest->name = NULL;
|
||||
dest->numchildren = dtd->scaffold[src_node].childcnt;
|
||||
- dest->children = &dest[1];
|
||||
+ dest->children = jobDest;
|
||||
|
||||
- /* Push children to the stack
|
||||
- * in a way where the first child ends up at the top of the
|
||||
- * (downwards growing) stack, in order to be processed first. */
|
||||
- stackTop -= dest->numchildren;
|
||||
+ /* Append scaffold indices of children to array */
|
||||
for (i = 0, cn = dtd->scaffold[src_node].firstchild;
|
||||
- i < dest->numchildren; i++, cn = dtd->scaffold[cn].nextsib) {
|
||||
- (stackTop + i)->numchildren = (unsigned int)cn;
|
||||
- }
|
||||
+ i < dest->numchildren; i++, cn = dtd->scaffold[cn].nextsib)
|
||||
+ (jobDest++)->numchildren = (unsigned int)cn;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From ee2a5b50e7d1940ba8745715b62ceb9efd3a96da Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Tue, 8 Feb 2022 17:37:14 +0100
|
||||
Subject: [PATCH] lib: Drop unused macro UTF8_GET_NAMING
|
||||
|
||||
---
|
||||
lib/xmltok.c | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/lib/xmltok.c b/lib/xmltok.c
|
||||
index a72200e..3bddf12 100644
|
||||
--- a/lib/xmltok.c
|
||||
+++ b/lib/xmltok.c
|
||||
@@ -98,11 +98,6 @@
|
||||
+ ((((byte)[1]) & 3) << 1) + ((((byte)[2]) >> 5) & 1)] \
|
||||
& (1u << (((byte)[2]) & 0x1F)))
|
||||
|
||||
-#define UTF8_GET_NAMING(pages, p, n) \
|
||||
- ((n) == 2 \
|
||||
- ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
|
||||
- : ((n) == 3 ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) : 0))
|
||||
-
|
||||
/* Detection of invalid UTF-8 sequences is based on Table 3.1B
|
||||
of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
|
||||
with the additional restriction of not allowing the Unicode
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 6881a4fc8596307ab9ff2e85e605afa2e413ab71 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sat, 12 Feb 2022 00:19:13 +0100
|
||||
Subject: [PATCH] lib: Fix (harmless) use of uninitialized memory
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 902895d..c768f85 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -718,8 +718,7 @@ XML_ParserCreate(const XML_Char *encodingName) {
|
||||
|
||||
XML_Parser XMLCALL
|
||||
XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
|
||||
- XML_Char tmp[2];
|
||||
- *tmp = nsSep;
|
||||
+ XML_Char tmp[2] = {nsSep, 0};
|
||||
return XML_ParserCreate_MM(encodingName, NULL, tmp);
|
||||
}
|
||||
|
||||
@@ -1344,8 +1343,7 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
|
||||
would be otherwise.
|
||||
*/
|
||||
if (parser->m_ns) {
|
||||
- XML_Char tmp[2];
|
||||
- *tmp = parser->m_namespaceSeparator;
|
||||
+ XML_Char tmp[2] = {parser->m_namespaceSeparator, 0};
|
||||
parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
|
||||
} else {
|
||||
parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
From 2ba6c76fca21397959145e18c5ef376201209020 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sun, 27 Feb 2022 16:58:08 +0100
|
||||
Subject: [PATCH] lib: Relax fix to CVE-2022-25236 with regard to RFC
|
||||
3986 URI characters
|
||||
|
||||
---
|
||||
lib/xmlparse.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 131 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
|
||||
index 59da19c..6fe2cf1 100644
|
||||
--- a/lib/xmlparse.c
|
||||
+++ b/lib/xmlparse.c
|
||||
@@ -3705,6 +3705,117 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
return XML_ERROR_NONE;
|
||||
}
|
||||
|
||||
+static XML_Bool
|
||||
+is_rfc3986_uri_char(XML_Char candidate) {
|
||||
+ // For the RFC 3986 ANBF grammar see
|
||||
+ // https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
|
||||
+
|
||||
+ switch (candidate) {
|
||||
+ // From rule "ALPHA" (uppercase half)
|
||||
+ case 'A':
|
||||
+ case 'B':
|
||||
+ case 'C':
|
||||
+ case 'D':
|
||||
+ case 'E':
|
||||
+ case 'F':
|
||||
+ case 'G':
|
||||
+ case 'H':
|
||||
+ case 'I':
|
||||
+ case 'J':
|
||||
+ case 'K':
|
||||
+ case 'L':
|
||||
+ case 'M':
|
||||
+ case 'N':
|
||||
+ case 'O':
|
||||
+ case 'P':
|
||||
+ case 'Q':
|
||||
+ case 'R':
|
||||
+ case 'S':
|
||||
+ case 'T':
|
||||
+ case 'U':
|
||||
+ case 'V':
|
||||
+ case 'W':
|
||||
+ case 'X':
|
||||
+ case 'Y':
|
||||
+ case 'Z':
|
||||
+
|
||||
+ // From rule "ALPHA" (lowercase half)
|
||||
+ case 'a':
|
||||
+ case 'b':
|
||||
+ case 'c':
|
||||
+ case 'd':
|
||||
+ case 'e':
|
||||
+ case 'f':
|
||||
+ case 'g':
|
||||
+ case 'h':
|
||||
+ case 'i':
|
||||
+ case 'j':
|
||||
+ case 'k':
|
||||
+ case 'l':
|
||||
+ case 'm':
|
||||
+ case 'n':
|
||||
+ case 'o':
|
||||
+ case 'p':
|
||||
+ case 'q':
|
||||
+ case 'r':
|
||||
+ case 's':
|
||||
+ case 't':
|
||||
+ case 'u':
|
||||
+ case 'v':
|
||||
+ case 'w':
|
||||
+ case 'x':
|
||||
+ case 'y':
|
||||
+ case 'z':
|
||||
+
|
||||
+ // From rule "DIGIT"
|
||||
+ case '0':
|
||||
+ case '1':
|
||||
+ case '2':
|
||||
+ case '3':
|
||||
+ case '4':
|
||||
+ case '5':
|
||||
+ case '6':
|
||||
+ case '7':
|
||||
+ case '8':
|
||||
+ case '9':
|
||||
+
|
||||
+ // From rule "pct-encoded"
|
||||
+ case '%':
|
||||
+
|
||||
+ // From rule "unreserved"
|
||||
+ case '-':
|
||||
+ case '.':
|
||||
+ case '_':
|
||||
+ case '~':
|
||||
+
|
||||
+ // From rule "gen-delims"
|
||||
+ case ':':
|
||||
+ case '/':
|
||||
+ case '?':
|
||||
+ case '#':
|
||||
+ case '[':
|
||||
+ case ']':
|
||||
+ case '@':
|
||||
+
|
||||
+ // From rule "sub-delims"
|
||||
+ case '!':
|
||||
+ case '$':
|
||||
+ case '&':
|
||||
+ case '\'':
|
||||
+ case '(':
|
||||
+ case ')':
|
||||
+ case '*':
|
||||
+ case '+':
|
||||
+ case ',':
|
||||
+ case ';':
|
||||
+ case '=':
|
||||
+ return XML_TRUE;
|
||||
+
|
||||
+ default:
|
||||
+ return XML_FALSE;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* addBinding() overwrites the value of prefix->binding without checking.
|
||||
Therefore one must keep track of the old value outside of addBinding().
|
||||
*/
|
||||
@@ -3763,14 +3874,26 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
|
||||
&& (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
|
||||
isXMLNS = XML_FALSE;
|
||||
|
||||
- // NOTE: While Expat does not validate namespace URIs against RFC 3986,
|
||||
- // we have to at least make sure that the XML processor on top of
|
||||
- // Expat (that is splitting tag names by namespace separator into
|
||||
- // 2- or 3-tuples (uri-local or uri-local-prefix)) cannot be confused
|
||||
- // by an attacker putting additional namespace separator characters
|
||||
- // into namespace declarations. That would be ambiguous and not to
|
||||
- // be expected.
|
||||
- if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)) {
|
||||
+ // NOTE: While Expat does not validate namespace URIs against RFC 3986
|
||||
+ // today (and is not REQUIRED to do so with regard to the XML 1.0
|
||||
+ // namespaces specification) we have to at least make sure, that
|
||||
+ // the application on top of Expat (that is likely splitting expanded
|
||||
+ // element names ("qualified names") of form
|
||||
+ // "[uri sep] local [sep prefix] '\0'" back into 1, 2 or 3 pieces
|
||||
+ // in its element handler code) cannot be confused by an attacker
|
||||
+ // putting additional namespace separator characters into namespace
|
||||
+ // declarations. That would be ambiguous and not to be expected.
|
||||
+ //
|
||||
+ // While the HTML API docs of function XML_ParserCreateNS have been
|
||||
+ // advising against use of a namespace separator character that can
|
||||
+ // appear in a URI for >20 years now, some widespread applications
|
||||
+ // are using URI characters (':' (colon) in particular) for a
|
||||
+ // namespace separator, in practice. To keep these applications
|
||||
+ // functional, we only reject namespaces URIs containing the
|
||||
+ // application-chosen namespace separator if the chosen separator
|
||||
+ // is a non-URI character with regard to RFC 3986.
|
||||
+ if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)
|
||||
+ && ! is_rfc3986_uri_char(uri[len])) {
|
||||
return XML_ERROR_SYNTAX;
|
||||
}
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
From 2de077423fb22750ebea599677d523b53cb93b1d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sat, 12 Feb 2022 00:51:43 +0100
|
||||
Subject: [PATCH] tests: Cover CVE-2022-25236
|
||||
|
||||
---
|
||||
tests/runtests.c | 30 ++++++++++++++++++++++++++++++
|
||||
1 file changed, 30 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index d07203f..bc5344b 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -7220,6 +7220,35 @@ START_TEST(test_ns_double_colon_doctype) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+START_TEST(test_ns_separator_in_uri) {
|
||||
+ struct test_case {
|
||||
+ enum XML_Status expectedStatus;
|
||||
+ const char *doc;
|
||||
+ };
|
||||
+ struct test_case cases[] = {
|
||||
+ {XML_STATUS_OK, "<doc xmlns='one_two' />"},
|
||||
+ {XML_STATUS_ERROR, "<doc xmlns='one
two' />"},
|
||||
+ };
|
||||
+
|
||||
+ size_t i = 0;
|
||||
+ size_t failCount = 0;
|
||||
+ for (; i < sizeof(cases) / sizeof(cases[0]); i++) {
|
||||
+ XML_Parser parser = XML_ParserCreateNS(NULL, '\n');
|
||||
+ XML_SetElementHandler(parser, dummy_start_element, dummy_end_element);
|
||||
+ if (XML_Parse(parser, cases[i].doc, (int)strlen(cases[i].doc),
|
||||
+ /*isFinal*/ XML_TRUE)
|
||||
+ != cases[i].expectedStatus) {
|
||||
+ failCount++;
|
||||
+ }
|
||||
+ XML_ParserFree(parser);
|
||||
+ }
|
||||
+
|
||||
+ if (failCount) {
|
||||
+ fail("Namespace separator handling is broken");
|
||||
+ }
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
/* Control variable; the number of times duff_allocator() will successfully
|
||||
* allocate */
|
||||
#define ALLOC_ALWAYS_SUCCEED (-1)
|
||||
@@ -11905,6 +11934,7 @@ make_suite(void) {
|
||||
tcase_add_test(tc_namespace, test_ns_utf16_doctype);
|
||||
tcase_add_test(tc_namespace, test_ns_invalid_doctype);
|
||||
tcase_add_test(tc_namespace, test_ns_double_colon_doctype);
|
||||
+ tcase_add_test(tc_namespace, test_ns_separator_in_uri);
|
||||
|
||||
suite_add_tcase(s, tc_misc);
|
||||
tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
From 6a5510bc6b7efe743356296724e0b38300f05379 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Tue, 8 Feb 2022 04:06:21 +0100
|
||||
Subject: [PATCH] tests: Cover missing validation of encoding
|
||||
(CVE-2022-25235)
|
||||
|
||||
---
|
||||
tests/runtests.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 109 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index bc5344b..9b155b8 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -5998,6 +5998,105 @@ START_TEST(test_utf8_in_cdata_section_2) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+START_TEST(test_utf8_in_start_tags) {
|
||||
+ struct test_case {
|
||||
+ bool goodName;
|
||||
+ bool goodNameStart;
|
||||
+ const char *tagName;
|
||||
+ };
|
||||
+
|
||||
+ // The idea with the tests below is this:
|
||||
+ // We want to cover 1-, 2- and 3-byte sequences, 4-byte sequences
|
||||
+ // go to isNever and are hence not a concern.
|
||||
+ //
|
||||
+ // We start with a character that is a valid name character
|
||||
+ // (or even name-start character, see XML 1.0r4 spec) and then we flip
|
||||
+ // single bits at places where (1) the result leaves the UTF-8 encoding space
|
||||
+ // and (2) we stay in the same n-byte sequence family.
|
||||
+ //
|
||||
+ // The flipped bits are highlighted in angle brackets in comments,
|
||||
+ // e.g. "[<1>011 1001]" means we had [0011 1001] but we now flipped
|
||||
+ // the most significant bit to 1 to leave UTF-8 encoding space.
|
||||
+ struct test_case cases[] = {
|
||||
+ // 1-byte UTF-8: [0xxx xxxx]
|
||||
+ {true, true, "\x3A"}, // [0011 1010] = ASCII colon ':'
|
||||
+ {false, false, "\xBA"}, // [<1>011 1010]
|
||||
+ {true, false, "\x39"}, // [0011 1001] = ASCII nine '9'
|
||||
+ {false, false, "\xB9"}, // [<1>011 1001]
|
||||
+
|
||||
+ // 2-byte UTF-8: [110x xxxx] [10xx xxxx]
|
||||
+ {true, true, "\xDB\xA5"}, // [1101 1011] [1010 0101] =
|
||||
+ // Arabic small waw U+06E5
|
||||
+ {false, false, "\x9B\xA5"}, // [1<0>01 1011] [1010 0101]
|
||||
+ {false, false, "\xDB\x25"}, // [1101 1011] [<0>010 0101]
|
||||
+ {false, false, "\xDB\xE5"}, // [1101 1011] [1<1>10 0101]
|
||||
+ {true, false, "\xCC\x81"}, // [1100 1100] [1000 0001] =
|
||||
+ // combining char U+0301
|
||||
+ {false, false, "\x8C\x81"}, // [1<0>00 1100] [1000 0001]
|
||||
+ {false, false, "\xCC\x01"}, // [1100 1100] [<0>000 0001]
|
||||
+ {false, false, "\xCC\xC1"}, // [1100 1100] [1<1>00 0001]
|
||||
+
|
||||
+ // 3-byte UTF-8: [1110 xxxx] [10xx xxxx] [10xxxxxx]
|
||||
+ {true, true, "\xE0\xA4\x85"}, // [1110 0000] [1010 0100] [1000 0101] =
|
||||
+ // Devanagari Letter A U+0905
|
||||
+ {false, false, "\xA0\xA4\x85"}, // [1<0>10 0000] [1010 0100] [1000 0101]
|
||||
+ {false, false, "\xE0\x24\x85"}, // [1110 0000] [<0>010 0100] [1000 0101]
|
||||
+ {false, false, "\xE0\xE4\x85"}, // [1110 0000] [1<1>10 0100] [1000 0101]
|
||||
+ {false, false, "\xE0\xA4\x05"}, // [1110 0000] [1010 0100] [<0>000 0101]
|
||||
+ {false, false, "\xE0\xA4\xC5"}, // [1110 0000] [1010 0100] [1<1>00 0101]
|
||||
+ {true, false, "\xE0\xA4\x81"}, // [1110 0000] [1010 0100] [1000 0001] =
|
||||
+ // combining char U+0901
|
||||
+ {false, false, "\xA0\xA4\x81"}, // [1<0>10 0000] [1010 0100] [1000 0001]
|
||||
+ {false, false, "\xE0\x24\x81"}, // [1110 0000] [<0>010 0100] [1000 0001]
|
||||
+ {false, false, "\xE0\xE4\x81"}, // [1110 0000] [1<1>10 0100] [1000 0001]
|
||||
+ {false, false, "\xE0\xA4\x01"}, // [1110 0000] [1010 0100] [<0>000 0001]
|
||||
+ {false, false, "\xE0\xA4\xC1"}, // [1110 0000] [1010 0100] [1<1>00 0001]
|
||||
+ };
|
||||
+ const bool atNameStart[] = {true, false};
|
||||
+
|
||||
+ size_t i = 0;
|
||||
+ char doc[1024];
|
||||
+ size_t failCount = 0;
|
||||
+
|
||||
+ for (; i < sizeof(cases) / sizeof(cases[0]); i++) {
|
||||
+ size_t j = 0;
|
||||
+ for (; j < sizeof(atNameStart) / sizeof(atNameStart[0]); j++) {
|
||||
+ const bool expectedSuccess
|
||||
+ = atNameStart[j] ? cases[i].goodNameStart : cases[i].goodName;
|
||||
+ sprintf(doc, "<%s%s><!--", atNameStart[j] ? "" : "a", cases[i].tagName);
|
||||
+ XML_Parser parser = XML_ParserCreate(NULL);
|
||||
+
|
||||
+ const enum XML_Status status
|
||||
+ = XML_Parse(parser, doc, (int)strlen(doc), /*isFinal=*/XML_FALSE);
|
||||
+
|
||||
+ bool success = true;
|
||||
+ if ((status == XML_STATUS_OK) != expectedSuccess) {
|
||||
+ success = false;
|
||||
+ }
|
||||
+ if ((status == XML_STATUS_ERROR)
|
||||
+ && (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)) {
|
||||
+ success = false;
|
||||
+ }
|
||||
+
|
||||
+ if (! success) {
|
||||
+ fprintf(
|
||||
+ stderr,
|
||||
+ "FAIL case %2u (%sat name start, %u-byte sequence, error code %d)\n",
|
||||
+ (unsigned)i + 1u, atNameStart[j] ? " " : "not ",
|
||||
+ (unsigned)strlen(cases[i].tagName), XML_GetErrorCode(parser));
|
||||
+ failCount++;
|
||||
+ }
|
||||
+
|
||||
+ XML_ParserFree(parser);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (failCount > 0) {
|
||||
+ fail("UTF-8 regression detected");
|
||||
+ }
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
/* Test trailing spaces in elements are accepted */
|
||||
static void XMLCALL
|
||||
record_element_end_handler(void *userData, const XML_Char *name) {
|
||||
@@ -6175,6 +6274,14 @@ START_TEST(test_bad_doctype) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+START_TEST(test_bad_doctype_utf8) {
|
||||
+ const char *text = "<!DOCTYPE \xDB\x25"
|
||||
+ "doc><doc/>"; // [1101 1011] [<0>010 0101]
|
||||
+ expect_failure(text, XML_ERROR_INVALID_TOKEN,
|
||||
+ "Invalid UTF-8 in DOCTYPE not faulted");
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
START_TEST(test_bad_doctype_utf16) {
|
||||
const char text[] =
|
||||
/* <!DOCTYPE doc [ \x06f2 ]><doc/>
|
||||
@@ -11870,6 +11977,7 @@ make_suite(void) {
|
||||
tcase_add_test(tc_basic, test_ext_entity_utf8_non_bom);
|
||||
tcase_add_test(tc_basic, test_utf8_in_cdata_section);
|
||||
tcase_add_test(tc_basic, test_utf8_in_cdata_section_2);
|
||||
+ tcase_add_test(tc_basic, test_utf8_in_start_tags);
|
||||
tcase_add_test(tc_basic, test_trailing_spaces_in_elements);
|
||||
tcase_add_test(tc_basic, test_utf16_attribute);
|
||||
tcase_add_test(tc_basic, test_utf16_second_attr);
|
||||
@@ -11878,6 +11986,7 @@ make_suite(void) {
|
||||
tcase_add_test(tc_basic, test_bad_attr_desc_keyword);
|
||||
tcase_add_test(tc_basic, test_bad_attr_desc_keyword_utf16);
|
||||
tcase_add_test(tc_basic, test_bad_doctype);
|
||||
+ tcase_add_test(tc_basic, test_bad_doctype_utf8);
|
||||
tcase_add_test(tc_basic, test_bad_doctype_utf16);
|
||||
tcase_add_test(tc_basic, test_bad_doctype_plus);
|
||||
tcase_add_test(tc_basic, test_bad_doctype_star);
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
From 43992e4ae25fc3dc0eec0cd3a29313555d56aee2 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Mon, 19 Sep 2022 18:16:15 +0200
|
||||
Subject: [PATCH] tests: Cover overeager DTD destruction in
|
||||
XML_ExternalEntityParserCreate
|
||||
|
||||
---
|
||||
tests/runtests.c | 49 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 49 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index 245fe9bda..acb744dd4 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -10208,6 +10208,53 @@ START_TEST(test_alloc_long_notation) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+static int XMLCALL
|
||||
+external_entity_parser_create_alloc_fail_handler(XML_Parser parser,
|
||||
+ const XML_Char *context,
|
||||
+ const XML_Char *base,
|
||||
+ const XML_Char *systemId,
|
||||
+ const XML_Char *publicId) {
|
||||
+ UNUSED_P(base);
|
||||
+ UNUSED_P(systemId);
|
||||
+ UNUSED_P(publicId);
|
||||
+
|
||||
+ if (context != NULL)
|
||||
+ fail("Unexpected non-NULL context");
|
||||
+
|
||||
+ // The following number intends to fail the upcoming allocation in line
|
||||
+ // "parser->m_protocolEncodingName = copyString(encodingName,
|
||||
+ // &(parser->m_mem));" in function parserInit.
|
||||
+ allocation_count = 3;
|
||||
+
|
||||
+ const XML_Char *const encodingName = XCS("UTF-8"); // needs something non-NULL
|
||||
+ const XML_Parser ext_parser
|
||||
+ = XML_ExternalEntityParserCreate(parser, context, encodingName);
|
||||
+ if (ext_parser != NULL)
|
||||
+ fail(
|
||||
+ "Call to XML_ExternalEntityParserCreate was expected to fail out-of-memory");
|
||||
+
|
||||
+ allocation_count = ALLOC_ALWAYS_SUCCEED;
|
||||
+ return XML_STATUS_ERROR;
|
||||
+}
|
||||
+
|
||||
+START_TEST(test_alloc_reset_after_external_entity_parser_create_fail) {
|
||||
+ const char *const text = "<!DOCTYPE doc SYSTEM 'foo'><doc/>";
|
||||
+
|
||||
+ XML_SetExternalEntityRefHandler(
|
||||
+ g_parser, external_entity_parser_create_alloc_fail_handler);
|
||||
+ XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
|
||||
+
|
||||
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
|
||||
+ != XML_STATUS_ERROR)
|
||||
+ fail("Call to parse was expected to fail");
|
||||
+
|
||||
+ if (XML_GetErrorCode(g_parser) != XML_ERROR_EXTERNAL_ENTITY_HANDLING)
|
||||
+ fail("Call to parse was expected to fail from the external entity handler");
|
||||
+
|
||||
+ XML_ParserReset(g_parser, NULL);
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
static void
|
||||
nsalloc_setup(void) {
|
||||
XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free};
|
||||
@@ -12401,6 +12448,8 @@ make_suite(void) {
|
||||
tcase_add_test(tc_alloc, test_alloc_long_public_id);
|
||||
tcase_add_test(tc_alloc, test_alloc_long_entity_value);
|
||||
tcase_add_test(tc_alloc, test_alloc_long_notation);
|
||||
+ tcase_add_test__ifdef_xml_dtd(
|
||||
+ tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail);
|
||||
|
||||
suite_add_tcase(s, tc_nsalloc);
|
||||
tcase_add_checked_fixture(tc_nsalloc, nsalloc_setup, nsalloc_teardown);
|
||||
@@ -0,0 +1,38 @@
|
||||
From e0f852db1e3b1e6d34922c68a653c3cc4b85361c Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Thu, 3 Mar 2022 17:29:54 +0100
|
||||
Subject: [PATCH] tests: Cover relaxed fix to CVE-2022-25236
|
||||
|
||||
---
|
||||
tests/runtests.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index 60da868..712706c 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -7406,16 +7406,18 @@ START_TEST(test_ns_separator_in_uri) {
|
||||
struct test_case {
|
||||
enum XML_Status expectedStatus;
|
||||
const char *doc;
|
||||
+ XML_Char namesep;
|
||||
};
|
||||
struct test_case cases[] = {
|
||||
- {XML_STATUS_OK, "<doc xmlns='one_two' />"},
|
||||
- {XML_STATUS_ERROR, "<doc xmlns='one
two' />"},
|
||||
+ {XML_STATUS_OK, "<doc xmlns='one_two' />", XCS('\n')},
|
||||
+ {XML_STATUS_ERROR, "<doc xmlns='one
two' />", XCS('\n')},
|
||||
+ {XML_STATUS_OK, "<doc xmlns='one:two' />", XCS(':')},
|
||||
};
|
||||
|
||||
size_t i = 0;
|
||||
size_t failCount = 0;
|
||||
for (; i < sizeof(cases) / sizeof(cases[0]); i++) {
|
||||
- XML_Parser parser = XML_ParserCreateNS(NULL, '\n');
|
||||
+ XML_Parser parser = XML_ParserCreateNS(NULL, cases[i].namesep);
|
||||
XML_SetElementHandler(parser, dummy_start_element, dummy_end_element);
|
||||
if (XML_Parse(parser, cases[i].doc, (int)strlen(cases[i].doc),
|
||||
/*isFinal*/ XML_TRUE)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
From 154e565f6ef329c9ec97e6534c411ddde0b320c8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Pipping <sebastian@pipping.org>
|
||||
Date: Sun, 20 Feb 2022 03:26:57 +0100
|
||||
Subject: [PATCH] tests: Protect against nested element declaration
|
||||
model regressions
|
||||
|
||||
---
|
||||
tests/runtests.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 77 insertions(+)
|
||||
|
||||
diff --git a/tests/runtests.c b/tests/runtests.c
|
||||
index 2cd4acb..e28670d 100644
|
||||
--- a/tests/runtests.c
|
||||
+++ b/tests/runtests.c
|
||||
@@ -2664,6 +2664,82 @@ START_TEST(test_dtd_elements) {
|
||||
}
|
||||
END_TEST
|
||||
|
||||
+static void XMLCALL
|
||||
+element_decl_check_model(void *userData, const XML_Char *name,
|
||||
+ XML_Content *model) {
|
||||
+ UNUSED_P(userData);
|
||||
+ uint32_t errorFlags = 0;
|
||||
+
|
||||
+ /* Expected model array structure is this:
|
||||
+ * [0] (type 6, quant 0)
|
||||
+ * [1] (type 5, quant 0)
|
||||
+ * [3] (type 4, quant 0, name "bar")
|
||||
+ * [4] (type 4, quant 0, name "foo")
|
||||
+ * [5] (type 4, quant 3, name "xyz")
|
||||
+ * [2] (type 4, quant 2, name "zebra")
|
||||
+ */
|
||||
+ errorFlags |= ((xcstrcmp(name, XCS("junk")) == 0) ? 0 : (1u << 0));
|
||||
+ errorFlags |= ((model != NULL) ? 0 : (1u << 1));
|
||||
+
|
||||
+ errorFlags |= ((model[0].type == XML_CTYPE_SEQ) ? 0 : (1u << 2));
|
||||
+ errorFlags |= ((model[0].quant == XML_CQUANT_NONE) ? 0 : (1u << 3));
|
||||
+ errorFlags |= ((model[0].numchildren == 2) ? 0 : (1u << 4));
|
||||
+ errorFlags |= ((model[0].children == &model[1]) ? 0 : (1u << 5));
|
||||
+ errorFlags |= ((model[0].name == NULL) ? 0 : (1u << 6));
|
||||
+
|
||||
+ errorFlags |= ((model[1].type == XML_CTYPE_CHOICE) ? 0 : (1u << 7));
|
||||
+ errorFlags |= ((model[1].quant == XML_CQUANT_NONE) ? 0 : (1u << 8));
|
||||
+ errorFlags |= ((model[1].numchildren == 3) ? 0 : (1u << 9));
|
||||
+ errorFlags |= ((model[1].children == &model[3]) ? 0 : (1u << 10));
|
||||
+ errorFlags |= ((model[1].name == NULL) ? 0 : (1u << 11));
|
||||
+
|
||||
+ errorFlags |= ((model[2].type == XML_CTYPE_NAME) ? 0 : (1u << 12));
|
||||
+ errorFlags |= ((model[2].quant == XML_CQUANT_REP) ? 0 : (1u << 13));
|
||||
+ errorFlags |= ((model[2].numchildren == 0) ? 0 : (1u << 14));
|
||||
+ errorFlags |= ((model[2].children == NULL) ? 0 : (1u << 15));
|
||||
+ errorFlags |= ((xcstrcmp(model[2].name, XCS("zebra")) == 0) ? 0 : (1u << 16));
|
||||
+
|
||||
+ errorFlags |= ((model[3].type == XML_CTYPE_NAME) ? 0 : (1u << 17));
|
||||
+ errorFlags |= ((model[3].quant == XML_CQUANT_NONE) ? 0 : (1u << 18));
|
||||
+ errorFlags |= ((model[3].numchildren == 0) ? 0 : (1u << 19));
|
||||
+ errorFlags |= ((model[3].children == NULL) ? 0 : (1u << 20));
|
||||
+ errorFlags |= ((xcstrcmp(model[3].name, XCS("bar")) == 0) ? 0 : (1u << 21));
|
||||
+
|
||||
+ errorFlags |= ((model[4].type == XML_CTYPE_NAME) ? 0 : (1u << 22));
|
||||
+ errorFlags |= ((model[4].quant == XML_CQUANT_NONE) ? 0 : (1u << 23));
|
||||
+ errorFlags |= ((model[4].numchildren == 0) ? 0 : (1u << 24));
|
||||
+ errorFlags |= ((model[4].children == NULL) ? 0 : (1u << 25));
|
||||
+ errorFlags |= ((xcstrcmp(model[4].name, XCS("foo")) == 0) ? 0 : (1u << 26));
|
||||
+
|
||||
+ errorFlags |= ((model[5].type == XML_CTYPE_NAME) ? 0 : (1u << 27));
|
||||
+ errorFlags |= ((model[5].quant == XML_CQUANT_PLUS) ? 0 : (1u << 28));
|
||||
+ errorFlags |= ((model[5].numchildren == 0) ? 0 : (1u << 29));
|
||||
+ errorFlags |= ((model[5].children == NULL) ? 0 : (1u << 30));
|
||||
+ errorFlags |= ((xcstrcmp(model[5].name, XCS("xyz")) == 0) ? 0 : (1u << 31));
|
||||
+
|
||||
+ XML_SetUserData(g_parser, (void *)(uintptr_t)errorFlags);
|
||||
+ XML_FreeContentModel(g_parser, model);
|
||||
+}
|
||||
+
|
||||
+START_TEST(test_dtd_elements_nesting) {
|
||||
+ // Payload inspired by a test in Perl's XML::Parser
|
||||
+ const char *text = "<!DOCTYPE foo [\n"
|
||||
+ "<!ELEMENT junk ((bar|foo|xyz+), zebra*)>\n"
|
||||
+ "]>\n"
|
||||
+ "<foo/>";
|
||||
+
|
||||
+ XML_SetUserData(g_parser, (void *)(uintptr_t)-1);
|
||||
+
|
||||
+ XML_SetElementDeclHandler(g_parser, element_decl_check_model);
|
||||
+ if (XML_Parse(g_parser, text, (int)strlen(text), XML_TRUE)
|
||||
+ == XML_STATUS_ERROR)
|
||||
+ xml_failure(g_parser);
|
||||
+
|
||||
+ if ((uint32_t)(uintptr_t)XML_GetUserData(g_parser) != 0)
|
||||
+ fail("Element declaration model regression detected");
|
||||
+}
|
||||
+END_TEST
|
||||
+
|
||||
/* Test foreign DTD handling */
|
||||
START_TEST(test_set_foreign_dtd) {
|
||||
const char *text1 = "<?xml version='1.0' encoding='us-ascii'?>\n";
|
||||
@@ -11863,6 +11939,7 @@ make_suite(void) {
|
||||
tcase_add_test(tc_basic, test_memory_allocation);
|
||||
tcase_add_test(tc_basic, test_default_current);
|
||||
tcase_add_test(tc_basic, test_dtd_elements);
|
||||
+ tcase_add_test(tc_basic, test_dtd_elements_nesting);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_set_foreign_dtd);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_foreign_dtd_not_standalone);
|
||||
tcase_add_test__ifdef_xml_dtd(tc_basic, test_invalid_foreign_dtd);
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# This is a basic version file for the Config-mode of find_package().
|
||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||
# to create a version-file which can be installed along a config.cmake file.
|
||||
#
|
||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||
# the requested version string are exactly the same and it sets
|
||||
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
|
||||
# but only if the requested major version is the same as the current one.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "@PACKAGE_VERSION@")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
|
||||
if("@PACKAGE_VERSION@" MATCHES "^([0-9]+)\\.")
|
||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(CVF_VERSION_MAJOR "@PACKAGE_VERSION@")
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
# both endpoints of the range must have the expected major version
|
||||
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
|
||||
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
|
||||
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
|
||||
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
else()
|
||||
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# if the installed project requested no architecture check, don't perform the check
|
||||
if("FALSE")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@ac_cv_sizeof_void_p@" STREQUAL "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@ac_cv_sizeof_void_p@")
|
||||
math(EXPR installedBits "@ac_cv_sizeof_void_p@ * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
||||
@@ -1,19 +0,0 @@
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Import target "expat::expat" for configuration ""
|
||||
set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
|
||||
set_target_properties(expat::expat PROPERTIES
|
||||
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@"
|
||||
IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
@@ -1,19 +0,0 @@
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Import target "expat::expat" for configuration ""
|
||||
set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
|
||||
set_target_properties(expat::expat PROPERTIES
|
||||
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib"
|
||||
IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@SO_MAJOR@.dylib"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
@@ -1,19 +0,0 @@
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Import target "expat::expat" for configuration ""
|
||||
set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
|
||||
set_target_properties(expat::expat PROPERTIES
|
||||
IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a"
|
||||
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/libexpat-@SO_MAJOR@.dll"
|
||||
)
|
||||
|
||||
list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
|
||||
list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/libexpat-@SO_MAJOR@.dll" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
|
||||
####### Any changes to this file will be overwritten by the next CMake run ####
|
||||
####### The input file was expat-config.cmake.in ########
|
||||
|
||||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
|
||||
|
||||
macro(set_and_check _var _file)
|
||||
set(${_var} "${_file}")
|
||||
if(NOT EXISTS "${_file}")
|
||||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(check_required_components _NAME)
|
||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||
if(NOT ${_NAME}_${comp}_FOUND)
|
||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||
set(${_NAME}_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
####################################################################################
|
||||
@@ -1,94 +0,0 @@
|
||||
# Generated by CMake
|
||||
|
||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
|
||||
message(FATAL_ERROR "CMake >= 2.6.0 required")
|
||||
endif()
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.6...3.18)
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
set(_targetsDefined)
|
||||
set(_targetsNotDefined)
|
||||
set(_expectedTargets)
|
||||
foreach(_expectedTarget expat::expat)
|
||||
list(APPEND _expectedTargets ${_expectedTarget})
|
||||
if(NOT TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsNotDefined ${_expectedTarget})
|
||||
endif()
|
||||
if(TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsDefined ${_expectedTarget})
|
||||
endif()
|
||||
endforeach()
|
||||
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
endif()
|
||||
if(NOT "${_targetsDefined}" STREQUAL "")
|
||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
|
||||
endif()
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
|
||||
|
||||
# Compute the installation prefix relative to this file.
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
if(_IMPORT_PREFIX STREQUAL "/")
|
||||
set(_IMPORT_PREFIX "")
|
||||
endif()
|
||||
|
||||
# Create imported target expat::expat
|
||||
add_library(expat::expat SHARED IMPORTED)
|
||||
|
||||
set_target_properties(expat::expat PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
# Load information for each installed configuration.
|
||||
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
file(GLOB CONFIG_FILES "${_DIR}/expat-*.cmake")
|
||||
foreach(f ${CONFIG_FILES})
|
||||
include(${f})
|
||||
endforeach()
|
||||
|
||||
# Cleanup temporary variables.
|
||||
set(_IMPORT_PREFIX)
|
||||
|
||||
# Loop over all imported files and verify that they actually exist
|
||||
foreach(target ${_IMPORT_CHECK_TARGETS} )
|
||||
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
|
||||
if(NOT EXISTS "${file}" )
|
||||
message(FATAL_ERROR "The imported target \"${target}\" references the file
|
||||
\"${file}\"
|
||||
but this file does not exist. Possible reasons include:
|
||||
* The file was deleted, renamed, or moved to another location.
|
||||
* An install or uninstall procedure did not complete successfully.
|
||||
* The installation package was faulty and contained
|
||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
||||
but not all the files it references.
|
||||
")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_FILES_FOR_${target})
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_TARGETS)
|
||||
|
||||
# This file does not depend on other imported targets which have
|
||||
# been exported from the same project but in a separate export set.
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
@@ -1,75 +0,0 @@
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2019 Expat development team
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
#
|
||||
if(NOT _expat_config_included)
|
||||
# Protect against multiple inclusion
|
||||
set(_expat_config_included TRUE)
|
||||
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/expat.cmake")
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
#
|
||||
# Supported components
|
||||
#
|
||||
macro(expat_register_component _NAME _AVAILABE)
|
||||
set(expat_${_NAME}_FOUND ${_AVAILABE})
|
||||
endmacro()
|
||||
|
||||
expat_register_component(attr_info @EXPAT_ATTR_INFO@)
|
||||
expat_register_component(dtd @EXPAT_DTD@)
|
||||
expat_register_component(large_size @EXPAT_LARGE_SIZE@)
|
||||
expat_register_component(min_size @EXPAT_MIN_SIZE@)
|
||||
expat_register_component(ns @EXPAT_NS@)
|
||||
|
||||
if(@EXPAT_CONTEXT_BYTES@)
|
||||
expat_register_component(context_bytes ON)
|
||||
else()
|
||||
expat_register_component(context_bytes OFF)
|
||||
endif()
|
||||
|
||||
if("@EXPAT_CHAR_TYPE@" STREQUAL "char")
|
||||
expat_register_component(char ON)
|
||||
expat_register_component(ushort OFF)
|
||||
expat_register_component(wchar_t OFF)
|
||||
elseif("@EXPAT_CHAR_TYPE@" STREQUAL "ushort")
|
||||
expat_register_component(char OFF)
|
||||
expat_register_component(ushort ON)
|
||||
expat_register_component(wchar_t OFF)
|
||||
elseif("@EXPAT_CHAR_TYPE@" STREQUAL "wchar_t")
|
||||
expat_register_component(char OFF)
|
||||
expat_register_component(ushort OFF)
|
||||
expat_register_component(wchar_t ON)
|
||||
endif()
|
||||
|
||||
check_required_components(expat)
|
||||
|
||||
|
||||
endif(NOT _expat_config_included)
|
||||
@@ -1,36 +0,0 @@
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2019 Expat development team
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
|
||||
|
||||
set(WIN32 ON)
|
||||
set(MINGW ON)
|
||||
-431
@@ -1,431 +0,0 @@
|
||||
dnl configuration script for expat
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl __ __ _
|
||||
dnl ___\ \/ /_ __ __ _| |_
|
||||
dnl / _ \\ /| '_ \ / _` | __|
|
||||
dnl | __// \| |_) | (_| | |_
|
||||
dnl \___/_/\_\ .__/ \__,_|\__|
|
||||
dnl |_| XML parser
|
||||
dnl
|
||||
dnl Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
dnl Copyright (c) 2001-2003 Greg Stein <gstein@users.sourceforge.net>
|
||||
dnl Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net>
|
||||
dnl Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
dnl Copyright (c) 2017 S. P. Zeidler <spz@netbsd.org>
|
||||
dnl Copyright (c) 2017 Stephen Groat <stephen@groat.us>
|
||||
dnl Copyright (c) 2017-2020 Joe Orton <jorton@redhat.com>
|
||||
dnl Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
dnl Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
|
||||
dnl Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it>
|
||||
dnl Copyright (c) 2018 KangLin <kl222@126.com>
|
||||
dnl Copyright (c) 2019 Mohammed Khajapasha <mohammed.khajapasha@intel.com>
|
||||
dnl Copyright (c) 2019 Kishore Kunche <kishore.kunche@intel.com>
|
||||
dnl Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
dnl Licensed under the MIT license:
|
||||
dnl
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining
|
||||
dnl a copy of this software and associated documentation files (the
|
||||
dnl "Software"), to deal in the Software without restriction, including
|
||||
dnl without limitation the rights to use, copy, modify, merge, publish,
|
||||
dnl distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
dnl persons to whom the Software is furnished to do so, subject to the
|
||||
dnl following conditions:
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice shall be included
|
||||
dnl in all copies or substantial portions of the Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
dnl USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
dnl Ensure that Expat is configured with autoconf 2.69 or newer.
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
dnl Get the version number of Expat, using m4's esyscmd() command to run
|
||||
dnl the command at m4-generation time. This allows us to create an m4
|
||||
dnl symbol holding the correct version number. AC_INIT requires the
|
||||
dnl version number at m4-time, rather than when ./configure is run, so
|
||||
dnl all this must happen as part of m4, not as part of the shell code
|
||||
dnl contained in ./configure.
|
||||
dnl
|
||||
dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate
|
||||
dnl test. I believe this test will work, but I don't have a place with non-
|
||||
dnl GNU M4 to test it right now.
|
||||
m4_define([expat_version],
|
||||
m4_ifdef([__gnu__],
|
||||
[esyscmd(conftools/get-version.sh lib/expat.h)],
|
||||
[2.2.x]))
|
||||
AC_INIT([expat], expat_version, [expat-bugs@libexpat.org])
|
||||
m4_undefine([expat_version])
|
||||
|
||||
AC_CONFIG_SRCDIR([Makefile.in])
|
||||
AC_CONFIG_AUX_DIR([conftools])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
|
||||
dnl
|
||||
dnl Increment LIBREVISION if source code has changed at all
|
||||
dnl
|
||||
dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
|
||||
dnl
|
||||
dnl If the API changes compatibly (i.e. simply adding a new function
|
||||
dnl without changing or removing earlier interfaces), then increment LIBAGE.
|
||||
dnl
|
||||
dnl If the API changes incompatibly set LIBAGE back to 0
|
||||
dnl
|
||||
|
||||
LIBCURRENT=9 # sync
|
||||
LIBREVISION=1 # with
|
||||
LIBAGE=8 # CMakeLists.txt!
|
||||
|
||||
AC_CONFIG_HEADERS([expat_config.h])
|
||||
|
||||
AM_PROG_AR
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
LT_PREREQ([2.4])
|
||||
LT_INIT([win32-dll])
|
||||
|
||||
AC_SUBST(LIBCURRENT)
|
||||
AC_SUBST(LIBREVISION)
|
||||
AC_SUBST(LIBAGE)
|
||||
|
||||
AC_LANG([C])
|
||||
AC_PROG_CC_C99
|
||||
|
||||
AS_IF([test "$GCC" = yes],
|
||||
[AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS])
|
||||
dnl Be careful about adding the -fexceptions option; some versions of
|
||||
dnl GCC don't support it and it causes extra warnings that are only
|
||||
dnl distracting; avoid.
|
||||
AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])])
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
AC_PROG_CXX
|
||||
|
||||
AS_IF([test "$GCC" = yes],
|
||||
[AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CXXFLAGS])
|
||||
dnl Be careful about adding the -fexceptions option; some versions of
|
||||
dnl GCC don't support it and it causes extra warnings that are only
|
||||
dnl distracting; avoid.
|
||||
AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CXXFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [AM_CXXFLAGS])])
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
AS_IF([test "$GCC" = yes],
|
||||
[AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[AM_LDFLAGS])])
|
||||
|
||||
dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
|
||||
AS_CASE(["$LD"],[*clang*],
|
||||
[AS_CASE(["${host_os}"],
|
||||
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
|
||||
|
||||
EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
|
||||
AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
|
||||
AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
|
||||
dnl We define BYTEORDER to 1234 when the platform is little endian; it
|
||||
dnl defines it to 4321 when the platform is big endian. We also define
|
||||
dnl WORDS_BIGENDIAN to 1 when the platform is big endian.
|
||||
dnl
|
||||
dnl A long time ago (early 2000 years) AC_C_BIGENDIAN was considered
|
||||
dnl wrong when cross compiling, now (2018, GNU Autoconf 2.69) we assume
|
||||
dnl it is fine.
|
||||
AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1)
|
||||
AS_VAR_SET([BYTEORDER], 4321)],
|
||||
[AS_VAR_SET([BYTEORDER], 1234)])
|
||||
AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN])
|
||||
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
AC_ARG_WITH([xmlwf],
|
||||
[AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])],
|
||||
[],
|
||||
[with_xmlwf=yes])
|
||||
AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
|
||||
|
||||
AC_ARG_WITH([examples],
|
||||
[AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])],
|
||||
[],
|
||||
[with_examples=yes])
|
||||
AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes])
|
||||
|
||||
AC_ARG_WITH([tests],
|
||||
[AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])],
|
||||
[],
|
||||
[with_tests=yes])
|
||||
AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes])
|
||||
|
||||
|
||||
AS_VAR_SET([EXPATCFG_ON_MINGW],[no])
|
||||
AS_CASE("${host_os}",
|
||||
[mingw*],
|
||||
[AS_VAR_SET([EXPATCFG_ON_MINGW],[yes])
|
||||
AC_MSG_NOTICE([detected OS: MinGW])])
|
||||
AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
|
||||
|
||||
dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac
|
||||
AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
|
||||
AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null])
|
||||
AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null])
|
||||
AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null])
|
||||
|
||||
|
||||
AC_ARG_WITH([libbsd],
|
||||
[AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])],
|
||||
[],
|
||||
[with_libbsd=no])
|
||||
AS_IF([test "x${with_libbsd}" != xno],
|
||||
[AC_CHECK_LIB([bsd],
|
||||
[arc4random_buf],
|
||||
[],
|
||||
[AS_IF([test "x${with_libbsd}" = xyes],
|
||||
[AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
|
||||
AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdlib.h> /* for arc4random_buf on BSD, for NULL */
|
||||
#if defined(HAVE_LIBBSD)
|
||||
# include <bsd/stdlib.h>
|
||||
#endif
|
||||
int main() {
|
||||
arc4random_buf(NULL, 0U);
|
||||
return 0;
|
||||
}
|
||||
])],
|
||||
[AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#if defined(HAVE_LIBBSD)
|
||||
# include <bsd/stdlib.h>
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
int main() {
|
||||
arc4random();
|
||||
return 0;
|
||||
}
|
||||
])],
|
||||
[AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])])
|
||||
|
||||
AC_ARG_WITH([getrandom],
|
||||
[AS_HELP_STRING([--with-getrandom],
|
||||
[enforce the use of getrandom function in the system @<:@default=check@:>@])
|
||||
AS_HELP_STRING([--without-getrandom],
|
||||
[skip auto detect of getrandom @<:@default=check@:>@])],
|
||||
[],
|
||||
[with_getrandom=check])
|
||||
|
||||
AS_IF([test "x$with_getrandom" != xno],
|
||||
[AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdlib.h> /* for NULL */
|
||||
#include <sys/random.h>
|
||||
int main() {
|
||||
return getrandom(NULL, 0U, 0U);
|
||||
}
|
||||
])],
|
||||
[AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test "x$with_getrandom" = xyes],
|
||||
[AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])])
|
||||
|
||||
AC_ARG_WITH([sys_getrandom],
|
||||
[AS_HELP_STRING([--with-sys-getrandom],
|
||||
[enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@])
|
||||
AS_HELP_STRING([--without-sys-getrandom],
|
||||
[skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])],
|
||||
[],
|
||||
[with_sys_getrandom=check])
|
||||
|
||||
AS_IF([test "x$with_sys_getrandom" != xno],
|
||||
[AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdlib.h> /* for NULL */
|
||||
#include <unistd.h> /* for syscall */
|
||||
#include <sys/syscall.h> /* for SYS_getrandom */
|
||||
int main() {
|
||||
syscall(SYS_getrandom, NULL, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
])],
|
||||
[AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test "x$with_sys_getrandom" = xyes],
|
||||
[AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])])
|
||||
|
||||
dnl Only needed for xmlwf:
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h)
|
||||
AC_TYPE_OFF_T
|
||||
AC_FUNC_MMAP
|
||||
|
||||
AS_IF([test "$ac_cv_func_mmap_fixed_mapped" = "yes"],
|
||||
[AS_VAR_SET(FILEMAP,unixfilemap)],
|
||||
[AS_VAR_SET(FILEMAP,readfilemap)])
|
||||
AC_SUBST(FILEMAP)
|
||||
|
||||
|
||||
dnl Some basic configuration:
|
||||
AC_DEFINE([XML_NS], 1,
|
||||
[Define to make XML Namespaces functionality available.])
|
||||
AC_DEFINE([XML_DTD], 1,
|
||||
[Define to make parameter entity parsing functionality available.])
|
||||
AC_DEFINE([XML_DEV_URANDOM], 1,
|
||||
[Define to include code reading entropy from `/dev/urandom'.])
|
||||
|
||||
AC_ARG_ENABLE([xml-attr-info],
|
||||
[AS_HELP_STRING([--enable-xml-attr-info],
|
||||
[Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])],
|
||||
[],
|
||||
[enable_xml_attr_info=no])
|
||||
AS_IF([test "x${enable_xml_attr_info}" = "xyes"],
|
||||
[AC_DEFINE([XML_ATTR_INFO], 1,
|
||||
[Define to allow retrieving the byte offsets for attribute names and values.])])
|
||||
|
||||
AC_ARG_ENABLE([xml-context],
|
||||
AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@],
|
||||
[Retain context around the current parse point;
|
||||
default is enabled and a size of 1024 bytes])
|
||||
AS_HELP_STRING([--disable-xml-context],
|
||||
[Do not retain context around the current parse point]),
|
||||
[enable_xml_context=${enableval}])
|
||||
AS_IF([test "x${enable_xml_context}" != "xno"],
|
||||
[AS_IF([test "x${enable_xml_context}" = "xyes" \
|
||||
-o "x${enable_xml_context}" = "x"],
|
||||
[AS_VAR_SET(enable_xml_context,1024)])
|
||||
AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}],
|
||||
[Define to specify how much context to retain around the current parse point.])])
|
||||
|
||||
AC_ARG_WITH([docbook],
|
||||
[AS_HELP_STRING([--with-docbook],
|
||||
[enforce XML to man page compilation @<:@default=check@:>@])
|
||||
AS_HELP_STRING([--without-docbook],
|
||||
[skip XML to man page compilation @<:@default=check@:>@])],
|
||||
[],
|
||||
[with_docbook=check])
|
||||
|
||||
AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command])
|
||||
AS_IF([test "x$with_docbook" != xno],
|
||||
[AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man db2x_docbook2man docbook2man docbook-to-man])])
|
||||
AS_IF([test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes],
|
||||
[AC_MSG_ERROR([Required program 'docbook2x-man' not found.])])
|
||||
AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno],
|
||||
[AS_IF([${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase],
|
||||
[AC_MSG_ERROR([Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather
|
||||
than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point
|
||||
configure to command docbook2x-man of docbook2X.
|
||||
Or use DOCBOOK_TO_MAN="xmlto man --skip-validation" if you have xmlto around.
|
||||
You can also configure using --without-docbook if you can do without a man
|
||||
page for xmlwf.])])])
|
||||
|
||||
AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])
|
||||
|
||||
|
||||
dnl Configure CMake file templates
|
||||
dnl NOTE: The *_TRUE variables read here are Automake conditionals
|
||||
dnl that are either set to "" when enabled or to "#" when disabled
|
||||
dnl (because they are used to dynamically comment out certain things)
|
||||
AS_IF([test "x${enable_xml_attr_info}" = xyes],
|
||||
[EXPAT_ATTR_INFO=ON],
|
||||
[EXPAT_ATTR_INFO=OFF])
|
||||
EXPAT_DTD=ON
|
||||
AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x],
|
||||
[EXPAT_LARGE_SIZE=ON],
|
||||
[EXPAT_LARGE_SIZE=OFF])
|
||||
AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x],
|
||||
[EXPAT_MIN_SIZE=ON],
|
||||
[EXPAT_MIN_SIZE=OFF])
|
||||
EXPAT_NS=ON
|
||||
AS_IF([test "x${enable_xml_context}" != xno],
|
||||
[EXPAT_CONTEXT_BYTES=${enable_xml_context}],
|
||||
[EXPAT_CONTEXT_BYTES=OFF])
|
||||
AS_IF([test "x${UNICODE_TRUE}" = x],
|
||||
[AS_IF(
|
||||
[test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x],
|
||||
[EXPAT_CHAR_TYPE=wchar_t],
|
||||
[EXPAT_CHAR_TYPE=ushort])],
|
||||
[EXPAT_CHAR_TYPE=char])
|
||||
PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
|
||||
LIBDIR_BASENAME="$(basename "${libdir}")"
|
||||
SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
|
||||
SO_MINOR="${LIBAGE}"
|
||||
SO_PATCH="${LIBREVISION}"
|
||||
AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p
|
||||
AC_SUBST([EXPAT_ATTR_INFO])
|
||||
AC_SUBST([EXPAT_DTD])
|
||||
AC_SUBST([EXPAT_LARGE_SIZE])
|
||||
AC_SUBST([EXPAT_MIN_SIZE])
|
||||
AC_SUBST([EXPAT_NS])
|
||||
AC_SUBST([EXPAT_CONTEXT_BYTES])
|
||||
AC_SUBST([EXPAT_CHAR_TYPE])
|
||||
AC_SUBST_FILE([PACKAGE_INIT])
|
||||
AC_SUBST([LIBDIR_BASENAME])
|
||||
AC_SUBST([SO_MAJOR])
|
||||
AC_SUBST([SO_MINOR])
|
||||
AC_SUBST([SO_PATCH])
|
||||
AC_SUBST([ac_cv_sizeof_void_p])
|
||||
|
||||
|
||||
dnl write the Automake flags we set
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
AC_SUBST([AM_LDFLAGS])
|
||||
|
||||
dnl updating _EXPAT_OUTPUT_NAME variable to effect the package name in expat.pc file (issue #361)
|
||||
AC_SUBST(_EXPAT_OUTPUT_NAME, ["$PACKAGE_NAME"])
|
||||
|
||||
AS_CASE("${host_os}",
|
||||
[darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
|
||||
[mingw*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
|
||||
[CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
|
||||
AC_CONFIG_FILES([Makefile]
|
||||
[expat.pc]
|
||||
[cmake/expat-config.cmake]
|
||||
[cmake/autotools/expat-config-version.cmake]
|
||||
[cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}]
|
||||
[doc/Makefile]
|
||||
[examples/Makefile]
|
||||
[lib/Makefile]
|
||||
[tests/Makefile]
|
||||
[tests/benchmark/Makefile]
|
||||
[xmlwf/Makefile])
|
||||
AC_CONFIG_FILES([run.sh], [chmod +x run.sh])
|
||||
AC_OUTPUT
|
||||
|
||||
|
||||
AC_MSG_NOTICE([
|
||||
|
||||
Automake flags (can be overridden by user flags):
|
||||
[AM_CPPFLAGS]: ${AM_CPPFLAGS}
|
||||
[AM_CFLAGS]: ${AM_CFLAGS}
|
||||
[AM_CXXFLAGS]: ${AM_CXXFLAGS}
|
||||
[AM_LDFLAGS]: ${AM_LDFLAGS}
|
||||
|
||||
User flags (override Automake flags on conflict):
|
||||
CPPFLAGS: ${CPPFLAGS}
|
||||
CFLAGS: ${CFLAGS}
|
||||
CXXFLAGS: ${CXXFLAGS}
|
||||
LDFLAGS: ${LDFLAGS}])
|
||||
@@ -1,61 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
|
||||
# Copyright (c) 2017 Joe Orton <jorton@redhat.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
.PHONY: dist-hook # not inside conditional to avoid automake warning
|
||||
|
||||
if WITH_DOCBOOK
|
||||
dist_man_MANS = xmlwf.1
|
||||
|
||||
xmlwf.1: xmlwf.xml
|
||||
-rm -f $@
|
||||
$(DOCBOOK_TO_MAN) $<
|
||||
test -f $@ || mv XMLWF.1 $@
|
||||
else
|
||||
dist-hook:
|
||||
@echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
|
||||
@false
|
||||
endif
|
||||
|
||||
# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
|
||||
.PHONY: clean-local
|
||||
clean-local: clean-local-check
|
||||
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
$(RM) xmlwf.1
|
||||
|
||||
EXTRA_DIST = \
|
||||
ok.min.css \
|
||||
reference.html \
|
||||
style.css \
|
||||
valid-xhtml10.png \
|
||||
xmlwf.xml
|
||||
-616
@@ -1,616 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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@
|
||||
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2017 Stephen Groat <stephen@groat.us>
|
||||
# Copyright (c) 2017 Joe Orton <jorton@redhat.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
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 = doc
|
||||
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)/conftools/ax-require-defined.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-compile-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-link-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
|
||||
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.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)/expat_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 =
|
||||
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; }; \
|
||||
}
|
||||
man1dir = $(mandir)/man1
|
||||
am__installdirs = "$(DESTDIR)$(man1dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(dist_man_MANS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
|
||||
EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
|
||||
EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
|
||||
EXPAT_DTD = @EXPAT_DTD@
|
||||
EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
|
||||
EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
|
||||
EXPAT_NS = @EXPAT_NS@
|
||||
FGREP = @FGREP@
|
||||
FILEMAP = @FILEMAP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAGE = @LIBAGE@
|
||||
LIBCURRENT = @LIBCURRENT@
|
||||
LIBDIR_BASENAME = @LIBDIR_BASENAME@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBREVISION = @LIBREVISION@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SO_MAJOR = @SO_MAJOR@
|
||||
SO_MINOR = @SO_MINOR@
|
||||
SO_PATCH = @SO_PATCH@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
|
||||
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_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
|
||||
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@
|
||||
runstatedir = @runstatedir@
|
||||
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@
|
||||
@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1
|
||||
EXTRA_DIST = \
|
||||
ok.min.css \
|
||||
reference.html \
|
||||
style.css \
|
||||
valid-xhtml10.png \
|
||||
xmlwf.xml
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(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 doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(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
|
||||
install-man1: $(dist_man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list1=''; \
|
||||
list2='$(dist_man_MANS)'; \
|
||||
test -n "$(man1dir)" \
|
||||
&& test -n "`echo $$list1$$list2`" \
|
||||
|| exit 0; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
|
||||
{ for i in $$list1; do echo "$$i"; done; \
|
||||
if test -n "$$list2"; then \
|
||||
for i in $$list2; do echo "$$i"; done \
|
||||
| sed -n '/\.1[a-z]*$$/p'; \
|
||||
fi; \
|
||||
} | while read p; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; echo "$$p"; \
|
||||
done | \
|
||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
||||
sed 'N;N;s,\n, ,g' | { \
|
||||
list=; while read file base inst; do \
|
||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
|
||||
fi; \
|
||||
done; \
|
||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
|
||||
done; }
|
||||
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list=''; test -n "$(man1dir)" || exit 0; \
|
||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
||||
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
|
||||
sed -n '/\.1[a-z]*$$/p'; \
|
||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
@WITH_DOCBOOK_TRUE@dist-hook:
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(MANS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(man1dir)"; 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 clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
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-man1
|
||||
|
||||
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-man
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
clean-local cscopelist-am ctags-am dist-hook distclean \
|
||||
distclean-generic distclean-libtool 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-man1 install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-man uninstall-man1
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
.PHONY: dist-hook # not inside conditional to avoid automake warning
|
||||
|
||||
@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml
|
||||
@WITH_DOCBOOK_TRUE@ -rm -f $@
|
||||
@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $<
|
||||
@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@
|
||||
@WITH_DOCBOOK_FALSE@dist-hook:
|
||||
@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
|
||||
@WITH_DOCBOOK_FALSE@ @false
|
||||
|
||||
# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
|
||||
.PHONY: clean-local
|
||||
clean-local: clean-local-check
|
||||
|
||||
.PHONY: clean-local-check
|
||||
clean-local-check:
|
||||
$(RM) xmlwf.1
|
||||
|
||||
# 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:
|
||||
Vendored
-2
File diff suppressed because one or more lines are too long
-2594
File diff suppressed because it is too large
Load Diff
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
/* Stop not using half the screen */
|
||||
body {
|
||||
max-width: none; /* was: 80ch */
|
||||
}
|
||||
|
||||
.cpp-symbols dt {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* Resemble style of <footer> which is not part of xhtml1-strict */
|
||||
.footer {
|
||||
font-size: var(--ok-fs-5);
|
||||
color: var(--ok-tc-1);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
-324
@@ -1,324 +0,0 @@
|
||||
'\" -*- coding: us-ascii -*-
|
||||
.if \n(.g .ds T< \\FC
|
||||
.if \n(.g .ds T> \\F[\n[.fam]]
|
||||
.de URL
|
||||
\\$2 \(la\\$1\(ra\\$3
|
||||
..
|
||||
.if \n(.g .mso www.tmac
|
||||
.TH XMLWF 1 "May 23, 2021" "" ""
|
||||
.SH NAME
|
||||
xmlwf \- Determines if an XML document is well-formed
|
||||
.SH SYNOPSIS
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBxmlwf\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
[\fIOPTIONS\fR] [\fIFILE\fR ...]
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBxmlwf\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
\fB-h\fR
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBxmlwf\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
\fB-v\fR
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
.SH DESCRIPTION
|
||||
\fBxmlwf\fR uses the Expat library to
|
||||
determine if an XML document is well-formed. It is
|
||||
non-validating.
|
||||
.PP
|
||||
If you do not specify any files on the command-line, and you
|
||||
have a recent version of \fBxmlwf\fR, the
|
||||
input file will be read from standard input.
|
||||
.SH "WELL-FORMED DOCUMENTS"
|
||||
A well-formed document must adhere to the
|
||||
following rules:
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
The file begins with an XML declaration. For instance,
|
||||
\*(T<<?xml version="1.0" standalone="yes"?>\*(T>.
|
||||
\fINOTE\fR:
|
||||
\fBxmlwf\fR does not currently
|
||||
check for a valid XML declaration.
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
Every start tag is either empty (<tag/>)
|
||||
or has a corresponding end tag.
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
There is exactly one root element. This element must contain
|
||||
all other elements in the document. Only comments, white
|
||||
space, and processing instructions may come after the close
|
||||
of the root element.
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
All elements nest properly.
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
All attribute values are enclosed in quotes (either single
|
||||
or double).
|
||||
.PP
|
||||
If the document has a DTD, and it strictly complies with that
|
||||
DTD, then the document is also considered \fIvalid\fR.
|
||||
\fBxmlwf\fR is a non-validating parser --
|
||||
it does not check the DTD. However, it does support
|
||||
external entities (see the \*(T<\fB\-x\fR\*(T> option).
|
||||
.SH OPTIONS
|
||||
When an option includes an argument, you may specify the argument either
|
||||
separately ("\*(T<\fB\-d\fR\*(T> \fIoutput\fR") or concatenated with the
|
||||
option ("\*(T<\fB\-d\fR\*(T>\fIoutput\fR"). \fBxmlwf\fR
|
||||
supports both.
|
||||
.TP
|
||||
\*(T<\fB\-a\fR\*(T> \fIfactor\fR
|
||||
Sets the maximum tolerated amplification factor
|
||||
for protection against billion laughs attacks (default: 100.0).
|
||||
The amplification factor is calculated as ..
|
||||
|
||||
.nf
|
||||
|
||||
amplification := (direct + indirect) / direct
|
||||
|
||||
.fi
|
||||
|
||||
\&.. while parsing, whereas
|
||||
<direct> is the number of bytes read
|
||||
from the primary document in parsing and
|
||||
<indirect> is the number of bytes
|
||||
added by expanding entities and reading of external DTD files,
|
||||
combined.
|
||||
|
||||
\fINOTE\fR:
|
||||
If you ever need to increase this value for non-attack payload,
|
||||
please file a bug report.
|
||||
.TP
|
||||
\*(T<\fB\-b\fR\*(T> \fIbytes\fR
|
||||
Sets the number of output bytes (including amplification)
|
||||
needed to activate protection against billion laughs attacks
|
||||
(default: 8 MiB).
|
||||
This can be thought of as an "activation threshold".
|
||||
|
||||
\fINOTE\fR:
|
||||
If you ever need to increase this value for non-attack payload,
|
||||
please file a bug report.
|
||||
.TP
|
||||
\*(T<\fB\-c\fR\*(T>
|
||||
If the input file is well-formed and \fBxmlwf\fR
|
||||
doesn't encounter any errors, the input file is simply copied to
|
||||
the output directory unchanged.
|
||||
This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
|
||||
requires \*(T<\fB\-d\fR\*(T> to specify an output directory.
|
||||
.TP
|
||||
\*(T<\fB\-d\fR\*(T> \fIoutput-dir\fR
|
||||
Specifies a directory to contain transformed
|
||||
representations of the input files.
|
||||
By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
|
||||
(described below).
|
||||
You can select different output formats using \*(T<\fB\-c\fR\*(T>,
|
||||
\*(T<\fB\-m\fR\*(T> and \*(T<\fB\-N\fR\*(T>.
|
||||
|
||||
The output filenames will
|
||||
be exactly the same as the input filenames or "STDIN" if the input is
|
||||
coming from standard input. Therefore, you must be careful that the
|
||||
output file does not go into the same directory as the input
|
||||
file. Otherwise, \fBxmlwf\fR will delete the
|
||||
input file before it generates the output file (just like running
|
||||
\*(T<cat < file > file\*(T> in most shells).
|
||||
|
||||
Two structurally equivalent XML documents have a byte-for-byte
|
||||
identical canonical XML representation.
|
||||
Note that ignorable white space is considered significant and
|
||||
is treated equivalently to data.
|
||||
More on canonical XML can be found at
|
||||
http://www.jclark.com/xml/canonxml.html .
|
||||
.TP
|
||||
\*(T<\fB\-e\fR\*(T> \fIencoding\fR
|
||||
Specifies the character encoding for the document, overriding
|
||||
any document encoding declaration. \fBxmlwf\fR
|
||||
supports four built-in encodings:
|
||||
\*(T<US\-ASCII\*(T>,
|
||||
\*(T<UTF\-8\*(T>,
|
||||
\*(T<UTF\-16\*(T>, and
|
||||
\*(T<ISO\-8859\-1\*(T>.
|
||||
Also see the \*(T<\fB\-w\fR\*(T> option.
|
||||
.TP
|
||||
\*(T<\fB\-k\fR\*(T>
|
||||
When processing multiple files, \fBxmlwf\fR
|
||||
by default halts after the the first file with an error.
|
||||
This tells \fBxmlwf\fR to report the error
|
||||
but to keep processing.
|
||||
This can be useful, for example, when testing a filter that converts
|
||||
many files to XML and you want to quickly find out which conversions
|
||||
failed.
|
||||
.TP
|
||||
\*(T<\fB\-m\fR\*(T>
|
||||
Outputs some strange sort of XML file that completely
|
||||
describes the input file, including character positions.
|
||||
Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
|
||||
.TP
|
||||
\*(T<\fB\-n\fR\*(T>
|
||||
Turns on namespace processing. (describe namespaces)
|
||||
\*(T<\fB\-c\fR\*(T> disables namespaces.
|
||||
.TP
|
||||
\*(T<\fB\-N\fR\*(T>
|
||||
Adds a doctype and notation declarations to canonical XML output.
|
||||
This matches the example output used by the formal XML test cases.
|
||||
Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
|
||||
.TP
|
||||
\*(T<\fB\-p\fR\*(T>
|
||||
Tells \fBxmlwf\fR to process external DTDs and parameter
|
||||
entities.
|
||||
|
||||
Normally \fBxmlwf\fR never parses parameter
|
||||
entities. \*(T<\fB\-p\fR\*(T> tells it to always parse them.
|
||||
\*(T<\fB\-p\fR\*(T> implies \*(T<\fB\-x\fR\*(T>.
|
||||
.TP
|
||||
\*(T<\fB\-r\fR\*(T>
|
||||
Normally \fBxmlwf\fR memory-maps the XML file
|
||||
before parsing; this can result in faster parsing on many
|
||||
platforms.
|
||||
\*(T<\fB\-r\fR\*(T> turns off memory-mapping and uses normal file
|
||||
IO calls instead.
|
||||
Of course, memory-mapping is automatically turned off
|
||||
when reading from standard input.
|
||||
|
||||
Use of memory-mapping can cause some platforms to report
|
||||
substantially higher memory usage for
|
||||
\fBxmlwf\fR, but this appears to be a matter of
|
||||
the operating system reporting memory in a strange way; there is
|
||||
not a leak in \fBxmlwf\fR.
|
||||
.TP
|
||||
\*(T<\fB\-s\fR\*(T>
|
||||
Prints an error if the document is not standalone.
|
||||
A document is standalone if it has no external subset and no
|
||||
references to parameter entities.
|
||||
.TP
|
||||
\*(T<\fB\-t\fR\*(T>
|
||||
Turns on timings. This tells Expat to parse the entire file,
|
||||
but not perform any processing.
|
||||
This gives a fairly accurate idea of the raw speed of Expat itself
|
||||
without client overhead.
|
||||
\*(T<\fB\-t\fR\*(T> turns off most of the output options
|
||||
(\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-m\fR\*(T>, \*(T<\fB\-c\fR\*(T>, ...).
|
||||
.TP
|
||||
\*(T<\fB\-v\fR\*(T>
|
||||
Prints the version of the Expat library being used, including some
|
||||
information on the compile-time configuration of the library, and
|
||||
then exits.
|
||||
.TP
|
||||
\*(T<\fB\-w\fR\*(T>
|
||||
Enables support for Windows code pages.
|
||||
Normally, \fBxmlwf\fR will throw an error if it
|
||||
runs across an encoding that it is not equipped to handle itself. With
|
||||
\*(T<\fB\-w\fR\*(T>, \fBxmlwf\fR will try to use a Windows code
|
||||
page. See also \*(T<\fB\-e\fR\*(T>.
|
||||
.TP
|
||||
\*(T<\fB\-x\fR\*(T>
|
||||
Turns on parsing external entities.
|
||||
|
||||
Non-validating parsers are not required to resolve external
|
||||
entities, or even expand entities at all.
|
||||
Expat always expands internal entities (?),
|
||||
but external entity parsing must be enabled explicitly.
|
||||
|
||||
External entities are simply entities that obtain their
|
||||
data from outside the XML file currently being parsed.
|
||||
|
||||
This is an example of an internal entity:
|
||||
|
||||
.nf
|
||||
|
||||
<!ENTITY vers '1.0.2'>
|
||||
.fi
|
||||
|
||||
And here are some examples of external entities:
|
||||
|
||||
.nf
|
||||
|
||||
<!ENTITY header SYSTEM "header\-&vers;.xml"> (parsed)
|
||||
<!ENTITY logo SYSTEM "logo.png" PNG> (unparsed)
|
||||
.fi
|
||||
.TP
|
||||
\*(T<\fB\-\-\fR\*(T>
|
||||
(Two hyphens.)
|
||||
Terminates the list of options. This is only needed if a filename
|
||||
starts with a hyphen. For example:
|
||||
|
||||
.nf
|
||||
|
||||
xmlwf \-\- \-myfile.xml
|
||||
.fi
|
||||
|
||||
will run \fBxmlwf\fR on the file
|
||||
\*(T<\fI\-myfile.xml\fR\*(T>.
|
||||
.PP
|
||||
Older versions of \fBxmlwf\fR do not support
|
||||
reading from standard input.
|
||||
.SH OUTPUT
|
||||
\fBxmlwf\fR outputs nothing for files which are problem-free.
|
||||
If any input file is not well-formed, or if the output for any
|
||||
input file cannot be opened, \fBxmlwf\fR prints a single
|
||||
line describing the problem to standard output.
|
||||
.PP
|
||||
If the \*(T<\fB\-k\fR\*(T> option is not provided, \fBxmlwf\fR
|
||||
halts upon encountering a well-formedness or output-file error.
|
||||
If \*(T<\fB\-k\fR\*(T> is provided, \fBxmlwf\fR continues
|
||||
processing the remaining input files, describing problems found with any of them.
|
||||
.SH "EXIT STATUS"
|
||||
For option \*(T<\fB\-v\fR\*(T> or \*(T<\fB\-h\fR\*(T>, \fBxmlwf\fR always exits with status code 0. For other cases, the following exit status codes are returned:
|
||||
.TP
|
||||
\*(T<\fB0\fR\*(T>
|
||||
The input files are well-formed and the output (if requested) was written successfully.
|
||||
.TP
|
||||
\*(T<\fB1\fR\*(T>
|
||||
An internal error occurred.
|
||||
.TP
|
||||
\*(T<\fB2\fR\*(T>
|
||||
One or more input files were not well-formed or could not be parsed.
|
||||
.TP
|
||||
\*(T<\fB3\fR\*(T>
|
||||
If using the \*(T<\fB\-d\fR\*(T> option, an error occurred opening an output file.
|
||||
.TP
|
||||
\*(T<\fB4\fR\*(T>
|
||||
There was a command-line argument error in how \fBxmlwf\fR was invoked.
|
||||
.SH BUGS
|
||||
The errors should go to standard error, not standard output.
|
||||
.PP
|
||||
There should be a way to get \*(T<\fB\-d\fR\*(T> to send its
|
||||
output to standard output rather than forcing the user to send
|
||||
it to a file.
|
||||
.PP
|
||||
I have no idea why anyone would want to use the
|
||||
\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
|
||||
\*(T<\fB\-m\fR\*(T> options. If someone could explain it to
|
||||
me, I'd like to add this information to this manpage.
|
||||
.SH "SEE ALSO"
|
||||
.nf
|
||||
|
||||
The Expat home page: https://libexpat.github.io/
|
||||
The W3 XML 1.0 specification (fourth edition): https://www.w3.org/TR/2006/REC\-xml\-20060816/
|
||||
Billion laughs attack: https://en.wikipedia.org/wiki/Billion_laughs_attack
|
||||
.fi
|
||||
.SH AUTHOR
|
||||
This manual page was originally written by Scott Bronson <\*(T<bronson@rinspin.com\*(T>>
|
||||
in December 2001 for
|
||||
the Debian GNU/Linux system (but may be used by others). Permission is
|
||||
granted to copy, distribute and/or modify this document under
|
||||
the terms of the GNU Free Documentation
|
||||
License, Version 1.1.
|
||||
-538
@@ -1,538 +0,0 @@
|
||||
<!--
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2001 Scott Bronson <bronson@rinspin.com>
|
||||
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2009 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016 Ardo van Rangelrooij <ardo@debian.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2020 Joe Orton <jorton@redhat.com>
|
||||
Copyright (c) 2021 Tim Bray <tbray@textuality.com>
|
||||
Unlike most of Expat,
|
||||
this file is copyrighted under the GNU Free Documentation License 1.1.
|
||||
-->
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
|
||||
<!ENTITY dhfirstname "<firstname>Scott</firstname>">
|
||||
<!ENTITY dhsurname "<surname>Bronson</surname>">
|
||||
<!-- Please adjust the date whenever revising the manpage. -->
|
||||
<!ENTITY dhdate "<date>May 23, 2021</date>">
|
||||
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
|
||||
<!ENTITY dhemail "<email>bronson@rinspin.com</email>">
|
||||
<!ENTITY dhusername "Scott Bronson">
|
||||
<!ENTITY dhucpackage "<refentrytitle>XMLWF</refentrytitle>">
|
||||
<!ENTITY dhpackage "xmlwf">
|
||||
|
||||
<!ENTITY debian "<productname>Debian GNU/Linux</productname>">
|
||||
<!ENTITY gnu "<acronym>GNU</acronym>">
|
||||
]>
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<address>
|
||||
&dhemail;
|
||||
</address>
|
||||
<author>
|
||||
&dhfirstname;
|
||||
&dhsurname;
|
||||
</author>
|
||||
<copyright>
|
||||
<year>2001</year>
|
||||
<holder>&dhusername;</holder>
|
||||
</copyright>
|
||||
&dhdate;
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
&dhucpackage;
|
||||
|
||||
&dhsection;
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>&dhpackage;</refname>
|
||||
|
||||
<refpurpose>Determines if an XML document is well-formed</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>&dhpackage;</command>
|
||||
<arg><replaceable>OPTIONS</replaceable></arg>
|
||||
<arg><replaceable>FILE</replaceable> ...</arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>&dhpackage;</command>
|
||||
<arg choice="plain"><option>-h</option></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>&dhpackage;</command>
|
||||
<arg choice="plain"><option>-v</option></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
|
||||
<para>
|
||||
<command>&dhpackage;</command> uses the Expat library to
|
||||
determine if an XML document is well-formed. It is
|
||||
non-validating.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you do not specify any files on the command-line, and you
|
||||
have a recent version of <command>&dhpackage;</command>, the
|
||||
input file will be read from standard input.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>WELL-FORMED DOCUMENTS</title>
|
||||
|
||||
<para>
|
||||
A well-formed document must adhere to the
|
||||
following rules:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
The file begins with an XML declaration. For instance,
|
||||
<literal><?xml version="1.0" standalone="yes"?></literal>.
|
||||
<emphasis>NOTE</emphasis>:
|
||||
<command>&dhpackage;</command> does not currently
|
||||
check for a valid XML declaration.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Every start tag is either empty (<tag/>)
|
||||
or has a corresponding end tag.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
There is exactly one root element. This element must contain
|
||||
all other elements in the document. Only comments, white
|
||||
space, and processing instructions may come after the close
|
||||
of the root element.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
All elements nest properly.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
All attribute values are enclosed in quotes (either single
|
||||
or double).
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
If the document has a DTD, and it strictly complies with that
|
||||
DTD, then the document is also considered <emphasis>valid</emphasis>.
|
||||
<command>&dhpackage;</command> is a non-validating parser --
|
||||
it does not check the DTD. However, it does support
|
||||
external entities (see the <option>-x</option> option).
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>OPTIONS</title>
|
||||
|
||||
<para>
|
||||
When an option includes an argument, you may specify the argument either
|
||||
separately ("<option>-d</option> <replaceable>output</replaceable>") or concatenated with the
|
||||
option ("<option>-d</option><replaceable>output</replaceable>"). <command>&dhpackage;</command>
|
||||
supports both.
|
||||
</para>
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-a</option> <replaceable>factor</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets the maximum tolerated amplification factor
|
||||
for protection against billion laughs attacks (default: 100.0).
|
||||
The amplification factor is calculated as ..
|
||||
</para>
|
||||
<literallayout>
|
||||
amplification := (direct + indirect) / direct
|
||||
</literallayout>
|
||||
<para>
|
||||
.. while parsing, whereas
|
||||
<direct> is the number of bytes read
|
||||
from the primary document in parsing and
|
||||
<indirect> is the number of bytes
|
||||
added by expanding entities and reading of external DTD files,
|
||||
combined.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>NOTE</emphasis>:
|
||||
If you ever need to increase this value for non-attack payload,
|
||||
please file a bug report.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-b</option> <replaceable>bytes</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets the number of output bytes (including amplification)
|
||||
needed to activate protection against billion laughs attacks
|
||||
(default: 8 MiB).
|
||||
This can be thought of as an "activation threshold".
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>NOTE</emphasis>:
|
||||
If you ever need to increase this value for non-attack payload,
|
||||
please file a bug report.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-c</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If the input file is well-formed and <command>&dhpackage;</command>
|
||||
doesn't encounter any errors, the input file is simply copied to
|
||||
the output directory unchanged.
|
||||
This implies no namespaces (turns off <option>-n</option>) and
|
||||
requires <option>-d</option> to specify an output directory.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-d</option> <replaceable>output-dir</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies a directory to contain transformed
|
||||
representations of the input files.
|
||||
By default, <option>-d</option> outputs a canonical representation
|
||||
(described below).
|
||||
You can select different output formats using <option>-c</option>,
|
||||
<option>-m</option> and <option>-N</option>.
|
||||
</para>
|
||||
<para>
|
||||
The output filenames will
|
||||
be exactly the same as the input filenames or "STDIN" if the input is
|
||||
coming from standard input. Therefore, you must be careful that the
|
||||
output file does not go into the same directory as the input
|
||||
file. Otherwise, <command>&dhpackage;</command> will delete the
|
||||
input file before it generates the output file (just like running
|
||||
<literal>cat < file > file</literal> in most shells).
|
||||
</para>
|
||||
<para>
|
||||
Two structurally equivalent XML documents have a byte-for-byte
|
||||
identical canonical XML representation.
|
||||
Note that ignorable white space is considered significant and
|
||||
is treated equivalently to data.
|
||||
More on canonical XML can be found at
|
||||
http://www.jclark.com/xml/canonxml.html .
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-e</option> <replaceable>encoding</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the character encoding for the document, overriding
|
||||
any document encoding declaration. <command>&dhpackage;</command>
|
||||
supports four built-in encodings:
|
||||
<literal>US-ASCII</literal>,
|
||||
<literal>UTF-8</literal>,
|
||||
<literal>UTF-16</literal>, and
|
||||
<literal>ISO-8859-1</literal>.
|
||||
Also see the <option>-w</option> option.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-k</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When processing multiple files, <command>&dhpackage;</command>
|
||||
by default halts after the the first file with an error.
|
||||
This tells <command>&dhpackage;</command> to report the error
|
||||
but to keep processing.
|
||||
This can be useful, for example, when testing a filter that converts
|
||||
many files to XML and you want to quickly find out which conversions
|
||||
failed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-m</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Outputs some strange sort of XML file that completely
|
||||
describes the input file, including character positions.
|
||||
Requires <option>-d</option> to specify an output file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-n</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns on namespace processing. (describe namespaces)
|
||||
<option>-c</option> disables namespaces.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-N</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Adds a doctype and notation declarations to canonical XML output.
|
||||
This matches the example output used by the formal XML test cases.
|
||||
Requires <option>-d</option> to specify an output file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-p</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Tells <command>&dhpackage;</command> to process external DTDs and parameter
|
||||
entities.
|
||||
</para>
|
||||
<para>
|
||||
Normally <command>&dhpackage;</command> never parses parameter
|
||||
entities. <option>-p</option> tells it to always parse them.
|
||||
<option>-p</option> implies <option>-x</option>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-r</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Normally <command>&dhpackage;</command> memory-maps the XML file
|
||||
before parsing; this can result in faster parsing on many
|
||||
platforms.
|
||||
<option>-r</option> turns off memory-mapping and uses normal file
|
||||
IO calls instead.
|
||||
Of course, memory-mapping is automatically turned off
|
||||
when reading from standard input.
|
||||
</para>
|
||||
<para>
|
||||
Use of memory-mapping can cause some platforms to report
|
||||
substantially higher memory usage for
|
||||
<command>&dhpackage;</command>, but this appears to be a matter of
|
||||
the operating system reporting memory in a strange way; there is
|
||||
not a leak in <command>&dhpackage;</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-s</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prints an error if the document is not standalone.
|
||||
A document is standalone if it has no external subset and no
|
||||
references to parameter entities.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-t</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns on timings. This tells Expat to parse the entire file,
|
||||
but not perform any processing.
|
||||
This gives a fairly accurate idea of the raw speed of Expat itself
|
||||
without client overhead.
|
||||
<option>-t</option> turns off most of the output options
|
||||
(<option>-d</option>, <option>-m</option>, <option>-c</option>, ...).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-v</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prints the version of the Expat library being used, including some
|
||||
information on the compile-time configuration of the library, and
|
||||
then exits.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-w</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Enables support for Windows code pages.
|
||||
Normally, <command>&dhpackage;</command> will throw an error if it
|
||||
runs across an encoding that it is not equipped to handle itself. With
|
||||
<option>-w</option>, <command>&dhpackage;</command> will try to use a Windows code
|
||||
page. See also <option>-e</option>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-x</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns on parsing external entities.
|
||||
</para>
|
||||
<para>
|
||||
Non-validating parsers are not required to resolve external
|
||||
entities, or even expand entities at all.
|
||||
Expat always expands internal entities (?),
|
||||
but external entity parsing must be enabled explicitly.
|
||||
</para>
|
||||
<para>
|
||||
External entities are simply entities that obtain their
|
||||
data from outside the XML file currently being parsed.
|
||||
</para>
|
||||
<para>
|
||||
This is an example of an internal entity:
|
||||
<literallayout>
|
||||
<!ENTITY vers '1.0.2'>
|
||||
</literallayout>
|
||||
</para>
|
||||
<para>
|
||||
And here are some examples of external entities:
|
||||
|
||||
<literallayout>
|
||||
<!ENTITY header SYSTEM "header-&vers;.xml"> (parsed)
|
||||
<!ENTITY logo SYSTEM "logo.png" PNG> (unparsed)
|
||||
</literallayout>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
(Two hyphens.)
|
||||
Terminates the list of options. This is only needed if a filename
|
||||
starts with a hyphen. For example:
|
||||
</para>
|
||||
<literallayout>
|
||||
&dhpackage; -- -myfile.xml
|
||||
</literallayout>
|
||||
<para>
|
||||
will run <command>&dhpackage;</command> on the file
|
||||
<filename>-myfile.xml</filename>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>
|
||||
Older versions of <command>&dhpackage;</command> do not support
|
||||
reading from standard input.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>OUTPUT</title>
|
||||
<para>
|
||||
<command>&dhpackage;</command> outputs nothing for files which are problem-free.
|
||||
If any input file is not well-formed, or if the output for any
|
||||
input file cannot be opened, <command>&dhpackage;</command> prints a single
|
||||
line describing the problem to standard output.
|
||||
</para>
|
||||
<para>
|
||||
If the <option>-k</option> option is not provided, <command>&dhpackage;</command>
|
||||
halts upon encountering a well-formedness or output-file error.
|
||||
If <option>-k</option> is provided, <command>&dhpackage;</command> continues
|
||||
processing the remaining input files, describing problems found with any of them.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>EXIT STATUS</title>
|
||||
<para>For option <option>-v</option> or <option>-h</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>0</option></term>
|
||||
<listitem><para>The input files are well-formed and the output (if requested) was written successfully.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>1</option></term>
|
||||
<listitem><para>An internal error occurred.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>2</option></term>
|
||||
<listitem><para>One or more input files were not well-formed or could not be parsed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>3</option></term>
|
||||
<listitem><para>If using the <option>-d</option> option, an error occurred opening an output file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>4</option></term>
|
||||
<listitem><para>There was a command-line argument error in how <command>&dhpackage;</command> was invoked.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1>
|
||||
<title>BUGS</title>
|
||||
<para>
|
||||
The errors should go to standard error, not standard output.
|
||||
</para>
|
||||
<para>
|
||||
There should be a way to get <option>-d</option> to send its
|
||||
output to standard output rather than forcing the user to send
|
||||
it to a file.
|
||||
</para>
|
||||
<para>
|
||||
I have no idea why anyone would want to use the
|
||||
<option>-d</option>, <option>-c</option>, and
|
||||
<option>-m</option> options. If someone could explain it to
|
||||
me, I'd like to add this information to this manpage.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>SEE ALSO</title>
|
||||
<para>
|
||||
|
||||
<literallayout>
|
||||
The Expat home page: https://libexpat.github.io/
|
||||
The W3 XML 1.0 specification (fourth edition): https://www.w3.org/TR/2006/REC-xml-20060816/
|
||||
Billion laughs attack: https://en.wikipedia.org/wiki/Billion_laughs_attack
|
||||
</literallayout>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>AUTHOR</title>
|
||||
<para>
|
||||
This manual page was originally written by &dhusername; &dhemail;
|
||||
in December 2001 for
|
||||
the &debian; system (but may be used by others). Permission is
|
||||
granted to copy, distribute and/or modify this document under
|
||||
the terms of the <acronym>GNU</acronym> Free Documentation
|
||||
License, Version 1.1.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
|
||||
|
||||
noinst_PROGRAMS = elements outline
|
||||
|
||||
elements_SOURCES = elements.c
|
||||
elements_LDADD = ../lib/libexpat.la
|
||||
|
||||
outline_SOURCES = outline.c
|
||||
outline_LDADD = ../lib/libexpat.la
|
||||
@@ -1,673 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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@
|
||||
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
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@
|
||||
noinst_PROGRAMS = elements$(EXEEXT) outline$(EXEEXT)
|
||||
subdir = examples
|
||||
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)/conftools/ax-require-defined.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-compile-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-link-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
|
||||
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.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)/expat_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_elements_OBJECTS = elements.$(OBJEXT)
|
||||
elements_OBJECTS = $(am_elements_OBJECTS)
|
||||
elements_DEPENDENCIES = ../lib/libexpat.la
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
am_outline_OBJECTS = outline.$(OBJEXT)
|
||||
outline_OBJECTS = $(am_outline_OBJECTS)
|
||||
outline_DEPENDENCIES = ../lib/libexpat.la
|
||||
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 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/elements.Po ./$(DEPDIR)/outline.Po
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(elements_SOURCES) $(outline_SOURCES)
|
||||
DIST_SOURCES = $(elements_SOURCES) $(outline_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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 \
|
||||
$(top_srcdir)/conftools/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
|
||||
EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
|
||||
EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
|
||||
EXPAT_DTD = @EXPAT_DTD@
|
||||
EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
|
||||
EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
|
||||
EXPAT_NS = @EXPAT_NS@
|
||||
FGREP = @FGREP@
|
||||
FILEMAP = @FILEMAP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAGE = @LIBAGE@
|
||||
LIBCURRENT = @LIBCURRENT@
|
||||
LIBDIR_BASENAME = @LIBDIR_BASENAME@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBREVISION = @LIBREVISION@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SO_MAJOR = @SO_MAJOR@
|
||||
SO_MINOR = @SO_MINOR@
|
||||
SO_PATCH = @SO_PATCH@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
|
||||
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_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
|
||||
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@
|
||||
runstatedir = @runstatedir@
|
||||
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@
|
||||
elements_SOURCES = elements.c
|
||||
elements_LDADD = ../lib/libexpat.la
|
||||
outline_SOURCES = outline.c
|
||||
outline_LDADD = ../lib/libexpat.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(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 examples/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
elements$(EXEEXT): $(elements_OBJECTS) $(elements_DEPENDENCIES) $(EXTRA_elements_DEPENDENCIES)
|
||||
@rm -f elements$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(elements_OBJECTS) $(elements_LDADD) $(LIBS)
|
||||
|
||||
outline$(EXEEXT): $(outline_OBJECTS) $(outline_DEPENDENCIES) $(EXTRA_outline_DEPENDENCIES)
|
||||
@rm -f outline$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(outline_OBJECTS) $(outline_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elements.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outline.Po@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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 $(PROGRAMS)
|
||||
installdirs:
|
||||
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 clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/elements.Po
|
||||
-rm -f ./$(DEPDIR)/outline.Po
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
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 ./$(DEPDIR)/elements.Po
|
||||
-rm -f ./$(DEPDIR)/outline.Po
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
|
||||
ctags ctags-am distclean distclean-compile 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 maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
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:
|
||||
@@ -1,102 +0,0 @@
|
||||
/* This is simple demonstration of how to use expat. This program
|
||||
reads an XML document from standard input and writes a line with
|
||||
the name of each element to standard output indenting child
|
||||
elements by one tab stop more than their parent element.
|
||||
It must be used with Expat compiled for UTF-8 output.
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2004-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2005-2007 Steven Solie <ssolie@users.sourceforge.net>
|
||||
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2019 Zhongyuan Zhou <zhouzhongyuan@huawei.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <expat.h>
|
||||
|
||||
#ifdef XML_LARGE_SIZE
|
||||
# define XML_FMT_INT_MOD "ll"
|
||||
#else
|
||||
# define XML_FMT_INT_MOD "l"
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
# include <wchar.h>
|
||||
# define XML_FMT_STR "ls"
|
||||
#else
|
||||
# define XML_FMT_STR "s"
|
||||
#endif
|
||||
|
||||
static void XMLCALL
|
||||
startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
|
||||
int i;
|
||||
int *depthPtr = (int *)userData;
|
||||
(void)atts;
|
||||
|
||||
for (i = 0; i < *depthPtr; i++)
|
||||
putchar('\t');
|
||||
printf("%" XML_FMT_STR "\n", name);
|
||||
*depthPtr += 1;
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
endElement(void *userData, const XML_Char *name) {
|
||||
int *depthPtr = (int *)userData;
|
||||
(void)name;
|
||||
|
||||
*depthPtr -= 1;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
char buf[BUFSIZ];
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
int done;
|
||||
int depth = 0;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
XML_SetUserData(parser, &depth);
|
||||
XML_SetElementHandler(parser, startElement, endElement);
|
||||
do {
|
||||
size_t len = fread(buf, 1, sizeof(buf), stdin);
|
||||
done = len < sizeof(buf);
|
||||
if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) {
|
||||
fprintf(stderr, "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
|
||||
XML_ErrorString(XML_GetErrorCode(parser)),
|
||||
XML_GetCurrentLineNumber(parser));
|
||||
XML_ParserFree(parser);
|
||||
return 1;
|
||||
}
|
||||
} while (! done);
|
||||
XML_ParserFree(parser);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
/* Read an XML document from standard input and print an element
|
||||
outline on standard output.
|
||||
Must be used with Expat compiled for UTF-8 output.
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2005-2007 Steven Solie <ssolie@users.sourceforge.net>
|
||||
Copyright (c) 2005-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <expat.h>
|
||||
|
||||
#ifdef XML_LARGE_SIZE
|
||||
# define XML_FMT_INT_MOD "ll"
|
||||
#else
|
||||
# define XML_FMT_INT_MOD "l"
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
# define XML_FMT_STR "ls"
|
||||
#else
|
||||
# define XML_FMT_STR "s"
|
||||
#endif
|
||||
|
||||
#define BUFFSIZE 8192
|
||||
|
||||
char Buff[BUFFSIZE];
|
||||
|
||||
int Depth;
|
||||
|
||||
static void XMLCALL
|
||||
start(void *data, const XML_Char *el, const XML_Char **attr) {
|
||||
int i;
|
||||
(void)data;
|
||||
|
||||
for (i = 0; i < Depth; i++)
|
||||
printf(" ");
|
||||
|
||||
printf("%" XML_FMT_STR, el);
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", attr[i], attr[i + 1]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
Depth++;
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
end(void *data, const XML_Char *el) {
|
||||
(void)data;
|
||||
(void)el;
|
||||
|
||||
Depth--;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
XML_Parser p = XML_ParserCreate(NULL);
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
if (! p) {
|
||||
fprintf(stderr, "Couldn't allocate memory for parser\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
XML_SetElementHandler(p, start, end);
|
||||
|
||||
for (;;) {
|
||||
int done;
|
||||
int len;
|
||||
|
||||
len = (int)fread(Buff, 1, BUFFSIZE, stdin);
|
||||
if (ferror(stdin)) {
|
||||
fprintf(stderr, "Read error\n");
|
||||
exit(-1);
|
||||
}
|
||||
done = feof(stdin);
|
||||
|
||||
if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
|
||||
fprintf(stderr,
|
||||
"Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
|
||||
XML_GetCurrentLineNumber(p),
|
||||
XML_ErrorString(XML_GetErrorCode(p)));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (done)
|
||||
break;
|
||||
}
|
||||
XML_ParserFree(p);
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
-11
@@ -1,11 +0,0 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: @_EXPAT_OUTPUT_NAME@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Description: expat XML parser
|
||||
URL: http://www.libexpat.org
|
||||
Libs: -L${libdir} -l@_EXPAT_OUTPUT_NAME@
|
||||
Cflags: -I${includedir}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
%define Rversion %(echo %{version} | sed -e 's/\\./_/g' -e 's/^/R_/')
|
||||
Name: expat
|
||||
Version: 2.4.1
|
||||
Release: 8
|
||||
Summary: An XML parser library
|
||||
License: MIT
|
||||
URL: https://libexpat.github.io/
|
||||
Source0: https://github.com/libexpat/libexpat/releases/download/%{Rversion}/expat-%{version}.tar.gz
|
||||
|
||||
Patch0: backport-CVE-2021-45960.patch
|
||||
Patch1: backport-CVE-2021-46143.patch
|
||||
Patch2: backport-CVE-2022-22822-CVE-2022-22823-CVE-2022-22824-CVE-2022-22825-CVE-2022-22826-CVE-2022-22827.patch
|
||||
Patch3: backport-CVE-2022-23852-lib-Detect-and-prevent-integer-overflow-in-XML_GetBu.patch
|
||||
Patch4: backport-CVE-2022-23852-tests-Cover-integer-overflow-in-XML_GetBuffer-CVE-20.patch
|
||||
Patch5: backport-CVE-2022-23990-lib-Prevent-integer-overflow-in-doProlog-CVE-2022-23.patch
|
||||
Patch6: backport-CVE-2022-25235-lib-Add-missing-validation-of-encoding.patch
|
||||
Patch7: backport-tests-Cover-missing-validation-of-encoding.patch
|
||||
Patch8: backport-CVE-2022-25236-lib-Protect-against-malicious-namespace-declarations.patch
|
||||
Patch9: backport-tests-Cover-CVE-2022-25236.patch
|
||||
Patch10: backport-CVE-2022-25313-Prevent-stack-exhaustion-in-build_model.patch
|
||||
Patch11: backport-CVE-2022-25314-Prevent-integer-overflow-in-copyString.patch
|
||||
Patch12: backport-CVE-2022-25315-Prevent-integer-overflow-in-storeRawNames.patch
|
||||
Patch13: backport-Fix-build_model-regression.patch
|
||||
Patch14: backport-tests-Protect-against-nested-element-declaration-mod.patch
|
||||
Patch15: backport-lib-Fix-harmless-use-of-uninitialized-memory.patch
|
||||
Patch16: backport-lib-Drop-unused-macro-UTF8_GET_NAMING.patch
|
||||
Patch17: backport-lib-Relax-fix-to-CVE-2022-25236-with-regard-to-RFC-3.patch
|
||||
Patch18: backport-tests-Cover-relaxed-fix-to-CVE-2022-25236.patch
|
||||
Patch19: backport-0001-CVE-2022-40674.patch
|
||||
Patch20: backport-0002-CVE-2022-40674.patch
|
||||
Patch21: backport-CVE-2022-43680.patch
|
||||
Patch22: backport-tests-Cover-overeager-DTD-destruction-in-XML_Externa.patch
|
||||
|
||||
BuildRequires: sed,autoconf,automake,gcc-c++,libtool,xmlto
|
||||
|
||||
%description
|
||||
expat is a stream-oriented XML parser library written in C.
|
||||
expat excels with files too large to fit RAM, and where
|
||||
performance and flexibility are crucial.
|
||||
|
||||
%package devel
|
||||
Summary: Development files
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%description devel
|
||||
This package provides with static libraries and header files for developing with expat.
|
||||
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
autoreconf -fiv
|
||||
%configure CFLAGS="$RPM_OPT_FLAGS -fPIC" DOCBOOK_TO_MAN="xmlto man --skip-validation"
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
find %{buildroot} -type f -name changelog -delete
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%license COPYING AUTHORS
|
||||
%{_bindir}/*
|
||||
%{_libdir}/libexpat.so.1*
|
||||
%exclude %{_docdir}/%{name}/AUTHORS
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_includedir}/*
|
||||
%{_libdir}/{libexpat.*a,libexpat.so}
|
||||
%{_libdir}/cmake/expat-%{version}
|
||||
%{_libdir}/pkgconfig/expat.pc
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
%doc README.md
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Sat Oct 29 2022 fuanan <fuanan3@h-partners.com> - 2.4.1-8
|
||||
- fix CVE-2022-43680
|
||||
|
||||
* Tue Oct 11 2022 huangduirong <huangduirong@huawei.com> - 2.4.1-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Move autoreconf to build
|
||||
|
||||
* Thu Sep 15 2022 panxiaohe <panxh.life@foxmail.com> - 2.4.1-6
|
||||
- fix CVE-2022-40674
|
||||
|
||||
* Mon Mar 7 2022 yangzhuangzhuang <yangzhuangzhuang1@h-partners.com> - 2.4.1-5
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Relax fix to CVE-2022-25236
|
||||
|
||||
* Sat Feb 26 2022 yangzhuangzhuang <yangzhuangzhuang1@h-partners.com> - 2.4.1-4
|
||||
- Type:CVE
|
||||
- ID:Fix CVE-2022-25235 CVE-2022-25236 CVE-2022-25313 CVE-2022-25314 CVE-2022-25315
|
||||
- SUG:NA
|
||||
- DESC:Fix CVE-2022-25235 CVE-2022-25236 CVE-2022-25313 CVE-2022-25314 CVE-2022-25315
|
||||
|
||||
* Mon Feb 7 2022 yangzhuangzhuang <yangzhuangzhuang1@h-partners.com> - 2.4.1-3
|
||||
- Type:CVE
|
||||
- ID:CVE-2022-23852 CVE-2022-23990
|
||||
- SUG:NA
|
||||
- DESC:Fix CVE-2022-23852CVE-2022-23990
|
||||
|
||||
* Mon Jan 17 2022 wangjie <wangjie375@huawei.com> - 2.4.1-2
|
||||
- Type:CVE
|
||||
- ID:CVE-2021-45960 CVE-2021-46143 CVE-2022-22822 CVE-2022-22823 CVE-2022-22824 CVE-2022-22825 CVE-2022-22826 CVE-2022-22827
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2021-45960 CVE-2021-46143
|
||||
CVE-2022-22822 CVE-2022-22823 CVE-2022-22824 CVE-2022-22825 CVE-2022-22826 CVE-2022-22827
|
||||
|
||||
* Tue Jul 6 2021 panxiaohe <panxiaohe@huawei.com> - 2.4.1-1
|
||||
- update to 2.4.1
|
||||
- fix CVE-2013-0340
|
||||
|
||||
* Wed Jan 20 2021 wangchen <wangchen137@huawei.com> - 2.2.10-1
|
||||
- update to 2.2.10
|
||||
|
||||
* Sun Jun 28 2020 liuchenguang <liuchenguang4@huawei.com> - 2.2.9-2
|
||||
- quality enhancement synchronization github patch
|
||||
|
||||
* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.2.9-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update to 2.2.9
|
||||
|
||||
* Mon Oct 21 2019 shenyangyang <shenyangyang4@huawei.com> - 2.2.6-5
|
||||
- Type:NA
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:modify the directory of AUTHORS
|
||||
|
||||
* Mon Oct 21 2019 shenyangyang <shenyangyang4@huawei.com> - 2.2.6-4
|
||||
- Type:NA
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:move AUTHORS to license directory
|
||||
|
||||
* Sat Sep 28 2019 shenyangyang<shenyangyang4@huawei.com> - 2.2.6-3
|
||||
- Type:cves
|
||||
- ID:CVE-2019-15903
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2019-15903
|
||||
|
||||
* Fri Aug 30 2019 gulining<gulining1@huawei.com> - 2.2.6-2
|
||||
- Type:cves
|
||||
- ID:CVE-2018-20843
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2018-20843
|
||||
|
||||
* Thu Aug 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.2.6-1
|
||||
- Package Init
|
||||
@@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: libexpat/libexpat
|
||||
tag_prefix: "^R_"
|
||||
seperator: _
|
||||
-133
@@ -1,133 +0,0 @@
|
||||
/* expat_config.h. Generated from expat_config.h.in by configure. */
|
||||
/* expat_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
/* #undef AC_APPLE_UNIVERSAL_BUILD */
|
||||
|
||||
/* 1234 = LILENDIAN, 4321 = BIGENDIAN */
|
||||
#define BYTEORDER 1234
|
||||
|
||||
/* Define to 1 if you have the `arc4random' function. */
|
||||
/* #undef HAVE_ARC4RANDOM */
|
||||
|
||||
/* Define to 1 if you have the `arc4random_buf' function. */
|
||||
/* #undef HAVE_ARC4RANDOM_BUF */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define to 1 if you have the `getrandom' function. */
|
||||
#define HAVE_GETRANDOM 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `bsd' library (-lbsd). */
|
||||
/* #undef HAVE_LIBBSD */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#define HAVE_MMAP 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
|
||||
#define HAVE_SYSCALL_GETRANDOM 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "expat"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "expat"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "expat 2.4.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "expat"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.4.1"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.4.1"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to allow retrieving the byte offsets for attribute names and values.
|
||||
*/
|
||||
/* #undef XML_ATTR_INFO */
|
||||
|
||||
/* Define to specify how much context to retain around the current parse
|
||||
point. */
|
||||
#define XML_CONTEXT_BYTES 1024
|
||||
|
||||
/* Define to include code reading entropy from `/dev/urandom'. */
|
||||
#define XML_DEV_URANDOM 1
|
||||
|
||||
/* Define to make parameter entity parsing functionality available. */
|
||||
#define XML_DTD 1
|
||||
|
||||
/* Define to make XML Namespaces functionality available. */
|
||||
#define XML_NS 1
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
@@ -1,115 +0,0 @@
|
||||
/* expat_config.h.cmake. Based upon generated expat_config.h.in. */
|
||||
|
||||
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
|
||||
#cmakedefine BYTEORDER @BYTEORDER@
|
||||
|
||||
/* Define to 1 if you have the `arc4random' function. */
|
||||
#cmakedefine HAVE_ARC4RANDOM
|
||||
|
||||
/* Define to 1 if you have the `arc4random_buf' function. */
|
||||
#cmakedefine HAVE_ARC4RANDOM_BUF
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#cmakedefine HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#cmakedefine HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
#cmakedefine HAVE_GETPAGESIZE
|
||||
|
||||
/* Define to 1 if you have the `getrandom' function. */
|
||||
#cmakedefine HAVE_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `bsd' library (-lbsd). */
|
||||
#cmakedefine HAVE_LIBBSD
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#cmakedefine HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#cmakedefine HAVE_MMAP
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#cmakedefine HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#cmakedefine HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
|
||||
#cmakedefine HAVE_SYSCALL_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "@PACKAGE_NAME@"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#cmakedefine STDC_HEADERS
|
||||
|
||||
/* whether byteorder is bigendian */
|
||||
#cmakedefine WORDS_BIGENDIAN
|
||||
|
||||
/* Define to allow retrieving the byte offsets for attribute names and values.
|
||||
*/
|
||||
#cmakedefine XML_ATTR_INFO
|
||||
|
||||
/* Define to specify how much context to retain around the current parse
|
||||
point. */
|
||||
#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
|
||||
|
||||
#if ! defined(_WIN32)
|
||||
/* Define to include code reading entropy from `/dev/urandom'. */
|
||||
#cmakedefine XML_DEV_URANDOM
|
||||
#endif
|
||||
|
||||
/* Define to make parameter entity parsing functionality available. */
|
||||
#cmakedefine XML_DTD
|
||||
|
||||
/* Define to make XML Namespaces functionality available. */
|
||||
#cmakedefine XML_NS
|
||||
|
||||
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
|
||||
#ifdef _MSC_VER
|
||||
# define __func__ __FUNCTION__
|
||||
#endif
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
#cmakedefine off_t @OFF_T@
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#cmakedefine size_t @SIZE_T@
|
||||
@@ -1,132 +0,0 @@
|
||||
/* expat_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* 1234 = LILENDIAN, 4321 = BIGENDIAN */
|
||||
#undef BYTEORDER
|
||||
|
||||
/* Define to 1 if you have the `arc4random' function. */
|
||||
#undef HAVE_ARC4RANDOM
|
||||
|
||||
/* Define to 1 if you have the `arc4random_buf' function. */
|
||||
#undef HAVE_ARC4RANDOM_BUF
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define to 1 if you have the `getrandom' function. */
|
||||
#undef HAVE_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `bsd' library (-lbsd). */
|
||||
#undef HAVE_LIBBSD
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
|
||||
#undef HAVE_SYSCALL_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to allow retrieving the byte offsets for attribute names and values.
|
||||
*/
|
||||
#undef XML_ATTR_INFO
|
||||
|
||||
/* Define to specify how much context to retain around the current parse
|
||||
point. */
|
||||
#undef XML_CONTEXT_BYTES
|
||||
|
||||
/* Define to include code reading entropy from `/dev/urandom'. */
|
||||
#undef XML_DEV_URANDOM
|
||||
|
||||
/* Define to make parameter entity parsing functionality available. */
|
||||
#undef XML_DTD
|
||||
|
||||
/* Define to make XML Namespaces functionality available. */
|
||||
#undef XML_NS
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
@@ -1,48 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
set -e
|
||||
|
||||
filename="${1:-tests/xmltest.log}"
|
||||
|
||||
dos2unix "${filename}"
|
||||
|
||||
tempfile="$(mktemp)"
|
||||
sed \
|
||||
-e 's/^wine: Call .* msvcrt\.dll\._wperror, aborting$/ibm49i02.dtd: No such file or directory/' \
|
||||
\
|
||||
-e '/^wine: /d' \
|
||||
-e '/^Application tried to create a window, but no driver could be loaded.$/d' \
|
||||
-e '/^Make sure that your X server is running and that $DISPLAY is set correctly.$/d' \
|
||||
-e '/^err:systray:initialize_systray Could not create tray window$/d' \
|
||||
-e '/^In ibm\/invalid\/P49\/: Unhandled exception: unimplemented .\+/d' \
|
||||
\
|
||||
"${filename}" > "${tempfile}"
|
||||
mv "${tempfile}" "${filename}"
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation version 2.1
|
||||
# of the License.
|
||||
#
|
||||
# Copyright(c) 2023 Huawei Device Co., Ltd.
|
||||
|
||||
set -e
|
||||
cd $1
|
||||
if [ -d "expat-2.4.1" ];then
|
||||
rm -rf expat-2.4.1
|
||||
fi
|
||||
tar xvf expat-2.4.1.tar.gz
|
||||
cd $1/expat-2.4.1
|
||||
./configure
|
||||
patch -p1 < $1/backport-CVE-2021-45960.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2021-46143.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-22822-CVE-2022-22823-CVE-2022-22824-CVE-2022-22825-CVE-2022-22826-CVE-2022-22827.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-23852-lib-Detect-and-prevent-integer-overflow-in-XML_GetBu.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-23852-tests-Cover-integer-overflow-in-XML_GetBuffer-CVE-20.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-23990-lib-Prevent-integer-overflow-in-doProlog-CVE-2022-23.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-25235-lib-Add-missing-validation-of-encoding.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-25236-lib-Protect-against-malicious-namespace-declarations.patch --fuzz=0 --no-backup-if-mismatch
|
||||
|
||||
patch -p1 < $1/backport-CVE-2022-25313-Prevent-stack-exhaustion-in-build_model.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-25314-Prevent-integer-overflow-in-copyString.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-25315-Prevent-integer-overflow-in-storeRawNames.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-0001-CVE-2022-40674.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-0002-CVE-2022-40674.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2022-43680.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-Fix-build_model-regression.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-lib-Drop-unused-macro-UTF8_GET_NAMING.patch --fuzz=0 --no-backup-if-mismatch
|
||||
|
||||
|
||||
patch -p1 < $1/backport-lib-Fix-harmless-use-of-uninitialized-memory.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-lib-Relax-fix-to-CVE-2022-25236-with-regard-to-RFC-3.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-tests-Cover-CVE-2022-25236.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-tests-Cover-missing-validation-of-encoding.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-tests-Cover-overeager-DTD-destruction-in-XML_Externa.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-tests-Cover-relaxed-fix-to-CVE-2022-25236.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-tests-Protect-against-nested-element-declaration-mod.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/adapt_previewer_compilation.patch --fuzz=0 --no-backup-if-mismatch
|
||||
|
||||
cp -r $1/expat-2.4.1/. $1
|
||||
cd $1
|
||||
rm -rf $1/expat-2.4.1
|
||||
exit 0
|
||||
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2017 Tomasz Kłoczko <kloczek@fedoraproject.org>
|
||||
# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
include_HEADERS = \
|
||||
../expat_config.h \
|
||||
expat.h \
|
||||
expat_external.h
|
||||
|
||||
lib_LTLIBRARIES = libexpat.la
|
||||
noinst_LTLIBRARIES = libexpatinternal.la
|
||||
|
||||
libexpat_la_LDFLAGS = \
|
||||
@AM_LDFLAGS@ \
|
||||
-no-undefined \
|
||||
-version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
|
||||
|
||||
libexpat_la_SOURCES =
|
||||
|
||||
# This layer of indirection allows
|
||||
# the test suite to access internal symbols
|
||||
# despite compiling with -fvisibility=hidden
|
||||
libexpatinternal_la_SOURCES = \
|
||||
xmlparse.c \
|
||||
xmltok.c \
|
||||
xmlrole.c
|
||||
|
||||
libexpat_la_LIBADD = libexpatinternal.la
|
||||
|
||||
doc_DATA = \
|
||||
../AUTHORS \
|
||||
../Changes
|
||||
|
||||
install-data-hook:
|
||||
cd "$(DESTDIR)$(docdir)" && $(am__mv) Changes changelog
|
||||
|
||||
uninstall-local:
|
||||
$(RM) "$(DESTDIR)$(docdir)/changelog"
|
||||
|
||||
EXTRA_DIST = \
|
||||
ascii.h \
|
||||
asciitab.h \
|
||||
expat_external.h \
|
||||
expat.h \
|
||||
iasciitab.h \
|
||||
internal.h \
|
||||
latin1tab.h \
|
||||
libexpat.def \
|
||||
libexpatw.def \
|
||||
nametab.h \
|
||||
siphash.h \
|
||||
utf8tab.h \
|
||||
winconfig.h \
|
||||
xmlrole.h \
|
||||
xmltok.h \
|
||||
xmltok_impl.c \
|
||||
xmltok_impl.h \
|
||||
xmltok_ns.c
|
||||
-849
@@ -1,849 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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@
|
||||
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2017 Tomasz Kłoczko <kloczek@fedoraproject.org>
|
||||
# Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
|
||||
|
||||
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 = lib
|
||||
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)/conftools/ax-require-defined.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-compile-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-link-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
|
||||
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/expat_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
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)$(libdir)" "$(DESTDIR)$(docdir)" \
|
||||
"$(DESTDIR)$(includedir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
|
||||
libexpat_la_DEPENDENCIES = libexpatinternal.la
|
||||
am_libexpat_la_OBJECTS =
|
||||
libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
libexpatinternal_la_LIBADD =
|
||||
am_libexpatinternal_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
|
||||
libexpatinternal_la_OBJECTS = $(am_libexpatinternal_la_OBJECTS)
|
||||
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 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \
|
||||
./$(DEPDIR)/xmltok.Plo
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES)
|
||||
DIST_SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
DATA = $(doc_DATA)
|
||||
HEADERS = $(include_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 \
|
||||
$(top_srcdir)/conftools/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
|
||||
EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
|
||||
EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
|
||||
EXPAT_DTD = @EXPAT_DTD@
|
||||
EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
|
||||
EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
|
||||
EXPAT_NS = @EXPAT_NS@
|
||||
FGREP = @FGREP@
|
||||
FILEMAP = @FILEMAP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAGE = @LIBAGE@
|
||||
LIBCURRENT = @LIBCURRENT@
|
||||
LIBDIR_BASENAME = @LIBDIR_BASENAME@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBREVISION = @LIBREVISION@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SO_MAJOR = @SO_MAJOR@
|
||||
SO_MINOR = @SO_MINOR@
|
||||
SO_PATCH = @SO_PATCH@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
|
||||
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_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
|
||||
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@
|
||||
runstatedir = @runstatedir@
|
||||
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@
|
||||
include_HEADERS = \
|
||||
../expat_config.h \
|
||||
expat.h \
|
||||
expat_external.h
|
||||
|
||||
lib_LTLIBRARIES = libexpat.la
|
||||
noinst_LTLIBRARIES = libexpatinternal.la
|
||||
libexpat_la_LDFLAGS = \
|
||||
@AM_LDFLAGS@ \
|
||||
-no-undefined \
|
||||
-version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
|
||||
|
||||
libexpat_la_SOURCES =
|
||||
|
||||
# This layer of indirection allows
|
||||
# the test suite to access internal symbols
|
||||
# despite compiling with -fvisibility=hidden
|
||||
libexpatinternal_la_SOURCES = \
|
||||
xmlparse.c \
|
||||
xmltok.c \
|
||||
xmlrole.c
|
||||
|
||||
libexpat_la_LIBADD = libexpatinternal.la
|
||||
doc_DATA = \
|
||||
../AUTHORS \
|
||||
../Changes
|
||||
|
||||
EXTRA_DIST = \
|
||||
ascii.h \
|
||||
asciitab.h \
|
||||
expat_external.h \
|
||||
expat.h \
|
||||
iasciitab.h \
|
||||
internal.h \
|
||||
latin1tab.h \
|
||||
libexpat.def \
|
||||
libexpatw.def \
|
||||
nametab.h \
|
||||
siphash.h \
|
||||
utf8tab.h \
|
||||
winconfig.h \
|
||||
xmlrole.h \
|
||||
xmltok.h \
|
||||
xmltok_impl.c \
|
||||
xmltok_impl.h \
|
||||
xmltok_ns.c
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(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 lib/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu lib/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS)
|
||||
|
||||
libexpatinternal.la: $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_DEPENDENCIES) $(EXTRA_libexpatinternal_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrole.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmltok.Plo@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-docDATA: $(doc_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(docdir)" || 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_DATA) $$files '$(DESTDIR)$(docdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-docDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(includedir)" || 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)$(includedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(includedir)'; $(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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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 $(LTLIBRARIES) $(DATA) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(includedir)"; 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-libLTLIBRARIES clean-libtool \
|
||||
clean-noinstLTLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/xmlparse.Plo
|
||||
-rm -f ./$(DEPDIR)/xmlrole.Plo
|
||||
-rm -f ./$(DEPDIR)/xmltok.Plo
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-docDATA install-includeHEADERS
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
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 ./$(DEPDIR)/xmlparse.Plo
|
||||
-rm -f ./$(DEPDIR)/xmlrole.Plo
|
||||
-rm -f ./$(DEPDIR)/xmltok.Plo
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-docDATA uninstall-includeHEADERS \
|
||||
uninstall-libLTLIBRARIES uninstall-local
|
||||
|
||||
.MAKE: install-am install-data-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
|
||||
distclean-compile 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-data-hook install-docDATA install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-includeHEADERS install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-docDATA \
|
||||
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
|
||||
uninstall-local
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
install-data-hook:
|
||||
cd "$(DESTDIR)$(docdir)" && $(am__mv) Changes changelog
|
||||
|
||||
uninstall-local:
|
||||
$(RM) "$(DESTDIR)$(docdir)/changelog"
|
||||
|
||||
# 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:
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#define ASCII_A 0x41
|
||||
#define ASCII_B 0x42
|
||||
#define ASCII_C 0x43
|
||||
#define ASCII_D 0x44
|
||||
#define ASCII_E 0x45
|
||||
#define ASCII_F 0x46
|
||||
#define ASCII_G 0x47
|
||||
#define ASCII_H 0x48
|
||||
#define ASCII_I 0x49
|
||||
#define ASCII_J 0x4A
|
||||
#define ASCII_K 0x4B
|
||||
#define ASCII_L 0x4C
|
||||
#define ASCII_M 0x4D
|
||||
#define ASCII_N 0x4E
|
||||
#define ASCII_O 0x4F
|
||||
#define ASCII_P 0x50
|
||||
#define ASCII_Q 0x51
|
||||
#define ASCII_R 0x52
|
||||
#define ASCII_S 0x53
|
||||
#define ASCII_T 0x54
|
||||
#define ASCII_U 0x55
|
||||
#define ASCII_V 0x56
|
||||
#define ASCII_W 0x57
|
||||
#define ASCII_X 0x58
|
||||
#define ASCII_Y 0x59
|
||||
#define ASCII_Z 0x5A
|
||||
|
||||
#define ASCII_a 0x61
|
||||
#define ASCII_b 0x62
|
||||
#define ASCII_c 0x63
|
||||
#define ASCII_d 0x64
|
||||
#define ASCII_e 0x65
|
||||
#define ASCII_f 0x66
|
||||
#define ASCII_g 0x67
|
||||
#define ASCII_h 0x68
|
||||
#define ASCII_i 0x69
|
||||
#define ASCII_j 0x6A
|
||||
#define ASCII_k 0x6B
|
||||
#define ASCII_l 0x6C
|
||||
#define ASCII_m 0x6D
|
||||
#define ASCII_n 0x6E
|
||||
#define ASCII_o 0x6F
|
||||
#define ASCII_p 0x70
|
||||
#define ASCII_q 0x71
|
||||
#define ASCII_r 0x72
|
||||
#define ASCII_s 0x73
|
||||
#define ASCII_t 0x74
|
||||
#define ASCII_u 0x75
|
||||
#define ASCII_v 0x76
|
||||
#define ASCII_w 0x77
|
||||
#define ASCII_x 0x78
|
||||
#define ASCII_y 0x79
|
||||
#define ASCII_z 0x7A
|
||||
|
||||
#define ASCII_0 0x30
|
||||
#define ASCII_1 0x31
|
||||
#define ASCII_2 0x32
|
||||
#define ASCII_3 0x33
|
||||
#define ASCII_4 0x34
|
||||
#define ASCII_5 0x35
|
||||
#define ASCII_6 0x36
|
||||
#define ASCII_7 0x37
|
||||
#define ASCII_8 0x38
|
||||
#define ASCII_9 0x39
|
||||
|
||||
#define ASCII_TAB 0x09
|
||||
#define ASCII_SPACE 0x20
|
||||
#define ASCII_EXCL 0x21
|
||||
#define ASCII_QUOT 0x22
|
||||
#define ASCII_AMP 0x26
|
||||
#define ASCII_APOS 0x27
|
||||
#define ASCII_MINUS 0x2D
|
||||
#define ASCII_PERIOD 0x2E
|
||||
#define ASCII_COLON 0x3A
|
||||
#define ASCII_SEMI 0x3B
|
||||
#define ASCII_LT 0x3C
|
||||
#define ASCII_EQUALS 0x3D
|
||||
#define ASCII_GT 0x3E
|
||||
#define ASCII_LSQB 0x5B
|
||||
#define ASCII_RSQB 0x5D
|
||||
#define ASCII_UNDERSCORE 0x5F
|
||||
#define ASCII_LPAREN 0x28
|
||||
#define ASCII_RPAREN 0x29
|
||||
#define ASCII_FF 0x0C
|
||||
#define ASCII_SLASH 0x2F
|
||||
#define ASCII_HASH 0x23
|
||||
#define ASCII_PIPE 0x7C
|
||||
#define ASCII_COMMA 0x2C
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
|
||||
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
|
||||
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
|
||||
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
|
||||
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
|
||||
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
|
||||
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
-1050
File diff suppressed because it is too large
Load Diff
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#ifndef Expat_External_INCLUDED
|
||||
#define Expat_External_INCLUDED 1
|
||||
|
||||
/* External API definitions */
|
||||
|
||||
/* Expat tries very hard to make the API boundary very specifically
|
||||
defined. There are two macros defined to control this boundary;
|
||||
each of these can be defined before including this header to
|
||||
achieve some different behavior, but doing so it not recommended or
|
||||
tested frequently.
|
||||
|
||||
XMLCALL - The calling convention to use for all calls across the
|
||||
"library boundary." This will default to cdecl, and
|
||||
try really hard to tell the compiler that's what we
|
||||
want.
|
||||
|
||||
XMLIMPORT - Whatever magic is needed to note that a function is
|
||||
to be imported from a dynamically loaded library
|
||||
(.dll, .so, or .sl, depending on your platform).
|
||||
|
||||
The XMLCALL macro was added in Expat 1.95.7. The only one which is
|
||||
expected to be directly useful in client code is XMLCALL.
|
||||
|
||||
Note that on at least some Unix versions, the Expat library must be
|
||||
compiled with the cdecl calling convention as the default since
|
||||
system headers may assume the cdecl convention.
|
||||
*/
|
||||
#ifndef XMLCALL
|
||||
# if defined(_MSC_VER)
|
||||
# define XMLCALL __cdecl
|
||||
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
|
||||
# define XMLCALL __attribute__((cdecl))
|
||||
# else
|
||||
/* For any platform which uses this definition and supports more than
|
||||
one calling convention, we need to extend this definition to
|
||||
declare the convention used on that platform, if it's possible to
|
||||
do so.
|
||||
|
||||
If this is the case for your platform, please file a bug report
|
||||
with information on how to identify your platform via the C
|
||||
pre-processor and how to specify the same calling convention as the
|
||||
platform's malloc() implementation.
|
||||
*/
|
||||
# define XMLCALL
|
||||
# endif
|
||||
#endif /* not defined XMLCALL */
|
||||
|
||||
#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
|
||||
# ifndef XML_BUILDING_EXPAT
|
||||
/* using Expat from an application */
|
||||
|
||||
# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
|
||||
# define XMLIMPORT __declspec(dllimport)
|
||||
# endif
|
||||
|
||||
# endif
|
||||
#endif /* not defined XML_STATIC */
|
||||
|
||||
#ifndef XML_ENABLE_VISIBILITY
|
||||
# define XML_ENABLE_VISIBILITY 0
|
||||
#endif
|
||||
|
||||
#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
|
||||
# define XMLIMPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
/* If we didn't define it above, define it away: */
|
||||
#ifndef XMLIMPORT
|
||||
# define XMLIMPORT
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
|
||||
# define XML_ATTR_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
# define XML_ATTR_MALLOC
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
||||
#else
|
||||
# define XML_ATTR_ALLOC_SIZE(x)
|
||||
#endif
|
||||
|
||||
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
# ifndef XML_UNICODE
|
||||
# define XML_UNICODE
|
||||
# endif
|
||||
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
|
||||
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
typedef wchar_t XML_Char;
|
||||
typedef wchar_t XML_LChar;
|
||||
# else
|
||||
typedef unsigned short XML_Char;
|
||||
typedef char XML_LChar;
|
||||
# endif /* XML_UNICODE_WCHAR_T */
|
||||
#else /* Information is UTF-8 encoded. */
|
||||
typedef char XML_Char;
|
||||
typedef char XML_LChar;
|
||||
#endif /* XML_UNICODE */
|
||||
|
||||
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
typedef long long XML_Index;
|
||||
typedef unsigned long long XML_Size;
|
||||
#else
|
||||
typedef long XML_Index;
|
||||
typedef unsigned long XML_Size;
|
||||
#endif /* XML_LARGE_SIZE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not Expat_External_INCLUDED */
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
|
||||
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
|
||||
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
|
||||
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
|
||||
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
|
||||
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
|
||||
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
|
||||
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
|
||||
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
|
||||
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
|
||||
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
|
||||
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
|
||||
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
|
||||
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
|
||||
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
-163
@@ -1,163 +0,0 @@
|
||||
/* internal.h
|
||||
|
||||
Internal definitions used by Expat. This is not needed to compile
|
||||
client code.
|
||||
|
||||
The following calling convention macros are defined for frequently
|
||||
called functions:
|
||||
|
||||
FASTCALL - Used for those internal functions that have a simple
|
||||
body and a low number of arguments and local variables.
|
||||
|
||||
PTRCALL - Used for functions called though function pointers.
|
||||
|
||||
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
|
||||
|
||||
inline - Used for selected internal functions for which inlining
|
||||
may improve performance on some platforms.
|
||||
|
||||
Note: Use of these macros is based on judgement, not hard rules,
|
||||
and therefore subject to change.
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__)
|
||||
/* We'll use this version by default only where we know it helps.
|
||||
|
||||
regparm() generates warnings on Solaris boxes. See SF bug #692878.
|
||||
|
||||
Instability reported with egcs on a RedHat Linux 7.3.
|
||||
Let's comment out:
|
||||
#define FASTCALL __attribute__((stdcall, regparm(3)))
|
||||
and let's try this:
|
||||
*/
|
||||
# define FASTCALL __attribute__((regparm(3)))
|
||||
# define PTRFASTCALL __attribute__((regparm(3)))
|
||||
#endif
|
||||
|
||||
/* Using __fastcall seems to have an unexpected negative effect under
|
||||
MS VC++, especially for function pointers, so we won't use it for
|
||||
now on that platform. It may be reconsidered for a future release
|
||||
if it can be made more effective.
|
||||
Likely reason: __fastcall on Windows is like stdcall, therefore
|
||||
the compiler cannot perform stack optimizations for call clusters.
|
||||
*/
|
||||
|
||||
/* Make sure all of these are defined if they aren't already. */
|
||||
|
||||
#ifndef FASTCALL
|
||||
# define FASTCALL
|
||||
#endif
|
||||
|
||||
#ifndef PTRCALL
|
||||
# define PTRCALL
|
||||
#endif
|
||||
|
||||
#ifndef PTRFASTCALL
|
||||
# define PTRFASTCALL
|
||||
#endif
|
||||
|
||||
#ifndef XML_MIN_SIZE
|
||||
# if ! defined(__cplusplus) && ! defined(inline)
|
||||
# ifdef __GNUC__
|
||||
# define inline __inline
|
||||
# endif /* __GNUC__ */
|
||||
# endif
|
||||
#endif /* XML_MIN_SIZE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define inline inline
|
||||
#else
|
||||
# ifndef inline
|
||||
# define inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <limits.h> // ULONG_MAX
|
||||
|
||||
#if defined(_WIN32) && ! defined(__USE_MINGW_ANSI_STDIO)
|
||||
# define EXPAT_FMT_ULL(midpart) "%" midpart "I64u"
|
||||
# if defined(_WIN64) // Note: modifiers "td" and "zu" do not work for MinGW
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "I64d"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "I64u"
|
||||
# else
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
|
||||
# endif
|
||||
#else
|
||||
# define EXPAT_FMT_ULL(midpart) "%" midpart "llu"
|
||||
# if ! defined(ULONG_MAX)
|
||||
# error Compiler did not define ULONG_MAX for us
|
||||
# elif ULONG_MAX == 18446744073709551615u // 2^64-1
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "lu"
|
||||
# else
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED_P
|
||||
# define UNUSED_P(p) (void)p
|
||||
#endif
|
||||
|
||||
/* NOTE BEGIN If you ever patch these defaults to greater values
|
||||
for non-attack XML payload in your environment,
|
||||
please file a bug report with libexpat. Thank you!
|
||||
*/
|
||||
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT \
|
||||
100.0f
|
||||
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT \
|
||||
8388608 // 8 MiB, 2^23
|
||||
/* NOTE END */
|
||||
|
||||
#include "expat.h" // so we can use type XML_Parser below
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
#if defined(XML_DTD)
|
||||
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
|
||||
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
|
||||
const char *unsignedCharToPrintable(unsigned char c);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
|
||||
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
|
||||
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
|
||||
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
|
||||
@@ -1,80 +0,0 @@
|
||||
; DEF file for MS VC++
|
||||
|
||||
LIBRARY
|
||||
EXPORTS
|
||||
XML_DefaultCurrent @1
|
||||
XML_ErrorString @2
|
||||
XML_ExpatVersion @3
|
||||
XML_ExpatVersionInfo @4
|
||||
XML_ExternalEntityParserCreate @5
|
||||
XML_GetBase @6
|
||||
XML_GetBuffer @7
|
||||
XML_GetCurrentByteCount @8
|
||||
XML_GetCurrentByteIndex @9
|
||||
XML_GetCurrentColumnNumber @10
|
||||
XML_GetCurrentLineNumber @11
|
||||
XML_GetErrorCode @12
|
||||
XML_GetIdAttributeIndex @13
|
||||
XML_GetInputContext @14
|
||||
XML_GetSpecifiedAttributeCount @15
|
||||
XML_Parse @16
|
||||
XML_ParseBuffer @17
|
||||
XML_ParserCreate @18
|
||||
XML_ParserCreateNS @19
|
||||
XML_ParserCreate_MM @20
|
||||
XML_ParserFree @21
|
||||
XML_SetAttlistDeclHandler @22
|
||||
XML_SetBase @23
|
||||
XML_SetCdataSectionHandler @24
|
||||
XML_SetCharacterDataHandler @25
|
||||
XML_SetCommentHandler @26
|
||||
XML_SetDefaultHandler @27
|
||||
XML_SetDefaultHandlerExpand @28
|
||||
XML_SetDoctypeDeclHandler @29
|
||||
XML_SetElementDeclHandler @30
|
||||
XML_SetElementHandler @31
|
||||
XML_SetEncoding @32
|
||||
XML_SetEndCdataSectionHandler @33
|
||||
XML_SetEndDoctypeDeclHandler @34
|
||||
XML_SetEndElementHandler @35
|
||||
XML_SetEndNamespaceDeclHandler @36
|
||||
XML_SetEntityDeclHandler @37
|
||||
XML_SetExternalEntityRefHandler @38
|
||||
XML_SetExternalEntityRefHandlerArg @39
|
||||
XML_SetNamespaceDeclHandler @40
|
||||
XML_SetNotStandaloneHandler @41
|
||||
XML_SetNotationDeclHandler @42
|
||||
XML_SetParamEntityParsing @43
|
||||
XML_SetProcessingInstructionHandler @44
|
||||
XML_SetReturnNSTriplet @45
|
||||
XML_SetStartCdataSectionHandler @46
|
||||
XML_SetStartDoctypeDeclHandler @47
|
||||
XML_SetStartElementHandler @48
|
||||
XML_SetStartNamespaceDeclHandler @49
|
||||
XML_SetUnknownEncodingHandler @50
|
||||
XML_SetUnparsedEntityDeclHandler @51
|
||||
XML_SetUserData @52
|
||||
XML_SetXmlDeclHandler @53
|
||||
XML_UseParserAsHandlerArg @54
|
||||
; added with version 1.95.3
|
||||
XML_ParserReset @55
|
||||
XML_SetSkippedEntityHandler @56
|
||||
; added with version 1.95.5
|
||||
XML_GetFeatureList @57
|
||||
XML_UseForeignDTD @58
|
||||
; added with version 1.95.6
|
||||
XML_FreeContentModel @59
|
||||
XML_MemMalloc @60
|
||||
XML_MemRealloc @61
|
||||
XML_MemFree @62
|
||||
; added with version 1.95.8
|
||||
XML_StopParser @63
|
||||
XML_ResumeParser @64
|
||||
XML_GetParsingStatus @65
|
||||
; added with version 2.1.1
|
||||
; XML_GetAttributeInfo @66
|
||||
XML_SetHashSalt @67
|
||||
; internal @68 removed with version 2.3.1
|
||||
; added with version 2.4.0
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold @69
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
|
||||
@@ -1,80 +0,0 @@
|
||||
; DEF file for MS VC++
|
||||
|
||||
LIBRARY
|
||||
EXPORTS
|
||||
XML_DefaultCurrent @1
|
||||
XML_ErrorString @2
|
||||
XML_ExpatVersion @3
|
||||
XML_ExpatVersionInfo @4
|
||||
XML_ExternalEntityParserCreate @5
|
||||
XML_GetBase @6
|
||||
XML_GetBuffer @7
|
||||
XML_GetCurrentByteCount @8
|
||||
XML_GetCurrentByteIndex @9
|
||||
XML_GetCurrentColumnNumber @10
|
||||
XML_GetCurrentLineNumber @11
|
||||
XML_GetErrorCode @12
|
||||
XML_GetIdAttributeIndex @13
|
||||
XML_GetInputContext @14
|
||||
XML_GetSpecifiedAttributeCount @15
|
||||
XML_Parse @16
|
||||
XML_ParseBuffer @17
|
||||
XML_ParserCreate @18
|
||||
XML_ParserCreateNS @19
|
||||
XML_ParserCreate_MM @20
|
||||
XML_ParserFree @21
|
||||
XML_SetAttlistDeclHandler @22
|
||||
XML_SetBase @23
|
||||
XML_SetCdataSectionHandler @24
|
||||
XML_SetCharacterDataHandler @25
|
||||
XML_SetCommentHandler @26
|
||||
XML_SetDefaultHandler @27
|
||||
XML_SetDefaultHandlerExpand @28
|
||||
XML_SetDoctypeDeclHandler @29
|
||||
XML_SetElementDeclHandler @30
|
||||
XML_SetElementHandler @31
|
||||
XML_SetEncoding @32
|
||||
XML_SetEndCdataSectionHandler @33
|
||||
XML_SetEndDoctypeDeclHandler @34
|
||||
XML_SetEndElementHandler @35
|
||||
XML_SetEndNamespaceDeclHandler @36
|
||||
XML_SetEntityDeclHandler @37
|
||||
XML_SetExternalEntityRefHandler @38
|
||||
XML_SetExternalEntityRefHandlerArg @39
|
||||
XML_SetNamespaceDeclHandler @40
|
||||
XML_SetNotStandaloneHandler @41
|
||||
XML_SetNotationDeclHandler @42
|
||||
XML_SetParamEntityParsing @43
|
||||
XML_SetProcessingInstructionHandler @44
|
||||
XML_SetReturnNSTriplet @45
|
||||
XML_SetStartCdataSectionHandler @46
|
||||
XML_SetStartDoctypeDeclHandler @47
|
||||
XML_SetStartElementHandler @48
|
||||
XML_SetStartNamespaceDeclHandler @49
|
||||
XML_SetUnknownEncodingHandler @50
|
||||
XML_SetUnparsedEntityDeclHandler @51
|
||||
XML_SetUserData @52
|
||||
XML_SetXmlDeclHandler @53
|
||||
XML_UseParserAsHandlerArg @54
|
||||
; added with version 1.95.3
|
||||
XML_ParserReset @55
|
||||
XML_SetSkippedEntityHandler @56
|
||||
; added with version 1.95.5
|
||||
XML_GetFeatureList @57
|
||||
XML_UseForeignDTD @58
|
||||
; added with version 1.95.6
|
||||
XML_FreeContentModel @59
|
||||
XML_MemMalloc @60
|
||||
XML_MemRealloc @61
|
||||
XML_MemFree @62
|
||||
; added with version 1.95.8
|
||||
XML_StopParser @63
|
||||
XML_ResumeParser @64
|
||||
XML_GetParsingStatus @65
|
||||
; added with version 2.1.1
|
||||
; XML_GetAttributeInfo @66
|
||||
XML_SetHashSalt @67
|
||||
; internal @68 removed with version 2.3.1
|
||||
; added with version 2.4.0
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold @69
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
|
||||
-136
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
static const unsigned namingBitmap[] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000,
|
||||
0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
|
||||
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
|
||||
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF,
|
||||
0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
|
||||
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE,
|
||||
0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
|
||||
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF,
|
||||
0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
|
||||
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF,
|
||||
0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
|
||||
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF,
|
||||
0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF,
|
||||
0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000,
|
||||
0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
|
||||
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40,
|
||||
0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE,
|
||||
0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
|
||||
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000,
|
||||
0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB,
|
||||
0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
|
||||
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000,
|
||||
0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
|
||||
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF,
|
||||
0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
|
||||
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF,
|
||||
0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
|
||||
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718,
|
||||
0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
|
||||
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF,
|
||||
0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE,
|
||||
0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
|
||||
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
|
||||
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE,
|
||||
0xFFFFFFFF, 0x77FFFFFF,
|
||||
};
|
||||
static const unsigned char nmstrtPages[] = {
|
||||
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B,
|
||||
0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
static const unsigned char namePages[] = {
|
||||
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21,
|
||||
0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
-393
@@ -1,393 +0,0 @@
|
||||
/* ==========================================================================
|
||||
* siphash.h - SipHash-2-4 in a single header file
|
||||
* --------------------------------------------------------------------------
|
||||
* Derived by William Ahern from the reference implementation[1] published[2]
|
||||
* by Jean-Philippe Aumasson and Daniel J. Berstein.
|
||||
* Minimal changes by Sebastian Pipping and Victor Stinner on top, see below.
|
||||
* Licensed under the CC0 Public Domain Dedication license.
|
||||
*
|
||||
* 1. https://www.131002.net/siphash/siphash24.c
|
||||
* 2. https://www.131002.net/siphash/
|
||||
* --------------------------------------------------------------------------
|
||||
* HISTORY:
|
||||
*
|
||||
* 2020-10-03 (Sebastian Pipping)
|
||||
* - Drop support for Visual Studio 9.0/2008 and earlier
|
||||
*
|
||||
* 2019-08-03 (Sebastian Pipping)
|
||||
* - Mark part of sip24_valid as to be excluded from clang-format
|
||||
* - Re-format code using clang-format 9
|
||||
*
|
||||
* 2018-07-08 (Anton Maklakov)
|
||||
* - Add "fall through" markers for GCC's -Wimplicit-fallthrough
|
||||
*
|
||||
* 2017-11-03 (Sebastian Pipping)
|
||||
* - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined
|
||||
*
|
||||
* 2017-07-25 (Vadim Zeitlin)
|
||||
* - Fix use of SIPHASH_MAIN macro
|
||||
*
|
||||
* 2017-07-05 (Sebastian Pipping)
|
||||
* - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++
|
||||
* - Add const qualifiers at two places
|
||||
* - Ensure <=80 characters line length (assuming tab width 4)
|
||||
*
|
||||
* 2017-06-23 (Victor Stinner)
|
||||
* - Address Win64 compile warnings
|
||||
*
|
||||
* 2017-06-18 (Sebastian Pipping)
|
||||
* - Clarify license note in the header
|
||||
* - Address C89 issues:
|
||||
* - Stop using inline keyword (and let compiler decide)
|
||||
* - Replace _Bool by int
|
||||
* - Turn macro siphash24 into a function
|
||||
* - Address invalid conversion (void pointer) by explicit cast
|
||||
* - Address lack of stdint.h for Visual Studio 2003 to 2008
|
||||
* - Always expose sip24_valid (for self-tests)
|
||||
*
|
||||
* 2012-11-04 - Born. (William Ahern)
|
||||
* --------------------------------------------------------------------------
|
||||
* USAGE:
|
||||
*
|
||||
* SipHash-2-4 takes as input two 64-bit words as the key, some number of
|
||||
* message bytes, and outputs a 64-bit word as the message digest. This
|
||||
* implementation employs two data structures: a struct sipkey for
|
||||
* representing the key, and a struct siphash for representing the hash
|
||||
* state.
|
||||
*
|
||||
* For converting a 16-byte unsigned char array to a key, use either the
|
||||
* macro sip_keyof or the routine sip_tokey. The former instantiates a
|
||||
* compound literal key, while the latter requires a key object as a
|
||||
* parameter.
|
||||
*
|
||||
* unsigned char secret[16];
|
||||
* arc4random_buf(secret, sizeof secret);
|
||||
* struct sipkey *key = sip_keyof(secret);
|
||||
*
|
||||
* For hashing a message, use either the convenience macro siphash24 or the
|
||||
* routines sip24_init, sip24_update, and sip24_final.
|
||||
*
|
||||
* struct siphash state;
|
||||
* void *msg;
|
||||
* size_t len;
|
||||
* uint64_t hash;
|
||||
*
|
||||
* sip24_init(&state, key);
|
||||
* sip24_update(&state, msg, len);
|
||||
* hash = sip24_final(&state);
|
||||
*
|
||||
* or
|
||||
*
|
||||
* hash = siphash24(msg, len, key);
|
||||
*
|
||||
* To convert the 64-bit hash value to a canonical 8-byte little-endian
|
||||
* binary representation, use either the macro sip_binof or the routine
|
||||
* sip_tobin. The former instantiates and returns a compound literal array,
|
||||
* while the latter requires an array object as a parameter.
|
||||
* --------------------------------------------------------------------------
|
||||
* NOTES:
|
||||
*
|
||||
* o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers
|
||||
* lacking compound literal support. Instead, you must use the lower-level
|
||||
* interfaces which take as parameters the temporary state objects.
|
||||
*
|
||||
* o Uppercase macros may evaluate parameters more than once. Lowercase
|
||||
* macros should not exhibit any such side effects.
|
||||
* ==========================================================================
|
||||
*/
|
||||
#ifndef SIPHASH_H
|
||||
#define SIPHASH_H
|
||||
|
||||
#include <stddef.h> /* size_t */
|
||||
#include <stdint.h> /* uint64_t uint32_t uint8_t */
|
||||
|
||||
/*
|
||||
* Workaround to not require a C++11 compiler for using ULL suffix
|
||||
* if this code is included and compiled as C++; related GCC warning is:
|
||||
* warning: use of C++11 long long integer constant [-Wlong-long]
|
||||
*/
|
||||
#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low)
|
||||
|
||||
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
|
||||
|
||||
#define SIP_U32TO8_LE(p, v) \
|
||||
(p)[0] = (uint8_t)((v) >> 0); \
|
||||
(p)[1] = (uint8_t)((v) >> 8); \
|
||||
(p)[2] = (uint8_t)((v) >> 16); \
|
||||
(p)[3] = (uint8_t)((v) >> 24);
|
||||
|
||||
#define SIP_U64TO8_LE(p, v) \
|
||||
SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \
|
||||
SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
|
||||
|
||||
#define SIP_U8TO64_LE(p) \
|
||||
(((uint64_t)((p)[0]) << 0) | ((uint64_t)((p)[1]) << 8) \
|
||||
| ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24) \
|
||||
| ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) \
|
||||
| ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))
|
||||
|
||||
#define SIPHASH_INITIALIZER \
|
||||
{ 0, 0, 0, 0, {0}, 0, 0 }
|
||||
|
||||
struct siphash {
|
||||
uint64_t v0, v1, v2, v3;
|
||||
|
||||
unsigned char buf[8], *p;
|
||||
uint64_t c;
|
||||
}; /* struct siphash */
|
||||
|
||||
#define SIP_KEYLEN 16
|
||||
|
||||
struct sipkey {
|
||||
uint64_t k[2];
|
||||
}; /* struct sipkey */
|
||||
|
||||
#define sip_keyof(k) sip_tokey(&(struct sipkey){{0}}, (k))
|
||||
|
||||
static struct sipkey *
|
||||
sip_tokey(struct sipkey *key, const void *src) {
|
||||
key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
|
||||
key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
|
||||
return key;
|
||||
} /* sip_tokey() */
|
||||
|
||||
#ifdef SIPHASH_TOBIN
|
||||
|
||||
# define sip_binof(v) sip_tobin((unsigned char[8]){0}, (v))
|
||||
|
||||
static void *
|
||||
sip_tobin(void *dst, uint64_t u64) {
|
||||
SIP_U64TO8_LE((unsigned char *)dst, u64);
|
||||
return dst;
|
||||
} /* sip_tobin() */
|
||||
|
||||
#endif /* SIPHASH_TOBIN */
|
||||
|
||||
static void
|
||||
sip_round(struct siphash *H, const int rounds) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < rounds; i++) {
|
||||
H->v0 += H->v1;
|
||||
H->v1 = SIP_ROTL(H->v1, 13);
|
||||
H->v1 ^= H->v0;
|
||||
H->v0 = SIP_ROTL(H->v0, 32);
|
||||
|
||||
H->v2 += H->v3;
|
||||
H->v3 = SIP_ROTL(H->v3, 16);
|
||||
H->v3 ^= H->v2;
|
||||
|
||||
H->v0 += H->v3;
|
||||
H->v3 = SIP_ROTL(H->v3, 21);
|
||||
H->v3 ^= H->v0;
|
||||
|
||||
H->v2 += H->v1;
|
||||
H->v1 = SIP_ROTL(H->v1, 17);
|
||||
H->v1 ^= H->v2;
|
||||
H->v2 = SIP_ROTL(H->v2, 32);
|
||||
}
|
||||
} /* sip_round() */
|
||||
|
||||
static struct siphash *
|
||||
sip24_init(struct siphash *H, const struct sipkey *key) {
|
||||
H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
|
||||
H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
|
||||
H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
|
||||
H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
|
||||
|
||||
H->p = H->buf;
|
||||
H->c = 0;
|
||||
|
||||
return H;
|
||||
} /* sip24_init() */
|
||||
|
||||
#define sip_endof(a) (&(a)[sizeof(a) / sizeof *(a)])
|
||||
|
||||
static struct siphash *
|
||||
sip24_update(struct siphash *H, const void *src, size_t len) {
|
||||
const unsigned char *p = (const unsigned char *)src, *pe = p + len;
|
||||
uint64_t m;
|
||||
|
||||
do {
|
||||
while (p < pe && H->p < sip_endof(H->buf))
|
||||
*H->p++ = *p++;
|
||||
|
||||
if (H->p < sip_endof(H->buf))
|
||||
break;
|
||||
|
||||
m = SIP_U8TO64_LE(H->buf);
|
||||
H->v3 ^= m;
|
||||
sip_round(H, 2);
|
||||
H->v0 ^= m;
|
||||
|
||||
H->p = H->buf;
|
||||
H->c += 8;
|
||||
} while (p < pe);
|
||||
|
||||
return H;
|
||||
} /* sip24_update() */
|
||||
|
||||
static uint64_t
|
||||
sip24_final(struct siphash *H) {
|
||||
const char left = (char)(H->p - H->buf);
|
||||
uint64_t b = (H->c + left) << 56;
|
||||
|
||||
switch (left) {
|
||||
case 7:
|
||||
b |= (uint64_t)H->buf[6] << 48;
|
||||
/* fall through */
|
||||
case 6:
|
||||
b |= (uint64_t)H->buf[5] << 40;
|
||||
/* fall through */
|
||||
case 5:
|
||||
b |= (uint64_t)H->buf[4] << 32;
|
||||
/* fall through */
|
||||
case 4:
|
||||
b |= (uint64_t)H->buf[3] << 24;
|
||||
/* fall through */
|
||||
case 3:
|
||||
b |= (uint64_t)H->buf[2] << 16;
|
||||
/* fall through */
|
||||
case 2:
|
||||
b |= (uint64_t)H->buf[1] << 8;
|
||||
/* fall through */
|
||||
case 1:
|
||||
b |= (uint64_t)H->buf[0] << 0;
|
||||
/* fall through */
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
||||
H->v3 ^= b;
|
||||
sip_round(H, 2);
|
||||
H->v0 ^= b;
|
||||
H->v2 ^= 0xff;
|
||||
sip_round(H, 4);
|
||||
|
||||
return H->v0 ^ H->v1 ^ H->v2 ^ H->v3;
|
||||
} /* sip24_final() */
|
||||
|
||||
static uint64_t
|
||||
siphash24(const void *src, size_t len, const struct sipkey *key) {
|
||||
struct siphash state = SIPHASH_INITIALIZER;
|
||||
return sip24_final(sip24_update(sip24_init(&state, key), src, len));
|
||||
} /* siphash24() */
|
||||
|
||||
/*
|
||||
* SipHash-2-4 output with
|
||||
* k = 00 01 02 ...
|
||||
* and
|
||||
* in = (empty string)
|
||||
* in = 00 (1 byte)
|
||||
* in = 00 01 (2 bytes)
|
||||
* in = 00 01 02 (3 bytes)
|
||||
* ...
|
||||
* in = 00 01 02 ... 3e (63 bytes)
|
||||
*/
|
||||
static int
|
||||
sip24_valid(void) {
|
||||
/* clang-format off */
|
||||
static const unsigned char vectors[64][8] = {
|
||||
{ 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
|
||||
{ 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
|
||||
{ 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
|
||||
{ 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
|
||||
{ 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
|
||||
{ 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
|
||||
{ 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
|
||||
{ 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
|
||||
{ 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
|
||||
{ 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
|
||||
{ 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
|
||||
{ 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
|
||||
{ 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
|
||||
{ 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
|
||||
{ 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
|
||||
{ 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
|
||||
{ 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
|
||||
{ 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
|
||||
{ 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
|
||||
{ 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
|
||||
{ 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
|
||||
{ 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
|
||||
{ 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
|
||||
{ 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
|
||||
{ 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
|
||||
{ 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
|
||||
{ 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
|
||||
{ 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
|
||||
{ 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
|
||||
{ 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
|
||||
{ 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
|
||||
{ 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
|
||||
{ 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
|
||||
{ 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
|
||||
{ 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
|
||||
{ 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
|
||||
{ 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
|
||||
{ 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
|
||||
{ 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
|
||||
{ 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
|
||||
{ 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
|
||||
{ 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
|
||||
{ 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
|
||||
{ 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
|
||||
{ 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
|
||||
{ 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
|
||||
{ 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
|
||||
{ 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
|
||||
{ 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
|
||||
{ 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
|
||||
{ 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
|
||||
{ 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
|
||||
{ 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
|
||||
{ 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
|
||||
{ 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
|
||||
{ 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
|
||||
{ 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
|
||||
{ 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
|
||||
{ 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
|
||||
{ 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
|
||||
{ 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
|
||||
{ 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
|
||||
{ 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
|
||||
{ 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
unsigned char in[64];
|
||||
struct sipkey k;
|
||||
size_t i;
|
||||
|
||||
sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011"
|
||||
"\012\013\014\015\016\017");
|
||||
|
||||
for (i = 0; i < sizeof in; ++i) {
|
||||
in[i] = (unsigned char)i;
|
||||
|
||||
if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
} /* sip24_valid() */
|
||||
|
||||
#ifdef SIPHASH_MAIN
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
int
|
||||
main(void) {
|
||||
const int ok = sip24_valid();
|
||||
|
||||
if (ok)
|
||||
puts("OK");
|
||||
else
|
||||
puts("FAIL");
|
||||
|
||||
return ! ok;
|
||||
} /* main() */
|
||||
|
||||
#endif /* SIPHASH_MAIN */
|
||||
|
||||
#endif /* SIPHASH_H */
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
|
||||
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
|
||||
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
|
||||
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
|
||||
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
|
||||
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2005 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#ifndef WINCONFIG_H
|
||||
#define WINCONFIG_H
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif /* ndef WINCONFIG_H */
|
||||
-8251
File diff suppressed because it is too large
Load Diff
-1256
File diff suppressed because it is too large
Load Diff
-142
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#ifndef XmlRole_INCLUDED
|
||||
#define XmlRole_INCLUDED 1
|
||||
|
||||
#ifdef __VMS
|
||||
/* 0 1 2 3 0 1 2 3
|
||||
1234567890123456789012345678901 1234567890123456789012345678901 */
|
||||
# define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
|
||||
#endif
|
||||
|
||||
#include "xmltok.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
XML_ROLE_ERROR = -1,
|
||||
XML_ROLE_NONE = 0,
|
||||
XML_ROLE_XML_DECL,
|
||||
XML_ROLE_INSTANCE_START,
|
||||
XML_ROLE_DOCTYPE_NONE,
|
||||
XML_ROLE_DOCTYPE_NAME,
|
||||
XML_ROLE_DOCTYPE_SYSTEM_ID,
|
||||
XML_ROLE_DOCTYPE_PUBLIC_ID,
|
||||
XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
|
||||
XML_ROLE_DOCTYPE_CLOSE,
|
||||
XML_ROLE_GENERAL_ENTITY_NAME,
|
||||
XML_ROLE_PARAM_ENTITY_NAME,
|
||||
XML_ROLE_ENTITY_NONE,
|
||||
XML_ROLE_ENTITY_VALUE,
|
||||
XML_ROLE_ENTITY_SYSTEM_ID,
|
||||
XML_ROLE_ENTITY_PUBLIC_ID,
|
||||
XML_ROLE_ENTITY_COMPLETE,
|
||||
XML_ROLE_ENTITY_NOTATION_NAME,
|
||||
XML_ROLE_NOTATION_NONE,
|
||||
XML_ROLE_NOTATION_NAME,
|
||||
XML_ROLE_NOTATION_SYSTEM_ID,
|
||||
XML_ROLE_NOTATION_NO_SYSTEM_ID,
|
||||
XML_ROLE_NOTATION_PUBLIC_ID,
|
||||
XML_ROLE_ATTRIBUTE_NAME,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ID,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
|
||||
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
|
||||
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
|
||||
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
|
||||
XML_ROLE_ATTLIST_NONE,
|
||||
XML_ROLE_ATTLIST_ELEMENT_NAME,
|
||||
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
|
||||
XML_ROLE_ELEMENT_NONE,
|
||||
XML_ROLE_ELEMENT_NAME,
|
||||
XML_ROLE_CONTENT_ANY,
|
||||
XML_ROLE_CONTENT_EMPTY,
|
||||
XML_ROLE_CONTENT_PCDATA,
|
||||
XML_ROLE_GROUP_OPEN,
|
||||
XML_ROLE_GROUP_CLOSE,
|
||||
XML_ROLE_GROUP_CLOSE_REP,
|
||||
XML_ROLE_GROUP_CLOSE_OPT,
|
||||
XML_ROLE_GROUP_CLOSE_PLUS,
|
||||
XML_ROLE_GROUP_CHOICE,
|
||||
XML_ROLE_GROUP_SEQUENCE,
|
||||
XML_ROLE_CONTENT_ELEMENT,
|
||||
XML_ROLE_CONTENT_ELEMENT_REP,
|
||||
XML_ROLE_CONTENT_ELEMENT_OPT,
|
||||
XML_ROLE_CONTENT_ELEMENT_PLUS,
|
||||
XML_ROLE_PI,
|
||||
XML_ROLE_COMMENT,
|
||||
#ifdef XML_DTD
|
||||
XML_ROLE_TEXT_DECL,
|
||||
XML_ROLE_IGNORE_SECT,
|
||||
XML_ROLE_INNER_PARAM_ENTITY_REF,
|
||||
#endif /* XML_DTD */
|
||||
XML_ROLE_PARAM_ENTITY_REF
|
||||
};
|
||||
|
||||
typedef struct prolog_state {
|
||||
int(PTRCALL *handler)(struct prolog_state *state, int tok, const char *ptr,
|
||||
const char *end, const ENCODING *enc);
|
||||
unsigned level;
|
||||
int role_none;
|
||||
#ifdef XML_DTD
|
||||
unsigned includeLevel;
|
||||
int documentEntity;
|
||||
int inEntityValue;
|
||||
#endif /* XML_DTD */
|
||||
} PROLOG_STATE;
|
||||
|
||||
void XmlPrologStateInit(PROLOG_STATE *);
|
||||
#ifdef XML_DTD
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#define XmlTokenRole(state, tok, ptr, end, enc) \
|
||||
(((state)->handler)(state, tok, ptr, end, enc))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not XmlRole_INCLUDED */
|
||||
-1677
File diff suppressed because it is too large
Load Diff
-319
@@ -1,319 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2005 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#ifndef XmlTok_INCLUDED
|
||||
#define XmlTok_INCLUDED 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The following token may be returned by XmlContentTok */
|
||||
#define XML_TOK_TRAILING_RSQB \
|
||||
-5 /* ] or ]] at the end of the scan; might be \
|
||||
start of illegal ]]> sequence */
|
||||
/* The following tokens may be returned by both XmlPrologTok and
|
||||
XmlContentTok.
|
||||
*/
|
||||
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
|
||||
#define XML_TOK_TRAILING_CR \
|
||||
-3 /* A CR at the end of the scan; \
|
||||
might be part of CRLF sequence */
|
||||
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
|
||||
#define XML_TOK_PARTIAL -1 /* only part of a token */
|
||||
#define XML_TOK_INVALID 0
|
||||
|
||||
/* The following tokens are returned by XmlContentTok; some are also
|
||||
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
|
||||
*/
|
||||
#define XML_TOK_START_TAG_WITH_ATTS 1
|
||||
#define XML_TOK_START_TAG_NO_ATTS 2
|
||||
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
|
||||
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
|
||||
#define XML_TOK_END_TAG 5
|
||||
#define XML_TOK_DATA_CHARS 6
|
||||
#define XML_TOK_DATA_NEWLINE 7
|
||||
#define XML_TOK_CDATA_SECT_OPEN 8
|
||||
#define XML_TOK_ENTITY_REF 9
|
||||
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
|
||||
|
||||
/* The following tokens may be returned by both XmlPrologTok and
|
||||
XmlContentTok.
|
||||
*/
|
||||
#define XML_TOK_PI 11 /* processing instruction */
|
||||
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
|
||||
#define XML_TOK_COMMENT 13
|
||||
#define XML_TOK_BOM 14 /* Byte order mark */
|
||||
|
||||
/* The following tokens are returned only by XmlPrologTok */
|
||||
#define XML_TOK_PROLOG_S 15
|
||||
#define XML_TOK_DECL_OPEN 16 /* <!foo */
|
||||
#define XML_TOK_DECL_CLOSE 17 /* > */
|
||||
#define XML_TOK_NAME 18
|
||||
#define XML_TOK_NMTOKEN 19
|
||||
#define XML_TOK_POUND_NAME 20 /* #name */
|
||||
#define XML_TOK_OR 21 /* | */
|
||||
#define XML_TOK_PERCENT 22
|
||||
#define XML_TOK_OPEN_PAREN 23
|
||||
#define XML_TOK_CLOSE_PAREN 24
|
||||
#define XML_TOK_OPEN_BRACKET 25
|
||||
#define XML_TOK_CLOSE_BRACKET 26
|
||||
#define XML_TOK_LITERAL 27
|
||||
#define XML_TOK_PARAM_ENTITY_REF 28
|
||||
#define XML_TOK_INSTANCE_START 29
|
||||
|
||||
/* The following occur only in element type declarations */
|
||||
#define XML_TOK_NAME_QUESTION 30 /* name? */
|
||||
#define XML_TOK_NAME_ASTERISK 31 /* name* */
|
||||
#define XML_TOK_NAME_PLUS 32 /* name+ */
|
||||
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
|
||||
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
|
||||
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
|
||||
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
|
||||
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
|
||||
#define XML_TOK_COMMA 38
|
||||
|
||||
/* The following token is returned only by XmlAttributeValueTok */
|
||||
#define XML_TOK_ATTRIBUTE_VALUE_S 39
|
||||
|
||||
/* The following token is returned only by XmlCdataSectionTok */
|
||||
#define XML_TOK_CDATA_SECT_CLOSE 40
|
||||
|
||||
/* With namespace processing this is returned by XmlPrologTok for a
|
||||
name with a colon.
|
||||
*/
|
||||
#define XML_TOK_PREFIXED_NAME 41
|
||||
|
||||
#ifdef XML_DTD
|
||||
# define XML_TOK_IGNORE_SECT 42
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#ifdef XML_DTD
|
||||
# define XML_N_STATES 4
|
||||
#else /* not XML_DTD */
|
||||
# define XML_N_STATES 3
|
||||
#endif /* not XML_DTD */
|
||||
|
||||
#define XML_PROLOG_STATE 0
|
||||
#define XML_CONTENT_STATE 1
|
||||
#define XML_CDATA_SECTION_STATE 2
|
||||
#ifdef XML_DTD
|
||||
# define XML_IGNORE_SECTION_STATE 3
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#define XML_N_LITERAL_TYPES 2
|
||||
#define XML_ATTRIBUTE_VALUE_LITERAL 0
|
||||
#define XML_ENTITY_VALUE_LITERAL 1
|
||||
|
||||
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
|
||||
#define XML_UTF8_ENCODE_MAX 4
|
||||
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
|
||||
#define XML_UTF16_ENCODE_MAX 2
|
||||
|
||||
typedef struct position {
|
||||
/* first line and first column are 0 not 1 */
|
||||
XML_Size lineNumber;
|
||||
XML_Size columnNumber;
|
||||
} POSITION;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
const char *valuePtr;
|
||||
const char *valueEnd;
|
||||
char normalized;
|
||||
} ATTRIBUTE;
|
||||
|
||||
struct encoding;
|
||||
typedef struct encoding ENCODING;
|
||||
|
||||
typedef int(PTRCALL *SCANNER)(const ENCODING *, const char *, const char *,
|
||||
const char **);
|
||||
|
||||
enum XML_Convert_Result {
|
||||
XML_CONVERT_COMPLETED = 0,
|
||||
XML_CONVERT_INPUT_INCOMPLETE = 1,
|
||||
XML_CONVERT_OUTPUT_EXHAUSTED
|
||||
= 2 /* and therefore potentially input remaining as well */
|
||||
};
|
||||
|
||||
struct encoding {
|
||||
SCANNER scanners[XML_N_STATES];
|
||||
SCANNER literalScanners[XML_N_LITERAL_TYPES];
|
||||
int(PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *,
|
||||
const char *);
|
||||
int(PTRFASTCALL *nameLength)(const ENCODING *, const char *);
|
||||
const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
|
||||
int(PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
|
||||
ATTRIBUTE *atts);
|
||||
int(PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
|
||||
int(PTRCALL *predefinedEntityName)(const ENCODING *, const char *,
|
||||
const char *);
|
||||
void(PTRCALL *updatePosition)(const ENCODING *, const char *ptr,
|
||||
const char *end, POSITION *);
|
||||
int(PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr,
|
||||
const char *end, const char **badPtr);
|
||||
enum XML_Convert_Result(PTRCALL *utf8Convert)(const ENCODING *enc,
|
||||
const char **fromP,
|
||||
const char *fromLim, char **toP,
|
||||
const char *toLim);
|
||||
enum XML_Convert_Result(PTRCALL *utf16Convert)(const ENCODING *enc,
|
||||
const char **fromP,
|
||||
const char *fromLim,
|
||||
unsigned short **toP,
|
||||
const unsigned short *toLim);
|
||||
int minBytesPerChar;
|
||||
char isUtf8;
|
||||
char isUtf16;
|
||||
};
|
||||
|
||||
/* Scan the string starting at ptr until the end of the next complete
|
||||
token, but do not scan past eptr. Return an integer giving the
|
||||
type of token.
|
||||
|
||||
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
|
||||
|
||||
Return XML_TOK_PARTIAL when the string does not contain a complete
|
||||
token; nextTokPtr will not be set.
|
||||
|
||||
Return XML_TOK_INVALID when the string does not start a valid
|
||||
token; nextTokPtr will be set to point to the character which made
|
||||
the token invalid.
|
||||
|
||||
Otherwise the string starts with a valid token; nextTokPtr will be
|
||||
set to point to the character following the end of that token.
|
||||
|
||||
Each data character counts as a single token, but adjacent data
|
||||
characters may be returned together. Similarly for characters in
|
||||
the prolog outside literals, comments and processing instructions.
|
||||
*/
|
||||
|
||||
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
|
||||
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#ifdef XML_DTD
|
||||
|
||||
# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#endif /* XML_DTD */
|
||||
|
||||
/* This is used for performing a 2nd-level tokenization on the content
|
||||
of a literal that has already been returned by XmlTok.
|
||||
*/
|
||||
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
|
||||
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
|
||||
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
|
||||
|
||||
#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
|
||||
|
||||
#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
|
||||
|
||||
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
|
||||
(((enc)->getAtts)(enc, ptr, attsMax, atts))
|
||||
|
||||
#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
|
||||
|
||||
#define XmlPredefinedEntityName(enc, ptr, end) \
|
||||
(((enc)->predefinedEntityName)(enc, ptr, end))
|
||||
|
||||
#define XmlUpdatePosition(enc, ptr, end, pos) \
|
||||
(((enc)->updatePosition)(enc, ptr, end, pos))
|
||||
|
||||
#define XmlIsPublicId(enc, ptr, end, badPtr) \
|
||||
(((enc)->isPublicId)(enc, ptr, end, badPtr))
|
||||
|
||||
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
typedef struct {
|
||||
ENCODING initEnc;
|
||||
const ENCODING **encPtr;
|
||||
} INIT_ENCODING;
|
||||
|
||||
int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
|
||||
const char *ptr, const char *end, const char **badPtr,
|
||||
const char **versionPtr, const char **versionEndPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr, int *standalonePtr);
|
||||
|
||||
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
const ENCODING *XmlGetUtf8InternalEncoding(void);
|
||||
const ENCODING *XmlGetUtf16InternalEncoding(void);
|
||||
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
|
||||
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
|
||||
int XmlSizeOfUnknownEncoding(void);
|
||||
|
||||
typedef int(XMLCALL *CONVERTER)(void *userData, const char *p);
|
||||
|
||||
ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert,
|
||||
void *userData);
|
||||
|
||||
int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
|
||||
const char *ptr, const char *end, const char **badPtr,
|
||||
const char **versionPtr, const char **versionEndPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr, int *standalonePtr);
|
||||
|
||||
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
|
||||
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
|
||||
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
|
||||
void *userData);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not XmlTok_INCLUDED */
|
||||
-1817
File diff suppressed because it is too large
Load Diff
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2017-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
enum {
|
||||
BT_NONXML, /* e.g. noncharacter-FFFF */
|
||||
BT_MALFORM, /* illegal, with regard to encoding */
|
||||
BT_LT, /* less than = "<" */
|
||||
BT_AMP, /* ampersand = "&" */
|
||||
BT_RSQB, /* right square bracket = "[" */
|
||||
BT_LEAD2, /* lead byte of a 2-byte UTF-8 character */
|
||||
BT_LEAD3, /* lead byte of a 3-byte UTF-8 character */
|
||||
BT_LEAD4, /* lead byte of a 4-byte UTF-8 character */
|
||||
BT_TRAIL, /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */
|
||||
BT_CR, /* carriage return = "\r" */
|
||||
BT_LF, /* line feed = "\n" */
|
||||
BT_GT, /* greater than = ">" */
|
||||
BT_QUOT, /* quotation character = "\"" */
|
||||
BT_APOS, /* aposthrophe = "'" */
|
||||
BT_EQUALS, /* equal sign = "=" */
|
||||
BT_QUEST, /* question mark = "?" */
|
||||
BT_EXCL, /* exclamation mark = "!" */
|
||||
BT_SOL, /* solidus, slash = "/" */
|
||||
BT_SEMI, /* semicolon = ";" */
|
||||
BT_NUM, /* number sign = "#" */
|
||||
BT_LSQB, /* left square bracket = "[" */
|
||||
BT_S, /* white space, e.g. "\t", " "[, "\r"] */
|
||||
BT_NMSTRT, /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */
|
||||
BT_COLON, /* colon = ":" */
|
||||
BT_HEX, /* hex letter = "A".."F" + "a".."f" */
|
||||
BT_DIGIT, /* digit = "0".."9" */
|
||||
BT_NAME, /* dot and middle dot = "." + chr(0xb7) */
|
||||
BT_MINUS, /* minus = "-" */
|
||||
BT_OTHER, /* known not to be a name or name start character */
|
||||
BT_NONASCII, /* might be a name or name start character */
|
||||
BT_PERCNT, /* percent sign = "%" */
|
||||
BT_LPAR, /* left parenthesis = "(" */
|
||||
BT_RPAR, /* right parenthesis = "(" */
|
||||
BT_AST, /* asterisk = "*" */
|
||||
BT_PLUS, /* plus sign = "+" */
|
||||
BT_COMMA, /* comma = "," */
|
||||
BT_VERBAR /* vertical bar = "|" */
|
||||
};
|
||||
|
||||
#include <stddef.h>
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
/* This file is included!
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
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 furnished 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, FITNESS 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.
|
||||
*/
|
||||
|
||||
#ifdef XML_TOK_NS_C
|
||||
|
||||
const ENCODING *
|
||||
NS(XmlGetUtf8InternalEncoding)(void) {
|
||||
return &ns(internal_utf8_encoding).enc;
|
||||
}
|
||||
|
||||
const ENCODING *
|
||||
NS(XmlGetUtf16InternalEncoding)(void) {
|
||||
# if BYTEORDER == 1234
|
||||
return &ns(internal_little2_encoding).enc;
|
||||
# elif BYTEORDER == 4321
|
||||
return &ns(internal_big2_encoding).enc;
|
||||
# else
|
||||
const short n = 1;
|
||||
return (*(const char *)&n ? &ns(internal_little2_encoding).enc
|
||||
: &ns(internal_big2_encoding).enc);
|
||||
# endif
|
||||
}
|
||||
|
||||
static const ENCODING *const NS(encodings)[] = {
|
||||
&ns(latin1_encoding).enc, &ns(ascii_encoding).enc,
|
||||
&ns(utf8_encoding).enc, &ns(big2_encoding).enc,
|
||||
&ns(big2_encoding).enc, &ns(little2_encoding).enc,
|
||||
&ns(utf8_encoding).enc /* NO_ENC */
|
||||
};
|
||||
|
||||
static int PTRCALL
|
||||
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr) {
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE,
|
||||
ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
static int PTRCALL
|
||||
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
const char **nextTokPtr) {
|
||||
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE,
|
||||
ptr, end, nextTokPtr);
|
||||
}
|
||||
|
||||
int
|
||||
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
|
||||
const char *name) {
|
||||
int i = getEncodingIndex(name);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
SET_INIT_ENC_INDEX(p, i);
|
||||
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
|
||||
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
|
||||
p->initEnc.updatePosition = initUpdatePosition;
|
||||
p->encPtr = encPtr;
|
||||
*encPtr = &(p->initEnc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const ENCODING *
|
||||
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
|
||||
# define ENCODING_MAX 128
|
||||
char buf[ENCODING_MAX];
|
||||
char *p = buf;
|
||||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
if (ptr != end)
|
||||
return 0;
|
||||
*p = 0;
|
||||
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
|
||||
return enc;
|
||||
i = getEncodingIndex(buf);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
return NS(encodings)[i];
|
||||
}
|
||||
|
||||
int
|
||||
NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc,
|
||||
const char *ptr, const char *end, const char **badPtr,
|
||||
const char **versionPtr, const char **versionEndPtr,
|
||||
const char **encodingName, const ENCODING **encoding,
|
||||
int *standalone) {
|
||||
return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end,
|
||||
badPtr, versionPtr, versionEndPtr, encodingName,
|
||||
encoding, standalone);
|
||||
}
|
||||
|
||||
#endif /* XML_TOK_NS_C */
|
||||
@@ -1,38 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
case "@host@" in
|
||||
*-mingw*)
|
||||
exec wine "$@"
|
||||
;;
|
||||
*)
|
||||
exec "$@"
|
||||
;;
|
||||
esac
|
||||
@@ -1,44 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2019 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
set -e
|
||||
top_srcdir="$(dirname "$(type -p "$0")")"
|
||||
top_builddir=..
|
||||
|
||||
# Suck up all dash-dash test-driver arguments
|
||||
test_driver_args=()
|
||||
while [[ ${1} != '--' ]]; do
|
||||
test_driver_args=( "${test_driver_args[@]}" "${1}" )
|
||||
shift
|
||||
done
|
||||
shift # drop "--"
|
||||
|
||||
exec "${top_srcdir}"/conftools/test-driver "${test_driver_args[@]}" "${top_builddir}"/run.sh "$@"
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
SUBDIRS = . benchmark
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
|
||||
|
||||
noinst_LIBRARIES = libruntests.a
|
||||
|
||||
check_PROGRAMS = runtests runtestspp
|
||||
TESTS = runtests runtestspp
|
||||
|
||||
# To support MinGW and Non-MinGW at the same time:
|
||||
LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
|
||||
|
||||
libruntests_a_SOURCES = \
|
||||
chardata.c \
|
||||
structdata.c \
|
||||
memcheck.c \
|
||||
minicheck.c
|
||||
|
||||
runtests_SOURCES = \
|
||||
runtests.c
|
||||
|
||||
runtestspp_SOURCES = \
|
||||
runtestspp.cpp
|
||||
|
||||
runtests_LDADD = libruntests.a ../lib/libexpatinternal.la
|
||||
runtestspp_LDADD = libruntests.a ../lib/libexpatinternal.la
|
||||
|
||||
EXTRA_DIST = \
|
||||
chardata.h \
|
||||
structdata.h \
|
||||
minicheck.h \
|
||||
memcheck.h \
|
||||
README.txt \
|
||||
udiffer.py \
|
||||
xmltest.log.expected \
|
||||
xmltest.sh
|
||||
-1269
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
This directory contains the (fledgling) test suite for Expat. The
|
||||
tests provide general unit testing and regression coverage. The tests
|
||||
are not expected to be useful examples of Expat usage; see the
|
||||
examples/ directory for that.
|
||||
|
||||
The Expat tests use a partial internal implementation of the "Check"
|
||||
unit testing framework for C. More information on Check can be found at:
|
||||
|
||||
http://check.sourceforge.net/
|
||||
|
||||
Expat must be built and, depending on platform, must be installed, before "make check" can be executed.
|
||||
|
||||
This test suite can all change in a later version.
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../../lib
|
||||
|
||||
noinst_PROGRAMS = benchmark
|
||||
|
||||
benchmark_SOURCES = benchmark.c
|
||||
|
||||
benchmark_LDADD = ../../lib/libexpat.la
|
||||
|
||||
EXTRA_DIST = \
|
||||
README.txt
|
||||
@@ -1,664 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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@
|
||||
|
||||
#
|
||||
# __ __ _
|
||||
# ___\ \/ /_ __ __ _| |_
|
||||
# / _ \\ /| '_ \ / _` | __|
|
||||
# | __// \| |_) | (_| | |_
|
||||
# \___/_/\_\ .__/ \__,_|\__|
|
||||
# |_| XML parser
|
||||
#
|
||||
# Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com>
|
||||
# Licensed under the MIT license:
|
||||
#
|
||||
# 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 furnished 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, FITNESS 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.
|
||||
|
||||
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@
|
||||
noinst_PROGRAMS = benchmark$(EXEEXT)
|
||||
subdir = tests/benchmark
|
||||
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)/conftools/ax-require-defined.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-compile-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-check-link-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-flag.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-compile-flags.m4 \
|
||||
$(top_srcdir)/conftools/ax-append-link-flags.m4 \
|
||||
$(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.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)/expat_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_benchmark_OBJECTS = benchmark.$(OBJEXT)
|
||||
benchmark_OBJECTS = $(am_benchmark_OBJECTS)
|
||||
benchmark_DEPENDENCIES = ../../lib/libexpat.la
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
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 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/benchmark.Po
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(benchmark_SOURCES)
|
||||
DIST_SOURCES = $(benchmark_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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 \
|
||||
$(top_srcdir)/conftools/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../../lib
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
|
||||
EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
|
||||
EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
|
||||
EXPAT_DTD = @EXPAT_DTD@
|
||||
EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
|
||||
EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
|
||||
EXPAT_NS = @EXPAT_NS@
|
||||
FGREP = @FGREP@
|
||||
FILEMAP = @FILEMAP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAGE = @LIBAGE@
|
||||
LIBCURRENT = @LIBCURRENT@
|
||||
LIBDIR_BASENAME = @LIBDIR_BASENAME@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBREVISION = @LIBREVISION@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SO_MAJOR = @SO_MAJOR@
|
||||
SO_MINOR = @SO_MINOR@
|
||||
SO_PATCH = @SO_PATCH@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
|
||||
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_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
|
||||
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@
|
||||
runstatedir = @runstatedir@
|
||||
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@
|
||||
benchmark_SOURCES = benchmark.c
|
||||
benchmark_LDADD = ../../lib/libexpat.la
|
||||
EXTRA_DIST = \
|
||||
README.txt
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(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 tests/benchmark/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu tests/benchmark/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__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
benchmark$(EXEEXT): $(benchmark_OBJECTS) $(benchmark_DEPENDENCIES) $(EXTRA_benchmark_DEPENDENCIES)
|
||||
@rm -f benchmark$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(benchmark_OBJECTS) $(benchmark_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
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: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(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 $(PROGRAMS)
|
||||
installdirs:
|
||||
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 clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/benchmark.Po
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
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 ./$(DEPDIR)/benchmark.Po
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
|
||||
ctags ctags-am distclean distclean-compile 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 maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
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:
|
||||
@@ -1,16 +0,0 @@
|
||||
Use this benchmark command line utility as follows:
|
||||
|
||||
benchmark [-n] <file name> <buffer size> <# iterations>
|
||||
|
||||
The command line arguments are:
|
||||
|
||||
-n ... optional; if supplied, namespace processing is turned on
|
||||
<file name> ... name/path of test xml file
|
||||
<buffer size> ... size of processing buffer;
|
||||
the file is parsed in chunks of this size
|
||||
<# iterations> ... how often will the file be parsed
|
||||
|
||||
Returns:
|
||||
|
||||
The time (in seconds) it takes to parse the test file,
|
||||
averaged over the number of iterations.@
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user