浏览代码

Expat 2.2.8

Source commit: 58ff222c7edf0aad342966c3b6f96e73fadbca61
Martin Prikryl 6 年之前
父节点
当前提交
d256da575d
共有 90 个文件被更改,包括 5051 次插入7219 次删除
  1. 42 42
      libs/expat/CMake.README
  2. 583 241
      libs/expat/CMakeLists.txt
  3. 109 3
      libs/expat/Changes
  4. 66 69
      libs/expat/ConfigureChecks.cmake
  5. 30 36
      libs/expat/Makefile.am
  6. 30 36
      libs/expat/Makefile.in
  7. 62 1
      libs/expat/README.md
  8. 75 0
      libs/expat/cmake/expat-config.cmake.in
  9. 36 0
      libs/expat/cmake/mingw-toolchain.cmake
  10. 202 130
      libs/expat/configure
  11. 99 51
      libs/expat/configure.ac
  12. 6 4
      libs/expat/doc/reference.html
  13. 10 17
      libs/expat/examples/elements.c
  14. 0 140
      libs/expat/examples/elements.vcxproj
  15. 0 22
      libs/expat/examples/elements.vcxproj.filters
  16. 7 14
      libs/expat/examples/outline.c
  17. 0 151
      libs/expat/examples/outline.vcxproj
  18. 0 22
      libs/expat/examples/outline.vcxproj.filters
  19. 0 73
      libs/expat/expat.sln
  20. 8 4
      libs/expat/expat_config.h
  21. 115 111
      libs/expat/expat_config.h.cmake
  22. 4 0
      libs/expat/expat_config.h.in
  23. 48 0
      libs/expat/fix-xmltest-log.sh
  24. 0 1
      libs/expat/lib/Makefile.am
  25. 4 10
      libs/expat/lib/Makefile.in
  26. 31 31
      libs/expat/lib/asciitab.h
  27. 107 168
      libs/expat/lib/expat.h
  28. 0 179
      libs/expat/lib/expat.vcxproj
  29. 0 83
      libs/expat/lib/expat.vcxproj.filters
  30. 40 48
      libs/expat/lib/expat_external.h
  31. 0 149
      libs/expat/lib/expat_static.vcxproj
  32. 0 74
      libs/expat/lib/expat_static.vcxproj.filters
  33. 0 179
      libs/expat/lib/expatw.vcxproj
  34. 0 83
      libs/expat/lib/expatw.vcxproj.filters
  35. 0 149
      libs/expat/lib/expatw_static.vcxproj
  36. 0 74
      libs/expat/lib/expatw_static.vcxproj.filters
  37. 31 31
      libs/expat/lib/iasciitab.h
  38. 21 27
      libs/expat/lib/internal.h
  39. 31 31
      libs/expat/lib/latin1tab.h
  40. 0 143
      libs/expat/lib/loadlibrary.c
  41. 98 144
      libs/expat/lib/nametab.h
  42. 225 218
      libs/expat/lib/siphash.h
  43. 31 31
      libs/expat/lib/utf8tab.h
  44. 7 10
      libs/expat/lib/winconfig.h
  45. 285 329
      libs/expat/lib/xmlparse.c
  46. 256 382
      libs/expat/lib/xmlrole.c
  47. 5 8
      libs/expat/lib/xmlrole.h
  48. 335 382
      libs/expat/lib/xmltok.c
  49. 91 121
      libs/expat/lib/xmltok.h
  50. 326 319
      libs/expat/lib/xmltok_impl.c
  51. 36 36
      libs/expat/lib/xmltok_impl.h
  52. 30 54
      libs/expat/lib/xmltok_ns.c
  53. 47 51
      libs/expat/tests/benchmark/benchmark.c
  54. 0 25
      libs/expat/tests/benchmark/benchmark.sln
  55. 0 143
      libs/expat/tests/benchmark/benchmark.vcxproj
  56. 43 50
      libs/expat/tests/chardata.c
  57. 7 10
      libs/expat/tests/chardata.h
  58. 115 123
      libs/expat/tests/memcheck.c
  59. 1 1
      libs/expat/tests/memcheck.h
  60. 134 147
      libs/expat/tests/minicheck.c
  61. 28 28
      libs/expat/tests/minicheck.h
  62. 444 459
      libs/expat/tests/runtests.c
  63. 0 24
      libs/expat/tests/runtests.sln
  64. 0 142
      libs/expat/tests/runtests.vcxproj
  65. 0 48
      libs/expat/tests/runtests.vcxproj.filters
  66. 86 93
      libs/expat/tests/structdata.c
  67. 13 19
      libs/expat/tests/structdata.h
  68. 6 11
      libs/expat/tests/xmltest.sh
  69. 14 29
      libs/expat/win32/README.txt
  70. 84 0
      libs/expat/win32/build_expat_iss.bat
  71. 6 13
      libs/expat/win32/expat.iss
  72. 1 3
      libs/expat/xmlwf/Makefile.am
  73. 1 3
      libs/expat/xmlwf/Makefile.in
  74. 25 23
      libs/expat/xmlwf/codepage.c
  75. 10 16
      libs/expat/xmlwf/ct.c
  76. 4 8
      libs/expat/xmlwf/filemap.h
  77. 29 30
      libs/expat/xmlwf/readfilemap.c
  78. 8 9
      libs/expat/xmlwf/unixfilemap.c
  79. 14 21
      libs/expat/xmlwf/win32filemap.c
  80. 56 73
      libs/expat/xmlwf/xmlfile.c
  81. 3 8
      libs/expat/xmlwf/xmlfile.h
  82. 14 20
      libs/expat/xmlwf/xmlmime.c
  83. 36 36
      libs/expat/xmlwf/xmltchar.h
  84. 0 45
      libs/expat/xmlwf/xmlurl.h
  85. 196 208
      libs/expat/xmlwf/xmlwf.c
  86. 0 164
      libs/expat/xmlwf/xmlwf.vcxproj
  87. 0 48
      libs/expat/xmlwf/xmlwf.vcxproj.filters
  88. 69 0
      libs/expat/xmlwf/xmlwf_helpgen.py
  89. 35 0
      libs/expat/xmlwf/xmlwf_helpgen.sh
  90. 0 427
      libs/expat/xmlwf/xmlwin32url.cxx

+ 42 - 42
libs/expat/CMake.README

@@ -1,42 +1,42 @@
-== How to build expat with cmake (experimental) ==
-
-The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual 
-Studio) and should work on all other platform cmake supports.
-
-Assuming ~/expat-2.2.7 is the source directory of expat, add a subdirectory
-build and change into that directory:
-~/expat-2.2.7$ mkdir build && cd build
-~/expat-2.2.7/build$
-
-From that directory, call cmake first, then call make, make test and 
-make install in the usual way:
-~/expat-2.2.7/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.2.7/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.2.7/build$ make && make test && make install
-Scanning dependencies of target expat
-[  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
-[ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
-....
--- Installing: /usr/local/lib/pkgconfig/expat.pc
--- Installing: /usr/local/bin/xmlwf
--- Installing: /usr/local/share/man/man1/xmlwf.1
-
-For Windows builds, you must make sure to call cmake from an environment where 
-your compiler is reachable, that means either you call it from the 
-Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and
-make sure that gcc can be called. On Windows, you also might want to specify a 
-special Generator for CMake:
-for Visual Studio builds do: 
-cmake .. -G "Visual Studio 10" && vcexpress expat.sln
-for mingw builds do: 
-cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install 
-    && gmake && gmake install
+== How to build expat with cmake (experimental) ==
+
+The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
+Studio) and should work on all other platform cmake supports.
+
+Assuming ~/expat-2.2.8 is the source directory of expat, add a subdirectory
+build and change into that directory:
+~/expat-2.2.8$ mkdir build && cd build
+~/expat-2.2.8/build$
+
+From that directory, call cmake first, then call make, make test and
+make install in the usual way:
+~/expat-2.2.8/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.2.8/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.2.8/build$ make && make test && make install
+Scanning dependencies of target expat
+[  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
+[ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
+....
+-- Installing: /usr/local/lib/pkgconfig/expat.pc
+-- Installing: /usr/local/bin/xmlwf
+-- Installing: /usr/local/share/man/man1/xmlwf.1
+
+For Windows builds, you must make sure to call cmake from an environment where
+your compiler is reachable, that means either you call it from the
+Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and
+make sure that gcc can be called. On Windows, you also might want to specify a
+special Generator for CMake:
+for Visual Studio builds do:
+cmake .. -G "Visual Studio 15 2017" && msbuild /m expat.sln
+for mingw builds do:
+cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install
+    && gmake && gmake install

+ 583 - 241
libs/expat/CMakeLists.txt

@@ -1,241 +1,583 @@
-# This file is copyrighted under the BSD-license for buildsystem files of KDE
-# copyright 2010, Patrick Spendrin <[email protected]>
-
-project(expat)
-
-cmake_minimum_required(VERSION 2.8.10)
-set(PACKAGE_BUGREPORT "[email protected]")
-set(PACKAGE_NAME "expat")
-set(PACKAGE_VERSION "2.2.7")
-set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-set(PACKAGE_TARNAME "${PACKAGE_NAME}")
-
-include(GNUInstallDirs)
-
-if(WINCE)
-    set(BUILD_tools_default OFF)
-else()
-    set(BUILD_tools_default ON)
-endif()
-if(MSVC OR NOT BUILD_tools_default)
-    set(BUILD_doc_default OFF)
-else()
-    find_program(DOCBOOK_TO_MAN NAMES docbook2x-man db2x_docbook2man docbook2man docbook-to-man)
-    if(DOCBOOK_TO_MAN)
-        set(BUILD_doc_default ON)
-    else()
-        set(BUILD_doc_default OFF)
-    endif()
-endif()
-
-option(BUILD_tools "build the xmlwf tool for expat library" ${BUILD_tools_default})
-option(BUILD_examples "build the examples for expat library" ON)
-option(BUILD_tests "build the tests for expat library" ON)
-option(BUILD_shared "build a shared expat library" ON)
-option(BUILD_doc "build man page for xmlwf" ${BUILD_doc_default})
-option(USE_libbsd "utilize libbsd (for arc4random_buf)" OFF)
-option(INSTALL "install expat files in cmake install target" ON)
-
-if(USE_libbsd)
-    find_library(LIB_BSD NAMES bsd)
-    if(NOT LIB_BSD)
-        message(FATAL_ERROR "USE_libbsd option is enabled, but libbsd was not found")
-    else()
-        set(HAVE_LIBBSD TRUE)
-    endif()
-endif()
-
-# configuration options
-set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
-option(XML_DTD "Define to make parameter entity parsing functionality available" ON)
-option(XML_NS "Define to make XML Namespaces functionality available" ON)
-option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
-if(NOT WIN32)
-    option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
-    if(XML_DEV_URANDOM)
-        set(XML_DEV_URANDOM 1)
-    else(XML_DEV_URANDOM)
-        set(XML_DEV_URANDOM 0)
-    endif(XML_DEV_URANDOM)
-endif()
-option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF)
-option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF)
-
-if(XML_DTD)
-    set(XML_DTD 1)
-else(XML_DTD)
-    set(XML_DTD 0)
-endif(XML_DTD)
-if(XML_NS)
-    set(XML_NS 1)
-else(XML_NS)
-    set(XML_NS 0)
-endif(XML_NS)
-if(XML_UNICODE)
-    set(XML_UNICODE 1)
-else(XML_UNICODE)
-    set(XML_UNICODE 0)
-endif(XML_UNICODE)
-if(XML_UNICODE_WCHAR_T)
-    set(XML_UNICODE_WCHAR_T 1)
-else(XML_UNICODE_WCHAR_T)
-    set(XML_UNICODE_WCHAR_T 0)
-endif(XML_UNICODE_WCHAR_T)
-
-if(XML_UNICODE_WCHAR_T AND NOT XML_UNICODE)
-    message(SEND_ERROR "Option XML_UNICODE_WCHAR_T=ON may not be used without XML_UNICODE=ON.")
-    set(XML_UNICODE 1)
-endif(XML_UNICODE_WCHAR_T AND NOT XML_UNICODE)
-
-if(BUILD_tools AND (XML_UNICODE AND NOT XML_UNICODE_WCHAR_T))
-    message(SEND_ERROR "The xmlwf tool can not be built with option XML_UNICODE_WCHAR_T=OFF and XML_UNICODE=ON. Either set XML_UNICODE_WCHAR_T=ON or BUILD_tools=OFF.")
-endif()
-
-if(BUILD_tests)
-    enable_testing()
-endif(BUILD_tests)
-
-include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake)
-
-set(EXTRA_COMPILE_FLAGS)
-if(FLAG_NO_STRICT_ALIASING)
-    set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")
-endif()
-if(FLAG_VISIBILITY)
-  add_definitions(-DXML_ENABLE_VISIBILITY=1)
-  set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
-endif(FLAG_VISIBILITY)
-if (WARNINGS_AS_ERRORS)
-    if(MSVC)
-        add_definitions(/WX)
-    else(MSVC)
-        set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
-    endif(MSVC)
-endif(WARNINGS_AS_ERRORS)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
-
-set(MSVC_USE_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
-if (MSVC)
-    if (MSVC_USE_STATIC_CRT)
-        message("-- Using static CRT ${MSVC_USE_STATIC_CRT}")
-        foreach(flag_var
-                CMAKE_CXX_FLAGS_DEBUG
-                CMAKE_CXX_FLAGS_RELEASE
-                CMAKE_CXX_FLAGS_MINSIZEREL
-                CMAKE_CXX_FLAGS_RELWITHDEBINFO
-                CMAKE_C_FLAGS_DEBUG
-                CMAKE_C_FLAGS_RELEASE
-                CMAKE_C_FLAGS_MINSIZEREL
-                CMAKE_C_FLAGS_RELWITHDEBINFO
-                )
-            string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
-        endforeach()
-    endif()
-endif()
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
-if(MSVC)
-    add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
-endif(MSVC)
-if(WIN32)
-    set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Add a suffix, usually d on Windows")
-endif(WIN32)
-
-set(expat_SRCS
-    lib/loadlibrary.c
-    lib/xmlparse.c
-    lib/xmlrole.c
-    lib/xmltok.c
-    lib/xmltok_impl.c
-    lib/xmltok_ns.c
-)
-
-if(BUILD_shared)
-    set(_SHARED SHARED)
-    if(WIN32)
-        set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
-    endif(WIN32)
-else(BUILD_shared)
-    set(_SHARED STATIC)
-    if(WIN32)
-        add_definitions(-DXML_STATIC)
-    endif(WIN32)
-endif(BUILD_shared)
-
-add_library(expat ${_SHARED} ${expat_SRCS})
-if(USE_libbsd)
-    target_link_libraries(expat ${LIB_BSD})
-endif()
-
-set(LIBCURRENT 7)   # sync
-set(LIBREVISION 9)  # with
-set(LIBAGE 6)       # configure.ac!
-math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
-
-if(NOT WIN32)
-    set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
-    set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
-    set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
-endif(NOT WIN32)
-
-macro(expat_install)
-    if(INSTALL)
-        install(${ARGN})
-    endif()
-endmacro()
-
-expat_install(TARGETS expat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-                      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-                      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
-set(prefix ${CMAKE_INSTALL_PREFIX})
-set(exec_prefix "\${prefix}")
-set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
-configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
-
-expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-
-if(BUILD_tools)
-    set(xmlwf_SRCS
-        xmlwf/xmlwf.c
-        xmlwf/xmlfile.c
-        xmlwf/codepage.c
-        xmlwf/readfilemap.c
-    )
-
-    add_executable(xmlwf ${xmlwf_SRCS})
-    set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
-    target_link_libraries(xmlwf expat)
-    expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
-    if(BUILD_doc)
-        file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
-        add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")
-        expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
-     endif()
-endif()
-
-if(BUILD_examples)
-    add_executable(elements examples/elements.c)
-    set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
-    target_link_libraries(elements expat)
-
-    add_executable(outline examples/outline.c)
-    set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
-    target_link_libraries(outline expat)
-endif(BUILD_examples)
-
-if(BUILD_tests)
-    ## these are unittests that can be run on any platform
-    add_executable(runtests tests/runtests.c tests/chardata.c tests/structdata.c tests/minicheck.c tests/memcheck.c)
-    set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
-    target_link_libraries(runtests expat)
-    add_test(runtests tests/runtests)
-
-    add_executable(runtestspp tests/runtestspp.cpp tests/chardata.c tests/structdata.c tests/minicheck.c tests/memcheck.c)
-    set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
-    target_link_libraries(runtestspp expat)
-    add_test(runtestspp tests/runtestspp)
-endif(BUILD_tests)
+# This file is copyrighted under the BSD-license for buildsystem files of KDE
+# copyright 2010, Patrick Spendrin <[email protected]>
+
+cmake_minimum_required(VERSION 3.1.3)
+
+project(expat
+    VERSION
+        2.2.8
+    LANGUAGES
+        C
+)
+
+set(PACKAGE_BUGREPORT "[email protected]")
+set(PACKAGE_NAME "expat")
+set(PACKAGE_VERSION "${PROJECT_VERSION}")
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(PACKAGE_TARNAME "${PACKAGE_NAME}")
+
+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
+
+#
+# Configuration defaults
+#
+if(WINCE)
+    set(_EXPAT_BUILD_TOOLS_DEFAULT OFF)
+else()
+    set(_EXPAT_BUILD_TOOLS_DEFAULT ON)
+endif()
+if(MSVC OR NOT _EXPAT_BUILD_TOOLS_DEFAULT)
+    set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
+else()
+    find_program(DOCBOOK_TO_MAN NAMES docbook2x-man db2x_docbook2man docbook2man docbook-to-man)
+    if(DOCBOOK_TO_MAN)
+        set(_EXPAT_BUILD_DOCS_DEFAULT ON)
+    else()
+        set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
+    endif()
+endif()
+
+#
+# Configuration
+#
+option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT})
+option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON)
+option(EXPAT_BUILD_TESTS "build the tests for expat library" ON)
+option(EXPAT_SHARED_LIBS "build a shared expat library" ON)
+option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT})
+option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF)
+option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF)
+option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON)
+set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
+mark_as_advanced(EXPAT_CONTEXT_BYTES)
+option(EXPAT_DTD "Define to make parameter entity parsing functionality available" ON)
+mark_as_advanced(EXPAT_DTD)
+option(EXPAT_NS "Define to make XML Namespaces functionality available" ON)
+mark_as_advanced(EXPAT_NS)
+option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
+if(NOT WIN32 OR _EXPAT_HELP)
+    option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
+    set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING
+            "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
+    set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING
+            "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
+    mark_as_advanced(EXPAT_DEV_URANDOM)
+endif()
+set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]")
+option(EXPAT_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF)
+mark_as_advanced(EXPAT_ATTR_INFO)
+option(EXPAT_LARGE_SIZE "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>" OFF)
+mark_as_advanced(EXPAT_LARGE_SIZE)
+option(EXPAT_MIN_SIZE "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)" OFF)
+mark_as_advanced(EXPAT_MIN_SIZE)
+if(MSVC OR _EXPAT_HELP)
+    set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
+endif()
+
+#
+# Environment checks
+#
+if(EXPAT_WITH_LIBBSD)
+    find_library(LIB_BSD NAMES bsd)
+    if(NOT LIB_BSD)
+        message(SEND_ERROR "EXPAT_WITH_LIBBSD option is enabled, but libbsd was not found")
+    else()
+        set(HAVE_LIBBSD TRUE)
+    endif()
+endif()
+
+macro(_expat_copy_bool_int source_ref dest_ref)
+    if(${source_ref})
+        set(${dest_ref} 1)
+    else()
+        set(${dest_ref} 0)
+    endif()
+endmacro()
+
+if(EXPAT_LARGE_SIZE)
+    add_definitions(-DXML_LARGE_SIZE)
+endif()
+
+if(EXPAT_MIN_SIZE)
+    add_definitions(-DXML_MIN_SIZE)
+endif()
+
+if(EXPAT_CHAR_TYPE STREQUAL "char")
+    set(_EXPAT_UNICODE OFF)
+    set(_EXPAT_UNICODE_WCHAR_T OFF)
+elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
+    set(_EXPAT_UNICODE ON)
+    set(_EXPAT_UNICODE_WCHAR_T OFF)
+    if(EXPAT_BUILD_TOOLS)
+        message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TOOLS=OFF.")
+    endif()
+elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
+    set(_EXPAT_UNICODE ON)
+    set(_EXPAT_UNICODE_WCHAR_T ON)
+else()
+    message(SEND_ERROR "Option -DEXPAT_CHAR_TYPE=(char|ushort|wchar_t) cannot be \"${EXPAT_CHAR_TYPE}\".")
+endif()
+
+if(_EXPAT_UNICODE)
+    add_definitions(-DXML_UNICODE)              # for unsigned short
+    if(_EXPAT_UNICODE_WCHAR_T)
+        add_definitions(-DXML_UNICODE_WCHAR_T)  # for wchar_t
+    endif()
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake)
+
+macro(evaluate_detection_results use_ref have_ref thing_lower thing_title)
+    if(${use_ref} AND NOT (${use_ref} STREQUAL "AUTO") AND NOT ${have_ref})
+        message(SEND_ERROR
+                "Use of ${thing_lower} was enforced by ${use_ref}=ON but it could not be found.")
+    elseif(NOT ${use_ref} AND ${have_ref})
+        message("${thing_title} was found but it will not be used due to ${use_ref}=OFF.")
+        set(${have_ref} 0)
+    endif()
+endmacro()
+
+if(NOT WIN32)
+    evaluate_detection_results(EXPAT_WITH_GETRANDOM HAVE_GETRANDOM "function getrandom" "Function getrandom")
+    evaluate_detection_results(EXPAT_WITH_SYS_GETRANDOM HAVE_SYSCALL_GETRANDOM "syscall SYS_getrandom" "Syscall SYS_getrandom")
+endif()
+
+_expat_copy_bool_int(EXPAT_ATTR_INFO        XML_ATTR_INFO)
+_expat_copy_bool_int(EXPAT_DTD              XML_DTD)
+_expat_copy_bool_int(EXPAT_LARGE_SIZE       XML_LARGE_SIZE)
+_expat_copy_bool_int(EXPAT_MIN_SIZE         XML_MIN_SIZE)
+_expat_copy_bool_int(EXPAT_NS               XML_NS)
+if(NOT WIN32)
+    _expat_copy_bool_int(EXPAT_DEV_URANDOM  XML_DEV_URANDOM)
+endif()
+set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES})
+
+macro(expat_install)
+    if(EXPAT_ENABLE_INSTALL)
+        install(${ARGN})
+    endif()
+endmacro()
+
+configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
+add_definitions(-DHAVE_EXPAT_CONFIG_H)
+expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+
+set(EXTRA_COMPILE_FLAGS)
+if(FLAG_NO_STRICT_ALIASING)
+    set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")
+endif()
+if(FLAG_VISIBILITY)
+  add_definitions(-DXML_ENABLE_VISIBILITY=1)
+  set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
+endif(FLAG_VISIBILITY)
+if (EXPAT_WARNINGS_AS_ERRORS)
+    if(MSVC)
+        add_definitions(/WX)
+    else(MSVC)
+        set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
+    endif(MSVC)
+endif(EXPAT_WARNINGS_AS_ERRORS)
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
+
+if (MSVC)
+    if (EXPAT_MSVC_STATIC_CRT)
+        message("-- Using static CRT ${EXPAT_MSVC_STATIC_CRT}")
+        foreach(flag_var
+                CMAKE_CXX_FLAGS_DEBUG
+                CMAKE_CXX_FLAGS_RELEASE
+                CMAKE_CXX_FLAGS_MINSIZEREL
+                CMAKE_CXX_FLAGS_RELWITHDEBINFO
+                CMAKE_C_FLAGS_DEBUG
+                CMAKE_C_FLAGS_RELEASE
+                CMAKE_C_FLAGS_MINSIZEREL
+                CMAKE_C_FLAGS_RELWITHDEBINFO
+                )
+            string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+        endforeach()
+    endif()
+endif()
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+if(MSVC)
+    add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
+endif(MSVC)
+if(WIN32)
+    if(_EXPAT_UNICODE_WCHAR_T)
+        set(_POSTFIX_WIDE "w")
+    endif()
+
+    if(MSVC AND NOT EXPAT_SHARED_LIBS)
+        if(EXPAT_MSVC_STATIC_CRT)
+            set(_POSTFIX_CRT "MT")
+        else()
+            set(_POSTFIX_CRT "MD")
+        endif()
+    endif()
+
+    foreach(postfix_var
+            CMAKE_DEBUG_POSTFIX
+            CMAKE_RELEASE_POSTFIX
+            CMAKE_MINSIZEREL_POSTFIX
+            CMAKE_RELWITHDEBINFO_POSTFIX
+            )
+        if(postfix_var STREQUAL "CMAKE_DEBUG_POSTFIX")
+            set(_POSTFIX_DEBUG "d")
+        else()
+            set(_POSTFIX_DEBUG "")
+        endif()
+
+        set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. expat<postfix=[w][d][MD|MT]>.lib")
+    endforeach()
+endif(WIN32)
+
+#
+# C library
+#
+set(expat_SRCS
+    lib/xmlparse.c
+    lib/xmlrole.c
+    lib/xmltok.c
+# NOTE: ISO C forbids an empty translation unit
+#   lib/xmltok_impl.c
+#   lib/xmltok_ns.c
+)
+
+if(EXPAT_SHARED_LIBS)
+    set(_SHARED SHARED)
+    if(MSVC)
+        set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
+    endif(MSVC)
+else(EXPAT_SHARED_LIBS)
+    set(_SHARED STATIC)
+    if(WIN32)
+        add_definitions(-DXML_STATIC)
+    endif(WIN32)
+endif(EXPAT_SHARED_LIBS)
+
+add_library(expat ${_SHARED} ${expat_SRCS})
+if(EXPAT_WITH_LIBBSD)
+    target_link_libraries(expat ${LIB_BSD})
+endif()
+
+set(LIBCURRENT 7)    # sync
+set(LIBREVISION 10)  # with
+set(LIBAGE 6)        # configure.ac!
+math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
+
+if(NOT WIN32)
+    set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
+    set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
+    set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
+endif(NOT WIN32)
+
+expat_install(TARGETS expat EXPORT expat
+                      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+                      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+                      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+#
+# pkg-config file
+#
+if(NOT MSVC)
+    set(prefix ${CMAKE_INSTALL_PREFIX})
+    set(exec_prefix "\${prefix}")
+    set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+    set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+    configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
+    expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endif()
+
+#
+# C command line tool xmlwf
+#
+if(EXPAT_BUILD_TOOLS)
+    set(xmlwf_SRCS
+        xmlwf/xmlwf.c
+        xmlwf/xmlfile.c
+        xmlwf/codepage.c
+        xmlwf/readfilemap.c
+    )
+
+    add_executable(xmlwf ${xmlwf_SRCS})
+    set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
+    target_link_libraries(xmlwf expat)
+    expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+    if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
+        # https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html
+        set_target_properties(xmlwf PROPERTIES LINK_FLAGS -municode)
+    endif()
+
+    if(EXPAT_BUILD_DOCS)
+        file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
+        add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")
+        expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+    endif()
+endif()
+
+#
+# C code examples
+#
+if(EXPAT_BUILD_EXAMPLES)
+    add_executable(elements examples/elements.c)
+    set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
+    target_link_libraries(elements expat)
+
+    add_executable(outline examples/outline.c)
+    set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
+    target_link_libraries(outline expat)
+endif(EXPAT_BUILD_EXAMPLES)
+
+#
+# C/C++ test runners
+#
+if(EXPAT_BUILD_TESTS)
+    ## these are unittests that can be run on any platform
+    enable_language(CXX)
+    enable_testing()
+
+    set(test_SRCS
+        tests/chardata.c
+        tests/memcheck.c
+        tests/minicheck.c
+        tests/structdata.c
+    )
+
+    if(NOT MSVC)
+        if(MINGW)
+            set(host whatever-mingw32)  # for nothing but run.sh
+        endif()
+        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.sh.in run.sh @ONLY)
+    endif()
+
+    function(expat_add_test _name _file)
+        if(MSVC)
+            add_test(NAME ${_name} COMMAND ${_file})
+        else()
+            add_test(NAME ${_name} COMMAND bash run.sh ${_file})
+        endif()
+    endfunction()
+
+    add_executable(runtests tests/runtests.c ${test_SRCS})
+    set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
+    target_link_libraries(runtests expat)
+    expat_add_test(runtests $<TARGET_FILE:runtests>)
+
+    add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
+    set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
+    target_link_libraries(runtestspp expat)
+    expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
+endif(EXPAT_BUILD_TESTS)
+
+if(EXPAT_BUILD_FUZZERS)
+    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+        message(SEND_ERROR
+            "Building fuzz targets without Clang (but ${CMAKE_C_COMPILER_ID}) "
+            "is not supported. Please set "
+            "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++.")
+    endif()
+
+    string(FIND "${CMAKE_EXE_LINKER_FLAGS}" "-fsanitize" sanitizer_present)
+    if(${sanitizer_present} EQUAL "-1")
+        message(WARNING
+            "There was no sanitizer present when building the fuzz targets. "
+            "This is likely in error - consider adding "
+            "-DCMAKE_C_FLAGS='-fsanitize=<sanitizer>' and "
+            "-DCMAKE_CXX_FLAGS='-fsanitize=<sanitizer>' and "
+            "-DCMAKE_STATIC_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
+            "-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=<sanitizer>' to your cmake "
+            "execution.")
+    endif()
+
+    set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE)
+    set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer)
+
+    add_library(fuzzpat STATIC ${expat_SRCS})
+    target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link)
+
+    foreach(fuzz_target ${fuzz_targets})
+        foreach(encoding_type ${encoding_types})
+            set(target_name ${fuzz_target}_${encoding_type})
+            add_executable(${target_name} fuzz/${fuzz_target}.c)
+            target_link_libraries(${target_name} fuzzpat)
+            target_compile_definitions(${target_name}
+                PRIVATE ENCODING_FOR_FUZZING=${encoding_type})
+            target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer-no-link)
+            # NOTE: Avoiding target_link_options here only because it needs CMake >=3.13
+            set_target_properties(${target_name} PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
+            set_property(
+                TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
+        endforeach()
+    endforeach()
+endif(EXPAT_BUILD_FUZZERS)
+
+#
+# Custom target "run-xmltest"
+#
+if(EXPAT_BUILD_TOOLS AND NOT MSVC)
+    add_custom_target(
+        xmlts-zip-downloaded
+        COMMAND
+            sh -c 'test -f xmlts.zip || wget --output-document=xmlts.zip https://www.w3.org/XML/Test/xmlts20080827.zip'
+        BYPRODUCTS
+            tests/xmlts.zip
+        WORKING_DIRECTORY
+            tests/)
+
+    add_custom_target(
+        xmlts-zip-extracted
+        COMMAND
+            sh -c 'test -d xmlconf || unzip -q xmlts.zip'
+        BYPRODUCTS
+            tests/xmlconf
+        WORKING_DIRECTORY
+            tests/)
+    add_dependencies(xmlts-zip-extracted xmlts-zip-downloaded)
+
+    add_custom_target(
+        xmltest-sh-been-run
+        COMMAND
+            sh -c '${CMAKE_CURRENT_SOURCE_DIR}/tests/xmltest.sh "bash ${CMAKE_CURRENT_BINARY_DIR}/run.sh $<TARGET_FILE:xmlwf>" 2>&1 | tee tests/xmltest.log'
+        BYPRODUCTS
+            tests/xmltest.log)
+    add_dependencies(xmltest-sh-been-run xmlts-zip-extracted xmlwf)
+
+    add_custom_target(
+        xmltest-log-fixed
+        COMMAND
+            ${CMAKE_CURRENT_SOURCE_DIR}/fix-xmltest-log.sh tests/xmltest.log
+        DEPENDS
+            tests/xmltest.log)
+    add_dependencies(xmltest-log-fixed xmltest-sh-been-run)
+
+    add_custom_target(
+        xmltest-log-verified
+        COMMAND
+            diff -u ${CMAKE_CURRENT_SOURCE_DIR}/tests/xmltest.log.expected tests/xmltest.log)
+    add_dependencies(xmltest-log-verified xmltest-log-fixed)
+
+    add_custom_target(run-xmltest)
+    add_dependencies(run-xmltest xmltest-log-verified)
+endif()
+
+#
+# Documentation
+#
+configure_file(Changes changelog COPYONLY)
+expat_install(
+    FILES
+        AUTHORS
+        ${CMAKE_CURRENT_BINARY_DIR}/changelog
+    DESTINATION
+        ${CMAKE_INSTALL_DOCDIR})
+
+#
+# CMake files for find_package(expat [..] CONFIG [..])
+#
+configure_package_config_file(
+        cmake/expat-config.cmake.in
+        cmake/expat-config.cmake
+    INSTALL_DESTINATION
+        ${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
+)
+write_basic_package_version_file(
+    cmake/expat-config-version.cmake
+    COMPATIBILITY SameMajorVersion  # i.e. semver
+)
+export(
+    TARGETS
+        expat
+    FILE
+        cmake/expat-targets.cmake  # not going to be installed
+)
+expat_install(
+    FILES
+        ${CMAKE_CURRENT_BINARY_DIR}/cmake/expat-config.cmake
+        ${CMAKE_CURRENT_BINARY_DIR}/cmake/expat-config-version.cmake
+    DESTINATION
+        ${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
+)
+expat_install(
+    EXPORT
+        expat
+    DESTINATION
+        ${CMAKE_INSTALL_LIBDIR}/cmake/expat-${PROJECT_VERSION}/
+    NAMESPACE
+        expat::
+)
+
+#
+# Summary
+#
+if(EXPAT_CHAR_TYPE STREQUAL "char")
+    set(_EXPAT_CHAR_TYPE_SUMMARY "char (UTF-8)")
+elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
+    set(_EXPAT_CHAR_TYPE_SUMMARY "ushort (unsigned short, UTF-16)")
+elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
+    if(WIN32)
+        set(_EXPAT_CHAR_TYPE_SUMMARY "wchar_t (UTF-16)")
+    else()
+        set(_EXPAT_CHAR_TYPE_SUMMARY "wchar_t (UTF-32)  // not implemented")
+    endif()
+else()
+    set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR")
+endif()
+string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER)
+
+message(STATUS "===========================================================================")
+message(STATUS "")
+message(STATUS "Configuration")
+message(STATUS "  Prefix ..................... ${CMAKE_INSTALL_PREFIX}")
+message(STATUS "  Build type ................. ${CMAKE_BUILD_TYPE}")
+message(STATUS "  Shared libraries ........... ${EXPAT_SHARED_LIBS}")
+if(MSVC)
+    message(STATUS "  Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}")
+endif()
+message(STATUS "  Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}")
+if(WIN32)
+    message(STATUS "  Binary postfix ............. ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
+endif()
+message(STATUS "")
+message(STATUS "  Build documentation ........ ${EXPAT_BUILD_DOCS}")
+message(STATUS "  Build examples ............. ${EXPAT_BUILD_EXAMPLES}")
+message(STATUS "  Build fuzzers .............. ${EXPAT_BUILD_FUZZERS}")
+message(STATUS "  Build tests ................ ${EXPAT_BUILD_TESTS}")
+message(STATUS "  Build tools (xmlwf) ........ ${EXPAT_BUILD_TOOLS}")
+message(STATUS "  Install files .............. ${EXPAT_ENABLE_INSTALL}")
+message(STATUS "")
+message(STATUS "  Features")
+message(STATUS "    // Advanced options, changes not advised")
+message(STATUS "    Attributes info .......... ${EXPAT_ATTR_INFO}")
+message(STATUS "    Context bytes ............ ${EXPAT_CONTEXT_BYTES}")
+message(STATUS "    DTD support .............. ${EXPAT_DTD}")
+message(STATUS "    Large size ............... ${EXPAT_LARGE_SIZE}")
+message(STATUS "    Minimum size ............. ${EXPAT_MIN_SIZE}")
+message(STATUS "    Namespace support ........ ${EXPAT_NS}")
+message(STATUS "")
+message(STATUS "  Entropy sources")
+if(WIN32)
+    message(STATUS "    rand_s ................... ON")
+else()
+    message(STATUS "    getrandom ................ ${HAVE_GETRANDOM}")
+    message(STATUS "    syscall SYS_getrandom .... ${HAVE_SYSCALL_GETRANDOM}")
+    message(STATUS "    libbsd ................... ${EXPAT_WITH_LIBBSD}")
+    message(STATUS "    /dev/random .............. ${EXPAT_DEV_URANDOM}")
+endif()
+message(STATUS "")
+if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+    message(STATUS "Continue with")
+    message(STATUS "  make")
+    if(EXPAT_BUILD_TESTS)
+        message(STATUS "  make test")
+    endif()
+    if(EXPAT_ENABLE_INSTALL)
+        message(STATUS "  sudo make install")
+    endif()
+    message(STATUS "")
+endif()
+message(STATUS "===========================================================================")

+ 109 - 3
libs/expat/Changes

@@ -2,11 +2,117 @@ NOTE: We are looking for help with a few things:
       https://github.com/libexpat/libexpat/labels/help%20wanted
       If you can help, please get in touch.  Thanks!
 
+Release 2.2.8 Fri Septemper 13 2019
+        Security fixes:
+       #317 #318  CVE-2019-15903 -- Fix heap overflow triggered by
+                    XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber),
+                    and deny internal entities closing the doctype;
+                    fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43
+
+        Bug fixes:
+            #240  Fix cases where XML_StopParser did not have any effect
+                    when called from inside of an end element handler
+            #341  xmlwf: Fix exit code for operation without "-d DIRECTORY";
+                    previously, only "-d DIRECTORY" would give you a proper
+                    exit code:
+                      # xmlwf -d . <<<'<not well-formed>' 2>/dev/null ; echo $?
+                      2
+                      # xmlwf <<<'<not well-formed>' 2>/dev/null ; echo $?
+                      0
+                    Now both cases return exit code 2.
+
+        Other changes:
+       #299 #302  Windows: Replace LoadLibrary hack to access
+                    unofficial API function SystemFunction036 (RtlGenRandom)
+                    by using official API function rand_s (needs WinXP+)
+            #325  Windows: Drop support for Visual Studio <=7.1/2003
+                    and document supported compilers in README.md
+            #286  Windows: Remove COM code from xmlwf; in case it turns
+                    out needed later, there will be a dedicated repository
+                    below https://github.com/libexpat/ for that code
+            #322  Windows: Remove explicit MSVC solution and project files.
+                    You can generate Visual Studio solution files through
+                    CMake, e.g.: cmake -G"Visual Studio 15 2017" .
+            #338  xmlwf: Make "xmlwf -h" help output more friendly
+            #339  examples: Improve elements.c
+       #244 #264  Autotools: Add argument --enable-xml-attr-info
+       #239 #301  Autotools: Add arguments
+                    --with-getrandom
+                    --without-getrandom
+                    --with-sys-getrandom
+                    --without-sys-getrandom
+       #312 #343  Autotools: Fix linking issues with "./configure LD=clang"
+                  Autotools: Fix "make run-xmltest" for out-of-source builds
+       #329 #336  CMake: Pull all options from Expat <=2.2.7 into namespace
+                    prefix EXPAT_ with the exception of DOCBOOK_TO_MAN:
+                    - BUILD_doc            -> EXPAT_BUILD_DOCS (plural)
+                    - BUILD_examples       -> EXPAT_BUILD_EXAMPLES
+                    - BUILD_shared         -> EXPAT_SHARED_LIBS
+                    - BUILD_tests          -> EXPAT_BUILD_TESTS
+                    - BUILD_tools          -> EXPAT_BUILD_TOOLS
+                    - DOCBOOK_TO_MAN       -> DOCBOOK_TO_MAN (unchanged)
+                    - INSTALL              -> EXPAT_ENABLE_INSTALL
+                    - MSVC_USE_STATIC_CRT  -> EXPAT_MSVC_STATIC_CRT
+                    - USE_libbsd           -> EXPAT_WITH_LIBBSD
+                    - WARNINGS_AS_ERRORS   -> EXPAT_WARNINGS_AS_ERRORS
+                    - XML_CONTEXT_BYTES    -> EXPAT_CONTEXT_BYTES
+                    - XML_DEV_URANDOM      -> EXPAT_DEV_URANDOM
+                    - XML_DTD              -> EXPAT_DTD
+                    - XML_NS               -> EXPAT_NS
+                    - XML_UNICODE          -> EXPAT_CHAR_TYPE=ushort (!)
+                    - XML_UNICODE_WCHAR_T  -> EXPAT_CHAR_TYPE=wchar_t (!)
+       #244 #264  CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF),
+                    default OFF
+            #326  CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF),
+                    default OFF
+            #328  CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF),
+                    default OFF
+       #239 #277  CMake: Add arguments
+                    -DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO
+                    -DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO
+            #326  CMake: Install expat_config.h to include directory
+            #326  CMake: Generate and install configuration files for
+                    future find_package(expat [..] CONFIG [..])
+                  CMake: Now produces a summary of applied configuration
+                  CMake: Require C++ compiler only when tests are enabled
+            #330  CMake: Fix compilation for 16bit character types,
+                    i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON)
+            #265  CMake: Fix linking with MinGW
+            #330  CMake: Add full support for MinGW; to enable, use
+                    -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake
+            #330  CMake: Port "make run-xmltest" from GNU Autotools to CMake
+            #316  CMake: Windows: Make binary postfix match MSVC
+                    Old: expat[d].lib
+                    New: expat[w][d][MD|MT].lib
+                  CMake: Migrate files from Windows to Unix line endings
+            #308  CMake: Integrate OSS-Fuzz fuzzers, option
+                    -DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF
+             #14  Drop an OpenVMS support leftover
+    #235 #268 ..
+    #270 #310 ..
+  #313 #331 #333  Address compiler warnings
+    #282 #283 ..
+       #284 #285  Address cppcheck warnings
+       #294 #295  Address Clang Static Analyzer warnings
+        #24 #293  Mass-apply clang-format 9 (and ensure conformance during CI)
+                  Version info bumped from 7:9:6 to 7:10:6
+
+        Special thanks to:
+            David Loffredo
+            Joonun Jang
+            Khajapasha Mohammed
+            Kishore Kunche
+            Marco Maggi
+            Mitch Phillips
+            Rolf Ade
+            xantares
+            Zhongyuan Zhou
+
 Release 2.2.7 Wed June 19 2019
         Security fixes:
-       #186 #262  Fix extraction of namespace prefixes from XML names;
-                    XML names with multiple colons could end up in the
-                    wrong namespace, and take a high amount of RAM and CPU
+       #186 #262  CVE-2018-20843 -- Fix extraction of namespace prefixes from
+                    XML names; XML names with multiple colons could end up in
+                    the wrong namespace, and take a high amount of RAM and CPU
                     resources while processing, opening the door to
                     use for denial-of-service attacks
 

+ 66 - 69
libs/expat/ConfigureChecks.cmake

@@ -1,69 +1,66 @@
-include(CheckCCompilerFlag)
-include(CheckCSourceCompiles)
-include(CheckIncludeFile)
-include(CheckIncludeFiles)
-include(CheckSymbolExists)
-include(TestBigEndian)
-
-check_include_file("dlfcn.h" HAVE_DLFCN_H)
-check_include_file("fcntl.h" HAVE_FCNTL_H)
-check_include_file("inttypes.h" HAVE_INTTYPES_H)
-check_include_file("memory.h" HAVE_MEMORY_H)
-check_include_file("stdint.h" HAVE_STDINT_H)
-check_include_file("stdlib.h" HAVE_STDLIB_H)
-check_include_file("strings.h" HAVE_STRINGS_H)
-check_include_file("string.h" HAVE_STRING_H)
-check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
-check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
-check_include_file("unistd.h" HAVE_UNISTD_H)
-
-check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE)
-check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP)
-check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM)
-
-if(USE_libbsd)
-    set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}")
-    set(_bsd "bsd/")
-else()
-    set(_bsd "")
-endif()
-check_symbol_exists("arc4random_buf" "${_bsd}stdlib.h" HAVE_ARC4RANDOM_BUF)
-if(NOT HAVE_ARC4RANDOM_BUF)
-    check_symbol_exists("arc4random" "${_bsd}stdlib.h" HAVE_ARC4RANDOM)
-endif()
-set(CMAKE_REQUIRED_LIBRARIES)
-
-#/* Define to 1 if you have the ANSI C header files. */
-check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
-
-test_big_endian(WORDS_BIGENDIAN)
-#/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-if(WORDS_BIGENDIAN)
-    set(BYTEORDER 4321)
-else(WORDS_BIGENDIAN)
-    set(BYTEORDER 1234)
-endif(WORDS_BIGENDIAN)
-
-if(HAVE_SYS_TYPES_H)
-    check_symbol_exists("off_t" "sys/types.h" OFF_T)
-    check_symbol_exists("size_t" "sys/types.h" SIZE_T)
-else(HAVE_SYS_TYPES_H)
-    set(OFF_T "long")
-    set(SIZE_T "unsigned")
-endif(HAVE_SYS_TYPES_H)
-
-check_c_source_compiles("
-        #include <stdlib.h>  /* for NULL */
-        #include <unistd.h>  /* for syscall */
-        #include <sys/syscall.h>  /* for SYS_getrandom */
-        int main() {
-            syscall(SYS_getrandom, NULL, 0, 0);
-            return 0;
-        }"
-    HAVE_SYSCALL_GETRANDOM)
-
-configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
-add_definitions(-DHAVE_EXPAT_CONFIG_H)
-
-check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
-check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
+include(CheckCCompilerFlag)
+include(CheckCSourceCompiles)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckSymbolExists)
+include(TestBigEndian)
+
+check_include_file("dlfcn.h" HAVE_DLFCN_H)
+check_include_file("fcntl.h" HAVE_FCNTL_H)
+check_include_file("inttypes.h" HAVE_INTTYPES_H)
+check_include_file("memory.h" HAVE_MEMORY_H)
+check_include_file("stdint.h" HAVE_STDINT_H)
+check_include_file("stdlib.h" HAVE_STDLIB_H)
+check_include_file("strings.h" HAVE_STRINGS_H)
+check_include_file("string.h" HAVE_STRING_H)
+check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
+check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
+check_include_file("unistd.h" HAVE_UNISTD_H)
+
+check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE)
+check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP)
+check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM)
+
+if(EXPAT_WITH_LIBBSD)
+    set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}")
+    set(_bsd "bsd/")
+else()
+    set(_bsd "")
+endif()
+check_symbol_exists("arc4random_buf" "${_bsd}stdlib.h" HAVE_ARC4RANDOM_BUF)
+if(NOT HAVE_ARC4RANDOM_BUF)
+    check_symbol_exists("arc4random" "${_bsd}stdlib.h" HAVE_ARC4RANDOM)
+endif()
+set(CMAKE_REQUIRED_LIBRARIES)
+
+#/* Define to 1 if you have the ANSI C header files. */
+check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
+
+test_big_endian(WORDS_BIGENDIAN)
+#/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+if(WORDS_BIGENDIAN)
+    set(BYTEORDER 4321)
+else(WORDS_BIGENDIAN)
+    set(BYTEORDER 1234)
+endif(WORDS_BIGENDIAN)
+
+if(HAVE_SYS_TYPES_H)
+    check_symbol_exists("off_t" "sys/types.h" OFF_T)
+    check_symbol_exists("size_t" "sys/types.h" SIZE_T)
+else(HAVE_SYS_TYPES_H)
+    set(OFF_T "long")
+    set(SIZE_T "unsigned")
+endif(HAVE_SYS_TYPES_H)
+
+check_c_source_compiles("
+        #include <stdlib.h>  /* for NULL */
+        #include <unistd.h>  /* for syscall */
+        #include <sys/syscall.h>  /* for SYS_getrandom */
+        int main() {
+            syscall(SYS_getrandom, NULL, 0, 0);
+            return 0;
+        }"
+    HAVE_SYSCALL_GETRANDOM)
+
+check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
+check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)

+ 30 - 36
libs/expat/Makefile.am

@@ -54,41 +54,19 @@ pkgconfigdir = $(libdir)/pkgconfig
 
 
 _EXTRA_DIST_CMAKE = \
+    cmake/expat-config.cmake.in \
+    cmake/mingw-toolchain.cmake \
+    \
     CMakeLists.txt \
     CMake.README \
     ConfigureChecks.cmake \
     expat_config.h.cmake
 
 _EXTRA_DIST_WINDOWS = \
-    examples/elements.vcxproj \
-    examples/elements.vcxproj.filters \
-    examples/outline.vcxproj \
-    examples/outline.vcxproj.filters \
-    \
-    lib/expat_static.vcxproj \
-    lib/expat_static.vcxproj.filters \
-    lib/expat.vcxproj \
-    lib/expat.vcxproj.filters \
-    lib/expatw_static.vcxproj \
-    lib/expatw_static.vcxproj.filters \
-    lib/expatw.vcxproj \
-    lib/expatw.vcxproj.filters \
-    \
-    tests/benchmark/benchmark.sln \
-    tests/benchmark/benchmark.vcxproj \
-    \
-    tests/runtests.sln \
-    tests/runtests.vcxproj \
-    tests/runtests.vcxproj.filters \
-    \
+    win32/build_expat_iss.bat \
     win32/expat.iss \
     win32/MANIFEST.txt \
-    win32/README.txt \
-    \
-    xmlwf/xmlwf.vcxproj \
-    xmlwf/xmlwf.vcxproj.filters \
-    \
-    expat.sln
+    win32/README.txt
 
 EXTRA_DIST = \
     $(_EXTRA_DIST_CMAKE) \
@@ -98,8 +76,13 @@ EXTRA_DIST = \
     conftools/get-version.sh \
     conftools/PrintPath \
     \
+    xmlwf/xmlwf_helpgen.py \
+    xmlwf/xmlwf_helpgen.sh \
+    \
     Changes \
     README.md \
+    \
+    fix-xmltest-log.sh \
     test-driver-wrapper.sh
 
 
@@ -128,7 +111,8 @@ run-benchmark:
 	$(MAKE) -C tests/benchmark
 	./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
 
-tests/xmlts.zip:
+.PHONY: download-xmlts-zip
+download-xmlts-zip:
 	if test "$(XMLTS_ZIP)" = ""; then \
 		wget --output-document=tests/xmlts.zip \
 			https://www.w3.org/XML/Test/xmlts20080827.zip; \
@@ -136,16 +120,26 @@ tests/xmlts.zip:
 		cp $(XMLTS_ZIP) tests/xmlts.zip; \
 	fi
 
-tests/xmlconf: tests/xmlts.zip
+tests/xmlts.zip:
+	$(MAKE) download-xmlts-zip
+
+.PHONY: extract-xmlts-zip
+extract-xmlts-zip: tests/xmlts.zip
+	[ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip  # vpath workaround
 	cd tests && unzip -q xmlts.zip
 
+tests/xmlconf: tests/xmlts.zip
+	$(MAKE) extract-xmlts-zip
+
 .PHONY: run-xmltest
 run-xmltest: tests/xmlconf
 if WITH_XMLWF
+	[ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip  # vpath workaround
+	$(MAKE) -C lib
 	$(MAKE) -C xmlwf
-	tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log
-	dos2unix tests/xmltest.log
-	diff -u tests/xmltest.log.expected tests/xmltest.log
+	$(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
+	$(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
+	diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
 else
 	@echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
 	@echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
@@ -154,7 +148,7 @@ endif
 
 .PHONY: qa
 qa:
-	./qa.sh address
-	./qa.sh memory
-	./qa.sh undefined
-	./qa.sh coverage
+	QA_COMPILER=clang QA_SANITIZER=address   ./qa.sh
+	QA_COMPILER=clang QA_SANITIZER=memory    ./qa.sh
+	QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
+	QA_COMPILER=gcc   QA_PROCESSOR=gcov      ./qa.sh

+ 30 - 36
libs/expat/Makefile.in

@@ -424,41 +424,19 @@ SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3)
 pkgconfig_DATA = expat.pc
 pkgconfigdir = $(libdir)/pkgconfig
 _EXTRA_DIST_CMAKE = \
+    cmake/expat-config.cmake.in \
+    cmake/mingw-toolchain.cmake \
+    \
     CMakeLists.txt \
     CMake.README \
     ConfigureChecks.cmake \
     expat_config.h.cmake
 
 _EXTRA_DIST_WINDOWS = \
-    examples/elements.vcxproj \
-    examples/elements.vcxproj.filters \
-    examples/outline.vcxproj \
-    examples/outline.vcxproj.filters \
-    \
-    lib/expat_static.vcxproj \
-    lib/expat_static.vcxproj.filters \
-    lib/expat.vcxproj \
-    lib/expat.vcxproj.filters \
-    lib/expatw_static.vcxproj \
-    lib/expatw_static.vcxproj.filters \
-    lib/expatw.vcxproj \
-    lib/expatw.vcxproj.filters \
-    \
-    tests/benchmark/benchmark.sln \
-    tests/benchmark/benchmark.vcxproj \
-    \
-    tests/runtests.sln \
-    tests/runtests.vcxproj \
-    tests/runtests.vcxproj.filters \
-    \
+    win32/build_expat_iss.bat \
     win32/expat.iss \
     win32/MANIFEST.txt \
-    win32/README.txt \
-    \
-    xmlwf/xmlwf.vcxproj \
-    xmlwf/xmlwf.vcxproj.filters \
-    \
-    expat.sln
+    win32/README.txt
 
 EXTRA_DIST = \
     $(_EXTRA_DIST_CMAKE) \
@@ -468,8 +446,13 @@ EXTRA_DIST = \
     conftools/get-version.sh \
     conftools/PrintPath \
     \
+    xmlwf/xmlwf_helpgen.py \
+    xmlwf/xmlwf_helpgen.sh \
+    \
     Changes \
     README.md \
+    \
+    fix-xmltest-log.sh \
     test-driver-wrapper.sh
 
 all: expat_config.h
@@ -1007,7 +990,8 @@ run-benchmark:
 	$(MAKE) -C tests/benchmark
 	./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
 
-tests/xmlts.zip:
+.PHONY: download-xmlts-zip
+download-xmlts-zip:
 	if test "$(XMLTS_ZIP)" = ""; then \
 		wget --output-document=tests/xmlts.zip \
 			https://www.w3.org/XML/Test/xmlts20080827.zip; \
@@ -1015,25 +999,35 @@ tests/xmlts.zip:
 		cp $(XMLTS_ZIP) tests/xmlts.zip; \
 	fi
 
-tests/xmlconf: tests/xmlts.zip
+tests/xmlts.zip:
+	$(MAKE) download-xmlts-zip
+
+.PHONY: extract-xmlts-zip
+extract-xmlts-zip: tests/xmlts.zip
+	[ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip  # vpath workaround
 	cd tests && unzip -q xmlts.zip
 
+tests/xmlconf: tests/xmlts.zip
+	$(MAKE) extract-xmlts-zip
+
 .PHONY: run-xmltest
 run-xmltest: tests/xmlconf
+@WITH_XMLWF_TRUE@	[ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip  # vpath workaround
+@WITH_XMLWF_TRUE@	$(MAKE) -C lib
 @WITH_XMLWF_TRUE@	$(MAKE) -C xmlwf
-@WITH_XMLWF_TRUE@	tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log
-@WITH_XMLWF_TRUE@	dos2unix tests/xmltest.log
-@WITH_XMLWF_TRUE@	diff -u tests/xmltest.log.expected tests/xmltest.log
+@WITH_XMLWF_TRUE@	$(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
+@WITH_XMLWF_TRUE@	$(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
+@WITH_XMLWF_TRUE@	diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
 @WITH_XMLWF_FALSE@	@echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
 @WITH_XMLWF_FALSE@	@echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
 @WITH_XMLWF_FALSE@	@false
 
 .PHONY: qa
 qa:
-	./qa.sh address
-	./qa.sh memory
-	./qa.sh undefined
-	./qa.sh coverage
+	QA_COMPILER=clang QA_SANITIZER=address   ./qa.sh
+	QA_COMPILER=clang QA_SANITIZER=memory    ./qa.sh
+	QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
+	QA_COMPILER=gcc   QA_PROCESSOR=gcov      ./qa.sh
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

+ 62 - 1
libs/expat/README.md

@@ -3,7 +3,7 @@
 [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
 
 
-# Expat, Release 2.2.7
+# Expat, Release 2.2.8
 
 This is Expat, a C library for parsing XML, started by
 [James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
@@ -13,6 +13,11 @@ are called when the parser discovers the associated structures in the
 document being parsed.  A start tag is an example of the kind of
 structures for which you may register handlers.
 
+Expat supports the following compilers:
+- GNU GCC >=4.5
+- LLVM Clang >=3.5
+- Microsoft Visual Studio >=8.0/2005
+
 Windows users should use the
 [`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
 which includes both precompiled libraries and executables, and source code for
@@ -125,3 +130,59 @@ information.
 
 A reference manual is available in the file `doc/reference.html` in this
 distribution.
+
+
+The CMake build system is still *experimental* and will replace the primary
+build system based on GNU Autotools at some point when its ready.
+For an idea of the available (non-advanced) options for building with CMake:
+
+```console
+# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,'
+// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
+CMAKE_BUILD_TYPE:STRING=
+
+// Install path prefix, prepended onto install directories.
+CMAKE_INSTALL_PREFIX:PATH=/usr/local
+
+// Path to a program.
+DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
+
+// build man page for xmlwf
+EXPAT_BUILD_DOCS:BOOL=ON
+
+// build the examples for expat library
+EXPAT_BUILD_EXAMPLES:BOOL=ON
+
+// build fuzzers for the expat library
+EXPAT_BUILD_FUZZERS:BOOL=OFF
+
+// build the tests for expat library
+EXPAT_BUILD_TESTS:BOOL=ON
+
+// build the xmlwf tool for expat library
+EXPAT_BUILD_TOOLS:BOOL=ON
+
+// Character type to use (char|ushort|wchar_t) [default=char]
+EXPAT_CHAR_TYPE:STRING=char
+
+// install expat files in cmake install target
+EXPAT_ENABLE_INSTALL:BOOL=ON
+
+// Use /MT flag (static CRT) when compiling in MSVC
+EXPAT_MSVC_STATIC_CRT:BOOL=OFF
+
+// build a shared expat library
+EXPAT_SHARED_LIBS:BOOL=ON
+
+// Treat all compiler warnings as errors
+EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
+
+// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
+EXPAT_WITH_GETRANDOM:STRING=AUTO
+
+// utilize libbsd (for arc4random_buf)
+EXPAT_WITH_LIBBSD:BOOL=OFF
+
+// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
+EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO
+```

+ 75 - 0
libs/expat/cmake/expat-config.cmake.in

@@ -0,0 +1,75 @@
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2019 Expat development team
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+if(NOT _expat_config_included)
+    # Protect against multiple inclusion
+    set(_expat_config_included TRUE)
+
+
+include("${CMAKE_CURRENT_LIST_DIR}/expat.cmake")
+
+@PACKAGE_INIT@
+
+#
+# Supported components
+#
+macro(expat_register_component _NAME _AVAILABE)
+    set(expat_${_NAME}_FOUND ${_AVAILABE})
+endmacro()
+
+expat_register_component(attr_info          @EXPAT_ATTR_INFO@)
+expat_register_component(dtd                @EXPAT_DTD@)
+expat_register_component(large_size         @EXPAT_LARGE_SIZE@)
+expat_register_component(min_size           @EXPAT_MIN_SIZE@)
+expat_register_component(ns                 @EXPAT_NS@)
+
+if(@EXPAT_CONTEXT_BYTES@)
+    expat_register_component(context_bytes  ON)
+else()
+    expat_register_component(context_bytes  OFF)
+endif()
+
+if("@EXPAT_CHAR_TYPE@" STREQUAL "char")
+    expat_register_component(char           ON)
+    expat_register_component(ushort         OFF)
+    expat_register_component(wchar_t        OFF)
+elseif("@EXPAT_CHAR_TYPE@" STREQUAL "ushort")
+    expat_register_component(char           OFF)
+    expat_register_component(ushort         ON)
+    expat_register_component(wchar_t        OFF)
+elseif("@EXPAT_CHAR_TYPE@" STREQUAL "wchar_t")
+    expat_register_component(char           OFF)
+    expat_register_component(ushort         OFF)
+    expat_register_component(wchar_t        ON)
+endif()
+
+check_required_components(expat)
+
+
+endif(NOT _expat_config_included)

+ 36 - 0
libs/expat/cmake/mingw-toolchain.cmake

@@ -0,0 +1,36 @@
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2019 Expat development team
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+set(CMAKE_SYSTEM_NAME Windows)
+
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+
+set(WIN32 ON)
+set(MINGW ON)

+ 202 - 130
libs/expat/configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for expat 2.2.7.
+# Generated by GNU Autoconf 2.69 for expat 2.2.8.
 #
 # Report bugs to <[email protected]>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='expat'
 PACKAGE_TARNAME='expat'
-PACKAGE_VERSION='2.2.7'
-PACKAGE_STRING='expat 2.2.7'
+PACKAGE_VERSION='2.2.8'
+PACKAGE_STRING='expat 2.2.8'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -678,14 +678,6 @@ FGREP
 EGREP
 GREP
 SED
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
 LIBTOOL
 OBJDUMP
 DLLTOOL
@@ -736,6 +728,14 @@ am__isrc
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
 target_alias
 host_alias
 build_alias
@@ -792,6 +792,9 @@ with_xmlwf
 with_examples
 with_tests
 with_libbsd
+with_getrandom
+with_sys_getrandom
+enable_xml_attr_info
 enable_xml_context
 with_docbook
 '
@@ -1350,7 +1353,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures expat 2.2.7 to adapt to many kinds of systems.
+\`configure' configures expat 2.2.8 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1420,7 +1423,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of expat 2.2.7:";;
+     short | recursive ) echo "Configuration of expat 2.2.8:";;
    esac
   cat <<\_ACEOF
 
@@ -1439,6 +1442,8 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-xml-attr-info  Enable retrieving the byte offsets for attribute
+                          names and values [default=no]
   --enable-xml-context [COUNT]
                           Retain context around the current parse point;
                           default is enabled and a size of 1024 bytes
@@ -1456,11 +1461,16 @@ Optional Packages:
   --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                           compiler's sysroot if not specified).
   --without-xmlwf         do not build xmlwf
-
   --without-examples      do not build examples [default=included]
-
   --without-tests         do not build tests [default=included]
   --with-libbsd           utilize libbsd (for arc4random_buf)
+  --with-getrandom        enforce the use of getrandom function in the system
+                          [default=check]
+  --without-getrandom     skip auto detect of getrandom [default=check]
+  --with-sys-getrandom    enforce the use of syscall SYS_getrandom function in
+                          the system [default=check]
+  --without-sys-getrandom skip auto detect of syscall SYS_getrandom
+                          [default=check]
   --with-docbook          enforce XML to man page compilation [default=check]
   --without-docbook       skip XML to man page compilation [default=check]
 
@@ -1547,7 +1557,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-expat configure 2.2.7
+expat configure 2.2.8
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2091,7 +2101,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by expat $as_me 2.2.7, which was
+It was created by expat $as_me 2.2.8, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2475,6 +2485,77 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
 am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
@@ -2961,7 +3042,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='expat'
- VERSION='2.2.7'
+ VERSION='2.2.8'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3057,9 +3138,9 @@ fi
 
 
 
-LIBCURRENT=7   # sync
-LIBREVISION=9  # with
-LIBAGE=6       # CMakeLists.txt!
+LIBCURRENT=7    # sync
+LIBREVISION=10  # with
+LIBAGE=6        # CMakeLists.txt!
 
 
 if ${CPPFLAGS+:} false; then :
@@ -4377,77 +4458,6 @@ macro_revision='2.4.6'
 
 ltmain=$ac_aux_dir/ltmain.sh
 
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
@@ -17392,6 +17402,18 @@ done
 
 fi
 
+case "$LD" in #(
+  *clang*) :
+    case "${host_os}" in #(
+  *linux*) :
+    archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ;; #(
+  *) :
+     ;;
+esac ;; #(
+  *) :
+     ;;
+esac
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5
 $as_echo_n "checking whether compiler supports visibility... " >&6; }
 if ${expatcfg_cv_compiler_supports_visibility+:} false; then :
@@ -17972,7 +17994,17 @@ else
 fi
 
 
- if echo -- "${host}" | ${FGREP} mingw >/dev/null; then
+
+EXPATCFG_ON_MINGW=no
+case "${host_os}" in #(
+  mingw*) :
+    EXPATCFG_ON_MINGW=yes
+   { $as_echo "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5
+$as_echo "$as_me: detected OS: MinGW" >&6;} ;; #(
+  *) :
+     ;;
+esac
+ if test x${EXPATCFG_ON_MINGW} = xyes; then
   MINGW_TRUE=
   MINGW_FALSE='#'
 else
@@ -17980,6 +18012,7 @@ else
   MINGW_FALSE=
 fi
 
+
  if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null; then
   UNICODE_TRUE=
   UNICODE_FALSE='#'
@@ -18054,14 +18087,14 @@ $as_echo_n "checking for arc4random_buf (BSD or libbsd)... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-  #include <stdlib.h>  /* for arc4random_buf on BSD, for NULL */
-  #if defined(HAVE_LIBBSD)
-  # include <bsd/stdlib.h>
-  #endif
-  int main() {
-    arc4random_buf(NULL, 0U);
-    return 0;
-  }
+    #include <stdlib.h>  /* for arc4random_buf on BSD, for NULL */
+    #if defined(HAVE_LIBBSD)
+    # include <bsd/stdlib.h>
+    #endif
+    int main() {
+      arc4random_buf(NULL, 0U);
+      return 0;
+    }
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
@@ -18079,15 +18112,15 @@ $as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; }
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-      #if defined(HAVE_LIBBSD)
-      # include <bsd/stdlib.h>
-      #else
-      # include <stdlib.h>
-      #endif
-      int main() {
+       #if defined(HAVE_LIBBSD)
+       # include <bsd/stdlib.h>
+       #else
+       # include <stdlib.h>
+       #endif
+       int main() {
           arc4random();
           return 0;
-      }
+       }
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
@@ -18107,58 +18140,84 @@ rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5
+# Check whether --with-getrandom was given.
+if test "${with_getrandom+set}" = set; then :
+  withval=$with_getrandom;
+else
+  with_getrandom=check
+fi
+
+
+if test "x$with_getrandom" != xno; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5
 $as_echo_n "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-  #include <stdlib.h>  /* for NULL */
-  #include <sys/random.h>
-  int main() {
-    return getrandom(NULL, 0U, 0U);
-  }
+       #include <stdlib.h>  /* for NULL */
+       #include <sys/random.h>
+       int main() {
+         return getrandom(NULL, 0U, 0U);
+       }
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
 $as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+      if test "x$with_getrandom" = xyes; then :
+  as_fn_error $? "enforced the use of getrandom --with-getrandom, but not detected" "$LINENO" 5
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5
+
+# Check whether --with-sys_getrandom was given.
+if test "${with_sys_getrandom+set}" = set; then :
+  withval=$with_sys_getrandom;
+else
+  with_sys_getrandom=check
+fi
+
+
+if test "x$with_sys_getrandom" != xno; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5
 $as_echo_n "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; }
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-      #include <stdlib.h>  /* for NULL */
-      #include <unistd.h>  /* for syscall */
-      #include <sys/syscall.h>  /* for SYS_getrandom */
-      int main() {
-        syscall(SYS_getrandom, NULL, 0, 0);
-        return 0;
-      }
+       #include <stdlib.h>  /* for NULL */
+       #include <unistd.h>  /* for syscall */
+       #include <sys/syscall.h>  /* for SYS_getrandom */
+       int main() {
+         syscall(SYS_getrandom, NULL, 0, 0);
+         return 0;
+     }
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
 $as_echo "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+      if test "x$with_sys_getrandom" = xyes; then :
+  as_fn_error $? "enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected" "$LINENO" 5
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-
+fi
 
 for ac_header in fcntl.h unistd.h
 do :
@@ -18404,6 +18463,19 @@ $as_echo "#define XML_DTD 1" >>confdefs.h
 $as_echo "#define XML_DEV_URANDOM 1" >>confdefs.h
 
 
+# Check whether --enable-xml-attr-info was given.
+if test "${enable_xml_attr_info+set}" = set; then :
+  enableval=$enable_xml_attr_info;
+else
+  enable_xml_attr_info=no
+fi
+
+if test "x${enable_xml_attr_info}" = "xyes"; then :
+
+$as_echo "#define XML_ATTR_INFO 1" >>confdefs.h
+
+fi
+
 # Check whether --enable-xml-context was given.
 if test "${enable_xml_context+set}" = set; then :
   enableval=$enable_xml_context; enable_xml_context=${enableval}
@@ -19061,7 +19133,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by expat $as_me 2.2.7, which was
+This file was extended by expat $as_me 2.2.8, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19127,7 +19199,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-expat config.status 2.2.7
+expat config.status 2.2.8
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

+ 99 - 51
libs/expat/configure.ac

@@ -33,6 +33,7 @@ m4_undefine([expat_version])
 AC_CONFIG_SRCDIR([Makefile.in])
 AC_CONFIG_AUX_DIR([conftools])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_HOST
 AM_INIT_AUTOMAKE
 
 
@@ -47,9 +48,9 @@ dnl
 dnl If the API changes incompatibly set LIBAGE back to 0
 dnl
 
-LIBCURRENT=7   # sync
-LIBREVISION=9  # with
-LIBAGE=6       # CMakeLists.txt!
+LIBCURRENT=7    # sync
+LIBREVISION=10  # with
+LIBAGE=6        # CMakeLists.txt!
 
 AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [CPPFLAGS])
 AC_CONFIG_HEADER([expat_config.h])
@@ -93,6 +94,11 @@ AC_LANG_POP([C++])
 AS_IF([test "$GCC" = yes],
   [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[LDFLAGS])])
 
+dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
+AS_CASE(["$LD"],[*clang*],
+  [AS_CASE(["${host_os}"],
+     [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
+
 EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
   AX_APPEND_FLAG([-fvisibility=hidden],       [CFLAGS])
   AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [CFLAGS])])
@@ -118,19 +124,31 @@ AC_C_CONST
 AC_TYPE_SIZE_T
 
 AC_ARG_WITH([xmlwf],
-  [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [],
+  [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])],
+  [],
   [with_xmlwf=yes])
 AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
 
-AC_ARG_WITH([examples], [
-AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])], [], [with_examples=yes])
+AC_ARG_WITH([examples],
+  [AS_HELP_STRING([--without-examples], [do not build examples @<:@default=included@:>@])],
+  [],
+  [with_examples=yes])
 AM_CONDITIONAL([WITH_EXAMPLES], [test x${with_examples} = xyes])
 
-AC_ARG_WITH([tests], [
-AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])], [], [with_tests=yes])
+AC_ARG_WITH([tests],
+  [AS_HELP_STRING([--without-tests], [do not build tests @<:@default=included@:>@])],
+  [],
+  [with_tests=yes])
 AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes])
 
-AM_CONDITIONAL([MINGW], [echo -- "${host}" | ${FGREP} mingw >/dev/null])
+
+AS_VAR_SET([EXPATCFG_ON_MINGW],[no])
+AS_CASE("${host_os}",
+  [mingw*],
+  [AS_VAR_SET([EXPATCFG_ON_MINGW],[yes])
+   AC_MSG_NOTICE([detected OS: MinGW])])
+AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
+
 AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
 
 
@@ -143,65 +161,85 @@ AS_IF([test "x${with_libbsd}" != xno],
      [arc4random_buf],
      [],
      [AS_IF([test "x${with_libbsd}" = xyes],
-            [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
+        [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])])
 AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)])
 AC_LINK_IFELSE([AC_LANG_SOURCE([
-  #include <stdlib.h>  /* for arc4random_buf on BSD, for NULL */
-  #if defined(HAVE_LIBBSD)
-  # include <bsd/stdlib.h>
-  #endif
-  int main() {
-    arc4random_buf(NULL, 0U);
-    return 0;
-  }
-])],
+    #include <stdlib.h>  /* for arc4random_buf on BSD, for NULL */
+    #if defined(HAVE_LIBBSD)
+    # include <bsd/stdlib.h>
+    #endif
+    int main() {
+      arc4random_buf(NULL, 0U);
+      return 0;
+    }
+  ])],
   [AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], [Define to 1 if you have the `arc4random_buf' function.])
    AC_MSG_RESULT([yes])],
   [AC_MSG_RESULT([no])
 
    AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)])
    AC_LINK_IFELSE([AC_LANG_SOURCE([
-      #if defined(HAVE_LIBBSD)
-      # include <bsd/stdlib.h>
-      #else
-      # include <stdlib.h>
-      #endif
-      int main() {
+       #if defined(HAVE_LIBBSD)
+       # include <bsd/stdlib.h>
+       #else
+       # include <stdlib.h>
+       #endif
+       int main() {
           arc4random();
           return 0;
-      }
+       }
      ])],
      [AC_DEFINE([HAVE_ARC4RANDOM], [1], [Define to 1 if you have the `arc4random' function.])
       AC_MSG_RESULT([yes])],
      [AC_MSG_RESULT([no])])])
 
+AC_ARG_WITH([getrandom],
+  [AS_HELP_STRING([--with-getrandom],
+                  [enforce the use of getrandom function in the system @<:@default=check@:>@])
+AS_HELP_STRING([--without-getrandom],
+               [skip auto detect of getrandom @<:@default=check@:>@])],
+  [],
+  [with_getrandom=check])
 
-AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
-AC_LINK_IFELSE([AC_LANG_SOURCE([
-  #include <stdlib.h>  /* for NULL */
-  #include <sys/random.h>
-  int main() {
-    return getrandom(NULL, 0U, 0U);
-  }
-  ])],
-  [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
-   AC_MSG_RESULT([yes])],
-  [AC_MSG_RESULT([no])
+AS_IF([test "x$with_getrandom" != xno],
+  [AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
+   AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <stdlib.h>  /* for NULL */
+       #include <sys/random.h>
+       int main() {
+         return getrandom(NULL, 0U, 0U);
+       }
+     ])],
+     [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
+      AC_MSG_RESULT([yes])],
+     [AC_MSG_RESULT([no])
+      AS_IF([test "x$with_getrandom" = xyes],
+        [AC_MSG_ERROR([enforced the use of getrandom --with-getrandom, but not detected])])])])
+
+AC_ARG_WITH([sys_getrandom],
+  [AS_HELP_STRING([--with-sys-getrandom],
+                  [enforce the use of syscall SYS_getrandom function in the system @<:@default=check@:>@])
+AS_HELP_STRING([--without-sys-getrandom],
+               [skip auto detect of syscall SYS_getrandom @<:@default=check@:>@])],
+  [],
+  [with_sys_getrandom=check])
 
-   AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
+AS_IF([test "x$with_sys_getrandom" != xno],
+  [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)])
    AC_LINK_IFELSE([AC_LANG_SOURCE([
-      #include <stdlib.h>  /* for NULL */
-      #include <unistd.h>  /* for syscall */
-      #include <sys/syscall.h>  /* for SYS_getrandom */
-      int main() {
-        syscall(SYS_getrandom, NULL, 0, 0);
-        return 0;
-      }
+       #include <stdlib.h>  /* for NULL */
+       #include <unistd.h>  /* for syscall */
+       #include <sys/syscall.h>  /* for SYS_getrandom */
+       int main() {
+         syscall(SYS_getrandom, NULL, 0, 0);
+         return 0;
+     }
    ])],
-   [AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.])
-    AC_MSG_RESULT([yes])],
-   [AC_MSG_RESULT([no])])])
-
+     [AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], [Define to 1 if you have `syscall' and `SYS_getrandom'.])
+      AC_MSG_RESULT([yes])],
+     [AC_MSG_RESULT([no])
+      AS_IF([test "x$with_sys_getrandom" = xyes],
+        [AC_MSG_ERROR([enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected])])])])
 
 dnl Only needed for xmlwf:
 AC_CHECK_HEADERS(fcntl.h unistd.h)
@@ -222,6 +260,15 @@ AC_DEFINE([XML_DTD], 1,
 AC_DEFINE([XML_DEV_URANDOM], 1,
           [Define to include code reading entropy from `/dev/urandom'.])
 
+AC_ARG_ENABLE([xml-attr-info],
+  [AS_HELP_STRING([--enable-xml-attr-info],
+     [Enable retrieving the byte offsets for attribute names and values @<:@default=no@:>@])],
+  [],
+  [enable_xml_attr_info=no])
+AS_IF([test "x${enable_xml_attr_info}" = "xyes"],
+      [AC_DEFINE([XML_ATTR_INFO], 1,
+         [Define to allow retrieving the byte offsets for attribute names and values.])])
+
 AC_ARG_ENABLE([xml-context],
   AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@],
     [Retain context around the current parse point;
@@ -240,8 +287,9 @@ AC_ARG_WITH([docbook],
   [AS_HELP_STRING([--with-docbook],
                   [enforce XML to man page compilation @<:@default=check@:>@])
 AS_HELP_STRING([--without-docbook],
-               [skip XML to man page compilation @<:@default=check@:>@])], [],
-               [with_docbook=check])
+               [skip XML to man page compilation @<:@default=check@:>@])],
+  [],
+  [with_docbook=check])
 
 AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command])
 AS_IF([test "x$with_docbook" != xno],

+ 6 - 4
libs/expat/doc/reference.html

@@ -276,9 +276,11 @@ directions or Unix directions below.</p>
 
 <p>If you're using the GNU compiler under cygwin, follow the Unix
 directions in the next section. Otherwise if you have Microsoft's
-Developer Studio installed, then from Windows Explorer double-click on
-"expat.vcxproj" in the lib directory and build and install in the usual
-manner.</p>
+Developer Studio installed,
+you can use CMake to generate a <code>.sln</code> file, e.g.
+<code>
+cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo .
+</code>, and build Expat using <code>msbuild /m expat.sln</code> after.</p>
 
 <p>Alternatively, you may download the Win32 binary package that
 contains the "expat.h" include file and a pre-built DLL.</p>
@@ -2152,7 +2154,7 @@ function behavior. In order to have an effect this must be called
 before parsing has started. Returns 1 if successful, 0 when called
 after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
 <p><b>Note:</b>This call is optional, as the parser will auto-generate 
-a new random salt value if no value has been set at the start of parsing.
+a new random salt value if no value has been set at the start of parsing.</p>
 <p><b>Note:</b>One should not call <code>XML_SetHashSalt</code> with a
 hash salt value of 0, as this value is used as sentinel value to indicate
 that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently

+ 10 - 17
libs/expat/examples/elements.c

@@ -38,25 +38,20 @@
 #include <expat.h>
 
 #ifdef XML_LARGE_SIZE
-# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-#  define XML_FMT_INT_MOD "I64"
-# else
 #  define XML_FMT_INT_MOD "ll"
-# endif
 #else
-# define XML_FMT_INT_MOD "l"
+#  define XML_FMT_INT_MOD "l"
 #endif
 
 #ifdef XML_UNICODE_WCHAR_T
-# include <wchar.h>
-# define XML_FMT_STR "ls"
+#  include <wchar.h>
+#  define XML_FMT_STR "ls"
 #else
-# define XML_FMT_STR "s"
+#  define XML_FMT_STR "s"
 #endif
 
 static void XMLCALL
-startElement(void *userData, const XML_Char *name, const XML_Char **atts)
-{
+startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
   int i;
   int *depthPtr = (int *)userData;
   (void)atts;
@@ -68,8 +63,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts)
 }
 
 static void XMLCALL
-endElement(void *userData, const XML_Char *name)
-{
+endElement(void *userData, const XML_Char *name) {
   int *depthPtr = (int *)userData;
   (void)name;
 
@@ -77,8 +71,7 @@ endElement(void *userData, const XML_Char *name)
 }
 
 int
-main(int argc, char *argv[])
-{
+main(int argc, char *argv[]) {
   char buf[BUFSIZ];
   XML_Parser parser = XML_ParserCreate(NULL);
   int done;
@@ -92,13 +85,13 @@ main(int argc, char *argv[])
     size_t len = fread(buf, 1, sizeof(buf), stdin);
     done = len < sizeof(buf);
     if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) {
-      fprintf(stderr,
-              "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
+      fprintf(stderr, "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
               XML_ErrorString(XML_GetErrorCode(parser)),
               XML_GetCurrentLineNumber(parser));
+      XML_ParserFree(parser);
       return 1;
     }
-  } while (!done);
+  } while (! done);
   XML_ParserFree(parser);
   return 0;
 }

+ 0 - 140
libs/expat/examples/elements.vcxproj

@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{35262250-C85F-463A-9F6D-670088BFA17E}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release-elements\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug-elements\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release-elements\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release-elements\elements.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Release-elements\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release-elements\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Release\elements.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\elements.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Release\elements.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpatMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug-elements\</AssemblerListingLocation>
-      <BrowseInformation>true</BrowseInformation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug-elements\elements.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug-elements\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug-elements\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Debug\elements.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\elements.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Debug\elements.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpatMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="elements.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\lib\expat_static.vcxproj">
-      <Project>{58a821bc-e4af-4df4-9a54-2baa22b92615}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 22
libs/expat/examples/elements.vcxproj.filters

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{95d10a62-f554-4b10-a08b-cc74ba9fe102}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{21ef9308-545b-4d8d-8bde-012f925efa3a}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{ddac4f51-12d6-4e8f-817c-12c85eb1ffd2}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="elements.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

+ 7 - 14
libs/expat/examples/outline.c

@@ -36,30 +36,25 @@
 #include <expat.h>
 
 #ifdef XML_LARGE_SIZE
-# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-#  define XML_FMT_INT_MOD "I64"
-# else
 #  define XML_FMT_INT_MOD "ll"
-# endif
 #else
-# define XML_FMT_INT_MOD "l"
+#  define XML_FMT_INT_MOD "l"
 #endif
 
 #ifdef XML_UNICODE_WCHAR_T
-# define XML_FMT_STR "ls"
+#  define XML_FMT_STR "ls"
 #else
-# define XML_FMT_STR "s"
+#  define XML_FMT_STR "s"
 #endif
 
-#define BUFFSIZE        8192
+#define BUFFSIZE 8192
 
 char Buff[BUFFSIZE];
 
 int Depth;
 
 static void XMLCALL
-start(void *data, const XML_Char *el, const XML_Char **attr)
-{
+start(void *data, const XML_Char *el, const XML_Char **attr) {
   int i;
   (void)data;
 
@@ -77,8 +72,7 @@ start(void *data, const XML_Char *el, const XML_Char **attr)
 }
 
 static void XMLCALL
-end(void *data, const XML_Char *el)
-{
+end(void *data, const XML_Char *el) {
   (void)data;
   (void)el;
 
@@ -86,8 +80,7 @@ end(void *data, const XML_Char *el)
 }
 
 int
-main(int argc, char *argv[])
-{
+main(int argc, char *argv[]) {
   XML_Parser p = XML_ParserCreate(NULL);
   (void)argc;
   (void)argv;

+ 0 - 151
libs/expat/examples/outline.vcxproj

@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug-outline\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release-outline\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <MinimalRebuild>true</MinimalRebuild>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug-outline\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug-outline\outline.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug-outline\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug-outline\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Debug\outline.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\outline.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Debug\outline.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release-outline\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release-outline\outline.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Release-outline\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release-outline\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Release\outline.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\outline.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Release\outline.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="outline.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\lib\expat.vcxproj">
-      <Project>{45a5074d-66e8-44a4-a03f-018027b528d6}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 22
libs/expat/examples/outline.vcxproj.filters

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{48092a1f-486d-4bd8-a9ea-d087423ab371}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{d9494f7e-987c-467b-a3e0-ea577aea229d}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{7e3cfca9-158f-4e78-be6c-02d599fd9254}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="outline.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

+ 0 - 73
libs/expat/expat.sln

@@ -1,73 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elements", "examples\elements.vcxproj", "{35262250-C85F-463A-9F6D-670088BFA17E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat", "lib\expat.vcxproj", "{45A5074D-66E8-44A4-A03F-018027B528D6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat_static", "lib\expat_static.vcxproj", "{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expatw", "lib\expatw.vcxproj", "{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expatw_static", "lib\expatw_static.vcxproj", "{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "outline", "examples\outline.vcxproj", "{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlwf", "xmlwf\xmlwf.vcxproj", "{E3C5991F-5238-4168-A179-275D1AC98D7E}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-		Template|Win32 = Template|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Debug|Win32.Build.0 = Debug|Win32
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Release|Win32.ActiveCfg = Release|Win32
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Release|Win32.Build.0 = Release|Win32
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Template|Win32.ActiveCfg = Release|Win32
-		{35262250-C85F-463A-9F6D-670088BFA17E}.Template|Win32.Build.0 = Release|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Debug|Win32.Build.0 = Debug|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Release|Win32.ActiveCfg = Release|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Release|Win32.Build.0 = Release|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Template|Win32.ActiveCfg = Template|Win32
-		{45A5074D-66E8-44A4-A03F-018027B528D6}.Template|Win32.Build.0 = Template|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Debug|Win32.ActiveCfg = Debug|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Debug|Win32.Build.0 = Debug|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Release|Win32.ActiveCfg = Release|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Release|Win32.Build.0 = Release|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Template|Win32.ActiveCfg = Template|Win32
-		{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}.Template|Win32.Build.0 = Template|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Debug|Win32.Build.0 = Debug|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Release|Win32.ActiveCfg = Release|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Release|Win32.Build.0 = Release|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Template|Win32.ActiveCfg = Template|Win32
-		{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}.Template|Win32.Build.0 = Template|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Debug|Win32.Build.0 = Debug|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Release|Win32.ActiveCfg = Release|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Release|Win32.Build.0 = Release|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Template|Win32.ActiveCfg = Template|Win32
-		{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}.Template|Win32.Build.0 = Template|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Debug|Win32.Build.0 = Debug|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Release|Win32.ActiveCfg = Release|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Release|Win32.Build.0 = Release|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Template|Win32.ActiveCfg = Template|Win32
-		{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}.Template|Win32.Build.0 = Template|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Debug|Win32.Build.0 = Debug|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Release|Win32.ActiveCfg = Release|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Release|Win32.Build.0 = Release|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Template|Win32.ActiveCfg = Template|Win32
-		{E3C5991F-5238-4168-A179-275D1AC98D7E}.Template|Win32.Build.0 = Template|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 8 - 4
libs/expat/expat_config.h

@@ -50,7 +50,7 @@
 #define HAVE_STRING_H 1
 
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
-/* #undef HAVE_SYSCALL_GETRANDOM */
+#define HAVE_SYSCALL_GETRANDOM 1
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
@@ -77,7 +77,7 @@
 #define PACKAGE_NAME "expat"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.2.7"
+#define PACKAGE_STRING "expat 2.2.8"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "expat"
@@ -86,13 +86,13 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.2.7"
+#define PACKAGE_VERSION "2.2.8"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "2.2.7"
+#define VERSION "2.2.8"
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -106,6 +106,10 @@
 # endif
 #endif
 
+/* Define to allow retrieving the byte offsets for attribute names and values.
+   */
+/* #undef XML_ATTR_INFO */
+
 /* Define to specify how much context to retain around the current parse
    point. */
 #define XML_CONTEXT_BYTES 1024

+ 115 - 111
libs/expat/expat_config.h.cmake

@@ -1,111 +1,115 @@
-/* expat_config.h.cmake.  Based upon generated expat_config.h.in.  */
-
-/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-#cmakedefine BYTEORDER @BYTEORDER@
-
-/* Define to 1 if you have the `arc4random' function. */
-#cmakedefine HAVE_ARC4RANDOM
-
-/* Define to 1 if you have the `arc4random_buf' function. */
-#cmakedefine HAVE_ARC4RANDOM_BUF
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#cmakedefine HAVE_FCNTL_H
-
-/* Define to 1 if you have the `getpagesize' function. */
-#cmakedefine HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrandom' function. */
-#cmakedefine HAVE_GETRANDOM
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `bsd' library (-lbsd). */
-#cmakedefine HAVE_LIBBSD
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#cmakedefine HAVE_MMAP
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
-/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
-#cmakedefine HAVE_SYSCALL_GETRANDOM
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H
-
-/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine STDC_HEADERS
-
-/* whether byteorder is bigendian */
-#cmakedefine WORDS_BIGENDIAN
-
-/* Define to specify how much context to retain around the current parse
-   point. */
-#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
-
-/* Define to make parameter entity parsing functionality available. */
-#cmakedefine XML_DTD
-
-/* Define to make XML Namespaces functionality available. */
-#cmakedefine XML_NS
-
-#if ! defined(_WIN32)
-/* Define to extract entropy from /dev/urandom. */
-#cmakedefine XML_DEV_URANDOM
-#endif
-
-/* Define to use UTF-16 chars (two bytes). */
-#cmakedefine XML_UNICODE
-
-/* Define to use wchar_t as UTF-16 char type instead of unsigned short. */
-#cmakedefine XML_UNICODE_WCHAR_T
-
-/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
-#ifdef _MSC_VER
-# define __func__ __FUNCTION__
-#endif
-
-/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine off_t @OFF_T@
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#cmakedefine size_t @SIZE_T@
+/* expat_config.h.cmake.  Based upon generated expat_config.h.in.  */
+
+/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+#cmakedefine BYTEORDER @BYTEORDER@
+
+/* Define to 1 if you have the `arc4random' function. */
+#cmakedefine HAVE_ARC4RANDOM
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+#cmakedefine HAVE_ARC4RANDOM_BUF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getpagesize' function. */
+#cmakedefine HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrandom' function. */
+#cmakedefine HAVE_GETRANDOM
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `bsd' library (-lbsd). */
+#cmakedefine HAVE_LIBBSD
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#cmakedefine HAVE_MMAP
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H
+
+/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
+#cmakedefine HAVE_SYSCALL_GETRANDOM
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H
+
+/* Name of package */
+#define PACKAGE "@PACKAGE_NAME@"
+
+/* Define to the address where bug reports for this package should be sent. */
+#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
+
+/* Define to the full name of this package. */
+#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
+
+/* Define to the full name and version of this package. */
+#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
+
+/* Define to the one symbol short name of this package. */
+#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine STDC_HEADERS
+
+/* whether byteorder is bigendian */
+#cmakedefine WORDS_BIGENDIAN
+
+/* Define to allow retrieving the byte offsets for attribute names and values.
+ */
+#cmakedefine XML_ATTR_INFO
+
+/* Define to specify how much context to retain around the current parse
+   point. */
+#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
+
+#if ! defined(_WIN32)
+/* Define to include code reading entropy from `/dev/urandom'. */
+  #cmakedefine XML_DEV_URANDOM
+#endif
+
+/* Define to make parameter entity parsing functionality available. */
+#cmakedefine XML_DTD
+
+/* Define to make XML Namespaces functionality available. */
+#cmakedefine XML_NS
+
+/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
+#ifdef _MSC_VER
+#  define __func__ __FUNCTION__
+#endif
+
+/* Define to `long' if <sys/types.h> does not define. */
+#cmakedefine off_t @OFF_T@
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#cmakedefine size_t @SIZE_T@

+ 4 - 0
libs/expat/expat_config.h.in

@@ -105,6 +105,10 @@
 # endif
 #endif
 
+/* Define to allow retrieving the byte offsets for attribute names and values.
+   */
+#undef XML_ATTR_INFO
+
 /* Define to specify how much context to retain around the current parse
    point. */
 #undef XML_CONTEXT_BYTES

+ 48 - 0
libs/expat/fix-xmltest-log.sh

@@ -0,0 +1,48 @@
+#! /usr/bin/env bash
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2019 Expat development team
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+set -e
+
+filename="${1:-tests/xmltest.log}"
+
+dos2unix "${filename}"
+
+tempfile="$(mktemp)"
+sed \
+        -e 's/^wine: Call .* msvcrt\.dll\._wperror, aborting$/ibm49i02.dtd: No such file or directory/' \
+        \
+        -e '/^wine: /d' \
+        -e '/^Application tried to create a window, but no driver could be loaded.$/d' \
+        -e '/^Make sure that your X server is running and that $DISPLAY is set correctly.$/d' \
+        -e '/^err:systray:initialize_systray Could not create tray window$/d' \
+        -e '/^In ibm\/invalid\/P49\/: Unhandled exception: unimplemented .\+/d' \
+        \
+        "${filename}" > "${tempfile}"
+mv "${tempfile}" "${filename}"

+ 0 - 1
libs/expat/lib/Makefile.am

@@ -40,7 +40,6 @@ libexpat_la_LDFLAGS = \
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
 
 libexpat_la_SOURCES = \
-    loadlibrary.c \
     xmlparse.c \
     xmltok.c \
     xmlrole.c

+ 4 - 10
libs/expat/lib/Makefile.in

@@ -173,8 +173,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
 	"$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libexpat_la_LIBADD =
-am_libexpat_la_OBJECTS = loadlibrary.lo xmlparse.lo xmltok.lo \
-	xmlrole.lo
+am_libexpat_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
 libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -198,8 +197,7 @@ am__v_at_1 =
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp
 am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = ./$(DEPDIR)/loadlibrary.Plo \
-	./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \
+am__depfiles_remade = ./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \
 	./$(DEPDIR)/xmltok.Plo
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -388,7 +386,6 @@ libexpat_la_LDFLAGS = \
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
 
 libexpat_la_SOURCES = \
-    loadlibrary.c \
     xmlparse.c \
     xmltok.c \
     xmlrole.c
@@ -495,7 +492,6 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadlibrary.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrole.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmltok.Plo@am__quote@ # am--include-marker
@@ -703,8 +699,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 	mostlyclean-am
 
 distclean: distclean-am
-		-rm -f ./$(DEPDIR)/loadlibrary.Plo
-	-rm -f ./$(DEPDIR)/xmlparse.Plo
+		-rm -f ./$(DEPDIR)/xmlparse.Plo
 	-rm -f ./$(DEPDIR)/xmlrole.Plo
 	-rm -f ./$(DEPDIR)/xmltok.Plo
 	-rm -f Makefile
@@ -753,8 +748,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-		-rm -f ./$(DEPDIR)/loadlibrary.Plo
-	-rm -f ./$(DEPDIR)/xmlparse.Plo
+		-rm -f ./$(DEPDIR)/xmlparse.Plo
 	-rm -f ./$(DEPDIR)/xmlrole.Plo
 	-rm -f ./$(DEPDIR)/xmltok.Plo
 	-rm -f Makefile

+ 31 - 31
libs/expat/lib/asciitab.h

@@ -31,34 +31,34 @@
 */
 
 /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
-/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
-/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
-/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
-/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
-/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
-/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
-/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
-/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
-/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
-/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
+    /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
+    /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
+    /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
+    /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
+    /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
+    /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
+    /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
+    /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
+    /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
+    /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
+    /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
+    /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
+    /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
+    /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
+    /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
+    /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
+    /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

+ 107 - 168
libs/expat/lib/expat.h

@@ -33,15 +33,6 @@
 #ifndef Expat_INCLUDED
 #define Expat_INCLUDED 1
 
-#ifdef __VMS
-/*      0        1         2         3      0        1         2         3
-        1234567890123456789012345678901     1234567890123456789012345678901 */
-#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler
-#define XML_SetUnparsedEntityDeclHandler    XML_SetUnparsedEntDeclHandler
-#define XML_SetStartNamespaceDeclHandler    XML_SetStartNamespcDeclHandler
-#define XML_SetExternalEntityRefHandlerArg  XML_SetExternalEntRefHandlerArg
-#endif
-
 #include <stdlib.h>
 #include "expat_external.h"
 
@@ -53,8 +44,8 @@ struct XML_ParserStruct;
 typedef struct XML_ParserStruct *XML_Parser;
 
 typedef unsigned char XML_Bool;
-#define XML_TRUE   ((XML_Bool) 1)
-#define XML_FALSE  ((XML_Bool) 0)
+#define XML_TRUE ((XML_Bool)1)
+#define XML_FALSE ((XML_Bool)0)
 
 /* The XML_Status enum gives the possible return values for several
    API functions.  The preprocessor #defines are included so this
@@ -164,25 +155,23 @@ enum XML_Content_Quant {
 typedef struct XML_cp XML_Content;
 
 struct XML_cp {
-  enum XML_Content_Type         type;
-  enum XML_Content_Quant        quant;
-  XML_Char *                    name;
-  unsigned int                  numchildren;
-  XML_Content *                 children;
+  enum XML_Content_Type type;
+  enum XML_Content_Quant quant;
+  XML_Char *name;
+  unsigned int numchildren;
+  XML_Content *children;
 };
 
-
 /* This is called for an element declaration. See above for
    description of the model argument. It's the caller's responsibility
    to free model when finished with it.
 */
-typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData,
-                                                const XML_Char *name,
-                                                XML_Content *model);
+typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
+                                              const XML_Char *name,
+                                              XML_Content *model);
 
 XMLPARSEAPI(void)
-XML_SetElementDeclHandler(XML_Parser parser,
-                          XML_ElementDeclHandler eldecl);
+XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl);
 
 /* The Attlist declaration handler is called for *each* attribute. So
    a single Attlist declaration with multiple attributes declared will
@@ -192,17 +181,12 @@ XML_SetElementDeclHandler(XML_Parser parser,
    value will be NULL in the case of "#REQUIRED". If "isrequired" is
    true and default is non-NULL, then this is a "#FIXED" default.
 */
-typedef void (XMLCALL *XML_AttlistDeclHandler) (
-                                    void            *userData,
-                                    const XML_Char  *elname,
-                                    const XML_Char  *attname,
-                                    const XML_Char  *att_type,
-                                    const XML_Char  *dflt,
-                                    int              isrequired);
+typedef void(XMLCALL *XML_AttlistDeclHandler)(
+    void *userData, const XML_Char *elname, const XML_Char *attname,
+    const XML_Char *att_type, const XML_Char *dflt, int isrequired);
 
 XMLPARSEAPI(void)
-XML_SetAttlistDeclHandler(XML_Parser parser,
-                          XML_AttlistDeclHandler attdecl);
+XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl);
 
 /* The XML declaration handler is called for *both* XML declarations
    and text declarations. The way to distinguish is that the version
@@ -212,15 +196,13 @@ XML_SetAttlistDeclHandler(XML_Parser parser,
    was no standalone parameter in the declaration, that it was given
    as no, or that it was given as yes.
 */
-typedef void (XMLCALL *XML_XmlDeclHandler) (void           *userData,
-                                            const XML_Char *version,
-                                            const XML_Char *encoding,
-                                            int             standalone);
+typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData,
+                                          const XML_Char *version,
+                                          const XML_Char *encoding,
+                                          int standalone);
 
 XMLPARSEAPI(void)
-XML_SetXmlDeclHandler(XML_Parser parser,
-                      XML_XmlDeclHandler xmldecl);
-
+XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl);
 
 typedef struct {
   void *(*malloc_fcn)(size_t size);
@@ -248,7 +230,6 @@ XML_ParserCreate(const XML_Char *encoding);
 XMLPARSEAPI(XML_Parser)
 XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
 
-
 /* Constructs a new parser using the memory management suite referred to
    by memsuite. If memsuite is NULL, then use the standard library memory
    suite. If namespaceSeparator is non-NULL it creates a parser with
@@ -278,31 +259,27 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
 /* atts is array of name/value pairs, terminated by 0;
    names and values are 0 terminated.
 */
-typedef void (XMLCALL *XML_StartElementHandler) (void *userData,
-                                                 const XML_Char *name,
-                                                 const XML_Char **atts);
-
-typedef void (XMLCALL *XML_EndElementHandler) (void *userData,
-                                               const XML_Char *name);
+typedef void(XMLCALL *XML_StartElementHandler)(void *userData,
+                                               const XML_Char *name,
+                                               const XML_Char **atts);
 
+typedef void(XMLCALL *XML_EndElementHandler)(void *userData,
+                                             const XML_Char *name);
 
 /* s is not 0 terminated. */
-typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData,
-                                                  const XML_Char *s,
-                                                  int len);
+typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData,
+                                                const XML_Char *s, int len);
 
 /* target and data are 0 terminated */
-typedef void (XMLCALL *XML_ProcessingInstructionHandler) (
-                                                void *userData,
-                                                const XML_Char *target,
-                                                const XML_Char *data);
+typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData,
+                                                        const XML_Char *target,
+                                                        const XML_Char *data);
 
 /* data is 0 terminated */
-typedef void (XMLCALL *XML_CommentHandler) (void *userData,
-                                            const XML_Char *data);
+typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data);
 
-typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData);
-typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData);
+typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData);
+typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData);
 
 /* This is called for any characters in the XML document for which
    there is no applicable handler.  This includes both characters that
@@ -317,25 +294,23 @@ typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData);
    default handler: for example, a comment might be split between
    multiple calls.
 */
-typedef void (XMLCALL *XML_DefaultHandler) (void *userData,
-                                            const XML_Char *s,
-                                            int len);
+typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s,
+                                          int len);
 
 /* This is called for the start of the DOCTYPE declaration, before
    any DTD or internal subset is parsed.
 */
-typedef void (XMLCALL *XML_StartDoctypeDeclHandler) (
-                                            void *userData,
-                                            const XML_Char *doctypeName,
-                                            const XML_Char *sysid,
-                                            const XML_Char *pubid,
-                                            int has_internal_subset);
+typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
+                                                   const XML_Char *doctypeName,
+                                                   const XML_Char *sysid,
+                                                   const XML_Char *pubid,
+                                                   int has_internal_subset);
 
 /* This is called for the start of the DOCTYPE declaration when the
    closing > is encountered, but after processing any external
    subset.
 */
-typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
+typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
 
 /* This is called for entity declarations. The is_parameter_entity
    argument will be non-zero if the entity is a parameter entity, zero
@@ -355,20 +330,14 @@ typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
    Note that is_parameter_entity can't be changed to XML_Bool, since
    that would break binary compatibility.
 */
-typedef void (XMLCALL *XML_EntityDeclHandler) (
-                              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);
+typedef void(XMLCALL *XML_EntityDeclHandler)(
+    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);
 
 XMLPARSEAPI(void)
-XML_SetEntityDeclHandler(XML_Parser parser,
-                         XML_EntityDeclHandler handler);
+XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler);
 
 /* OBSOLETE -- OBSOLETE -- OBSOLETE
    This handler has been superseded by the EntityDeclHandler above.
@@ -379,24 +348,20 @@ XML_SetEntityDeclHandler(XML_Parser parser,
    entityName, systemId and notationName arguments will never be
    NULL. The other arguments may be.
 */
-typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) (
-                                    void *userData,
-                                    const XML_Char *entityName,
-                                    const XML_Char *base,
-                                    const XML_Char *systemId,
-                                    const XML_Char *publicId,
-                                    const XML_Char *notationName);
+typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)(
+    void *userData, const XML_Char *entityName, const XML_Char *base,
+    const XML_Char *systemId, const XML_Char *publicId,
+    const XML_Char *notationName);
 
 /* This is called for a declaration of notation.  The base argument is
    whatever was set by XML_SetBase. The notationName will never be
    NULL.  The other arguments can be.
 */
-typedef void (XMLCALL *XML_NotationDeclHandler) (
-                                    void *userData,
-                                    const XML_Char *notationName,
-                                    const XML_Char *base,
-                                    const XML_Char *systemId,
-                                    const XML_Char *publicId);
+typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData,
+                                               const XML_Char *notationName,
+                                               const XML_Char *base,
+                                               const XML_Char *systemId,
+                                               const XML_Char *publicId);
 
 /* When namespace processing is enabled, these are called once for
    each namespace declaration. The call to the start and end element
@@ -404,14 +369,12 @@ typedef void (XMLCALL *XML_NotationDeclHandler) (
    declaration handlers. For an xmlns attribute, prefix will be
    NULL.  For an xmlns="" attribute, uri will be NULL.
 */
-typedef void (XMLCALL *XML_StartNamespaceDeclHandler) (
-                                    void *userData,
-                                    const XML_Char *prefix,
-                                    const XML_Char *uri);
+typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData,
+                                                     const XML_Char *prefix,
+                                                     const XML_Char *uri);
 
-typedef void (XMLCALL *XML_EndNamespaceDeclHandler) (
-                                    void *userData,
-                                    const XML_Char *prefix);
+typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData,
+                                                   const XML_Char *prefix);
 
 /* This is called if the document is not standalone, that is, it has an
    external subset or a reference to a parameter entity, but does not
@@ -422,7 +385,7 @@ typedef void (XMLCALL *XML_EndNamespaceDeclHandler) (
    conditions above this handler will only be called if the referenced
    entity was actually read.
 */
-typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData);
+typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData);
 
 /* This is called for a reference to an external parsed general
    entity.  The referenced entity is not automatically parsed.  The
@@ -458,12 +421,11 @@ typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData);
    Note that unlike other handlers the first argument is the parser,
    not userData.
 */
-typedef int (XMLCALL *XML_ExternalEntityRefHandler) (
-                                    XML_Parser parser,
-                                    const XML_Char *context,
-                                    const XML_Char *base,
-                                    const XML_Char *systemId,
-                                    const XML_Char *publicId);
+typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser,
+                                                   const XML_Char *context,
+                                                   const XML_Char *base,
+                                                   const XML_Char *systemId,
+                                                   const XML_Char *publicId);
 
 /* This is called in two situations:
    1) An entity reference is encountered for which no declaration
@@ -475,10 +437,9 @@ typedef int (XMLCALL *XML_ExternalEntityRefHandler) (
          the event would be out of sync with the reporting of the
          declarations or attribute values
 */
-typedef void (XMLCALL *XML_SkippedEntityHandler) (
-                                    void *userData,
-                                    const XML_Char *entityName,
-                                    int is_parameter_entity);
+typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData,
+                                                const XML_Char *entityName,
+                                                int is_parameter_entity);
 
 /* This structure is filled in by the XML_UnknownEncodingHandler to
    provide information to the parser about encodings that are unknown
@@ -535,8 +496,8 @@ typedef void (XMLCALL *XML_SkippedEntityHandler) (
 typedef struct {
   int map[256];
   void *data;
-  int (XMLCALL *convert)(void *data, const char *s);
-  void (XMLCALL *release)(void *data);
+  int(XMLCALL *convert)(void *data, const char *s);
+  void(XMLCALL *release)(void *data);
 } XML_Encoding;
 
 /* This is called for an encoding that is unknown to the parser.
@@ -554,23 +515,19 @@ typedef struct {
    If info does not describe a suitable encoding, then the parser will
    return an XML_UNKNOWN_ENCODING error.
 */
-typedef int (XMLCALL *XML_UnknownEncodingHandler) (
-                                    void *encodingHandlerData,
-                                    const XML_Char *name,
-                                    XML_Encoding *info);
+typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
+                                                 const XML_Char *name,
+                                                 XML_Encoding *info);
 
 XMLPARSEAPI(void)
-XML_SetElementHandler(XML_Parser parser,
-                      XML_StartElementHandler start,
+XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start,
                       XML_EndElementHandler end);
 
 XMLPARSEAPI(void)
-XML_SetStartElementHandler(XML_Parser parser,
-                           XML_StartElementHandler handler);
+XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler);
 
 XMLPARSEAPI(void)
-XML_SetEndElementHandler(XML_Parser parser,
-                         XML_EndElementHandler handler);
+XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler);
 
 XMLPARSEAPI(void)
 XML_SetCharacterDataHandler(XML_Parser parser,
@@ -580,8 +537,7 @@ XMLPARSEAPI(void)
 XML_SetProcessingInstructionHandler(XML_Parser parser,
                                     XML_ProcessingInstructionHandler handler);
 XMLPARSEAPI(void)
-XML_SetCommentHandler(XML_Parser parser,
-                      XML_CommentHandler handler);
+XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler);
 
 XMLPARSEAPI(void)
 XML_SetCdataSectionHandler(XML_Parser parser,
@@ -601,20 +557,17 @@ XML_SetEndCdataSectionHandler(XML_Parser parser,
    default handler, or to the skipped entity handler, if one is set.
 */
 XMLPARSEAPI(void)
-XML_SetDefaultHandler(XML_Parser parser,
-                      XML_DefaultHandler handler);
+XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler);
 
 /* This sets the default handler but does not inhibit expansion of
    internal entities.  The entity reference will not be passed to the
    default handler.
 */
 XMLPARSEAPI(void)
-XML_SetDefaultHandlerExpand(XML_Parser parser,
-                            XML_DefaultHandler handler);
+XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler);
 
 XMLPARSEAPI(void)
-XML_SetDoctypeDeclHandler(XML_Parser parser,
-                          XML_StartDoctypeDeclHandler start,
+XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start,
                           XML_EndDoctypeDeclHandler end);
 
 XMLPARSEAPI(void)
@@ -622,16 +575,14 @@ XML_SetStartDoctypeDeclHandler(XML_Parser parser,
                                XML_StartDoctypeDeclHandler start);
 
 XMLPARSEAPI(void)
-XML_SetEndDoctypeDeclHandler(XML_Parser parser,
-                             XML_EndDoctypeDeclHandler end);
+XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end);
 
 XMLPARSEAPI(void)
 XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
                                  XML_UnparsedEntityDeclHandler handler);
 
 XMLPARSEAPI(void)
-XML_SetNotationDeclHandler(XML_Parser parser,
-                           XML_NotationDeclHandler handler);
+XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler);
 
 XMLPARSEAPI(void)
 XML_SetNamespaceDeclHandler(XML_Parser parser,
@@ -659,8 +610,7 @@ XML_SetExternalEntityRefHandler(XML_Parser parser,
    instead of the parser object.
 */
 XMLPARSEAPI(void)
-XML_SetExternalEntityRefHandlerArg(XML_Parser parser,
-                                   void *arg);
+XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg);
 
 XMLPARSEAPI(void)
 XML_SetSkippedEntityHandler(XML_Parser parser,
@@ -740,7 +690,6 @@ XML_UseParserAsHandlerArg(XML_Parser parser);
 XMLPARSEAPI(enum XML_Error)
 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
 
-
 /* Sets the base to be used for resolving relative URIs in system
    identifiers in declarations.  Resolving relative identifiers is
    left to the application: this value will be passed through as the
@@ -780,10 +729,10 @@ XML_GetIdAttributeIndex(XML_Parser parser);
    info->valueEnd - info->valueStart = 4 bytes.
 */
 typedef struct {
-  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
-  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
-  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
-  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
+  XML_Index nameStart;  /* Offset to beginning of the attribute name. */
+  XML_Index nameEnd;    /* Offset after the attribute name's last byte. */
+  XML_Index valueStart; /* Offset to beginning of the attribute value. */
+  XML_Index valueEnd;   /* Offset after the attribute value's last byte. */
 } XML_AttrInfo;
 
 /* Returns an array of XML_AttrInfo structures for the attribute/value pairs
@@ -819,20 +768,20 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
    (resumable = 0) an already suspended parser. Some call-backs may
    still follow because they would otherwise get lost. Examples:
    - endElementHandler() for empty elements when stopped in
-     startElementHandler(), 
-   - endNameSpaceDeclHandler() when stopped in endElementHandler(), 
+     startElementHandler(),
+   - endNameSpaceDeclHandler() when stopped in endElementHandler(),
    and possibly others.
 
    Can be called from most handlers, including DTD related call-backs,
    except when parsing an external parameter entity and resumable != 0.
    Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
-   Possible error codes: 
+   Possible error codes:
    - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
    - XML_ERROR_FINISHED: when the parser has already finished.
    - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
 
-   When resumable != 0 (true) then parsing is suspended, that is, 
-   XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. 
+   When resumable != 0 (true) then parsing is suspended, that is,
+   XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
    Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
    return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
 
@@ -843,7 +792,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
    the externalEntityRefHandler() to call XML_StopParser() on the parent
    parser (recursively), if one wants to stop parsing altogether.
 
-   When suspended, parsing can be resumed by calling XML_ResumeParser(). 
+   When suspended, parsing can be resumed by calling XML_ResumeParser().
 */
 XMLPARSEAPI(enum XML_Status)
 XML_StopParser(XML_Parser parser, XML_Bool resumable);
@@ -851,7 +800,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable);
 /* Resumes parsing after it has been suspended with XML_StopParser().
    Must not be called from within a handler call-back. Returns same
    status codes as XML_Parse() or XML_ParseBuffer().
-   Additional error code XML_ERROR_NOT_SUSPENDED possible.   
+   Additional error code XML_ERROR_NOT_SUSPENDED possible.
 
    *Note*:
    This must be called on the most deeply nested child parser instance
@@ -863,12 +812,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable);
 XMLPARSEAPI(enum XML_Status)
 XML_ResumeParser(XML_Parser parser);
 
-enum XML_Parsing {
-  XML_INITIALIZED,
-  XML_PARSING,
-  XML_FINISHED,
-  XML_SUSPENDED
-};
+enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED };
 
 typedef struct {
   enum XML_Parsing parsing;
@@ -900,8 +844,7 @@ XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
    Otherwise returns a new XML_Parser object.
 */
 XMLPARSEAPI(XML_Parser)
-XML_ExternalEntityParserCreate(XML_Parser parser,
-                               const XML_Char *context,
+XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context,
                                const XML_Char *encoding);
 
 enum XML_ParamEntityParsing {
@@ -945,8 +888,7 @@ XML_SetParamEntityParsing(XML_Parser parser,
    Note: If parser == NULL, the function will do nothing and return 0.
 */
 XMLPARSEAPI(int)
-XML_SetHashSalt(XML_Parser parser,
-                unsigned long hash_salt);
+XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt);
 
 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
    XML_GetErrorCode returns information about the error.
@@ -963,7 +905,7 @@ XML_GetErrorCode(XML_Parser parser);
    be within the relevant markup.  When called outside of the callback
    functions, the position indicated will be just past the last parse
    event (regardless of whether there was an associated callback).
-   
+
    They may also be called after returning from a call to XML_Parse
    or XML_ParseBuffer.  If the return value is XML_STATUS_ERROR then
    the location is the location of the character at which the error
@@ -995,14 +937,12 @@ XML_GetCurrentByteCount(XML_Parser parser);
    the handler that makes the call.
 */
 XMLPARSEAPI(const char *)
-XML_GetInputContext(XML_Parser parser,
-                    int *offset,
-                    int *size);
+XML_GetInputContext(XML_Parser parser, int *offset, int *size);
 
 /* For backwards compatibility with previous versions. */
-#define XML_GetErrorLineNumber   XML_GetCurrentLineNumber
+#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
 #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
-#define XML_GetErrorByteIndex    XML_GetCurrentByteIndex
+#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
 
 /* Frees the content model passed to the element declaration handler */
 XMLPARSEAPI(void)
@@ -1062,21 +1002,20 @@ enum XML_FeatureEnum {
 };
 
 typedef struct {
-  enum XML_FeatureEnum  feature;
-  const XML_LChar       *name;
-  long int              value;
+  enum XML_FeatureEnum feature;
+  const XML_LChar *name;
+  long int value;
 } XML_Feature;
 
 XMLPARSEAPI(const XML_Feature *)
 XML_GetFeatureList(void);
 
-
 /* Expat follows the semantic versioning convention.
    See http://semver.org.
 */
 #define XML_MAJOR_VERSION 2
 #define XML_MINOR_VERSION 2
-#define XML_MICRO_VERSION 7
+#define XML_MICRO_VERSION 8
 
 #ifdef __cplusplus
 }

+ 0 - 179
libs/expat/lib/expat.vcxproj

@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{45A5074D-66E8-44A4-A03F-018027B528D6}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug\</AssemblerListingLocation>
-      <BrowseInformation>true</BrowseInformation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug\expat.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <TypeLibraryName>.\..\win32\bin\Debug\expat.tlb</TypeLibraryName>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\expat.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <LinkDLL>true</LinkDLL>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Debug\libexpat.dll</OutputFile>
-      <ImportLibrary>.\..\win32\bin\Debug\libexpat.lib</ImportLibrary>
-      <ModuleDefinitionFile>.\libexpat.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release\expat.pch</PrecompiledHeaderOutputFile>
-      <PrecompiledHeader />
-      <ObjectFileName>.\..\win32\tmp\Release\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <TypeLibraryName>.\..\win32\bin\Release\expat.tlb</TypeLibraryName>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\expat.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <LinkDLL>true</LinkDLL>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Release\libexpat.dll</OutputFile>
-      <ImportLibrary>.\..\win32\bin\Release\libexpat.lib</ImportLibrary>
-      <ModuleDefinitionFile>.\libexpat.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="libexpat.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c" />
-    <ClCompile Include="xmlparse.c">
-      <ExceptionHandling Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </ExceptionHandling>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c" />
-    <ClCompile Include="xmltok.c" />
-    <ClCompile Include="xmltok_impl.c" />
-    <ClCompile Include="xmltok_ns.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h" />
-    <ClInclude Include="asciitab.h" />
-    <ClInclude Include="expat.h" />
-    <ClInclude Include="expat_external.h" />
-    <ClInclude Include="iasciitab.h" />
-    <ClInclude Include="internal.h" />
-    <ClInclude Include="latin1tab.h" />
-    <ClInclude Include="nametab.h" />
-    <ClInclude Include="siphash.h" />
-    <ClInclude Include="utf8tab.h" />
-    <ClInclude Include="xmlrole.h" />
-    <ClInclude Include="xmltok.h" />
-    <ClInclude Include="xmltok_impl.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 83
libs/expat/lib/expat.vcxproj.filters

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{f01bb743-0ef8-4601-bc44-378fc0abe768}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{c22177dc-5748-4bb1-816e-df311093bf72}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{41146e15-3129-4e5e-bb0f-6b78bb4701b9}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlparse.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_impl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_ns.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="asciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat_external.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="iasciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="internal.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="latin1tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="nametab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="siphash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="utf8tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmlrole.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok_impl.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="libexpat.def">
-      <Filter>Source Files</Filter>
-    </CustomBuild>
-  </ItemGroup>
-</Project>

+ 40 - 48
libs/expat/lib/expat_external.h

@@ -35,10 +35,6 @@
 
 /* External API definitions */
 
-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
-# define XML_USE_MSC_EXTENSIONS 1
-#endif
-
 /* Expat tries very hard to make the API boundary very specifically
    defined.  There are two macros defined to control this boundary;
    each of these can be defined before including this header to
@@ -62,11 +58,11 @@
    system headers may assume the cdecl convention.
 */
 #ifndef XMLCALL
-# if defined(_MSC_VER)
-#  define XMLCALL __cdecl
-# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
-#  define XMLCALL __attribute__((cdecl))
-# else
+#  if defined(_MSC_VER)
+#    define XMLCALL __cdecl
+#  elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
+#    define XMLCALL __attribute__((cdecl))
+#  else
 /* For any platform which uses this definition and supports more than
    one calling convention, we need to extend this definition to
    declare the convention used on that platform, if it's possible to
@@ -77,45 +73,46 @@
    pre-processor and how to specify the same calling convention as the
    platform's malloc() implementation.
 */
-#  define XMLCALL
-# endif
-#endif  /* not defined XMLCALL */
-
+#    define XMLCALL
+#  endif
+#endif /* not defined XMLCALL */
 
-#if !defined(XML_STATIC) && !defined(XMLIMPORT)
-# ifndef XML_BUILDING_EXPAT
+#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
+#  ifndef XML_BUILDING_EXPAT
 /* using Expat from an application */
 
-#  ifdef XML_USE_MSC_EXTENSIONS
-#   define XMLIMPORT __declspec(dllimport)
-#  endif
+#    if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
+#      define XMLIMPORT __declspec(dllimport)
+#    endif
 
-# endif
-#endif  /* not defined XML_STATIC */
+#  endif
+#endif /* not defined XML_STATIC */
 
 #ifndef XML_ENABLE_VISIBILITY
-# define XML_ENABLE_VISIBILITY 0
+#  define XML_ENABLE_VISIBILITY 0
 #endif
 
-#if !defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
-# define XMLIMPORT __attribute__ ((visibility ("default")))
+#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
+#  define XMLIMPORT __attribute__((visibility("default")))
 #endif
 
 /* If we didn't define it above, define it away: */
 #ifndef XMLIMPORT
-# define XMLIMPORT
+#  define XMLIMPORT
 #endif
 
-#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
-# define XML_ATTR_MALLOC __attribute__((__malloc__))
+#if defined(__GNUC__)                                                          \
+    && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
+#  define XML_ATTR_MALLOC __attribute__((__malloc__))
 #else
-# define XML_ATTR_MALLOC
+#  define XML_ATTR_MALLOC
 #endif
 
-#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-# define XML_ATTR_ALLOC_SIZE(x)  __attribute__((__alloc_size__(x)))
+#if defined(__GNUC__)                                                          \
+    && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+#  define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
 #else
-# define XML_ATTR_ALLOC_SIZE(x)
+#  define XML_ATTR_ALLOC_SIZE(x)
 #endif
 
 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
@@ -125,35 +122,30 @@ extern "C" {
 #endif
 
 #ifdef XML_UNICODE_WCHAR_T
-# ifndef XML_UNICODE
-#  define XML_UNICODE
-# endif
-# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
-#  error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
-# endif
+#  ifndef XML_UNICODE
+#    define XML_UNICODE
+#  endif
+#  if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
+#    error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
+#  endif
 #endif
 
-#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
-# ifdef XML_UNICODE_WCHAR_T
+#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
+#  ifdef XML_UNICODE_WCHAR_T
 typedef wchar_t XML_Char;
 typedef wchar_t XML_LChar;
-# else
+#  else
 typedef unsigned short XML_Char;
 typedef char XML_LChar;
-# endif /* XML_UNICODE_WCHAR_T */
-#else                  /* Information is UTF-8 encoded. */
+#  endif /* XML_UNICODE_WCHAR_T */
+#else    /* Information is UTF-8 encoded. */
 typedef char XML_Char;
 typedef char XML_LChar;
-#endif /* XML_UNICODE */
+#endif   /* XML_UNICODE */
 
-#ifdef XML_LARGE_SIZE  /* Use large integers for file/stream positions. */
-# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-typedef __int64 XML_Index; 
-typedef unsigned __int64 XML_Size;
-# else
+#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
 typedef long long XML_Index;
 typedef unsigned long long XML_Size;
-# endif
 #else
 typedef long XML_Index;
 typedef unsigned long XML_Size;

+ 0 - 149
libs/expat/lib/expat_static.vcxproj

@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release_static\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug_static\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <PreprocessorDefinitions>_WINDOWS;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release_static\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release_static\expat_static.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Release_static\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release_static\</ProgramDataBaseFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\expat_static.bsc</OutputFile>
-    </Bscmake>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>..\win32\bin\Release\libexpatMT.lib</OutputFile>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug_static\</AssemblerListingLocation>
-      <BrowseInformation>true</BrowseInformation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug_static\expat_static.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug_static\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug_static\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\expat_static.bsc</OutputFile>
-    </Bscmake>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>..\win32\bin\Debug\libexpatMT.lib</OutputFile>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c" />
-    <ClCompile Include="xmlparse.c" />
-    <ClCompile Include="xmlrole.c" />
-    <ClCompile Include="xmltok.c" />
-    <ClCompile Include="xmltok_impl.c" />
-    <ClCompile Include="xmltok_ns.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h" />
-    <ClInclude Include="asciitab.h" />
-    <ClInclude Include="expat.h" />
-    <ClInclude Include="expat_external.h" />
-    <ClInclude Include="iasciitab.h" />
-    <ClInclude Include="internal.h" />
-    <ClInclude Include="latin1tab.h" />
-    <ClInclude Include="nametab.h" />
-    <ClInclude Include="siphash.h" />
-    <ClInclude Include="utf8tab.h" />
-    <ClInclude Include="xmlrole.h" />
-    <ClInclude Include="xmltok.h" />
-    <ClInclude Include="xmltok_impl.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 74
libs/expat/lib/expat_static.vcxproj.filters

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{ef375f25-3490-4376-8deb-a8a8bebc0194}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{f1cd6f85-7111-4c1b-abad-37c79851ca34}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlparse.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_impl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_ns.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="asciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat_external.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="iasciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="internal.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="latin1tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="nametab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="siphash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="utf8tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmlrole.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok_impl.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>

+ 0 - 179
libs/expat/lib/expatw.vcxproj

@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release-w\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug-w\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;XML_UNICODE_WCHAR_T;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release-w\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release-w\expatw.pch</PrecompiledHeaderOutputFile>
-      <PrecompiledHeader />
-      <ObjectFileName>.\..\win32\tmp\Release-w\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release-w\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <TypeLibraryName>.\..\win32\bin\Release\expatw.tlb</TypeLibraryName>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\expatw.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <LinkDLL>true</LinkDLL>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Release\libexpatw.dll</OutputFile>
-      <ImportLibrary>.\..\win32\bin\Release\libexpatw.lib</ImportLibrary>
-      <ModuleDefinitionFile>.\libexpatw.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;XML_UNICODE_WCHAR_T;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug-w\</AssemblerListingLocation>
-      <BrowseInformation>true</BrowseInformation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug-w\expatw.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug-w\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug-w\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <TypeLibraryName>.\..\win32\bin\Debug\expatw.tlb</TypeLibraryName>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\expatw.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <LinkDLL>true</LinkDLL>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Debug\libexpatw.dll</OutputFile>
-      <ImportLibrary>.\..\win32\bin\Debug\libexpatw.lib</ImportLibrary>
-      <ModuleDefinitionFile>.\libexpatw.def</ModuleDefinitionFile>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CustomBuild Include="libexpatw.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c" />
-    <ClCompile Include="xmlparse.c">
-      <ExceptionHandling Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </ExceptionHandling>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c" />
-    <ClCompile Include="xmltok.c" />
-    <ClCompile Include="xmltok_impl.c" />
-    <ClCompile Include="xmltok_ns.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h" />
-    <ClInclude Include="asciitab.h" />
-    <ClInclude Include="expat.h" />
-    <ClInclude Include="expat_external.h" />
-    <ClInclude Include="iasciitab.h" />
-    <ClInclude Include="internal.h" />
-    <ClInclude Include="latin1tab.h" />
-    <ClInclude Include="nametab.h" />
-    <ClInclude Include="siphash.h" />
-    <ClInclude Include="utf8tab.h" />
-    <ClInclude Include="xmlrole.h" />
-    <ClInclude Include="xmltok.h" />
-    <ClInclude Include="xmltok_impl.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 83
libs/expat/lib/expatw.vcxproj.filters

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{fea8fd20-7d6d-4664-a821-1ab5a29dadbd}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{0ceb9aa0-672d-4a6b-bff9-345c51aab04c}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{d62ff6fc-7f74-443d-a048-31ef02a6f99f}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlparse.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_impl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_ns.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="asciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat_external.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="iasciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="internal.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="latin1tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="nametab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="siphash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="utf8tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmlrole.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok_impl.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="libexpatw.def">
-      <Filter>Source Files</Filter>
-    </CustomBuild>
-  </ItemGroup>
-</Project>

+ 0 - 149
libs/expat/lib/expatw_static.vcxproj

@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug-w_static\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release-w_static\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_LIB;XML_UNICODE_WCHAR_T;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug-w_static\</AssemblerListingLocation>
-      <BrowseInformation>true</BrowseInformation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug-w_static\expatw_static.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug-w_static\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug-w_static\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\expatw_static.bsc</OutputFile>
-    </Bscmake>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>..\win32\bin\Debug\libexpatwMT.lib</OutputFile>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <PreprocessorDefinitions>_WINDOWS;NDEBUG;_LIB;XML_UNICODE_WCHAR_T;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release-w_static\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release-w_static\expatw_static.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Release-w_static\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release-w_static\</ProgramDataBaseFileName>
-    </ClCompile>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\expatw_static.bsc</OutputFile>
-    </Bscmake>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>..\win32\bin\Release\libexpatwMT.lib</OutputFile>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c" />
-    <ClCompile Include="xmlparse.c" />
-    <ClCompile Include="xmlrole.c" />
-    <ClCompile Include="xmltok.c" />
-    <ClCompile Include="xmltok_impl.c" />
-    <ClCompile Include="xmltok_ns.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h" />
-    <ClInclude Include="asciitab.h" />
-    <ClInclude Include="expat.h" />
-    <ClInclude Include="expat_external.h" />
-    <ClInclude Include="iasciitab.h" />
-    <ClInclude Include="internal.h" />
-    <ClInclude Include="latin1tab.h" />
-    <ClInclude Include="nametab.h" />
-    <ClInclude Include="siphash.h" />
-    <ClInclude Include="utf8tab.h" />
-    <ClInclude Include="xmlrole.h" />
-    <ClInclude Include="xmltok.h" />
-    <ClInclude Include="xmltok_impl.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 74
libs/expat/lib/expatw_static.vcxproj.filters

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{c0226397-04be-42b5-ba75-257ac91ef7fa}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{3d74dc56-3aec-4ee9-b700-7203f44e015d}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="loadlibrary.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlparse.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlrole.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_impl.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmltok_ns.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="ascii.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="asciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="expat_external.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="iasciitab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="internal.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="latin1tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="nametab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="siphash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="utf8tab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmlrole.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltok_impl.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>

+ 31 - 31
libs/expat/lib/iasciitab.h

@@ -32,34 +32,34 @@
 
 /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
 /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
-/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
-/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
-/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
-/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
-/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
-/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
-/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
-/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
-/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
-/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
-/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
-/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
-/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
+    /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
+    /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
+    /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
+    /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
+    /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
+    /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
+    /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
+    /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
+    /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
+    /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
+    /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
+    /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
+    /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
+    /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
+    /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
+    /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
+    /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

+ 21 - 27
libs/expat/lib/internal.h

@@ -49,7 +49,7 @@
    USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
+#if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__)
 /* We'll use this version by default only where we know it helps.
 
    regparm() generates warnings on Solaris boxes.   See SF bug #692878.
@@ -59,8 +59,8 @@
    #define FASTCALL __attribute__((stdcall, regparm(3)))
    and let's try this:
 */
-#define FASTCALL __attribute__((regparm(3)))
-#define PTRFASTCALL __attribute__((regparm(3)))
+#  define FASTCALL __attribute__((regparm(3)))
+#  define PTRFASTCALL __attribute__((regparm(3)))
 #endif
 
 /* Using __fastcall seems to have an unexpected negative effect under
@@ -74,55 +74,49 @@
 /* Make sure all of these are defined if they aren't already. */
 
 #ifndef FASTCALL
-#define FASTCALL
+#  define FASTCALL
 #endif
 
 #ifndef PTRCALL
-#define PTRCALL
+#  define PTRCALL
 #endif
 
 #ifndef PTRFASTCALL
-#define PTRFASTCALL
+#  define PTRFASTCALL
 #endif
 
 #ifndef XML_MIN_SIZE
-#if !defined(__cplusplus) && !defined(inline)
-#ifdef __GNUC__
-#define inline __inline
-#endif /* __GNUC__ */
-#endif
+#  if ! defined(__cplusplus) && ! defined(inline)
+#    ifdef __GNUC__
+#      define inline __inline
+#    endif /* __GNUC__ */
+#  endif
 #endif /* XML_MIN_SIZE */
 
 #ifdef __cplusplus
-#define inline inline
+#  define inline inline
 #else
-#ifndef inline
-#define inline
-#endif
+#  ifndef inline
+#    define inline
+#  endif
 #endif
 
 #ifndef UNUSED_P
-# ifdef __GNUC__
-#  define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__))
-# else
-#  define UNUSED_P(p) UNUSED_ ## p
-# endif
+#  define UNUSED_P(p) (void)p
 #endif
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
 #ifdef XML_ENABLE_VISIBILITY
-#if XML_ENABLE_VISIBILITY
-__attribute__ ((visibility ("default")))
-#endif
+#  if XML_ENABLE_VISIBILITY
+__attribute__((visibility("default")))
+#  endif
 #endif
 void
-_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
-
+_INTERNAL_trim_to_complete_utf8_characters(const char *from,
+                                           const char **fromLimRef);
 
 #ifdef __cplusplus
 }

+ 31 - 31
libs/expat/lib/latin1tab.h

@@ -31,34 +31,34 @@
 */
 
 /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
-/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
-/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
-/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
-/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
-/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
+    /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
+    /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
+    /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
+    /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
+    /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
+    /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
+    /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,

+ 0 - 143
libs/expat/lib/loadlibrary.c

@@ -1,143 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) 2016 - 2017, Steve Holme, <[email protected]>.
- * Copyright (C) 2017, Expat development team
- *
- * All rights reserved.
- * Licensed under the MIT license:
- *
- * Permission to  use, copy,  modify, and distribute  this software  for any
- * purpose with  or without fee is  hereby granted, provided that  the above
- * copyright notice and this permission notice appear in all copies.
- *
- * 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 OF
- * THIRD PARTY RIGHTS. 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.
- *
- * Except as contained in this notice,  the name of a copyright holder shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings  in this  Software without  prior written  authorization of  the
- * copyright holder.
- *
- ***************************************************************************/
-
-#if defined(_WIN32)
-
-#include <windows.h>
-#include <tchar.h>
-
-
-HMODULE _Expat_LoadLibrary(LPCTSTR filename);
-
-
-#if !defined(LOAD_WITH_ALTERED_SEARCH_PATH)
-#define LOAD_WITH_ALTERED_SEARCH_PATH  0x00000008
-#endif
-
-#if !defined(LOAD_LIBRARY_SEARCH_SYSTEM32)
-#define LOAD_LIBRARY_SEARCH_SYSTEM32   0x00000800
-#endif
-
-/* We use our own typedef here since some headers might lack these */
-typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
-
-/* See function definitions in winbase.h */
-#ifdef UNICODE
-#  ifdef _WIN32_WCE
-#    define LOADLIBARYEX  L"LoadLibraryExW"
-#  else
-#    define LOADLIBARYEX  "LoadLibraryExW"
-#  endif
-#else
-#  define LOADLIBARYEX    "LoadLibraryExA"
-#endif
-
-
-/*
- * _Expat_LoadLibrary()
- *
- * This is used to dynamically load DLLs using the most secure method available
- * for the version of Windows that we are running on.
- *
- * Parameters:
- *
- * filename  [in] - The filename or full path of the DLL to load. If only the
- *                  filename is passed then the DLL will be loaded from the
- *                  Windows system directory.
- *
- * Returns the handle of the module on success; otherwise NULL.
- */
-HMODULE _Expat_LoadLibrary(LPCTSTR filename)
-{
-  HMODULE hModule = NULL;
-  LOADLIBRARYEX_FN pLoadLibraryEx = NULL;
-
-  /* Get a handle to kernel32 so we can access it's functions at runtime */
-  HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32"));
-  if(!hKernel32)
-    return NULL;  /* LCOV_EXCL_LINE */
-
-  /* Attempt to find LoadLibraryEx() which is only available on Windows 2000
-     and above */
-  pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBARYEX);
-
-  /* Detect if there's already a path in the filename and load the library if
-     there is. Note: Both back slashes and forward slashes have been supported
-     since the earlier days of DOS at an API level although they are not
-     supported by command prompt */
-  if(_tcspbrk(filename, TEXT("\\/"))) {
-    /** !checksrc! disable BANNEDFUNC 1 **/
-    hModule = pLoadLibraryEx ?
-      pLoadLibraryEx(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
-      LoadLibrary(filename);
-  }
-  /* Detect if KB2533623 is installed, as LOAD_LIBARY_SEARCH_SYSTEM32 is only
-     supported on Windows Vista, Windows Server 2008, Windows 7 and Windows
-     Server 2008 R2 with this patch or natively on Windows 8 and above */
-  else if(pLoadLibraryEx && GetProcAddress(hKernel32, "AddDllDirectory")) {
-    /* Load the DLL from the Windows system directory */
-    hModule = pLoadLibraryEx(filename, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
-  }
-  else {
-    /* Attempt to get the Windows system path */
-    UINT systemdirlen = GetSystemDirectory(NULL, 0);
-    if(systemdirlen) {
-      /* Allocate space for the full DLL path (Room for the null terminator
-         is included in systemdirlen) */
-      size_t filenamelen = _tcslen(filename);
-      TCHAR *path = malloc(sizeof(TCHAR) * (systemdirlen + 1 + filenamelen));
-      if(path && GetSystemDirectory(path, systemdirlen)) {
-        /* Calculate the full DLL path */
-        _tcscpy(path + _tcslen(path), TEXT("\\"));
-        _tcscpy(path + _tcslen(path), filename);
-
-        /* Load the DLL from the Windows system directory */
-        /** !checksrc! disable BANNEDFUNC 1 **/
-        hModule = pLoadLibraryEx ?
-          pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
-          LoadLibrary(path);
-
-      }
-      free(path);
-    }
-  }
-
-  return hModule;
-}
-
-#else /* defined(_WIN32) */
-
-/* ISO C requires a translation unit to contain at least one declaration
-   [-Wempty-translation-unit] */
-typedef int _TRANSLATION_UNIT_LOAD_LIBRARY_C_NOT_EMTPY;
-
-#endif /* defined(_WIN32) */

+ 98 - 144
libs/expat/lib/nametab.h

@@ -31,152 +31,106 @@
 */
 
 static const unsigned namingBitmap[] = {
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
-0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
-0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
-0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
-0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
-0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
-0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
-0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
-0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
-0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
-0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
-0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
-0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
-0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
-0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
-0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
-0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
-0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
-0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
-0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
-0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
-0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
-0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
-0x40000000, 0xF580C900, 0x00000007, 0x02010800,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
-0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
-0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
-0x00000000, 0x00004C40, 0x00000000, 0x00000000,
-0x00000007, 0x00000000, 0x00000000, 0x00000000,
-0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
-0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
-0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
-0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
-0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
-0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
-0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
-0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
-0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
-0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
-0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
-0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
-0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
-0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
-0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
-0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
-0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
-0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
-0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
-0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
-0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
-0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
-0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
-0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
-0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
-0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
-0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
-0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x00000000, 0x00000000,
-0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
-0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
-0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000,
+    0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
+    0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+    0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
+    0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
+    0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF,
+    0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
+    0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE,
+    0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
+    0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF,
+    0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
+    0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF,
+    0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
+    0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF,
+    0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF,
+    0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
+    0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+    0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000,
+    0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800,
+    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF,
+    0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
+    0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40,
+    0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000,
+    0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE,
+    0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
+    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
+    0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F,
+    0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
+    0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000,
+    0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
+    0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB,
+    0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
+    0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000,
+    0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
+    0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF,
+    0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
+    0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF,
+    0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
+    0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718,
+    0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
+    0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF,
+    0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+    0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE,
+    0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
+    0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
+    0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE,
+    0xFFFFFFFF, 0x77FFFFFF,
 };
 static const unsigned char nmstrtPages[] = {
-0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
-0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
-0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B,
+    0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
 };
 static const unsigned char namePages[] = {
-0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
-0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
-0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
-0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21,
+    0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
 };

+ 225 - 218
libs/expat/lib/siphash.h

@@ -11,6 +11,10 @@
  * --------------------------------------------------------------------------
  * HISTORY:
  *
+ * 2019-08-03  (Sebastian Pipping)
+ *   - Mark part of sip24_valid as to be excluded from clang-format
+ *   - Re-format code using clang-format 9
+ *
  * 2018-07-08  (Anton Maklakov)
  *   - Add "fall through" markers for GCC's -Wimplicit-fallthrough
  *
@@ -94,186 +98,186 @@
 #include <stddef.h> /* size_t */
 
 #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-  /* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
-  typedef unsigned __int8   uint8_t;
-  typedef unsigned __int32 uint32_t;
-  typedef unsigned __int64 uint64_t;
+/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
 #else
- #include <stdint.h> /* uint64_t uint32_t uint8_t */
+#  include <stdint.h> /* uint64_t uint32_t uint8_t */
 #endif
 
-
 /*
  * Workaround to not require a C++11 compiler for using ULL suffix
  * if this code is included and compiled as C++; related GCC warning is:
  * warning: use of C++11 long long integer constant [-Wlong-long]
  */
-#define _SIP_ULL(high, low)  (((uint64_t)high << 32) | low)
-
-
-#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b))))
+#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low)
 
-#define SIP_U32TO8_LE(p, v) \
-	(p)[0] = (uint8_t)((v) >>  0); (p)[1] = (uint8_t)((v) >>  8); \
-	(p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24);
+#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
 
-#define SIP_U64TO8_LE(p, v) \
-	SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >>  0)); \
-	SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
+#define SIP_U32TO8_LE(p, v)                                                    \
+  (p)[0] = (uint8_t)((v) >> 0);                                                \
+  (p)[1] = (uint8_t)((v) >> 8);                                                \
+  (p)[2] = (uint8_t)((v) >> 16);                                               \
+  (p)[3] = (uint8_t)((v) >> 24);
 
-#define SIP_U8TO64_LE(p) \
-	(((uint64_t)((p)[0]) <<  0) | \
-	 ((uint64_t)((p)[1]) <<  8) | \
-	 ((uint64_t)((p)[2]) << 16) | \
-	 ((uint64_t)((p)[3]) << 24) | \
-	 ((uint64_t)((p)[4]) << 32) | \
-	 ((uint64_t)((p)[5]) << 40) | \
-	 ((uint64_t)((p)[6]) << 48) | \
-	 ((uint64_t)((p)[7]) << 56))
+#define SIP_U64TO8_LE(p, v)                                                    \
+  SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0));                                \
+  SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
 
+#define SIP_U8TO64_LE(p)                                                       \
+  (((uint64_t)((p)[0]) << 0) | ((uint64_t)((p)[1]) << 8)                       \
+   | ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24)                   \
+   | ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40)                   \
+   | ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))
 
-#define SIPHASH_INITIALIZER { 0, 0, 0, 0, { 0 }, 0, 0 }
+#define SIPHASH_INITIALIZER                                                    \
+  { 0, 0, 0, 0, {0}, 0, 0 }
 
 struct siphash {
-	uint64_t v0, v1, v2, v3;
+  uint64_t v0, v1, v2, v3;
 
-	unsigned char buf[8], *p;
-	uint64_t c;
+  unsigned char buf[8], *p;
+  uint64_t c;
 }; /* struct siphash */
 
-
 #define SIP_KEYLEN 16
 
 struct sipkey {
-	uint64_t k[2];
+  uint64_t k[2];
 }; /* struct sipkey */
 
-#define sip_keyof(k) sip_tokey(&(struct sipkey){ { 0 } }, (k))
+#define sip_keyof(k) sip_tokey(&(struct sipkey){{0}}, (k))
 
-static struct sipkey *sip_tokey(struct sipkey *key, const void *src) {
-	key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
-	key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
-	return key;
+static struct sipkey *
+sip_tokey(struct sipkey *key, const void *src) {
+  key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
+  key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
+  return key;
 } /* sip_tokey() */
 
-
 #ifdef SIPHASH_TOBIN
 
-#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v))
+#  define sip_binof(v) sip_tobin((unsigned char[8]){0}, (v))
 
-static void *sip_tobin(void *dst, uint64_t u64) {
-	SIP_U64TO8_LE((unsigned char *)dst, u64);
-	return dst;
+static void *
+sip_tobin(void *dst, uint64_t u64) {
+  SIP_U64TO8_LE((unsigned char *)dst, u64);
+  return dst;
 } /* sip_tobin() */
 
-#endif  /* SIPHASH_TOBIN */
-
+#endif /* SIPHASH_TOBIN */
 
-static void sip_round(struct siphash *H, const int rounds) {
-	int i;
+static void
+sip_round(struct siphash *H, const int rounds) {
+  int i;
 
-	for (i = 0; i < rounds; i++) {
-		H->v0 += H->v1;
-		H->v1 = SIP_ROTL(H->v1, 13);
-		H->v1 ^= H->v0;
-		H->v0 = SIP_ROTL(H->v0, 32);
+  for (i = 0; i < rounds; i++) {
+    H->v0 += H->v1;
+    H->v1 = SIP_ROTL(H->v1, 13);
+    H->v1 ^= H->v0;
+    H->v0 = SIP_ROTL(H->v0, 32);
 
-		H->v2 += H->v3;
-		H->v3 = SIP_ROTL(H->v3, 16);
-		H->v3 ^= H->v2;
+    H->v2 += H->v3;
+    H->v3 = SIP_ROTL(H->v3, 16);
+    H->v3 ^= H->v2;
 
-		H->v0 += H->v3;
-		H->v3 = SIP_ROTL(H->v3, 21);
-		H->v3 ^= H->v0;
+    H->v0 += H->v3;
+    H->v3 = SIP_ROTL(H->v3, 21);
+    H->v3 ^= H->v0;
 
-		H->v2 += H->v1;
-		H->v1 = SIP_ROTL(H->v1, 17);
-		H->v1 ^= H->v2;
-		H->v2 = SIP_ROTL(H->v2, 32);
-	}
+    H->v2 += H->v1;
+    H->v1 = SIP_ROTL(H->v1, 17);
+    H->v1 ^= H->v2;
+    H->v2 = SIP_ROTL(H->v2, 32);
+  }
 } /* sip_round() */
 
+static struct siphash *
+sip24_init(struct siphash *H, const struct sipkey *key) {
+  H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
+  H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
+  H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
+  H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
 
-static struct siphash *sip24_init(struct siphash *H,
-		const struct sipkey *key) {
-	H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
-	H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
-	H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
-	H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
+  H->p = H->buf;
+  H->c = 0;
 
-	H->p = H->buf;
-	H->c = 0;
-
-	return H;
+  return H;
 } /* sip24_init() */
 
+#define sip_endof(a) (&(a)[sizeof(a) / sizeof *(a)])
 
-#define sip_endof(a) (&(a)[sizeof (a) / sizeof *(a)])
-
-static struct siphash *sip24_update(struct siphash *H, const void *src,
-		size_t len) {
-	const unsigned char *p = (const unsigned char *)src, *pe = p + len;
-	uint64_t m;
+static struct siphash *
+sip24_update(struct siphash *H, const void *src, size_t len) {
+  const unsigned char *p = (const unsigned char *)src, *pe = p + len;
+  uint64_t m;
 
-	do {
-		while (p < pe && H->p < sip_endof(H->buf))
-			*H->p++ = *p++;
+  do {
+    while (p < pe && H->p < sip_endof(H->buf))
+      *H->p++ = *p++;
 
-		if (H->p < sip_endof(H->buf))
-			break;
+    if (H->p < sip_endof(H->buf))
+      break;
 
-		m = SIP_U8TO64_LE(H->buf);
-		H->v3 ^= m;
-		sip_round(H, 2);
-		H->v0 ^= m;
+    m = SIP_U8TO64_LE(H->buf);
+    H->v3 ^= m;
+    sip_round(H, 2);
+    H->v0 ^= m;
 
-		H->p = H->buf;
-		H->c += 8;
-	} while (p < pe);
+    H->p = H->buf;
+    H->c += 8;
+  } while (p < pe);
 
-	return H;
+  return H;
 } /* sip24_update() */
 
-
-static uint64_t sip24_final(struct siphash *H) {
-	const char left = (char)(H->p - H->buf);
-	uint64_t b = (H->c + left) << 56;
-
-	switch (left) {
-	case 7: b |= (uint64_t)H->buf[6] << 48;
-		/* fall through */
-	case 6: b |= (uint64_t)H->buf[5] << 40;
-		/* fall through */
-	case 5: b |= (uint64_t)H->buf[4] << 32;
-		/* fall through */
-	case 4: b |= (uint64_t)H->buf[3] << 24;
-		/* fall through */
-	case 3: b |= (uint64_t)H->buf[2] << 16;
-		/* fall through */
-	case 2: b |= (uint64_t)H->buf[1] << 8;
-		/* fall through */
-	case 1: b |= (uint64_t)H->buf[0] << 0;
-		/* fall through */
-	case 0: break;
-	}
-
-	H->v3 ^= b;
-	sip_round(H, 2);
-	H->v0 ^= b;
-	H->v2 ^= 0xff;
-	sip_round(H, 4);
-
-	return H->v0 ^ H->v1 ^ H->v2  ^ H->v3;
+static uint64_t
+sip24_final(struct siphash *H) {
+  const char left = (char)(H->p - H->buf);
+  uint64_t b = (H->c + left) << 56;
+
+  switch (left) {
+  case 7:
+    b |= (uint64_t)H->buf[6] << 48;
+    /* fall through */
+  case 6:
+    b |= (uint64_t)H->buf[5] << 40;
+    /* fall through */
+  case 5:
+    b |= (uint64_t)H->buf[4] << 32;
+    /* fall through */
+  case 4:
+    b |= (uint64_t)H->buf[3] << 24;
+    /* fall through */
+  case 3:
+    b |= (uint64_t)H->buf[2] << 16;
+    /* fall through */
+  case 2:
+    b |= (uint64_t)H->buf[1] << 8;
+    /* fall through */
+  case 1:
+    b |= (uint64_t)H->buf[0] << 0;
+    /* fall through */
+  case 0:
+    break;
+  }
+
+  H->v3 ^= b;
+  sip_round(H, 2);
+  H->v0 ^= b;
+  H->v2 ^= 0xff;
+  sip_round(H, 4);
+
+  return H->v0 ^ H->v1 ^ H->v2 ^ H->v3;
 } /* sip24_final() */
 
-
-static uint64_t siphash24(const void *src, size_t len,
-		const struct sipkey *key) {
-	struct siphash state = SIPHASH_INITIALIZER;
-	return sip24_final(sip24_update(sip24_init(&state, key), src, len));
+static uint64_t
+siphash24(const void *src, size_t len, const struct sipkey *key) {
+  struct siphash state = SIPHASH_INITIALIZER;
+  return sip24_final(sip24_update(sip24_init(&state, key), src, len));
 } /* siphash24() */
 
-
 /*
  * SipHash-2-4 output with
  * k = 00 01 02 ...
@@ -285,107 +289,110 @@ static uint64_t siphash24(const void *src, size_t len,
  * ...
  * in = 00 01 02 ... 3e (63 bytes)
  */
-static int sip24_valid(void) {
-	static const unsigned char vectors[64][8] = {
-		{ 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
-		{ 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
-		{ 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
-		{ 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
-		{ 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
-		{ 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
-		{ 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
-		{ 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
-		{ 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
-		{ 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
-		{ 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
-		{ 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
-		{ 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
-		{ 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
-		{ 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
-		{ 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
-		{ 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
-		{ 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
-		{ 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
-		{ 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
-		{ 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
-		{ 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
-		{ 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
-		{ 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
-		{ 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
-		{ 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
-		{ 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
-		{ 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
-		{ 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
-		{ 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
-		{ 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
-		{ 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
-		{ 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
-		{ 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
-		{ 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
-		{ 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
-		{ 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
-		{ 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
-		{ 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
-		{ 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
-		{ 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
-		{ 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
-		{ 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
-		{ 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
-		{ 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
-		{ 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
-		{ 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
-		{ 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
-		{ 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
-		{ 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
-		{ 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
-		{ 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
-		{ 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
-		{ 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
-		{ 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
-		{ 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
-		{ 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
-		{ 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
-		{ 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
-		{ 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
-		{ 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
-		{ 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
-		{ 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
-		{ 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
-	};
-	unsigned char in[64];
-	struct sipkey k;
-	size_t i;
-
-	sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011"
-			"\012\013\014\015\016\017");
-
-	for (i = 0; i < sizeof in; ++i) {
-		in[i] = (unsigned char)i;
-
-		if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
-			return 0;
-	}
-
-	return 1;
+static int
+sip24_valid(void) {
+  /* clang-format off */
+  static const unsigned char vectors[64][8] = {
+    { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
+    { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
+    { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
+    { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
+    { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
+    { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
+    { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
+    { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
+    { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
+    { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
+    { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
+    { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
+    { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
+    { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
+    { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
+    { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
+    { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
+    { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
+    { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
+    { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
+    { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
+    { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
+    { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
+    { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
+    { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
+    { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
+    { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
+    { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
+    { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
+    { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
+    { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
+    { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
+    { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
+    { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
+    { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
+    { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
+    { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
+    { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
+    { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
+    { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
+    { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
+    { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
+    { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
+    { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
+    { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
+    { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
+    { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
+    { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
+    { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
+    { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
+    { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
+    { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
+    { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
+    { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
+    { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
+    { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
+    { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
+    { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
+    { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
+    { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
+    { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
+    { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
+    { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
+    { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
+  };
+  /* clang-format on */
+
+  unsigned char in[64];
+  struct sipkey k;
+  size_t i;
+
+  sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011"
+                "\012\013\014\015\016\017");
+
+  for (i = 0; i < sizeof in; ++i) {
+    in[i] = (unsigned char)i;
+
+    if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
+      return 0;
+  }
+
+  return 1;
 } /* sip24_valid() */
 
-
 #ifdef SIPHASH_MAIN
 
-#include <stdio.h>
+#  include <stdio.h>
 
-int main(void) {
-	const int ok = sip24_valid();
+int
+main(void) {
+  const int ok = sip24_valid();
 
-	if (ok)
-		puts("OK");
-	else
-		puts("FAIL");
+  if (ok)
+    puts("OK");
+  else
+    puts("FAIL");
 
-	return !ok;
+  return ! ok;
 } /* main() */
 
 #endif /* SIPHASH_MAIN */
 
-
 #endif /* SIPHASH_H */

+ 31 - 31
libs/expat/lib/utf8tab.h

@@ -31,34 +31,34 @@
 */
 
 /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
-/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
-/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
-/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
-/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
-/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
+    /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
+    /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
+    /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
+    /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
+    /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
+    /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
+    /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
+    /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
+    /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,

+ 7 - 10
libs/expat/lib/winconfig.h

@@ -40,20 +40,17 @@
 #include <memory.h>
 #include <string.h>
 
+#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */
+#  include <expat_config.h>
+#else /* !defined(HAVE_EXPAT_CONFIG_H) */
 
-#if defined(HAVE_EXPAT_CONFIG_H)  /* e.g. MinGW */
-# include <expat_config.h>
-#else  /* !defined(HAVE_EXPAT_CONFIG_H) */
-
-
-#define XML_NS 1
-#define XML_DTD 1
-#define XML_CONTEXT_BYTES 1024
+#  define XML_NS 1
+#  define XML_DTD 1
+#  define XML_CONTEXT_BYTES 1024
 
 /* we will assume all Windows platforms are little endian */
-#define BYTEORDER 1234
+#  define BYTEORDER 1234
 
 #endif /* !defined(HAVE_EXPAT_CONFIG_H) */
 
-
 #endif /* ndef WINCONFIG_H */

文件差异内容过多而无法显示
+ 285 - 329
libs/expat/lib/xmlparse.c


文件差异内容过多而无法显示
+ 256 - 382
libs/expat/lib/xmlrole.c


+ 5 - 8
libs/expat/lib/xmlrole.h

@@ -36,7 +36,7 @@
 #ifdef __VMS
 /*      0        1         2         3      0        1         2         3
         1234567890123456789012345678901     1234567890123456789012345678901 */
-#define XmlPrologStateInitExternalEntity    XmlPrologStateInitExternalEnt
+#  define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
 #endif
 
 #include "xmltok.h"
@@ -113,11 +113,8 @@ enum {
 };
 
 typedef struct prolog_state {
-  int (PTRCALL *handler) (struct prolog_state *state,
-                          int tok,
-                          const char *ptr,
-                          const char *end,
-                          const ENCODING *enc);
+  int(PTRCALL *handler)(struct prolog_state *state, int tok, const char *ptr,
+                        const char *end, const ENCODING *enc);
   unsigned level;
   int role_none;
 #ifdef XML_DTD
@@ -132,8 +129,8 @@ void XmlPrologStateInit(PROLOG_STATE *);
 void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
 #endif /* XML_DTD */
 
-#define XmlTokenRole(state, tok, ptr, end, enc) \
- (((state)->handler)(state, tok, ptr, end, enc))
+#define XmlTokenRole(state, tok, ptr, end, enc)                                \
+  (((state)->handler)(state, tok, ptr, end, enc))
 
 #ifdef __cplusplus
 }

文件差异内容过多而无法显示
+ 335 - 382
libs/expat/lib/xmltok.c


+ 91 - 121
libs/expat/lib/xmltok.h

@@ -38,16 +38,18 @@ extern "C" {
 #endif
 
 /* The following token may be returned by XmlContentTok */
-#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
-                                    start of illegal ]]> sequence */
+#define XML_TOK_TRAILING_RSQB                                                  \
+  -5 /* ] or ]] at the end of the scan; might be                               \
+        start of illegal ]]> sequence */
 /* The following tokens may be returned by both XmlPrologTok and
    XmlContentTok.
 */
-#define XML_TOK_NONE -4          /* The string to be scanned is empty */
-#define XML_TOK_TRAILING_CR -3   /* A CR at the end of the scan;
-                                    might be part of CRLF sequence */
-#define XML_TOK_PARTIAL_CHAR -2  /* only part of a multibyte sequence */
-#define XML_TOK_PARTIAL -1       /* only part of a token */
+#define XML_TOK_NONE -4 /* The string to be scanned is empty */
+#define XML_TOK_TRAILING_CR                                                    \
+  -3                            /* A CR at the end of the scan;                \
+                                   might be part of CRLF sequence */
+#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
+#define XML_TOK_PARTIAL -1      /* only part of a token */
 #define XML_TOK_INVALID 0
 
 /* The following tokens are returned by XmlContentTok; some are also
@@ -62,24 +64,24 @@ extern "C" {
 #define XML_TOK_DATA_NEWLINE 7
 #define XML_TOK_CDATA_SECT_OPEN 8
 #define XML_TOK_ENTITY_REF 9
-#define XML_TOK_CHAR_REF 10               /* numeric character reference */
+#define XML_TOK_CHAR_REF 10 /* numeric character reference */
 
 /* The following tokens may be returned by both XmlPrologTok and
    XmlContentTok.
 */
-#define XML_TOK_PI 11                     /* processing instruction */
-#define XML_TOK_XML_DECL 12               /* XML decl or text decl */
+#define XML_TOK_PI 11       /* processing instruction */
+#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
 #define XML_TOK_COMMENT 13
-#define XML_TOK_BOM 14                    /* Byte order mark */
+#define XML_TOK_BOM 14 /* Byte order mark */
 
 /* The following tokens are returned only by XmlPrologTok */
 #define XML_TOK_PROLOG_S 15
-#define XML_TOK_DECL_OPEN 16              /* <!foo */
-#define XML_TOK_DECL_CLOSE 17             /* > */
+#define XML_TOK_DECL_OPEN 16  /* <!foo */
+#define XML_TOK_DECL_CLOSE 17 /* > */
 #define XML_TOK_NAME 18
 #define XML_TOK_NMTOKEN 19
-#define XML_TOK_POUND_NAME 20             /* #name */
-#define XML_TOK_OR 21                     /* | */
+#define XML_TOK_POUND_NAME 20 /* #name */
+#define XML_TOK_OR 21         /* | */
 #define XML_TOK_PERCENT 22
 #define XML_TOK_OPEN_PAREN 23
 #define XML_TOK_CLOSE_PAREN 24
@@ -90,14 +92,14 @@ extern "C" {
 #define XML_TOK_INSTANCE_START 29
 
 /* The following occur only in element type declarations */
-#define XML_TOK_NAME_QUESTION 30          /* name? */
-#define XML_TOK_NAME_ASTERISK 31          /* name* */
-#define XML_TOK_NAME_PLUS 32              /* name+ */
-#define XML_TOK_COND_SECT_OPEN 33         /* <![ */
-#define XML_TOK_COND_SECT_CLOSE 34        /* ]]> */
-#define XML_TOK_CLOSE_PAREN_QUESTION 35   /* )? */
-#define XML_TOK_CLOSE_PAREN_ASTERISK 36   /* )* */
-#define XML_TOK_CLOSE_PAREN_PLUS 37       /* )+ */
+#define XML_TOK_NAME_QUESTION 30        /* name? */
+#define XML_TOK_NAME_ASTERISK 31        /* name* */
+#define XML_TOK_NAME_PLUS 32            /* name+ */
+#define XML_TOK_COND_SECT_OPEN 33       /* <![ */
+#define XML_TOK_COND_SECT_CLOSE 34      /* ]]> */
+#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
+#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
+#define XML_TOK_CLOSE_PAREN_PLUS 37     /* )+ */
 #define XML_TOK_COMMA 38
 
 /* The following token is returned only by XmlAttributeValueTok */
@@ -112,20 +114,20 @@ extern "C" {
 #define XML_TOK_PREFIXED_NAME 41
 
 #ifdef XML_DTD
-#define XML_TOK_IGNORE_SECT 42
+#  define XML_TOK_IGNORE_SECT 42
 #endif /* XML_DTD */
 
 #ifdef XML_DTD
-#define XML_N_STATES 4
+#  define XML_N_STATES 4
 #else /* not XML_DTD */
-#define XML_N_STATES 3
+#  define XML_N_STATES 3
 #endif /* not XML_DTD */
 
 #define XML_PROLOG_STATE 0
 #define XML_CONTENT_STATE 1
 #define XML_CDATA_SECTION_STATE 2
 #ifdef XML_DTD
-#define XML_IGNORE_SECTION_STATE 3
+#  define XML_IGNORE_SECTION_STATE 3
 #endif /* XML_DTD */
 
 #define XML_N_LITERAL_TYPES 2
@@ -153,52 +155,41 @@ typedef struct {
 struct encoding;
 typedef struct encoding ENCODING;
 
-typedef int (PTRCALL *SCANNER)(const ENCODING *,
-                               const char *,
-                               const char *,
-                               const char **);
+typedef int(PTRCALL *SCANNER)(const ENCODING *, const char *, const char *,
+                              const char **);
 
 enum XML_Convert_Result {
   XML_CONVERT_COMPLETED = 0,
   XML_CONVERT_INPUT_INCOMPLETE = 1,
-  XML_CONVERT_OUTPUT_EXHAUSTED = 2  /* and therefore potentially input remaining as well */
+  XML_CONVERT_OUTPUT_EXHAUSTED
+  = 2 /* and therefore potentially input remaining as well */
 };
 
 struct encoding {
   SCANNER scanners[XML_N_STATES];
   SCANNER literalScanners[XML_N_LITERAL_TYPES];
-  int (PTRCALL *nameMatchesAscii)(const ENCODING *,
-                                  const char *,
-                                  const char *,
-                                  const char *);
-  int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
+  int(PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *,
+                                 const char *);
+  int(PTRFASTCALL *nameLength)(const ENCODING *, const char *);
   const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
-  int (PTRCALL *getAtts)(const ENCODING *enc,
-                         const char *ptr,
-                         int attsMax,
-                         ATTRIBUTE *atts);
-  int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
-  int (PTRCALL *predefinedEntityName)(const ENCODING *,
-                                      const char *,
-                                      const char *);
-  void (PTRCALL *updatePosition)(const ENCODING *,
-                                 const char *ptr,
-                                 const char *end,
-                                 POSITION *);
-  int (PTRCALL *isPublicId)(const ENCODING *enc,
-                            const char *ptr,
-                            const char *end,
-                            const char **badPtr);
-  enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc,
-                              const char **fromP,
-                              const char *fromLim,
-                              char **toP,
-                              const char *toLim);
-  enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc,
-                               const char **fromP,
-                               const char *fromLim,
-                               unsigned short **toP,
-                               const unsigned short *toLim);
+  int(PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
+                        ATTRIBUTE *atts);
+  int(PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
+  int(PTRCALL *predefinedEntityName)(const ENCODING *, const char *,
+                                     const char *);
+  void(PTRCALL *updatePosition)(const ENCODING *, const char *ptr,
+                                const char *end, POSITION *);
+  int(PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr,
+                           const char *end, const char **badPtr);
+  enum XML_Convert_Result(PTRCALL *utf8Convert)(const ENCODING *enc,
+                                                const char **fromP,
+                                                const char *fromLim, char **toP,
+                                                const char *toLim);
+  enum XML_Convert_Result(PTRCALL *utf16Convert)(const ENCODING *enc,
+                                                 const char **fromP,
+                                                 const char *fromLim,
+                                                 unsigned short **toP,
+                                                 const unsigned short *toLim);
   int minBytesPerChar;
   char isUtf8;
   char isUtf16;
@@ -225,66 +216,62 @@ struct encoding {
    the prolog outside literals, comments and processing instructions.
 */
 
-
-#define XmlTok(enc, state, ptr, end, nextTokPtr) \
+#define XmlTok(enc, state, ptr, end, nextTokPtr)                               \
   (((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
 
-#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
-   XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
+#define XmlPrologTok(enc, ptr, end, nextTokPtr)                                \
+  XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
 
-#define XmlContentTok(enc, ptr, end, nextTokPtr) \
-   XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
+#define XmlContentTok(enc, ptr, end, nextTokPtr)                               \
+  XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
 
-#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
-   XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
+#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr)                          \
+  XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
 
 #ifdef XML_DTD
 
-#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
-   XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
+#  define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr)                       \
+    XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
 
 #endif /* XML_DTD */
 
 /* This is used for performing a 2nd-level tokenization on the content
    of a literal that has already been returned by XmlTok.
 */
-#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
+#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr)                  \
   (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
 
-#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
-   XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
+#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr)                        \
+  XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
 
-#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
-   XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
+#define XmlEntityValueTok(enc, ptr, end, nextTokPtr)                           \
+  XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
 
-#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
+#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2)                             \
   (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
 
-#define XmlNameLength(enc, ptr) \
-  (((enc)->nameLength)(enc, ptr))
+#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
 
-#define XmlSkipS(enc, ptr) \
-  (((enc)->skipS)(enc, ptr))
+#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
 
-#define XmlGetAttributes(enc, ptr, attsMax, atts) \
+#define XmlGetAttributes(enc, ptr, attsMax, atts)                              \
   (((enc)->getAtts)(enc, ptr, attsMax, atts))
 
-#define XmlCharRefNumber(enc, ptr) \
-  (((enc)->charRefNumber)(enc, ptr))
+#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
 
-#define XmlPredefinedEntityName(enc, ptr, end) \
+#define XmlPredefinedEntityName(enc, ptr, end)                                 \
   (((enc)->predefinedEntityName)(enc, ptr, end))
 
-#define XmlUpdatePosition(enc, ptr, end, pos) \
+#define XmlUpdatePosition(enc, ptr, end, pos)                                  \
   (((enc)->updatePosition)(enc, ptr, end, pos))
 
-#define XmlIsPublicId(enc, ptr, end, badPtr) \
+#define XmlIsPublicId(enc, ptr, end, badPtr)                                   \
   (((enc)->isPublicId)(enc, ptr, end, badPtr))
 
-#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
+#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim)                        \
   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
 
-#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
+#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim)                       \
   (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
 
 typedef struct {
@@ -292,16 +279,11 @@ typedef struct {
   const ENCODING **encPtr;
 } INIT_ENCODING;
 
-int XmlParseXmlDecl(int isGeneralTextEntity,
-                    const ENCODING *enc,
-                    const char *ptr,
-                    const char *end,
-                    const char **badPtr,
-                    const char **versionPtr,
-                    const char **versionEndPtr,
+int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
+                    const char *ptr, const char *end, const char **badPtr,
+                    const char **versionPtr, const char **versionEndPtr,
                     const char **encodingNamePtr,
-                    const ENCODING **namedEncodingPtr,
-                    int *standalonePtr);
+                    const ENCODING **namedEncodingPtr, int *standalonePtr);
 
 int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
 const ENCODING *XmlGetUtf8InternalEncoding(void);
@@ -310,34 +292,22 @@ int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
 int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
 int XmlSizeOfUnknownEncoding(void);
 
+typedef int(XMLCALL *CONVERTER)(void *userData, const char *p);
 
-typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
-
-ENCODING *
-XmlInitUnknownEncoding(void *mem,
-                       int *table,
-                       CONVERTER convert,
-                       void *userData);
+ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert,
+                                 void *userData);
 
-int XmlParseXmlDeclNS(int isGeneralTextEntity,
-                      const ENCODING *enc,
-                      const char *ptr,
-                      const char *end,
-                      const char **badPtr,
-                      const char **versionPtr,
-                      const char **versionEndPtr,
+int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
+                      const char *ptr, const char *end, const char **badPtr,
+                      const char **versionPtr, const char **versionEndPtr,
                       const char **encodingNamePtr,
-                      const ENCODING **namedEncodingPtr,
-                      int *standalonePtr);
+                      const ENCODING **namedEncodingPtr, int *standalonePtr);
 
 int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
 const ENCODING *XmlGetUtf8InternalEncodingNS(void);
 const ENCODING *XmlGetUtf16InternalEncodingNS(void);
-ENCODING *
-XmlInitUnknownEncodingNS(void *mem,
-                         int *table,
-                         CONVERTER convert,
-                         void *userData);
+ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
+                                   void *userData);
 #ifdef __cplusplus
 }
 #endif

文件差异内容过多而无法显示
+ 326 - 319
libs/expat/lib/xmltok_impl.c


+ 36 - 36
libs/expat/lib/xmltok_impl.h

@@ -31,43 +31,43 @@
 */
 
 enum {
-  BT_NONXML,
-  BT_MALFORM,
-  BT_LT,
-  BT_AMP,
-  BT_RSQB,
-  BT_LEAD2,
-  BT_LEAD3,
-  BT_LEAD4,
-  BT_TRAIL,
-  BT_CR,
-  BT_LF,
-  BT_GT,
-  BT_QUOT,
-  BT_APOS,
-  BT_EQUALS,
-  BT_QUEST,
-  BT_EXCL,
-  BT_SOL,
-  BT_SEMI,
-  BT_NUM,
-  BT_LSQB,
-  BT_S,
-  BT_NMSTRT,
-  BT_COLON,
-  BT_HEX,
-  BT_DIGIT,
-  BT_NAME,
-  BT_MINUS,
-  BT_OTHER, /* known not to be a name or name start character */
+  BT_NONXML,   /* e.g. noncharacter-FFFF */
+  BT_MALFORM,  /* illegal, with regard to encoding */
+  BT_LT,       /* less than = "<" */
+  BT_AMP,      /* ampersand = "&" */
+  BT_RSQB,     /* right square bracket = "[" */
+  BT_LEAD2,    /* lead byte of a 2-byte UTF-8 character */
+  BT_LEAD3,    /* lead byte of a 3-byte UTF-8 character */
+  BT_LEAD4,    /* lead byte of a 4-byte UTF-8 character */
+  BT_TRAIL,    /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */
+  BT_CR,       /* carriage return = "\r" */
+  BT_LF,       /* line feed = "\n" */
+  BT_GT,       /* greater than = ">" */
+  BT_QUOT,     /* quotation character = "\"" */
+  BT_APOS,     /* aposthrophe = "'" */
+  BT_EQUALS,   /* equal sign = "=" */
+  BT_QUEST,    /* question mark = "?" */
+  BT_EXCL,     /* exclamation mark = "!" */
+  BT_SOL,      /* solidus, slash = "/" */
+  BT_SEMI,     /* semicolon = ";" */
+  BT_NUM,      /* number sign = "#" */
+  BT_LSQB,     /* left square bracket = "[" */
+  BT_S,        /* white space, e.g. "\t", " "[, "\r"] */
+  BT_NMSTRT,   /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */
+  BT_COLON,    /* colon = ":" */
+  BT_HEX,      /* hex letter = "A".."F" + "a".."f" */
+  BT_DIGIT,    /* digit = "0".."9" */
+  BT_NAME,     /* dot and middle dot = "." + chr(0xb7) */
+  BT_MINUS,    /* minus = "-" */
+  BT_OTHER,    /* known not to be a name or name start character */
   BT_NONASCII, /* might be a name or name start character */
-  BT_PERCNT,
-  BT_LPAR,
-  BT_RPAR,
-  BT_AST,
-  BT_PLUS,
-  BT_COMMA,
-  BT_VERBAR
+  BT_PERCNT,   /* percent sign = "%" */
+  BT_LPAR,     /* left parenthesis = "(" */
+  BT_RPAR,     /* right parenthesis = "(" */
+  BT_AST,      /* asterisk = "*" */
+  BT_PLUS,     /* plus sign = "+" */
+  BT_COMMA,    /* comma = "," */
+  BT_VERBAR    /* vertical bar = "|" */
 };
 
 #include <stddef.h>

+ 30 - 54
libs/expat/lib/xmltok_ns.c

@@ -33,56 +33,47 @@
 #ifdef XML_TOK_NS_C
 
 const ENCODING *
-NS(XmlGetUtf8InternalEncoding)(void)
-{
+NS(XmlGetUtf8InternalEncoding)(void) {
   return &ns(internal_utf8_encoding).enc;
 }
 
 const ENCODING *
-NS(XmlGetUtf16InternalEncoding)(void)
-{
-#if BYTEORDER == 1234
+NS(XmlGetUtf16InternalEncoding)(void) {
+#  if BYTEORDER == 1234
   return &ns(internal_little2_encoding).enc;
-#elif BYTEORDER == 4321
+#  elif BYTEORDER == 4321
   return &ns(internal_big2_encoding).enc;
-#else
+#  else
   const short n = 1;
-  return (*(const char *)&n
-          ? &ns(internal_little2_encoding).enc
-          : &ns(internal_big2_encoding).enc);
-#endif
+  return (*(const char *)&n ? &ns(internal_little2_encoding).enc
+                            : &ns(internal_big2_encoding).enc);
+#  endif
 }
 
-static const ENCODING * const NS(encodings)[] = {
-  &ns(latin1_encoding).enc,
-  &ns(ascii_encoding).enc,
-  &ns(utf8_encoding).enc,
-  &ns(big2_encoding).enc,
-  &ns(big2_encoding).enc,
-  &ns(little2_encoding).enc,
-  &ns(utf8_encoding).enc /* NO_ENC */
+static const ENCODING *const NS(encodings)[] = {
+    &ns(latin1_encoding).enc, &ns(ascii_encoding).enc,
+    &ns(utf8_encoding).enc,   &ns(big2_encoding).enc,
+    &ns(big2_encoding).enc,   &ns(little2_encoding).enc,
+    &ns(utf8_encoding).enc /* NO_ENC */
 };
 
 static int PTRCALL
 NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
-                   const char **nextTokPtr)
-{
-  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
-                  XML_PROLOG_STATE, ptr, end, nextTokPtr);
+                   const char **nextTokPtr) {
+  return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE,
+                  ptr, end, nextTokPtr);
 }
 
 static int PTRCALL
 NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
-                    const char **nextTokPtr)
-{
-  return initScan(NS(encodings), (const INIT_ENCODING *)enc,
-                  XML_CONTENT_STATE, ptr, end, nextTokPtr);
+                    const char **nextTokPtr) {
+  return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE,
+                  ptr, end, nextTokPtr);
 }
 
 int
 NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
-                    const char *name)
-{
+                    const char *name) {
   int i = getEncodingIndex(name);
   if (i == UNKNOWN_ENC)
     return 0;
@@ -96,9 +87,8 @@ NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
 }
 
 static const ENCODING *
-NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
-{
-#define ENCODING_MAX 128
+NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
+#  define ENCODING_MAX 128
   char buf[ENCODING_MAX];
   char *p = buf;
   int i;
@@ -115,28 +105,14 @@ NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
 }
 
 int
-NS(XmlParseXmlDecl)(int isGeneralTextEntity,
-                    const ENCODING *enc,
-                    const char *ptr,
-                    const char *end,
-                    const char **badPtr,
-                    const char **versionPtr,
-                    const char **versionEndPtr,
-                    const char **encodingName,
-                    const ENCODING **encoding,
-                    int *standalone)
-{
-  return doParseXmlDecl(NS(findEncoding),
-                        isGeneralTextEntity,
-                        enc,
-                        ptr,
-                        end,
-                        badPtr,
-                        versionPtr,
-                        versionEndPtr,
-                        encodingName,
-                        encoding,
-                        standalone);
+NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc,
+                    const char *ptr, const char *end, const char **badPtr,
+                    const char **versionPtr, const char **versionEndPtr,
+                    const char **encodingName, const ENCODING **encoding,
+                    int *standalone) {
+  return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end,
+                        badPtr, versionPtr, versionEndPtr, encodingName,
+                        encoding, standalone);
 }
 
 #endif /* XML_TOK_NS_C */

+ 47 - 51
libs/expat/tests/benchmark/benchmark.c

@@ -37,43 +37,40 @@
 #include "expat.h"
 
 #ifdef XML_LARGE_SIZE
-# define XML_FMT_INT_MOD "ll"
+#  define XML_FMT_INT_MOD "ll"
 #else
-# define XML_FMT_INT_MOD "l"
+#  define XML_FMT_INT_MOD "l"
 #endif
 
 #ifdef XML_UNICODE_WCHAR_T
-# define XML_FMT_STR "ls"
+#  define XML_FMT_STR "ls"
 #else
-# define XML_FMT_STR "s"
+#  define XML_FMT_STR "s"
 #endif
 
 static void
-usage(const char *prog, int rc)
-{
-  fprintf(stderr,
-          "usage: %s [-n] filename bufferSize nr_of_loops\n", prog);
+usage(const char *prog, int rc) {
+  fprintf(stderr, "usage: %s [-n] filename bufferSize nr_of_loops\n", prog);
   exit(rc);
 }
 
-int main (int argc, char *argv[]) 
-{
-  XML_Parser  parser;
-  char        *XMLBuf, *XMLBufEnd, *XMLBufPtr;
-  FILE        *fd;
+int
+main(int argc, char *argv[]) {
+  XML_Parser parser;
+  char *XMLBuf, *XMLBufEnd, *XMLBufPtr;
+  FILE *fd;
   struct stat fileAttr;
-  int         nrOfLoops, bufferSize, fileSize, i, isFinal;
-  int         j = 0, ns = 0;
-  clock_t     tstart, tend;
-  double      cpuTime = 0.0;
+  int nrOfLoops, bufferSize, fileSize, i, isFinal;
+  int j = 0, ns = 0;
+  clock_t tstart, tend;
+  double cpuTime = 0.0;
 
   if (argc > 1) {
     if (argv[1][0] == '-') {
       if (argv[1][1] == 'n' && argv[1][2] == '\0') {
         ns = 1;
         j = 1;
-      }
-      else
+      } else
         usage(argv[0], 1);
     }
   }
@@ -81,29 +78,28 @@ int main (int argc, char *argv[])
   if (argc != j + 4)
     usage(argv[0], 1);
 
-  if (stat (argv[j + 1], &fileAttr) != 0) {
-    fprintf (stderr, "could not access file '%s'\n", argv[j + 1]);
+  if (stat(argv[j + 1], &fileAttr) != 0) {
+    fprintf(stderr, "could not access file '%s'\n", argv[j + 1]);
     return 2;
   }
-  
-  fd = fopen (argv[j + 1], "r");
-  if (!fd) {
-    fprintf (stderr, "could not open file '%s'\n", argv[j + 1]);
+
+  fd = fopen(argv[j + 1], "r");
+  if (! fd) {
+    fprintf(stderr, "could not open file '%s'\n", argv[j + 1]);
     exit(2);
   }
-  
-  bufferSize = atoi (argv[j + 2]);
-  nrOfLoops = atoi (argv[j + 3]);
+
+  bufferSize = atoi(argv[j + 2]);
+  nrOfLoops = atoi(argv[j + 3]);
   if (bufferSize <= 0 || nrOfLoops <= 0) {
-    fprintf (stderr, 
-             "buffer size and nr of loops must be greater than zero.\n");
+    fprintf(stderr, "buffer size and nr of loops must be greater than zero.\n");
     exit(3);
   }
 
-  XMLBuf = malloc (fileAttr.st_size);
-  fileSize = fread (XMLBuf, sizeof (char), fileAttr.st_size, fd);
-  fclose (fd);
-  
+  XMLBuf = malloc(fileAttr.st_size);
+  fileSize = fread(XMLBuf, sizeof(char), fileAttr.st_size, fd);
+  fclose(fd);
+
   if (ns)
     parser = XML_ParserCreateNS(NULL, '!');
   else
@@ -121,29 +117,29 @@ int main (int argc, char *argv[])
         isFinal = 1;
       else
         parseBufferSize = bufferSize;
-      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",
-                 XML_ErrorString (XML_GetErrorCode (parser)),
-                 XML_GetCurrentLineNumber (parser),
-                 XML_GetCurrentColumnNumber (parser));
-        free (XMLBuf);
-        XML_ParserFree (parser);
-        exit (4);
+      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",
+                XML_ErrorString(XML_GetErrorCode(parser)),
+                XML_GetCurrentLineNumber(parser),
+                XML_GetCurrentColumnNumber(parser));
+        free(XMLBuf);
+        XML_ParserFree(parser);
+        exit(4);
       }
       XMLBufPtr += bufferSize;
-    } while (!isFinal);
+    } while (! isFinal);
     tend = clock();
-    cpuTime += ((double) (tend - tstart)) / CLOCKS_PER_SEC;
+    cpuTime += ((double)(tend - tstart)) / CLOCKS_PER_SEC;
     XML_ParserReset(parser, NULL);
     i++;
   }
 
-  XML_ParserFree (parser);
-  free (XMLBuf);
-      
-  printf ("%d loops, with buffer size %d. Average time per loop: %f\n", 
-          nrOfLoops, bufferSize, cpuTime / (double) nrOfLoops);
+  XML_ParserFree(parser);
+  free(XMLBuf);
+
+  printf("%d loops, with buffer size %d. Average time per loop: %f\n",
+         nrOfLoops, bufferSize, cpuTime / (double)nrOfLoops);
   return 0;
 }

+ 0 - 25
libs/expat/tests/benchmark/benchmark.sln

@@ -1,25 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "benchmark.vcxproj", "{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-		Template|Win32 = Template|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Debug|Win32.Build.0 = Debug|Win32
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Release|Win32.ActiveCfg = Release|Win32
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Release|Win32.Build.0 = Release|Win32
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Template|Win32.ActiveCfg = Template|Win32
-		{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}.Template|Win32.Build.0 = Template|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 0 - 143
libs/expat/tests/benchmark/benchmark.vcxproj

@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{FF89BA66-62C4-49EC-9189-1E7B603A1FD6}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\Release\</OutDir>
-    <IntDir>.\Release\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\Debug\</OutDir>
-    <IntDir>.\Debug\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\Release\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\Release\benchmark.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\Release\</ObjectFileName>
-      <ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\Release\benchmark.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x1009</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\Release\benchmark.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>.\Release\benchmark.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\..\win32\bin\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <MinimalRebuild>true</MinimalRebuild>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\Debug\benchmark.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\Debug\</ObjectFileName>
-      <ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\Debug\benchmark.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x1009</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\Debug\benchmark.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>.\Debug\benchmark.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\..\win32\bin\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="benchmark.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 43 - 50
libs/expat/tests/chardata.c

@@ -31,7 +31,7 @@
 */
 
 #ifdef HAVE_EXPAT_CONFIG_H
-# include <expat_config.h>
+#  include <expat_config.h>
 #endif
 #include "minicheck.h"
 
@@ -41,65 +41,58 @@
 
 #include "chardata.h"
 
-
 static int
-xmlstrlen(const XML_Char *s)
-{
-    int len = 0;
-    assert(s != NULL);
-    while (s[len] != 0)
-        ++len;
-    return len;
+xmlstrlen(const XML_Char *s) {
+  int len = 0;
+  assert(s != NULL);
+  while (s[len] != 0)
+    ++len;
+  return len;
 }
 
-
 void
-CharData_Init(CharData *storage)
-{
-    assert(storage != NULL);
-    storage->count = -1;
+CharData_Init(CharData *storage) {
+  assert(storage != NULL);
+  storage->count = -1;
 }
 
 void
-CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len)
-{
-    int maxchars;
+CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) {
+  int maxchars;
 
-    assert(storage != NULL);
-    assert(s != NULL);
-    maxchars = sizeof(storage->data) / sizeof(storage->data[0]);
-    if (storage->count < 0)
-        storage->count = 0;
-    if (len < 0)
-        len = xmlstrlen(s);
-    if ((len + storage->count) > maxchars) {
-        len = (maxchars - storage->count);
-    }
-    if (len + storage->count < (int)sizeof(storage->data)) {
-        memcpy(storage->data + storage->count, s,
-               len * sizeof(storage->data[0]));
-        storage->count += len;
-    }
+  assert(storage != NULL);
+  assert(s != NULL);
+  maxchars = sizeof(storage->data) / sizeof(storage->data[0]);
+  if (storage->count < 0)
+    storage->count = 0;
+  if (len < 0)
+    len = xmlstrlen(s);
+  if ((len + storage->count) > maxchars) {
+    len = (maxchars - storage->count);
+  }
+  if (len + storage->count < (int)sizeof(storage->data)) {
+    memcpy(storage->data + storage->count, s, len * sizeof(storage->data[0]));
+    storage->count += len;
+  }
 }
 
 int
-CharData_CheckXMLChars(CharData *storage, const XML_Char *expected)
-{
-    char buffer[1024];
-    int len = xmlstrlen(expected);
-    int count;
+CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) {
+  char buffer[1024];
+  int len = xmlstrlen(expected);
+  int count;
 
-    assert(storage != NULL);
-    count = (storage->count < 0) ? 0 : storage->count;
-    if (len != count) {
-        sprintf(buffer, "wrong number of data characters: got %d, expected %d",
-                count, len);
-        fail(buffer);
-        return 0;
-    }
-    if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) {
-        fail("got bad data bytes");
-        return 0;
-    }
-    return 1;
+  assert(storage != NULL);
+  count = (storage->count < 0) ? 0 : storage->count;
+  if (len != count) {
+    sprintf(buffer, "wrong number of data characters: got %d, expected %d",
+            count, len);
+    fail(buffer);
+    return 0;
+  }
+  if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) {
+    fail("got bad data bytes");
+    return 0;
+  }
+  return 1;
 }

+ 7 - 10
libs/expat/tests/chardata.h

@@ -36,27 +36,24 @@ extern "C" {
 #endif
 
 #ifndef XML_CHARDATA_H
-#define XML_CHARDATA_H 1
-
-#ifndef XML_VERSION
-#include "expat.h"                      /* need XML_Char */
-#endif
+#  define XML_CHARDATA_H 1
 
+#  ifndef XML_VERSION
+#    include "expat.h" /* need XML_Char */
+#  endif
 
 typedef struct {
-    int count;                          /* # of chars, < 0 if not set */
-    XML_Char data[2048];
+  int count; /* # of chars, < 0 if not set */
+  XML_Char data[2048];
 } CharData;
 
-
 void CharData_Init(CharData *storage);
 
 void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);
 
 int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);
 
-
-#endif  /* XML_CHARDATA_H */
+#endif /* XML_CHARDATA_H */
 
 #ifdef __cplusplus
 }

+ 115 - 123
libs/expat/tests/memcheck.c

@@ -34,17 +34,16 @@
 #include <stdlib.h>
 #include "memcheck.h"
 
-
 /* Structures to keep track of what has been allocated.  Speed isn't a
  * big issue for the tests this is required for, so we will use a
  * doubly-linked list to make deletion easier.
  */
 
 typedef struct allocation_entry {
-    struct allocation_entry * next;
-    struct allocation_entry * prev;
-    void * allocation;
-    size_t num_bytes;
+  struct allocation_entry *next;
+  struct allocation_entry *prev;
+  void *allocation;
+  size_t num_bytes;
 } AllocationEntry;
 
 static AllocationEntry *alloc_head = NULL;
@@ -52,147 +51,140 @@ static AllocationEntry *alloc_tail = NULL;
 
 static AllocationEntry *find_allocation(void *ptr);
 
-
 /* Allocate some memory and keep track of it. */
 void *
-tracking_malloc(size_t size)
-{
-    AllocationEntry *entry = malloc(sizeof(AllocationEntry));
-
-    if (entry == NULL) {
-        printf("Allocator failure\n");
-        return NULL;
-    }
-    entry->num_bytes = size;
-    entry->allocation = malloc(size);
-    if (entry->allocation == NULL) {
-        free(entry);
-        return NULL;
-    }
-    entry->next = NULL;
+tracking_malloc(size_t size) {
+  AllocationEntry *entry = malloc(sizeof(AllocationEntry));
 
-    /* Add to the list of allocations */
-    if (alloc_head == NULL) {
-        entry->prev = NULL;
-        alloc_head = alloc_tail = entry;
-    } else {
-        entry->prev = alloc_tail;
-        alloc_tail->next = entry;
-        alloc_tail = entry;
-    }
-
-    return entry->allocation;
+  if (entry == NULL) {
+    printf("Allocator failure\n");
+    return NULL;
+  }
+  entry->num_bytes = size;
+  entry->allocation = malloc(size);
+  if (entry->allocation == NULL) {
+    free(entry);
+    return NULL;
+  }
+  entry->next = NULL;
+
+  /* Add to the list of allocations */
+  if (alloc_head == NULL) {
+    entry->prev = NULL;
+    alloc_head = alloc_tail = entry;
+  } else {
+    entry->prev = alloc_tail;
+    alloc_tail->next = entry;
+    alloc_tail = entry;
+  }
+
+  return entry->allocation;
 }
 
 static AllocationEntry *
-find_allocation(void *ptr)
-{
-    AllocationEntry *entry;
-
-    for (entry = alloc_head; entry != NULL; entry = entry->next) {
-        if (entry->allocation == ptr) {
-            return entry;
-        }
+find_allocation(void *ptr) {
+  AllocationEntry *entry;
+
+  for (entry = alloc_head; entry != NULL; entry = entry->next) {
+    if (entry->allocation == ptr) {
+      return entry;
     }
-    return NULL;
+  }
+  return NULL;
 }
 
 /* Free some memory and remove the tracking for it */
 void
-tracking_free(void *ptr)
-{
-    AllocationEntry *entry;
-
-    if (ptr == NULL) {
-        /* There won't be an entry for this */
-        return;
-    }
-
-    entry = find_allocation(ptr);
-    if (entry != NULL) {
-        /* This is the relevant allocation.  Unlink it */
-        if (entry->prev != NULL)
-            entry->prev->next = entry->next;
-        else
-            alloc_head = entry->next;
-        if (entry->next != NULL)
-            entry->next->prev = entry->prev;
-        else
-            alloc_tail = entry->next;
-        free(entry);
-    } else {
-        printf("Attempting to free unallocated memory at %p\n", ptr);
-    }
-    free(ptr);
+tracking_free(void *ptr) {
+  AllocationEntry *entry;
+
+  if (ptr == NULL) {
+    /* There won't be an entry for this */
+    return;
+  }
+
+  entry = find_allocation(ptr);
+  if (entry != NULL) {
+    /* This is the relevant allocation.  Unlink it */
+    if (entry->prev != NULL)
+      entry->prev->next = entry->next;
+    else
+      alloc_head = entry->next;
+    if (entry->next != NULL)
+      entry->next->prev = entry->prev;
+    else
+      alloc_tail = entry->next;
+    free(entry);
+  } else {
+    printf("Attempting to free unallocated memory at %p\n", ptr);
+  }
+  free(ptr);
 }
 
 /* Reallocate some memory and keep track of it */
 void *
-tracking_realloc(void *ptr, size_t size)
-{
-    AllocationEntry *entry;
+tracking_realloc(void *ptr, size_t size) {
+  AllocationEntry *entry;
+
+  if (ptr == NULL) {
+    /* By definition, this is equivalent to malloc(size) */
+    return tracking_malloc(size);
+  }
+  if (size == 0) {
+    /* By definition, this is equivalent to free(ptr) */
+    tracking_free(ptr);
+    return NULL;
+  }
 
-    if (ptr == NULL) {
-        /* By definition, this is equivalent to malloc(size) */
-        return tracking_malloc(size);
+  /* Find the allocation entry for this memory */
+  entry = find_allocation(ptr);
+  if (entry == NULL) {
+    printf("Attempting to realloc unallocated memory at %p\n", ptr);
+    entry = malloc(sizeof(AllocationEntry));
+    if (entry == NULL) {
+      printf("Reallocator failure\n");
+      return NULL;
     }
-    if (size == 0) {
-        /* By definition, this is equivalent to free(ptr) */
-        tracking_free(ptr);
-        return NULL;
+    entry->allocation = realloc(ptr, size);
+    if (entry->allocation == NULL) {
+      free(entry);
+      return NULL;
     }
 
-    /* Find the allocation entry for this memory */
-    entry = find_allocation(ptr);
-    if (entry == NULL) {
-        printf("Attempting to realloc unallocated memory at %p\n", ptr);
-        entry = malloc(sizeof(AllocationEntry));
-        if (entry == NULL) {
-            printf("Reallocator failure\n");
-            return NULL;
-        }
-        entry->allocation = realloc(ptr, size);
-        if (entry->allocation == NULL) {
-            free(entry);
-            return NULL;
-        }
-
-        /* Add to the list of allocations */
-        entry->next = NULL;
-        if (alloc_head == NULL) {
-            entry->prev = NULL;
-            alloc_head = alloc_tail = entry;
-        } else {
-            entry->prev = alloc_tail;
-            alloc_tail->next = entry;
-            alloc_tail = entry;
-        }
+    /* Add to the list of allocations */
+    entry->next = NULL;
+    if (alloc_head == NULL) {
+      entry->prev = NULL;
+      alloc_head = alloc_tail = entry;
     } else {
-        entry->allocation = realloc(ptr, size);
-        if (entry->allocation == NULL) {
-            /* Realloc semantics say the original is still allocated */
-            entry->allocation = ptr;
-            return NULL;
-        }
+      entry->prev = alloc_tail;
+      alloc_tail->next = entry;
+      alloc_tail = entry;
+    }
+  } else {
+    entry->allocation = realloc(ptr, size);
+    if (entry->allocation == NULL) {
+      /* Realloc semantics say the original is still allocated */
+      entry->allocation = ptr;
+      return NULL;
     }
+  }
 
-    entry->num_bytes = size;
-    return entry->allocation;
+  entry->num_bytes = size;
+  return entry->allocation;
 }
 
 int
-tracking_report(void)
-{
-    AllocationEntry *entry;
-
-    if (alloc_head == NULL)
-        return 1;
-
-    /* Otherwise we have allocations that haven't been freed */
-    for (entry = alloc_head; entry != NULL; entry = entry->next)
-    {
-        printf("Allocated %lu bytes at %p\n",
-                (long unsigned)entry->num_bytes, entry->allocation);
-    }
-    return 0;
+tracking_report(void) {
+  AllocationEntry *entry;
+
+  if (alloc_head == NULL)
+    return 1;
+
+  /* Otherwise we have allocations that haven't been freed */
+  for (entry = alloc_head; entry != NULL; entry = entry->next) {
+    printf("Allocated %lu bytes at %p\n", (long unsigned)entry->num_bytes,
+           entry->allocation);
+  }
+  return 0;
 }

+ 1 - 1
libs/expat/tests/memcheck.h

@@ -36,7 +36,7 @@ extern "C" {
 #endif
 
 #ifndef XML_MEMCHECK_H
-#define XML_MEMCHECK_H 1
+#  define XML_MEMCHECK_H 1
 
 /* Allocation declarations */
 

+ 134 - 147
libs/expat/tests/minicheck.c

@@ -40,100 +40,91 @@
 #include <assert.h>
 #include <string.h>
 
-#include "internal.h"  /* for UNUSED_P only */
+#include "internal.h" /* for UNUSED_P only */
 #include "minicheck.h"
 
 Suite *
-suite_create(const char *name)
-{
-    Suite *suite = (Suite *) calloc(1, sizeof(Suite));
-    if (suite != NULL) {
-        suite->name = name;
-    }
-    return suite;
+suite_create(const char *name) {
+  Suite *suite = (Suite *)calloc(1, sizeof(Suite));
+  if (suite != NULL) {
+    suite->name = name;
+  }
+  return suite;
 }
 
 TCase *
-tcase_create(const char *name)
-{
-    TCase *tc = (TCase *) calloc(1, sizeof(TCase));
-    if (tc != NULL) {
-        tc->name = name;
-    }
-    return tc;
+tcase_create(const char *name) {
+  TCase *tc = (TCase *)calloc(1, sizeof(TCase));
+  if (tc != NULL) {
+    tc->name = name;
+  }
+  return tc;
 }
 
 void
-suite_add_tcase(Suite *suite, TCase *tc) 
-{
-    assert(suite != NULL);
-    assert(tc != NULL);
-    assert(tc->next_tcase == NULL);
-
-    tc->next_tcase = suite->tests;
-    suite->tests = tc;
+suite_add_tcase(Suite *suite, TCase *tc) {
+  assert(suite != NULL);
+  assert(tc != NULL);
+  assert(tc->next_tcase == NULL);
+
+  tc->next_tcase = suite->tests;
+  suite->tests = tc;
 }
 
 void
-tcase_add_checked_fixture(TCase *tc,
-                          tcase_setup_function setup,
-                          tcase_teardown_function teardown)
-{
-    assert(tc != NULL);
-    tc->setup = setup;
-    tc->teardown = teardown;
+tcase_add_checked_fixture(TCase *tc, tcase_setup_function setup,
+                          tcase_teardown_function teardown) {
+  assert(tc != NULL);
+  tc->setup = setup;
+  tc->teardown = teardown;
 }
 
 void
-tcase_add_test(TCase *tc, tcase_test_function test)
-{
-    assert(tc != NULL);
-    if (tc->allocated == tc->ntests) {
-        int nalloc = tc->allocated + 100;
-        size_t new_size = sizeof(tcase_test_function) * nalloc;
-        tcase_test_function *new_tests = realloc(tc->tests, new_size);
-        assert(new_tests != NULL);
-        tc->tests = new_tests;
-        tc->allocated = nalloc;
-    }
-    tc->tests[tc->ntests] = test;
-    tc->ntests++;
+tcase_add_test(TCase *tc, tcase_test_function test) {
+  assert(tc != NULL);
+  if (tc->allocated == tc->ntests) {
+    int nalloc = tc->allocated + 100;
+    size_t new_size = sizeof(tcase_test_function) * nalloc;
+    tcase_test_function *new_tests = realloc(tc->tests, new_size);
+    assert(new_tests != NULL);
+    tc->tests = new_tests;
+    tc->allocated = nalloc;
+  }
+  tc->tests[tc->ntests] = test;
+  tc->ntests++;
 }
 
 static void
-tcase_free(TCase *tc)
-{
-    if (! tc) {
-        return;
-    }
+tcase_free(TCase *tc) {
+  if (! tc) {
+    return;
+  }
 
-    free(tc->tests);
-    free(tc);
+  free(tc->tests);
+  free(tc);
 }
 
 static void
-suite_free(Suite *suite)
-{
-    if (! suite) {
-        return;
-    }
-
-    while (suite->tests != NULL) {
-        TCase *next = suite->tests->next_tcase;
-        tcase_free(suite->tests);
-        suite->tests = next;
-    }
-    free(suite);
+suite_free(Suite *suite) {
+  if (! suite) {
+    return;
+  }
+
+  while (suite->tests != NULL) {
+    TCase *next = suite->tests->next_tcase;
+    tcase_free(suite->tests);
+    suite->tests = next;
+  }
+  free(suite);
 }
 
 SRunner *
-srunner_create(Suite *suite)
-{
-    SRunner *runner = calloc(1, sizeof(SRunner));
-    if (runner != NULL) {
-        runner->suite = suite;
-    }
-    return runner;
+srunner_create(Suite *suite) {
+  SRunner *runner = calloc(1, sizeof(SRunner));
+  if (runner != NULL) {
+    runner->suite = suite;
+  }
+  return runner;
 }
 
 static jmp_buf env;
@@ -143,100 +134,96 @@ 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;
-    _check_current_lineno = lineno;
-    _check_current_filename = filename;
+_check_set_test_info(char const *function, char const *filename, int lineno) {
+  _check_current_function = function;
+  _check_current_lineno = lineno;
+  _check_current_filename = filename;
 }
 
-
 static void
-add_failure(SRunner *runner, int verbosity)
-{
-    runner->nfailures++;
-    if (verbosity >= CK_VERBOSE) {
-        printf("%s:%d: %s\n", _check_current_filename,
-               _check_current_lineno, _check_current_function);
-    }
+add_failure(SRunner *runner, int verbosity) {
+  runner->nfailures++;
+  if (verbosity >= CK_VERBOSE) {
+    printf("%s:%d: %s\n", _check_current_filename, _check_current_lineno,
+           _check_current_function);
+  }
 }
 
 void
-srunner_run_all(SRunner *runner, int verbosity)
-{
-    Suite *suite;
-    TCase *tc;
-    assert(runner != NULL);
-    suite = runner->suite;
-    tc = suite->tests;
-    while (tc != NULL) {
-        int i;
-        for (i = 0; i < tc->ntests; ++i) {
-            runner->nchecks++;
-
-            if (tc->setup != NULL) {
-                /* setup */
-                if (setjmp(env)) {
-                    add_failure(runner, verbosity);
-                    continue;
-                }
-                tc->setup();
-            }
-            /* test */
-            if (setjmp(env)) {
-                add_failure(runner, verbosity);
-                continue;
-            }
-            (tc->tests[i])();
-
-            /* teardown */
-            if (tc->teardown != NULL) {
-                if (setjmp(env)) {
-                    add_failure(runner, verbosity);
-                    continue;
-                }
-                tc->teardown();
-            }
+srunner_run_all(SRunner *runner, int verbosity) {
+  Suite *suite;
+  TCase *volatile tc;
+  assert(runner != NULL);
+  suite = runner->suite;
+  tc = suite->tests;
+  while (tc != NULL) {
+    volatile int i;
+    for (i = 0; i < tc->ntests; ++i) {
+      runner->nchecks++;
+
+      if (tc->setup != NULL) {
+        /* setup */
+        if (setjmp(env)) {
+          add_failure(runner, verbosity);
+          continue;
         }
-        tc = tc->next_tcase;
-    }
-    if (verbosity) {
-        int passed = runner->nchecks - runner->nfailures;
-        double percentage = ((double) passed) / runner->nchecks;
-        int display = (int) (percentage * 100);
-        printf("%d%%: Checks: %d, Failed: %d\n",
-               display, runner->nchecks, runner->nfailures);
+        tc->setup();
+      }
+      /* test */
+      if (setjmp(env)) {
+        add_failure(runner, verbosity);
+        continue;
+      }
+      (tc->tests[i])();
+
+      /* teardown */
+      if (tc->teardown != NULL) {
+        if (setjmp(env)) {
+          add_failure(runner, verbosity);
+          continue;
+        }
+        tc->teardown();
+      }
     }
+    tc = tc->next_tcase;
+  }
+  if (verbosity) {
+    int passed = runner->nchecks - runner->nfailures;
+    double percentage = ((double)passed) / runner->nchecks;
+    int display = (int)(percentage * 100);
+    printf("%d%%: Checks: %d, Failed: %d\n", display, runner->nchecks,
+           runner->nfailures);
+  }
 }
 
 void
-_fail_unless(int UNUSED_P(condition), const char *UNUSED_P(file), int UNUSED_P(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.
-    */
-    if (msg != NULL) {
-        const int has_newline = (msg[strlen(msg) - 1] == '\n');
-        fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n");
-    }
-    longjmp(env, 1);
+_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);
+  UNUSED_P(file);
+  UNUSED_P(line);
+  if (msg != NULL) {
+    const int has_newline = (msg[strlen(msg) - 1] == '\n');
+    fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n");
+  }
+  longjmp(env, 1);
 }
 
 int
-srunner_ntests_failed(SRunner *runner)
-{
-    assert(runner != NULL);
-    return runner->nfailures;
+srunner_ntests_failed(SRunner *runner) {
+  assert(runner != NULL);
+  return runner->nfailures;
 }
 
 void
-srunner_free(SRunner *runner)
-{
-    if (! runner) {
-        return;
-    }
+srunner_free(SRunner *runner) {
+  if (! runner) {
+    return;
+  }
 
-    suite_free(runner->suite);
-    free(runner);
+  suite_free(runner->suite);
+  free(runner);
 }

+ 28 - 28
libs/expat/tests/minicheck.h

@@ -41,26 +41,29 @@ extern "C" {
 #endif
 
 #define CK_NOFORK 0
-#define CK_FORK   1
+#define CK_FORK 1
 
-#define CK_SILENT  0
-#define CK_NORMAL  1
+#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 
+   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__
+#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 START_TEST(testname)                                                   \
+  static void testname(void) {                                                 \
+    _check_set_test_info(__func__, __FILE__, __LINE__);                        \
     {
-#define END_TEST } }
+#define END_TEST                                                               \
+  }                                                                            \
+  }
 
-#define fail(msg)  _fail_unless(0, __FILE__, __LINE__, msg)
+#define fail(msg) _fail_unless(0, __FILE__, __LINE__, msg)
 
 typedef void (*tcase_setup_function)(void);
 typedef void (*tcase_teardown_function)(void);
@@ -71,31 +74,29 @@ typedef struct Suite Suite;
 typedef struct TCase TCase;
 
 struct SRunner {
-    Suite *suite;
-    int nchecks;
-    int nfailures;
+  Suite *suite;
+  int nchecks;
+  int nfailures;
 };
 
 struct Suite {
-    const char *name;
-    TCase *tests;
+  const char *name;
+  TCase *tests;
 };
 
 struct TCase {
-    const char *name;
-    tcase_setup_function setup;
-    tcase_teardown_function teardown;
-    tcase_test_function *tests;
-    int ntests;
-    int allocated;
-    TCase *next_tcase;
+  const char *name;
+  tcase_setup_function setup;
+  tcase_teardown_function teardown;
+  tcase_test_function *tests;
+  int ntests;
+  int allocated;
+  TCase *next_tcase;
 };
 
-
 /* Internal helper. */
-void _check_set_test_info(char const *function,
-                          char const *filename, int lineno);
-
+void _check_set_test_info(char const *function, char const *filename,
+                          int lineno);
 
 /*
  * Prototypes for the actual implementation.
@@ -105,8 +106,7 @@ 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 *,
-                               tcase_setup_function,
+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);

文件差异内容过多而无法显示
+ 444 - 459
libs/expat/tests/runtests.c


+ 0 - 24
libs/expat/tests/runtests.sln

@@ -1,24 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runtests", "runtests.vcxproj", "{63D6D820-B526-4A5F-9605-9B8551FAC591}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-		Template|Win32 = Template|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{63D6D820-B526-4A5F-9605-9B8551FAC591}.Debug|Win32.ActiveCfg = Debug|Win32
-		{63D6D820-B526-4A5F-9605-9B8551FAC591}.Debug|Win32.Build.0 = Debug|Win32
-		{63D6D820-B526-4A5F-9605-9B8551FAC591}.Release|Win32.ActiveCfg = Release|Win32
-		{63D6D820-B526-4A5F-9605-9B8551FAC591}.Release|Win32.Build.0 = Release|Win32
-		{63D6D820-B526-4A5F-9605-9B8551FAC591}.Template|Win32.ActiveCfg = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 0 - 142
libs/expat/tests/runtests.vcxproj

@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{63D6D820-B526-4A5F-9605-9B8551FAC591}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\Release\</OutDir>
-    <IntDir>.\Release\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\Debug\</OutDir>
-    <IntDir>.\Debug\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\Release\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\Release\runtests.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\Release\</ObjectFileName>
-      <ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\Release\runtests.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x1009</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\Release\runtests.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>.\Release\runtests.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpatMT.lib;libexpat.exp;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <MinimalRebuild>true</MinimalRebuild>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\Debug\runtests.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\Debug\</ObjectFileName>
-      <ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\Debug\runtests.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x1009</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\Debug\runtests.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>.\Debug\runtests.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpatMT.lib;libexpat.exp;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="chardata.c" />
-    <ClCompile Include="minicheck.c" />
-    <ClCompile Include="memcheck.c" />
-    <ClCompile Include="runtests.c" />
-    <ClCompile Include="structdata.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="chardata.h" />
-    <ClInclude Include="minicheck.h" />
-    <ClInclude Include="memcheck.h" />
-    <ClInclude Include="structdata.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 48
libs/expat/tests/runtests.vcxproj.filters

@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{a3e83144-e1b8-4d37-853a-793ce2b17b31}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{6a1287d5-359d-4ecb-a1a8-79aec14ad46d}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{75f72e18-16a8-453e-84bc-fe9301b8d5b2}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="chardata.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="minicheck.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="memcheck.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="runtests.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="structdata.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="chardata.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="minicheck.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="memcheck.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="structdata.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>

+ 86 - 93
libs/expat/tests/structdata.c

@@ -31,10 +31,9 @@
 */
 
 #ifdef HAVE_EXPAT_CONFIG_H
-# include "expat_config.h"
+#  include "expat_config.h"
 #endif
 
-
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -46,117 +45,111 @@
 #define STRUCT_EXTENSION_COUNT 8
 
 #ifdef XML_UNICODE_WCHAR_T
-# include <wchar.h>
-# define XML_FMT_STR "ls"
-# define xcstrlen(s) wcslen(s)
-# define xcstrcmp(s, t) wcscmp((s), (t))
+#  include <wchar.h>
+#  define XML_FMT_STR "ls"
+#  define xcstrlen(s) wcslen(s)
+#  define xcstrcmp(s, t) wcscmp((s), (t))
 #else
-# define XML_FMT_STR "s"
-# define xcstrlen(s) strlen(s)
-# define xcstrcmp(s, t) strcmp((s), (t))
+#  define XML_FMT_STR "s"
+#  define xcstrlen(s) strlen(s)
+#  define xcstrcmp(s, t) strcmp((s), (t))
 #endif
 
-
 static XML_Char *
-xmlstrdup(const XML_Char *s)
-{
-    size_t byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char);
-    XML_Char *dup = malloc(byte_count);
-
-    assert(dup != NULL);
-    memcpy(dup, s, byte_count);
-    return dup;
-}
+xmlstrdup(const XML_Char *s) {
+  size_t byte_count = (xcstrlen(s) + 1) * sizeof(XML_Char);
+  XML_Char *dup = malloc(byte_count);
 
+  assert(dup != NULL);
+  memcpy(dup, s, byte_count);
+  return dup;
+}
 
 void
-StructData_Init(StructData *storage)
-{
-    assert(storage != NULL);
-    storage->count = 0;
-    storage->max_count = 0;
-    storage->entries = NULL;
+StructData_Init(StructData *storage) {
+  assert(storage != NULL);
+  storage->count = 0;
+  storage->max_count = 0;
+  storage->entries = NULL;
 }
 
 void
-StructData_AddItem(StructData *storage,
-                   const XML_Char *s,
-                   int data0,
-                   int data1,
-                   int data2)
-{
-    StructDataEntry *entry;
-
-    assert(storage != NULL);
-    assert(s != NULL);
-    if (storage->count == storage->max_count) {
-        StructDataEntry *new;
-
-        storage->max_count += STRUCT_EXTENSION_COUNT;
-        new = realloc(storage->entries,
-                      storage->max_count * sizeof(StructDataEntry));
-        assert(new != NULL);
-        storage->entries = new;
-    }
-
-    entry = &storage->entries[storage->count];
-    entry->str = xmlstrdup(s);
-    entry->data0 = data0;
-    entry->data1 = data1;
-    entry->data2 = data2;
-    storage->count++;
+StructData_AddItem(StructData *storage, const XML_Char *s, int data0, int data1,
+                   int data2) {
+  StructDataEntry *entry;
+
+  assert(storage != NULL);
+  assert(s != NULL);
+  if (storage->count == storage->max_count) {
+    StructDataEntry *new;
+
+    storage->max_count += STRUCT_EXTENSION_COUNT;
+    new = realloc(storage->entries,
+                  storage->max_count * sizeof(StructDataEntry));
+    assert(new != NULL);
+    storage->entries = new;
+  }
+
+  entry = &storage->entries[storage->count];
+  entry->str = xmlstrdup(s);
+  entry->data0 = data0;
+  entry->data1 = data1;
+  entry->data2 = data2;
+  storage->count++;
 }
 
 /* 'fail()' aborts the function via a longjmp, so there is no point
  * in returning a value from this function.
  */
 void
-StructData_CheckItems(StructData *storage,
-                      const StructDataEntry *expected,
-                      int count)
-{
-    char buffer[1024];
-    int i;
-
-    assert(storage != NULL);
-    assert(expected != NULL);
-    if (count != storage->count) {
-        sprintf(buffer, "wrong number of entries: got %d, expected %d",
-                storage->count, count);
+StructData_CheckItems(StructData *storage, const StructDataEntry *expected,
+                      int count) {
+  char buffer[1024];
+  int i;
+
+  assert(storage != NULL);
+  assert(expected != NULL);
+  if (count != storage->count) {
+    sprintf(buffer, "wrong number of entries: got %d, expected %d",
+            storage->count, count);
+    StructData_Dispose(storage);
+    fail(buffer);
+  } else {
+    for (i = 0; i < count; i++) {
+      const StructDataEntry *got = &storage->entries[i];
+      const StructDataEntry *want = &expected[i];
+
+      assert(got != NULL);
+      assert(want != NULL);
+
+      if (xcstrcmp(got->str, want->str) != 0) {
         StructData_Dispose(storage);
-        fail(buffer);
-    }
-    for (i = 0; i < count; i++)
-    {
-        const StructDataEntry *got = &storage->entries[i];
-        const StructDataEntry *want = &expected[i];
-
-        if (xcstrcmp(got->str, want->str) != 0) {
-            StructData_Dispose(storage);
-            fail("structure got bad string");
-        }
-        if (got->data0 != want->data0 ||
-            got->data1 != want->data1 ||
-            got->data2 != want->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);
+        fail("structure got bad string");
+      } else {
+        if (got->data0 != want->data0 || got->data1 != want->data1
+            || got->data2 != want->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);
         }
+      }
     }
+  }
 }
 
 void
-StructData_Dispose(StructData *storage)
-{
-    int i;
-
-    assert(storage != NULL);
-    for (i = 0; i < storage->count; i++)
-        free((void *)storage->entries[i].str);
-    free(storage->entries);
+StructData_Dispose(StructData *storage) {
+  int i;
+
+  assert(storage != NULL);
+  for (i = 0; i < storage->count; i++)
+    free((void *)storage->entries[i].str);
+  free(storage->entries);
+
+  storage->count = 0;
+  storage->entries = NULL;
 }

+ 13 - 19
libs/expat/tests/structdata.h

@@ -36,40 +36,34 @@ extern "C" {
 #endif
 
 #ifndef XML_STRUCTDATA_H
-#define XML_STRUCTDATA_H 1
+#  define XML_STRUCTDATA_H 1
 
-#include "expat.h"
+#  include "expat.h"
 
 typedef struct {
-    const XML_Char *str;
-    int data0;
-    int data1;
-    int data2;
+  const XML_Char *str;
+  int data0;
+  int data1;
+  int data2;
 } StructDataEntry;
 
 typedef struct {
-    int count;       /* Number of entries used */
-    int max_count;   /* Number of StructDataEntry items in `entries` */
-    StructDataEntry *entries;
+  int count;     /* Number of entries used */
+  int max_count; /* Number of StructDataEntry items in `entries` */
+  StructDataEntry *entries;
 } StructData;
 
-
 void StructData_Init(StructData *storage);
 
-void StructData_AddItem(StructData *storage,
-                        const XML_Char *s,
-                        int data0,
-                        int data1,
-                        int data2);
+void StructData_AddItem(StructData *storage, const XML_Char *s, int data0,
+                        int data1, int data2);
 
-void StructData_CheckItems(StructData *storage,
-                           const StructDataEntry *expected,
+void StructData_CheckItems(StructData *storage, const StructDataEntry *expected,
                            int count);
 
 void StructData_Dispose(StructData *storage);
 
-
-#endif  /* XML_STRUCTDATA_H */
+#endif /* XML_STRUCTDATA_H */
 
 #ifdef __cplusplus
 }

+ 6 - 11
libs/expat/tests/xmltest.sh

@@ -22,17 +22,16 @@
 
 shopt -s nullglob
 
+# Note: OUTPUT must terminate with the directory separator.
+OUTPUT="$PWD/tests/out/"
+TS="$PWD/tests/"
+
 MYDIR="`dirname \"$0\"`"
 cd "$MYDIR"
 MYDIR="`pwd`"
 XMLWF="${1:-`dirname \"$MYDIR\"`/xmlwf/xmlwf}"
-# XMLWF=/usr/local/bin/xmlwf
-TS="$MYDIR"
-# OUTPUT must terminate with the directory separator.
-OUTPUT="$TS/out/"
-# OUTPUT=/home/tmp/xml-testsuite-out/
 # Unicode-aware diff utility
-DIFF="$TS/udiffer.py"
+DIFF="${MYDIR}/udiffer.py"
 
 
 # RunXmlwfNotWF file reldir
@@ -40,9 +39,7 @@ DIFF="$TS/udiffer.py"
 RunXmlwfNotWF() {
   file="$1"
   reldir="$2"
-  $XMLWF -p "$file" > outfile || return $?
-  read outdata < outfile
-  if test "$outdata" = "" ; then
+  if $XMLWF -p "$file" > /dev/null; then
       echo "Expected not well-formed: $reldir$file"
       return 1
   else
@@ -133,7 +130,6 @@ for xmldir in ibm/not-wf/P* \
       RunXmlwfNotWF "$xmlfile" "$xmldir/"
       UpdateStatus $?
   done
-  rm outfile
 done
 
 cd "$TS/xmlconf/oasis"
@@ -141,7 +137,6 @@ for xmlfile in *fail*.xml ; do
     RunXmlwfNotWF "$xmlfile" "oasis/"
     UpdateStatus $?
 done
-rm outfile
 
 echo "Passed: $SUCCESS"
 echo "Failed: $ERROR"

+ 14 - 29
libs/expat/win32/README.txt

@@ -6,16 +6,17 @@ Expat can be built on Windows in two ways:
   This follows the Unix build procedures.
 
 * MS Visual Studio 2013, 2015 and 2017:
-  A solution file for Visual Studio 2013 is provided: expat.sln.
-  The associated project files (*.vcxproj) reside in the appropriate
-  project directories. This solution file can be opened in VS 2015 or VS 2017
-  and should be upgraded automatically if VS 2013 is not also installed.
-  Note: Tests have their own solution files.
+  Use CMake to generate a solution file for Visual Studio, then use msbuild
+  to compile.  For example:
+
+  md build
+  cd build
+  cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
+  msbuild /m expat.sln
 
 * All MS C/C++ compilers:
-  The output for all projects will be generated in the win32\bin
-  directory, intermediate files will be located in project-specific
-  subdirectories of win32\tmp.
+  The output for all projects will be generated in the <CMAKE_BUILD_TYPE>\
+  and xmlwf\<CMAKE_BUILD_TYPE>\ directories.
   
 * Creating MinGW dynamic libraries from MS VC++ DLLs:
   
@@ -37,39 +38,23 @@ Expat can be built on Windows in two ways:
 
   Dynamic Linking:
 
-  By default the Expat Dlls are built to link statically
+  By default the Expat Dlls are built to link dynamically
   with the multi-threaded run-time library. 
   The libraries are named
   - libexpat(w).dll 
   - libexpat(w).lib (import library)
   The "w" indicates the UTF-16 version of the library.
 
-  One rarely uses other versions of the Dll, but they can
-  be built easily by specifying a different RTL linkage in
-  the IDE on the C/C++ tab under the category Code Generation.
+  Versions that are statically linking with the multi-threaded run-time library
+  can be built with -DEXPAT_MSVC_STATIC_CRT=ON.
 
-  Static Linking:
+  Static Linking:  (through -DEXPAT_SHARED_LIBS=OFF)
 
   The libraries should be named like this:
-  Single-theaded:     libexpat(w)ML.lib
   Multi-threaded:     libexpat(w)MT.lib
   Multi-threaded Dll: libexpat(w)MD.lib
   The suffixes conform to the compiler switch settings
-  /ML, /MT and /MD for MS VC++.
-  
-  Note: In Visual Studio 2005 (Visual C++ 8.0) and later, the
-  single-threaded runtime library is not supported anymore.
-
-  By default, the expat-static and expatw-static projects are set up
-  to link statically against the multithreaded run-time library,
-  so they will build libexpatMT.lib or libexpatwMT.lib files.
-
-  To build the other versions of the static library, 
-  go to Project - Settings:
-  - specify a different RTL linkage on the C/C++ tab
-    under the category Code Generation.
-  - then, on the Library tab, change the output file name
-    accordingly, as described above
+  /MT and /MD for MS VC++.
 
   An application linking to the static libraries must
   have the global macro XML_STATIC defined.

+ 84 - 0
libs/expat/win32/build_expat_iss.bat

@@ -0,0 +1,84 @@
+REM Batch script to build Inno Setup installer for libexpat for Windows
+REM Call from parent directory, e.g.: cmd /c win32\build_expat_iss.bat
+REM                          __  __            _
+REM                       ___\ \/ /_ __   __ _| |_
+REM                      / _ \\  /| '_ \ / _` | __|
+REM                     |  __//  \| |_) | (_| | |_
+REM                      \___/_/\_\ .__/ \__,_|\__|
+REM                               |_| XML parser
+REM
+REM Copyright (C) 2019 Expat development team
+REM Licensed under the MIT license:
+REM
+REM Permission is  hereby granted,  free of charge,  to any  person obtaining
+REM a  copy  of  this  software   and  associated  documentation  files  (the
+REM "Software"),  to  deal in  the  Software  without restriction,  including
+REM without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+REM distribute, sublicense, and/or sell copies of the Software, and to permit
+REM persons  to whom  the Software  is  furnished to  do so,  subject to  the
+REM following conditions:
+REM
+REM The above copyright  notice and this permission notice  shall be included
+REM in all copies or substantial portions of the Software.
+REM
+REM THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+REM EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+REM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+REM NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+REM DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+REM OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+REM USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+SET GENERATOR=Visual Studio 15 2017
+
+REM Read by msbuild!
+SET CONFIGURATION=RelWithDebInfo
+
+REM Where Inno Setup expects build results
+SET BINDIR=win32\bin\Release
+
+
+MD %BINDIR% || EXIT /b 1
+
+
+MD build_shared_char || EXIT /b 1
+CD build_shared_char || EXIT /b 1
+    cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF .. || EXIT /b 1
+    msbuild /m expat.sln || EXIT /b 1
+    DIR %CONFIGURATION% || EXIT /b 1
+    CD .. || EXIT /b 1
+COPY build_shared_char\%CONFIGURATION%\expat.dll %BINDIR%\ || EXIT /b 1
+COPY build_shared_char\%CONFIGURATION%\expat.lib %BINDIR%\ || EXIT /b 1
+
+
+MD build_static_char || EXIT /b 1
+CD build_static_char || EXIT /b 1
+    cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF .. || EXIT /b 1
+    msbuild /m expat.sln || EXIT /b 1
+    DIR %CONFIGURATION% || EXIT /b 1
+    CD .. || EXIT /b 1
+COPY build_static_char\%CONFIGURATION%\expatMT.lib %BINDIR%\ || EXIT /b 1
+COPY build_static_char\xmlwf\%CONFIGURATION%\xmlwf.exe %BINDIR%\ || EXIT /b 1
+
+
+MD build_shared_wchar_t || EXIT /b 1
+CD build_shared_wchar_t || EXIT /b 1
+    cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
+    msbuild /m expat.sln || EXIT /b 1
+    DIR %CONFIGURATION% || EXIT /b 1
+    CD .. || EXIT /b 1
+COPY build_shared_wchar_t\%CONFIGURATION%\expatw.dll %BINDIR%\ || EXIT /b 1
+COPY build_shared_wchar_t\%CONFIGURATION%\expatw.lib %BINDIR%\ || EXIT /b 1
+
+
+MD build_static_wchar_t || EXIT /b 1
+CD build_static_wchar_t || EXIT /b 1
+    cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_SHARED_LIBS=OFF -DEXPAT_CHAR_TYPE=wchar_t .. || EXIT /b 1
+    msbuild /m expat.sln || EXIT /b 1
+    DIR %CONFIGURATION% || EXIT /b 1
+    CD .. || EXIT /b 1
+COPY build_static_wchar_t\%CONFIGURATION%\expatwMT.lib %BINDIR%\ || EXIT /b 1
+
+
+DIR %BINDIR% || EXIT /b 1
+iscc win32\expat.iss || EXIT /b 1

+ 6 - 13
libs/expat/win32/expat.iss

@@ -4,7 +4,7 @@
 ; This script was contributed by Tim Peters.
 ; It was designed for Inno Setup 2.0.19 but works with later versions as well.
 
-#define expatVer "2.2.7"
+#define expatVer "2.2.8"
 
 [Setup]
 AppName=Expat
@@ -44,31 +44,24 @@ Flags: ignoreversion; Source: doc\*.css;                    DestDir: "{app}\Doc"
 Flags: ignoreversion; Source: doc\*.png;                    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: expat.sln;                    DestDir: "{app}\Source"
 Flags: ignoreversion; Source: win32\README.txt;             DestDir: "{app}\Source"
+Flags: ignoreversion; Source: CMake.README;                 DestDir: "{app}\Source"
+Flags: ignoreversion; Source: CMakeLists.txt;               DestDir: "{app}\Source"
+Flags: ignoreversion; Source: ConfigureChecks.cmake;        DestDir: "{app}\Source"
+Flags: ignoreversion; Source: expat_config.h.cmake;         DestDir: "{app}\Source"
+Flags: ignoreversion; Source: cmake\expat-config.cmake.in;  DestDir: "{app}\Source\cmake"
 Flags: ignoreversion; Source: lib\*.c;                      DestDir: "{app}\Source\lib"
 Flags: ignoreversion; Source: lib\*.h;                      DestDir: "{app}\Source\lib"
 Flags: ignoreversion; Source: lib\*.def;                    DestDir: "{app}\Source\lib"
-Flags: ignoreversion; Source: lib\*.vcxproj;                DestDir: "{app}\Source\lib"
-Flags: ignoreversion; Source: lib\*.vcxproj.filters;        DestDir: "{app}\Source\lib"
 Flags: ignoreversion; Source: examples\*.c;                 DestDir: "{app}\Source\examples"
-Flags: ignoreversion; Source: examples\*.vcxproj;           DestDir: "{app}\Source\examples"
-Flags: ignoreversion; Source: examples\*.vcxproj.filters;   DestDir: "{app}\Source\examples"
 Flags: ignoreversion; Source: tests\*.c;                    DestDir: "{app}\Source\tests"
 Flags: ignoreversion; Source: tests\*.cpp;                  DestDir: "{app}\Source\tests"
 Flags: ignoreversion; Source: tests\*.h;                    DestDir: "{app}\Source\tests"
-Flags: ignoreversion; Source: tests\*.sln;                  DestDir: "{app}\Source\tests"
-Flags: ignoreversion; Source: tests\*.vcxproj;              DestDir: "{app}\Source\tests"
-Flags: ignoreversion; Source: tests\*.vcxproj.filters;      DestDir: "{app}\Source\tests"
 Flags: ignoreversion; Source: tests\README.txt;             DestDir: "{app}\Source\tests"
 Flags: ignoreversion; Source: tests\benchmark\*.c;          DestDir: "{app}\Source\tests\benchmark"
-Flags: ignoreversion; Source: tests\benchmark\*.sln;        DestDir: "{app}\Source\tests\benchmark"
-Flags: ignoreversion; Source: tests\benchmark\*.vcxproj;    DestDir: "{app}\Source\tests\benchmark"
 Flags: ignoreversion; Source: tests\benchmark\README.txt;   DestDir: "{app}\Source\tests\benchmark"
 Flags: ignoreversion; Source: xmlwf\*.c*;                   DestDir: "{app}\Source\xmlwf"
 Flags: ignoreversion; Source: xmlwf\*.h;                    DestDir: "{app}\Source\xmlwf"
-Flags: ignoreversion; Source: xmlwf\*.vcxproj;              DestDir: "{app}\Source\xmlwf"
-Flags: ignoreversion; Source: xmlwf\*.vcxproj.filters;      DestDir: "{app}\Source\xmlwf"
 
 [Messages]
 WelcomeLabel1=Welcome to the Expat XML Parser Setup Wizard

+ 1 - 3
libs/expat/xmlwf/Makefile.am

@@ -56,6 +56,4 @@ EXTRA_DIST = \
     xmlfile.h \
     xmlmime.c \
     xmlmime.h \
-    xmltchar.h \
-    xmlurl.h \
-    xmlwin32url.cxx
+    xmltchar.h

+ 1 - 3
libs/expat/xmlwf/Makefile.in

@@ -365,9 +365,7 @@ EXTRA_DIST = \
     xmlfile.h \
     xmlmime.c \
     xmlmime.h \
-    xmltchar.h \
-    xmlurl.h \
-    xmlwin32url.cxx
+    xmltchar.h
 
 all: all-am
 

+ 25 - 23
libs/expat/xmlwf/codepage.c

@@ -31,25 +31,24 @@
 */
 
 #include "codepage.h"
-#include "internal.h"  /* for UNUSED_P only */
+#include "internal.h" /* for UNUSED_P only */
 
 #if defined(_WIN32)
-#define STRICT 1
-#define WIN32_LEAN_AND_MEAN 1
+#  define STRICT 1
+#  define WIN32_LEAN_AND_MEAN 1
 
-#include <windows.h>
+#  include <windows.h>
 
 int
-codepageMap(int cp, int *map)
-{
+codepageMap(int cp, int *map) {
   int i;
   CPINFO info;
-  if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2)
+  if (! GetCPInfo(cp, &info) || info.MaxCharSize > 2)
     return 0;
   for (i = 0; i < 256; i++)
     map[i] = -1;
   if (info.MaxCharSize > 1) {
-    for (i = 0; i < MAX_LEADBYTES; i+=2) {
+    for (i = 0; i < MAX_LEADBYTES; i += 2) {
       int j, lim;
       if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0)
         break;
@@ -59,23 +58,24 @@ codepageMap(int cp, int *map)
     }
   }
   for (i = 0; i < 256; i++) {
-   if (map[i] == -1) {
-     char c = (char)i;
-     unsigned short n;
-     if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
-                             &c, 1, &n, 1) == 1)
-       map[i] = n;
-   }
+    if (map[i] == -1) {
+      char c = (char)i;
+      unsigned short n;
+      if (MultiByteToWideChar(cp, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, &c, 1,
+                              &n, 1)
+          == 1)
+        map[i] = n;
+    }
   }
   return 1;
 }
 
 int
-codepageConvert(int cp, const char *p)
-{
+codepageConvert(int cp, const char *p) {
   unsigned short c;
-  if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
-                          p, 2, &c, 1) == 1)
+  if (MultiByteToWideChar(cp, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, p, 2, &c,
+                          1)
+      == 1)
     return c;
   return -1;
 }
@@ -83,14 +83,16 @@ codepageConvert(int cp, const char *p)
 #else /* not _WIN32 */
 
 int
-codepageMap(int UNUSED_P(cp), int *UNUSED_P(map))
-{
+codepageMap(int cp, int *map) {
+  UNUSED_P(cp);
+  UNUSED_P(map);
   return 0;
 }
 
 int
-codepageConvert(int UNUSED_P(cp), const char *UNUSED_P(p))
-{
+codepageConvert(int cp, const char *p) {
+  UNUSED_P(cp);
+  UNUSED_P(p);
   return -1;
 }
 

+ 10 - 16
libs/expat/xmlwf/ct.c

@@ -33,8 +33,7 @@
 #define CHARSET_MAX 41
 
 static const char *
-getTok(const char **pp)
-{
+getTok(const char **pp) {
   enum { inAtom, inString, init, inComment };
   int state = init;
   const char *tokStart = 0;
@@ -102,9 +101,8 @@ getTok(const char **pp)
 /* key must be lowercase ASCII */
 
 static int
-matchkey(const char *start, const char *end, const char *key)
-{
-  if (!start)
+matchkey(const char *start, const char *end, const char *key) {
+  if (! start)
     return 0;
   for (; start != end; start++, key++)
     if (*start != *key && *start != 'A' + (*key - 'a'))
@@ -113,8 +111,7 @@ matchkey(const char *start, const char *end, const char *key)
 }
 
 void
-getXMLCharset(const char *buf, char *charset)
-{
+getXMLCharset(const char *buf, char *charset) {
   const char *next, *p;
 
   charset[0] = '\0';
@@ -122,10 +119,10 @@ getXMLCharset(const char *buf, char *charset)
   p = getTok(&next);
   if (matchkey(p, next, "text"))
     strcpy(charset, "us-ascii");
-  else if (!matchkey(p, next, "application"))
+  else if (! matchkey(p, next, "application"))
     return;
   p = getTok(&next);
-  if (!p || *p != '/')
+  if (! p || *p != '/')
     return;
   p = getTok(&next);
   if (matchkey(p, next, "xml"))
@@ -151,8 +148,7 @@ getXMLCharset(const char *buf, char *charset)
                 *s++ = *p;
               }
               *s++ = '\0';
-            }
-            else {
+            } else {
               if (next - p > CHARSET_MAX - 1)
                 break;
               while (p != next)
@@ -163,15 +159,13 @@ getXMLCharset(const char *buf, char *charset)
           }
         }
       }
-    }
-  else
-    p = getTok(&next);
+    } else
+      p = getTok(&next);
   }
 }
 
 int
-main(int argc, char **argv)
-{
+main(int argc, char **argv) {
   char buf[CHARSET_MAX];
   getXMLCharset(argv[1], buf);
   printf("charset = \"%s\"\n", buf);

+ 4 - 8
libs/expat/xmlwf/filemap.h

@@ -30,10 +30,9 @@
    USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#include <limits.h>  /* INT_MAX */
+#include <limits.h> /* INT_MAX */
 #include <stddef.h>
 
-
 /* The following limit (for XML_Parse's int len) derives from
  * this loop in xmparse.c:
  *
@@ -41,17 +40,14 @@
  *      bufferSize = (int) (2U * (unsigned) bufferSize);
  *    } while (bufferSize < neededSize && bufferSize > 0);
  */
-#define XML_MAX_CHUNK_LEN  (INT_MAX / 2 + 1)
-
+#define XML_MAX_CHUNK_LEN (INT_MAX / 2 + 1)
 
 #ifdef XML_UNICODE
 int filemap(const wchar_t *name,
-            void (*processor)(const void *, size_t,
-                              const wchar_t *, void *arg),
+            void (*processor)(const void *, size_t, const wchar_t *, void *arg),
             void *arg);
 #else
 int filemap(const char *name,
-            void (*processor)(const void *, size_t,
-                              const char *, void *arg),
+            void (*processor)(const void *, size_t, const char *, void *arg),
             void *arg);
 #endif

+ 29 - 30
libs/expat/xmlwf/readfilemap.c

@@ -37,40 +37,40 @@
 #include <stdio.h>
 
 /* Functions close(2) and read(2) */
-#if !defined(_WIN32) && !defined(_WIN64)
-# include <unistd.h>
+#if ! defined(_WIN32) && ! defined(_WIN64)
+#  include <unistd.h>
 #endif
 
 /* Function "read": */
 #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
-#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
+#  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
+#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
 #endif
 
 #ifndef S_ISREG
-# ifndef S_IFREG
-#  define S_IFREG _S_IFREG
-# endif
-# ifndef S_IFMT
-#  define S_IFMT _S_IFMT
-# endif
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#  ifndef S_IFREG
+#    define S_IFREG _S_IFREG
+#  endif
+#  ifndef S_IFMT
+#    define S_IFMT _S_IFMT
+#  endif
+#  define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
 #endif /* not S_ISREG */
 
 #ifndef O_BINARY
-# ifdef _O_BINARY
-#  define O_BINARY _O_BINARY
-# else
-#  define O_BINARY 0
-# endif
+#  ifdef _O_BINARY
+#    define O_BINARY _O_BINARY
+#  else
+#    define O_BINARY 0
+#  endif
 #endif
 
 #include "xmltchar.h"
@@ -79,15 +79,14 @@
 int
 filemap(const tchar *name,
         void (*processor)(const void *, size_t, const tchar *, void *arg),
-        void *arg)
-{
+        void *arg) {
   size_t nbytes;
   int fd;
   _EXPAT_read_count_t n;
   struct stat sb;
   void *p;
 
-  fd = topen(name, O_RDONLY|O_BINARY);
+  fd = topen(name, O_RDONLY | O_BINARY);
   if (fd < 0) {
     tperror(name);
     return 0;
@@ -97,14 +96,14 @@ filemap(const tchar *name,
     close(fd);
     return 0;
   }
-  if (!S_ISREG(sb.st_mode)) {
+  if (! S_ISREG(sb.st_mode)) {
     ftprintf(stderr, T("%s: not a regular file\n"), name);
     close(fd);
     return 0;
   }
   if (sb.st_size > XML_MAX_CHUNK_LEN) {
     close(fd);
-    return 2;  /* Cannot be passed to XML_Parse in one go */
+    return 2; /* Cannot be passed to XML_Parse in one go */
   }
 
   nbytes = sb.st_size;
@@ -116,7 +115,7 @@ filemap(const tchar *name,
     return 1;
   }
   p = malloc(nbytes);
-  if (!p) {
+  if (! p) {
     ftprintf(stderr, T("%s: out of memory\n"), name);
     close(fd);
     return 0;

+ 8 - 9
libs/expat/xmlwf/unixfilemap.c

@@ -40,23 +40,22 @@
 #include <unistd.h>
 
 #ifndef MAP_FILE
-#define MAP_FILE 0
+#  define MAP_FILE 0
 #endif
 
 #include "xmltchar.h"
 #include "filemap.h"
 
 #ifdef XML_UNICODE_WCHAR_T
-# define XML_FMT_STR "ls"
+#  define XML_FMT_STR "ls"
 #else
-# define XML_FMT_STR "s"
+#  define XML_FMT_STR "s"
 #endif
 
 int
 filemap(const tchar *name,
         void (*processor)(const void *, size_t, const tchar *, void *arg),
-        void *arg)
-{
+        void *arg) {
   int fd;
   size_t nbytes;
   struct stat sb;
@@ -72,14 +71,14 @@ filemap(const tchar *name,
     close(fd);
     return 0;
   }
-  if (!S_ISREG(sb.st_mode)) {
+  if (! S_ISREG(sb.st_mode)) {
     close(fd);
     fprintf(stderr, "%" XML_FMT_STR ": not a regular file\n", name);
     return 0;
   }
   if (sb.st_size > XML_MAX_CHUNK_LEN) {
     close(fd);
-    return 2;  /* Cannot be passed to XML_Parse in one go */
+    return 2; /* Cannot be passed to XML_Parse in one go */
   }
 
   nbytes = sb.st_size;
@@ -90,8 +89,8 @@ filemap(const tchar *name,
     close(fd);
     return 1;
   }
-  p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ,
-                   MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
+  p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ, MAP_FILE | MAP_PRIVATE,
+                   fd, (off_t)0);
   if (p == (void *)-1) {
     tperror(name);
     close(fd);

+ 14 - 21
libs/expat/xmlwf/win32filemap.c

@@ -34,14 +34,14 @@
 #define WIN32_LEAN_AND_MEAN 1
 
 #ifdef XML_UNICODE_WCHAR_T
-# ifndef XML_UNICODE
-#  define XML_UNICODE
-# endif
+#  ifndef XML_UNICODE
+#    define XML_UNICODE
+#  endif
 #endif
 
 #ifdef XML_UNICODE
-# define UNICODE
-# define _UNICODE
+#  define UNICODE
+#  define _UNICODE
 #endif /* XML_UNICODE */
 #include <windows.h>
 #include <stdio.h>
@@ -53,8 +53,7 @@ static void win32perror(const TCHAR *);
 int
 filemap(const TCHAR *name,
         void (*processor)(const void *, size_t, const TCHAR *, void *arg),
-        void *arg)
-{
+        void *arg) {
   HANDLE f;
   HANDLE m;
   DWORD size;
@@ -62,7 +61,7 @@ filemap(const TCHAR *name,
   void *p;
 
   f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
-                          FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+                 FILE_FLAG_SEQUENTIAL_SCAN, NULL);
   if (f == INVALID_HANDLE_VALUE) {
     win32perror(name);
     return 0;
@@ -75,7 +74,7 @@ filemap(const TCHAR *name,
   }
   if (sizeHi || (size > XML_MAX_CHUNK_LEN)) {
     CloseHandle(f);
-    return 2;  /* Cannot be passed to XML_Parse in one go */
+    return 2; /* Cannot be passed to XML_Parse in one go */
   }
   /* CreateFileMapping barfs on zero length files */
   if (size == 0) {
@@ -97,7 +96,7 @@ filemap(const TCHAR *name,
     CloseHandle(f);
     return 0;
   }
-  processor(p, size, name, arg); 
+  processor(p, size, name, arg);
   UnmapViewOfFile(p);
   CloseHandle(m);
   CloseHandle(f);
@@ -105,21 +104,15 @@ filemap(const TCHAR *name,
 }
 
 static void
-win32perror(const TCHAR *s)
-{
+win32perror(const TCHAR *s) {
   LPVOID buf;
-  if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
-                    | FORMAT_MESSAGE_FROM_SYSTEM,
-                    NULL,
-                    GetLastError(),
-                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                    (LPTSTR) &buf,
-                    0,
+  if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                    NULL, GetLastError(),
+                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0,
                     NULL)) {
     _ftprintf(stderr, _T("%s: %s"), s, buf);
     fflush(stderr);
     LocalFree(buf);
-  }
-  else
+  } else
     _ftprintf(stderr, _T("%s: unknown Windows error\n"), s);
 }

+ 56 - 73
libs/expat/xmlwf/xmlfile.c

@@ -37,87 +37,77 @@
 #include <fcntl.h>
 
 #ifdef _WIN32
-#include "winconfig.h"
+#  include "winconfig.h"
 #elif defined(HAVE_EXPAT_CONFIG_H)
-#include <expat_config.h>
+#  include <expat_config.h>
 #endif /* ndef _WIN32 */
 
 #include "expat.h"
-#include "internal.h"  /* for UNUSED_P only */
+#include "internal.h" /* for UNUSED_P only */
 #include "xmlfile.h"
 #include "xmltchar.h"
 #include "filemap.h"
 
 #if defined(_MSC_VER)
-#include <io.h>
+#  include <io.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#  include <unistd.h>
 #endif
 
 #ifndef O_BINARY
-#ifdef _O_BINARY
-#define O_BINARY _O_BINARY
-#else
-#define O_BINARY 0
-#endif
+#  ifdef _O_BINARY
+#    define O_BINARY _O_BINARY
+#  else
+#    define O_BINARY 0
+#  endif
 #endif
 
 #ifdef _DEBUG
-#define READ_SIZE 16
+#  define READ_SIZE 16
 #else
-#define READ_SIZE (1024*8)
+#  define READ_SIZE (1024 * 8)
 #endif
 
-
 typedef struct {
   XML_Parser parser;
   int *retPtr;
 } PROCESS_ARGS;
 
-static int
-processStream(const XML_Char *filename, XML_Parser parser);
+static int processStream(const XML_Char *filename, XML_Parser parser);
 
 static void
-reportError(XML_Parser parser, const XML_Char *filename)
-{
+reportError(XML_Parser parser, const XML_Char *filename) {
   enum XML_Error code = XML_GetErrorCode(parser);
   const XML_Char *message = XML_ErrorString(code);
   if (message)
     ftprintf(stdout,
-             T("%s")
-               T(":%") T(XML_FMT_INT_MOD) T("u")
-               T(":%") T(XML_FMT_INT_MOD) T("u")
-               T(": %s\n"),
-             filename,
-             XML_GetErrorLineNumber(parser),
-             XML_GetErrorColumnNumber(parser),
-             message);
+             T("%s") T(":%") T(XML_FMT_INT_MOD) T("u") T(":%")
+                 T(XML_FMT_INT_MOD) T("u") T(": %s\n"),
+             filename, XML_GetErrorLineNumber(parser),
+             XML_GetErrorColumnNumber(parser), message);
   else
     ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code);
 }
- 
+
 /* This implementation will give problems on files larger than INT_MAX. */
 static void
-processFile(const void *data, size_t size,
-            const XML_Char *filename, void *args)
-{
+processFile(const void *data, size_t size, const XML_Char *filename,
+            void *args) {
   XML_Parser parser = ((PROCESS_ARGS *)args)->parser;
   int *retPtr = ((PROCESS_ARGS *)args)->retPtr;
   if (XML_Parse(parser, (const char *)data, (int)size, 1) == XML_STATUS_ERROR) {
     reportError(parser, filename);
     *retPtr = 0;
-  }
-  else
+  } else
     *retPtr = 1;
 }
 
 #if defined(_WIN32)
 
 static int
-isAsciiLetter(XML_Char c)
-{
+isAsciiLetter(XML_Char c) {
   return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z'));
 }
 
@@ -125,21 +115,19 @@ isAsciiLetter(XML_Char c)
 
 static const XML_Char *
 resolveSystemId(const XML_Char *base, const XML_Char *systemId,
-                XML_Char **toFree)
-{
+                XML_Char **toFree) {
   XML_Char *s;
   *toFree = 0;
-  if (!base
-      || *systemId == T('/')
+  if (! base || *systemId == T('/')
 #if defined(_WIN32)
       || *systemId == T('\\')
       || (isAsciiLetter(systemId[0]) && systemId[1] == T(':'))
 #endif
-     )
+  )
     return systemId;
   *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)
                                * sizeof(XML_Char));
-  if (!*toFree)
+  if (! *toFree)
     return systemId;
   tcscpy(*toFree, base);
   s = *toFree;
@@ -154,18 +142,16 @@ resolveSystemId(const XML_Char *base, const XML_Char *systemId,
 }
 
 static int
-externalEntityRefFilemap(XML_Parser parser,
-                         const XML_Char *context,
-                         const XML_Char *base,
-                         const XML_Char *systemId,
-                         const XML_Char *UNUSED_P(publicId))
-{
+externalEntityRefFilemap(XML_Parser parser, const XML_Char *context,
+                         const XML_Char *base, const XML_Char *systemId,
+                         const XML_Char *publicId) {
   int result;
   XML_Char *s;
   const XML_Char *filename;
   XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
   int filemapRes;
   PROCESS_ARGS args;
+  UNUSED_P(publicId);
   args.retPtr = &result;
   args.parser = entParser;
   filename = resolveSystemId(base, systemId, &s);
@@ -176,8 +162,10 @@ externalEntityRefFilemap(XML_Parser parser,
     result = 0;
     break;
   case 2:
-    ftprintf(stderr, T("%s: file too large for memory-mapping")
-        T(", switching to streaming\n"), filename);
+    ftprintf(stderr,
+             T("%s: file too large for memory-mapping")
+                 T(", switching to streaming\n"),
+             filename);
     result = processStream(filename, entParser);
     break;
   }
@@ -187,13 +175,12 @@ externalEntityRefFilemap(XML_Parser parser,
 }
 
 static int
-processStream(const XML_Char *filename, XML_Parser parser)
-{
+processStream(const XML_Char *filename, XML_Parser parser) {
   /* passing NULL for filename means read intput from stdin */
-  int fd = 0;   /* 0 is the fileno for stdin */
+  int fd = 0; /* 0 is the fileno for stdin */
 
   if (filename != NULL) {
-    fd = topen(filename, O_BINARY|O_RDONLY);
+    fd = topen(filename, O_BINARY | O_RDONLY);
     if (fd < 0) {
       tperror(filename);
       return 0;
@@ -202,7 +189,7 @@ processStream(const XML_Char *filename, XML_Parser parser)
   for (;;) {
     int nread;
     char *buf = (char *)XML_GetBuffer(parser, READ_SIZE);
-    if (!buf) {
+    if (! buf) {
       if (filename != NULL)
         close(fd);
       ftprintf(stderr, T("%s: out of memory\n"),
@@ -217,7 +204,7 @@ processStream(const XML_Char *filename, XML_Parser parser)
       return 0;
     }
     if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) {
-        reportError(parser, filename != NULL ? filename : T("STDIN"));
+      reportError(parser, filename != NULL ? filename : T("STDIN"));
       if (filename != NULL)
         close(fd);
       return 0;
@@ -225,23 +212,22 @@ processStream(const XML_Char *filename, XML_Parser parser)
     if (nread == 0) {
       if (filename != NULL)
         close(fd);
-      break;;
+      break;
+      ;
     }
   }
   return 1;
 }
 
 static int
-externalEntityRefStream(XML_Parser parser,
-                        const XML_Char *context,
-                        const XML_Char *base,
-                        const XML_Char *systemId,
-                        const XML_Char *UNUSED_P(publicId))
-{
+externalEntityRefStream(XML_Parser parser, const XML_Char *context,
+                        const XML_Char *base, const XML_Char *systemId,
+                        const XML_Char *publicId) {
   XML_Char *s;
   const XML_Char *filename;
   int ret;
   XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
+  UNUSED_P(publicId);
   filename = resolveSystemId(base, systemId, &s);
   XML_SetBase(entParser, filename);
   ret = processStream(filename, entParser);
@@ -251,22 +237,18 @@ externalEntityRefStream(XML_Parser parser,
 }
 
 int
-XML_ProcessFile(XML_Parser parser,
-                const XML_Char *filename,
-                unsigned flags)
-{
+XML_ProcessFile(XML_Parser parser, const XML_Char *filename, unsigned flags) {
   int result;
 
-  if (!XML_SetBase(parser, filename)) {
+  if (! XML_SetBase(parser, filename)) {
     ftprintf(stderr, T("%s: out of memory"), filename);
     exit(1);
   }
 
   if (flags & XML_EXTERNAL_ENTITIES)
-      XML_SetExternalEntityRefHandler(parser,
-                                      (flags & XML_MAP_FILE)
-                                      ? externalEntityRefFilemap
-                                      : externalEntityRefStream);
+    XML_SetExternalEntityRefHandler(parser, (flags & XML_MAP_FILE)
+                                                ? externalEntityRefFilemap
+                                                : externalEntityRefStream);
   if (flags & XML_MAP_FILE) {
     int filemapRes;
     PROCESS_ARGS args;
@@ -278,13 +260,14 @@ XML_ProcessFile(XML_Parser parser,
       result = 0;
       break;
     case 2:
-      ftprintf(stderr, T("%s: file too large for memory-mapping")
-          T(", switching to streaming\n"), filename);
+      ftprintf(stderr,
+               T("%s: file too large for memory-mapping")
+                   T(", switching to streaming\n"),
+               filename);
       result = processStream(filename, parser);
       break;
     }
-  }
-  else
+  } else
     result = processStream(filename, parser);
   return result;
 }

+ 3 - 8
libs/expat/xmlwf/xmlfile.h

@@ -34,15 +34,10 @@
 #define XML_EXTERNAL_ENTITIES 02
 
 #ifdef XML_LARGE_SIZE
-#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-#define XML_FMT_INT_MOD "I64"
+#  define XML_FMT_INT_MOD "ll"
 #else
-#define XML_FMT_INT_MOD "ll"
-#endif
-#else
-#define XML_FMT_INT_MOD "l"
+#  define XML_FMT_INT_MOD "l"
 #endif
 
-extern int XML_ProcessFile(XML_Parser parser,
-                           const XML_Char *filename,
+extern int XML_ProcessFile(XML_Parser parser, const XML_Char *filename,
                            unsigned flags);

+ 14 - 20
libs/expat/xmlwf/xmlmime.c

@@ -34,8 +34,7 @@
 #include "xmlmime.h"
 
 static const char *
-getTok(const char **pp)
-{
+getTok(const char **pp) {
   /* inComment means one level of nesting; inComment+1 means two levels etc */
   enum { inAtom, inString, init, inComment };
   int state = init;
@@ -106,9 +105,8 @@ getTok(const char **pp)
 /* key must be lowercase ASCII */
 
 static int
-matchkey(const char *start, const char *end, const char *key)
-{
-  if (!start)
+matchkey(const char *start, const char *end, const char *key) {
+  if (! start)
     return 0;
   for (; start != end; start++, key++)
     if (*start != *key && *start != 'A' + (*key - 'a'))
@@ -117,8 +115,7 @@ matchkey(const char *start, const char *end, const char *key)
 }
 
 void
-getXMLCharset(const char *buf, char *charset)
-{
+getXMLCharset(const char *buf, char *charset) {
   const char *next, *p;
 
   charset[0] = '\0';
@@ -126,18 +123,18 @@ getXMLCharset(const char *buf, char *charset)
   p = getTok(&next);
   if (matchkey(p, next, "text"))
     strcpy(charset, "us-ascii");
-  else if (!matchkey(p, next, "application"))
+  else if (! matchkey(p, next, "application"))
     return;
   p = getTok(&next);
-  if (!p || *p != '/')
+  if (! p || *p != '/')
     return;
   p = getTok(&next);
-/* BEGIN disabled code */
+  /* BEGIN disabled code */
   if (0) {
-    if (!matchkey(p, next, "xml") && charset[0] == '\0')
+    if (! matchkey(p, next, "xml") && charset[0] == '\0')
       return;
   }
-/* END disabled code */
+  /* END disabled code */
   p = getTok(&next);
   while (p) {
     if (*p == ';') {
@@ -159,8 +156,7 @@ getXMLCharset(const char *buf, char *charset)
                 *s++ = *p;
               }
               *s++ = '\0';
-            }
-            else {
+            } else {
               if (next - p > CHARSET_MAX - 1)
                 break;
               while (p != next)
@@ -172,19 +168,17 @@ getXMLCharset(const char *buf, char *charset)
         }
         break;
       }
-    }
-  else
-    p = getTok(&next);
+    } else
+      p = getTok(&next);
   }
 }
 
 #ifdef TEST
 
-#include <stdio.h>
+#  include <stdio.h>
 
 int
-main(int argc, char *argv[])
-{
+main(int argc, char *argv[]) {
   char buf[CHARSET_MAX];
   if (argc <= 1)
     return 1;

+ 36 - 36
libs/expat/xmlwf/xmltchar.h

@@ -34,41 +34,41 @@
 #include "expat_external.h"
 
 #ifdef XML_UNICODE
-# ifndef XML_UNICODE_WCHAR_T
-#  error xmlwf requires a 16-bit Unicode-compatible wchar_t
-# endif
-# define _PREPEND_BIG_L(x) L ## x
-# define T(x) _PREPEND_BIG_L(x)
-# define ftprintf fwprintf
-# define tfopen _wfopen
-# define fputts fputws
-# define puttc putwc
-# define tcscmp wcscmp
-# define tcscpy wcscpy
-# define tcscat wcscat
-# define tcschr wcschr
-# define tcsrchr wcsrchr
-# define tcslen wcslen
-# define tperror _wperror
-# define topen _wopen
-# define tmain wmain
-# define tremove _wremove
-# define tchar wchar_t
+#  ifndef XML_UNICODE_WCHAR_T
+#    error xmlwf requires a 16-bit Unicode-compatible wchar_t
+#  endif
+#  define _PREPEND_BIG_L(x) L##x
+#  define T(x) _PREPEND_BIG_L(x)
+#  define ftprintf fwprintf
+#  define tfopen _wfopen
+#  define fputts fputws
+#  define puttc putwc
+#  define tcscmp wcscmp
+#  define tcscpy wcscpy
+#  define tcscat wcscat
+#  define tcschr wcschr
+#  define tcsrchr wcsrchr
+#  define tcslen wcslen
+#  define tperror _wperror
+#  define topen _wopen
+#  define tmain wmain
+#  define tremove _wremove
+#  define tchar wchar_t
 #else /* not XML_UNICODE */
-# define T(x) x
-# define ftprintf fprintf
-# define tfopen fopen
-# define fputts fputs
-# define puttc putc
-# define tcscmp strcmp
-# define tcscpy strcpy
-# define tcscat strcat
-# define tcschr strchr
-# define tcsrchr strrchr
-# define tcslen strlen
-# define tperror perror
-# define topen open
-# define tmain main
-# define tremove remove
-# define tchar char
+#  define T(x) x
+#  define ftprintf fprintf
+#  define tfopen fopen
+#  define fputts fputs
+#  define puttc putc
+#  define tcscmp strcmp
+#  define tcscpy strcpy
+#  define tcscat strcat
+#  define tcschr strchr
+#  define tcsrchr strrchr
+#  define tcslen strlen
+#  define tperror perror
+#  define topen open
+#  define tmain main
+#  define tremove remove
+#  define tchar char
 #endif /* not XML_UNICODE */

+ 0 - 45
libs/expat/xmlwf/xmlurl.h

@@ -1,45 +0,0 @@
-/*
-                            __  __            _
-                         ___\ \/ /_ __   __ _| |_
-                        / _ \\  /| '_ \ / _` | __|
-                       |  __//  \| |_) | (_| | |_
-                        \___/_/\_\ .__/ \__,_|\__|
-                                 |_| XML parser
-
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
-   Licensed under the MIT license:
-
-   Permission is  hereby granted,  free of charge,  to any  person obtaining
-   a  copy  of  this  software   and  associated  documentation  files  (the
-   "Software"),  to  deal in  the  Software  without restriction,  including
-   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
-   distribute, sublicense, and/or sell copies of the Software, and to permit
-   persons  to whom  the Software  is  furnished to  do so,  subject to  the
-   following conditions:
-
-   The above copyright  notice and this permission notice  shall be included
-   in all copies or substantial portions of the Software.
-
-   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
-   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
-   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-   USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int XML_URLInit();
-void XML_URLUninit();
-int XML_ProcessURL(XML_Parser parser,
-                   const XML_Char *url,
-                   unsigned flags);
-
-#ifdef __cplusplus
-}
-#endif

+ 196 - 208
libs/expat/xmlwf/xmlwf.c

@@ -38,16 +38,16 @@
 
 #include "expat.h"
 #include "codepage.h"
-#include "internal.h"  /* for UNUSED_P only */
+#include "internal.h" /* for UNUSED_P only */
 #include "xmlfile.h"
 #include "xmltchar.h"
 
 #ifdef _MSC_VER
-# include <crtdbg.h>
+#  include <crtdbg.h>
 #endif
 
 #ifdef XML_UNICODE
-# include <wchar.h>
+#  include <wchar.h>
 #endif
 
 /* Structures for handler user data */
@@ -64,14 +64,12 @@ typedef struct xmlwfUserData {
   const XML_Char *currentDoctypeName;
 } XmlwfUserData;
 
-
 /* This ensures proper sorting. */
 
 #define NSSEP T('\001')
 
 static void XMLCALL
-characterData(void *userData, const XML_Char *s, int len)
-{
+characterData(void *userData, const XML_Char *s, int len) {
   FILE *fp = ((XmlwfUserData *)userData)->fp;
   for (; len > 0; --len, ++s) {
     switch (*s) {
@@ -106,8 +104,7 @@ characterData(void *userData, const XML_Char *s, int len)
 }
 
 static void
-attributeValue(FILE *fp, const XML_Char *s)
-{
+attributeValue(FILE *fp, const XML_Char *s) {
   puttc(T('='), fp);
   puttc(T('"'), fp);
   assert(s);
@@ -158,14 +155,12 @@ attributeValue(FILE *fp, const XML_Char *s)
 is equivalent to lexicographically comparing based on the character number. */
 
 static int
-attcmp(const void *att1, const void *att2)
-{
+attcmp(const void *att1, const void *att2) {
   return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2);
 }
 
 static void XMLCALL
-startElement(void *userData, const XML_Char *name, const XML_Char **atts)
-{
+startElement(void *userData, const XML_Char *name, const XML_Char **atts) {
   int nAtts;
   const XML_Char **p;
   FILE *fp = ((XmlwfUserData *)userData)->fp;
@@ -188,8 +183,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts)
 }
 
 static void XMLCALL
-endElement(void *userData, const XML_Char *name)
-{
+endElement(void *userData, const XML_Char *name) {
   FILE *fp = ((XmlwfUserData *)userData)->fp;
   puttc(T('<'), fp);
   puttc(T('/'), fp);
@@ -198,8 +192,7 @@ endElement(void *userData, const XML_Char *name)
 }
 
 static int
-nsattcmp(const void *p1, const void *p2)
-{
+nsattcmp(const void *p1, const void *p2) {
   const XML_Char *att1 = *(const XML_Char **)p1;
   const XML_Char *att2 = *(const XML_Char **)p2;
   int sep1 = (tcsrchr(att1, NSSEP) != 0);
@@ -210,8 +203,7 @@ nsattcmp(const void *p1, const void *p2)
 }
 
 static void XMLCALL
-startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
-{
+startElementNS(void *userData, const XML_Char *name, const XML_Char **atts) {
   int nAtts;
   int nsi;
   const XML_Char **p;
@@ -226,8 +218,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
     fputts(T(" xmlns:n1"), fp);
     attributeValue(fp, name);
     nsi = 2;
-  }
-  else {
+  } else {
     fputts(name, fp);
     nsi = 1;
   }
@@ -245,8 +236,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
     if (sep) {
       ftprintf(fp, T("n%d:"), nsi);
       fputts(sep + 1, fp);
-    }
-    else
+    } else
       fputts(name, fp);
     attributeValue(fp, *atts);
     if (sep) {
@@ -259,8 +249,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
 }
 
 static void XMLCALL
-endElementNS(void *userData, const XML_Char *name)
-{
+endElementNS(void *userData, const XML_Char *name) {
   FILE *fp = ((XmlwfUserData *)userData)->fp;
   const XML_Char *sep;
   puttc(T('<'), fp);
@@ -269,8 +258,7 @@ endElementNS(void *userData, const XML_Char *name)
   if (sep) {
     fputts(T("n1:"), fp);
     fputts(sep + 1, fp);
-  }
-  else
+  } else
     fputts(name, fp);
   puttc(T('>'), fp);
 }
@@ -279,8 +267,7 @@ endElementNS(void *userData, const XML_Char *name)
 
 static void XMLCALL
 processingInstruction(void *userData, const XML_Char *target,
-                      const XML_Char *data)
-{
+                      const XML_Char *data) {
   FILE *fp = ((XmlwfUserData *)userData)->fp;
   puttc(T('<'), fp);
   puttc(T('?'), fp);
@@ -291,9 +278,8 @@ processingInstruction(void *userData, const XML_Char *target,
   puttc(T('>'), fp);
 }
 
-
-static XML_Char *xcsdup(const XML_Char *s)
-{
+static XML_Char *
+xcsdup(const XML_Char *s) {
   XML_Char *result;
   int count = 0;
   int numBytes;
@@ -311,19 +297,18 @@ static XML_Char *xcsdup(const XML_Char *s)
 }
 
 static void XMLCALL
-startDoctypeDecl(void *userData,
-                 const XML_Char *doctypeName,
-                 const XML_Char *UNUSED_P(sysid),
-                 const XML_Char *UNUSED_P(publid),
-                 int UNUSED_P(has_internal_subset))
-{
+startDoctypeDecl(void *userData, const XML_Char *doctypeName,
+                 const XML_Char *sysid, const XML_Char *publid,
+                 int has_internal_subset) {
   XmlwfUserData *data = (XmlwfUserData *)userData;
+  UNUSED_P(sysid);
+  UNUSED_P(publid);
+  UNUSED_P(has_internal_subset);
   data->currentDoctypeName = xcsdup(doctypeName);
 }
 
 static void
-freeNotations(XmlwfUserData *data)
-{
+freeNotations(XmlwfUserData *data) {
   NotationList *notationListHead = data->notationListHead;
 
   while (notationListHead != NULL) {
@@ -337,8 +322,8 @@ freeNotations(XmlwfUserData *data)
   data->notationListHead = NULL;
 }
 
-static int xcscmp(const XML_Char *xs, const XML_Char *xt)
-{
+static int
+xcscmp(const XML_Char *xs, const XML_Char *xt) {
   while (*xs != 0 && *xt != 0) {
     if (*xs < *xt)
       return -1;
@@ -355,17 +340,15 @@ static int xcscmp(const XML_Char *xs, const XML_Char *xt)
 }
 
 static int
-notationCmp(const void *a, const void *b)
-{
-  const NotationList * const n1 = *(NotationList **)a;
-  const NotationList * const n2 = *(NotationList **)b;
+notationCmp(const void *a, const void *b) {
+  const NotationList *const n1 = *(NotationList **)a;
+  const NotationList *const n2 = *(NotationList **)b;
 
   return xcscmp(n1->notationName, n2->notationName);
 }
 
 static void XMLCALL
-endDoctypeDecl(void *userData)
-{
+endDoctypeDecl(void *userData) {
   XmlwfUserData *data = (XmlwfUserData *)userData;
   NotationList **notations;
   int notationCount = 0;
@@ -389,9 +372,7 @@ endDoctypeDecl(void *userData)
     return;
   }
 
-  for (p = data->notationListHead, i = 0;
-       i < notationCount;
-       p = p->next, i++) {
+  for (p = data->notationListHead, i = 0; i < notationCount; p = p->next, i++) {
     notations[i] = p;
   }
   qsort(notations, notationCount, sizeof(NotationList *), notationCmp);
@@ -415,8 +396,7 @@ endDoctypeDecl(void *userData)
         fputts(notations[i]->systemId, data->fp);
         puttc(T('\''), data->fp);
       }
-    }
-    else if (notations[i]->systemId != NULL) {
+    } else if (notations[i]->systemId != NULL) {
       fputts(T(" SYSTEM '"), data->fp);
       fputts(notations[i]->systemId, data->fp);
       puttc(T('\''), data->fp);
@@ -435,16 +415,13 @@ endDoctypeDecl(void *userData)
 }
 
 static void XMLCALL
-notationDecl(void *userData,
-             const XML_Char *notationName,
-             const XML_Char *UNUSED_P(base),
-             const XML_Char *systemId,
-             const XML_Char *publicId)
-{
+notationDecl(void *userData, const XML_Char *notationName, const XML_Char *base,
+             const XML_Char *systemId, const XML_Char *publicId) {
   XmlwfUserData *data = (XmlwfUserData *)userData;
   NotationList *entry = malloc(sizeof(NotationList));
   const char *errorMessage = "Unable to store NOTATION for output\n";
 
+  UNUSED_P(base);
   if (entry == NULL) {
     fputs(errorMessage, stderr);
     return; /* Nothing we can really do about this */
@@ -463,8 +440,7 @@ notationDecl(void *userData,
       free(entry);
       return;
     }
-  }
-  else {
+  } else {
     entry->systemId = NULL;
   }
   if (publicId != NULL) {
@@ -476,8 +452,7 @@ notationDecl(void *userData,
       free(entry);
       return;
     }
-  }
-  else {
+  } else {
     entry->publicId = NULL;
   }
 
@@ -488,101 +463,103 @@ notationDecl(void *userData,
 #endif /* not W3C14N */
 
 static void XMLCALL
-defaultCharacterData(void *userData, const XML_Char *UNUSED_P(s), int UNUSED_P(len))
-{
-  XML_DefaultCurrent((XML_Parser) userData);
+defaultCharacterData(void *userData, const XML_Char *s, int len) {
+  UNUSED_P(s);
+  UNUSED_P(len);
+  XML_DefaultCurrent((XML_Parser)userData);
 }
 
 static void XMLCALL
-defaultStartElement(void *userData, const XML_Char *UNUSED_P(name),
-                    const XML_Char **UNUSED_P(atts))
-{
-  XML_DefaultCurrent((XML_Parser) userData);
+defaultStartElement(void *userData, const XML_Char *name,
+                    const XML_Char **atts) {
+  UNUSED_P(name);
+  UNUSED_P(atts);
+  XML_DefaultCurrent((XML_Parser)userData);
 }
 
 static void XMLCALL
-defaultEndElement(void *userData, const XML_Char *UNUSED_P(name))
-{
-  XML_DefaultCurrent((XML_Parser) userData);
+defaultEndElement(void *userData, const XML_Char *name) {
+  UNUSED_P(name);
+  XML_DefaultCurrent((XML_Parser)userData);
 }
 
 static void XMLCALL
-defaultProcessingInstruction(void *userData, const XML_Char *UNUSED_P(target),
-                             const XML_Char *UNUSED_P(data))
-{
-  XML_DefaultCurrent((XML_Parser) userData);
+defaultProcessingInstruction(void *userData, const XML_Char *target,
+                             const XML_Char *data) {
+  UNUSED_P(target);
+  UNUSED_P(data);
+  XML_DefaultCurrent((XML_Parser)userData);
 }
 
 static void XMLCALL
-nopCharacterData(void *UNUSED_P(userData), const XML_Char *UNUSED_P(s), int UNUSED_P(len))
-{
+nopCharacterData(void *userData, const XML_Char *s, int len) {
+  UNUSED_P(userData);
+  UNUSED_P(s);
+  UNUSED_P(len);
 }
 
 static void XMLCALL
-nopStartElement(void *UNUSED_P(userData), const XML_Char *UNUSED_P(name), const XML_Char **UNUSED_P(atts))
-{
+nopStartElement(void *userData, const XML_Char *name, const XML_Char **atts) {
+  UNUSED_P(userData);
+  UNUSED_P(name);
+  UNUSED_P(atts);
 }
 
 static void XMLCALL
-nopEndElement(void *UNUSED_P(userData), const XML_Char *UNUSED_P(name))
-{
+nopEndElement(void *userData, const XML_Char *name) {
+  UNUSED_P(userData);
+  UNUSED_P(name);
 }
 
 static void XMLCALL
-nopProcessingInstruction(void *UNUSED_P(userData), const XML_Char *UNUSED_P(target),
-                         const XML_Char *UNUSED_P(data))
-{
+nopProcessingInstruction(void *userData, const XML_Char *target,
+                         const XML_Char *data) {
+  UNUSED_P(userData);
+  UNUSED_P(target);
+  UNUSED_P(data);
 }
 
 static void XMLCALL
-markup(void *userData, const XML_Char *s, int len)
-{
-  FILE *fp = ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp;
+markup(void *userData, const XML_Char *s, int len) {
+  FILE *fp = ((XmlwfUserData *)XML_GetUserData((XML_Parser)userData))->fp;
   for (; len > 0; --len, ++s)
     puttc(*s, fp);
 }
 
 static void
-metaLocation(XML_Parser parser)
-{
+metaLocation(XML_Parser parser) {
   const XML_Char *uri = XML_GetBase(parser);
   FILE *fp = ((XmlwfUserData *)XML_GetUserData(parser))->fp;
   if (uri)
     ftprintf(fp, T(" uri=\"%s\""), uri);
   ftprintf(fp,
-           T(" byte=\"%") T(XML_FMT_INT_MOD) T("d\"")
-             T(" nbytes=\"%d\"")
-             T(" line=\"%") T(XML_FMT_INT_MOD) T("u\"")
-             T(" col=\"%") T(XML_FMT_INT_MOD) T("u\""),
-           XML_GetCurrentByteIndex(parser),
-           XML_GetCurrentByteCount(parser),
+           T(" byte=\"%") T(XML_FMT_INT_MOD) T("d\"") T(" nbytes=\"%d\"")
+               T(" line=\"%") T(XML_FMT_INT_MOD) T("u\"") T(" col=\"%")
+                   T(XML_FMT_INT_MOD) T("u\""),
+           XML_GetCurrentByteIndex(parser), XML_GetCurrentByteCount(parser),
            XML_GetCurrentLineNumber(parser),
            XML_GetCurrentColumnNumber(parser));
 }
 
 static void
-metaStartDocument(void *userData)
-{
+metaStartDocument(void *userData) {
   fputts(T("<document>\n"),
-         ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp);
+         ((XmlwfUserData *)XML_GetUserData((XML_Parser)userData))->fp);
 }
 
 static void
-metaEndDocument(void *userData)
-{
+metaEndDocument(void *userData) {
   fputts(T("</document>\n"),
-         ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp);
+         ((XmlwfUserData *)XML_GetUserData((XML_Parser)userData))->fp);
 }
 
 static void XMLCALL
-metaStartElement(void *userData, const XML_Char *name,
-                 const XML_Char **atts)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaStartElement(void *userData, const XML_Char *name, const XML_Char **atts) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   const XML_Char **specifiedAttsEnd
-    = atts + XML_GetSpecifiedAttributeCount(parser);
+      = atts + XML_GetSpecifiedAttributeCount(parser);
   const XML_Char **idAttPtr;
   int idAttIndex = XML_GetIdAttributeIndex(parser);
   if (idAttIndex < 0)
@@ -605,15 +582,13 @@ metaStartElement(void *userData, const XML_Char *name,
         fputts(T("\"/>\n"), fp);
     } while (*(atts += 2));
     fputts(T("</starttag>\n"), fp);
-  }
-  else
+  } else
     fputts(T("/>\n"), fp);
 }
 
 static void XMLCALL
-metaEndElement(void *userData, const XML_Char *name)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaEndElement(void *userData, const XML_Char *name) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   ftprintf(fp, T("<endtag name=\"%s\""), name);
@@ -623,9 +598,8 @@ metaEndElement(void *userData, const XML_Char *name)
 
 static void XMLCALL
 metaProcessingInstruction(void *userData, const XML_Char *target,
-                          const XML_Char *data)
-{
-  XML_Parser parser = (XML_Parser) userData;
+                          const XML_Char *data) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *usrData = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = usrData->fp;
   ftprintf(fp, T("<pi target=\"%s\" data=\""), target);
@@ -636,9 +610,8 @@ metaProcessingInstruction(void *userData, const XML_Char *target,
 }
 
 static void XMLCALL
-metaComment(void *userData, const XML_Char *data)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaComment(void *userData, const XML_Char *data) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *usrData = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = usrData->fp;
   fputts(T("<comment data=\""), fp);
@@ -649,9 +622,8 @@ metaComment(void *userData, const XML_Char *data)
 }
 
 static void XMLCALL
-metaStartCdataSection(void *userData)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaStartCdataSection(void *userData) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   fputts(T("<startcdata"), fp);
@@ -660,9 +632,8 @@ metaStartCdataSection(void *userData)
 }
 
 static void XMLCALL
-metaEndCdataSection(void *userData)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaEndCdataSection(void *userData) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   fputts(T("<endcdata"), fp);
@@ -671,9 +642,8 @@ metaEndCdataSection(void *userData)
 }
 
 static void XMLCALL
-metaCharacterData(void *userData, const XML_Char *s, int len)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaCharacterData(void *userData, const XML_Char *s, int len) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   fputts(T("<chars str=\""), fp);
@@ -684,24 +654,23 @@ metaCharacterData(void *userData, const XML_Char *s, int len)
 }
 
 static void XMLCALL
-metaStartDoctypeDecl(void *userData,
-                     const XML_Char *doctypeName,
-                     const XML_Char *UNUSED_P(sysid),
-                     const XML_Char *UNUSED_P(pubid),
-                     int UNUSED_P(has_internal_subset))
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaStartDoctypeDecl(void *userData, const XML_Char *doctypeName,
+                     const XML_Char *sysid, const XML_Char *pubid,
+                     int has_internal_subset) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
+  UNUSED_P(sysid);
+  UNUSED_P(pubid);
+  UNUSED_P(has_internal_subset);
   ftprintf(fp, T("<startdoctype name=\"%s\""), doctypeName);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
 }
 
 static void XMLCALL
-metaEndDoctypeDecl(void *userData)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaEndDoctypeDecl(void *userData) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   fputts(T("<enddoctype"), fp);
@@ -710,15 +679,13 @@ metaEndDoctypeDecl(void *userData)
 }
 
 static void XMLCALL
-metaNotationDecl(void *userData,
-                 const XML_Char *notationName,
-                 const XML_Char *UNUSED_P(base),
-                 const XML_Char *systemId,
-                 const XML_Char *publicId)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaNotationDecl(void *userData, const XML_Char *notationName,
+                 const XML_Char *base, const XML_Char *systemId,
+                 const XML_Char *publicId) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
+  UNUSED_P(base);
   ftprintf(fp, T("<notation name=\"%s\""), notationName);
   if (publicId)
     ftprintf(fp, T(" public=\"%s\""), publicId);
@@ -731,30 +698,24 @@ metaNotationDecl(void *userData,
   fputts(T("/>\n"), fp);
 }
 
-
 static void XMLCALL
-metaEntityDecl(void *userData,
-               const XML_Char *entityName,
-               int  UNUSED_P(is_param),
-               const XML_Char *value,
-               int  value_length,
-               const XML_Char *UNUSED_P(base),
-               const XML_Char *systemId,
-               const XML_Char *publicId,
-               const XML_Char *notationName)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaEntityDecl(void *userData, const XML_Char *entityName, int is_param,
+               const XML_Char *value, int value_length, const XML_Char *base,
+               const XML_Char *systemId, const XML_Char *publicId,
+               const XML_Char *notationName) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
 
+  UNUSED_P(is_param);
+  UNUSED_P(base);
   if (value) {
     ftprintf(fp, T("<entity name=\"%s\""), entityName);
     metaLocation(parser);
     puttc(T('>'), fp);
     characterData(data, value, value_length);
     fputts(T("</entity/>\n"), fp);
-  }
-  else if (notationName) {
+  } else if (notationName) {
     ftprintf(fp, T("<entity name=\"%s\""), entityName);
     if (publicId)
       ftprintf(fp, T(" public=\"%s\""), publicId);
@@ -764,8 +725,7 @@ metaEntityDecl(void *userData,
     ftprintf(fp, T(" notation=\"%s\""), notationName);
     metaLocation(parser);
     fputts(T("/>\n"), fp);
-  }
-  else {
+  } else {
     ftprintf(fp, T("<entity name=\"%s\""), entityName);
     if (publicId)
       ftprintf(fp, T(" public=\"%s\""), publicId);
@@ -778,11 +738,9 @@ metaEntityDecl(void *userData,
 }
 
 static void XMLCALL
-metaStartNamespaceDecl(void *userData,
-                       const XML_Char *prefix,
-                       const XML_Char *uri)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaStartNamespaceDecl(void *userData, const XML_Char *prefix,
+                       const XML_Char *uri) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
   fputts(T("<startns"), fp);
@@ -792,74 +750,70 @@ metaStartNamespaceDecl(void *userData,
     fputts(T(" ns=\""), fp);
     characterData(data, uri, (int)tcslen(uri));
     fputts(T("\"/>\n"), fp);
-  }
-  else
+  } else
     fputts(T("/>\n"), fp);
 }
 
 static void XMLCALL
-metaEndNamespaceDecl(void *userData, const XML_Char *prefix)
-{
-  XML_Parser parser = (XML_Parser) userData;
+metaEndNamespaceDecl(void *userData, const XML_Char *prefix) {
+  XML_Parser parser = (XML_Parser)userData;
   XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
   FILE *fp = data->fp;
-  if (!prefix)
+  if (! prefix)
     fputts(T("<endns/>\n"), fp);
   else
     ftprintf(fp, T("<endns prefix=\"%s\"/>\n"), prefix);
 }
 
 static int XMLCALL
-unknownEncodingConvert(void *data, const char *p)
-{
+unknownEncodingConvert(void *data, const char *p) {
   return codepageConvert(*(int *)data, p);
 }
 
 static int XMLCALL
-unknownEncoding(void *UNUSED_P(userData), const XML_Char *name, XML_Encoding *info)
-{
+unknownEncoding(void *userData, const XML_Char *name, XML_Encoding *info) {
   int cp;
   static const XML_Char prefixL[] = T("windows-");
   static const XML_Char prefixU[] = T("WINDOWS-");
   int i;
 
+  UNUSED_P(userData);
   for (i = 0; prefixU[i]; i++)
     if (name[i] != prefixU[i] && name[i] != prefixL[i])
       return 0;
-  
+
   cp = 0;
   for (; name[i]; i++) {
     static const XML_Char digits[] = T("0123456789");
     const XML_Char *s = tcschr(digits, name[i]);
-    if (!s)
+    if (! s)
       return 0;
     cp *= 10;
     cp += (int)(s - digits);
     if (cp >= 0x10000)
       return 0;
   }
-  if (!codepageMap(cp, info->map))
+  if (! codepageMap(cp, info->map))
     return 0;
   info->convert = unknownEncodingConvert;
   /* We could just cast the code page integer to a void *,
   and avoid the use of release. */
   info->release = free;
   info->data = malloc(sizeof(int));
-  if (!info->data)
+  if (! info->data)
     return 0;
   *(int *)info->data = cp;
   return 1;
 }
 
 static int XMLCALL
-notStandalone(void *UNUSED_P(userData))
-{
+notStandalone(void *userData) {
+  UNUSED_P(userData);
   return 0;
 }
 
 static void
-showVersion(XML_Char *prog)
-{
+showVersion(XML_Char *prog) {
   XML_Char *s = prog;
   XML_Char ch;
   const XML_Feature *features = XML_GetFeatureList();
@@ -868,7 +822,7 @@ showVersion(XML_Char *prog)
 #if defined(_WIN32)
         || ch == '\\'
 #endif
-        )
+    )
       prog = s + 1;
     ++s;
   }
@@ -889,10 +843,46 @@ showVersion(XML_Char *prog)
 }
 
 static void
-usage(const XML_Char *prog, int rc)
-{
-  ftprintf(stderr,
-           T("usage: %s [-s] [-n] [-p] [-x] [-e encoding] [-w] [-d output-dir] [-c] [-m] [-r] [-t] [-N] [file ...]\n"), prog);
+usage(const XML_Char *prog, int rc) {
+  ftprintf(
+      stderr,
+      /* Generated with:
+       * $ xmlwf/xmlwf_helpgen.sh
+       */
+      /* clang-format off */
+      T("usage: %s [-s] [-n] [-p] [-x] [-e ENCODING] [-w] [-r] [-d DIRECTORY]\n")
+      T("             [-c | -m | -t] [-N]\n")
+      T("             [FILE [FILE ...]]\n")
+      T("\n")
+      T("xmlwf - Determines if an XML document is well-formed\n")
+      T("\n")
+      T("positional arguments:\n")
+      T("  FILE          files to process (default: STDIN)\n")
+      T("\n")
+      T("input control arguments:\n")
+      T("  -s            print an error if the document is not [s]tandalone\n")
+      T("  -n            enable [n]amespace processing\n")
+      T("  -p            enable processing external DTDs and [p]arameter entities\n")
+      T("  -x            enable processing of e[x]ternal entities\n")
+      T("  -e ENCODING   override any in-document [e]ncoding declaration\n")
+      T("  -w            enable support for [W]indows code pages\n")
+      T("  -r            disable memory-mapping and use normal file [r]ead IO calls instead\n")
+      T("\n")
+      T("output control arguments:\n")
+      T("  -d DIRECTORY  output [d]estination directory\n")
+      T("  -c            write a [c]opy of input XML, not canonical XML\n")
+      T("  -m            write [m]eta XML, not canonical XML\n")
+      T("  -t            write no XML output for [t]iming of plain parsing\n")
+      T("  -N            enable adding doctype and [n]otation declarations\n")
+      T("\n")
+      T("info arguments:\n")
+      T("  -h            show this [h]elp message and exit\n")
+      T("  -v            show program's [v]ersion number and exit\n")
+      T("\n")
+      T("libexpat is software libre, licensed under the MIT license.\n")
+      T("Please report bugs at https://github.com/libexpat/libexpat/issues.  Thank you!\n")
+      , /* clang-format on */
+      prog);
   exit(rc);
 }
 
@@ -902,8 +892,7 @@ int wmain(int argc, XML_Char **argv);
 #endif
 
 int
-tmain(int argc, XML_Char **argv)
-{
+tmain(int argc, XML_Char **argv) {
   int i, j;
   const XML_Char *outputDir = NULL;
   const XML_Char *encoding = NULL;
@@ -913,13 +902,13 @@ tmain(int argc, XML_Char **argv)
   int useNamespaces = 0;
   int requireStandalone = 0;
   int requiresNotations = 0;
-  enum XML_ParamEntityParsing paramEntityParsing = 
-    XML_PARAM_ENTITY_PARSING_NEVER;
+  enum XML_ParamEntityParsing paramEntityParsing
+      = XML_PARAM_ENTITY_PARSING_NEVER;
   int useStdin = 0;
-  XmlwfUserData userData = { NULL, NULL, NULL };
+  XmlwfUserData userData = {NULL, NULL, NULL};
 
 #ifdef _MSC_VER
-  _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
+  _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 #endif
 
   i = 1;
@@ -980,8 +969,7 @@ tmain(int argc, XML_Char **argv)
         if (++i == argc)
           usage(argv[0], 2);
         outputDir = argv[i];
-      }
-      else
+      } else
         outputDir = argv[i] + j + 1;
       i++;
       j = 0;
@@ -991,8 +979,7 @@ tmain(int argc, XML_Char **argv)
         if (++i == argc)
           usage(argv[0], 2);
         encoding = argv[i];
-      }
-      else
+      } else
         encoding = argv[i] + j + 1;
       i++;
       j = 0;
@@ -1043,18 +1030,17 @@ tmain(int argc, XML_Char **argv)
       XML_SetElementHandler(parser, nopStartElement, nopEndElement);
       XML_SetCharacterDataHandler(parser, nopCharacterData);
       XML_SetProcessingInstructionHandler(parser, nopProcessingInstruction);
-    }
-    else if (outputDir) {
-      const XML_Char * delim = T("/");
+    } else if (outputDir) {
+      const XML_Char *delim = T("/");
       const XML_Char *file = useStdin ? T("STDIN") : argv[i];
-      if (!useStdin) {
+      if (! useStdin) {
         /* Jump after last (back)slash */
-        const XML_Char * lastDelim = tcsrchr(file, delim[0]);
+        const XML_Char *lastDelim = tcsrchr(file, delim[0]);
         if (lastDelim)
           file = lastDelim + 1;
 #if defined(_WIN32)
         else {
-          const XML_Char * winDelim = T("\\");
+          const XML_Char *winDelim = T("\\");
           lastDelim = tcsrchr(file, winDelim[0]);
           if (lastDelim) {
             file = lastDelim + 1;
@@ -1064,12 +1050,12 @@ tmain(int argc, XML_Char **argv)
 #endif
       }
       outName = (XML_Char *)malloc((tcslen(outputDir) + tcslen(file) + 2)
-                       * sizeof(XML_Char));
+                                   * sizeof(XML_Char));
       tcscpy(outName, outputDir);
       tcscat(outName, delim);
       tcscat(outName, file);
       userData.fp = tfopen(outName, T("wb"));
-      if (!userData.fp) {
+      if (! userData.fp) {
         tperror(outName);
         exit(1);
       }
@@ -1126,13 +1112,15 @@ tmain(int argc, XML_Char **argv)
       if (outputType == 'm')
         metaEndDocument(parser);
       fclose(userData.fp);
-      if (!result) {
+      if (! result) {
         tremove(outName);
-        exit(2);
       }
       free(outName);
     }
     XML_ParserFree(parser);
+    if (! result) {
+      exit(2);
+    }
   }
   return 0;
 }

+ 0 - 164
libs/expat/xmlwf/xmlwf.vcxproj

@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Template|Win32">
-      <Configuration>Template</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <SccProjectName />
-    <SccLocalPath />
-    <ProjectGuid>{E3C5991F-5238-4168-A179-275D1AC98D7E}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>.\..\win32\bin\Release\</OutDir>
-    <IntDir>.\..\win32\tmp\Release-xmlwf\</IntDir>
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>.\..\win32\bin\Debug\</OutDir>
-    <IntDir>.\..\win32\tmp\Debug-xmlwf\</IntDir>
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <StringPooling>true</StringPooling>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>MaxSpeed</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Release-xmlwf\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Release-xmlwf\xmlwf.pch</PrecompiledHeaderOutputFile>
-      <PrecompiledHeader />
-      <ObjectFileName>.\..\win32\tmp\Release-xmlwf\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Release-xmlwf\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Release\xmlwf.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Release\xmlwf.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Console</SubSystem>
-      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-      <OutputFile>..\win32\bin\Release\xmlwf.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <InlineFunctionExpansion>Default</InlineFunctionExpansion>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <Optimization>Disabled</Optimization>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AssemblerListingLocation>.\..\win32\tmp\Debug-xmlwf\</AssemblerListingLocation>
-      <PrecompiledHeaderOutputFile>.\..\win32\tmp\Debug-xmlwf\xmlwf.pch</PrecompiledHeaderOutputFile>
-      <ObjectFileName>.\..\win32\tmp\Debug-xmlwf\</ObjectFileName>
-      <ProgramDataBaseFileName>.\..\win32\tmp\Debug-xmlwf\</ProgramDataBaseFileName>
-    </ClCompile>
-    <Midl>
-      <TypeLibraryName>.\..\win32\bin\Debug\xmlwf.tlb</TypeLibraryName>
-    </Midl>
-    <ResourceCompile>
-      <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ResourceCompile>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <OutputFile>.\..\win32\bin\Debug\xmlwf.bsc</OutputFile>
-    </Bscmake>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Console</SubSystem>
-      <OutputFile>..\win32\bin\Debug\xmlwf.exe</OutputFile>
-      <AdditionalLibraryDirectories>..\win32\bin\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libexpat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="codepage.c" />
-    <ClCompile Include="readfilemap.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="unixfilemap.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="win32filemap.c" />
-    <ClCompile Include="xmlfile.c" />
-    <ClCompile Include="xmlwf.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="codepage.h" />
-    <ClInclude Include="xmlfile.h" />
-    <ClInclude Include="xmltchar.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\lib\expat.vcxproj">
-      <Project>{45a5074d-66e8-44a4-a03f-018027b528d6}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 48
libs/expat/xmlwf/xmlwf.vcxproj.filters

@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{843deb01-ec59-4070-9fb7-4de851940fbd}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{41225059-d26f-42fd-9d1b-fda760b7e45d}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;fi;fd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{a722469e-558e-4d77-b8ea-88c9f136e29a}</UniqueIdentifier>
-      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="codepage.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="readfilemap.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="unixfilemap.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="win32filemap.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlfile.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="xmlwf.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="codepage.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmlfile.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="xmltchar.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>

+ 69 - 0
libs/expat/xmlwf/xmlwf_helpgen.py

@@ -0,0 +1,69 @@
+#! /usr/bin/env python3
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2019 Expat development team
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import argparse
+
+epilog = """
+libexpat is software libre, licensed under the MIT license.
+Please report bugs at https://github.com/libexpat/libexpat/issues.  Thank you!
+"""
+
+parser = argparse.ArgumentParser(prog='xmlwf', add_help=False,
+                                 description='xmlwf - Determines if an XML document is well-formed',
+                                 formatter_class=argparse.RawTextHelpFormatter,
+                                 epilog=epilog)
+
+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 [s]tandalone')
+input_related.add_argument('-n', action='store_true', help='enable [n]amespace processing')
+input_related.add_argument('-p', action='store_true', help='enable processing external DTDs and [p]arameter entities')
+input_related.add_argument('-x', action='store_true', help='enable processing of e[x]ternal entities')
+input_related.add_argument('-e', action='store', metavar='ENCODING', help='override any in-document [e]ncoding declaration')
+input_related.add_argument('-w', action='store_true', help='enable support for [W]indows code pages')
+input_related.add_argument('-r', action='store_true', help='disable memory-mapping and use normal file [r]ead IO calls instead')
+
+output_related = parser.add_argument_group('output control arguments')
+output_related.add_argument('-d', action='store', metavar='DIRECTORY', help='output [d]estination directory')
+output_mode = output_related.add_mutually_exclusive_group()
+output_mode.add_argument('-c', action='store_true', help='write a [c]opy of input XML, not canonical XML')
+output_mode.add_argument('-m', action='store_true', help='write [m]eta XML, not canonical XML')
+output_mode.add_argument('-t', action='store_true', help='write no XML output for [t]iming of plain parsing')
+output_related.add_argument('-N', action='store_true', help='enable adding doctype and [n]otation declarations')
+
+parser.add_argument('files', metavar='FILE', nargs='*', help='files to process (default: STDIN)')
+
+info = parser.add_argument_group('info arguments')
+info = info.add_mutually_exclusive_group()
+info.add_argument('-h', action='store_true', help='show this [h]elp message and exit')
+info.add_argument('-v', action='store_true', help='show program\'s [v]ersion number and exit')
+
+
+if __name__ == '__main__':
+    parser.print_help()

+ 35 - 0
libs/expat/xmlwf/xmlwf_helpgen.sh

@@ -0,0 +1,35 @@
+#! /usr/bin/env bash
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2019 Expat development team
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+./xmlwf/xmlwf_helpgen.py | sed \
+        -e 's,usage: xmlwf,usage: %s,' \
+        -e 's, \[-h | -v\],,' \
+        -e 's,^,      T(",' \
+        -e 's,$,\\n"),'

+ 0 - 427
libs/expat/xmlwf/xmlwin32url.cxx

@@ -1,427 +0,0 @@
-/*
-                            __  __            _
-                         ___\ \/ /_ __   __ _| |_
-                        / _ \\  /| '_ \ / _` | __|
-                       |  __//  \| |_) | (_| | |_
-                        \___/_/\_\ .__/ \__,_|\__|
-                                 |_| XML parser
-
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
-   Licensed under the MIT license:
-
-   Permission is  hereby granted,  free of charge,  to any  person obtaining
-   a  copy  of  this  software   and  associated  documentation  files  (the
-   "Software"),  to  deal in  the  Software  without restriction,  including
-   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
-   distribute, sublicense, and/or sell copies of the Software, and to permit
-   persons  to whom  the Software  is  furnished to  do so,  subject to  the
-   following conditions:
-
-   The above copyright  notice and this permission notice  shall be included
-   in all copies or substantial portions of the Software.
-
-   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
-   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
-   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-   USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include "expat.h"
-#ifdef XML_UNICODE
-#define UNICODE
-#endif
-#include <windows.h>
-#include <urlmon.h>
-#include <wininet.h>
-#include <stdio.h>
-#include <tchar.h>
-#include "xmlurl.h"
-#include "xmlmime.h"
-
-static int
-processURL(XML_Parser parser, IMoniker *baseMoniker, const XML_Char *url);
-
-typedef void (*StopHandler)(void *, HRESULT);
-
-class Callback : public IBindStatusCallback {
-public:
-  // IUnknown methods
-  STDMETHODIMP QueryInterface(REFIID,void **);
-  STDMETHODIMP_(ULONG) AddRef();
-  STDMETHODIMP_(ULONG) Release();
-  // IBindStatusCallback methods
-  STDMETHODIMP OnStartBinding(DWORD, IBinding *);
-  STDMETHODIMP GetPriority(LONG *);
-  STDMETHODIMP OnLowResource(DWORD);
-  STDMETHODIMP OnProgress(ULONG, ULONG, ULONG, LPCWSTR);
-  STDMETHODIMP OnStopBinding(HRESULT, LPCWSTR);
-  STDMETHODIMP GetBindInfo(DWORD *, BINDINFO *);
-  STDMETHODIMP OnDataAvailable(DWORD, DWORD, FORMATETC *, STGMEDIUM *);
-  STDMETHODIMP OnObjectAvailable(REFIID, IUnknown *);
-  Callback(XML_Parser, IMoniker *, StopHandler, void *);
-  ~Callback();
-  int externalEntityRef(const XML_Char *context,
-                        const XML_Char *systemId, const XML_Char *publicId);
-private:
-  XML_Parser parser_;
-  IMoniker *baseMoniker_;
-  DWORD totalRead_;
-  ULONG ref_;
-  IBinding *pBinding_;
-  StopHandler stopHandler_;
-  void *stopArg_;
-};
-
-STDMETHODIMP_(ULONG)
-Callback::AddRef()
-{ 
-  return ref_++;
-}
-
-STDMETHODIMP_(ULONG)
-Callback::Release()
-{ 
-  if (--ref_ == 0) {
-    delete this;
-    return 0;
-  }
-  return ref_;
-}
-
-STDMETHODIMP
-Callback::QueryInterface(REFIID riid, void** ppv)
-{ 
-  if (IsEqualGUID(riid, IID_IUnknown))
-    *ppv = (IUnknown *)this;
-  else if (IsEqualGUID(riid, IID_IBindStatusCallback))
-    *ppv = (IBindStatusCallback *)this;
-  else
-    return E_NOINTERFACE;
-  ((LPUNKNOWN)*ppv)->AddRef();
-  return S_OK;
-}
-
-STDMETHODIMP
-Callback::OnStartBinding(DWORD, IBinding* pBinding)
-{
-  pBinding_ = pBinding;
-  pBinding->AddRef();
-  return S_OK;
-}
-
-STDMETHODIMP
-Callback::GetPriority(LONG *)
-{
-  return E_NOTIMPL;
-}
-
-STDMETHODIMP
-Callback::OnLowResource(DWORD)
-{
-  return E_NOTIMPL;
-}
-
-STDMETHODIMP
-Callback::OnProgress(ULONG, ULONG, ULONG, LPCWSTR)
-{
-  return S_OK;
-}
-
-STDMETHODIMP
-Callback::OnStopBinding(HRESULT hr, LPCWSTR szError)
-{
-  if (pBinding_) {
-    pBinding_->Release();
-    pBinding_ = 0;
-  }
-  if (baseMoniker_) {
-    baseMoniker_->Release();
-    baseMoniker_ = 0;
-  }
-  stopHandler_(stopArg_, hr);
-  return S_OK;
-}
-
-STDMETHODIMP
-Callback::GetBindInfo(DWORD* pgrfBINDF, BINDINFO* pbindinfo)
-{
-  *pgrfBINDF = BINDF_ASYNCHRONOUS;
-  return S_OK;
-}
-
-static void
-reportError(XML_Parser parser)
-{
-  int code = XML_GetErrorCode(parser);
-  const XML_Char *message = XML_ErrorString(code);
-  if (message)
-    _ftprintf(stderr, _T("%s:%d:%ld: %s\n"),
-	     XML_GetBase(parser),
-	     XML_GetErrorLineNumber(parser),
-	     XML_GetErrorColumnNumber(parser),
-	     message);
-  else
-    _ftprintf(stderr, _T("%s: (unknown message %d)\n"),
-              XML_GetBase(parser), code);
-}
-
-STDMETHODIMP
-Callback::OnDataAvailable(DWORD grfBSCF,
-                          DWORD dwSize,
-                          FORMATETC *pfmtetc,
-                          STGMEDIUM* pstgmed)
-{
-  if (grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
-    IWinInetHttpInfo *hp;
-    HRESULT hr = pBinding_->QueryInterface(IID_IWinInetHttpInfo,
-                                           (void **)&hp);
-    if (SUCCEEDED(hr)) {
-      char contentType[1024];
-      DWORD bufSize = sizeof(contentType);
-      DWORD flags = 0;
-      contentType[0] = 0;
-      hr = hp->QueryInfo(HTTP_QUERY_CONTENT_TYPE, contentType,
-                         &bufSize, 0, NULL);
-      if (SUCCEEDED(hr)) {
-	char charset[CHARSET_MAX];
-	getXMLCharset(contentType, charset);
-	if (charset[0]) {
-#ifdef XML_UNICODE
-	  XML_Char wcharset[CHARSET_MAX];
-	  XML_Char *p1 = wcharset;
-	  const char *p2 = charset;
-	  while ((*p1++ = (unsigned char)*p2++) != 0)
-	    ;
-	  XML_SetEncoding(parser_, wcharset);
-#else
-	  XML_SetEncoding(parser_, charset);
-#endif
-	}
-      }
-      hp->Release();
-    }
-  }
-  if (!parser_)
-    return E_ABORT;
-  if (pstgmed->tymed == TYMED_ISTREAM) {
-    while (totalRead_ < dwSize) {
-#define READ_MAX (64*1024)
-      DWORD nToRead = dwSize - totalRead_;
-      if (nToRead > READ_MAX)
-	nToRead = READ_MAX;
-      void *buf = XML_GetBuffer(parser_, nToRead);
-      if (!buf) {
-	_ftprintf(stderr, _T("out of memory\n"));
-	return E_ABORT;
-      }
-      DWORD nRead;
-      HRESULT hr = pstgmed->pstm->Read(buf, nToRead, &nRead);
-      if (SUCCEEDED(hr)) {
-	totalRead_ += nRead;
-	if (!XML_ParseBuffer(parser_,
-			     nRead,
-			     (grfBSCF & BSCF_LASTDATANOTIFICATION) != 0
-			     && totalRead_ == dwSize)) {
-	  reportError(parser_);
-	  return E_ABORT;
-	}
-      }
-    }
-  }
-  return S_OK;
-}
-
-STDMETHODIMP
-Callback::OnObjectAvailable(REFIID, IUnknown *)
-{
-  return S_OK;
-}
-
-int
-Callback::externalEntityRef(const XML_Char *context,
-                            const XML_Char *systemId,
-                            const XML_Char *publicId)
-{
-  XML_Parser entParser = XML_ExternalEntityParserCreate(parser_, context, 0);
-  XML_SetBase(entParser, systemId);
-  int ret = processURL(entParser, baseMoniker_, systemId);
-  XML_ParserFree(entParser);
-  return ret;
-}
-
-Callback::Callback(XML_Parser parser, IMoniker *baseMoniker,
-                   StopHandler stopHandler, void *stopArg)
-: parser_(parser),
-  baseMoniker_(baseMoniker),
-  ref_(0),
-  pBinding_(0),
-  totalRead_(0),
-  stopHandler_(stopHandler),
-  stopArg_(stopArg)
-{
-  if (baseMoniker_)
-    baseMoniker_->AddRef();
-}
-
-Callback::~Callback()
-{
-  if (pBinding_)
-    pBinding_->Release();
-  if (baseMoniker_)
-    baseMoniker_->Release();
-}
-
-static int
-externalEntityRef(void *arg,
-                  const XML_Char *context,
-                  const XML_Char *base,
-                  const XML_Char *systemId,
-                  const XML_Char *publicId)
-{
-  return ((Callback *)arg)->externalEntityRef(context, systemId, publicId);
-}
-
-
-static HRESULT
-openStream(XML_Parser parser,
-           IMoniker *baseMoniker,
-           const XML_Char *uri,
-           StopHandler stopHandler, void *stopArg)
-{
-  if (!XML_SetBase(parser, uri))
-    return E_OUTOFMEMORY;
-  HRESULT hr;
-  IMoniker *m;
-#ifdef XML_UNICODE
-  hr = CreateURLMoniker(0, uri, &m);
-#else
-  LPWSTR uriw = new wchar_t[strlen(uri) + 1];
-  for (int i = 0;; i++) {
-    uriw[i] = uri[i];
-    if (uriw[i] == 0)
-      break;
-  }
-  hr = CreateURLMoniker(baseMoniker, uriw, &m);
-  delete [] uriw;
-#endif
-  if (FAILED(hr))
-    return hr;
-  IBindStatusCallback *cb = new Callback(parser, m, stopHandler, stopArg);
-  XML_SetExternalEntityRefHandler(parser, externalEntityRef);
-  XML_SetExternalEntityRefHandlerArg(parser, cb);
-  cb->AddRef();
-  IBindCtx *b;
-  if (FAILED(hr = CreateAsyncBindCtx(0, cb, 0, &b))) {
-    cb->Release();
-    m->Release();
-    return hr;
-  }
-  cb->Release();
-  IStream *pStream;
-  hr = m->BindToStorage(b, 0, IID_IStream, (void **)&pStream);
-  if (SUCCEEDED(hr)) {
-    if (pStream)
-      pStream->Release();
-  }
-  if (hr == MK_S_ASYNCHRONOUS)
-    hr = S_OK;
-  m->Release();
-  b->Release();
-  return hr;
-}
-
-struct QuitInfo {
-  const XML_Char *url;
-  HRESULT hr;
-  int stop;
-};
-
-static void
-winPerror(const XML_Char *url, HRESULT hr)
-{
-  LPVOID buf;
-  if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
-		    | FORMAT_MESSAGE_FROM_HMODULE,
-		    GetModuleHandleA("urlmon.dll"),
-		    hr,
-		    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-		    (LPTSTR) &buf,
-		    0,
-		    NULL)
-      || FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
-		      | FORMAT_MESSAGE_FROM_SYSTEM,
-		      0,
-		      hr,
-		      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-		      (LPTSTR) &buf,
-		      0,
-		      NULL)) {
-    /* The system error messages seem to end with a newline. */
-    _ftprintf(stderr, _T("%s: %s"), url, buf);
-    fflush(stderr);
-    LocalFree(buf);
-  }
-  else
-    _ftprintf(stderr, _T("%s: error %x\n"), url, hr);
-}
-
-static void
-threadQuit(void *p, HRESULT hr)
-{
-  QuitInfo *qi = (QuitInfo *)p;
-  qi->hr = hr;
-  qi->stop = 1;
-}
-
-extern "C"
-int
-XML_URLInit(void)
-{
-  return SUCCEEDED(CoInitialize(0));
-}
-
-extern "C"
-void
-XML_URLUninit(void)
-{
-  CoUninitialize();
-}
-
-static int
-processURL(XML_Parser parser, IMoniker *baseMoniker,
-           const XML_Char *url)
-{
-  QuitInfo qi;
-  qi.stop = 0;
-  qi.url = url;
-
-  XML_SetBase(parser, url);
-  HRESULT hr = openStream(parser, baseMoniker, url, threadQuit, &qi);
-  if (FAILED(hr)) {
-    winPerror(url, hr);
-    return 0;
-  }
-  else if (FAILED(qi.hr)) {
-    winPerror(url, qi.hr);
-    return 0;
-  }
-  MSG msg;
-  while (!qi.stop && GetMessage (&msg, NULL, 0, 0)) {
-    TranslateMessage (&msg);
-    DispatchMessage (&msg);
-  }
-  return 1;
-}
-
-extern "C"
-int
-XML_ProcessURL(XML_Parser parser,
-               const XML_Char *url,
-               unsigned flags)
-{
-  return processURL(parser, 0, url);
-}

部分文件因为文件数量过多而无法显示