Projects
Mega:24.03
expat
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:expat.spec
Changed
@@ -1,6 +1,6 @@ %define Rversion %(echo %{version} | sed -e 's/\\./_/g' -e 's/^/R_/') Name: expat -Version: 2.6.0 +Version: 2.5.0 Release: 1 Summary: An XML parser library License: MIT @@ -59,9 +59,6 @@ %{_mandir}/man1/* %changelog -* Wed Feb 21 2024 liweigang <izmirvii@gmail.com> - 2.6.0-1 -- expat update to 2.6.0 - * Tue Jan 31 2023 zhoupengcheng <zhoupengcheng11@huawei.com> - 2.5.0-1 - expat update to 2.5.0
View file
_service:tar_scm:expat-2.6.0.tar.gz/CMake.README -> _service:tar_scm:expat-2.5.0.tar.gz/CMake.README
Changed
@@ -3,25 +3,25 @@ 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.6.0 is the source directory of expat, add a subdirectory +Assuming ~/expat-2.5.0 is the source directory of expat, add a subdirectory build and change into that directory: -~/expat-2.6.0$ mkdir build && cd build -~/expat-2.6.0/build$ +~/expat-2.5.0$ mkdir build && cd build +~/expat-2.5.0/build$ From that directory, call cmake first, then call make, make test and make install in the usual way: -~/expat-2.6.0/build$ cmake .. +~/expat-2.5.0/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.6.0/build +-- Build files have been written to: /home/patrick/expat-2.5.0/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.6.0/build$ make && make test && make install +~/expat-2.5.0/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
View file
_service:tar_scm:expat-2.6.0.tar.gz/CMakeLists.txt -> _service:tar_scm:expat-2.5.0.tar.gz/CMakeLists.txt
Changed
@@ -7,12 +7,12 @@ # # Copyright (c) 2010 Patrick Spendrin <ps_ml@gmx.de> # Copyright (c) 2012 Karl Waclawek <karl@waclawek.net> -# Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> +# Copyright (c) 2016-2022 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-2022 Rhodri James <rhodri@wildebeest.org.uk> +# 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> @@ -34,19 +34,16 @@ # Unlike most of Expat, # this file is copyrighted under the BSD-license for buildsystem files of KDE. -cmake_minimum_required(VERSION 3.5.0) +cmake_minimum_required(VERSION 3.1.3) project(expat VERSION - 2.6.0 + 2.5.0 LANGUAGES C ) -set(CMAKE_C_STANDARD 99) -set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_C_EXTENSIONS OFF) # i.e. -std=c99 rather than default -std=gnu99 -set(PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues") +set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") set(PACKAGE_NAME "expat") set(PACKAGE_VERSION "${PROJECT_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") @@ -139,12 +136,10 @@ expat_shy_set(EXPAT_WITH_LIBBSD OFF CACHE BOOL "Utilize libbsd (for arc4random_buf)") endif() expat_shy_set(EXPAT_ENABLE_INSTALL ON CACHE BOOL "Install expat files in cmake install target") -expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point, 0 to disable") +expat_shy_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) expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available") mark_as_advanced(EXPAT_DTD) -expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available") -mark_as_advanced(EXPAT_GE) expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available") mark_as_advanced(EXPAT_NS) expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors") @@ -172,20 +167,11 @@ if(EXPAT_BUILD_TESTS) # We have to call enable_language() before modifying any CMAKE_CXX_* variables enable_language(CXX) - - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) # i.e. -std=c++11 rather than default -std=gnu++11 endif() # # Environment checks # -if(EXPAT_DTD AND NOT EXPAT_GE) - message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.") - message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.") -endif() - if(EXPAT_WITH_LIBBSD) find_library(LIB_BSD NAMES bsd) if(NOT LIB_BSD) @@ -288,16 +274,12 @@ _expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO) _expat_copy_bool_int(EXPAT_DTD XML_DTD) -_expat_copy_bool_int(EXPAT_GE XML_GE) _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() -if(NOT EXPAT_CONTEXT_BYTES GREATER 0) # in particular with -DEXPAT_CONTEXT_BYTES=OFF - set(EXPAT_CONTEXT_BYTES 0) -endif() set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES}) macro(expat_install) @@ -329,10 +311,6 @@ add_definitions(/WX) else() set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror") - if(MINGW) - # To avoid "error: unknown conversion type character ‘l’ in format -Werror=format=" - set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-format") - endif() endif() endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}") @@ -403,13 +381,7 @@ endif() endmacro() - if(EXPAT_DTD OR EXPAT_GE) - set(_EXPAT_DTD_OR_GE TRUE) - else() - set(_EXPAT_DTD_OR_GE FALSE) - endif() - - _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE) + _expat_def_file_toggle(EXPAT_DTD _EXPAT_COMMENT_DTD) _expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") @@ -417,8 +389,7 @@ # Add DLL version string(REPLACE "." "," _EXPAT_DLL_VERSION ${PROJECT_VERSION}.0) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/version.rc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") - set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} win32/version.rc) endif() else() set(_SHARED STATIC) @@ -465,9 +436,9 @@ set_property(TARGET expat PROPERTY ${build_type_upper}_POSTFIX ${EXPAT_${build_type_upper}_POSTFIX}) endforeach() -set(LIBCURRENT 10) # sync -set(LIBREVISION 0) # with -set(LIBAGE 9) # configure.ac! +set(LIBCURRENT 9) # sync +set(LIBREVISION 10) # with +set(LIBAGE 8) # configure.ac! math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}") if(NOT WIN32) @@ -480,7 +451,7 @@ message(FATAL_ERROR "Expat requires CMake >=3.17 on platform \"APPLE\".") endif() - # NOTE: This intends to talk CMake into compatibility with GNU Libtool + # NOTE: This intends to talk CMake into compatiblity with GNU Libtool math(EXPR _EXPAT_MACHO_COMPATIBILITY_VERSION "${LIBCURRENT} + 1") set(_EXPAT_MACHO_CURRENT_VERSION "${_EXPAT_MACHO_COMPATIBILITY_VERSION}.${LIBREVISION}") set_property(TARGET expat PROPERTY MACHO_COMPATIBILITY_VERSION ${_EXPAT_MACHO_COMPATIBILITY_VERSION}) @@ -570,10 +541,10 @@ # if(EXPAT_BUILD_TOOLS) set(xmlwf_SRCS + xmlwf/xmlwf.c + xmlwf/xmlfile.c xmlwf/codepage.c xmlwf/readfilemap.c - xmlwf/xmlfile.c - xmlwf/xmlwf.c ) add_executable(xmlwf ${xmlwf_SRCS}) @@ -608,8 +579,10 @@ # C code examples # if(EXPAT_BUILD_EXAMPLES) - foreach(_target element_declarations elements outline) - add_executable(${_target} examples/${_target}.c) + add_executable(elements examples/elements.c) + add_executable(outline examples/outline.c) + + foreach(_target elements outline) set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) target_link_libraries(${_target} expat) endforeach() @@ -622,6 +595,14 @@ ## 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_C_SOURCES} + ) + if(NOT MSVC) if(MINGW) set(host whatever-mingw32) # for nothing but run.sh @@ -637,43 +618,9 @@ endif() endfunction() - set(_EXPAT_TEST_TARGETS runtests runtests_cxx) - - add_executable(runtests - tests/acc_tests.c - tests/alloc_tests.c - tests/basic_tests.c - tests/chardata.c
View file
_service:tar_scm:expat-2.6.0.tar.gz/Changes -> _service:tar_scm:expat-2.5.0.tar.gz/Changes
Changed
@@ -2,120 +2,6 @@ https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! -Release 2.6.0 Tue February 6 2024 - Security fixes: - #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens - that can cause denial of service, in partial where - dealing with compressed XML input. Applications - that parsed a document in one go -- a single call to - functions XML_Parse or XML_ParseBuffer -- were not affected. - The smaller the chunks/buffers you use for parsing - previously, the bigger the problem prior to the fix. - Backporters should be careful to no omit parts of - pull request #789 and to include earlier pull request #771, - in order to not break the fix. - #777 CVE-2023-52426 -- Fix billion laughs attacks for users - compiling *without* XML_DTD defined (which is not common). - Users with XML_DTD defined have been protected since - Expat >=2.4.0 (and that was CVE-2013-0340 back then). - - Bug fixes: - #753 Fix parse-size-dependent "invalid token" error for - external entities that start with a byte order mark - #780 Fix NULL pointer dereference in setContext via - XML_ExternalEntityParserCreate for compilation with - XML_DTD undefined - #812 #813 Protect against closing entities out of order - - Other changes: - #723 Improve support for arc4random/arc4random_buf - #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse - #761 #770 xmlwf: Support --help and --version - #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read - #744 xmlwf: Improve language and URL clickability in help output - #673 examples: Add new example "element_declarations.c" - #764 Be stricter about macro XML_CONTEXT_BYTES at build time - #765 Make inclusion to expat_config.h consistent - #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode - #678 #705 .. - #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 - #795 Autotools: Make installation of shipped man page doc/xmlwf.1 - independent of docbook2man availability - #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file - section "Cflags.private" in order to fix compilation - against static libexpat using pkg-config on Windows - #724 #751 Autotools|CMake: Require a C99 compiler - (a de-facto requirement already since Expat 2.2.2 of 2017) - #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable - #750 #786 Autotools|CMake: Make test suite require a C++11 compiler - #749 CMake: Require CMake >=3.5.0 - #672 CMake: Lowercase off_t and size_t to help a bug in Meson - #746 CMake: Sort xmlwf sources alphabetically - #785 CMake|Windows: Fix generation of DLL file version info - #790 CMake: Build tests/benchmark/benchmark.c as well for - a build with -DEXPAT_BUILD_TESTS=ON - #745 #757 docs: Document the importance of isFinal + adjust tests - accordingly - #736 docs: Improve use of "NULL" and "null" - #713 docs: Be specific about version of XML (XML 1.0r4) - and version of C (C99); (XML 1.0r5 will need a sponsor.) - #762 docs: reference.html: Promote function XML_ParseBuffer more - #779 docs: reference.html: Add HTML anchors to XML_* macros - #760 docs: reference.html: Upgrade to OK.css 1.2.0 - #763 #739 docs: Fix typos - #696 docs|CI: Use HTTPS URLs instead of HTTP at various places - #669 #670 .. - #692 #703 .. - #733 #772 Address compiler warnings - #798 #800 Address clang-tidy warnings - #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) - to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ - for what these numbers do - - Infrastructure: - #700 #701 docs: Document security policy in file SECURITY.md - #766 docs: Improve parse buffer variables in-code documentation - #674 #738 .. - #740 #747 .. - #748 #781 #782 Refactor coverage and conformance tests - #714 #716 Refactor debug level variables to unsigned long - #671 Improve handling of empty environment variable value - in function getDebugLevel (without visible user effect) - #755 #774 .. - #758 #783 .. - #784 #787 tests: Improve test coverage with regard to parse chunk size - #660 #797 #801 Fuzzing: Improve fuzzing coverage - #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests - #698 #721 CI: Resolve some Travis CI leftovers - #669 CI: Be robust towards absence of Git tags - #693 #694 CI: Set permissions to "contents: read" for security - #709 CI: Pin all GitHub Actions to specific commits for security - #739 CI: Reject spelling errors using codespell - #798 CI: Enforce clang-tidy clean code - #773 #808 .. - #809 #810 CI: Upgrade Clang from 15 to 18 - #796 CI: Start using Clang's Control Flow Integrity sanitizer - #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images - #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging - #763 CI: Adapt to breaking changes in codespell - #803 CI: Adapt to breaking changes in Cppcheck - - Special thanks to: - Ivan Galkin - Joyce Brum - Philippe Antoine - Rhodri James - Snild Dolkow - spookyahell - Steven Garske - and - Clang AddressSanitizer - Clang UndefinedBehaviorSanitizer - codespell - GCC Farm Project - OSS-Fuzz - Sony Mobile - Release 2.5.0 Tue October 25 2022 Security fixes: #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager @@ -125,7 +11,7 @@ arbitrary code execution. Bug fixes: - #612 #645 Fix corruption from undefined entities + #612 #645 Fix curruption from undefined entities #613 #654 Fix case when parsing was suspended while processing nested entities #616 #652 #653 Stop leaking opening tag bindings after a closing tag @@ -432,7 +318,7 @@ see https://verbump.de/ for what these numbers do Special thanks to: - Donghee Na + Dong-hee Na Joergen Ibsen Kai Pastor
View file
_service:tar_scm:expat-2.6.0.tar.gz/ConfigureChecks.cmake -> _service:tar_scm:expat-2.5.0.tar.gz/ConfigureChecks.cmake
Changed
@@ -46,11 +46,11 @@ 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) + 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") + set(OFF_T "long") + set(SIZE_T "unsigned") endif(HAVE_SYS_TYPES_H) check_c_source_compiles("
View file
_service:tar_scm:expat-2.6.0.tar.gz/Makefile.am -> _service:tar_scm:expat-2.5.0.tar.gz/Makefile.am
Changed
@@ -6,10 +6,9 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> +# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org> # Copyright (c) 2018 KangLin <kl222@126.com> # Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com> -# Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -85,7 +84,7 @@ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc.cmake + win32/version.rc EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -132,11 +131,6 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip:
View file
_service:tar_scm:expat-2.6.0.tar.gz/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/Makefile.in
Changed
@@ -22,10 +22,9 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> +# Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org> # Copyright (c) 2018 KangLin <kl222@126.com> # Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com> -# Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -137,8 +136,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -342,7 +339,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -362,7 +358,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -483,7 +478,7 @@ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc.cmake + win32/version.rc EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -511,7 +506,7 @@ .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -537,9 +532,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -550,7 +545,7 @@ stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/expat_config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -1097,11 +1092,6 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 - ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip:
View file
_service:tar_scm:expat-2.6.0.tar.gz/README.md -> _service:tar_scm:expat-2.5.0.tar.gz/README.md
Changed
@@ -1,14 +1,13 @@ -!Run Linux CI tasks(https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)(https://github.com/libexpat/libexpat/actions/workflows/linux.yml) +!Run Linux Travis CI tasks(https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)(https://github.com/libexpat/libexpat/actions/workflows/linux.yml) !AppVeyor Build Status(https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)(https://ci.appveyor.com/project/libexpat/libexpat) !Packaging status(https://repology.org/badge/tiny-repos/expat.svg)(https://repology.org/metapackage/expat/versions) !Downloads SourceForge(https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)(https://sourceforge.net/projects/expat/files/) !Downloads GitHub(https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)(https://github.com/libexpat/libexpat/releases) -# Expat, Release 2.6.0 +# Expat, Release 2.5.0 -This is Expat, a C99 library for parsing -XML 1.0 Fourth Edition(https://www.w3.org/TR/2006/REC-xml-20060816/), started by +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
View file
_service:tar_scm:expat-2.6.0.tar.gz/acinclude.m4 -> _service:tar_scm:expat-2.5.0.tar.gz/acinclude.m4
Changed
@@ -8,7 +8,5 @@ m4_include(conftools/ax-append-compile-flags.m4) m4_include(conftools/ax-append-link-flags.m4) m4_include(conftools/expatcfg-compiler-supports-visibility.m4) -m4_include(conftools/ax-cxx-compile-stdcxx.m4) -m4_include(conftools/ax-cxx-compile-stdcxx-11.m4) ### end of file
View file
_service:tar_scm:expat-2.6.0.tar.gz/aclocal.m4 -> _service:tar_scm:expat-2.5.0.tar.gz/aclocal.m4
Changed
@@ -715,42 +715,6 @@ rmdir .tst 2>/dev/null AC_SUBST(am__leading_dot)) -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE(DEFAULT-MODE) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN(AM_MAINTAINER_MODE, -m4_case(m4_default($1, disable), - enable, m4_define(am_maintainer_other, disable), - disable, m4_define(am_maintainer_other, enable), - m4_define(am_maintainer_other, enable) - m4_warn(syntax, unexpected argument to AM@&t@_MAINTAINER_MODE: $1)) -AC_MSG_CHECKING(whether to enable maintainer-specific portions of Makefiles) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE(maintainer-mode, - AS_HELP_STRING(--am_maintainer_other-maintainer-mode, - am_maintainer_other make rules and dependencies not useful - (and sometimes confusing) to the casual installer), - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=m4_if(am_maintainer_other, enable, no, yes)) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl - -) - # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc.
View file
_service:tar_scm:expat-2.6.0.tar.gz/cmake/autotools/expat-config-version.cmake.in -> _service:tar_scm:expat-2.5.0.tar.gz/cmake/autotools/expat-config-version.cmake.in
Changed
@@ -52,6 +52,11 @@ 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()
View file
_service:tar_scm:expat-2.6.0.tar.gz/cmake/autotools/expat.cmake -> _service:tar_scm:expat-2.5.0.tar.gz/cmake/autotools/expat.cmake
Changed
@@ -7,7 +7,7 @@ message(FATAL_ERROR "CMake >= 2.8.3 required") endif() cmake_policy(PUSH) -cmake_policy(VERSION 2.8.3...3.26) +cmake_policy(VERSION 2.8.3...3.22) #---------------------------------------------------------------- # Generated CMake target import file. #----------------------------------------------------------------
View file
_service:tar_scm:expat-2.6.0.tar.gz/configure -> _service:tar_scm:expat-2.5.0.tar.gz/configure
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for expat 2.6.0. +# Generated by GNU Autoconf 2.71 for expat 2.5.0. # -# Report bugs to <https://github.com/libexpat/libexpat/issues>. +# Report bugs to <expat-bugs@libexpat.org>. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -276,10 +276,10 @@ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and -$0: https://github.com/libexpat/libexpat/issues about your -$0: system, including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." +$0: expat-bugs@libexpat.org about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -621,9 +621,9 @@ # Identity of this package. PACKAGE_NAME='expat' PACKAGE_TARNAME='expat' -PACKAGE_VERSION='2.6.0' -PACKAGE_STRING='expat 2.6.0' -PACKAGE_BUGREPORT='https://github.com/libexpat/libexpat/issues' +PACKAGE_VERSION='2.5.0' +PACKAGE_STRING='expat 2.5.0' +PACKAGE_BUGREPORT='expat-bugs@libexpat.org' PACKAGE_URL='' ac_unique_file="Makefile.in" @@ -696,7 +696,6 @@ UNICODE_TRUE MINGW_FALSE MINGW_TRUE -HAVE_CXX11 WITH_TESTS_FALSE WITH_TESTS_TRUE WITH_EXAMPLES_FALSE @@ -753,9 +752,6 @@ CC ac_ct_AR AR -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -838,7 +834,6 @@ ac_user_opts=' enable_option_checking enable_silent_rules -enable_maintainer_mode enable_dependency_tracking enable_shared enable_static @@ -1420,7 +1415,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures expat 2.6.0 to adapt to many kinds of systems. +\`configure' configures expat 2.5.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1491,7 +1486,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of expat 2.6.0:";; + short | recursive ) echo "Configuration of expat 2.5.0:";; esac cat <<\_ACEOF @@ -1501,9 +1496,6 @@ --enable-FEATURE=ARG include FEATURE ARG=yes --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") - --disable-maintainer-mode - disable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -1564,7 +1556,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to <https://github.com/libexpat/libexpat/issues>. +Report bugs to <expat-bugs@libexpat.org>. _ACEOF ac_status=$? fi @@ -1628,7 +1620,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -expat configure 2.6.0 +expat configure 2.5.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2259,7 +2251,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by expat $as_me 2.6.0, which was +It was created by expat $as_me 2.5.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2545,7 +2537,9 @@ /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (char **p, int i) +static char *e (p, i) + char **p; + int i; { return pi; } @@ -2596,7 +2590,6 @@ extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); -extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -3825,7 +3818,7 @@ # Define the identity of the package. PACKAGE='expat' - VERSION='2.6.0' + VERSION='2.5.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3929,35 +3922,11 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test ${enable_maintainer_mode+y} -then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - # to allow argument --disable-maintainer-mode - - -LIBCURRENT=10 # sync -LIBREVISION=0 # with -LIBAGE=9 # CMakeLists.txt! +LIBCURRENT=9 # sync +LIBREVISION=10 # with +LIBAGE=8 # CMakeLists.txt! ac_config_headers="$ac_config_headers expat_config.h" @@ -13905,11 +13874,6 @@ -if test "${ac_cv_prog_cc_c99}" = no -then : - as_fn_error $? "Expat requires a C99 compiler." "$LINENO" 5 -fi - if test "$GCC" = yes then : @@ -14632,11 +14596,11 @@
View file
_service:tar_scm:expat-2.6.0.tar.gz/configure.ac -> _service:tar_scm:expat-2.5.0.tar.gz/configure.ac
Changed
@@ -11,7 +11,7 @@ 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-2024 Sebastian Pipping <sebastian@pipping.org> +dnl Copyright (c) 2016-2022 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> @@ -60,7 +60,7 @@ m4_ifdef(__gnu__, esyscmd(conftools/get-version.sh lib/expat.h), 2.2.x)) -AC_INIT(expat, expat_version, https://github.com/libexpat/libexpat/issues) +AC_INIT(expat, expat_version, expat-bugs@libexpat.org) m4_undefine(expat_version) AC_CONFIG_SRCDIR(Makefile.in) @@ -68,7 +68,6 @@ AC_CONFIG_MACRO_DIR(m4) AC_CANONICAL_HOST AM_INIT_AUTOMAKE -AM_MAINTAINER_MODE(enable) # to allow argument --disable-maintainer-mode dnl @@ -82,9 +81,9 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=10 # sync -LIBREVISION=0 # with -LIBAGE=9 # CMakeLists.txt! +LIBCURRENT=9 # sync +LIBREVISION=10 # with +LIBAGE=8 # CMakeLists.txt! AC_CONFIG_HEADERS(expat_config.h) AH_TOP(#ifndef EXPAT_CONFIG_H @@ -106,9 +105,6 @@ AC_LANG(C) AC_PROG_CC_C99 -AS_IF(test "${ac_cv_prog_cc_c99}" = no, - AC_MSG_ERROR(Expat requires a C99 compiler.)) - AS_IF(test "$GCC" = yes, AX_APPEND_COMPILE_FLAGS(-Wall -Wextra, AM_CFLAGS) dnl Be careful about adding the -fexceptions option; some versions of @@ -180,8 +176,6 @@ with_tests=yes) AM_CONDITIONAL(WITH_TESTS, test x${with_tests} = xyes) -AS_IF(test x${with_tests} = xyes, - AX_CXX_COMPILE_STDCXX_11(noext, mandatory)) AS_VAR_SET(EXPATCFG_ON_MINGW,no) AS_CASE("${host_os}", @@ -208,16 +202,14 @@ , AS_IF(test "x${with_libbsd}" = xyes, AC_MSG_ERROR(Enforced use of libbsd cannot be satisfied.)))) -AC_MSG_CHECKING(for arc4random_buf (BSD, libbsd or glibc 2.36+)) +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> - #else - # include <stdlib.h> /* for arc4random_buf on BSD */ #endif int main() { - char dummy123; // double brackets for m4 - arc4random_buf(dummy, 0U); + arc4random_buf(NULL, 0U); return 0; } ), @@ -225,7 +217,7 @@ AC_MSG_RESULT(yes), AC_MSG_RESULT(no) - AC_MSG_CHECKING(for arc4random (BSD, macOS, libbsd or glibc 2.36+)) + AC_MSG_CHECKING(for arc4random (BSD, macOS or libbsd)) AC_LINK_IFELSE(AC_LANG_SOURCE( #if defined(HAVE_LIBBSD) # include <bsd/stdlib.h> @@ -303,8 +295,6 @@ dnl Some basic configuration: AC_DEFINE(XML_NS, 1, Define to make XML Namespaces functionality available.) -AC_DEFINE(XML_GE, 1, - Define as 1/0 to enable/disable support for general entities.) AC_DEFINE(XML_DTD, 1, Define to make parameter entity parsing functionality available.) AC_DEFINE(XML_DEV_URANDOM, 1, @@ -329,10 +319,9 @@ 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)), - AS_VAR_SET(enable_xml_context,0)) -AC_DEFINE_UNQUOTED(XML_CONTEXT_BYTES, ${enable_xml_context}, - Define to specify how much context to retain around the current parse point, 0 to disable.) + 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, @@ -356,12 +345,8 @@ You can also configure using --without-docbook if you can do without a man page for xmlwf.))) -dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will -dnl get it installed, independent of whether some flavor of docbook2man is available. -dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. -AS_IF(test -f "${srcdir}"/doc/xmlwf.1, - AM_CONDITIONAL(WITH_DOCBOOK, true), - AM_CONDITIONAL(WITH_DOCBOOK, test "x${DOCBOOK_TO_MAN}" != x)) +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
View file
_service:tar_scm:expat-2.6.0.tar.gz/doc/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/doc/Makefile.in
Changed
@@ -132,8 +132,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -243,7 +241,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -263,7 +260,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -355,7 +351,7 @@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -379,9 +375,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps):
View file
_service:tar_scm:expat-2.6.0.tar.gz/doc/ok.min.css -> _service:tar_scm:expat-2.5.0.tar.gz/doc/ok.min.css
Changed
@@ -1,2 +1,2 @@ -/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbrtitle{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}type=button,type=reset,type=submit,button{-webkit-appearance:button}type=button::-moz-focus-inner,type=reset::-moz-focus-inner,type=submit::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}type=button:-moz-focusring,type=reset:-moz-focusring,type=submit:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}type=checkbox,type=radio{box-sizing:border-box;padding:0}type=number::-webkit-inner-spin-button,type=number::-webkit-outer-spin-button{height:auto}type=search{-webkit-appearance:textfield;outline-offset:-2px}type=search::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}hidden,template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--ok-mono:SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);background-color:var(--ok-bg-0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}role=button,button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,inputtype=checkbox,inputtype=radio,main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}inputtype=search{-webkit-appearance:none;-moz-appearance:none;appearance:none}inputtype=file{max-width:300px}inputtype=number{-moz-appearance:textfield}inputtype=checkbox,inputtype=radio{display:inline;min-width:auto}inputtype=color{height:2.5rem}inputtype=date,inputtype=datetime-local,inputtype=month,inputtype=time,inputtype=week{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}inputtype=date:before,inputtype=datetime-local:before,inputtype=month:before,inputtype=time:before,inputtype=week:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}inputtype=date:disabled:before,inputtype=datetime-local:disabled:before,inputtype=month:disabled:before,inputtype=time:disabled:before,inputtype=week:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}inputtype=range{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}inputtype=range::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}inputtype=range::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}inputtype=range::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}inputtype=range::-ms-fill-lower{background:transparent}inputtype=range::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}inputtype=range::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}inputtype=range::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}inputtype=range:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}inputtype=range:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}inputtype=range:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}inputtype=range:disabled{cursor:default}inputtype=range:disabled::-webkit-slider-runnable-track{cursor:default}inputtype=range:disabled::-moz-range-track{cursor:default}inputtype=range:disabled::-ms-track{cursor:default}inputtype=range:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}inputtype=range:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}inputtype=range:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not(multiple){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not(multiple):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}selectmultiple{border-radius:var(--ok-br)}selectmultiple:disabled{background-color:var(--ok-bg-1)}selectmultiple option{color:var(--ok-t-)}selectmultiple:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,inputtype=button,inputtype=reset,inputtype=submit{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,inputtype=button,inputtype=reset,inputtype=submit{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,inputtype=button:disabled,inputtype=reset:disabled,inputtype=submit:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),inputtype=button:focus:not(:disabled),inputtype=reset:focus:not(:disabled),inputtype=submit:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin-top:.5em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not(type=submit):not(type=button):not(type=reset):not(type=range),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not(multiple):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),inputtype=button:hover:not(:disabled),inputtype=reset:hover:not(:disabled),inputtype=submit:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file +/*! OK.css v1.0.3 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbrtitle{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}type=button,type=reset,type=submit,button{-webkit-appearance:button}type=button::-moz-focus-inner,type=reset::-moz-focus-inner,type=submit::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}type=button:-moz-focusring,type=reset:-moz-focusring,type=submit:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}type=checkbox,type=radio{box-sizing:border-box;padding:0}type=number::-webkit-inner-spin-button,type=number::-webkit-outer-spin-button{height:auto}type=search{-webkit-appearance:textfield;outline-offset:-2px}type=search::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}hidden,template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--ok-mono:SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);background-color:var(--ok-bg-0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}role=button,button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3)}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,inputtype=checkbox,inputtype=radio,main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}inputtype=search{-webkit-appearance:none;-moz-appearance:none;appearance:none}inputtype=file{max-width:300px}inputtype=number{-moz-appearance:textfield}inputtype=checkbox,inputtype=radio{display:inline;min-width:auto}inputtype=color{height:2.5rem}inputtype=date,inputtype=datetime-local,inputtype=month,inputtype=time,inputtype=week{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}inputtype=date:before,inputtype=datetime-local:before,inputtype=month:before,inputtype=time:before,inputtype=week:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}inputtype=date:disabled:before,inputtype=datetime-local:disabled:before,inputtype=month:disabled:before,inputtype=time:disabled:before,inputtype=week:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}inputtype=range{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}inputtype=range::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}inputtype=range::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}inputtype=range::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}inputtype=range::-ms-fill-lower{background:transparent}inputtype=range::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}inputtype=range::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}inputtype=range::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}inputtype=range:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}inputtype=range:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}inputtype=range:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}inputtype=range:disabled{cursor:default}inputtype=range:disabled::-webkit-slider-runnable-track{cursor:default}inputtype=range:disabled::-moz-range-track{cursor:default}inputtype=range:disabled::-ms-track{cursor:default}inputtype=range:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}inputtype=range:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}inputtype=range:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not(multiple){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not(multiple):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}selectmultiple{border-radius:var(--ok-br)}selectmultiple:disabled{background-color:var(--ok-bg-1)}selectmultiple option{color:var(--ok-t-)}selectmultiple:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,inputtype=button,inputtype=reset,inputtype=submit{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,inputtype=button,inputtype=reset,inputtype=submit{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,inputtype=button:disabled,inputtype=reset:disabled,inputtype=submit:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),inputtype=button:focus:not(:disabled),inputtype=reset:focus:not(:disabled),inputtype=submit:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;border-radius:var(--ok-br);display:block;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;margin-left:auto;margin-right:auto;overflow-x:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not(type=submit):not(type=button):not(type=reset):not(type=range),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}inputtype=range:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not(multiple):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),inputtype=button:hover:not(:disabled),inputtype=reset:hover:not(:disabled),inputtype=submit:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file
View file
_service:tar_scm:expat-2.6.0.tar.gz/doc/reference.html -> _service:tar_scm:expat-2.5.0.tar.gz/doc/reference.html
Changed
@@ -14,13 +14,11 @@ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net> Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2002-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Jakub Wilk <jwilk@jwilk.net> Copyright (c) 2021 Tomas Korbar <tkorbar@redhat.com> Copyright (c) 2021 Nicolas Cavallari <nicolas.cavallari@green-communications.fr> Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl> - Copyright (c) 2023 Hanno Böck <hanno@gentoo.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -52,7 +50,7 @@ <div> <h1> The Expat XML Parser - <small>Release 2.6.0</small> + <small>Release 2.5.0</small> </h1> </div> <div class="content"> @@ -70,11 +68,11 @@ <p>This is free software, licensed under the <a href="../COPYING">MIT/X Consortium license</a>. You may download it -from <a href="https://libexpat.github.io/">the Expat home page</a>. +from <a href="http://www.libexpat.org/">the Expat home page</a>. </p> <p>The bulk of this document was originally commissioned as an article -by <a href="https://www.xml.com/">XML.com</a>. They graciously allowed +by <a href="http://www.xml.com/">XML.com</a>. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -153,11 +151,10 @@ </ul> </li> <li> - <a href="#attack-protection">Attack Protection</a> + <a href="#billion-laughs">Billion Laughs Attack Protection</a> <ul> <li><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></li> <li><a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">XML_SetBillionLaughsAttackProtectionActivationThreshold</a></li> - <li><a href="#XML_SetReparseDeferralEnabled">XML_SetReparseDeferralEnabled</a></li> </ul> </li> <li><a href="#miscellaneous">Miscellaneous Functions</a> @@ -308,7 +305,7 @@ <p>The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from <a href= -"https://sourceforge.net/projects/expat/" >Source Forge</a>. After +"http://sourceforge.net/projects/expat/" >Source Forge</a>. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.</p> @@ -362,64 +359,37 @@ <code>XML_UNICODE_WCHAR_T</code>. The symbols are:</p> <dl class="cpp-symbols"> -<dt><a name="XML_GE">XML_GE</a></dt> -<dd> -Added in Expat 2.6.0. -Include support for -<a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-physical-struct">general entities</a> -(syntax <code>&e1;</code> to reference and -syntax <code><!ENTITY e1 'value1'></code> (an internal general entity) or -<code><!ENTITY e2 SYSTEM 'file2'></code> (an external general entity) to declare). -With <code>XML_GE</code> enabled, general entities will be replaced by their declared replacement text; -for this to work for <em>external</em> general entities, in addition an -<code><a href="#XML_SetExternalEntityRefHandler">XML_ExternalEntityRefHandler</a></code> must be set using -<code><a href="#XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</a></code>. -Also, enabling <code>XML_GE</code> makes -the functions <code><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification"> -XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code> -<a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold"> -XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available. -<br/> -With <code>XML_GE</code> disabled, Expat has a smaller memory footprint and can be faster, but will -not load external general entities and will replace all general entities -(except the <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent">predefined five</a>: -<code>amp</code>, <code>apos</code>, <code>gt</code>, <code>lt</code>, <code>quot</code>) -with a self-reference: -for example, referencing an entity <code>e1</code> via <code>&e1;</code> will be replaced -by text <code>&e1;</code>. -</dd> - -<dt><a name="XML_DTD">XML_DTD</a></dt> +<dt>XML_DTD</dt> <dd>Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external parameter entities or process conditional sections. If defined, makes +not load external entities or process conditional sections. If defined, makes the functions <code><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification"> XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code> <a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold"> XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.</dd> -<dt><a name="XML_NS">XML_NS</a></dt> +<dt>XML_NS</dt> <dd>When defined, support for the <cite><a href= -"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite> +"http://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite> specification is included.</dd> -<dt><a name="XML_UNICODE">XML_UNICODE</a></dt> +<dt>XML_UNICODE</dt> <dd>When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type <code>XML_Char</code>. This is implied if <code>XML_UNICODE_WCHAR_T</code> is defined.</dd> -<dt><a name="XML_UNICODE_WCHAR_T">XML_UNICODE_WCHAR_T</a></dt> +<dt>XML_UNICODE_WCHAR_T</dt> <dd>If defined, causes the <code>XML_Char</code> character type to be defined using the <code>wchar_t</code> type; otherwise, <code>unsigned short</code> is used. Defining this implies <code>XML_UNICODE</code>.</dd> -<dt><a name="XML_LARGE_SIZE">XML_LARGE_SIZE</a></dt> +<dt>XML_LARGE_SIZE</dt> <dd>If defined, causes the <code>XML_Size</code> and <code>XML_Index</code> integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -429,23 +399,23 @@ could overflow. It may not be supported by all compilers, and is turned off by default.</dd> -<dt><a name="XML_CONTEXT_BYTES">XML_CONTEXT_BYTES</a></dt> +<dt>XML_CONTEXT_BYTES</dt> <dd>The number of input bytes of markup context which the parser will ensure are available for reporting via <code><a href= "#XML_GetInputContext" >XML_GetInputContext</a></code>. This is -normally set to 1024, and must be set to a positive integer to enable. -If this is set to zero, the input context will not be available and <code><a +normally set to 1024, and must be set to a positive integer. If this +is not defined, the input context will not be available and <code><a href= "#XML_GetInputContext" >XML_GetInputContext</a></code> will -always report <code>NULL</code>. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.</dd> -<dt><a name="XML_STATIC">XML_STATIC</a></dt> +<dt>XML_STATIC</dt> <dd>On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.</dd> -<dt><a name="XML_ATTR_INFO">XML_ATTR_INFO</a></dt> +<dt>XML_ATTR_INFO</dt> <dd>If defined, makes the additional function <code><a href= "#XML_GetAttributeInfo" >XML_GetAttributeInfo</a></code> available for reporting attribute byte offsets.</dd> @@ -699,9 +669,8 @@ tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be -<code>NULL</code>. -The URI will be <code>NULL</code> for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be null. +The URI will be null for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.</p> @@ -830,7 +799,7 @@ include</p> <ul> - <li>Supporting the <a href= "https://www.w3.org/TR/xinclude/" + <li>Supporting the <a href= "http://www.w3.org/TR/xinclude/" >XInclude</a> specification.</li> <li>Delaying further processing until additional information is @@ -978,20 +947,16 @@ XML_ParserCreate(const XML_Char *encoding); </pre> <div class="fcndef"> -<p> -Construct a new parser. If encoding is non-<code>NULL</code>, it specifies a +Construct a new parser. If encoding is non-null, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: -</p> <ul> <li>US-ASCII</li> <li>UTF-8</li> <li>UTF-16</li> <li>ISO-8859-1</li> </ul> -<p>
View file
_service:tar_scm:expat-2.6.0.tar.gz/doc/xmlwf.1 -> _service:tar_scm:expat-2.5.0.tar.gz/doc/xmlwf.1
Changed
@@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "February 6, 2024" "" "" +.TH XMLWF 1 "October 25, 2022" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS @@ -25,7 +25,7 @@ \fBxmlwf\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu -\fB-h\fR | \fB--help\fR +\fB-h\fR 'in \n(.iu-\nxu .ad b 'hy @@ -35,7 +35,7 @@ \fBxmlwf\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu -\fB-v\fR | \fB--version\fR +\fB-v\fR 'in \n(.iu-\nxu .ad b 'hy @@ -158,16 +158,6 @@ \*(T<ISO\-8859\-1\*(T>. Also see the \*(T<\fB\-w\fR\*(T> option. .TP -\*(T<\fB\-g\fR\*(T> \fIbytes\fR -Sets the buffer size to request per call pair to -\*(T<\fBXML_GetBuffer\fR\*(T> and \*(T<\fBread\fR\*(T> -(default: 8 KiB). -.TP -\*(T<\fB\-h\fR\*(T>, \*(T<\fB\-\-help\fR\*(T> -Prints short usage information on command \fBxmlwf\fR, -and then exits. -Similar to this man page but more concise. -.TP \*(T<\fB\-k\fR\*(T> When processing multiple files, \fBxmlwf\fR by default halts after the the first file with an error. @@ -199,10 +189,6 @@ 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\-q\fR\*(T> -Disable reparse deferral, and allow quadratic parse runtime -on large tokens (default: reparse deferral enabled). -.TP \*(T<\fB\-r\fR\*(T> Normally \fBxmlwf\fR memory-maps the XML file before parsing; this can result in faster parsing on many @@ -231,7 +217,7 @@ \*(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>, \*(T<\fB\-\-version\fR\*(T> +\*(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. @@ -295,7 +281,7 @@ 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 options \*(T<\fB\-v\fR\*(T>|\*(T<\fB\-\-version\fR\*(T> or \*(T<\fB\-h\fR\*(T>|\*(T<\fB\-\-help\fR\*(T>, \fBxmlwf\fR always exits with status code 0. For other cases, the following exit status codes are returned: +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.
View file
_service:tar_scm:expat-2.6.0.tar.gz/doc/xmlwf.xml -> _service:tar_scm:expat-2.5.0.tar.gz/doc/xmlwf.xml
Changed
@@ -9,7 +9,7 @@ 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-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 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> @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" <!ENTITY dhfirstname "<firstname>Scott</firstname>"> <!ENTITY dhsurname "<surname>Bronson</surname>"> - <!ENTITY dhdate "<date>February 6, 2024</date>"> + <!ENTITY dhdate "<date>October 25, 2022</date>"> <!-- Please adjust this^^ date whenever cutting a new release. --> <!ENTITY dhsection "<manvolnum>1</manvolnum>"> <!ENTITY dhemail "<email>bronson@rinspin.com</email>"> @@ -66,17 +66,11 @@ </cmdsynopsis> <cmdsynopsis> <command>&dhpackage;</command> - <group choice="plain"> - <arg><option>-h</option></arg> - <arg><option>--help</option></arg> - </group> + <arg choice="plain"><option>-h</option></arg> </cmdsynopsis> <cmdsynopsis> <command>&dhpackage;</command> - <group choice="plain"> - <arg><option>-v</option></arg> - <arg><option>--version</option></arg> - </group> + <arg choice="plain"><option>-v</option></arg> </cmdsynopsis> </refsynopsisdiv> @@ -258,29 +252,6 @@ </varlistentry> <varlistentry> - <term><option>-g</option> <replaceable>bytes</replaceable></term> - <listitem> - <para> - Sets the buffer size to request per call pair to - <function>XML_GetBuffer</function> and <function>read</function> - (default: 8 KiB). - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term><option>-h</option></term> - <term><option>--help</option></term> - <listitem> - <para> - Prints short usage information on command <command>&dhpackage;</command>, - and then exits. - Similar to this man page but more concise. - </para> - </listitem> - </varlistentry> - - <varlistentry> <term><option>-k</option></term> <listitem> <para> @@ -343,16 +314,6 @@ </varlistentry> <varlistentry> - <term><option>-q</option></term> - <listitem> - <para> - Disable reparse deferral, and allow quadratic parse runtime - on large tokens (default: reparse deferral enabled). - </para> - </listitem> - </varlistentry> - - <varlistentry> <term><option>-r</option></term> <listitem> <para> @@ -401,7 +362,6 @@ <varlistentry> <term><option>-v</option></term> - <term><option>--version</option></term> <listitem> <para> Prints the version of the Expat library being used, including some @@ -501,7 +461,7 @@ <refsect1> <title>EXIT STATUS</title> - <para>For options <option>-v</option>|<option>--version</option> or <option>-h</option>|<option>--help</option>, <command>&dhpackage;</command> always exits with status code 0. For other cases, the following exit status codes are returned: + <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>
View file
_service:tar_scm:expat-2.6.0.tar.gz/examples/Makefile.am -> _service:tar_scm:expat-2.5.0.tar.gz/examples/Makefile.am
Changed
@@ -6,8 +6,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org> -# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com> +# 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 @@ -31,10 +31,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib -noinst_PROGRAMS = element_declarations elements outline - -element_declarations_SOURCES = element_declarations.c -element_declarations_LDADD = ../lib/libexpat.la +noinst_PROGRAMS = elements outline elements_SOURCES = elements.c elements_LDADD = ../lib/libexpat.la
View file
_service:tar_scm:expat-2.6.0.tar.gz/examples/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/examples/Makefile.in
Changed
@@ -22,8 +22,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping <sebastian@pipping.org> -# Copyright (c) 2020 Jeffrey Walton <noloader@gmail.com> +# 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 @@ -119,8 +119,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = element_declarations$(EXEEXT) elements$(EXEEXT) \ - outline$(EXEEXT) +noinst_PROGRAMS = elements$(EXEEXT) outline$(EXEEXT) subdir = examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ @@ -134,8 +133,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -145,16 +142,13 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) -am_element_declarations_OBJECTS = element_declarations.$(OBJEXT) -element_declarations_OBJECTS = $(am_element_declarations_OBJECTS) -element_declarations_DEPENDENCIES = ../lib/libexpat.la +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_elements_OBJECTS = elements.$(OBJEXT) -elements_OBJECTS = $(am_elements_OBJECTS) -elements_DEPENDENCIES = ../lib/libexpat.la am_outline_OBJECTS = outline.$(OBJEXT) outline_OBJECTS = $(am_outline_OBJECTS) outline_DEPENDENCIES = ../lib/libexpat.la @@ -173,8 +167,7 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/element_declarations.Po \ - ./$(DEPDIR)/elements.Po ./$(DEPDIR)/outline.Po +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) @@ -194,10 +187,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(element_declarations_SOURCES) $(elements_SOURCES) \ - $(outline_SOURCES) -DIST_SOURCES = $(element_declarations_SOURCES) $(elements_SOURCES) \ - $(outline_SOURCES) +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;; \ @@ -271,7 +262,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -291,7 +281,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -373,8 +362,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -element_declarations_SOURCES = element_declarations.c -element_declarations_LDADD = ../lib/libexpat.la elements_SOURCES = elements.c elements_LDADD = ../lib/libexpat.la outline_SOURCES = outline.c @@ -383,7 +370,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -407,9 +394,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -422,10 +409,6 @@ echo " rm -f" $$list; \ rm -f $$list -element_declarations$(EXEEXT): $(element_declarations_OBJECTS) $(element_declarations_DEPENDENCIES) $(EXTRA_element_declarations_DEPENDENCIES) - @rm -f element_declarations$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(element_declarations_OBJECTS) $(element_declarations_LDADD) $(LIBS) - elements$(EXEEXT): $(elements_OBJECTS) $(elements_DEPENDENCIES) $(EXTRA_elements_DEPENDENCIES) @rm -f elements$(EXEEXT) $(AM_V_CCLD)$(LINK) $(elements_OBJECTS) $(elements_LDADD) $(LIBS) @@ -440,7 +423,6 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/element_declarations.Po@am__quote@ # am--include-marker @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 @@ -601,8 +583,7 @@ mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/element_declarations.Po - -rm -f ./$(DEPDIR)/elements.Po + -rm -f ./$(DEPDIR)/elements.Po -rm -f ./$(DEPDIR)/outline.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ @@ -649,8 +630,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/element_declarations.Po - -rm -f ./$(DEPDIR)/elements.Po + -rm -f ./$(DEPDIR)/elements.Po -rm -f ./$(DEPDIR)/outline.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic
View file
_service:tar_scm:expat-2.6.0.tar.gz/expat.pc.cmake -> _service:tar_scm:expat-2.5.0.tar.gz/expat.pc.cmake
Changed
@@ -10,4 +10,3 @@ Libs: -L${libdir} -l$<TARGET_PROPERTY:expat,pkgconfig_$<LOWER_CASE:$<CONFIG>>_output_name> Libs.private: $<TARGET_PROPERTY:expat,pkgconfig_libm> Cflags: -I${includedir} -Cflags.private: -DXML_STATIC
View file
_service:tar_scm:expat-2.6.0.tar.gz/expat.pc.in -> _service:tar_scm:expat-2.5.0.tar.gz/expat.pc.in
Changed
@@ -10,4 +10,3 @@ Libs: -L${libdir} -l@PACKAGE_NAME@ Libs.private: @LIBM@ Cflags: -I${includedir} -Cflags.private: -DXML_STATIC
View file
_service:tar_scm:expat-2.6.0.tar.gz/expat_config.h -> _service:tar_scm:expat-2.5.0.tar.gz/expat_config.h
Changed
@@ -16,9 +16,6 @@ /* Define to 1 if you have the `arc4random_buf' function. */ #define HAVE_ARC4RANDOM_BUF 1 -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 @@ -77,13 +74,13 @@ #define PACKAGE "expat" /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues" +#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.6.0" +#define PACKAGE_STRING "expat 2.5.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -92,7 +89,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.6.0" +#define PACKAGE_VERSION "2.5.0" /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -100,7 +97,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.6.0" +#define VERSION "2.5.0" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -119,7 +116,7 @@ /* #undef XML_ATTR_INFO */ /* Define to specify how much context to retain around the current parse - point, 0 to disable. */ + point. */ #define XML_CONTEXT_BYTES 1024 /* Define to include code reading entropy from `/dev/urandom'. */ @@ -128,9 +125,6 @@ /* Define to make parameter entity parsing functionality available. */ #define XML_DTD 1 -/* Define as 1/0 to enable/disable support for general entities. */ -#define XML_GE 1 - /* Define to make XML Namespaces functionality available. */ #define XML_NS 1
View file
_service:tar_scm:expat-2.6.0.tar.gz/expat_config.h.cmake -> _service:tar_scm:expat-2.5.0.tar.gz/expat_config.h.cmake
Changed
@@ -82,9 +82,7 @@ #cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" /* Define to 1 if you have the ANSI C header files. */ -#ifndef STDC_HEADERS #cmakedefine STDC_HEADERS -#endif /* whether byteorder is bigendian */ #cmakedefine WORDS_BIGENDIAN @@ -94,8 +92,8 @@ #cmakedefine XML_ATTR_INFO /* Define to specify how much context to retain around the current parse - point, 0 to disable. */ -#define XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@ + point. */ +#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@ #if ! defined(_WIN32) /* Define to include code reading entropy from `/dev/urandom'. */ @@ -105,9 +103,6 @@ /* Define to make parameter entity parsing functionality available. */ #cmakedefine XML_DTD -/* Define as 1/0 to enable/disable support for general entities. */ -#define XML_GE @XML_GE@ - /* Define to make XML Namespaces functionality available. */ #cmakedefine XML_NS @@ -117,9 +112,9 @@ #endif /* Define to `long' if <sys/types.h> does not define. */ -#cmakedefine off_t @off_t@ +#cmakedefine off_t @OFF_T@ /* Define to `unsigned' if <sys/types.h> does not define. */ -#cmakedefine size_t @size_t@ +#cmakedefine size_t @SIZE_T@ #endif // ndef EXPAT_CONFIG_H
View file
_service:tar_scm:expat-2.6.0.tar.gz/expat_config.h.in -> _service:tar_scm:expat-2.5.0.tar.gz/expat_config.h.in
Changed
@@ -15,9 +15,6 @@ /* Define to 1 if you have the `arc4random_buf' function. */ #undef HAVE_ARC4RANDOM_BUF -/* define if the compiler supports basic C++11 syntax */ -#undef HAVE_CXX11 - /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -118,7 +115,7 @@ #undef XML_ATTR_INFO /* Define to specify how much context to retain around the current parse - point, 0 to disable. */ + point. */ #undef XML_CONTEXT_BYTES /* Define to include code reading entropy from `/dev/urandom'. */ @@ -127,9 +124,6 @@ /* Define to make parameter entity parsing functionality available. */ #undef XML_DTD -/* Define as 1/0 to enable/disable support for general entities. */ -#undef XML_GE - /* Define to make XML Namespaces functionality available. */ #undef XML_NS
View file
_service:tar_scm:expat-2.6.0.tar.gz/fuzz/xml_parse_fuzzer.c -> _service:tar_scm:expat-2.5.0.tar.gz/fuzz/xml_parse_fuzzer.c
Changed
@@ -47,59 +47,18 @@ (void)name; } -static void XMLCALL -may_stop_character_handler(void *userData, const XML_Char *s, int len) { - XML_Parser parser = (XML_Parser)userData; - if (len > 1 && s0 == 's') { - XML_StopParser(parser, s1 == 'r' ? XML_FALSE : XML_TRUE); - } -} +int +LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + XML_Parser p = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING)); + assert(p); -static void -ParseOneInput(XML_Parser p, const uint8_t *data, size_t size) { // Set the hash salt using siphash to generate a deterministic hash. struct sipkey *key = sip_keyof(hash_key); XML_SetHashSalt(p, (unsigned long)siphash24(data, size, key)); - (void)sip24_valid; - XML_SetUserData(p, p); XML_SetElementHandler(p, start, end); - XML_SetCharacterDataHandler(p, may_stop_character_handler); XML_Parse(p, (const XML_Char *)data, size, 0); - if (XML_Parse(p, (const XML_Char *)data, size, 1) == XML_STATUS_ERROR) { - XML_ErrorString(XML_GetErrorCode(p)); - } - XML_GetCurrentLineNumber(p); - if (size % 2) { - XML_ParserReset(p, NULL); - } -} - -int -LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - XML_Parser parentParser = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING)); - assert(parentParser); - ParseOneInput(parentParser, data, size); - // not freed yet, but used later and freed then - - XML_Parser namespaceParser = XML_ParserCreateNS(NULL, '!'); - assert(namespaceParser); - ParseOneInput(namespaceParser, data, size); - XML_ParserFree(namespaceParser); - - XML_Parser externalEntityParser - = XML_ExternalEntityParserCreate(parentParser, "e1", NULL); - assert(externalEntityParser); - ParseOneInput(externalEntityParser, data, size); - XML_ParserFree(externalEntityParser); - - XML_Parser externalDtdParser - = XML_ExternalEntityParserCreate(parentParser, NULL, NULL); - assert(externalDtdParser); - ParseOneInput(externalDtdParser, data, size); - XML_ParserFree(externalDtdParser); - - // finally frees this parser which served as parent - XML_ParserFree(parentParser); + XML_Parse(p, (const XML_Char *)data, size, 1); + XML_ParserFree(p); return 0; }
View file
_service:tar_scm:expat-2.6.0.tar.gz/fuzz/xml_parsebuffer_fuzzer.c -> _service:tar_scm:expat-2.5.0.tar.gz/fuzz/xml_parsebuffer_fuzzer.c
Changed
@@ -48,70 +48,24 @@ (void)name; } -static void XMLCALL -may_stop_character_handler(void *userData, const XML_Char *s, int len) { - XML_Parser parser = (XML_Parser)userData; - if (len > 1 && s0 == 's') { - XML_StopParser(parser, s1 == 'r' ? XML_FALSE : XML_TRUE); - } -} - -static void -ParseOneInput(XML_Parser p, const uint8_t *data, size_t size) { - // Set the hash salt using siphash to generate a deterministic hash. - struct sipkey *key = sip_keyof(hash_key); - XML_SetHashSalt(p, (unsigned long)siphash24(data, size, key)); - (void)sip24_valid; - - XML_SetUserData(p, p); - XML_SetElementHandler(p, start, end); - XML_SetCharacterDataHandler(p, may_stop_character_handler); - void *buf = XML_GetBuffer(p, size); - assert(buf); - memcpy(buf, data, size); - XML_ParseBuffer(p, size, 0); - buf = XML_GetBuffer(p, size); - if (buf == NULL) { - return; - } - memcpy(buf, data, size); - if (XML_ParseBuffer(p, size, 1) == XML_STATUS_ERROR) { - XML_ErrorString(XML_GetErrorCode(p)); - } - XML_GetCurrentLineNumber(p); - if (size % 2) { - XML_ParserReset(p, NULL); - } -} - int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (size == 0) return 0; - XML_Parser parentParser = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING)); - assert(parentParser); - ParseOneInput(parentParser, data, size); - // not freed yet, but used later and freed then - - XML_Parser namespaceParser = XML_ParserCreateNS(NULL, '!'); - assert(namespaceParser); - ParseOneInput(namespaceParser, data, size); - XML_ParserFree(namespaceParser); + XML_Parser p = XML_ParserCreate(xstr(ENCODING_FOR_FUZZING)); + assert(p); + XML_SetElementHandler(p, start, end); - XML_Parser externalEntityParser - = XML_ExternalEntityParserCreate(parentParser, "e1", NULL); - assert(externalEntityParser); - ParseOneInput(externalEntityParser, data, size); - XML_ParserFree(externalEntityParser); + // Set the hash salt using siphash to generate a deterministic hash. + struct sipkey *key = sip_keyof(hash_key); + XML_SetHashSalt(p, (unsigned long)siphash24(data, size, key)); - XML_Parser externalDtdParser - = XML_ExternalEntityParserCreate(parentParser, NULL, NULL); - assert(externalDtdParser); - ParseOneInput(externalDtdParser, data, size); - XML_ParserFree(externalDtdParser); + void *buf = XML_GetBuffer(p, size); + assert(buf); - // finally frees this parser which served as parent - XML_ParserFree(parentParser); + memcpy(buf, data, size); + XML_ParseBuffer(p, size, size == 0); + XML_ParserFree(p); return 0; }
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/lib/Makefile.in
Changed
@@ -135,8 +135,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -302,7 +300,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -322,7 +319,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -455,7 +451,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -479,9 +475,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps):
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/expat.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/expat.h
Changed
@@ -11,13 +11,11 @@ Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net> Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org> Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl> - Copyright (c) 2023 Hanno Böck <hanno@gentoo.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -271,7 +269,7 @@ const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); -/* Prepare a parser object to be reused. This is particularly +/* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionately high, such as when a large number of small documnents need to be parsed. All handlers are cleared from the parser, except for the @@ -953,7 +951,7 @@ XMLPARSEAPI(int) XML_GetCurrentByteCount(XML_Parser parser); -/* If XML_CONTEXT_BYTES is >=1, returns the input buffer, sets +/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise @@ -1027,9 +1025,7 @@ XML_FEATURE_ATTR_INFO, /* Added in Expat 2.4.0. */ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT, - XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT, - /* Added in Expat 2.6.0. */ - XML_FEATURE_GE + XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT /* Additional features must be added to the end of this enum. */ }; @@ -1042,29 +1038,23 @@ XMLPARSEAPI(const XML_Feature *) XML_GetFeatureList(void); -#if XML_GE == 1 -/* Added in Expat 2.4.0 for XML_DTD defined and - * added in Expat 2.6.0 for XML_GE == 1. */ +#ifdef XML_DTD +/* Added in Expat 2.4.0. */ XMLPARSEAPI(XML_Bool) XML_SetBillionLaughsAttackProtectionMaximumAmplification( XML_Parser parser, float maximumAmplificationFactor); -/* Added in Expat 2.4.0 for XML_DTD defined and - * added in Expat 2.6.0 for XML_GE == 1. */ +/* Added in Expat 2.4.0. */ XMLPARSEAPI(XML_Bool) XML_SetBillionLaughsAttackProtectionActivationThreshold( XML_Parser parser, unsigned long long activationThresholdBytes); #endif -/* Added in Expat 2.6.0. */ -XMLPARSEAPI(XML_Bool) -XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); - /* Expat follows the semantic versioning convention. - See https://semver.org + See http://semver.org. */ #define XML_MAJOR_VERSION 2 -#define XML_MINOR_VERSION 6 +#define XML_MINOR_VERSION 5 #define XML_MICRO_VERSION 0 #ifdef __cplusplus
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/internal.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/internal.h
Changed
@@ -28,10 +28,9 @@ 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-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -155,15 +154,12 @@ void _INTERNAL_trim_to_complete_utf8_characters(const char *from, const char **fromLimRef); -#if XML_GE == 1 +#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 -extern XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c -extern unsigned int g_parseAttempts; // used for testing only - #ifdef __cplusplus } #endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/libexpat.def.cmake -> _service:tar_scm:expat-2.5.0.tar.gz/lib/libexpat.def.cmake
Changed
@@ -75,7 +75,5 @@ XML_SetHashSalt @67 ; internal @68 removed with version 2.3.1 ; added with version 2.4.0 -@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69 -@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70 -; added with version 2.6.0 - XML_SetReparseDeferralEnabled @71 +@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69 +@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/siphash.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/siphash.h
Changed
@@ -106,7 +106,7 @@ * 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_ULL(high, low) ((((uint64_t)high) << 32) | (low)) #define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b)))) @@ -190,10 +190,10 @@ static struct siphash * sip24_init(struct siphash *H, const struct sipkey *key) { - H->v0 = SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k0; - H->v1 = SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k1; - H->v2 = SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k0; - H->v3 = SIP_ULL(0x74656462U, 0x79746573U) ^ key->k1; + H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k0; + H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k1; + H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k0; + H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k1; H->p = H->buf; H->c = 0;
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/winconfig.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/winconfig.h
Changed
@@ -9,8 +9,7 @@ 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-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2023 Orgad Shaneh <orgad.shaneh@audiocodes.com> + 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 @@ -36,9 +35,7 @@ #ifndef WINCONFIG_H #define WINCONFIG_H -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif +#define WIN32_LEAN_AND_MEAN #include <windows.h> #undef WIN32_LEAN_AND_MEAN
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmlparse.c -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmlparse.c
Changed
@@ -1,4 +1,4 @@ -/* 628e24d4966bedbd4800f6ed128d06d29703765b4bce12d3b7f099f90f842fc9 (2.6.0+) +/* 5ab094ffadd6edfc94c3eee53af44a86951f9f1f0933ada3114bbce2bfb02c99 (2.5.0+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -13,7 +13,7 @@ Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net> Copyright (c) 2005-2009 Steven Solie <steven@solie.ca> Copyright (c) 2016 Eric Rahm <erahm@mozilla.com> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2016 Gaurav <g.gupta@samsung.com> Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de> Copyright (c) 2016 Gustavo Grieco <gustavo.grieco@imag.fr> @@ -32,13 +32,10 @@ Copyright (c) 2019 David Loffredo <loffredo@steptools.com> Copyright (c) 2019-2020 Ben Wagner <bungeman@chromium.org> Copyright (c) 2019 Vadim Zeitlin <vadim@zeitlins.org> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> + Copyright (c) 2021 Dong-hee Na <donghee.na@python.org> Copyright (c) 2022 Samanta Navarro <ferivoz@riseup.net> Copyright (c) 2022 Jeffrey Walton <noloader@gmail.com> Copyright (c) 2022 Jann Horn <jannh@google.com> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> - Copyright (c) 2023 Owain Davies <owaind@bath.edu> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -63,25 +60,10 @@ #define XML_BUILDING_EXPAT 1 -#include "expat_config.h" +#include <expat_config.h> -#if ! defined(XML_GE) || (1 - XML_GE - 1 == 2) || (XML_GE < 0) || (XML_GE > 1) -# error XML_GE (for general entities) must be defined, non-empty, either 1 or 0 (0 to disable, 1 to enable; 1 is a common default) -#endif - -#if defined(XML_DTD) && XML_GE == 0 -# error Either undefine XML_DTD or define XML_GE to 1. -#endif - -#if ! defined(XML_CONTEXT_BYTES) || (1 - XML_CONTEXT_BYTES - 1 == 2) \ - || (XML_CONTEXT_BYTES + 0 < 0) -# error XML_CONTEXT_BYTES must be defined, non-empty and >=0 (0 to disable, >=1 to enable; 1024 is a common default) -#endif - -#if defined(HAVE_SYSCALL_GETRANDOM) -# if ! defined(_GNU_SOURCE) -# define _GNU_SOURCE 1 /* syscall prototype */ -# endif +#if ! defined(_GNU_SOURCE) +# define _GNU_SOURCE 1 /* syscall prototype */ #endif #ifdef _WIN32 @@ -91,7 +73,6 @@ # endif #endif -#include <stdbool.h> #include <stddef.h> #include <string.h> /* memset(), memcpy() */ #include <assert.h> @@ -150,8 +131,8 @@ Your options include: \ * Linux >=3.17 + glibc >=2.25 (getrandom): HAVE_GETRANDOM, \ * Linux >=3.17 + glibc (including <2.25) (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, \ - * BSD / macOS >=10.7 / glibc >=2.36 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \ - * BSD / macOS (including <10.7) / glibc >=2.36 (arc4random): HAVE_ARC4RANDOM, \ + * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \ + * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \ * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \ * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \ * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 (/dev/urandom): XML_DEV_URANDOM, \ @@ -215,8 +196,6 @@ /* Do safe (NULL-aware) pointer arithmetic */ #define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0) -#define EXPAT_MIN(a, b) (((a) < (b)) ? (a) : (b)) - #include "internal.h" #include "xmltok.h" #include "xmlrole.h" @@ -300,7 +279,7 @@ XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to contain the 'raw' name as well. - A parser reuses these structures, maintaining a list of allocated + A parser re-uses these structures, maintaining a list of allocated TAG objects in a free list. */ typedef struct tag { @@ -429,12 +408,12 @@ XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */ }; -#if XML_GE == 1 +#ifdef XML_DTD typedef unsigned long long XmlBigCount; typedef struct accounting { XmlBigCount countBytesDirect; XmlBigCount countBytesIndirect; - unsigned long debugLevel; + int debugLevel; float maximumAmplificationFactor; // >=1.0 unsigned long long activationThresholdBytes; } ACCOUNTING; @@ -443,9 +422,9 @@ unsigned int countEverOpened; unsigned int currentDepth; unsigned int maximumDepthSeen; - unsigned long debugLevel; + int debugLevel; } ENTITY_STATS; -#endif /* XML_GE == 1 */ +#endif /* XML_DTD */ typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, const char *end, const char **endPtr); @@ -485,47 +464,41 @@ const ENCODING *enc, const char *start, const char *end, const char **endPtr, XML_Bool haveMore, enum XML_Account account); -static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc, +static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore, enum XML_Account account); #ifdef XML_DTD -static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc, +static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr, XML_Bool haveMore); #endif /* XML_DTD */ static void freeBindings(XML_Parser parser, BINDING *bindings); -static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, - const char *attStr, TAG_NAME *tagNamePtr, +static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, + const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr, enum XML_Account account); static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); -static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, - XML_Bool isCdata, XML_Bool isId, - const XML_Char *value, XML_Parser parser); -static enum XML_Error storeAttributeValue(XML_Parser parser, - const ENCODING *enc, XML_Bool isCdata, - const char *ptr, const char *end, - STRING_POOL *pool, +static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, + XML_Bool isId, const XML_Char *dfltValue, + XML_Parser parser); +static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, + XML_Bool isCdata, const char *, + const char *, STRING_POOL *, enum XML_Account account); -static enum XML_Error appendAttributeValue(XML_Parser parser, - const ENCODING *enc, - XML_Bool isCdata, const char *ptr, - const char *end, STRING_POOL *pool, +static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *, + XML_Bool isCdata, const char *, + const char *, STRING_POOL *, enum XML_Account account); static ATTRIBUTE_ID *getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType); -#if XML_GE == 1 +static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end, enum XML_Account account); -#else -static enum XML_Error storeSelfEntityValue(XML_Parser parser, ENTITY *entity); -#endif static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportComment(XML_Parser parser, const ENCODING *enc, @@ -545,22 +518,21 @@ const XML_Memory_Handling_Suite *ms); static int dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); -static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *newTable, - STRING_POOL *newPool, const HASH_TABLE *oldTable); +static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *, STRING_POOL *, + const HASH_TABLE *); static NAMED *lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize); -static void FASTCALL hashTableInit(HASH_TABLE *table, +static void FASTCALL hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); -static void FASTCALL hashTableClear(HASH_TABLE *table); -static void FASTCALL hashTableDestroy(HASH_TABLE *table);
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmlrole.c -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmlrole.c
Changed
@@ -12,10 +12,10 @@ Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net> Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2005-2009 Steven Solie <steven@solie.ca> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> + Copyright (c) 2021 Dong-hee Na <donghee.na@python.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -38,7 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "expat_config.h" +#include <expat_config.h> #include <stddef.h>
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmlrole.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmlrole.h
Changed
@@ -10,7 +10,7 @@ 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-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -127,9 +127,9 @@ #endif /* XML_DTD */ } PROLOG_STATE; -void XmlPrologStateInit(PROLOG_STATE *state); +void XmlPrologStateInit(PROLOG_STATE *); #ifdef XML_DTD -void XmlPrologStateInitExternalEntity(PROLOG_STATE *state); +void XmlPrologStateInitExternalEntity(PROLOG_STATE *); #endif /* XML_DTD */ #define XmlTokenRole(state, tok, ptr, end, enc) \
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmltok.c -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmltok.c
Changed
@@ -12,7 +12,7 @@ Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net> Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net> Copyright (c) 2005-2009 Steven Solie <steven@solie.ca> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2016 Pascal Cuoq <cuoq@trust-in-soft.com> Copyright (c) 2016 Don Lewis <truckman@apache.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> @@ -20,10 +20,8 @@ Copyright (c) 2017 Benbuck Nason <bnason@netflix.com> Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> + Copyright (c) 2021 Dong-hee Na <donghee.na@python.org> Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> - Copyright (c) 2023 Hanno Böck <hanno@gentoo.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -46,7 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "expat_config.h" +#include <expat_config.h> #include <stddef.h> #include <string.h> /* memcpy */ @@ -78,7 +76,7 @@ #define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) #define UCS2_GET_NAMING(pages, hi, lo) \ - (namingBitmap(pageshi << 3) + ((lo) >> 5) & (1u << ((lo) & 0x1F))) + (namingBitmap(pageshi << 3) + ((lo) >> 5) & (1u << ((lo)&0x1F))) /* A 2 byte UTF-8 representation splits the characters 11 bits between the bottom 5 and 6 bits of the bytes. We need 8 bits to index into @@ -102,7 +100,7 @@ & (1u << (((byte)2) & 0x1F))) /* Detection of invalid UTF-8 sequences is based on Table 3.1B - of Unicode 3.2: https://www.unicode.org/unicode/reports/tr28/ + of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/ with the additional restriction of not allowing the Unicode code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE). Implementation details: @@ -227,7 +225,7 @@ /* isNmstrt2 */ NULL, /* isNmstrt3 */ NULL, /* isNmstrt4 */ NULL, \ /* isInvalid2 */ NULL, /* isInvalid3 */ NULL, /* isInvalid4 */ NULL -static int FASTCALL checkCharRefNumber(int result); +static int FASTCALL checkCharRefNumber(int); #include "xmltok_impl.h" #include "ascii.h" @@ -245,7 +243,7 @@ #endif #define SB_BYTE_TYPE(enc, p) \ - (((const struct normal_encoding *)(enc))->type(unsigned char)*(p)) + (((struct normal_encoding *)(enc))->type(unsigned char)*(p)) #ifdef XML_MIN_SIZE static int PTRFASTCALL @@ -409,7 +407,7 @@ unsigned short *to = *toP; const char *from = *fromP; while (from < fromLim && to < toLim) { - switch (SB_BYTE_TYPE(enc, from)) { + switch (((struct normal_encoding *)enc)->type(unsigned char)*from) { case BT_LEAD2: if (fromLim - from < 2) { res = XML_CONVERT_INPUT_INCOMPLETE; @@ -717,26 +715,31 @@ return res; \ } +#define SET2(ptr, ch) (((ptr)0 = ((ch)&0xff)), ((ptr)1 = ((ch) >> 8))) #define GET_LO(ptr) ((unsigned char)(ptr)0) #define GET_HI(ptr) ((unsigned char)(ptr)1) DEFINE_UTF16_TO_UTF8(little2_) DEFINE_UTF16_TO_UTF16(little2_) +#undef SET2 #undef GET_LO #undef GET_HI +#define SET2(ptr, ch) (((ptr)0 = ((ch) >> 8)), ((ptr)1 = ((ch)&0xFF))) #define GET_LO(ptr) ((unsigned char)(ptr)1) #define GET_HI(ptr) ((unsigned char)(ptr)0) DEFINE_UTF16_TO_UTF8(big2_) DEFINE_UTF16_TO_UTF16(big2_) +#undef SET2 #undef GET_LO #undef GET_HI #define LITTLE2_BYTE_TYPE(enc, p) \ - ((p)1 == 0 ? SB_BYTE_TYPE(enc, p) : unicode_byte_type((p)1, (p)0)) + ((p)1 == 0 ? ((struct normal_encoding *)(enc))->type(unsigned char)*(p) \ + : unicode_byte_type((p)1, (p)0)) #define LITTLE2_BYTE_TO_ASCII(p) ((p)1 == 0 ? (p)0 : -1) #define LITTLE2_CHAR_MATCHES(p, c) ((p)1 == 0 && (p)0 == (c)) #define LITTLE2_IS_NAME_CHAR_MINBPC(p) \ @@ -869,7 +872,9 @@ #endif #define BIG2_BYTE_TYPE(enc, p) \ - ((p)0 == 0 ? SB_BYTE_TYPE(enc, p + 1) : unicode_byte_type((p)0, (p)1)) + ((p)0 == 0 \ + ? ((struct normal_encoding *)(enc))->type(unsigned char)(p)1 \ + : unicode_byte_type((p)0, (p)1)) #define BIG2_BYTE_TO_ASCII(p) ((p)0 == 0 ? (p)1 : -1) #define BIG2_CHAR_MATCHES(p, c) ((p)0 == 0 && (p)1 == (c)) #define BIG2_IS_NAME_CHAR_MINBPC(p) \
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmltok.h -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmltok.h
Changed
@@ -10,7 +10,7 @@ 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-2024 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Licensed under the MIT license: @@ -289,8 +289,7 @@ const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); -int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr, - const char *name); +int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncoding(void); const ENCODING *XmlGetUtf16InternalEncoding(void); int FASTCALL XmlUtf8Encode(int charNumber, char *buf); @@ -308,8 +307,7 @@ const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); -int XmlInitEncodingNS(INIT_ENCODING *p, const ENCODING **encPtr, - const char *name); +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,
View file
_service:tar_scm:expat-2.6.0.tar.gz/lib/xmltok_impl.c -> _service:tar_scm:expat-2.5.0.tar.gz/lib/xmltok_impl.c
Changed
@@ -126,7 +126,7 @@ # endif # define HAS_CHARS(enc, ptr, end, count) \ - ((end) - (ptr) >= ((count) * MINBPC(enc))) + ((end) - (ptr) >= ((count)*MINBPC(enc))) # define HAS_CHAR(enc, ptr, end) HAS_CHARS(enc, ptr, end, 1)
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/Makefile.am -> _service:tar_scm:expat-2.5.0.tar.gz/tests/Makefile.am
Changed
@@ -6,8 +6,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> -# Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> +# 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: # @@ -34,61 +34,34 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib -check_PROGRAMS = runtests runtests_cxx -TESTS = runtests runtests_cxx +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 -runtests_SOURCES = \ - acc_tests.c \ - alloc_tests.c \ - basic_tests.c \ +libruntests_a_SOURCES = \ chardata.c \ - common.c \ - dummy.c \ - handlers.c \ + structdata.c \ memcheck.c \ - minicheck.c \ - misc_tests.c \ - ns_tests.c \ - nsalloc_tests.c \ - runtests.c \ - structdata.c + minicheck.c + +runtests_SOURCES = \ + runtests.c -runtests_cxx_SOURCES = \ - acc_tests_cxx.cpp \ - alloc_tests_cxx.cpp \ - basic_tests_cxx.cpp \ - chardata_cxx.cpp \ - common_cxx.cpp \ - dummy_cxx.cpp \ - handlers_cxx.cpp \ - memcheck_cxx.cpp \ - minicheck_cxx.cpp \ - misc_tests_cxx.cpp \ - nsalloc_tests_cxx.cpp \ - ns_tests_cxx.cpp \ - runtests_cxx.cpp \ - structdata_cxx.cpp +runtestspp_SOURCES = \ + runtestspp.cpp -runtests_LDADD = ../lib/libexpatinternal.la -runtests_cxx_LDADD = ../lib/libexpatinternal.la +runtests_LDADD = libruntests.a ../lib/libexpatinternal.la +runtestspp_LDADD = libruntests.a ../lib/libexpatinternal.la runtests_LDFLAGS = @AM_LDFLAGS@ @LIBM@ -runtests_cxx_LDFLAGS = @AM_LDFLAGS@ @LIBM@ +runtestspp_LDFLAGS = @AM_LDFLAGS@ @LIBM@ EXTRA_DIST = \ - acc_tests.h \ - alloc_tests.h \ - basic_tests.h \ chardata.h \ - common.h \ - dummy.h \ - handlers.h \ - misc_tests.h \ - ns_tests.h \ - nsalloc_tests.h \ structdata.h \ minicheck.h \ memcheck.h \
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/tests/Makefile.in
Changed
@@ -22,8 +22,8 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> -# Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> +# 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: # @@ -45,6 +45,7 @@ # 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 \ @@ -119,8 +120,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = runtests$(EXEEXT) runtests_cxx$(EXEEXT) -TESTS = runtests$(EXEEXT) runtests_cxx$(EXEEXT) +check_PROGRAMS = runtests$(EXEEXT) runtestspp$(EXEEXT) +TESTS = runtests$(EXEEXT) runtestspp$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ @@ -134,8 +135,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -144,14 +143,20 @@ CONFIG_HEADER = $(top_builddir)/expat_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am_runtests_OBJECTS = acc_tests.$(OBJEXT) alloc_tests.$(OBJEXT) \ - basic_tests.$(OBJEXT) chardata.$(OBJEXT) common.$(OBJEXT) \ - dummy.$(OBJEXT) handlers.$(OBJEXT) memcheck.$(OBJEXT) \ - minicheck.$(OBJEXT) misc_tests.$(OBJEXT) ns_tests.$(OBJEXT) \ - nsalloc_tests.$(OBJEXT) runtests.$(OBJEXT) \ - structdata.$(OBJEXT) +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libruntests_a_AR = $(AR) $(ARFLAGS) +libruntests_a_LIBADD = +am_libruntests_a_OBJECTS = chardata.$(OBJEXT) structdata.$(OBJEXT) \ + memcheck.$(OBJEXT) minicheck.$(OBJEXT) +libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS) +am_runtests_OBJECTS = runtests.$(OBJEXT) runtests_OBJECTS = $(am_runtests_OBJECTS) -runtests_DEPENDENCIES = ../lib/libexpatinternal.la +runtests_DEPENDENCIES = libruntests.a ../lib/libexpatinternal.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -159,19 +164,12 @@ runtests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(runtests_LDFLAGS) $(LDFLAGS) -o $@ -am_runtests_cxx_OBJECTS = acc_tests_cxx.$(OBJEXT) \ - alloc_tests_cxx.$(OBJEXT) basic_tests_cxx.$(OBJEXT) \ - chardata_cxx.$(OBJEXT) common_cxx.$(OBJEXT) \ - dummy_cxx.$(OBJEXT) handlers_cxx.$(OBJEXT) \ - memcheck_cxx.$(OBJEXT) minicheck_cxx.$(OBJEXT) \ - misc_tests_cxx.$(OBJEXT) nsalloc_tests_cxx.$(OBJEXT) \ - ns_tests_cxx.$(OBJEXT) runtests_cxx.$(OBJEXT) \ - structdata_cxx.$(OBJEXT) -runtests_cxx_OBJECTS = $(am_runtests_cxx_OBJECTS) -runtests_cxx_DEPENDENCIES = ../lib/libexpatinternal.la -runtests_cxx_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ +am_runtestspp_OBJECTS = runtestspp.$(OBJEXT) +runtestspp_OBJECTS = $(am_runtestspp_OBJECTS) +runtestspp_DEPENDENCIES = libruntests.a ../lib/libexpatinternal.la +runtestspp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(runtests_cxx_LDFLAGS) $(LDFLAGS) -o $@ + $(CXXFLAGS) $(runtestspp_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -187,21 +185,9 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/acc_tests.Po \ - ./$(DEPDIR)/acc_tests_cxx.Po ./$(DEPDIR)/alloc_tests.Po \ - ./$(DEPDIR)/alloc_tests_cxx.Po ./$(DEPDIR)/basic_tests.Po \ - ./$(DEPDIR)/basic_tests_cxx.Po ./$(DEPDIR)/chardata.Po \ - ./$(DEPDIR)/chardata_cxx.Po ./$(DEPDIR)/common.Po \ - ./$(DEPDIR)/common_cxx.Po ./$(DEPDIR)/dummy.Po \ - ./$(DEPDIR)/dummy_cxx.Po ./$(DEPDIR)/handlers.Po \ - ./$(DEPDIR)/handlers_cxx.Po ./$(DEPDIR)/memcheck.Po \ - ./$(DEPDIR)/memcheck_cxx.Po ./$(DEPDIR)/minicheck.Po \ - ./$(DEPDIR)/minicheck_cxx.Po ./$(DEPDIR)/misc_tests.Po \ - ./$(DEPDIR)/misc_tests_cxx.Po ./$(DEPDIR)/ns_tests.Po \ - ./$(DEPDIR)/ns_tests_cxx.Po ./$(DEPDIR)/nsalloc_tests.Po \ - ./$(DEPDIR)/nsalloc_tests_cxx.Po ./$(DEPDIR)/runtests.Po \ - ./$(DEPDIR)/runtests_cxx.Po ./$(DEPDIR)/structdata.Po \ - ./$(DEPDIR)/structdata_cxx.Po +am__depfiles_remade = ./$(DEPDIR)/chardata.Po ./$(DEPDIR)/memcheck.Po \ + ./$(DEPDIR)/minicheck.Po ./$(DEPDIR)/runtests.Po \ + ./$(DEPDIR)/runtestspp.Po ./$(DEPDIR)/structdata.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -239,8 +225,10 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(runtests_SOURCES) $(runtests_cxx_SOURCES) -DIST_SOURCES = $(runtests_SOURCES) $(runtests_cxx_SOURCES) +SOURCES = $(libruntests_a_SOURCES) $(runtests_SOURCES) \ + $(runtestspp_SOURCES) +DIST_SOURCES = $(libruntests_a_SOURCES) $(runtests_SOURCES) \ + $(runtestspp_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -560,7 +548,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -580,7 +567,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -663,56 +649,28 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . benchmark +noinst_LIBRARIES = libruntests.a # To support MinGW and Non-MinGW at the same time: LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh -runtests_SOURCES = \ - acc_tests.c \ - alloc_tests.c \ - basic_tests.c \ +libruntests_a_SOURCES = \ chardata.c \ - common.c \ - dummy.c \ - handlers.c \ + structdata.c \ memcheck.c \ - minicheck.c \ - misc_tests.c \ - ns_tests.c \ - nsalloc_tests.c \ - runtests.c \ - structdata.c - -runtests_cxx_SOURCES = \ - acc_tests_cxx.cpp \ - alloc_tests_cxx.cpp \ - basic_tests_cxx.cpp \ - chardata_cxx.cpp \ - common_cxx.cpp \ - dummy_cxx.cpp \ - handlers_cxx.cpp \ - memcheck_cxx.cpp \ - minicheck_cxx.cpp \ - misc_tests_cxx.cpp \ - nsalloc_tests_cxx.cpp \ - ns_tests_cxx.cpp \ - runtests_cxx.cpp \ - structdata_cxx.cpp - -runtests_LDADD = ../lib/libexpatinternal.la -runtests_cxx_LDADD = ../lib/libexpatinternal.la + minicheck.c + +runtests_SOURCES = \ + runtests.c + +runtestspp_SOURCES = \ + runtestspp.cpp + +runtests_LDADD = libruntests.a ../lib/libexpatinternal.la +runtestspp_LDADD = libruntests.a ../lib/libexpatinternal.la
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/benchmark/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/tests/benchmark/Makefile.in
Changed
@@ -133,8 +133,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -261,7 +259,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -281,7 +278,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -372,7 +368,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -396,9 +392,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps):
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/benchmark/benchmark.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/benchmark/benchmark.c
Changed
@@ -8,7 +8,7 @@ Copyright (c) 2003-2006 Karl Waclawek <karl@waclawek.net> Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Licensed under the MIT license: @@ -33,8 +33,6 @@ */ #include <sys/stat.h> -#include <assert.h> -#include <stddef.h> // ptrdiff_t #include <stdlib.h> #include <stdio.h> #include <time.h> @@ -64,8 +62,7 @@ char *XMLBuf, *XMLBufEnd, *XMLBufPtr; FILE *fd; struct stat fileAttr; - int nrOfLoops, bufferSize, i, isFinal; - size_t fileSize; + int nrOfLoops, bufferSize, fileSize, i, isFinal; int j = 0, ns = 0; clock_t tstart, tend; double cpuTime = 0.0; @@ -117,13 +114,12 @@ isFinal = 0; tstart = clock(); do { - ptrdiff_t parseBufferSize = XMLBufEnd - XMLBufPtr; - if (parseBufferSize <= (ptrdiff_t)bufferSize) + int parseBufferSize = XMLBufEnd - XMLBufPtr; + if (parseBufferSize <= bufferSize) isFinal = 1; else parseBufferSize = bufferSize; - assert(parseBufferSize <= (ptrdiff_t)bufferSize); - if (! XML_Parse(parser, XMLBufPtr, (int)parseBufferSize, isFinal)) { + if (! XML_Parse(parser, XMLBufPtr, parseBufferSize, isFinal)) { fprintf(stderr, "error '%" XML_FMT_STR "' at line %" XML_FMT_INT_MOD "u character %" XML_FMT_INT_MOD "u\n",
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/chardata.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/chardata.c
Changed
@@ -9,10 +9,9 @@ Copyright (c) 2002-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> Copyright (c) 2016 Gilles Espinasse <g.esp@free.fr> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Joe Orton <jorton@redhat.com> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -35,11 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if defined(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include "expat_config.h" +#include <expat_config.h> #include "minicheck.h" #include <assert.h> @@ -85,16 +80,15 @@ int CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) { + char buffer1024; int len = xmlstrlen(expected); int count; assert(storage != NULL); count = (storage->count < 0) ? 0 : storage->count; if (len != count) { - char buffer1024; - snprintf(buffer, sizeof(buffer), - "wrong number of data characters: got %d, expected %d", count, - len); + sprintf(buffer, "wrong number of data characters: got %d, expected %d", + count, len); fail(buffer); return 0; }
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/memcheck.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/memcheck.c
Changed
@@ -6,9 +6,8 @@ \___/_/\_\ .__/ \__,_|\__| |_| XML parser - Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> + Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> + Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -50,13 +49,12 @@ static AllocationEntry *alloc_head = NULL; static AllocationEntry *alloc_tail = NULL; -static AllocationEntry *find_allocation(const void *ptr); +static AllocationEntry *find_allocation(void *ptr); /* Allocate some memory and keep track of it. */ void * tracking_malloc(size_t size) { - AllocationEntry *const entry - = (AllocationEntry *)malloc(sizeof(AllocationEntry)); + AllocationEntry *entry = malloc(sizeof(AllocationEntry)); if (entry == NULL) { printf("Allocator failure\n"); @@ -84,7 +82,7 @@ } static AllocationEntry * -find_allocation(const void *ptr) { +find_allocation(void *ptr) { AllocationEntry *entry; for (entry = alloc_head; entry != NULL; entry = entry->next) { @@ -142,7 +140,7 @@ entry = find_allocation(ptr); if (entry == NULL) { printf("Attempting to realloc unallocated memory at %p\n", ptr); - entry = (AllocationEntry *)malloc(sizeof(AllocationEntry)); + entry = malloc(sizeof(AllocationEntry)); if (entry == NULL) { printf("Reallocator failure\n"); return NULL; @@ -164,11 +162,12 @@ alloc_tail = entry; } } else { - void *const reallocated = realloc(ptr, size); - if (reallocated == NULL) { + entry->allocation = realloc(ptr, size); + if (entry->allocation == NULL) { + /* Realloc semantics say the original is still allocated */ + entry->allocation = ptr; return NULL; } - entry->allocation = reallocated; } entry->num_bytes = size;
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/minicheck.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/minicheck.c
Changed
@@ -11,11 +11,10 @@ |_| XML parser Copyright (c) 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2020 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -38,11 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if defined(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <setjmp.h> @@ -94,8 +88,7 @@ if (tc->allocated == tc->ntests) { int nalloc = tc->allocated + 100; size_t new_size = sizeof(tcase_test_function) * nalloc; - tcase_test_function *const new_tests - = (tcase_test_function *)realloc(tc->tests, new_size); + tcase_test_function *new_tests = realloc(tc->tests, new_size); assert(new_tests != NULL); tc->tests = new_tests; tc->allocated = nalloc; @@ -130,7 +123,7 @@ SRunner * srunner_create(Suite *suite) { - SRunner *const runner = (SRunner *)calloc(1, sizeof(SRunner)); + SRunner *runner = calloc(1, sizeof(SRunner)); if (runner != NULL) { runner->suite = suite; } @@ -139,35 +132,17 @@ static jmp_buf env; -#define SUBTEST_LEN (50) // informative, but not too long static char const *_check_current_function = NULL; -static char _check_current_subtestSUBTEST_LEN; static int _check_current_lineno = -1; static char const *_check_current_filename = NULL; void _check_set_test_info(char const *function, char const *filename, int lineno) { _check_current_function = function; - set_subtest("%s", ""); _check_current_lineno = lineno; _check_current_filename = filename; } -void -set_subtest(char const *fmt, ...) { - va_list ap; - va_start(ap, fmt); - vsnprintf(_check_current_subtest, SUBTEST_LEN, fmt, ap); - va_end(ap); - // replace line feeds with spaces, for nicer error logs - for (size_t i = 0; i < SUBTEST_LEN; ++i) { - if (_check_current_subtesti == '\n') { - _check_current_subtesti = ' '; - } - } - _check_current_subtestSUBTEST_LEN - 1 = '\0'; // ensure termination -} - static void handle_success(int verbosity) { if (verbosity >= CK_VERBOSE) { @@ -176,20 +151,16 @@ } static void -handle_failure(SRunner *runner, int verbosity, const char *context, - const char *phase_info) { +handle_failure(SRunner *runner, int verbosity, const char *phase_info) { runner->nfailures++; if (verbosity != CK_SILENT) { - if (strlen(_check_current_subtest) != 0) { - phase_info = _check_current_subtest; - } - printf("FAIL %s: %s (%s at %s:%d)\n", context, _check_current_function, - phase_info, _check_current_filename, _check_current_lineno); + printf("FAIL: %s (%s at %s:%d)\n", _check_current_function, phase_info, + _check_current_filename, _check_current_lineno); } } void -srunner_run_all(SRunner *runner, const char *context, int verbosity) { +srunner_run_all(SRunner *runner, int verbosity) { Suite *suite; TCase *volatile tc; assert(runner != NULL); @@ -199,28 +170,26 @@ volatile int i; for (i = 0; i < tc->ntests; ++i) { runner->nchecks++; - set_subtest("%s", ""); if (tc->setup != NULL) { /* setup */ if (setjmp(env)) { - handle_failure(runner, verbosity, context, "during setup"); + handle_failure(runner, verbosity, "during setup"); continue; } tc->setup(); } /* test */ if (setjmp(env)) { - handle_failure(runner, verbosity, context, "during actual test"); + handle_failure(runner, verbosity, "during actual test"); continue; } (tc->testsi)(); - set_subtest("%s", ""); /* teardown */ if (tc->teardown != NULL) { if (setjmp(env)) { - handle_failure(runner, verbosity, context, "during teardown"); + handle_failure(runner, verbosity, "during teardown"); continue; } tc->teardown(); @@ -230,10 +199,6 @@ } tc = tc->next_tcase; } -} - -void -srunner_summarize(SRunner *runner, int verbosity) { if (verbosity != CK_SILENT) { int passed = runner->nchecks - runner->nfailures; double percentage = ((double)passed) / runner->nchecks; @@ -244,11 +209,12 @@ } void -_fail(const char *file, int line, const char *msg) { +_fail_unless(int condition, const char *file, int line, const char *msg) { /* Always print the error message so it isn't lost. In this case, we have a failure, so there's no reason to be quiet about what it is. */ + UNUSED_P(condition); _check_current_filename = file; _check_current_lineno = line; if (msg != NULL) {
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/minicheck.h -> _service:tar_scm:expat-2.5.0.tar.gz/tests/minicheck.h
Changed
@@ -14,9 +14,7 @@ Copyright (c) 2004-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2006-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com> + Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -43,54 +41,30 @@ extern "C" { #endif -#ifndef XML_MINICHECK_H -# define XML_MINICHECK_H +#define CK_NOFORK 0 +#define CK_FORK 1 -# define CK_NOFORK 0 -# define CK_FORK 1 - -# define CK_SILENT 0 -# define CK_NORMAL 1 -# define CK_VERBOSE 2 +#define CK_SILENT 0 +#define CK_NORMAL 1 +#define CK_VERBOSE 2 /* Workaround for Microsoft's compiler and Tru64 Unix systems where the C compiler has a working __func__, but the C++ compiler only has a working __FUNCTION__. This could be fixed in configure.in, but it's not worth it right now. */ -# if defined(_MSC_VER) || (defined(__osf__) && defined(__cplusplus)) -# define __func__ __FUNCTION__ -# endif - -/* PRINTF_LIKE has two effects: - 1. Make clang's -Wformat-nonliteral stop warning about non-literal format - strings in annotated functions' code. - 2. Make both clang and gcc's -Wformat-nonliteral warn about *callers* of - the annotated function that use a non-literal format string. -*/ -# if defined(__GNUC__) -# define PRINTF_LIKE(fmtpos, argspos) \ - __attribute__((format(printf, fmtpos, argspos))) -# else -# define PRINTF_LIKE(fmtpos, argspos) -# endif - -# define START_TEST(testname) \ - static void testname(void) { \ - _check_set_test_info(__func__, __FILE__, __LINE__); \ - { -# define END_TEST \ - } \ - } - -void PRINTF_LIKE(1, 2) set_subtest(char const *fmt, ...); - -# define fail(msg) _fail(__FILE__, __LINE__, msg) -# define assert_true(cond) \ - do { \ - if (! (cond)) { \ - _fail(__FILE__, __LINE__, "check failed: " #cond); \ - } \ - } while (0) +#if defined(_MSC_VER) || (defined(__osf__) && defined(__cplusplus)) +# define __func__ __FUNCTION__ +#endif + +#define START_TEST(testname) \ + static void testname(void) { \ + _check_set_test_info(__func__, __FILE__, __LINE__); \ + { +#define END_TEST \ + } \ + } + +#define fail(msg) _fail_unless(0, __FILE__, __LINE__, msg) typedef void (*tcase_setup_function)(void); typedef void (*tcase_teardown_function)(void); @@ -129,25 +103,18 @@ * Prototypes for the actual implementation. */ -# if defined(__GNUC__) -__attribute__((noreturn)) -# endif -void -_fail(const char *file, int line, const char *msg); +void _fail_unless(int condition, const char *file, int line, const char *msg); Suite *suite_create(const char *name); TCase *tcase_create(const char *name); void suite_add_tcase(Suite *suite, TCase *tc); -void tcase_add_checked_fixture(TCase *tc, tcase_setup_function setup, - tcase_teardown_function teardown); +void tcase_add_checked_fixture(TCase *, tcase_setup_function, + tcase_teardown_function); void tcase_add_test(TCase *tc, tcase_test_function test); SRunner *srunner_create(Suite *suite); -void srunner_run_all(SRunner *runner, const char *context, int verbosity); -void srunner_summarize(SRunner *runner, int verbosity); +void srunner_run_all(SRunner *runner, int verbosity); int srunner_ntests_failed(SRunner *runner); void srunner_free(SRunner *runner); -#endif /* XML_MINICHECK_H */ - #ifdef __cplusplus } #endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/runtests.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/runtests.c
Changed
@@ -10,16 +10,14 @@ Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2017 Joe Orton <jorton@redhat.com> Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> + Copyright (c) 2021 Dong-hee Na <donghee.na@python.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -42,36 +40,12451 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "expat_config.h" +#include <expat_config.h> +#if defined(NDEBUG) +# undef NDEBUG /* because test suite relies on assert(...) at the moment */ +#endif + +#include <assert.h> +#include <stdlib.h> #include <stdio.h> #include <string.h> +#include <stddef.h> /* ptrdiff_t */ +#include <ctype.h> +#include <limits.h> +#include <stdint.h> /* intptr_t uint64_t */ + +#if ! defined(__cplusplus) +# include <stdbool.h> +#endif #include "expat.h" +#include "chardata.h" +#include "structdata.h" #include "internal.h" #include "minicheck.h" -#include "common.h" +#include "memcheck.h" +#include "siphash.h" +#include "ascii.h" /* for ASCII_xxx */ + +#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_CHAR "lc" +# define XML_FMT_STR "ls" +# include <wchar.h> +# define xcstrlen(s) wcslen(s) +# define xcstrcmp(s, t) wcscmp((s), (t)) +# define xcstrncmp(s, t, n) wcsncmp((s), (t), (n)) +# define XCS(s) _XCS(s) +# define _XCS(s) L##s +#else +# ifdef XML_UNICODE +# error "No support for UTF-16 character without wchar_t in tests" +# else +# define XML_FMT_CHAR "c" +# define XML_FMT_STR "s" +# define xcstrlen(s) strlen(s) +# define xcstrcmp(s, t) strcmp((s), (t)) +# define xcstrncmp(s, t, n) strncmp((s), (t), (n)) +# define XCS(s) s +# endif /* XML_UNICODE */ +#endif /* XML_UNICODE_WCHAR_T */ + +static XML_Parser g_parser = NULL; + +static void +tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test) { +#ifdef XML_DTD + tcase_add_test(tc, test); +#else + UNUSED_P(tc); + UNUSED_P(test); +#endif +} + +static void +basic_setup(void) { + g_parser = XML_ParserCreate(NULL); + if (g_parser == NULL) + fail("Parser not created."); +} + +static void +basic_teardown(void) { + if (g_parser != NULL) { + XML_ParserFree(g_parser); + g_parser = NULL; + } +} + +/* Generate a failure using the parser state to create an error message; + this should be used when the parser reports an error we weren't + expecting. +*/ +static void +_xml_failure(XML_Parser parser, const char *file, int line) { + char buffer1024; + enum XML_Error err = XML_GetErrorCode(parser); + sprintf(buffer, + " %d: %" XML_FMT_STR " (line %" XML_FMT_INT_MOD + "u, offset %" XML_FMT_INT_MOD "u)\n reported from %s, line %d\n", + err, XML_ErrorString(err), XML_GetCurrentLineNumber(parser), + XML_GetCurrentColumnNumber(parser), file, line); + _fail_unless(0, file, line, buffer); +} + +static enum XML_Status +_XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s, int len, + int isFinal) { + enum XML_Status res = XML_STATUS_ERROR; + int offset = 0; + + if (len == 0) { + return XML_Parse(parser, s, len, isFinal); + } + + for (; offset < len; offset++) { + const int innerIsFinal = (offset == len - 1) && isFinal; + const char c = soffset; /* to help out-of-bounds detection */ + res = XML_Parse(parser, &c, sizeof(char), innerIsFinal); + if (res != XML_STATUS_OK) { + return res; + } + } + return res; +} + +#define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__) + +static void +_expect_failure(const char *text, enum XML_Error errorCode, + const char *errorMessage, const char *file, int lineno) { + if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) + == XML_STATUS_OK) + /* Hackish use of _fail_unless() macro, but let's us report + the right filename and line number. */ + _fail_unless(0, file, lineno, errorMessage); + if (XML_GetErrorCode(g_parser) != errorCode) + _xml_failure(g_parser, file, lineno); +} + +#define expect_failure(text, errorCode, errorMessage) \ + _expect_failure((text), (errorCode), (errorMessage), __FILE__, __LINE__) + +/* Dummy handlers for when we need to set a handler to tickle a bug, + but it doesn't need to do anything. +*/ +static unsigned long dummy_handler_flags = 0; + +#define DUMMY_START_DOCTYPE_HANDLER_FLAG (1UL << 0) +#define DUMMY_END_DOCTYPE_HANDLER_FLAG (1UL << 1) +#define DUMMY_ENTITY_DECL_HANDLER_FLAG (1UL << 2) +#define DUMMY_NOTATION_DECL_HANDLER_FLAG (1UL << 3) +#define DUMMY_ELEMENT_DECL_HANDLER_FLAG (1UL << 4) +#define DUMMY_ATTLIST_DECL_HANDLER_FLAG (1UL << 5) +#define DUMMY_COMMENT_HANDLER_FLAG (1UL << 6) +#define DUMMY_PI_HANDLER_FLAG (1UL << 7) +#define DUMMY_START_ELEMENT_HANDLER_FLAG (1UL << 8) +#define DUMMY_START_CDATA_HANDLER_FLAG (1UL << 9) +#define DUMMY_END_CDATA_HANDLER_FLAG (1UL << 10) +#define DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG (1UL << 11) +#define DUMMY_START_NS_DECL_HANDLER_FLAG (1UL << 12) +#define DUMMY_END_NS_DECL_HANDLER_FLAG (1UL << 13) +#define DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG (1UL << 14) +#define DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG (1UL << 15) +#define DUMMY_SKIP_HANDLER_FLAG (1UL << 16) +#define DUMMY_DEFAULT_HANDLER_FLAG (1UL << 17) + +static void XMLCALL +dummy_xdecl_handler(void *userData, const XML_Char *version, + const XML_Char *encoding, int standalone) { + UNUSED_P(userData); + UNUSED_P(version); + UNUSED_P(encoding); + UNUSED_P(standalone); +} + +static void XMLCALL +dummy_start_doctype_handler(void *userData, const XML_Char *doctypeName, + const XML_Char *sysid, const XML_Char *pubid, + int has_internal_subset) { + UNUSED_P(userData);
View file
_service:tar_scm:expat-2.5.0.tar.gz/tests/runtestspp.cpp
Added
@@ -0,0 +1,36 @@ +/* C++ compilation harness for the test suite. + + This is used to ensure the Expat headers can be included from C++ + and have everything work as expected. + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 2005 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. +*/ + +#include "runtests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/structdata.c -> _service:tar_scm:expat-2.5.0.tar.gz/tests/structdata.c
Changed
@@ -7,8 +7,7 @@ |_| XML parser Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> + 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 @@ -31,10 +30,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if defined(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - #include "expat_config.h" #include <assert.h> @@ -61,7 +56,7 @@ static XML_Char * xmlstrdup(const XML_Char *s) { size_t byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char); - XML_Char *const dup = (XML_Char *)malloc(byte_count); + XML_Char *dup = malloc(byte_count); assert(dup != NULL); memcpy(dup, s, byte_count); @@ -84,13 +79,13 @@ assert(storage != NULL); assert(s != NULL); if (storage->count == storage->max_count) { - StructDataEntry *new_entries; + StructDataEntry *new; storage->max_count += STRUCT_EXTENSION_COUNT; - new_entries = (StructDataEntry *)realloc( - storage->entries, storage->max_count * sizeof(StructDataEntry)); - assert(new_entries != NULL); - storage->entries = new_entries; + new = realloc(storage->entries, + storage->max_count * sizeof(StructDataEntry)); + assert(new != NULL); + storage->entries = new; } entry = &storage->entriesstorage->count; @@ -108,17 +103,17 @@ StructData_CheckItems(StructData *storage, const StructDataEntry *expected, int count) { char buffer1024; + int i; assert(storage != NULL); assert(expected != NULL); if (count != storage->count) { - snprintf(buffer, sizeof(buffer), - "wrong number of entries: got %d, expected %d", storage->count, - count); + sprintf(buffer, "wrong number of entries: got %d, expected %d", + storage->count, count); StructData_Dispose(storage); fail(buffer); } else { - for (int i = 0; i < count; i++) { + for (i = 0; i < count; i++) { const StructDataEntry *got = &storage->entriesi; const StructDataEntry *want = &expectedi; @@ -131,11 +126,11 @@ } else { if (got->data0 != want->data0 || got->data1 != want->data1 || got->data2 != want->data2) { - snprintf(buffer, sizeof(buffer), - "struct '%" XML_FMT_STR - "' expected (%d,%d,%d), got (%d,%d,%d)", - got->str, want->data0, want->data1, want->data2, got->data0, - got->data1, got->data2); + sprintf(buffer, + "struct '%" XML_FMT_STR + "' expected (%d,%d,%d), got (%d,%d,%d)", + got->str, want->data0, want->data1, want->data2, got->data0, + got->data1, got->data2); StructData_Dispose(storage); fail(buffer); }
View file
_service:tar_scm:expat-2.6.0.tar.gz/win32/expat.iss -> _service:tar_scm:expat-2.5.0.tar.gz/win32/expat.iss
Changed
@@ -14,7 +14,7 @@ ; Copyright (c) 2001 Tim Peters <tim.peters@gmail.com> ; Copyright (c) 2001-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> ; Copyright (c) 2006-2017 Karl Waclawek <karl@waclawek.net> -; Copyright (c) 2007-2024 Sebastian Pipping <sebastian@pipping.org> +; Copyright (c) 2007-2022 Sebastian Pipping <sebastian@pipping.org> ; Copyright (c) 2022 Johnny Jazeix <jazeix@gmail.com> ; Licensed under the MIT license: ; @@ -37,7 +37,7 @@ ; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE ; USE OR OTHER DEALINGS IN THE SOFTWARE. -#define expatVer "2.6.0" +#define expatVer "2.5.0" Setup AppName=Expat @@ -77,7 +77,7 @@ Flags: ignoreversion; Source: doc\*.xml; DestDir: "{app}\Doc" Flags: ignoreversion; Source: win32\bin\Release\*.dll; DestDir: "{app}\Bin" Flags: ignoreversion; Source: win32\bin\Release\*.lib; DestDir: "{app}\Bin" -Flags: ignoreversion; Source: win32\version.rc.cmake; DestDir: "{app}\Source\win32" +Flags: ignoreversion; Source: win32\version.rc; DestDir: "{app}\Source\win32" Flags: ignoreversion; Source: win32\README.txt; DestDir: "{app}\Source" Flags: ignoreversion; Source: AUTHORS; DestDir: "{app}\Source" Flags: ignoreversion; Source: Changes; DestDir: "{app}\Source"
View file
_service:tar_scm:expat-2.5.0.tar.gz/win32/version.rc
Added
@@ -0,0 +1,17 @@ +1 VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_FILEVERSION +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileVersion", "VER_FILEVERSION" + VALUE "ProductVersion", "VER_FILEVERSION" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/Makefile.in -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/Makefile.in
Changed
@@ -134,8 +134,6 @@ $(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)/conftools/ax-cxx-compile-stdcxx.m4 \ - $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -269,7 +267,6 @@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -289,7 +286,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -396,7 +392,7 @@ .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -420,9 +416,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS)
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/readfilemap.c -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/readfilemap.c
Changed
@@ -13,7 +13,6 @@ Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2017 Franek Korta <fkorta@gmail.com> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -51,14 +50,14 @@ #if defined(_MSC_VER) # include <io.h> /* https://msdn.microsoft.com/en-us/library/wyssk1bs(v=vs.100).aspx */ -# define EXPAT_read _read -# define EXPAT_read_count_t int -# define EXPAT_read_req_t unsigned int +# define _EXPAT_read _read +# define _EXPAT_read_count_t int +# define _EXPAT_read_req_t unsigned int #else /* POSIX */ /* http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */ -# define EXPAT_read read -# define EXPAT_read_count_t ssize_t -# define EXPAT_read_req_t size_t +# define _EXPAT_read read +# define _EXPAT_read_count_t ssize_t +# define _EXPAT_read_req_t size_t #endif #ifndef S_ISREG @@ -68,7 +67,7 @@ # ifndef S_IFMT # define S_IFMT _S_IFMT # endif -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) #endif /* not S_ISREG */ #ifndef O_BINARY @@ -88,7 +87,7 @@ void *arg) { size_t nbytes; int fd; - EXPAT_read_count_t n; + _EXPAT_read_count_t n; struct stat sb; void *p; @@ -126,14 +125,14 @@ close(fd); return 0; } - n = EXPAT_read(fd, p, (EXPAT_read_req_t)nbytes); + n = _EXPAT_read(fd, p, (_EXPAT_read_req_t)nbytes); if (n < 0) { tperror(name); free(p); close(fd); return 0; } - if (n != (EXPAT_read_count_t)nbytes) { + if (n != (_EXPAT_read_count_t)nbytes) { ftprintf(stderr, T("%s: read unexpected number of bytes\n"), name); free(p); close(fd);
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/xmlfile.c -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/xmlfile.c
Changed
@@ -11,10 +11,10 @@ Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2004-2006 Karl Waclawek <karl@waclawek.net> Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> + Copyright (c) 2021 Dong-hee Na <donghee.na@python.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -37,7 +37,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "expat_config.h" +#include <expat_config.h> #include <stdio.h> #include <stdlib.h> @@ -71,7 +71,11 @@ # endif #endif -int g_read_size_bytes = 1024 * 8; +#ifdef _DEBUG +# define READ_SIZE 16 +#else +# define READ_SIZE (1024 * 8) +#endif typedef struct { XML_Parser parser; @@ -191,7 +195,7 @@ } for (;;) { int nread; - char *buf = (char *)XML_GetBuffer(parser, g_read_size_bytes); + char *buf = (char *)XML_GetBuffer(parser, READ_SIZE); if (! buf) { if (filename != NULL) close(fd); @@ -199,7 +203,7 @@ filename != NULL ? filename : T("xmlwf")); return 0; } - nread = read(fd, buf, g_read_size_bytes); + nread = read(fd, buf, READ_SIZE); if (nread < 0) { tperror(filename != NULL ? filename : T("STDIN")); if (filename != NULL)
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/xmlfile.h -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/xmlfile.h
Changed
@@ -10,7 +10,7 @@ Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net> Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2005 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -42,7 +42,5 @@ # define XML_FMT_INT_MOD "l" #endif -extern int g_read_size_bytes; - extern int XML_ProcessFile(XML_Parser parser, const XML_Char *filename, unsigned flags);
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/xmlwf.c -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/xmlwf.c
Changed
@@ -11,14 +11,13 @@ Copyright (c) 2001-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2004-2009 Karl Waclawek <karl@waclawek.net> Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> + Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2019 David Loffredo <loffredo@steptools.com> Copyright (c) 2020 Joe Orton <jorton@redhat.com> Copyright (c) 2020 Kleber Tarcísio <klebertarcisio@yahoo.com.br> Copyright (c) 2021 Tim Bray <tbray@textuality.com> Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com> - Copyright (c) 2022 Sean McBride <sean@rogue-research.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -41,7 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "expat_config.h" +#include <expat_config.h> #include <assert.h> #include <stdio.h> @@ -179,7 +178,7 @@ static int attcmp(const void *att1, const void *att2) { - return tcscmp(*(const XML_Char *const *)att1, *(const XML_Char *const *)att2); + return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); } static void XMLCALL @@ -216,8 +215,8 @@ static int nsattcmp(const void *p1, const void *p2) { - const XML_Char *att1 = *(const XML_Char *const *)p1; - const XML_Char *att2 = *(const XML_Char *const *)p2; + const XML_Char *att1 = *(const XML_Char **)p1; + const XML_Char *att2 = *(const XML_Char **)p2; int sep1 = (tcsrchr(att1, NSSEP) != 0); int sep2 = (tcsrchr(att2, NSSEP) != 0); if (sep1 != sep2) @@ -371,8 +370,8 @@ static int notationCmp(const void *a, const void *b) { - const NotationList *const n1 = *(const NotationList *const *)a; - const NotationList *const n2 = *(const NotationList *const *)b; + const NotationList *const n1 = *(NotationList **)a; + const NotationList *const n2 = *(NotationList **)b; return xcscmp(n1->notationName, n2->notationName); } @@ -872,9 +871,6 @@ } } -#if defined(__GNUC__) -__attribute__((noreturn)) -#endif static void usage(const XML_Char *prog, int rc) { ftprintf( @@ -887,54 +883,50 @@ /* clang-format off */ T("usage:\n") T(" %s OPTIONS FILE ...\n") - T(" %s -h|--help\n") - T(" %s -v|--version\n") + T(" %s -h\n") + T(" %s -v\n") T("\n") T("xmlwf - Determines if an XML document is well-formed\n") T("\n") T("positional arguments:\n") - T(" FILE file to process (default: STDIN)\n") + T(" FILE file to process (default: STDIN)\n") T("\n") T("input control arguments:\n") - T(" -s print an error if the document is not standalone\n") - T(" -n enable namespace processing\n") - T(" -p enable processing of external DTDs and parameter entities\n") - T(" -x enable processing of external entities\n") - T(" -e ENCODING override any in-document encoding declaration\n") - T(" -w enable support for Windows code pages\n") - T(" -r disable memory-mapping and use read calls instead\n") - T(" -g BYTES buffer size to request per call pair to XML_GetBuffer and read (default: 8 KiB)\n") - T(" -k when processing multiple files, keep processing after first file with error\n") + T(" -s print an error if the document is not standalone\n") + T(" -n enable namespace processing\n") + T(" -p enable processing external DTDs and parameter entities\n") + T(" -x enable processing of external entities\n") + T(" -e ENCODING override any in-document encoding declaration\n") + T(" -w enable support for Windows code pages\n") + T(" -r disable memory-mapping and use normal file read IO calls instead\n") + T(" -k when processing multiple files, keep processing after first file with error\n") T("\n") T("output control arguments:\n") - T(" -d DIRECTORY output destination directory\n") - T(" -c write a copy of input XML, not canonical XML\n") - T(" -m write meta XML, not canonical XML\n") - T(" -t write no XML output for timing of plain parsing\n") - T(" -N enable adding doctype and notation declarations\n") + T(" -d DIRECTORY output destination directory\n") + T(" -c write a copy of input XML, not canonical XML\n") + T(" -m write meta XML, not canonical XML\n") + T(" -t write no XML output for timing of plain parsing\n") + T(" -N enable adding doctype and notation declarations\n") T("\n") T("billion laughs attack protection:\n") T(" NOTE: If you ever need to increase these values for non-attack payload, please file a bug report.\n") T("\n") - T(" -a FACTOR set maximum tolerated amplification factor (default: 100.0)\n") - T(" -b BYTES set number of output bytes needed to activate (default: 8 MiB)\n") - T("\n") - T("reparse deferral:\n") - T(" -q disable reparse deferral, and allow quadratic parse runtime with large tokens\n") + T(" -a FACTOR set maximum tolerated amplification factor (default: 100.0)\n") + T(" -b BYTES set number of output bytes needed to activate (default: 8 MiB)\n") T("\n") T("info arguments:\n") - T(" -h, --help show this help message and exit\n") - T(" -v, --version show program's version number and exit\n") + T(" -h show this help message and exit\n") + T(" -v show program's version number and exit\n") T("\n") T("exit status:\n") - T(" 0 the input files are well-formed and the output (if requested) was written successfully\n") - T(" 1 could not allocate data structures, signals a serious problem with execution environment\n") - T(" 2 one or more input files were not well-formed\n") - T(" 3 could not create an output file\n") - T(" 4 command-line argument error\n") + T(" 0 the input files are well-formed and the output (if requested) was written successfully\n") + T(" 1 could not allocate data structures, signals a serious problem with execution environment\n") + T(" 2 one or more input files were not well-formed\n") + T(" 3 could not create an output file\n") + T(" 4 command-line argument error\n") T("\n") T("xmlwf of libexpat is software libre, licensed under the MIT license.\n") - T("Please report bugs at https://github.com/libexpat/libexpat/issues -- thank you!\n") + T("Please report bugs at https://github.com/libexpat/libexpat/issues. Thank you!\n") , /* clang-format on */ prog, prog, prog); exit(rc); @@ -948,10 +940,8 @@ #define XMLWF_SHIFT_ARG_INTO(constCharStarTarget, argc, argv, i, j) \ { \ if (argvij + 1 == T('\0')) { \ - if (++i == argc) { \ + if (++i == argc) \ usage(argv0, XMLWF_EXIT_USAGE_ERROR); \ - /* usage called exit(..), never gets here */ \ - } \ constCharStarTarget = argvi; \ } else { \ constCharStarTarget = argvi + j + 1; \ @@ -974,11 +964,9 @@ int continueOnError = 0; float attackMaximumAmplification = -1.0f; /* signaling "not set" */ - unsigned long long attackThresholdBytes = 0; + unsigned long long attackThresholdBytes; XML_Bool attackThresholdGiven = XML_FALSE; - XML_Bool disableDeferral = XML_FALSE; - int exitCode = XMLWF_EXIT_SUCCESS; enum XML_ParamEntityParsing paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; @@ -995,17 +983,9 @@ if (j == 0) { if (argvi0 != T('-')) break; - if (argvi1 == T('-')) { - if (argvi2 == T('\0')) { - i++; - break; - } else if (tcscmp(argvi + 2, T("help")) == 0) { - usage(argv0, XMLWF_EXIT_SUCCESS); - // usage called exit(..), never gets here - } else if (tcscmp(argvi + 2, T("version")) == 0) { - showVersion(argv0); - return XMLWF_EXIT_SUCCESS; - } + if (argvi1 == T('-') && argvi2 == T('\0')) { + i++; + break; } j++; } @@ -1058,30 +1038,10 @@ break; case T('h'): usage(argv0, XMLWF_EXIT_SUCCESS); - // usage called exit(..), never gets here + return 0; case T('v'):
View file
_service:tar_scm:expat-2.6.0.tar.gz/xmlwf/xmlwf_helpgen.py -> _service:tar_scm:expat-2.5.0.tar.gz/xmlwf/xmlwf_helpgen.py
Changed
@@ -6,7 +6,7 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2019-2023 Sebastian Pipping <sebastian@pipping.org> +# Copyright (c) 2019-2021 Sebastian Pipping <sebastian@pipping.org> # Copyright (c) 2021 Tim Bray <tbray@textuality.com> # Licensed under the MIT license: # @@ -33,20 +33,20 @@ epilog = """ exit status: - 0 the input files are well-formed and the output (if requested) was written successfully - 1 could not allocate data structures, signals a serious problem with execution environment - 2 one or more input files were not well-formed - 3 could not create an output file - 4 command-line argument error + 0 the input files are well-formed and the output (if requested) was written successfully + 1 could not allocate data structures, signals a serious problem with execution environment + 2 one or more input files were not well-formed + 3 could not create an output file + 4 command-line argument error xmlwf of libexpat is software libre, licensed under the MIT license. -Please report bugs at https://github.com/libexpat/libexpat/issues -- thank you! +Please report bugs at https://github.com/libexpat/libexpat/issues. Thank you! """ usage = """ %(prog)s OPTIONS FILE ... - %(prog)s -h|--help - %(prog)s -v|--version + %(prog)s -h + %(prog)s -v """ parser = argparse.ArgumentParser(prog='xmlwf', add_help=False, @@ -58,12 +58,11 @@ input_related = parser.add_argument_group('input control arguments') input_related.add_argument('-s', action='store_true', help='print an error if the document is not standalone') input_related.add_argument('-n', action='store_true', help='enable namespace processing') -input_related.add_argument('-p', action='store_true', help='enable processing of external DTDs and parameter entities') +input_related.add_argument('-p', action='store_true', help='enable processing external DTDs and parameter entities') input_related.add_argument('-x', action='store_true', help='enable processing of external entities') input_related.add_argument('-e', action='store', metavar='ENCODING', help='override any in-document encoding declaration') input_related.add_argument('-w', action='store_true', help='enable support for Windows code pages') -input_related.add_argument('-r', action='store_true', help='disable memory-mapping and use read calls instead') -input_related.add_argument('-g', metavar='BYTES', help='buffer size to request per call pair to XML_GetBuffer and read (default: 8 KiB)') +input_related.add_argument('-r', action='store_true', help='disable memory-mapping and use normal file read IO calls instead') input_related.add_argument('-k', action='store_true', help='when processing multiple files, keep processing after first file with error') output_related = parser.add_argument_group('output control arguments') @@ -82,16 +81,12 @@ help='set maximum tolerated amplification factor (default: 100.0)') billion_laughs.add_argument('-b', metavar='BYTES', help='set number of output bytes needed to activate (default: 8 MiB)') -reparse_deferral = parser.add_argument_group('reparse deferral') -reparse_deferral.add_argument('-q', metavar='FACTOR', - help='disable reparse deferral, and allow quadratic parse runtime with large tokens') - parser.add_argument('files', metavar='FILE', nargs='*', help='file to process (default: STDIN)') info = parser.add_argument_group('info arguments') info = info.add_mutually_exclusive_group() -info.add_argument('-h', '--help', action='store_true', help='show this help message and exit') -info.add_argument('-v', '--version', action='store_true', help='show program\'s version number and exit') +info.add_argument('-h', action='store_true', help='show this help message and exit') +info.add_argument('-v', action='store_true', help='show program\'s version number and exit') if __name__ == '__main__':
View file
_service:tar_scm:expat-2.6.0.tar.gz/conftools/ax-cxx-compile-stdcxx-11.m4
Deleted
@@ -1,39 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11(ext|noext, mandatory|optional) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++11. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com> -# Copyright (c) 2012 Zack Weinberg <zackw@panix.com> -# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu> -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com> -# Copyright (c) 2015 Paul Norman <penorman@mac.com> -# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 18 - -AX_REQUIRE_DEFINED(AX_CXX_COMPILE_STDCXX) -AC_DEFUN(AX_CXX_COMPILE_STDCXX_11, AX_CXX_COMPILE_STDCXX(11, $1, $2))
View file
_service:tar_scm:expat-2.6.0.tar.gz/conftools/ax-cxx-compile-stdcxx.m4
Deleted
@@ -1,1018 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, ext|noext, mandatory|optional) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for -# the respective C++ standard version. -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for no added switch, and then for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com> -# Copyright (c) 2012 Zack Weinberg <zackw@panix.com> -# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu> -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com> -# Copyright (c) 2015 Paul Norman <penorman@mac.com> -# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu> -# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com> -# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com> -# Copyright (c) 2020 Jason Merrill <jason@redhat.com> -# Copyright (c) 2021 Jörn Heusipp <osmanx@problemloesungsmaschine.de> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 18 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AC_DEFUN(AX_CXX_COMPILE_STDCXX, dnl - m4_if($1, 11, ax_cxx_compile_alternatives="11 0x", - $1, 14, ax_cxx_compile_alternatives="14 1y", - $1, 17, ax_cxx_compile_alternatives="17 1z", - $1, 20, ax_cxx_compile_alternatives="20", - m4_fatal(invalid first argument `$1' to AX_CXX_COMPILE_STDCXX))dnl - m4_if($2, , , - $2, ext, , - $2, noext, , - m4_fatal(invalid second argument `$2' to AX_CXX_COMPILE_STDCXX))dnl - m4_if($3, , ax_cxx_compile_cxx$1_required=true, - $3, mandatory, ax_cxx_compile_cxx$1_required=true, - $3, optional, ax_cxx_compile_cxx$1_required=false, - m4_fatal(invalid third argument `$3' to AX_CXX_COMPILE_STDCXX)) - AC_LANG_PUSH(C++)dnl - ac_success=no - - m4_if($2, , dnl - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), - ax_cv_cxx_compile_cxx$1=yes, - ax_cv_cxx_compile_cxx$1=no)) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi) - - m4_if($2, noext, , dnl - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_$switch) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), - eval $cachevar=yes, - eval $cachevar=no) - CXX="$ac_save_CXX") - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi) - - m4_if($2, ext, , dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do - if test x"$switch" = xMSVC; then - dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide - dnl with -std=c++17. We suffix the cache variable name with _MSVC to - dnl avoid this. - switch=-std:c++${alternative} - cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_${switch}_MSVC) - else - cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_$switch) - fi - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), - eval $cachevar=yes, - eval $cachevar=no) - CXX="$ac_save_CXX") - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi) - AC_LANG_POP(C++) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR(*** A compiler with support for C++$1 language features is required.) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE(No compiler with C++$1 support was found) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - define if the compiler supports basic C++$1 syntax) - fi - AC_SUBST(HAVE_CXX$1) -) - - -dnl Test body for checking C++11 support - -m4_define(_AX_CXX_COMPILE_STDCXX_testbody_11, - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - -dnl Test body for checking C++14 support - -m4_define(_AX_CXX_COMPILE_STDCXX_testbody_14, - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - -dnl Test body for checking C++17 support - -m4_define(_AX_CXX_COMPILE_STDCXX_testbody_17, - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 -) - -dnl Test body for checking C++20 support - -m4_define(_AX_CXX_COMPILE_STDCXX_testbody_20, - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 -) - - -dnl Tests for new features in C++11 - -m4_define(_AX_CXX_COMPILE_STDCXX_testbody_new_in_11, - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler"
View file
_service:tar_scm:expat-2.6.0.tar.gz/examples/element_declarations.c
Deleted
@@ -1,234 +0,0 @@ -/* Read an XML document from standard input and print - element declarations (if any) to standard output. - 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 <steven@solie.ca> - Copyright (c) 2016-2024 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 <stdbool.h> -#include <stdio.h> -#include <stdlib.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 - -// While traversing the XML_Content tree, we avoid recursion -// to not be vulnerable to a denial of service attack. -typedef struct StackStruct { - const XML_Content *model; - unsigned level; - struct StackStruct *prev; -} Stack; - -static Stack * -stackPushMalloc(Stack *stackTop, const XML_Content *model, unsigned level) { - Stack *const newStackTop = malloc(sizeof(Stack)); - if (! newStackTop) { - return NULL; - } - newStackTop->model = model; - newStackTop->level = level; - newStackTop->prev = stackTop; - return newStackTop; -} - -static Stack * -stackPopFree(Stack *stackTop) { - Stack *const newStackTop = stackTop->prev; - free(stackTop); - return newStackTop; -} - -static char * -contentTypeName(enum XML_Content_Type contentType) { - switch (contentType) { - case XML_CTYPE_EMPTY: - return "EMPTY"; - case XML_CTYPE_ANY: - return "ANY"; - case XML_CTYPE_MIXED: - return "MIXED"; - case XML_CTYPE_NAME: - return "NAME"; - case XML_CTYPE_CHOICE: - return "CHOICE"; - case XML_CTYPE_SEQ: - return "SEQ"; - default: - return "???"; - } -} - -static char * -contentQuantName(enum XML_Content_Quant contentQuant) { - switch (contentQuant) { - case XML_CQUANT_NONE: - return "NONE"; - case XML_CQUANT_OPT: - return "OPT"; - case XML_CQUANT_REP: - return "REP"; - case XML_CQUANT_PLUS: - return "PLUS"; - default: - return "???"; - } -} - -static void -dumpContentModelElement(const XML_Content *model, unsigned level, - const XML_Content *root) { - // Indent - unsigned u = 0; - for (; u < level; u++) { - printf(" "); - } - - // Node - printf("%u type=%s(%d), quant=%s(%d)", (unsigned)(model - root), - contentTypeName(model->type), model->type, - contentQuantName(model->quant), model->quant); - if (model->name) { - printf(", name=\"%" XML_FMT_STR "\"", model->name); - } else { - printf(", name=NULL"); - } - printf(", numchildren=%d", model->numchildren); - printf("\n"); -} - -static bool -dumpContentModel(const XML_Char *name, const XML_Content *root) { - printf("Element \"%" XML_FMT_STR "\":\n", name); - Stack *stackTop = stackPushMalloc(NULL, root, 1); - if (! stackTop) { - return false; - } - - while (stackTop) { - const XML_Content *const model = stackTop->model; - const unsigned level = stackTop->level; - - dumpContentModelElement(model, level, root); - - stackTop = stackPopFree(stackTop); - - for (size_t u = model->numchildren; u >= 1; u--) { - Stack *const newStackTop - = stackPushMalloc(stackTop, model->children + (u - 1), level + 1); - if (! newStackTop) { - // We ran out of memory, so let's free all memory allocated - // earlier in this function, to be leak-clean: - while (stackTop != NULL) { - stackTop = stackPopFree(stackTop); - } - return false; - } - stackTop = newStackTop; - } - } - - printf("\n"); - return true; -} - -static void XMLCALL -handleElementDeclaration(void *userData, const XML_Char *name, - XML_Content *model) { - XML_Parser parser = (XML_Parser)userData; - const bool success = dumpContentModel(name, model); - XML_FreeContentModel(parser, model); - if (! success) { - XML_StopParser(parser, /* resumable= */ XML_FALSE); - } -} - -int -main(void) { - XML_Parser parser = XML_ParserCreate(NULL); - int done; - - if (! parser) { - fprintf(stderr, "Couldn't allocate memory for parser\n"); - return 1; - } - - XML_SetUserData(parser, parser); - XML_SetElementDeclHandler(parser, handleElementDeclaration);
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/acc_tests.c
Deleted
@@ -1,396 +0,0 @@ -/* Tests in the "accounting" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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 <math.h> /* NAN, INFINITY */ -#include <stdio.h> -#include <string.h> - -#include "expat_config.h" - -#include "expat.h" -#include "internal.h" -#include "common.h" -#include "minicheck.h" -#include "chardata.h" -#include "handlers.h" -#include "acc_tests.h" - -#if XML_GE == 1 -START_TEST(test_accounting_precision) { - struct AccountingTestCase cases = { - {"<e/>", NULL, NULL, 0}, - {"<e></e>", NULL, NULL, 0}, - - /* Attributes */ - {"<e k1=\"v2\" k2=\"v2\"/>", NULL, NULL, 0}, - {"<e k1=\"v2\" k2=\"v2\"></e>", NULL, NULL, 0}, - {"<p:e xmlns:p=\"https://domain.invalid/\" />", NULL, NULL, 0}, - {"<e k=\"&'><"\" />", NULL, NULL, - sizeof(XML_Char) * 5 /* number of predefined entities */}, - {"<e1 xmlns='https://example.org/'>\n" - " <e2 xmlns=''/>\n" - "</e1>", - NULL, NULL, 0}, - - /* Text */ - {"<e>text</e>", NULL, NULL, 0}, - {"<e1><e2>text1<e3/>text2</e2></e1>", NULL, NULL, 0}, - {"<e>&'><"</e>", NULL, NULL, - sizeof(XML_Char) * 5 /* number of predefined entities */}, - {"<e>A)</e>", NULL, NULL, 0}, - - /* Prolog */ - {"<?xml version=\"1.0\"?><root/>", NULL, NULL, 0}, - - /* Whitespace */ - {" <e1> <e2> </e2> </e1> ", NULL, NULL, 0}, - {"<e1 ><e2 /></e1 >", NULL, NULL, 0}, - {"<e1><e2 k = \"v\"/><e3 k = 'v'/></e1>", NULL, NULL, 0}, - - /* Comments */ - {"<!-- Comment --><e><!-- Comment --></e>", NULL, NULL, 0}, - - /* Processing instructions */ - {"<?xml-stylesheet type=\"text/xsl\" href=\"https://domain.invalid/\" media=\"all\"?><e/>", - NULL, NULL, 0}, - {"<?pi0?><?pi1 ?><?pi2 ?><r/><?pi4?>", NULL, NULL, 0}, -# ifdef XML_DTD - {"<?pi0?><?pi1 ?><?pi2 ?><!DOCTYPE r SYSTEM 'first.ent'><r/>", - "<?pi3?><!ENTITY % e1 SYSTEM 'second.ent'><?pi4?>%e1;<?pi5?>", "<?pi6?>", - 0}, -# endif /* XML_DTD */ - - /* CDATA */ - {"<e><!CDATAone two three></e>", NULL, NULL, 0}, - /* The following is the essence of this OSS-Fuzz finding: - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34302 - https://oss-fuzz.com/testcase-detail/4860575394955264 - */ - {"<!DOCTYPE r \n" - "<!ENTITY e \"111<!CDATA2 <= 2>333\">\n" - ">\n" - "<r>&e;</r>\n", - NULL, NULL, sizeof(XML_Char) * strlen("111<!CDATA2 <= 2>333")}, - -# ifdef XML_DTD - /* Conditional sections */ - {"<!DOCTYPE r \n" - "<!ENTITY % draft 'INCLUDE'>\n" - "<!ENTITY % final 'IGNORE'>\n" - "<!ENTITY % import SYSTEM \"first.ent\">\n" - "%import;\n" - ">\n" - "<r/>\n", - "<!%draft;<!--1-->>\n" - "<!%final;<!--22-->>", - NULL, sizeof(XML_Char) * (strlen("INCLUDE") + strlen("IGNORE"))}, -# endif /* XML_DTD */ - - /* General entities */ - {"<!DOCTYPE root \n" - "<!ENTITY nine \"123456789\">\n" - ">\n" - "<root>&nine;</root>", - NULL, NULL, sizeof(XML_Char) * strlen("123456789")}, - {"<!DOCTYPE root \n" - "<!ENTITY nine \"123456789\">\n" - ">\n" - "<root k1=\"&nine;\"/>", - NULL, NULL, sizeof(XML_Char) * strlen("123456789")}, - {"<!DOCTYPE root \n" - "<!ENTITY nine \"123456789\">\n" - "<!ENTITY nine2 \"&nine;&nine;\">\n" - ">\n" - "<root>&nine2;&nine2;&nine2;</root>", - NULL, NULL, - sizeof(XML_Char) * 3 /* calls to &nine2; */ * 2 /* calls to &nine; */ - * (strlen("&nine;") + strlen("123456789"))}, - {"<!DOCTYPE r \n" - " <!ENTITY five SYSTEM 'first.ent'>\n" - ">\n" - "<r>&five;</r>", - "12345", NULL, 0}, - {"<!DOCTYPE r \n" - " <!ENTITY five SYSTEM 'first.ent'>\n" - ">\n" - "<r>&five;</r>", - "\xEF\xBB\xBF" /* UTF-8 BOM */, NULL, 0}, - -# ifdef XML_DTD - /* Parameter entities */ - {"<!DOCTYPE r \n" - "<!ENTITY % comment \"<!---->\">\n" - "%comment;\n" - ">\n" - "<r/>", - NULL, NULL, sizeof(XML_Char) * strlen("<!---->")}, - {"<!DOCTYPE r \n" - "<!ENTITY % ninedef \"<!ENTITY nine "123456789">\">\n" - "%ninedef;\n" - ">\n" - "<r>&nine;</r>", - NULL, NULL, - sizeof(XML_Char) - * (strlen("<!ENTITY nine \"123456789\">") + strlen("123456789"))}, - {"<!DOCTYPE r \n" - "<!ENTITY % comment \"<!--1-->\">\n" - "<!ENTITY % comment2 \"%comment;<!--22-->%comment;\">\n" - "%comment2;\n" - ">\n" - "<r/>\n", - NULL, NULL, - sizeof(XML_Char) - * (strlen("%comment;<!--22-->%comment;") + 2 * strlen("<!--1-->"))}, - {"<!DOCTYPE r \n" - " <!ENTITY % five \"12345\">\n" - " <!ENTITY % five2def \"<!ENTITY five2 "%five;%five;">\">\n" - " %five2def;\n" - ">\n" - "<r>&five2;</r>", - NULL, NULL, /* from "%five2def;": */ - sizeof(XML_Char) - * (strlen("<!ENTITY five2 \"%five;%five;\">") - + 2 /* calls to "%five;" */ * strlen("12345") - + /* from "&five2;": */ strlen("1234512345"))}, - {"<!DOCTYPE r SYSTEM \"first.ent\">\n" - "<r/>", - "<!ENTITY % comment '<!--1-->'>\n" - "<!ENTITY % comment2 '<!--22-->%comment;<!--22-->%comment;<!--22-->'>\n" - "%comment2;",
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/acc_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "accounting" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_ACC_TESTS_H -# define XML_ACC_TESTS_H - -extern void make_accounting_test_case(Suite *s); - -#endif /* XML_ACC_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/acc_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "acc_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/alloc_tests.c
Deleted
@@ -1,2127 +0,0 @@ -/* Tests in the "allocation" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <string.h> -#include <assert.h> - -#include "expat.h" -#include "common.h" -#include "minicheck.h" -#include "dummy.h" -#include "handlers.h" -#include "alloc_tests.h" - -static void -alloc_setup(void) { - XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free}; - - /* Ensure the parser creation will go through */ - g_allocation_count = ALLOC_ALWAYS_SUCCEED; - g_reallocation_count = REALLOC_ALWAYS_SUCCEED; - g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL); - if (g_parser == NULL) - fail("Parser not created"); -} - -static void -alloc_teardown(void) { - basic_teardown(); -} - -/* Test the effects of allocation failures on xml declaration processing */ -START_TEST(test_alloc_parse_xdecl) { - const char *text = "<?xml version='1.0' encoding='utf-8'?>\n" - "<doc>Hello, world</doc>"; - int i; - const int max_alloc_count = 15; - - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - break; - /* Resetting the parser is insufficient, because some memory - * allocations are cached within the parser. Instead we use - * the teardown and setup routines to ensure that we have the - * right sort of parser back in our hands. - */ - alloc_teardown(); - alloc_setup(); - } - if (i == 0) - fail("Parse succeeded despite failing allocator"); - if (i == max_alloc_count) - fail("Parse failed with max allocations"); -} -END_TEST - -/* As above, but with an encoding big enough to cause storing the - * version information to expand the string pool being used. - */ -START_TEST(test_alloc_parse_xdecl_2) { - const char *text - = "<?xml version='1.0' encoding='" - /* Each line is 64 characters */ - "ThisIsAStupidlyLongEncodingNameIntendedToTriggerPoolGrowth123456" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP" - "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMN" - "'?>" - "<doc>Hello, world</doc>"; - int i; - const int max_alloc_count = 20; - - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - XML_SetXmlDeclHandler(g_parser, dummy_xdecl_handler); - XML_SetUnknownEncodingHandler(g_parser, long_encoding_handler, NULL); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - break; - /* See comment in test_alloc_parse_xdecl() */ - alloc_teardown(); - alloc_setup(); - } - if (i == 0) - fail("Parse succeeded despite failing allocator"); - if (i == max_alloc_count) - fail("Parse failed with max allocations"); -} -END_TEST - -/* Test the effects of allocation failures on a straightforward parse */ -START_TEST(test_alloc_parse_pi) { - const char *text = "<?xml version='1.0' encoding='utf-8'?>\n" - "<?pi unknown?>\n" - "<doc>" - "Hello, world" - "</doc>"; - int i; - const int max_alloc_count = 15; - - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - break; - /* See comment in test_alloc_parse_xdecl() */ - alloc_teardown(); - alloc_setup(); - } - if (i == 0) - fail("Parse succeeded despite failing allocator"); - if (i == max_alloc_count) - fail("Parse failed with max allocations"); -} -END_TEST - -START_TEST(test_alloc_parse_pi_2) { - const char *text = "<?xml version='1.0' encoding='utf-8'?>\n" - "<doc>" - "Hello, world" - "<?pi unknown?>\n" - "</doc>"; - int i; - const int max_alloc_count = 15; - - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - XML_SetProcessingInstructionHandler(g_parser, dummy_pi_handler); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - break; - /* See comment in test_alloc_parse_xdecl() */ - alloc_teardown(); - alloc_setup(); - } - if (i == 0) - fail("Parse succeeded despite failing allocator"); - if (i == max_alloc_count) - fail("Parse failed with max allocations"); -}
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/alloc_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "allocation" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_ALLOC_TESTS_H -# define XML_ALLOC_TESTS_H - -extern void make_alloc_test_case(Suite *s); - -#endif /* XML_ALLOC_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/alloc_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "alloc_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/basic_tests.c
Deleted
@@ -1,6076 +0,0 @@ -/* Tests in the "basic" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.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(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <assert.h> - -#include <stdio.h> -#include <string.h> -#include <time.h> - -#if ! defined(__cplusplus) -# include <stdbool.h> -#endif - -#include "expat_config.h" - -#include "expat.h" -#include "internal.h" -#include "minicheck.h" -#include "structdata.h" -#include "common.h" -#include "dummy.h" -#include "handlers.h" -#include "siphash.h" -#include "basic_tests.h" - -static void -basic_setup(void) { - g_parser = XML_ParserCreate(NULL); - if (g_parser == NULL) - fail("Parser not created."); -} - -/* - * Character & encoding tests. - */ - -START_TEST(test_nul_byte) { - char text = "<doc>\0</doc>"; - - /* test that a NUL byte (in US-ASCII data) is an error */ - if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE) - == XML_STATUS_OK) - fail("Parser did not report error on NUL-byte."); - if (XML_GetErrorCode(g_parser) != XML_ERROR_INVALID_TOKEN) - xml_failure(g_parser); -} -END_TEST - -START_TEST(test_u0000_char) { - /* test that a NUL byte (in US-ASCII data) is an error */ - expect_failure("<doc>�</doc>", XML_ERROR_BAD_CHAR_REF, - "Parser did not report error on NUL-byte."); -} -END_TEST - -START_TEST(test_siphash_self) { - if (! sip24_valid()) - fail("SipHash self-test failed"); -} -END_TEST - -START_TEST(test_siphash_spec) { - /* https://131002.net/siphash/siphash.pdf (page 19, "Test values") */ - const char message = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" - "\x0a\x0b\x0c\x0d\x0e"; - const size_t len = sizeof(message) - 1; - const uint64_t expected = SIP_ULL(0xa129ca61U, 0x49be45e5U); - struct siphash state; - struct sipkey key; - - sip_tokey(&key, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" - "\x0a\x0b\x0c\x0d\x0e\x0f"); - sip24_init(&state, &key); - - /* Cover spread across calls */ - sip24_update(&state, message, 4); - sip24_update(&state, message + 4, len - 4); - - /* Cover null length */ - sip24_update(&state, message, 0); - - if (sip24_final(&state) != expected) - fail("sip24_final failed spec test\n"); - - /* Cover wrapper */ - if (siphash24(message, len, &key) != expected) - fail("siphash24 failed spec test\n"); -} -END_TEST - -START_TEST(test_bom_utf8) { - /* This test is really just making sure we don't core on a UTF-8 BOM. */ - const char *text = "\357\273\277<e/>"; - - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); -} -END_TEST - -START_TEST(test_bom_utf16_be) { - char text = "\376\377\0<\0e\0/\0>"; - - if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); -} -END_TEST - -START_TEST(test_bom_utf16_le) { - char text = "\377\376<\0e\0/\0>\0"; - - if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); -} -END_TEST - -START_TEST(test_nobom_utf16_le) { - char text = " \0<\0e\0/\0>\0"; - - if (g_chunkSize == 1) { - // TODO: with just the first byte, we can't tell the difference between - // UTF-16-LE and UTF-8. Avoid the failure for now. - return; - } - - if (_XML_Parse_SINGLE_BYTES(g_parser, text, sizeof(text) - 1, XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); -} -END_TEST - -START_TEST(test_hash_collision) { - /* For full coverage of the lookup routine, we need to ensure a - * hash collision even though we can only tell that we have one - * through breakpoint debugging or coverage statistics. The - * following will cause a hash collision on machines with a 64-bit - * long type; others will have to experiment. The full coverage - * tests invoked from qa.sh usually provide a hash collision, but - * not always. This is an attempt to provide insurance. - */ -#define COLLIDING_HASH_SALT (unsigned long)SIP_ULL(0xffffffffU, 0xff99fc90U) - const char *text - = "<doc>\n" - "<a1/><a2/><a3/><a4/><a5/><a6/><a7/><a8/>\n" - "<b1></b1><b2 attr='foo'>This is a foo</b2><b3></b3><b4></b4>\n" - "<b5></b5><b6></b6><b7></b7><b8></b8>\n" - "<c1/><c2/><c3/><c4/><c5/><c6/><c7/><c8/>\n" - "<d1/><d2/><d3/><d4/><d5/><d6/><d7/>\n" - "<d8>This triggers the table growth and collides with b2</d8>\n" - "</doc>\n"; - - XML_SetHashSalt(g_parser, COLLIDING_HASH_SALT); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/basic_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "basic" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_BASIC_TESTS_H -# define XML_BASIC_TESTS_H - -extern void make_basic_test_case(Suite *s); - -#endif /* XML_BASIC_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/basic_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "basic_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/chardata_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "chardata.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/common.c
Deleted
@@ -1,325 +0,0 @@ -/* Commonly used functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.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 <assert.h> -#include <stdio.h> -#include <string.h> - -#include "expat_config.h" -#include "expat.h" -#include "internal.h" -#include "chardata.h" -#include "minicheck.h" -#include "common.h" - -/* Common test data */ - -const char *long_character_data_text - = "<?xml version='1.0' encoding='iso-8859-1'?><s>" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "</s>"; - -const char *long_cdata_text - = "<s><!CDATA" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "012345678901234567890123456789012345678901234567890123456789" - "></s>"; - -/* Having an element name longer than 1024 characters exercises some - * of the pool allocation code in the parser that otherwise does not - * get executed. The count at the end of the line is the number of - * characters (bytes) in the element name by that point.x - */ -const char *get_buffer_test_text - = "<documentwitharidiculouslylongelementnametotease" /* 0x030 */ - "aparticularcorneroftheallocationinXML_GetBuffers" /* 0x060 */ - "othatwecanimprovethecoverageyetagain012345678901" /* 0x090 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0c0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x0f0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x120 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x150 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x180 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1b0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x1e0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x210 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x240 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x270 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2a0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x2d0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x300 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x330 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x360 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x390 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3c0 */ - "123456789abcdef0123456789abcdef0123456789abcdef0" /* 0x3f0 */ - "123456789abcdef0123456789abcdef0123456789>\n<ef0"; /* 0x420 */ - -/* Test control globals */ - -/* Used as the "resumable" parameter to XML_StopParser by some tests */ -XML_Bool g_resumable = XML_FALSE; - -/* Used to control abort checks in some tests */ -XML_Bool g_abortable = XML_FALSE; - -/* Used to control _XML_Parse_SINGLE_BYTES() chunk size */ -int g_chunkSize = 1; - -/* Common test functions */ - -void -tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test) { -#ifdef XML_DTD - tcase_add_test(tc, test); -#else - UNUSED_P(tc); - UNUSED_P(test); -#endif -} - -void -tcase_add_test__if_xml_ge(TCase *tc, tcase_test_function test) { -#if XML_GE == 1 - tcase_add_test(tc, test); -#else - UNUSED_P(tc); - UNUSED_P(test); -#endif -} - -void -basic_teardown(void) { - if (g_parser != NULL) { - XML_ParserFree(g_parser); - g_parser = NULL; - } -} - -/* Generate a failure using the parser state to create an error message; - this should be used when the parser reports an error we weren't - expecting. -*/ -void -_xml_failure(XML_Parser parser, const char *file, int line) { - char buffer1024; - enum XML_Error err = XML_GetErrorCode(parser); - snprintf(buffer, sizeof(buffer), - " %d: %" XML_FMT_STR " (line %" XML_FMT_INT_MOD - "u, offset %" XML_FMT_INT_MOD "u)\n reported from %s, line %d\n", - err, XML_ErrorString(err), XML_GetCurrentLineNumber(parser), - XML_GetCurrentColumnNumber(parser), file, line); - _fail(file, line, buffer); -} - -enum XML_Status -_XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s, int len, - int isFinal) { - // This ensures that tests have to run pathological parse cases - // (e.g. when `s` is NULL) against plain XML_Parse rather than - // chunking _XML_Parse_SINGLE_BYTES. - assert((parser != NULL) && (s != NULL) && (len >= 0)); - const int chunksize = g_chunkSize; - if (chunksize > 0) {
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/common.h
Deleted
@@ -1,162 +0,0 @@ -/* Commonly used functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef XML_COMMON_H -# define XML_COMMON_H - -# include "expat_config.h" -# include "minicheck.h" -# include "chardata.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" -# include <wchar.h> -# define xcstrlen(s) wcslen(s) -# define xcstrcmp(s, t) wcscmp((s), (t)) -# define xcstrncmp(s, t, n) wcsncmp((s), (t), (n)) -# define XCS(s) _XCS(s) -# define _XCS(s) L##s -# else -# ifdef XML_UNICODE -# error "No support for UTF-16 character without wchar_t in tests" -# else -# define XML_FMT_STR "s" -# define xcstrlen(s) strlen(s) -# define xcstrcmp(s, t) strcmp((s), (t)) -# define xcstrncmp(s, t, n) strncmp((s), (t), (n)) -# define XCS(s) s -# endif /* XML_UNICODE */ -# endif /* XML_UNICODE_WCHAR_T */ - -extern XML_Parser g_parser; - -extern XML_Bool g_resumable; -extern XML_Bool g_abortable; - -extern int g_chunkSize; - -extern const char *long_character_data_text; -extern const char *long_cdata_text; -extern const char *get_buffer_test_text; - -extern void tcase_add_test__ifdef_xml_dtd(TCase *tc, tcase_test_function test); -extern void tcase_add_test__if_xml_ge(TCase *tc, tcase_test_function test); - -extern void basic_teardown(void); - -extern void _xml_failure(XML_Parser parser, const char *file, int line); - -# define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__) - -extern enum XML_Status _XML_Parse_SINGLE_BYTES(XML_Parser parser, const char *s, - int len, int isFinal); - -extern void _expect_failure(const char *text, enum XML_Error errorCode, - const char *errorMessage, const char *file, - int lineno); - -# define expect_failure(text, errorCode, errorMessage) \ - _expect_failure((text), (errorCode), (errorMessage), __FILE__, __LINE__) - -/* Support functions for handlers to collect up character and attribute data. - */ - -extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s, - int len); - -extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name, - const XML_Char **atts); - -extern void _run_character_check(const char *text, const XML_Char *expected, - const char *file, int line); - -# define run_character_check(text, expected) \ - _run_character_check(text, expected, __FILE__, __LINE__) - -extern void _run_attribute_check(const char *text, const XML_Char *expected, - const char *file, int line); - -# define run_attribute_check(text, expected) \ - _run_attribute_check(text, expected, __FILE__, __LINE__) - -typedef struct ExtTest { - const char *parse_text; - const XML_Char *encoding; - CharData *storage; -} ExtTest; - -extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s, - int len); - -extern void _run_ext_character_check(const char *text, ExtTest *test_data, - const XML_Char *expected, const char *file, - int line); - -# define run_ext_character_check(text, test_data, expected) \ - _run_ext_character_check(text, test_data, expected, __FILE__, __LINE__) - -# define ALLOC_ALWAYS_SUCCEED (-1) -# define REALLOC_ALWAYS_SUCCEED (-1) - -extern int g_allocation_count; -extern int g_reallocation_count; - -extern void *duff_allocator(size_t size); - -extern void *duff_reallocator(void *ptr, size_t size); - -#endif /* XML_COMMON_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/common_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "common.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/dummy.c
Deleted
@@ -1,261 +0,0 @@ -/* Dummy handler functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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. -*/ - -#include "expat.h" -#include "internal.h" -#include "common.h" -#include "dummy.h" - -/* Dummy handlers for when we need to set a handler to tickle a bug, - but it doesn't need to do anything. -*/ -static unsigned long dummy_handler_flags = 0; - -void -init_dummy_handlers(void) { - dummy_handler_flags = 0; -} - -unsigned long -get_dummy_handler_flags(void) { - return dummy_handler_flags; -} - -void XMLCALL -dummy_xdecl_handler(void *userData, const XML_Char *version, - const XML_Char *encoding, int standalone) { - UNUSED_P(userData); - UNUSED_P(version); - UNUSED_P(encoding); - UNUSED_P(standalone); -} - -void XMLCALL -dummy_start_doctype_handler(void *userData, const XML_Char *doctypeName, - const XML_Char *sysid, const XML_Char *pubid, - int has_internal_subset) { - UNUSED_P(userData); - UNUSED_P(doctypeName); - UNUSED_P(sysid); - UNUSED_P(pubid); - UNUSED_P(has_internal_subset); - dummy_handler_flags |= DUMMY_START_DOCTYPE_HANDLER_FLAG; -} - -void XMLCALL -dummy_end_doctype_handler(void *userData) { - UNUSED_P(userData); - dummy_handler_flags |= DUMMY_END_DOCTYPE_HANDLER_FLAG; -} - -void XMLCALL -dummy_entity_decl_handler(void *userData, const XML_Char *entityName, - int is_parameter_entity, const XML_Char *value, - int value_length, const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId, - const XML_Char *notationName) { - UNUSED_P(userData); - UNUSED_P(entityName); - UNUSED_P(is_parameter_entity); - UNUSED_P(value); - UNUSED_P(value_length); - UNUSED_P(base); - UNUSED_P(systemId); - UNUSED_P(publicId); - UNUSED_P(notationName); - dummy_handler_flags |= DUMMY_ENTITY_DECL_HANDLER_FLAG; -} - -void XMLCALL -dummy_notation_decl_handler(void *userData, const XML_Char *notationName, - const XML_Char *base, const XML_Char *systemId, - const XML_Char *publicId) { - UNUSED_P(userData); - UNUSED_P(notationName); - UNUSED_P(base); - UNUSED_P(systemId); - UNUSED_P(publicId); - dummy_handler_flags |= DUMMY_NOTATION_DECL_HANDLER_FLAG; -} - -void XMLCALL -dummy_element_decl_handler(void *userData, const XML_Char *name, - XML_Content *model) { - UNUSED_P(userData); - UNUSED_P(name); - /* The content model must be freed by the handler. Unfortunately - * we cannot pass the parser as the userData because this is used - * with other handlers that require other userData. - */ - XML_FreeContentModel(g_parser, model); - dummy_handler_flags |= DUMMY_ELEMENT_DECL_HANDLER_FLAG; -} - -void XMLCALL -dummy_attlist_decl_handler(void *userData, const XML_Char *elname, - const XML_Char *attname, const XML_Char *att_type, - const XML_Char *dflt, int isrequired) { - UNUSED_P(userData); - UNUSED_P(elname); - UNUSED_P(attname); - UNUSED_P(att_type); - UNUSED_P(dflt); - UNUSED_P(isrequired); - dummy_handler_flags |= DUMMY_ATTLIST_DECL_HANDLER_FLAG; -} - -void XMLCALL -dummy_comment_handler(void *userData, const XML_Char *data) { - UNUSED_P(userData); - UNUSED_P(data); - dummy_handler_flags |= DUMMY_COMMENT_HANDLER_FLAG; -} - -void XMLCALL -dummy_pi_handler(void *userData, const XML_Char *target, const XML_Char *data) { - UNUSED_P(userData); - UNUSED_P(target); - UNUSED_P(data); - dummy_handler_flags |= DUMMY_PI_HANDLER_FLAG; -} - -void XMLCALL -dummy_start_element(void *userData, const XML_Char *name, - const XML_Char **atts) { - UNUSED_P(userData); - UNUSED_P(name); - UNUSED_P(atts); - dummy_handler_flags |= DUMMY_START_ELEMENT_HANDLER_FLAG; -} - -void XMLCALL -dummy_end_element(void *userData, const XML_Char *name) { - UNUSED_P(userData); - UNUSED_P(name); -} - -void XMLCALL -dummy_start_cdata_handler(void *userData) { - UNUSED_P(userData); - dummy_handler_flags |= DUMMY_START_CDATA_HANDLER_FLAG; -} - -void XMLCALL -dummy_end_cdata_handler(void *userData) { - UNUSED_P(userData); - dummy_handler_flags |= DUMMY_END_CDATA_HANDLER_FLAG; -} - -void XMLCALL -dummy_cdata_handler(void *userData, const XML_Char *s, int len) { - UNUSED_P(userData); - UNUSED_P(s); - UNUSED_P(len); -} - -void XMLCALL -dummy_start_namespace_decl_handler(void *userData, const XML_Char *prefix, - const XML_Char *uri) { - UNUSED_P(userData); - UNUSED_P(prefix);
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/dummy.h
Deleted
@@ -1,150 +0,0 @@ -/* Dummy handler functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_DUMMY_H -# define XML_DUMMY_H - -# define DUMMY_START_DOCTYPE_HANDLER_FLAG (1UL << 0) -# define DUMMY_END_DOCTYPE_HANDLER_FLAG (1UL << 1) -# define DUMMY_ENTITY_DECL_HANDLER_FLAG (1UL << 2) -# define DUMMY_NOTATION_DECL_HANDLER_FLAG (1UL << 3) -# define DUMMY_ELEMENT_DECL_HANDLER_FLAG (1UL << 4) -# define DUMMY_ATTLIST_DECL_HANDLER_FLAG (1UL << 5) -# define DUMMY_COMMENT_HANDLER_FLAG (1UL << 6) -# define DUMMY_PI_HANDLER_FLAG (1UL << 7) -# define DUMMY_START_ELEMENT_HANDLER_FLAG (1UL << 8) -# define DUMMY_START_CDATA_HANDLER_FLAG (1UL << 9) -# define DUMMY_END_CDATA_HANDLER_FLAG (1UL << 10) -# define DUMMY_UNPARSED_ENTITY_DECL_HANDLER_FLAG (1UL << 11) -# define DUMMY_START_NS_DECL_HANDLER_FLAG (1UL << 12) -# define DUMMY_END_NS_DECL_HANDLER_FLAG (1UL << 13) -# define DUMMY_START_DOCTYPE_DECL_HANDLER_FLAG (1UL << 14) -# define DUMMY_END_DOCTYPE_DECL_HANDLER_FLAG (1UL << 15) -# define DUMMY_SKIP_HANDLER_FLAG (1UL << 16) -# define DUMMY_DEFAULT_HANDLER_FLAG (1UL << 17) - -extern void init_dummy_handlers(void); -extern unsigned long get_dummy_handler_flags(void); - -extern void XMLCALL dummy_xdecl_handler(void *userData, const XML_Char *version, - const XML_Char *encoding, - int standalone); - -extern void XMLCALL dummy_start_doctype_handler(void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset); - -extern void XMLCALL dummy_end_doctype_handler(void *userData); - -extern void XMLCALL dummy_entity_decl_handler( - void *userData, const XML_Char *entityName, int is_parameter_entity, - const XML_Char *value, int value_length, const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId, - const XML_Char *notationName); - -extern void XMLCALL dummy_notation_decl_handler(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -extern void XMLCALL dummy_element_decl_handler(void *userData, - const XML_Char *name, - XML_Content *model); - -extern void XMLCALL dummy_attlist_decl_handler( - void *userData, const XML_Char *elname, const XML_Char *attname, - const XML_Char *att_type, const XML_Char *dflt, int isrequired); - -extern void XMLCALL dummy_comment_handler(void *userData, const XML_Char *data); - -extern void XMLCALL dummy_pi_handler(void *userData, const XML_Char *target, - const XML_Char *data); - -extern void XMLCALL dummy_start_element(void *userData, const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL dummy_end_element(void *userData, const XML_Char *name); - -extern void XMLCALL dummy_start_cdata_handler(void *userData); - -extern void XMLCALL dummy_end_cdata_handler(void *userData); - -extern void XMLCALL dummy_cdata_handler(void *userData, const XML_Char *s, - int len); - -extern void XMLCALL dummy_start_namespace_decl_handler(void *userData, - const XML_Char *prefix, - const XML_Char *uri); - -extern void XMLCALL dummy_end_namespace_decl_handler(void *userData, - const XML_Char *prefix); - -extern void XMLCALL dummy_unparsed_entity_decl_handler( - void *userData, const XML_Char *entityName, const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId, - const XML_Char *notationName); - -extern void XMLCALL dummy_default_handler(void *userData, const XML_Char *s, - int len); - -extern void XMLCALL dummy_start_doctype_decl_handler( - void *userData, const XML_Char *doctypeName, const XML_Char *sysid, - const XML_Char *pubid, int has_internal_subset); - -extern void XMLCALL dummy_end_doctype_decl_handler(void *userData); - -extern void XMLCALL dummy_skip_handler(void *userData, - const XML_Char *entityName, - int is_parameter_entity); - -#endif /* XML_DUMMY_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/dummy_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "dummy.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/handlers.c
Deleted
@@ -1,1932 +0,0 @@ -/* XML handler functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.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(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <stdio.h> -#include <string.h> -#include <assert.h> - -#include "expat_config.h" - -#include "expat.h" -#include "internal.h" -#include "chardata.h" -#include "structdata.h" -#include "common.h" -#include "handlers.h" - -/* Global variables for user parameter settings tests */ -/* Variable holding the expected handler userData */ -const void *g_handler_data = NULL; -/* Count of the number of times the comment handler has been invoked */ -int g_comment_count = 0; -/* Count of the number of skipped entities */ -int g_skip_count = 0; -/* Count of the number of times the XML declaration handler is invoked */ -int g_xdecl_count = 0; - -/* Start/End Element Handlers */ - -void XMLCALL -start_element_event_handler(void *userData, const XML_Char *name, - const XML_Char **atts) { - UNUSED_P(atts); - CharData_AppendXMLChars((CharData *)userData, name, -1); -} - -void XMLCALL -end_element_event_handler(void *userData, const XML_Char *name) { - CharData *storage = (CharData *)userData; - CharData_AppendXMLChars(storage, XCS("/"), 1); - CharData_AppendXMLChars(storage, name, -1); -} - -void XMLCALL -start_element_event_handler2(void *userData, const XML_Char *name, - const XML_Char **attr) { - StructData *storage = (StructData *)userData; - UNUSED_P(attr); - StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser), - XML_GetCurrentLineNumber(g_parser), STRUCT_START_TAG); -} - -void XMLCALL -end_element_event_handler2(void *userData, const XML_Char *name) { - StructData *storage = (StructData *)userData; - StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser), - XML_GetCurrentLineNumber(g_parser), STRUCT_END_TAG); -} - -void XMLCALL -counting_start_element_handler(void *userData, const XML_Char *name, - const XML_Char **atts) { - ElementInfo *info = (ElementInfo *)userData; - AttrInfo *attr; - int count, id, i; - - while (info->name != NULL) { - if (! xcstrcmp(name, info->name)) - break; - info++; - } - if (info->name == NULL) - fail("Element not recognised"); - /* The attribute count is twice what you might expect. It is a - * count of items in atts, an array which contains alternating - * attribute names and attribute values. For the naive user this - * is possibly a little unexpected, but it is what the - * documentation in expat.h tells us to expect. - */ - count = XML_GetSpecifiedAttributeCount(g_parser); - if (info->attr_count * 2 != count) { - fail("Not got expected attribute count"); - return; - } - id = XML_GetIdAttributeIndex(g_parser); - if (id == -1 && info->id_name != NULL) { - fail("ID not present"); - return; - } - if (id != -1 && xcstrcmp(attsid, info->id_name)) { - fail("ID does not have the correct name"); - return; - } - for (i = 0; i < info->attr_count; i++) { - attr = info->attributes; - while (attr->name != NULL) { - if (! xcstrcmp(atts0, attr->name)) - break; - attr++; - } - if (attr->name == NULL) { - fail("Attribute not recognised"); - return; - } - if (xcstrcmp(atts1, attr->value)) { - fail("Attribute has wrong value"); - return; - } - /* Remember, two entries in atts per attribute (see above) */ - atts += 2; - } -} - -void XMLCALL -suspending_end_handler(void *userData, const XML_Char *s) { - UNUSED_P(s); - XML_StopParser((XML_Parser)userData, 1); -} - -void XMLCALL -start_element_suspender(void *userData, const XML_Char *name, - const XML_Char **atts) { - UNUSED_P(userData); - UNUSED_P(atts); - if (! xcstrcmp(name, XCS("suspend"))) - XML_StopParser(g_parser, XML_TRUE); - if (! xcstrcmp(name, XCS("abort"))) - XML_StopParser(g_parser, XML_FALSE); -} - -/* Check that an element name and attribute name match the expected values. - The expected values are passed as an array reference of string pointers - provided as the userData argument; the first is the expected - element name, and the second is the expected attribute name. -*/ -int g_triplet_start_flag = XML_FALSE; -int g_triplet_end_flag = XML_FALSE; - -void XMLCALL -triplet_start_checker(void *userData, const XML_Char *name, - const XML_Char **atts) { - XML_Char **elemstr = (XML_Char **)userData; - char buffer1024; - if (xcstrcmp(elemstr0, name) != 0) { - snprintf(buffer, sizeof(buffer), - "unexpected start string: '%" XML_FMT_STR "'", name); - fail(buffer); - } - if (xcstrcmp(elemstr1, atts0) != 0) { - snprintf(buffer, sizeof(buffer), - "unexpected attribute string: '%" XML_FMT_STR "'", atts0); - fail(buffer); - } - g_triplet_start_flag = XML_TRUE; -} -
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/handlers.h
Deleted
@@ -1,595 +0,0 @@ -/* XML handler functions for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef XML_HANDLERS_H -# define XML_HANDLERS_H - -# include "expat_config.h" - -# include "expat.h" - -/* Variable holding the expected handler userData */ -extern const void *g_handler_data; -/* Count of the number of times the comment handler has been invoked */ -extern int g_comment_count; -/* Count of the number of skipped entities */ -extern int g_skip_count; -/* Count of the number of times the XML declaration handler is invoked */ -extern int g_xdecl_count; - -/* Start/End Element Handlers */ - -extern void XMLCALL start_element_event_handler(void *userData, - const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL end_element_event_handler(void *userData, - const XML_Char *name); - -# define STRUCT_START_TAG 0 -# define STRUCT_END_TAG 1 - -extern void XMLCALL start_element_event_handler2(void *userData, - const XML_Char *name, - const XML_Char **attr); - -extern void XMLCALL end_element_event_handler2(void *userData, - const XML_Char *name); - -typedef struct attrInfo { - const XML_Char *name; - const XML_Char *value; -} AttrInfo; - -typedef struct elementInfo { - const XML_Char *name; - int attr_count; - const XML_Char *id_name; - AttrInfo *attributes; -} ElementInfo; - -extern void XMLCALL counting_start_element_handler(void *userData, - const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL suspending_end_handler(void *userData, const XML_Char *s); - -extern void XMLCALL start_element_suspender(void *userData, - const XML_Char *name, - const XML_Char **atts); - -extern int g_triplet_start_flag; -extern int g_triplet_end_flag; - -extern void XMLCALL triplet_start_checker(void *userData, const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL triplet_end_checker(void *userData, const XML_Char *name); - -extern void XMLCALL overwrite_start_checker(void *userData, - const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL overwrite_end_checker(void *userData, const XML_Char *name); - -extern void XMLCALL start_element_fail(void *userData, const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL start_ns_clearing_start_element(void *userData, - const XML_Char *prefix, - const XML_Char *uri); - -typedef struct { - XML_Parser parser; - int deep; -} DataIssue240; - -extern void XMLCALL start_element_issue_240(void *userData, - const XML_Char *name, - const XML_Char **atts); - -extern void XMLCALL end_element_issue_240(void *userData, const XML_Char *name); - -/* Text encoding handlers */ - -extern int XMLCALL UnknownEncodingHandler(void *data, const XML_Char *encoding, - XML_Encoding *info); - -extern int XMLCALL UnrecognisedEncodingHandler(void *data, - const XML_Char *encoding, - XML_Encoding *info); - -extern int XMLCALL unknown_released_encoding_handler(void *data, - const XML_Char *encoding, - XML_Encoding *info); - -extern int XMLCALL MiscEncodingHandler(void *data, const XML_Char *encoding, - XML_Encoding *info); - -extern int XMLCALL long_encoding_handler(void *userData, - const XML_Char *encoding, - XML_Encoding *info); - -/* External Entity Handlers */ - -typedef struct ExtOption { - const XML_Char *system_id; - const char *parse_text; -} ExtOption; - -extern int XMLCALL external_entity_optioner(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -extern int XMLCALL external_entity_loader(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -typedef struct ext_faults { - const char *parse_text; - const char *fail_text; - const XML_Char *encoding; - enum XML_Error error; -} ExtFaults; - -extern int XMLCALL external_entity_faulter(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); -extern int XMLCALL external_entity_failer__if_not_xml_ge( - XML_Parser parser, const XML_Char *context, const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId); -extern int XMLCALL external_entity_null_loader(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -extern int XMLCALL external_entity_resetter(XML_Parser parser, - const XML_Char *context, - const XML_Char *base,
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/handlers_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "handlers.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/memcheck_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "memcheck.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/minicheck_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "minicheck.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/misc_tests.c
Deleted
@@ -1,523 +0,0 @@ -/* Tests in the "miscellaneous" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <assert.h> -#include <string.h> - -#include "expat_config.h" - -#include "expat.h" -#include "internal.h" -#include "minicheck.h" -#include "memcheck.h" -#include "common.h" -#include "ascii.h" /* for ASCII_xxx */ -#include "handlers.h" -#include "misc_tests.h" - -/* Test that a failure to allocate the parser structure fails gracefully */ -START_TEST(test_misc_alloc_create_parser) { - XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free}; - unsigned int i; - const unsigned int max_alloc_count = 10; - - /* Something this simple shouldn't need more than 10 allocations */ - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - g_parser = XML_ParserCreate_MM(NULL, &memsuite, NULL); - if (g_parser != NULL) - break; - } - if (i == 0) - fail("Parser unexpectedly ignored failing allocator"); - else if (i == max_alloc_count) - fail("Parser not created with max allocation count"); -} -END_TEST - -/* Test memory allocation failures for a parser with an encoding */ -START_TEST(test_misc_alloc_create_parser_with_encoding) { - XML_Memory_Handling_Suite memsuite = {duff_allocator, realloc, free}; - unsigned int i; - const unsigned int max_alloc_count = 10; - - /* Try several levels of allocation */ - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - g_parser = XML_ParserCreate_MM(XCS("us-ascii"), &memsuite, NULL); - if (g_parser != NULL) - break; - } - if (i == 0) - fail("Parser ignored failing allocator"); - else if (i == max_alloc_count) - fail("Parser not created with max allocation count"); -} -END_TEST - -/* Test that freeing a NULL parser doesn't cause an explosion. - * (Not actually tested anywhere else) - */ -START_TEST(test_misc_null_parser) { - XML_ParserFree(NULL); -} -END_TEST - -#if defined(__has_feature) -# if __has_feature(undefined_behavior_sanitizer) -# define EXPAT_TESTS_UBSAN 1 -# else -# define EXPAT_TESTS_UBSAN 0 -# endif -#else -# define EXPAT_TESTS_UBSAN 0 -#endif - -/* Test that XML_ErrorString rejects out-of-range codes */ -START_TEST(test_misc_error_string) { -#if ! EXPAT_TESTS_UBSAN // because this would trigger UBSan - union { - enum XML_Error xml_error; - int integer; - } trickery; - - assert_true(sizeof(enum XML_Error) == sizeof(int)); // self-test - - trickery.integer = -1; - if (XML_ErrorString(trickery.xml_error) != NULL) - fail("Negative error code not rejected"); - - trickery.integer = 100; - if (XML_ErrorString(trickery.xml_error) != NULL) - fail("Large error code not rejected"); -#endif -} -END_TEST - -/* Test the version information is consistent */ - -/* Since we are working in XML_LChars (potentially 16-bits), we - * can't use the standard C library functions for character - * manipulation and have to roll our own. - */ -static int -parse_version(const XML_LChar *version_text, - XML_Expat_Version *version_struct) { - if (! version_text) - return XML_FALSE; - - while (*version_text != 0x00) { - if (*version_text >= ASCII_0 && *version_text <= ASCII_9) - break; - version_text++; - } - if (*version_text == 0x00) - return XML_FALSE; - - /* version_struct->major = strtoul(version_text, 10, &version_text) */ - version_struct->major = 0; - while (*version_text >= ASCII_0 && *version_text <= ASCII_9) { - version_struct->major - = 10 * version_struct->major + (*version_text++ - ASCII_0); - } - if (*version_text++ != ASCII_PERIOD) - return XML_FALSE; - - /* Now for the minor version number */ - version_struct->minor = 0; - while (*version_text >= ASCII_0 && *version_text <= ASCII_9) { - version_struct->minor - = 10 * version_struct->minor + (*version_text++ - ASCII_0); - } - if (*version_text++ != ASCII_PERIOD) - return XML_FALSE; - - /* Finally the micro version number */ - version_struct->micro = 0; - while (*version_text >= ASCII_0 && *version_text <= ASCII_9) { - version_struct->micro - = 10 * version_struct->micro + (*version_text++ - ASCII_0); - } - if (*version_text != 0x00) - return XML_FALSE; - return XML_TRUE; -} - -static int -versions_equal(const XML_Expat_Version *first, - const XML_Expat_Version *second) { - return (first->major == second->major && first->minor == second->minor - && first->micro == second->micro); -} - -START_TEST(test_misc_version) { - XML_Expat_Version read_version = XML_ExpatVersionInfo(); - /* Silence compiler warning with the following assignment */
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/misc_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "miscellaneous" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_MISC_TESTS_H -# define XML_MISC_TESTS_H - -extern void make_miscellaneous_test_case(Suite *s); - -#endif /* XML_MISC_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/misc_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "misc_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/ns_tests.c
Deleted
@@ -1,754 +0,0 @@ -/* Tests in the "namespace" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.org> - Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.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 "expat_config.h" - -#include <string.h> - -#include "expat.h" -#include "internal.h" -#include "minicheck.h" -#include "common.h" -#include "dummy.h" -#include "handlers.h" -#include "ns_tests.h" - -static void -namespace_setup(void) { - g_parser = XML_ParserCreateNS(NULL, XCS(' ')); - if (g_parser == NULL) - fail("Parser not created."); -} - -static void -namespace_teardown(void) { - basic_teardown(); -} - -START_TEST(test_return_ns_triplet) { - const char *text = "<foo:e xmlns:foo='http://example.org/' bar:a='12'\n" - " xmlns:bar='http://example.org/'>"; - const char *epilog = "</foo:e>"; - const XML_Char *elemstr - = {XCS("http://example.org/ e foo"), XCS("http://example.org/ a bar")}; - XML_SetReturnNSTriplet(g_parser, XML_TRUE); - XML_SetUserData(g_parser, (void *)elemstr); - XML_SetElementHandler(g_parser, triplet_start_checker, triplet_end_checker); - XML_SetNamespaceDeclHandler(g_parser, dummy_start_namespace_decl_handler, - dummy_end_namespace_decl_handler); - g_triplet_start_flag = XML_FALSE; - g_triplet_end_flag = XML_FALSE; - init_dummy_handlers(); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_FALSE) - == XML_STATUS_ERROR) - xml_failure(g_parser); - /* Check that unsetting "return triplets" fails while still parsing */ - XML_SetReturnNSTriplet(g_parser, XML_FALSE); - if (_XML_Parse_SINGLE_BYTES(g_parser, epilog, (int)strlen(epilog), XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); - if (! g_triplet_start_flag) - fail("triplet_start_checker not invoked"); - if (! g_triplet_end_flag) - fail("triplet_end_checker not invoked"); - if (get_dummy_handler_flags() - != (DUMMY_START_NS_DECL_HANDLER_FLAG | DUMMY_END_NS_DECL_HANDLER_FLAG)) - fail("Namespace handlers not called"); -} -END_TEST - -/* Test that the parsing status is correctly reset by XML_ParserReset(). - * We use test_return_ns_triplet() for our example parse to improve - * coverage of tidying up code executed. - */ -START_TEST(test_ns_parser_reset) { - XML_ParsingStatus status; - - XML_GetParsingStatus(g_parser, &status); - if (status.parsing != XML_INITIALIZED) - fail("parsing status doesn't start INITIALIZED"); - test_return_ns_triplet(); - XML_GetParsingStatus(g_parser, &status); - if (status.parsing != XML_FINISHED) - fail("parsing status doesn't end FINISHED"); - XML_ParserReset(g_parser, NULL); - XML_GetParsingStatus(g_parser, &status); - if (status.parsing != XML_INITIALIZED) - fail("parsing status doesn't reset to INITIALIZED"); -} -END_TEST - -static void -run_ns_tagname_overwrite_test(const char *text, const XML_Char *result) { - CharData storage; - CharData_Init(&storage); - XML_SetUserData(g_parser, &storage); - XML_SetElementHandler(g_parser, overwrite_start_checker, - overwrite_end_checker); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); - CharData_CheckXMLChars(&storage, result); -} - -/* Regression test for SF bug #566334. */ -START_TEST(test_ns_tagname_overwrite) { - const char *text = "<n:e xmlns:n='http://example.org/'>\n" - " <n:f n:attr='foo'/>\n" - " <n:g n:attr2='bar'/>\n" - "</n:e>"; - const XML_Char *result = XCS("start http://example.org/ e\n") - XCS("start http://example.org/ f\n") - XCS("attribute http://example.org/ attr\n") - XCS("end http://example.org/ f\n") - XCS("start http://example.org/ g\n") - XCS("attribute http://example.org/ attr2\n") - XCS("end http://example.org/ g\n") - XCS("end http://example.org/ e\n"); - run_ns_tagname_overwrite_test(text, result); -} -END_TEST - -/* Regression test for SF bug #566334. */ -START_TEST(test_ns_tagname_overwrite_triplet) { - const char *text = "<n:e xmlns:n='http://example.org/'>\n" - " <n:f n:attr='foo'/>\n" - " <n:g n:attr2='bar'/>\n" - "</n:e>"; - const XML_Char *result = XCS("start http://example.org/ e n\n") - XCS("start http://example.org/ f n\n") - XCS("attribute http://example.org/ attr n\n") - XCS("end http://example.org/ f n\n") - XCS("start http://example.org/ g n\n") - XCS("attribute http://example.org/ attr2 n\n") - XCS("end http://example.org/ g n\n") - XCS("end http://example.org/ e n\n"); - XML_SetReturnNSTriplet(g_parser, XML_TRUE); - run_ns_tagname_overwrite_test(text, result); -} -END_TEST - -/* Regression test for SF bug #620343. */ -START_TEST(test_start_ns_clears_start_element) { - /* This needs to use separate start/end tags; using the empty tag - syntax doesn't cause the problematic path through Expat to be - taken. - */ - const char *text = "<e xmlns='http://example.org/'></e>"; - - XML_SetStartElementHandler(g_parser, start_element_fail); - XML_SetStartNamespaceDeclHandler(g_parser, start_ns_clearing_start_element); - XML_SetEndNamespaceDeclHandler(g_parser, dummy_end_namespace_decl_handler); - XML_UseParserAsHandlerArg(g_parser); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - == XML_STATUS_ERROR) - xml_failure(g_parser); -} -END_TEST - -/* Regression test for SF bug #616863. */ -START_TEST(test_default_ns_from_ext_subset_and_ext_ge) { - const char *text = "<?xml version='1.0'?>\n" - "<!DOCTYPE doc SYSTEM 'http://example.org/doc.dtd' \n" - " <!ENTITY en SYSTEM 'http://example.org/entity.ent'>\n" - ">\n" - "<doc xmlns='http://example.org/ns1'>\n" - "&en;\n" - "</doc>"; - - XML_SetParamEntityParsing(g_parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/ns_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "namespace" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_NS_TESTS_H -# define XML_NS_TESTS_H - -extern void make_namespace_test_case(Suite *s); - -#endif /* XML_NS_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/ns_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "ns_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/nsalloc_tests.c
Deleted
@@ -1,1537 +0,0 @@ -/* Tests in the "namespace allocation" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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. -*/ - -#if defined(NDEBUG) -# undef NDEBUG /* because test suite relies on assert(...) at the moment */ -#endif - -#include <string.h> -#include <assert.h> - -#include "expat.h" -#include "common.h" -#include "minicheck.h" -#include "dummy.h" -#include "handlers.h" -#include "nsalloc_tests.h" - -static void -nsalloc_setup(void) { - XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free}; - XML_Char ns_sep2 = {' ', '\0'}; - - /* Ensure the parser creation will go through */ - g_allocation_count = ALLOC_ALWAYS_SUCCEED; - g_reallocation_count = REALLOC_ALWAYS_SUCCEED; - g_parser = XML_ParserCreate_MM(NULL, &memsuite, ns_sep); - if (g_parser == NULL) - fail("Parser not created"); -} - -static void -nsalloc_teardown(void) { - basic_teardown(); -} - -/* Test the effects of allocation failure in simple namespace parsing. - * Based on test_ns_default_with_empty_uri() - */ -START_TEST(test_nsalloc_xmlns) { - const char *text = "<doc xmlns='http://example.org/'>\n" - " <e xmlns=''/>\n" - "</doc>"; - unsigned int i; - const unsigned int max_alloc_count = 30; - - for (i = 0; i < max_alloc_count; i++) { - g_allocation_count = i; - /* Exercise more code paths with a default handler */ - XML_SetDefaultHandler(g_parser, dummy_default_handler); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - break; - /* Resetting the parser is insufficient, because some memory - * allocations are cached within the parser. Instead we use - * the teardown and setup routines to ensure that we have the - * right sort of parser back in our hands. - */ - nsalloc_teardown(); - nsalloc_setup(); - } - if (i == 0) - fail("Parsing worked despite failing allocations"); - else if (i == max_alloc_count) - fail("Parsing failed even at maximum allocation count"); -} -END_TEST - -/* Test XML_ParseBuffer interface with namespace and a dicky allocator */ -START_TEST(test_nsalloc_parse_buffer) { - const char *text = "<doc>Hello</doc>"; - void *buffer; - - /* Try a parse before the start of the world */ - /* (Exercises new code path) */ - if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_ERROR) - fail("Pre-init XML_ParseBuffer not faulted"); - if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_BUFFER) - fail("Pre-init XML_ParseBuffer faulted for wrong reason"); - - buffer = XML_GetBuffer(g_parser, 1 /* any small number greater than 0 */); - if (buffer == NULL) - fail("Could not acquire parse buffer"); - - g_allocation_count = 0; - if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_ERROR) - fail("Pre-init XML_ParseBuffer not faulted"); - if (XML_GetErrorCode(g_parser) != XML_ERROR_NO_MEMORY) - fail("Pre-init XML_ParseBuffer faulted for wrong reason"); - - /* Now with actual memory allocation */ - g_allocation_count = ALLOC_ALWAYS_SUCCEED; - if (XML_ParseBuffer(g_parser, 0, XML_FALSE) != XML_STATUS_OK) - xml_failure(g_parser); - - /* Check that resuming an unsuspended parser is faulted */ - if (XML_ResumeParser(g_parser) != XML_STATUS_ERROR) - fail("Resuming unsuspended parser not faulted"); - if (XML_GetErrorCode(g_parser) != XML_ERROR_NOT_SUSPENDED) - xml_failure(g_parser); - - /* Get the parser into suspended state */ - XML_SetCharacterDataHandler(g_parser, clearing_aborting_character_handler); - g_resumable = XML_TRUE; - buffer = XML_GetBuffer(g_parser, (int)strlen(text)); - if (buffer == NULL) - fail("Could not acquire parse buffer"); - assert(buffer != NULL); - memcpy(buffer, text, strlen(text)); - if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE) - != XML_STATUS_SUSPENDED) - xml_failure(g_parser); - if (XML_GetErrorCode(g_parser) != XML_ERROR_NONE) - xml_failure(g_parser); - if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - fail("Suspended XML_ParseBuffer not faulted"); - if (XML_GetErrorCode(g_parser) != XML_ERROR_SUSPENDED) - xml_failure(g_parser); - if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL) - fail("Suspended XML_GetBuffer not faulted"); - - /* Get it going again and complete the world */ - XML_SetCharacterDataHandler(g_parser, NULL); - if (XML_ResumeParser(g_parser) != XML_STATUS_OK) - xml_failure(g_parser); - if (XML_ParseBuffer(g_parser, (int)strlen(text), XML_TRUE) - != XML_STATUS_ERROR) - fail("Post-finishing XML_ParseBuffer not faulted"); - if (XML_GetErrorCode(g_parser) != XML_ERROR_FINISHED) - xml_failure(g_parser); - if (XML_GetBuffer(g_parser, (int)strlen(text)) != NULL) - fail("Post-finishing XML_GetBuffer not faulted"); -} -END_TEST - -/* Check handling of long prefix names (pool growth) */ -START_TEST(test_nsalloc_long_prefix) { - const char *text - = "<" - /* 64 characters per line */ - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - ":foo xmlns:" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/nsalloc_tests.h
Deleted
@@ -1,56 +0,0 @@ -/* Tests in the "namespace allocation" test case for the Expat test suite - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2001-2006 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net> - Copyright (c) 2005-2007 Steven Solie <steven@solie.ca> - Copyright (c) 2005-2012 Karl Waclawek <karl@waclawek.net> - Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> - Copyright (c) 2017-2022 Rhodri James <rhodri@wildebeest.org.uk> - Copyright (c) 2017 Joe Orton <jorton@redhat.com> - Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com> - Copyright (c) 2018 Marco Maggi <marco.maggi-ipsu@poste.it> - Copyright (c) 2019 David Loffredo <loffredo@steptools.com> - Copyright (c) 2020 Tim Gates <tim.gates@iress.com> - Copyright (c) 2021 Donghee Na <donghee.na@python.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 __cplusplus -extern "C" { -#endif - -#ifndef XML_NSALLOC_TESTS_H -# define XML_NSALLOC_TESTS_H - -extern void make_nsalloc_test_case(Suite *s); - -#endif /* XML_NSALLOC_TESTS_H */ - -#ifdef __cplusplus -} -#endif
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/nsalloc_tests_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "nsalloc_tests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/runtests_cxx.cpp
Deleted
@@ -1,36 +0,0 @@ -/* C++ compilation harness for the test suite. - - This is used to ensure the Expat headers can be included from C++ - and have everything work as expected. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> - Copyright (c) 2017-2023 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. -*/ - -#include "runtests.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/tests/structdata_cxx.cpp
Deleted
@@ -1,32 +0,0 @@ -/* C++ compilation harness for the test suite. - __ __ _ - ___\ \/ /_ __ __ _| |_ - / _ \\ /| '_ \ / _` | __| - | __// \| |_) | (_| | |_ - \___/_/\_\ .__/ \__,_|\__| - |_| XML parser - - Copyright (c) 2023 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. -*/ - -#include "structdata.c"
View file
_service:tar_scm:expat-2.6.0.tar.gz/win32/version.rc.cmake
Deleted
@@ -1,17 +0,0 @@ -1 VERSIONINFO -FILEVERSION VER_FILEVERSION -PRODUCTVERSION VER_FILEVERSION -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "FileVersion", "${PROJECT_VERSION}.0" - VALUE "ProductVersion", "${PROJECT_VERSION}.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 1252 - END -END
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2