Bladeren bron

Expat 2.2.5

Source commit: 472177bc5cc06b5d1573c59dbfb9db71d7f3c5a8
Martin Prikryl 8 jaren geleden
bovenliggende
commit
a4f5c61270
58 gewijzigde bestanden met toevoegingen van 1800 en 1049 verwijderingen
  1. 6 6
      libs/expat/CMake.README
  2. 6 12
      libs/expat/CMakeLists.txt
  3. 46 1
      libs/expat/Changes
  4. 2 2
      libs/expat/Makefile.am
  5. 3 2
      libs/expat/Makefile.in
  6. 6 2
      libs/expat/README.md
  7. 120 12
      libs/expat/configure
  8. 19 1
      libs/expat/configure.ac
  9. 9 4
      libs/expat/doc/Makefile.am
  10. 7 4
      libs/expat/doc/Makefile.in
  11. 0 20
      libs/expat/doc/doc.mk
  12. 8 3
      libs/expat/doc/xmlwf.1
  13. 14 2
      libs/expat/doc/xmlwf.xml
  14. 1 0
      libs/expat/examples/Makefile.in
  15. 15 8
      libs/expat/examples/elements.c
  16. 4 3
      libs/expat/examples/elements.vcxproj
  17. 16 9
      libs/expat/examples/outline.c
  18. 5 4
      libs/expat/examples/outline.vcxproj
  19. 5 5
      libs/expat/expat_config.h
  20. 1 0
      libs/expat/lib/Makefile.in
  21. 1 1
      libs/expat/lib/expat.h
  22. 5 4
      libs/expat/lib/expat.vcxproj
  23. 28 26
      libs/expat/lib/expat_external.h
  24. 5 4
      libs/expat/lib/expat_static.vcxproj
  25. 5 4
      libs/expat/lib/expatw.vcxproj
  26. 5 4
      libs/expat/lib/expatw_static.vcxproj
  27. 1 1
      libs/expat/lib/internal.h
  28. 2 0
      libs/expat/lib/libexpat.def
  29. 2 0
      libs/expat/lib/libexpatw.def
  30. 1 1
      libs/expat/lib/loadlibrary.c
  31. 280 376
      libs/expat/lib/xmlparse.c
  32. 27 16
      libs/expat/lib/xmltok.c
  33. 0 5
      libs/expat/lib/xmltok.h
  34. 0 73
      libs/expat/lib/xmltok_impl.c
  35. 3 0
      libs/expat/tests/Makefile.am
  36. 7 2
      libs/expat/tests/Makefile.in
  37. 1 0
      libs/expat/tests/benchmark/Makefile.in
  38. 10 3
      libs/expat/tests/benchmark/benchmark.c
  39. 1 49
      libs/expat/tests/chardata.c
  40. 0 4
      libs/expat/tests/chardata.h
  41. 321 208
      libs/expat/tests/runtests.c
  42. 2 0
      libs/expat/tests/runtests.vcxproj
  43. 6 0
      libs/expat/tests/runtests.vcxproj.filters
  44. 162 0
      libs/expat/tests/structdata.c
  45. 76 0
      libs/expat/tests/structdata.h
  46. 62 0
      libs/expat/tests/udiffer.py
  47. 2 27
      libs/expat/tests/xmltest.log.expected
  48. 4 2
      libs/expat/tests/xmltest.sh
  49. 9 6
      libs/expat/win32/expat.iss
  50. 9 2
      libs/expat/xmlwf/Makefile.am
  51. 70 8
      libs/expat/xmlwf/Makefile.in
  52. 36 24
      libs/expat/xmlwf/readfilemap.c
  53. 14 7
      libs/expat/xmlwf/unixfilemap.c
  54. 5 5
      libs/expat/xmlwf/win32filemap.c
  55. 8 4
      libs/expat/xmlwf/xmlfile.c
  56. 39 33
      libs/expat/xmlwf/xmltchar.h
  57. 293 46
      libs/expat/xmlwf/xmlwf.c
  58. 5 4
      libs/expat/xmlwf/xmlwf.vcxproj

+ 6 - 6
libs/expat/CMake.README

@@ -3,25 +3,25 @@
 The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual 
 The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual 
 Studio) and should work on all other platform cmake supports.
 Studio) and should work on all other platform cmake supports.
 
 
-Assuming ~/expat-2.2.4 is the source directory of expat, add a subdirectory
+Assuming ~/expat-2.2.5 is the source directory of expat, add a subdirectory
 build and change into that directory:
 build and change into that directory:
-~/expat-2.2.4$ mkdir build && cd build
-~/expat-2.2.4/build$
+~/expat-2.2.5$ mkdir build && cd build
+~/expat-2.2.5/build$
 
 
 From that directory, call cmake first, then call make, make test and 
 From that directory, call cmake first, then call make, make test and 
 make install in the usual way:
 make install in the usual way:
-~/expat-2.2.4/build$ cmake ..
+~/expat-2.2.5/build$ cmake ..
 -- The C compiler identification is GNU
 -- The C compiler identification is GNU
 -- The CXX compiler identification is GNU
 -- The CXX compiler identification is GNU
 ....
 ....
 -- Configuring done
 -- Configuring done
 -- Generating done
 -- Generating done
--- Build files have been written to: /home/patrick/expat-2.2.4/build
+-- Build files have been written to: /home/patrick/expat-2.2.5/build
 
 
 If you want to specify the install location for your files, append 
 If you want to specify the install location for your files, append 
 -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
 -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
 
 
-~/expat-2.2.4/build$ make && make test && make install
+~/expat-2.2.5/build$ make && make test && make install
 Scanning dependencies of target expat
 Scanning dependencies of target expat
 [  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
 [  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
 [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
 [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o

+ 6 - 12
libs/expat/CMakeLists.txt

@@ -6,7 +6,7 @@ project(expat)
 cmake_minimum_required(VERSION 2.6)
 cmake_minimum_required(VERSION 2.6)
 set(PACKAGE_BUGREPORT "[email protected]")
 set(PACKAGE_BUGREPORT "[email protected]")
 set(PACKAGE_NAME "expat")
 set(PACKAGE_NAME "expat")
-set(PACKAGE_VERSION "2.2.4")
+set(PACKAGE_VERSION "2.2.5")
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_TARNAME "${PACKAGE_NAME}")
 set(PACKAGE_TARNAME "${PACKAGE_NAME}")
 
 
@@ -18,7 +18,7 @@ endif()
 if(MSVC OR NOT BUILD_tools_default)
 if(MSVC OR NOT BUILD_tools_default)
     set(BUILD_doc_default OFF)
     set(BUILD_doc_default OFF)
 else()
 else()
-    find_program(DOCBOOK_TO_MAN NAMES docbook2x-man)
+    find_program(DOCBOOK_TO_MAN NAMES docbook2x-man docbook2man docbook-to-man)
     if(DOCBOOK_TO_MAN)
     if(DOCBOOK_TO_MAN)
         set(BUILD_doc_default ON)
         set(BUILD_doc_default ON)
     else()
     else()
@@ -113,7 +113,7 @@ if(USE_libbsd)
 endif()
 endif()
 
 
 set(LIBCURRENT 7)   # sync
 set(LIBCURRENT 7)   # sync
-set(LIBREVISION 6)  # with
+set(LIBREVISION 7)  # with
 set(LIBAGE 6)       # configure.ac!
 set(LIBAGE 6)       # configure.ac!
 math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
 math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
 
 
@@ -155,13 +155,7 @@ if(BUILD_tools)
     target_link_libraries(xmlwf expat)
     target_link_libraries(xmlwf expat)
     expat_install(TARGETS xmlwf DESTINATION bin)
     expat_install(TARGETS xmlwf DESTINATION bin)
     if(BUILD_doc)
     if(BUILD_doc)
-        if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
-            set(make_command "$(MAKE)")
-        else()
-            set(make_command "make")
-        endif()
-
-        add_custom_command(TARGET expat PRE_BUILD COMMAND "${make_command}" -f "${PROJECT_SOURCE_DIR}/doc/doc.mk" -C "${PROJECT_SOURCE_DIR}/doc" xmlwf.1 "DOCBOOK_TO_MAN=${DOCBOOK_TO_MAN}")
+        add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_SOURCE_DIR}/doc/xmlwf.1")
         expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1)
         expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1)
     endif()
     endif()
 endif()
 endif()
@@ -178,12 +172,12 @@ endif(BUILD_examples)
 
 
 if(BUILD_tests)
 if(BUILD_tests)
     ## these are unittests that can be run on any platform
     ## these are unittests that can be run on any platform
-    add_executable(runtests tests/runtests.c tests/chardata.c tests/minicheck.c tests/memcheck.c)
+    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)
     set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
     target_link_libraries(runtests expat)
     target_link_libraries(runtests expat)
     add_test(runtests tests/runtests)
     add_test(runtests tests/runtests)
 
 
-    add_executable(runtestspp tests/runtestspp.cpp tests/chardata.c tests/minicheck.c tests/memcheck.c)
+    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)
     set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
     target_link_libraries(runtestspp expat)
     target_link_libraries(runtestspp expat)
     add_test(runtestspp tests/runtestspp)
     add_test(runtestspp tests/runtestspp)

+ 46 - 1
libs/expat/Changes

@@ -2,7 +2,52 @@ NOTE: We are looking for help with a few things:
       https://github.com/libexpat/libexpat/labels/help%20wanted
       https://github.com/libexpat/libexpat/labels/help%20wanted
       If you can help, please get in touch.  Thanks!
       If you can help, please get in touch.  Thanks!
 
 
-Release 2.2.4 Sat Auguest 19 2017
+Release 2.2.5 Tue October 31 2017
+        Bug fixes:
+              #8  If the parser runs out of memory, make sure its internal
+                    state reflects the memory it actually has, not the memory
+                    it wanted to have.
+             #11  The default handler wasn't being called when it should for
+                    a SYSTEM or PUBLIC doctype if an entity declaration handler
+                    was registered.
+       #137 #138  Fix a case of mistakenly reported parsing success where
+                    XML_StopParser was called from an element handler
+            #162  Function XML_ErrorString was returning NULL rather than
+                    a message for code XML_ERROR_INVALID_ARGUMENT
+                    introduced with release 2.2.1
+
+        Other changes:
+            #106  xmlwf: Add argument -N adding notation declarations
+        #75 #106  Test suite: Resolve expected failure cases where xmlwf
+                    output was incomplete
+            #127  Windows: Fix test suite compilation
+       #126 #127  Windows: Fix compilation for Visual Studio 2012
+        #33 #132  tests: Mass-fix compilation for XML_UNICODE_WCHAR_T
+            #129  examples: Fix compilation for XML_UNICODE_WCHAR_T
+            #130  benchmark: Fix compilation for XML_UNICODE_WCHAR_T
+            #144  xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs
+                    Windows or MinGW for 2-byte wchar_t
+              #9  Address two Clang Static Analyzer false positives
+             #59  Resolve troublesome macros hiding parser struct membership
+                    and dereferencing that pointer
+              #6  Resolve superfluous internal malloc/realloc switch
+       #153 #155  Improve docbook2x-man detection
+            #160  Undefine NDEBUG in the test suite (rather than rejecting it)
+            #161  Address compiler warnings
+                  Version info bumped from 7:6:6 to 7:7:6
+
+        Special thanks to:
+            Benbuck Nason
+            Hans Wennborg
+            José Gutiérrez de la Concha
+            Pedro Monreal Gonzalez
+            Rhodri James
+            Rolf Ade
+            Stephen Groat
+                 and
+            Core Infrastructure Initiative
+
+Release 2.2.4 Sat August 19 2017
         Bug fixes:
         Bug fixes:
             #115  Fix copying of partial characters for UTF-8 input
             #115  Fix copying of partial characters for UTF-8 input
 
 

+ 2 - 2
libs/expat/Makefile.am

@@ -103,7 +103,7 @@ buildlib:
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:  * Mass-patch Makefile.am, e.g.' >&2
 	@echo 'ERROR:  * Mass-patch Makefile.am, e.g.' >&2
 	@echo 'ERROR:    # find -name Makefile.am -exec sed \' >&2
 	@echo 'ERROR:    # find -name Makefile.am -exec sed \' >&2
-	@echo 'ERROR:          -e "s,libexpat\.la,libexpatw\.la," \' >&2
+	@echo 'ERROR:          -e "s,libexpat\.la,libexpatw.la," \' >&2
 	@echo 'ERROR:          -e "s,libexpat_la,libexpatw_la," \' >&2
 	@echo 'ERROR:          -e "s,libexpat_la,libexpatw_la," \' >&2
 	@echo 'ERROR:          -i {} +' >&2
 	@echo 'ERROR:          -i {} +' >&2
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:' >&2
@@ -119,7 +119,7 @@ buildlib:
 .PHONY: run-benchmark
 .PHONY: run-benchmark
 run-benchmark:
 run-benchmark:
 	$(MAKE) -C tests/benchmark
 	$(MAKE) -C tests/benchmark
-	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
+	./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
 
 
 tests/xmlts.zip:
 tests/xmlts.zip:
 	if test "$(XMLTS_ZIP)" = ""; then \
 	if test "$(XMLTS_ZIP)" = ""; then \

+ 3 - 2
libs/expat/Makefile.in

@@ -296,6 +296,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@
@@ -976,7 +977,7 @@ buildlib:
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:  * Mass-patch Makefile.am, e.g.' >&2
 	@echo 'ERROR:  * Mass-patch Makefile.am, e.g.' >&2
 	@echo 'ERROR:    # find -name Makefile.am -exec sed \' >&2
 	@echo 'ERROR:    # find -name Makefile.am -exec sed \' >&2
-	@echo 'ERROR:          -e "s,libexpat\.la,libexpatw\.la," \' >&2
+	@echo 'ERROR:          -e "s,libexpat\.la,libexpatw.la," \' >&2
 	@echo 'ERROR:          -e "s,libexpat_la,libexpatw_la," \' >&2
 	@echo 'ERROR:          -e "s,libexpat_la,libexpatw_la," \' >&2
 	@echo 'ERROR:          -i {} +' >&2
 	@echo 'ERROR:          -i {} +' >&2
 	@echo 'ERROR:' >&2
 	@echo 'ERROR:' >&2
@@ -991,7 +992,7 @@ buildlib:
 .PHONY: run-benchmark
 .PHONY: run-benchmark
 run-benchmark:
 run-benchmark:
 	$(MAKE) -C tests/benchmark
 	$(MAKE) -C tests/benchmark
-	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
+	./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
 
 
 tests/xmlts.zip:
 tests/xmlts.zip:
 	if test "$(XMLTS_ZIP)" = ""; then \
 	if test "$(XMLTS_ZIP)" = ""; then \

+ 6 - 2
libs/expat/README.md

@@ -1,4 +1,8 @@
-# Expat, Release 2.2.4
+[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat)
+[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
+
+
+# Expat, Release 2.2.5
 
 
 This is Expat, a C library for parsing XML, started by
 This is Expat, a C library for parsing XML, started by
 [James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
 [James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
@@ -79,7 +83,7 @@ support this mode of compilation (yet):
 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
    <br/>
    <br/>
    `find -name Makefile.am -exec sed
    `find -name Makefile.am -exec sed
-       -e 's,libexpat\.la,libexpatw\.la,'
+       -e 's,libexpat\.la,libexpatw.la,'
        -e 's,libexpat_la,libexpatw_la,'
        -e 's,libexpat_la,libexpatw_la,'
        -i {} +`
        -i {} +`
 
 

+ 120 - 12
libs/expat/configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for expat 2.2.4.
+# Generated by GNU Autoconf 2.69 for expat 2.2.5.
 #
 #
 # Report bugs to <[email protected]>.
 # Report bugs to <[email protected]>.
 #
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 # Identity of this package.
 PACKAGE_NAME='expat'
 PACKAGE_NAME='expat'
 PACKAGE_TARNAME='expat'
 PACKAGE_TARNAME='expat'
-PACKAGE_VERSION='2.2.4'
-PACKAGE_STRING='expat 2.2.4'
+PACKAGE_VERSION='2.2.5'
+PACKAGE_STRING='expat 2.2.5'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 PACKAGE_URL=''
 
 
@@ -637,7 +637,14 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LTLIBOBJS
 LIBOBJS
 LIBOBJS
+WITH_DOCBOOK_FALSE
+WITH_DOCBOOK_TRUE
+DOCBOOK_TO_MAN
 FILEMAP
 FILEMAP
+UNICODE_FALSE
+UNICODE_TRUE
+MINGW_FALSE
+MINGW_TRUE
 WITH_XMLWF_FALSE
 WITH_XMLWF_FALSE
 WITH_XMLWF_TRUE
 WITH_XMLWF_TRUE
 CXXCPP
 CXXCPP
@@ -780,6 +787,7 @@ enable_libtool_lock
 with_xmlwf
 with_xmlwf
 with_libbsd
 with_libbsd
 enable_xml_context
 enable_xml_context
+with_docbook
 '
 '
       ac_precious_vars='build_alias
       ac_precious_vars='build_alias
 host_alias
 host_alias
@@ -794,7 +802,8 @@ CPP
 CXX
 CXX
 CXXFLAGS
 CXXFLAGS
 CCC
 CCC
-CXXCPP'
+CXXCPP
+DOCBOOK_TO_MAN'
 
 
 
 
 # Initialize some variables set by options.
 # Initialize some variables set by options.
@@ -1335,7 +1344,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # 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.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
   cat <<_ACEOF
-\`configure' configures expat 2.2.4 to adapt to many kinds of systems.
+\`configure' configures expat 2.2.5 to adapt to many kinds of systems.
 
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
@@ -1405,7 +1414,7 @@ fi
 
 
 if test -n "$ac_init_help"; then
 if test -n "$ac_init_help"; then
   case $ac_init_help in
   case $ac_init_help in
-     short | recursive ) echo "Configuration of expat 2.2.4:";;
+     short | recursive ) echo "Configuration of expat 2.2.5:";;
    esac
    esac
   cat <<\_ACEOF
   cat <<\_ACEOF
 
 
@@ -1445,6 +1454,8 @@ Optional Packages:
 
 
   --with-libbsd           utilize libbsd (for arc4random_buf)
   --with-libbsd           utilize libbsd (for arc4random_buf)
 
 
+  --with-docbook          enforce XML to man page compilation [default=check]
+  --without-docbook       skip XML to man page compilation [default=check]
 
 
 Some influential environment variables:
 Some influential environment variables:
   CC          C compiler command
   CC          C compiler command
@@ -1460,6 +1471,8 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
   CXXCPP      C++ preprocessor
+  DOCBOOK_TO_MAN
+              docbook2x-man command
 
 
 Use these variables to override the choices made by `configure' or to help
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 it to find libraries and programs with nonstandard names/locations.
@@ -1527,7 +1540,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
 if $ac_init_version; then
   cat <<\_ACEOF
   cat <<\_ACEOF
-expat configure 2.2.4
+expat configure 2.2.5
 generated by GNU Autoconf 2.69
 generated by GNU Autoconf 2.69
 
 
 Copyright (C) 2012 Free Software Foundation, Inc.
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2071,7 +2084,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 running configure, to aid debugging if configure makes a mistake.
 
 
-It was created by expat $as_me 2.2.4, which was
+It was created by expat $as_me 2.2.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
 
   $ $0 $@
   $ $0 $@
@@ -2940,7 +2953,7 @@ fi
 
 
 # Define the identity of the package.
 # Define the identity of the package.
  PACKAGE='expat'
  PACKAGE='expat'
- VERSION='2.2.4'
+ VERSION='2.2.5'
 
 
 
 
 cat >>confdefs.h <<_ACEOF
 cat >>confdefs.h <<_ACEOF
@@ -3038,7 +3051,7 @@ fi
 
 
 
 
 LIBCURRENT=7   # sync
 LIBCURRENT=7   # sync
-LIBREVISION=6  # with
+LIBREVISION=7  # with
 LIBAGE=6       # CMakeLists.txt!
 LIBAGE=6       # CMakeLists.txt!
 
 
 CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
 CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
@@ -16765,6 +16778,23 @@ else
 fi
 fi
 
 
 
 
+ if echo -- "${host}" | fgrep -q mingw; then
+  MINGW_TRUE=
+  MINGW_FALSE='#'
+else
+  MINGW_TRUE='#'
+  MINGW_FALSE=
+fi
+
+ if echo -- "${CPPFLAGS}${CFLAGS}" | fgrep -q XML_UNICODE; then
+  UNICODE_TRUE=
+  UNICODE_FALSE='#'
+else
+  UNICODE_TRUE='#'
+  UNICODE_FALSE=
+fi
+
+
 
 
 
 
 # Check whether --with-libbsd was given.
 # Check whether --with-libbsd was given.
@@ -17223,6 +17253,72 @@ _ACEOF
 
 
 fi
 fi
 
 
+
+# Check whether --with-docbook was given.
+if test "${with_docbook+set}" = set; then :
+  withval=$with_docbook;
+else
+  with_docbook=check
+fi
+
+
+
+if test "x$with_docbook" != xno; then :
+  for ac_prog in docbook2x-man docbook2man docbook-to-man
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DOCBOOK_TO_MAN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DOCBOOK_TO_MAN"; then
+  ac_cv_prog_DOCBOOK_TO_MAN="$DOCBOOK_TO_MAN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DOCBOOK_TO_MAN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DOCBOOK_TO_MAN=$ac_cv_prog_DOCBOOK_TO_MAN
+if test -n "$DOCBOOK_TO_MAN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5
+$as_echo "$DOCBOOK_TO_MAN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$DOCBOOK_TO_MAN" && break
+done
+test -n "$DOCBOOK_TO_MAN" || DOCBOOK_TO_MAN="if test "x$with_docbook" != xcheck; then
+    as_fn_error $? "Required program 'docbook2x-man' not found." "$LINENO" 5"
+
+fi
+
+ if test x${DOCBOOK_TO_MAN} != x; then
+  WITH_DOCBOOK_TRUE=
+  WITH_DOCBOOK_FALSE='#'
+else
+  WITH_DOCBOOK_TRUE='#'
+  WITH_DOCBOOK_FALSE=
+fi
+
+
 ac_config_files="$ac_config_files Makefile expat.pc"
 ac_config_files="$ac_config_files Makefile expat.pc"
 
 
 ac_config_files="$ac_config_files doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile"
 ac_config_files="$ac_config_files doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile"
@@ -17370,6 +17466,18 @@ if test -z "${WITH_XMLWF_TRUE}" && test -z "${WITH_XMLWF_FALSE}"; then
   as_fn_error $? "conditional \"WITH_XMLWF\" was never defined.
   as_fn_error $? "conditional \"WITH_XMLWF\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 fi
+if test -z "${MINGW_TRUE}" && test -z "${MINGW_FALSE}"; then
+  as_fn_error $? "conditional \"MINGW\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${UNICODE_TRUE}" && test -z "${UNICODE_FALSE}"; then
+  as_fn_error $? "conditional \"UNICODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_DOCBOOK_TRUE}" && test -z "${WITH_DOCBOOK_FALSE}"; then
+  as_fn_error $? "conditional \"WITH_DOCBOOK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 
 : "${CONFIG_STATUS=./config.status}"
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_write_fail=0
@@ -17767,7 +17875,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 # values after options handling.
 ac_log="
 ac_log="
-This file was extended by expat $as_me 2.2.4, which was
+This file was extended by expat $as_me 2.2.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_FILES    = $CONFIG_FILES
@@ -17833,7 +17941,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 ac_cs_version="\\
-expat config.status 2.2.4
+expat config.status 2.2.5
 configured by $0, generated by GNU Autoconf 2.69,
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
   with options \\"\$ac_cs_config\\"
 
 

+ 19 - 1
libs/expat/configure.ac

@@ -47,7 +47,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0
 dnl
 dnl
 
 
 LIBCURRENT=7   # sync
 LIBCURRENT=7   # sync
-LIBREVISION=6  # with
+LIBREVISION=7  # with
 LIBAGE=6       # CMakeLists.txt!
 LIBAGE=6       # CMakeLists.txt!
 
 
 CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
 CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
@@ -106,6 +106,9 @@ AC_ARG_WITH([xmlwf], [
 AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [with_xmlwf=yes])
 AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [with_xmlwf=yes])
 AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
 AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
 
 
+AM_CONDITIONAL([MINGW], [echo -- "${host}" | fgrep -q mingw])
+AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | fgrep -q XML_UNICODE])
+
 
 
 AC_ARG_WITH([libbsd], [
 AC_ARG_WITH([libbsd], [
 AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])
 AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])
@@ -225,6 +228,21 @@ AS_IF([test "x${enable_xml_context}" != "xno"], [
     [Define to specify how much context to retain around the current parse point.])
     [Define to specify how much context to retain around the current parse point.])
 ])
 ])
 
 
+AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook],
+    [enforce XML to man page compilation @<:@default=check@:>@])
+AS_HELP_STRING([--without-docbook],
+    [skip XML to man page compilation @<:@default=check@:>@])],
+  [],
+  [with_docbook=check])
+
+AC_ARG_VAR([DOCBOOK_TO_MAN], [docbook2x-man command])
+AS_IF([test "x$with_docbook" != xno],
+  [AC_CHECK_PROGS([DOCBOOK_TO_MAN], [docbook2x-man docbook2man docbook-to-man],
+  [if test "x$with_docbook" != xcheck; then 
+    AC_MSG_ERROR([Required program 'docbook2x-man' not found.])])])
+
+AM_CONDITIONAL(WITH_DOCBOOK, [test x${DOCBOOK_TO_MAN} != x])
+
 AC_CONFIG_FILES([Makefile expat.pc])
 AC_CONFIG_FILES([Makefile expat.pc])
 AC_CONFIG_FILES([
 AC_CONFIG_FILES([
   doc/Makefile
   doc/Makefile

+ 9 - 4
libs/expat/doc/Makefile.am

@@ -30,8 +30,14 @@
 
 
 dist_man_MANS = xmlwf.1
 dist_man_MANS = xmlwf.1
 
 
-xmlwf.1: doc.mk xmlwf.xml
-	$(MAKE) -f $(srcdir)/doc.mk xmlwf.1 srcdir=$(srcdir)
+xmlwf.1: xmlwf.xml
+if WITH_DOCBOOK
+	$(DOCBOOK_TO_MAN) $<
+	mv XMLWF.1 $@
+else
+	@echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
+	@false
+endif
 
 
 # https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
 # https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
 .PHONY: clean-local
 .PHONY: clean-local
@@ -39,10 +45,9 @@ clean-local: clean-local-check
 
 
 .PHONY: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
 clean-local-check:
-	$(MAKE) -f $(srcdir)/doc.mk clean
+	$(RM) xmlwf.1
 
 
 EXTRA_DIST = \
 EXTRA_DIST = \
-    doc.mk \
     expat.png \
     expat.png \
     reference.html \
     reference.html \
     style.css \
     style.css \

+ 7 - 4
libs/expat/doc/Makefile.in

@@ -206,6 +206,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@
@@ -311,7 +312,6 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
 dist_man_MANS = xmlwf.1
 dist_man_MANS = xmlwf.1
 EXTRA_DIST = \
 EXTRA_DIST = \
-    doc.mk \
     expat.png \
     expat.png \
     reference.html \
     reference.html \
     style.css \
     style.css \
@@ -559,8 +559,11 @@ uninstall-man: uninstall-man1
 .PRECIOUS: Makefile
 .PRECIOUS: Makefile
 
 
 
 
-xmlwf.1: doc.mk xmlwf.xml
-	$(MAKE) -f $(srcdir)/doc.mk xmlwf.1 srcdir=$(srcdir)
+xmlwf.1: xmlwf.xml
+@WITH_DOCBOOK_TRUE@	$(DOCBOOK_TO_MAN) $<
+@WITH_DOCBOOK_TRUE@	mv XMLWF.1 $@
+@WITH_DOCBOOK_FALSE@	@echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2
+@WITH_DOCBOOK_FALSE@	@false
 
 
 # https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
 # https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned
 .PHONY: clean-local
 .PHONY: clean-local
@@ -568,7 +571,7 @@ clean-local: clean-local-check
 
 
 .PHONY: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
 clean-local-check:
-	$(MAKE) -f $(srcdir)/doc.mk clean
+	$(RM) xmlwf.1
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # 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.
 # Otherwise a system limit (for SysV at least) may be exceeded.

+ 0 - 20
libs/expat/doc/doc.mk

@@ -1,20 +0,0 @@
-# Copyright (C) Sebastian Pipping <[email protected]>
-# Licensed under MIT/X License
-
-DOCBOOK_TO_MAN = docbook2x-man
-
-srcdir = .
-
-
-.PHONY: all
-all: xmlwf.1
-
-xmlwf.1: XMLWF.1
-	cp $< $@
-
-XMLWF.1: $(srcdir)/xmlwf.xml
-	$(DOCBOOK_TO_MAN) $(srcdir)/xmlwf.xml
-
-.PHONY: clean
-clean:
-	$(RM) xmlwf.1 XMLWF.1

+ 8 - 3
libs/expat/doc/xmlwf.1

@@ -15,7 +15,7 @@ xmlwf \- Determines if an XML document is well-formed
 \fBxmlwf\fR \kx
 \fBxmlwf\fR \kx
 .if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
 .if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
 'in \n(.iu+\nxu
 'in \n(.iu+\nxu
-[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-v\fR] [file ...]
+[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-N\fR] [\fB-v\fR] [file ...]
 'in \n(.iu-\nxu
 'in \n(.iu-\nxu
 .ad b
 .ad b
 'hy
 'hy
@@ -78,8 +78,8 @@ Specifies a directory to contain transformed
 representations of the input files.
 representations of the input files.
 By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
 By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
 (described below).
 (described below).
-You can select different output formats using \*(T<\fB\-c\fR\*(T>
-and \*(T<\fB\-m\fR\*(T>.
+You can select different output formats using \*(T<\fB\-c\fR\*(T>,
+\*(T<\fB\-m\fR\*(T> and \*(T<\fB\-N\fR\*(T>.
 
 
 The output filenames will
 The output filenames will
 be exactly the same as the input filenames or "STDIN" if the input is
 be exactly the same as the input filenames or "STDIN" if the input is
@@ -115,6 +115,11 @@ Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
 Turns on namespace processing. (describe namespaces)
 Turns on namespace processing. (describe namespaces)
 \*(T<\fB\-c\fR\*(T> disables namespaces.
 \*(T<\fB\-c\fR\*(T> disables namespaces.
 .TP 
 .TP 
+\*(T<\fB\-N\fR\*(T>
+Adds a doctype and notation declarations to canonical XML output.
+This matches the example output used by the formal XML test cases.
+Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
+.TP 
 \*(T<\fB\-p\fR\*(T>
 \*(T<\fB\-p\fR\*(T>
 Tells xmlwf to process external DTDs and parameter
 Tells xmlwf to process external DTDs and parameter
 entities.
 entities.

+ 14 - 2
libs/expat/doc/xmlwf.xml

@@ -58,6 +58,7 @@
 
 
 	  <arg><option>-r</option></arg>
 	  <arg><option>-r</option></arg>
 	  <arg><option>-t</option></arg>
 	  <arg><option>-t</option></arg>
+          <arg><option>-N</option></arg>
 
 
 	  <arg><option>-v</option></arg>
 	  <arg><option>-v</option></arg>
 
 
@@ -159,8 +160,8 @@ supports both.
   representations of the input files.
   representations of the input files.
   By default, <option>-d</option> outputs a canonical representation
   By default, <option>-d</option> outputs a canonical representation
   (described below).
   (described below).
-  You can select different output formats using <option>-c</option>
-  and <option>-m</option>.
+  You can select different output formats using <option>-c</option>,
+  <option>-m</option> and <option>-N</option>.
 	  </para>
 	  </para>
 	  <para>
 	  <para>
   The output filenames will
   The output filenames will
@@ -219,6 +220,17 @@ supports both.
         </listitem>
         </listitem>
       </varlistentry>
       </varlistentry>
 
 
+      <varlistentry>
+        <term><option>-N</option></term>
+        <listitem>
+          <para>
+  Adds a doctype and notation declarations to canonical XML output.
+  This matches the example output used by the formal XML test cases.
+  Requires <option>-d</option> to specify an output file.
+          </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
       <varlistentry>
         <term><option>-p</option></term>
         <term><option>-p</option></term>
         <listitem>
         <listitem>

+ 1 - 0
libs/expat/examples/Makefile.in

@@ -229,6 +229,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@

+ 15 - 8
libs/expat/examples/elements.c

@@ -38,17 +38,24 @@
 #include <expat.h>
 #include <expat.h>
 
 
 #ifdef XML_LARGE_SIZE
 #ifdef XML_LARGE_SIZE
-#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-#define XML_FMT_INT_MOD "I64"
+# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
+#  define XML_FMT_INT_MOD "I64"
+# else
+#  define XML_FMT_INT_MOD "ll"
+# endif
 #else
 #else
-#define XML_FMT_INT_MOD "ll"
+# define XML_FMT_INT_MOD "l"
 #endif
 #endif
+
+#ifdef XML_UNICODE_WCHAR_T
+# include <wchar.h>
+# define XML_FMT_STR "ls"
 #else
 #else
-#define XML_FMT_INT_MOD "l"
+# define XML_FMT_STR "s"
 #endif
 #endif
 
 
 static void XMLCALL
 static void XMLCALL
-startElement(void *userData, const char *name, const char **atts)
+startElement(void *userData, const XML_Char *name, const XML_Char **atts)
 {
 {
   int i;
   int i;
   int *depthPtr = (int *)userData;
   int *depthPtr = (int *)userData;
@@ -56,12 +63,12 @@ startElement(void *userData, const char *name, const char **atts)
 
 
   for (i = 0; i < *depthPtr; i++)
   for (i = 0; i < *depthPtr; i++)
     putchar('\t');
     putchar('\t');
-  puts(name);
+  printf("%" XML_FMT_STR "\n", name);
   *depthPtr += 1;
   *depthPtr += 1;
 }
 }
 
 
 static void XMLCALL
 static void XMLCALL
-endElement(void *userData, const char *name)
+endElement(void *userData, const XML_Char *name)
 {
 {
   int *depthPtr = (int *)userData;
   int *depthPtr = (int *)userData;
   (void)name;
   (void)name;
@@ -86,7 +93,7 @@ main(int argc, char *argv[])
     done = len < sizeof(buf);
     done = len < sizeof(buf);
     if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
     if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
       fprintf(stderr,
       fprintf(stderr,
-              "%s at line %" XML_FMT_INT_MOD "u\n",
+              "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n",
               XML_ErrorString(XML_GetErrorCode(parser)),
               XML_ErrorString(XML_GetErrorCode(parser)),
               XML_GetCurrentLineNumber(parser));
               XML_GetCurrentLineNumber(parser));
       return 1;
       return 1;

+ 4 - 3
libs/expat/examples/elements.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -14,17 +14,18 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{35262250-C85F-463A-9F6D-670088BFA17E}</ProjectGuid>
     <ProjectGuid>{35262250-C85F-463A-9F6D-670088BFA17E}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 16 - 9
libs/expat/examples/outline.c

@@ -36,13 +36,19 @@
 #include <expat.h>
 #include <expat.h>
 
 
 #ifdef XML_LARGE_SIZE
 #ifdef XML_LARGE_SIZE
-#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-#define XML_FMT_INT_MOD "I64"
+# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
+#  define XML_FMT_INT_MOD "I64"
+# else
+#  define XML_FMT_INT_MOD "ll"
+# endif
 #else
 #else
-#define XML_FMT_INT_MOD "ll"
+# define XML_FMT_INT_MOD "l"
 #endif
 #endif
+
+#ifdef XML_UNICODE_WCHAR_T
+# define XML_FMT_STR "ls"
 #else
 #else
-#define XML_FMT_INT_MOD "l"
+# define XML_FMT_STR "s"
 #endif
 #endif
 
 
 #define BUFFSIZE        8192
 #define BUFFSIZE        8192
@@ -52,7 +58,7 @@ char Buff[BUFFSIZE];
 int Depth;
 int Depth;
 
 
 static void XMLCALL
 static void XMLCALL
-start(void *data, const char *el, const char **attr)
+start(void *data, const XML_Char *el, const XML_Char **attr)
 {
 {
   int i;
   int i;
   (void)data;
   (void)data;
@@ -60,10 +66,10 @@ start(void *data, const char *el, const char **attr)
   for (i = 0; i < Depth; i++)
   for (i = 0; i < Depth; i++)
     printf("  ");
     printf("  ");
 
 
-  printf("%s", el);
+  printf("%" XML_FMT_STR, el);
 
 
   for (i = 0; attr[i]; i += 2) {
   for (i = 0; attr[i]; i += 2) {
-    printf(" %s='%s'", attr[i], attr[i + 1]);
+    printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", attr[i], attr[i + 1]);
   }
   }
 
 
   printf("\n");
   printf("\n");
@@ -71,7 +77,7 @@ start(void *data, const char *el, const char **attr)
 }
 }
 
 
 static void XMLCALL
 static void XMLCALL
-end(void *data, const char *el)
+end(void *data, const XML_Char *el)
 {
 {
   (void)data;
   (void)data;
   (void)el;
   (void)el;
@@ -105,7 +111,8 @@ main(int argc, char *argv[])
     done = feof(stdin);
     done = feof(stdin);
 
 
     if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
     if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
-      fprintf(stderr, "Parse error at line %" XML_FMT_INT_MOD "u:\n%s\n",
+      fprintf(stderr,
+              "Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
               XML_GetCurrentLineNumber(p),
               XML_GetCurrentLineNumber(p),
               XML_ErrorString(XML_GetErrorCode(p)));
               XML_ErrorString(XML_GetErrorCode(p)));
       exit(-1);
       exit(-1);

+ 5 - 4
libs/expat/examples/outline.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,21 +18,22 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}</ProjectGuid>
     <ProjectGuid>{DE74E6FD-E107-4326-B1B0-A0CFEEB64F25}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 5 - 5
libs/expat/expat_config.h

@@ -23,7 +23,7 @@
 #define HAVE_GETPAGESIZE 1
 #define HAVE_GETPAGESIZE 1
 
 
 /* Define to 1 if you have the `getrandom' function. */
 /* Define to 1 if you have the `getrandom' function. */
-/* #undef HAVE_GETRANDOM */
+#define HAVE_GETRANDOM 1
 
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 #define HAVE_INTTYPES_H 1
@@ -53,7 +53,7 @@
 #define HAVE_STRING_H 1
 #define HAVE_STRING_H 1
 
 
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
-#define HAVE_SYSCALL_GETRANDOM 1
+/* #undef HAVE_SYSCALL_GETRANDOM */
 
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_PARAM_H 1
@@ -80,7 +80,7 @@
 #define PACKAGE_NAME "expat"
 #define PACKAGE_NAME "expat"
 
 
 /* Define to the full name and version of this package. */
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.2.4"
+#define PACKAGE_STRING "expat 2.2.5"
 
 
 /* Define to the one symbol short name of this package. */
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "expat"
 #define PACKAGE_TARNAME "expat"
@@ -89,13 +89,13 @@
 #define PACKAGE_URL ""
 #define PACKAGE_URL ""
 
 
 /* Define to the version of this package. */
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.2.4"
+#define PACKAGE_VERSION "2.2.5"
 
 
 /* Define to 1 if you have the ANSI C header files. */
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 #define STDC_HEADERS 1
 
 
 /* Version number of package */
 /* Version number of package */
-#define VERSION "2.2.4"
+#define VERSION "2.2.5"
 
 
 /* whether byteorder is bigendian */
 /* whether byteorder is bigendian */
 /* #undef WORDS_BIGENDIAN */
 /* #undef WORDS_BIGENDIAN */

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

@@ -263,6 +263,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@

+ 1 - 1
libs/expat/lib/expat.h

@@ -1076,7 +1076,7 @@ XML_GetFeatureList(void);
 */
 */
 #define XML_MAJOR_VERSION 2
 #define XML_MAJOR_VERSION 2
 #define XML_MINOR_VERSION 2
 #define XML_MINOR_VERSION 2
-#define XML_MICRO_VERSION 4
+#define XML_MICRO_VERSION 5
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }

+ 5 - 4
libs/expat/lib/expat.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,21 +18,22 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{45A5074D-66E8-44A4-A03F-018027B528D6}</ProjectGuid>
     <ProjectGuid>{45A5074D-66E8-44A4-A03F-018027B528D6}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 28 - 26
libs/expat/lib/expat_external.h

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

+ 5 - 4
libs/expat/lib/expat_static.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,21 +18,22 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}</ProjectGuid>
     <ProjectGuid>{58A821BC-E4AF-4DF4-9A54-2BAA22B92615}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 5 - 4
libs/expat/lib/expatw.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,21 +18,22 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}</ProjectGuid>
     <ProjectGuid>{C04F1C11-7079-48AD-A90B-6F59B7A55BEF}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 5 - 4
libs/expat/lib/expatw_static.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,21 +18,22 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}</ProjectGuid>
     <ProjectGuid>{9220B0F2-C895-4CB2-91D1-1C16C4ECB759}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   </PropertyGroup>

+ 1 - 1
libs/expat/lib/internal.h

@@ -116,7 +116,7 @@ extern "C" {
 
 
 
 
 void
 void
-align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef);
+_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
 
 
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 2 - 0
libs/expat/lib/libexpat.def

@@ -74,3 +74,5 @@ EXPORTS
 ; added with version 2.1.1
 ; added with version 2.1.1
 ; XML_GetAttributeInfo @66
 ; XML_GetAttributeInfo @66
   XML_SetHashSalt @67@
   XML_SetHashSalt @67@
+; added with version 2.2.5
+  _INTERNAL_trim_to_complete_utf8_characters @68@

+ 2 - 0
libs/expat/lib/libexpatw.def

@@ -74,3 +74,5 @@ EXPORTS
 ; added with version 2.1.1
 ; added with version 2.1.1
 ; XML_GetAttributeInfo @66
 ; XML_GetAttributeInfo @66
   XML_SetHashSalt @67@
   XML_SetHashSalt @67@
+; added with version 2.2.5
+  _INTERNAL_trim_to_complete_utf8_characters @68@

+ 1 - 1
libs/expat/lib/loadlibrary.c

@@ -84,7 +84,7 @@ HMODULE _Expat_LoadLibrary(LPCTSTR filename)
   /* Get a handle to kernel32 so we can access it's functions at runtime */
   /* Get a handle to kernel32 so we can access it's functions at runtime */
   HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32"));
   HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32"));
   if(!hKernel32)
   if(!hKernel32)
-    return NULL;
+    return NULL;  /* LCOV_EXCL_LINE */
 
 
   /* Attempt to find LoadLibraryEx() which is only available on Windows 2000
   /* Attempt to find LoadLibraryEx() which is only available on Windows 2000
      and above */
      and above */

File diff suppressed because it is too large
+ 280 - 376
libs/expat/lib/xmlparse.c


+ 27 - 16
libs/expat/lib/xmltok.c

@@ -31,8 +31,17 @@
 */
 */
 
 
 #include <stddef.h>
 #include <stddef.h>
-#include <stdbool.h>
-#include <string.h>  // memcpy
+#include <string.h>  /* memcpy */
+
+#if defined(_MSC_VER) && (_MSC_VER <= 1700)
+  /* for vs2012/11.0/1700 and earlier Visual Studio compilers */
+# define bool   int
+# define false  0
+# define true   1
+#else
+# include <stdbool.h>
+#endif
+
 
 
 #ifdef _WIN32
 #ifdef _WIN32
 #include "winconfig.h"
 #include "winconfig.h"
@@ -57,7 +66,6 @@
   { PREFIX(prologTok), PREFIX(contentTok), \
   { PREFIX(prologTok), PREFIX(contentTok), \
     PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \
     PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \
   { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
   { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
-  PREFIX(sameName), \
   PREFIX(nameMatchesAscii), \
   PREFIX(nameMatchesAscii), \
   PREFIX(nameLength), \
   PREFIX(nameLength), \
   PREFIX(skipS), \
   PREFIX(skipS), \
@@ -354,7 +362,7 @@ enum {  /* UTF8_cvalN is value of masked first byte of N byte sequence */
 };
 };
 
 
 void
 void
-align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef)
+_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef)
 {
 {
   const char * fromLim = *fromLimRef;
   const char * fromLim = *fromLimRef;
   size_t walked = 0;
   size_t walked = 0;
@@ -405,18 +413,22 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
   }
   }
 
 
   /* Avoid copying partial characters (from incomplete input). */
   /* Avoid copying partial characters (from incomplete input). */
-  const char * const fromLimBefore = fromLim;
-  align_limit_to_full_utf8_characters(*fromP, &fromLim);
-  if (fromLim < fromLimBefore) {
-    input_incomplete = true;
+  {
+    const char * const fromLimBefore = fromLim;
+    _INTERNAL_trim_to_complete_utf8_characters(*fromP, &fromLim);
+    if (fromLim < fromLimBefore) {
+      input_incomplete = true;
+    }
   }
   }
 
 
-  const ptrdiff_t bytesToCopy = fromLim - *fromP;
-  memcpy((void *)*toP, (const void *)*fromP, (size_t)bytesToCopy);
-  *fromP += bytesToCopy;
-  *toP += bytesToCopy;
+  {
+    const ptrdiff_t bytesToCopy = fromLim - *fromP;
+    memcpy(*toP, *fromP, bytesToCopy);
+    *fromP += bytesToCopy;
+    *toP += bytesToCopy;
+  }
 
 
-  if (output_exhausted)  // needs to go first
+  if (output_exhausted)  /* needs to go first */
     return XML_CONVERT_OUTPUT_EXHAUSTED;
     return XML_CONVERT_OUTPUT_EXHAUSTED;
   else if (input_incomplete)
   else if (input_incomplete)
     return XML_CONVERT_INPUT_INCOMPLETE;
     return XML_CONVERT_INPUT_INCOMPLETE;
@@ -1452,9 +1464,8 @@ unknown_toUtf8(const ENCODING *enc,
         return XML_CONVERT_OUTPUT_EXHAUSTED;
         return XML_CONVERT_OUTPUT_EXHAUSTED;
       (*fromP)++;
       (*fromP)++;
     }
     }
-    do {
-      *(*toP)++ = *utf8++;
-    } while (--n != 0);
+    memcpy(*toP, utf8, n);
+    *toP += n;
   }
   }
 }
 }
 
 

+ 0 - 5
libs/expat/lib/xmltok.h

@@ -167,9 +167,6 @@ enum XML_Convert_Result {
 struct encoding {
 struct encoding {
   SCANNER scanners[XML_N_STATES];
   SCANNER scanners[XML_N_STATES];
   SCANNER literalScanners[XML_N_LITERAL_TYPES];
   SCANNER literalScanners[XML_N_LITERAL_TYPES];
-  int (PTRCALL *sameName)(const ENCODING *,
-                          const char *,
-                          const char *);
   int (PTRCALL *nameMatchesAscii)(const ENCODING *,
   int (PTRCALL *nameMatchesAscii)(const ENCODING *,
                                   const char *,
                                   const char *,
                                   const char *,
                                   const char *,
@@ -260,8 +257,6 @@ struct encoding {
 #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
 #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
    XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
    XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
 
 
-#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
-
 #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
 #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
   (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
   (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
 
 

+ 0 - 73
libs/expat/lib/xmltok_impl.c

@@ -1653,79 +1653,6 @@ PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr,
   return 0;
   return 0;
 }
 }
 
 
-/* This function does not appear to be called from anywhere within the
- * library code.  It is used via the macro XmlSameName(), which is
- * defined but never used.  Since it appears in the encoding function
- * table, removing it is not a thing to be undertaken lightly.  For
- * the moment, we simply exclude it from coverage tests.
- *
- * LCOV_EXCL_START
- */
-static int PTRCALL
-PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
-{
-  for (;;) {
-    switch (BYTE_TYPE(enc, ptr1)) {
-#define LEAD_CASE(n) \
-    case BT_LEAD ## n: \
-      if (*ptr1++ != *ptr2++) \
-        return 0;
-    LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2)
-#undef LEAD_CASE
-      /* fall through */
-      if (*ptr1++ != *ptr2++)
-        return 0;
-      break;
-    case BT_NONASCII:
-    case BT_NMSTRT:
-#ifdef XML_NS
-    case BT_COLON:
-#endif
-    case BT_HEX:
-    case BT_DIGIT:
-    case BT_NAME:
-    case BT_MINUS:
-      if (*ptr2++ != *ptr1++)
-        return 0;
-      if (MINBPC(enc) > 1) {
-        if (*ptr2++ != *ptr1++)
-          return 0;
-        if (MINBPC(enc) > 2) {
-          if (*ptr2++ != *ptr1++)
-            return 0;
-          if (MINBPC(enc) > 3) {
-            if (*ptr2++ != *ptr1++)
-              return 0;
-          }
-        }
-      }
-      break;
-    default:
-      if (MINBPC(enc) == 1 && *ptr1 == *ptr2)
-        return 1;
-      switch (BYTE_TYPE(enc, ptr2)) {
-      case BT_LEAD2:
-      case BT_LEAD3:
-      case BT_LEAD4:
-      case BT_NONASCII:
-      case BT_NMSTRT:
-#ifdef XML_NS
-      case BT_COLON:
-#endif
-      case BT_HEX:
-      case BT_DIGIT:
-      case BT_NAME:
-      case BT_MINUS:
-        return 0;
-      default:
-        return 1;
-      }
-    }
-  }
-  /* not reached */
-}
-/* LCOV_EXCL_STOP */
-
 static int PTRCALL
 static int PTRCALL
 PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
 PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
                          const char *end1, const char *ptr2)
                          const char *end1, const char *ptr2)

+ 3 - 0
libs/expat/tests/Makefile.am

@@ -42,6 +42,7 @@ LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
 
 
 libruntests_a_SOURCES = \
 libruntests_a_SOURCES = \
     chardata.c \
     chardata.c \
+    structdata.c \
     memcheck.c \
     memcheck.c \
     minicheck.c
     minicheck.c
 
 
@@ -56,8 +57,10 @@ runtestspp_LDADD = libruntests.a ../lib/libexpat.la
 
 
 EXTRA_DIST = \
 EXTRA_DIST = \
     chardata.h \
     chardata.h \
+    structdata.h \
     minicheck.h \
     minicheck.h \
     memcheck.h \
     memcheck.h \
     README.txt \
     README.txt \
+    udiffer.py \
     xmltest.log.expected \
     xmltest.log.expected \
     xmltest.sh
     xmltest.sh

+ 7 - 2
libs/expat/tests/Makefile.in

@@ -142,8 +142,8 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 am__v_AR_1 = 
 libruntests_a_AR = $(AR) $(ARFLAGS)
 libruntests_a_AR = $(AR) $(ARFLAGS)
 libruntests_a_LIBADD =
 libruntests_a_LIBADD =
-am_libruntests_a_OBJECTS = chardata.$(OBJEXT) memcheck.$(OBJEXT) \
-	minicheck.$(OBJEXT)
+am_libruntests_a_OBJECTS = chardata.$(OBJEXT) structdata.$(OBJEXT) \
+	memcheck.$(OBJEXT) minicheck.$(OBJEXT)
 libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS)
 libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS)
 am_runtests_OBJECTS = runtests.$(OBJEXT)
 am_runtests_OBJECTS = runtests.$(OBJEXT)
 runtests_OBJECTS = $(am_runtests_OBJECTS)
 runtests_OBJECTS = $(am_runtests_OBJECTS)
@@ -505,6 +505,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@
@@ -616,6 +617,7 @@ noinst_LIBRARIES = libruntests.a
 LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
 LOG_DRIVER = $(srcdir)/../test-driver-wrapper.sh
 libruntests_a_SOURCES = \
 libruntests_a_SOURCES = \
     chardata.c \
     chardata.c \
+    structdata.c \
     memcheck.c \
     memcheck.c \
     minicheck.c
     minicheck.c
 
 
@@ -629,9 +631,11 @@ runtests_LDADD = libruntests.a ../lib/libexpat.la
 runtestspp_LDADD = libruntests.a ../lib/libexpat.la
 runtestspp_LDADD = libruntests.a ../lib/libexpat.la
 EXTRA_DIST = \
 EXTRA_DIST = \
     chardata.h \
     chardata.h \
+    structdata.h \
     minicheck.h \
     minicheck.h \
     memcheck.h \
     memcheck.h \
     README.txt \
     README.txt \
+    udiffer.py \
     xmltest.log.expected \
     xmltest.log.expected \
     xmltest.sh
     xmltest.sh
 
 
@@ -705,6 +709,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minicheck.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minicheck.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtests.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtests.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtestspp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtestspp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/structdata.Po@am__quote@
 
 
 .c.o:
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<

+ 1 - 0
libs/expat/tests/benchmark/Makefile.in

@@ -226,6 +226,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@

+ 10 - 3
libs/expat/tests/benchmark/benchmark.c

@@ -37,9 +37,15 @@
 #include "expat.h"
 #include "expat.h"
 
 
 #ifdef XML_LARGE_SIZE
 #ifdef XML_LARGE_SIZE
-#define XML_FMT_INT_MOD "ll"
+# define XML_FMT_INT_MOD "ll"
 #else
 #else
-#define XML_FMT_INT_MOD "l"
+# define XML_FMT_INT_MOD "l"
+#endif
+
+#ifdef XML_UNICODE_WCHAR_T
+# define XML_FMT_STR "ls"
+#else
+# define XML_FMT_STR "s"
 #endif
 #endif
 
 
 static void
 static void
@@ -116,7 +122,8 @@ int main (int argc, char *argv[])
       else
       else
         parseBufferSize = bufferSize;
         parseBufferSize = bufferSize;
       if (!XML_Parse (parser, XMLBufPtr, parseBufferSize, isFinal)) {
       if (!XML_Parse (parser, XMLBufPtr, parseBufferSize, isFinal)) {
-        fprintf (stderr, "error '%s' at line %" XML_FMT_INT_MOD \
+        fprintf (stderr,
+                 "error '%" XML_FMT_STR "' at line %" XML_FMT_INT_MOD   \
                      "u character %" XML_FMT_INT_MOD "u\n",
                      "u character %" XML_FMT_INT_MOD "u\n",
                  XML_ErrorString (XML_GetErrorCode (parser)),
                  XML_ErrorString (XML_GetErrorCode (parser)),
                  XML_GetCurrentLineNumber (parser),
                  XML_GetCurrentLineNumber (parser),

+ 1 - 49
libs/expat/tests/chardata.c

@@ -31,7 +31,7 @@
 */
 */
 
 
 #ifdef HAVE_EXPAT_CONFIG_H
 #ifdef HAVE_EXPAT_CONFIG_H
-#include <expat_config.h>
+# include <expat_config.h>
 #endif
 #endif
 #include "minicheck.h"
 #include "minicheck.h"
 
 
@@ -60,25 +60,6 @@ CharData_Init(CharData *storage)
     storage->count = -1;
     storage->count = -1;
 }
 }
 
 
-void
-CharData_AppendString(CharData *storage, const char *s)
-{
-    int maxchars = sizeof(storage->data) / sizeof(storage->data[0]);
-    int len;
-
-    assert(s != NULL);
-    len = strlen(s);
-    if (storage->count < 0)
-        storage->count = 0;
-    if ((len + storage->count) > maxchars) {
-        len = (maxchars - storage->count);
-    }
-    if (len + storage->count < (int)sizeof(storage->data)) {
-        memcpy(storage->data + storage->count, s, len);
-        storage->count += len;
-    }
-}
-
 void
 void
 CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len)
 CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len)
 {
 {
@@ -101,35 +82,6 @@ CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len)
     }
     }
 }
 }
 
 
-int
-CharData_CheckString(CharData *storage, const char *expected)
-{
-    char buffer[4096];
-    int len;
-    int count;
-
-    assert(storage != NULL);
-    assert(expected != NULL);
-    count = (storage->count < 0) ? 0 : storage->count;
-    len = strlen(expected);
-    if (len != count) {
-        if (sizeof(XML_Char) == 1)
-            sprintf(buffer, "wrong number of data characters:"
-                    " got %d, expected %d:\n%s", count, len, storage->data);
-        else
-            sprintf(buffer,
-                    "wrong number of data characters: got %d, expected %d",
-                    count, len);
-        fail(buffer);
-        return 0;
-    }
-    if (memcmp(expected, storage->data, len) != 0) {
-        fail("got bad data bytes");
-        return 0;
-    }
-    return 1;
-}
-
 int
 int
 CharData_CheckXMLChars(CharData *storage, const XML_Char *expected)
 CharData_CheckXMLChars(CharData *storage, const XML_Char *expected)
 {
 {

+ 0 - 4
libs/expat/tests/chardata.h

@@ -51,12 +51,8 @@ typedef struct {
 
 
 void CharData_Init(CharData *storage);
 void CharData_Init(CharData *storage);
 
 
-void CharData_AppendString(CharData *storage, const char *s);
-
 void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);
 void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);
 
 
-int CharData_CheckString(CharData *storage, const char *s);
-
 int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);
 int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);
 
 
 
 

File diff suppressed because it is too large
+ 321 - 208
libs/expat/tests/runtests.c


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

@@ -128,11 +128,13 @@
     <ClCompile Include="minicheck.c" />
     <ClCompile Include="minicheck.c" />
     <ClCompile Include="memcheck.c" />
     <ClCompile Include="memcheck.c" />
     <ClCompile Include="runtests.c" />
     <ClCompile Include="runtests.c" />
+    <ClCompile Include="structdata.c" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="chardata.h" />
     <ClInclude Include="chardata.h" />
     <ClInclude Include="minicheck.h" />
     <ClInclude Include="minicheck.h" />
     <ClInclude Include="memcheck.h" />
     <ClInclude Include="memcheck.h" />
+    <ClInclude Include="structdata.h" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">

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

@@ -27,6 +27,9 @@
     <ClCompile Include="runtests.c">
     <ClCompile Include="runtests.c">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="structdata.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="chardata.h">
     <ClInclude Include="chardata.h">
@@ -38,5 +41,8 @@
     <ClInclude Include="memcheck.h">
     <ClInclude Include="memcheck.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="structdata.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 162 - 0
libs/expat/tests/structdata.c

@@ -0,0 +1,162 @@
+/*
+                            __  __            _
+                         ___\ \/ /_ __   __ _| |_
+                        / _ \\  /| '_ \ / _` | __|
+                       |  __//  \| |_) | (_| | |_
+                        \___/_/\_\ .__/ \__,_|\__|
+                                 |_| 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 HAVE_EXPAT_CONFIG_H
+# include "expat_config.h"
+#endif
+
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "structdata.h"
+#include "minicheck.h"
+
+#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))
+#else
+# 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)
+{
+    int 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;
+}
+
+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++;
+}
+
+/* '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_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);
+        }
+    }
+}
+
+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);
+}

+ 76 - 0
libs/expat/tests/structdata.h

@@ -0,0 +1,76 @@
+/* Interface to some helper routines used to accumulate and check
+   structured content.
+                            __  __            _
+                         ___\ \/ /_ __   __ _| |_
+                        / _ \\  /| '_ \ / _` | __|
+                       |  __//  \| |_) | (_| | |_
+                        \___/_/\_\ .__/ \__,_|\__|
+                                 |_| 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
+
+#ifndef XML_STRUCTDATA_H
+#define XML_STRUCTDATA_H 1
+
+#include "expat.h"
+
+typedef struct {
+    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;
+} StructData;
+
+
+void StructData_Init(StructData *storage);
+
+void StructData_AddItem(StructData *storage,
+                        const XML_Char *s,
+                        int data0,
+                        int data1,
+                        int data2);
+
+void StructData_CheckItems(StructData *storage,
+                           const StructDataEntry *expected,
+                           int count);
+
+void StructData_Dispose(StructData *storage);
+
+
+#endif  /* XML_STRUCTDATA_H */
+
+#ifdef __cplusplus
+}
+#endif

+ 62 - 0
libs/expat/tests/udiffer.py

@@ -0,0 +1,62 @@
+#! /usr/bin/env python3
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 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.
+
+import argparse
+import difflib
+import sys
+
+
+def _read_lines(filename):
+    try:
+        with open(filename) as f:
+            return f.readlines()
+    except UnicodeDecodeError:
+        with open(filename, encoding='utf_16') as f:
+            return f.readlines()
+
+
+def main():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('first', metavar='FILE')
+    parser.add_argument('second', metavar='FILE')
+    config = parser.parse_args()
+
+    first = _read_lines(config.first)
+    second = _read_lines(config.second)
+
+    diffs = list(difflib.unified_diff(first, second, fromfile=config.first,
+                                      tofile=config.second))
+    if diffs:
+        sys.stdout.writelines(diffs)
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()

+ 2 - 27
libs/expat/tests/xmltest.log.expected

@@ -1,35 +1,10 @@
 Output differs: ibm/valid/P02/ibm02v01.xml
 Output differs: ibm/valid/P02/ibm02v01.xml
-Output differs: ibm/valid/P28/ibm28v02.xml
-Output differs: ibm/valid/P29/ibm29v01.xml
-Output differs: ibm/valid/P29/ibm29v02.xml
-Output differs: ibm/valid/P54/ibm54v01.xml
-Output differs: ibm/valid/P56/ibm56v08.xml
-Output differs: ibm/valid/P57/ibm57v01.xml
-Output differs: ibm/valid/P58/ibm58v01.xml
-Output differs: ibm/valid/P58/ibm58v02.xml
-Output differs: ibm/valid/P70/ibm70v01.xml
-Output differs: ibm/valid/P82/ibm82v01.xml
 ibm49i02.dtd: No such file or directory
 ibm49i02.dtd: No such file or directory
-Output differs: ibm/invalid/P58/ibm58i01.xml
-Output differs: ibm/invalid/P58/ibm58i02.xml
-Output differs: xmltest/valid/sa/069.xml
-Output differs: xmltest/valid/sa/076.xml
-Output differs: xmltest/valid/sa/090.xml
-Output differs: xmltest/valid/sa/091.xml
-Output differs: sun/valid/notation01.xml
-Output differs: sun/valid/not-sa01.xml
-Output differs: sun/valid/not-sa02.xml
-Output differs: sun/valid/not-sa03.xml
-Output differs: sun/valid/not-sa04.xml
-Output differs: sun/valid/sa02.xml
-Output differs: sun/valid/sa03.xml
-Output differs: sun/valid/sa04.xml
-Output differs: sun/valid/sa05.xml
 Expected not well-formed: ibm/not-wf/misc/432gewf.xml
 Expected not well-formed: ibm/not-wf/misc/432gewf.xml
 Expected not well-formed: xmltest/not-wf/not-sa/005.xml
 Expected not well-formed: xmltest/not-wf/not-sa/005.xml
 Expected not well-formed: sun/not-wf/uri01.xml
 Expected not well-formed: sun/not-wf/uri01.xml
 Expected not well-formed: oasis/p06fail1.xml
 Expected not well-formed: oasis/p06fail1.xml
 Expected not well-formed: oasis/p08fail1.xml
 Expected not well-formed: oasis/p08fail1.xml
 Expected not well-formed: oasis/p08fail2.xml
 Expected not well-formed: oasis/p08fail2.xml
-Passed: 1776
-Failed: 33
+Passed: 1801
+Failed: 8

+ 4 - 2
libs/expat/tests/xmltest.sh

@@ -31,6 +31,8 @@ TS="$MYDIR"
 # OUTPUT must terminate with the directory separator.
 # OUTPUT must terminate with the directory separator.
 OUTPUT="$TS/out/"
 OUTPUT="$TS/out/"
 # OUTPUT=/home/tmp/xml-testsuite-out/
 # OUTPUT=/home/tmp/xml-testsuite-out/
+# Unicode-aware diff utility
+DIFF="$TS/udiffer.py"
 
 
 
 
 # RunXmlwfNotWF file reldir
 # RunXmlwfNotWF file reldir
@@ -53,11 +55,11 @@ RunXmlwfNotWF() {
 RunXmlwfWF() {
 RunXmlwfWF() {
   file="$1"
   file="$1"
   reldir="$2"
   reldir="$2"
-  $XMLWF -p -d "$OUTPUT$reldir" "$file" > outfile || return $?
+  $XMLWF -p -N -d "$OUTPUT$reldir" "$file" > outfile || return $?
   read outdata < outfile 
   read outdata < outfile 
   if test "$outdata" = "" ; then 
   if test "$outdata" = "" ; then 
       if [ -f "out/$file" ] ; then 
       if [ -f "out/$file" ] ; then 
-          diff -u "$OUTPUT$reldir$file" "out/$file" > outfile 
+          $DIFF "$OUTPUT$reldir$file" "out/$file" > outfile 
           if [ -s outfile ] ; then 
           if [ -s outfile ] ; then 
               cp outfile "$OUTPUT$reldir$file.diff"
               cp outfile "$OUTPUT$reldir$file.diff"
               echo "Output differs: $reldir$file"
               echo "Output differs: $reldir$file"

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

@@ -4,20 +4,23 @@
 ; This script was contributed by Tim Peters.
 ; This script was contributed by Tim Peters.
 ; It was designed for Inno Setup 2.0.19 but works with later versions as well.
 ; It was designed for Inno Setup 2.0.19 but works with later versions as well.
 
 
+#define expatVer "2.2.5"
+
 [Setup]
 [Setup]
 AppName=Expat
 AppName=Expat
 AppId=expat
 AppId=expat
-AppVersion=2.2.4
-AppVerName=Expat 2.2.4
-AppCopyright=Copyright  1998-2017 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
+AppVersion={#expatVer}
+AppVerName=Expat {#expatVer}
+AppCopyright=Copyright © 1998-2017 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
 AppPublisher=The Expat Developers
 AppPublisher=The Expat Developers
 AppPublisherURL=http://www.libexpat.org/
 AppPublisherURL=http://www.libexpat.org/
 AppSupportURL=http://www.libexpat.org/
 AppSupportURL=http://www.libexpat.org/
 AppUpdatesURL=http://www.libexpat.org/
 AppUpdatesURL=http://www.libexpat.org/
-UninstallDisplayName=Expat XML Parser 2.2.4
-VersionInfoVersion=2.2.4
+UninstallDisplayName=Expat XML Parser {#expatVer}
+VersionInfoVersion={#expatVer}
+OutputBaseFilename=expat-win32bin-{#expatVer}
 
 
-DefaultDirName={pf}\Expat 2.2.4
+DefaultDirName={pf}\Expat {#expatVer}
 UninstallFilesDir={app}\Uninstall
 UninstallFilesDir={app}\Uninstall
 
 
 Compression=lzma
 Compression=lzma

+ 9 - 2
libs/expat/xmlwf/Makefile.am

@@ -28,8 +28,6 @@
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
-AM_CPPFLAGS = -I$(srcdir)/../lib
-
 bin_PROGRAMS = xmlwf
 bin_PROGRAMS = xmlwf
 
 
 xmlwf_LDADD = ../lib/libexpat.la
 xmlwf_LDADD = ../lib/libexpat.la
@@ -39,6 +37,15 @@ xmlwf_SOURCES = \
     codepage.c \
     codepage.c \
     @[email protected]
     @[email protected]
 
 
+xmlwf_CPPFLAGS = -I$(srcdir)/../lib
+
+if MINGW
+if UNICODE
+xmlwf_CPPFLAGS += -mwindows
+xmlwf_LDFLAGS = -municode
+endif
+endif
+
 EXTRA_DIST = \
 EXTRA_DIST = \
     codepage.h \
     codepage.h \
     ct.c \
     ct.c \

+ 70 - 8
libs/expat/xmlwf/Makefile.in

@@ -119,6 +119,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 build_triplet = @build@
 host_triplet = @host@
 host_triplet = @host@
 bin_PROGRAMS = xmlwf$(EXEEXT)
 bin_PROGRAMS = xmlwf$(EXEEXT)
+@MINGW_TRUE@@UNICODE_TRUE@am__append_1 = -mwindows
 subdir = xmlwf
 subdir = xmlwf
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -135,14 +136,17 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
 PROGRAMS = $(bin_PROGRAMS)
-am_xmlwf_OBJECTS = xmlwf.$(OBJEXT) xmlfile.$(OBJEXT) \
-	codepage.$(OBJEXT) @FILEMAP@.$(OBJEXT)
+am_xmlwf_OBJECTS = xmlwf-xmlwf.$(OBJEXT) xmlwf-xmlfile.$(OBJEXT) \
+	xmlwf-codepage.$(OBJEXT) xmlwf-@FILEMAP@.$(OBJEXT)
 xmlwf_OBJECTS = $(am_xmlwf_OBJECTS)
 xmlwf_OBJECTS = $(am_xmlwf_OBJECTS)
 xmlwf_DEPENDENCIES = ../lib/libexpat.la
 xmlwf_DEPENDENCIES = ../lib/libexpat.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_0 = --silent
 am__v_lt_1 = 
 am__v_lt_1 = 
+xmlwf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(xmlwf_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
 am__v_P_0 = false
@@ -228,6 +232,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DLLTOOL = @DLLTOOL@
+DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@
 DSYMUTIL = @DSYMUTIL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_C = @ECHO_C@
@@ -331,7 +336,6 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I$(srcdir)/../lib
 xmlwf_LDADD = ../lib/libexpat.la
 xmlwf_LDADD = ../lib/libexpat.la
 xmlwf_SOURCES = \
 xmlwf_SOURCES = \
     xmlwf.c \
     xmlwf.c \
@@ -339,6 +343,8 @@ xmlwf_SOURCES = \
     codepage.c \
     codepage.c \
     @[email protected]
     @[email protected]
 
 
+xmlwf_CPPFLAGS = -I$(srcdir)/../lib $(am__append_1)
+@MINGW_TRUE@@UNICODE_TRUE@xmlwf_LDFLAGS = -municode
 EXTRA_DIST = \
 EXTRA_DIST = \
     codepage.h \
     codepage.h \
     ct.c \
     ct.c \
@@ -438,7 +444,7 @@ clean-binPROGRAMS:
 
 
 xmlwf$(EXEEXT): $(xmlwf_OBJECTS) $(xmlwf_DEPENDENCIES) $(EXTRA_xmlwf_DEPENDENCIES) 
 xmlwf$(EXEEXT): $(xmlwf_OBJECTS) $(xmlwf_DEPENDENCIES) $(EXTRA_xmlwf_DEPENDENCIES) 
 	@rm -f xmlwf$(EXEEXT)
 	@rm -f xmlwf$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(xmlwf_OBJECTS) $(xmlwf_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(xmlwf_LINK) $(xmlwf_OBJECTS) $(xmlwf_LDADD) $(LIBS)
 
 
 mostlyclean-compile:
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
 	-rm -f *.$(OBJEXT)
@@ -446,10 +452,10 @@ mostlyclean-compile:
 distclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 	-rm -f *.tab.c
 
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@[email protected]@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codepage.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlfile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwf-@[email protected]@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwf-codepage.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwf-xmlfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwf-xmlwf.Po@am__quote@
 
 
 .c.o:
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -472,6 +478,62 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 
+xmlwf-xmlwf.o: xmlwf.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-xmlwf.o -MD -MP -MF $(DEPDIR)/xmlwf-xmlwf.Tpo -c -o xmlwf-xmlwf.o `test -f 'xmlwf.c' || echo '$(srcdir)/'`xmlwf.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-xmlwf.Tpo $(DEPDIR)/xmlwf-xmlwf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='xmlwf.c' object='xmlwf-xmlwf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-xmlwf.o `test -f 'xmlwf.c' || echo '$(srcdir)/'`xmlwf.c
+
+xmlwf-xmlwf.obj: xmlwf.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-xmlwf.obj -MD -MP -MF $(DEPDIR)/xmlwf-xmlwf.Tpo -c -o xmlwf-xmlwf.obj `if test -f 'xmlwf.c'; then $(CYGPATH_W) 'xmlwf.c'; else $(CYGPATH_W) '$(srcdir)/xmlwf.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-xmlwf.Tpo $(DEPDIR)/xmlwf-xmlwf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='xmlwf.c' object='xmlwf-xmlwf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-xmlwf.obj `if test -f 'xmlwf.c'; then $(CYGPATH_W) 'xmlwf.c'; else $(CYGPATH_W) '$(srcdir)/xmlwf.c'; fi`
+
+xmlwf-xmlfile.o: xmlfile.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-xmlfile.o -MD -MP -MF $(DEPDIR)/xmlwf-xmlfile.Tpo -c -o xmlwf-xmlfile.o `test -f 'xmlfile.c' || echo '$(srcdir)/'`xmlfile.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-xmlfile.Tpo $(DEPDIR)/xmlwf-xmlfile.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='xmlfile.c' object='xmlwf-xmlfile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-xmlfile.o `test -f 'xmlfile.c' || echo '$(srcdir)/'`xmlfile.c
+
+xmlwf-xmlfile.obj: xmlfile.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-xmlfile.obj -MD -MP -MF $(DEPDIR)/xmlwf-xmlfile.Tpo -c -o xmlwf-xmlfile.obj `if test -f 'xmlfile.c'; then $(CYGPATH_W) 'xmlfile.c'; else $(CYGPATH_W) '$(srcdir)/xmlfile.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-xmlfile.Tpo $(DEPDIR)/xmlwf-xmlfile.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='xmlfile.c' object='xmlwf-xmlfile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-xmlfile.obj `if test -f 'xmlfile.c'; then $(CYGPATH_W) 'xmlfile.c'; else $(CYGPATH_W) '$(srcdir)/xmlfile.c'; fi`
+
+xmlwf-codepage.o: codepage.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-codepage.o -MD -MP -MF $(DEPDIR)/xmlwf-codepage.Tpo -c -o xmlwf-codepage.o `test -f 'codepage.c' || echo '$(srcdir)/'`codepage.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-codepage.Tpo $(DEPDIR)/xmlwf-codepage.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='codepage.c' object='xmlwf-codepage.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-codepage.o `test -f 'codepage.c' || echo '$(srcdir)/'`codepage.c
+
+xmlwf-codepage.obj: codepage.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-codepage.obj -MD -MP -MF $(DEPDIR)/xmlwf-codepage.Tpo -c -o xmlwf-codepage.obj `if test -f 'codepage.c'; then $(CYGPATH_W) 'codepage.c'; else $(CYGPATH_W) '$(srcdir)/codepage.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-codepage.Tpo $(DEPDIR)/xmlwf-codepage.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='codepage.c' object='xmlwf-codepage.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-codepage.obj `if test -f 'codepage.c'; then $(CYGPATH_W) 'codepage.c'; else $(CYGPATH_W) '$(srcdir)/codepage.c'; fi`
+
+xmlwf-@[email protected]: @[email protected]
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-@[email protected] -MD -MP -MF $(DEPDIR)/xmlwf-@[email protected] -c -o xmlwf-@[email protected] `test -f '@[email protected]' || echo '$(srcdir)/'`@[email protected]
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-@[email protected] $(DEPDIR)/xmlwf-@[email protected]
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='@[email protected]' object='xmlwf-@[email protected]' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-@[email protected] `test -f '@[email protected]' || echo '$(srcdir)/'`@[email protected]
+
+xmlwf-@[email protected]: @[email protected]
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmlwf-@[email protected] -MD -MP -MF $(DEPDIR)/xmlwf-@[email protected] -c -o xmlwf-@[email protected] `if test -f '@[email protected]'; then $(CYGPATH_W) '@[email protected]'; else $(CYGPATH_W) '$(srcdir)/@[email protected]'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/xmlwf-@[email protected] $(DEPDIR)/xmlwf-@[email protected]
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='@[email protected]' object='xmlwf-@[email protected]' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xmlwf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmlwf-@[email protected] `if test -f '@[email protected]'; then $(CYGPATH_W) '@[email protected]'; else $(CYGPATH_W) '$(srcdir)/@[email protected]'; fi`
+
 mostlyclean-libtool:
 mostlyclean-libtool:
 	-rm -f *.lo
 	-rm -f *.lo
 
 

+ 36 - 24
libs/expat/xmlwf/readfilemap.c

@@ -41,49 +41,61 @@
 # include <unistd.h>
 # include <unistd.h>
 #endif
 #endif
 
 
-#ifndef S_ISREG
-#ifndef S_IFREG
-#define S_IFREG _S_IFREG
-#endif
-#ifndef S_IFMT
-#define S_IFMT _S_IFMT
+/* Function "read": */
+#if defined(_MSC_VER)
+  /* https://msdn.microsoft.com/en-us/library/wyssk1bs(v=vs.100).aspx */
+# define _EXPAT_read          _read
+# define _EXPAT_read_count_t  int
+#else  /* POSIX */
+  /* http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */
+# define _EXPAT_read          read
+# define _EXPAT_read_count_t  ssize_t
 #endif
 #endif
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+
+#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)
 #endif /* not S_ISREG */
 #endif /* not S_ISREG */
 
 
 #ifndef O_BINARY
 #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
 #endif
 
 
+#include "xmltchar.h"
 #include "filemap.h"
 #include "filemap.h"
 
 
 int
 int
-filemap(const char *name,
-        void (*processor)(const void *, size_t, const char *, void *arg),
+filemap(const tchar *name,
+        void (*processor)(const void *, size_t, const tchar *, void *arg),
         void *arg)
         void *arg)
 {
 {
   size_t nbytes;
   size_t nbytes;
   int fd;
   int fd;
-  ssize_t n;
+  _EXPAT_read_count_t n;
   struct stat sb;
   struct stat sb;
   void *p;
   void *p;
 
 
-  fd = open(name, O_RDONLY|O_BINARY);
+  fd = topen(name, O_RDONLY|O_BINARY);
   if (fd < 0) {
   if (fd < 0) {
-    perror(name);
+    tperror(name);
     return 0;
     return 0;
   }
   }
   if (fstat(fd, &sb) < 0) {
   if (fstat(fd, &sb) < 0) {
-    perror(name);
+    tperror(name);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }
   if (!S_ISREG(sb.st_mode)) {
   if (!S_ISREG(sb.st_mode)) {
-    fprintf(stderr, "%s: not a regular file\n", name);
+    ftprintf(stderr, T("%s: not a regular file\n"), name);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }
@@ -102,19 +114,19 @@ filemap(const char *name,
   }
   }
   p = malloc(nbytes);
   p = malloc(nbytes);
   if (!p) {
   if (!p) {
-    fprintf(stderr, "%s: out of memory\n", name);
+    ftprintf(stderr, T("%s: out of memory\n"), name);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }
-  n = read(fd, p, nbytes);
+  n = _EXPAT_read(fd, p, nbytes);
   if (n < 0) {
   if (n < 0) {
-    perror(name);
+    tperror(name);
     free(p);
     free(p);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }
-  if (n != (ssize_t)nbytes) {
-    fprintf(stderr, "%s: read unexpected number of bytes\n", name);
+  if (n != (_EXPAT_read_count_t)nbytes) {
+    ftprintf(stderr, T("%s: read unexpected number of bytes\n"), name);
     free(p);
     free(p);
     close(fd);
     close(fd);
     return 0;
     return 0;

+ 14 - 7
libs/expat/xmlwf/unixfilemap.c

@@ -43,11 +43,18 @@
 #define MAP_FILE 0
 #define MAP_FILE 0
 #endif
 #endif
 
 
+#include "xmltchar.h"
 #include "filemap.h"
 #include "filemap.h"
 
 
+#ifdef XML_UNICODE_WCHAR_T
+# define XML_FMT_STR "ls"
+#else
+# define XML_FMT_STR "s"
+#endif
+
 int
 int
-filemap(const char *name,
-        void (*processor)(const void *, size_t, const char *, void *arg),
+filemap(const tchar *name,
+        void (*processor)(const void *, size_t, const tchar *, void *arg),
         void *arg)
         void *arg)
 {
 {
   int fd;
   int fd;
@@ -55,19 +62,19 @@ filemap(const char *name,
   struct stat sb;
   struct stat sb;
   void *p;
   void *p;
 
 
-  fd = open(name, O_RDONLY);
+  fd = topen(name, O_RDONLY);
   if (fd < 0) {
   if (fd < 0) {
-    perror(name);
+    tperror(name);
     return 0;
     return 0;
   }
   }
   if (fstat(fd, &sb) < 0) {
   if (fstat(fd, &sb) < 0) {
-    perror(name);
+    tperror(name);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }
   if (!S_ISREG(sb.st_mode)) {
   if (!S_ISREG(sb.st_mode)) {
     close(fd);
     close(fd);
-    fprintf(stderr, "%s: not a regular file\n", name);
+    fprintf(stderr, "%" XML_FMT_STR ": not a regular file\n", name);
     return 0;
     return 0;
   }
   }
   if (sb.st_size > XML_MAX_CHUNK_LEN) {
   if (sb.st_size > XML_MAX_CHUNK_LEN) {
@@ -86,7 +93,7 @@ filemap(const char *name,
   p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ,
   p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ,
                    MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
                    MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
   if (p == (void *)-1) {
   if (p == (void *)-1) {
-    perror(name);
+    tperror(name);
     close(fd);
     close(fd);
     return 0;
     return 0;
   }
   }

+ 5 - 5
libs/expat/xmlwf/win32filemap.c

@@ -34,14 +34,14 @@
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
 
 
 #ifdef XML_UNICODE_WCHAR_T
 #ifdef XML_UNICODE_WCHAR_T
-#ifndef XML_UNICODE
-#define XML_UNICODE
-#endif
+# ifndef XML_UNICODE
+#  define XML_UNICODE
+# endif
 #endif
 #endif
 
 
 #ifdef XML_UNICODE
 #ifdef XML_UNICODE
-#define UNICODE
-#define _UNICODE
+# define UNICODE
+# define _UNICODE
 #endif /* XML_UNICODE */
 #endif /* XML_UNICODE */
 #include <windows.h>
 #include <windows.h>
 #include <stdio.h>
 #include <stdio.h>

+ 8 - 4
libs/expat/xmlwf/xmlfile.c

@@ -85,7 +85,11 @@ reportError(XML_Parser parser, const XML_Char *filename)
   enum XML_Error code = XML_GetErrorCode(parser);
   enum XML_Error code = XML_GetErrorCode(parser);
   const XML_Char *message = XML_ErrorString(code);
   const XML_Char *message = XML_ErrorString(code);
   if (message)
   if (message)
-    ftprintf(stdout, T("%s:%" XML_FMT_INT_MOD "u:%" XML_FMT_INT_MOD "u: %s\n"),
+    ftprintf(stdout,
+             T("%s")
+               T(":%") T(XML_FMT_INT_MOD) T("u")
+               T(":%") T(XML_FMT_INT_MOD) T("u")
+               T(": %s\n"),
              filename,
              filename,
              XML_GetErrorLineNumber(parser),
              XML_GetErrorLineNumber(parser),
              XML_GetErrorColumnNumber(parser),
              XML_GetErrorColumnNumber(parser),
@@ -202,18 +206,18 @@ processStream(const XML_Char *filename, XML_Parser parser)
       if (filename != NULL)
       if (filename != NULL)
         close(fd);
         close(fd);
       ftprintf(stderr, T("%s: out of memory\n"),
       ftprintf(stderr, T("%s: out of memory\n"),
-               filename != NULL ? filename : "xmlwf");
+               filename != NULL ? filename : T("xmlwf"));
       return 0;
       return 0;
     }
     }
     nread = read(fd, buf, READ_SIZE);
     nread = read(fd, buf, READ_SIZE);
     if (nread < 0) {
     if (nread < 0) {
-      tperror(filename != NULL ? filename : "STDIN");
+      tperror(filename != NULL ? filename : T("STDIN"));
       if (filename != NULL)
       if (filename != NULL)
         close(fd);
         close(fd);
       return 0;
       return 0;
     }
     }
     if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) {
     if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) {
-      reportError(parser, filename != NULL ? filename : "STDIN");
+        reportError(parser, filename != NULL ? filename : T("STDIN"));
       if (filename != NULL)
       if (filename != NULL)
         close(fd);
         close(fd);
       return 0;
       return 0;

+ 39 - 33
libs/expat/xmlwf/xmltchar.h

@@ -30,39 +30,45 @@
    USE OR OTHER DEALINGS IN THE SOFTWARE.
    USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 */
 
 
+/* Ensures compile-time constants are consistent */
+#include "expat_external.h"
+
 #ifdef XML_UNICODE
 #ifdef XML_UNICODE
-#ifndef XML_UNICODE_WCHAR_T
-#error xmlwf requires a 16-bit Unicode-compatible wchar_t 
-#endif
-#define T(x) 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
+# 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 */
 #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 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 */
 #endif /* not XML_UNICODE */

+ 293 - 46
libs/expat/xmlwf/xmlwf.c

@@ -30,6 +30,7 @@
    USE OR OTHER DEALINGS IN THE SOFTWARE.
    USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 */
 
 
+#include <assert.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <stddef.h>
@@ -42,9 +43,28 @@
 #include "xmltchar.h"
 #include "xmltchar.h"
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
-#include <crtdbg.h>
+# include <crtdbg.h>
 #endif
 #endif
 
 
+#ifdef XML_UNICODE
+# include <wchar.h>
+#endif
+
+/* Structures for handler user data */
+typedef struct NotationList {
+  struct NotationList *next;
+  const XML_Char *notationName;
+  const XML_Char *systemId;
+  const XML_Char *publicId;
+} NotationList;
+
+typedef struct xmlwfUserData {
+  FILE *fp;
+  NotationList *notationListHead;
+  const XML_Char *currentDoctypeName;
+} XmlwfUserData;
+
+
 /* This ensures proper sorting. */
 /* This ensures proper sorting. */
 
 
 #define NSSEP T('\001')
 #define NSSEP T('\001')
@@ -52,7 +72,7 @@
 static void XMLCALL
 static void XMLCALL
 characterData(void *userData, const XML_Char *s, int len)
 characterData(void *userData, const XML_Char *s, int len)
 {
 {
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   for (; len > 0; --len, ++s) {
   for (; len > 0; --len, ++s) {
     switch (*s) {
     switch (*s) {
     case T('&'):
     case T('&'):
@@ -90,6 +110,7 @@ attributeValue(FILE *fp, const XML_Char *s)
 {
 {
   puttc(T('='), fp);
   puttc(T('='), fp);
   puttc(T('"'), fp);
   puttc(T('"'), fp);
+  assert(s);
   for (;;) {
   for (;;) {
     switch (*s) {
     switch (*s) {
     case 0:
     case 0:
@@ -147,7 +168,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts)
 {
 {
   int nAtts;
   int nAtts;
   const XML_Char **p;
   const XML_Char **p;
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   puttc(T('<'), fp);
   puttc(T('<'), fp);
   fputts(name, fp);
   fputts(name, fp);
 
 
@@ -169,7 +190,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts)
 static void XMLCALL
 static void XMLCALL
 endElement(void *userData, const XML_Char *name)
 endElement(void *userData, const XML_Char *name)
 {
 {
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   puttc(T('<'), fp);
   puttc(T('<'), fp);
   puttc(T('/'), fp);
   puttc(T('/'), fp);
   fputts(name, fp);
   fputts(name, fp);
@@ -194,7 +215,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
   int nAtts;
   int nAtts;
   int nsi;
   int nsi;
   const XML_Char **p;
   const XML_Char **p;
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   const XML_Char *sep;
   const XML_Char *sep;
   puttc(T('<'), fp);
   puttc(T('<'), fp);
 
 
@@ -240,7 +261,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
 static void XMLCALL
 static void XMLCALL
 endElementNS(void *userData, const XML_Char *name)
 endElementNS(void *userData, const XML_Char *name)
 {
 {
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   const XML_Char *sep;
   const XML_Char *sep;
   puttc(T('<'), fp);
   puttc(T('<'), fp);
   puttc(T('/'), fp);
   puttc(T('/'), fp);
@@ -260,7 +281,7 @@ static void XMLCALL
 processingInstruction(void *userData, const XML_Char *target,
 processingInstruction(void *userData, const XML_Char *target,
                       const XML_Char *data)
                       const XML_Char *data)
 {
 {
-  FILE *fp = (FILE *)userData;
+  FILE *fp = ((XmlwfUserData *)userData)->fp;
   puttc(T('<'), fp);
   puttc(T('<'), fp);
   puttc(T('?'), fp);
   puttc(T('?'), fp);
   fputts(target, fp);
   fputts(target, fp);
@@ -270,6 +291,200 @@ processingInstruction(void *userData, const XML_Char *target,
   puttc(T('>'), fp);
   puttc(T('>'), fp);
 }
 }
 
 
+
+static XML_Char *xcsdup(const XML_Char *s)
+{
+  XML_Char *result;
+  int count = 0;
+  int numBytes;
+
+  /* Get the length of the string, including terminator */
+  while (s[count++] != 0) {
+    /* Do nothing */
+  }
+  numBytes = count * sizeof(XML_Char);
+  result = malloc(numBytes);
+  if (result == NULL)
+    return NULL;
+  memcpy(result, s, numBytes);
+  return result;
+}
+
+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))
+{
+  XmlwfUserData *data = (XmlwfUserData *)userData;
+  data->currentDoctypeName = xcsdup(doctypeName);
+}
+
+static void
+freeNotations(XmlwfUserData *data)
+{
+  NotationList *notationListHead = data->notationListHead;
+
+  while (notationListHead != NULL) {
+    NotationList *next = notationListHead->next;
+    free((void *)notationListHead->notationName);
+    free((void *)notationListHead->systemId);
+    free((void *)notationListHead->publicId);
+    free(notationListHead);
+    notationListHead = next;
+  }
+  data->notationListHead = NULL;
+}
+
+static int xcscmp(const XML_Char *xs, const XML_Char *xt)
+{
+  while (*xs != 0 && *xt != 0) {
+    if (*xs < *xt)
+      return -1;
+    if (*xs > *xt)
+      return 1;
+    xs++;
+    xt++;
+  }
+  if (*xs < *xt)
+    return -1;
+  if (*xs > *xt)
+    return 1;
+  return 0;
+}
+
+static int
+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)
+{
+  XmlwfUserData *data = (XmlwfUserData *)userData;
+  NotationList **notations;
+  int notationCount = 0;
+  NotationList *p;
+  int i;
+
+  /* How many notations do we have? */
+  for (p = data->notationListHead; p != NULL; p = p->next)
+    notationCount++;
+  if (notationCount == 0) {
+    /* Nothing to report */
+    free((void *)data->currentDoctypeName);
+    data->currentDoctypeName = NULL;
+    return;
+  }
+
+  notations = malloc(notationCount * sizeof(NotationList *));
+  if (notations == NULL) {
+    fprintf(stderr, "Unable to sort notations");
+    freeNotations(data);
+    return;
+  }
+
+  for (p = data->notationListHead, i = 0;
+       i < notationCount;
+       p = p->next, i++) {
+    notations[i] = p;
+  }
+  qsort(notations, notationCount, sizeof(NotationList *), notationCmp);
+
+  /* Output the DOCTYPE header */
+  fputts(T("<!DOCTYPE "), data->fp);
+  fputts(data->currentDoctypeName, data->fp);
+  fputts(T(" [\n"), data->fp);
+
+  /* Now the NOTATIONs */
+  for (i = 0; i < notationCount; i++) {
+    fputts(T("<!NOTATION "), data->fp);
+    fputts(notations[i]->notationName, data->fp);
+    if (notations[i]->publicId != NULL) {
+      fputts(T(" PUBLIC '"), data->fp);
+      fputts(notations[i]->publicId, data->fp);
+      puttc(T('\''), data->fp);
+      if (notations[i]->systemId != NULL) {
+        puttc(T(' '), data->fp);
+        puttc(T('\''), data->fp);
+        fputts(notations[i]->systemId, data->fp);
+        puttc(T('\''), data->fp);
+      }
+    }
+    else if (notations[i]->systemId != NULL) {
+      fputts(T(" SYSTEM '"), data->fp);
+      fputts(notations[i]->systemId, data->fp);
+      puttc(T('\''), data->fp);
+    }
+    puttc(T('>'), data->fp);
+    puttc(T('\n'), data->fp);
+  }
+
+  /* Finally end the DOCTYPE */
+  fputts(T("]>\n"), data->fp);
+
+  free(notations);
+  freeNotations(data);
+  free((void *)data->currentDoctypeName);
+  data->currentDoctypeName = NULL;
+}
+
+static void XMLCALL
+notationDecl(void *userData,
+             const XML_Char *notationName,
+             const XML_Char *UNUSED_P(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";
+
+  if (entry == NULL) {
+    fputs(errorMessage, stderr);
+    return; /* Nothing we can really do about this */
+  }
+  entry->notationName = xcsdup(notationName);
+  if (entry->notationName == NULL) {
+    fputs(errorMessage, stderr);
+    free(entry);
+    return;
+  }
+  if (systemId != NULL) {
+    entry->systemId = xcsdup(systemId);
+    if (entry->systemId == NULL) {
+      fputs(errorMessage, stderr);
+      free((void *)entry->notationName);
+      free(entry);
+      return;
+    }
+  }
+  else {
+    entry->systemId = NULL;
+  }
+  if (publicId != NULL) {
+    entry->publicId = xcsdup(publicId);
+    if (entry->publicId == NULL) {
+      fputs(errorMessage, stderr);
+      free((void *)entry->systemId); /* Safe if it's NULL */
+      free((void *)entry->notationName);
+      free(entry);
+      return;
+    }
+  }
+  else {
+    entry->publicId = NULL;
+  }
+
+  entry->next = data->notationListHead;
+  data->notationListHead = entry;
+}
+
 #endif /* not W3C14N */
 #endif /* not W3C14N */
 
 
 static void XMLCALL
 static void XMLCALL
@@ -322,7 +537,7 @@ nopProcessingInstruction(void *UNUSED_P(userData), const XML_Char *UNUSED_P(targ
 static void XMLCALL
 static void XMLCALL
 markup(void *userData, const XML_Char *s, int len)
 markup(void *userData, const XML_Char *s, int len)
 {
 {
-  FILE *fp = (FILE *)XML_GetUserData((XML_Parser) userData);
+  FILE *fp = ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp;
   for (; len > 0; --len, ++s)
   for (; len > 0; --len, ++s)
     puttc(*s, fp);
     puttc(*s, fp);
 }
 }
@@ -331,11 +546,14 @@ static void
 metaLocation(XML_Parser parser)
 metaLocation(XML_Parser parser)
 {
 {
   const XML_Char *uri = XML_GetBase(parser);
   const XML_Char *uri = XML_GetBase(parser);
+  FILE *fp = ((XmlwfUserData *)XML_GetUserData(parser))->fp;
   if (uri)
   if (uri)
-    ftprintf((FILE *)XML_GetUserData(parser), T(" uri=\"%s\""), uri);
-  ftprintf((FILE *)XML_GetUserData(parser),
-           T(" byte=\"%" XML_FMT_INT_MOD "d\" nbytes=\"%d\" \
-			 line=\"%" XML_FMT_INT_MOD "u\" col=\"%" XML_FMT_INT_MOD "u\""),
+    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_GetCurrentByteIndex(parser),
            XML_GetCurrentByteCount(parser),
            XML_GetCurrentByteCount(parser),
            XML_GetCurrentLineNumber(parser),
            XML_GetCurrentLineNumber(parser),
@@ -345,13 +563,15 @@ metaLocation(XML_Parser parser)
 static void
 static void
 metaStartDocument(void *userData)
 metaStartDocument(void *userData)
 {
 {
-  fputts(T("<document>\n"), (FILE *)XML_GetUserData((XML_Parser) userData));
+  fputts(T("<document>\n"),
+         ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp);
 }
 }
 
 
 static void
 static void
 metaEndDocument(void *userData)
 metaEndDocument(void *userData)
 {
 {
-  fputts(T("</document>\n"), (FILE *)XML_GetUserData((XML_Parser) userData));
+  fputts(T("</document>\n"),
+         ((XmlwfUserData *)XML_GetUserData((XML_Parser) userData))->fp);
 }
 }
 
 
 static void XMLCALL
 static void XMLCALL
@@ -359,7 +579,8 @@ metaStartElement(void *userData, const XML_Char *name,
                  const XML_Char **atts)
                  const XML_Char **atts)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   const XML_Char **specifiedAttsEnd
   const XML_Char **specifiedAttsEnd
     = atts + XML_GetSpecifiedAttributeCount(parser);
     = atts + XML_GetSpecifiedAttributeCount(parser);
   const XML_Char **idAttPtr;
   const XML_Char **idAttPtr;
@@ -368,14 +589,14 @@ metaStartElement(void *userData, const XML_Char *name,
     idAttPtr = 0;
     idAttPtr = 0;
   else
   else
     idAttPtr = atts + idAttIndex;
     idAttPtr = atts + idAttIndex;
-    
+
   ftprintf(fp, T("<starttag name=\"%s\""), name);
   ftprintf(fp, T("<starttag name=\"%s\""), name);
   metaLocation(parser);
   metaLocation(parser);
   if (*atts) {
   if (*atts) {
     fputts(T(">\n"), fp);
     fputts(T(">\n"), fp);
     do {
     do {
       ftprintf(fp, T("<attribute name=\"%s\" value=\""), atts[0]);
       ftprintf(fp, T("<attribute name=\"%s\" value=\""), atts[0]);
-      characterData(fp, atts[1], (int)tcslen(atts[1]));
+      characterData(data, atts[1], (int)tcslen(atts[1]));
       if (atts >= specifiedAttsEnd)
       if (atts >= specifiedAttsEnd)
         fputts(T("\" defaulted=\"yes\"/>\n"), fp);
         fputts(T("\" defaulted=\"yes\"/>\n"), fp);
       else if (atts == idAttPtr)
       else if (atts == idAttPtr)
@@ -393,7 +614,8 @@ static void XMLCALL
 metaEndElement(void *userData, const XML_Char *name)
 metaEndElement(void *userData, const XML_Char *name)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   ftprintf(fp, T("<endtag name=\"%s\""), name);
   ftprintf(fp, T("<endtag name=\"%s\""), name);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -404,9 +626,10 @@ metaProcessingInstruction(void *userData, const XML_Char *target,
                           const XML_Char *data)
                           const XML_Char *data)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *usrData = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = usrData->fp;
   ftprintf(fp, T("<pi target=\"%s\" data=\""), target);
   ftprintf(fp, T("<pi target=\"%s\" data=\""), target);
-  characterData(fp, data, (int)tcslen(data));
+  characterData(usrData, data, (int)tcslen(data));
   puttc(T('"'), fp);
   puttc(T('"'), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -416,9 +639,10 @@ static void XMLCALL
 metaComment(void *userData, const XML_Char *data)
 metaComment(void *userData, const XML_Char *data)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *usrData = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = usrData->fp;
   fputts(T("<comment data=\""), fp);
   fputts(T("<comment data=\""), fp);
-  characterData(fp, data, (int)tcslen(data));
+  characterData(usrData, data, (int)tcslen(data));
   puttc(T('"'), fp);
   puttc(T('"'), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -428,7 +652,8 @@ static void XMLCALL
 metaStartCdataSection(void *userData)
 metaStartCdataSection(void *userData)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   fputts(T("<startcdata"), fp);
   fputts(T("<startcdata"), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -438,7 +663,8 @@ static void XMLCALL
 metaEndCdataSection(void *userData)
 metaEndCdataSection(void *userData)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   fputts(T("<endcdata"), fp);
   fputts(T("<endcdata"), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -448,9 +674,10 @@ static void XMLCALL
 metaCharacterData(void *userData, const XML_Char *s, int len)
 metaCharacterData(void *userData, const XML_Char *s, int len)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   fputts(T("<chars str=\""), fp);
   fputts(T("<chars str=\""), fp);
-  characterData(fp, s, len);
+  characterData(data, s, len);
   puttc(T('"'), fp);
   puttc(T('"'), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -464,7 +691,8 @@ metaStartDoctypeDecl(void *userData,
                      int UNUSED_P(has_internal_subset))
                      int UNUSED_P(has_internal_subset))
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   ftprintf(fp, T("<startdoctype name=\"%s\""), doctypeName);
   ftprintf(fp, T("<startdoctype name=\"%s\""), doctypeName);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -474,7 +702,8 @@ static void XMLCALL
 metaEndDoctypeDecl(void *userData)
 metaEndDoctypeDecl(void *userData)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   fputts(T("<enddoctype"), fp);
   fputts(T("<enddoctype"), fp);
   metaLocation(parser);
   metaLocation(parser);
   fputts(T("/>\n"), fp);
   fputts(T("/>\n"), fp);
@@ -488,13 +717,14 @@ metaNotationDecl(void *userData,
                  const XML_Char *publicId)
                  const XML_Char *publicId)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   ftprintf(fp, T("<notation name=\"%s\""), notationName);
   ftprintf(fp, T("<notation name=\"%s\""), notationName);
   if (publicId)
   if (publicId)
     ftprintf(fp, T(" public=\"%s\""), publicId);
     ftprintf(fp, T(" public=\"%s\""), publicId);
   if (systemId) {
   if (systemId) {
     fputts(T(" system=\""), fp);
     fputts(T(" system=\""), fp);
-    characterData(fp, systemId, (int)tcslen(systemId));
+    characterData(data, systemId, (int)tcslen(systemId));
     puttc(T('"'), fp);
     puttc(T('"'), fp);
   }
   }
   metaLocation(parser);
   metaLocation(parser);
@@ -514,13 +744,14 @@ metaEntityDecl(void *userData,
                const XML_Char *notationName)
                const XML_Char *notationName)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
 
 
   if (value) {
   if (value) {
     ftprintf(fp, T("<entity name=\"%s\""), entityName);
     ftprintf(fp, T("<entity name=\"%s\""), entityName);
     metaLocation(parser);
     metaLocation(parser);
     puttc(T('>'), fp);
     puttc(T('>'), fp);
-    characterData(fp, value, value_length);
+    characterData(data, value, value_length);
     fputts(T("</entity/>\n"), fp);
     fputts(T("</entity/>\n"), fp);
   }
   }
   else if (notationName) {
   else if (notationName) {
@@ -528,7 +759,7 @@ metaEntityDecl(void *userData,
     if (publicId)
     if (publicId)
       ftprintf(fp, T(" public=\"%s\""), publicId);
       ftprintf(fp, T(" public=\"%s\""), publicId);
     fputts(T(" system=\""), fp);
     fputts(T(" system=\""), fp);
-    characterData(fp, systemId, (int)tcslen(systemId));
+    characterData(data, systemId, (int)tcslen(systemId));
     puttc(T('"'), fp);
     puttc(T('"'), fp);
     ftprintf(fp, T(" notation=\"%s\""), notationName);
     ftprintf(fp, T(" notation=\"%s\""), notationName);
     metaLocation(parser);
     metaLocation(parser);
@@ -539,7 +770,7 @@ metaEntityDecl(void *userData,
     if (publicId)
     if (publicId)
       ftprintf(fp, T(" public=\"%s\""), publicId);
       ftprintf(fp, T(" public=\"%s\""), publicId);
     fputts(T(" system=\""), fp);
     fputts(T(" system=\""), fp);
-    characterData(fp, systemId, (int)tcslen(systemId));
+    characterData(data, systemId, (int)tcslen(systemId));
     puttc(T('"'), fp);
     puttc(T('"'), fp);
     metaLocation(parser);
     metaLocation(parser);
     fputts(T("/>\n"), fp);
     fputts(T("/>\n"), fp);
@@ -552,13 +783,14 @@ metaStartNamespaceDecl(void *userData,
                        const XML_Char *uri)
                        const XML_Char *uri)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   fputts(T("<startns"), fp);
   fputts(T("<startns"), fp);
   if (prefix)
   if (prefix)
     ftprintf(fp, T(" prefix=\"%s\""), prefix);
     ftprintf(fp, T(" prefix=\"%s\""), prefix);
   if (uri) {
   if (uri) {
     fputts(T(" ns=\""), fp);
     fputts(T(" ns=\""), fp);
-    characterData(fp, uri, (int)tcslen(uri));
+    characterData(data, uri, (int)tcslen(uri));
     fputts(T("\"/>\n"), fp);
     fputts(T("\"/>\n"), fp);
   }
   }
   else
   else
@@ -569,7 +801,8 @@ static void XMLCALL
 metaEndNamespaceDecl(void *userData, const XML_Char *prefix)
 metaEndNamespaceDecl(void *userData, const XML_Char *prefix)
 {
 {
   XML_Parser parser = (XML_Parser) userData;
   XML_Parser parser = (XML_Parser) userData;
-  FILE *fp = (FILE *)XML_GetUserData(parser);
+  XmlwfUserData *data = (XmlwfUserData *)XML_GetUserData(parser);
+  FILE *fp = data->fp;
   if (!prefix)
   if (!prefix)
     fputts(T("<endns/>\n"), fp);
     fputts(T("<endns/>\n"), fp);
   else
   else
@@ -659,10 +892,15 @@ static void
 usage(const XML_Char *prog, int rc)
 usage(const XML_Char *prog, int rc)
 {
 {
   ftprintf(stderr,
   ftprintf(stderr,
-           T("usage: %s [-s] [-n] [-p] [-x] [-e encoding] [-w] [-d output-dir] [-c] [-m] [-r] [-t] [file ...]\n"), prog);
+           T("usage: %s [-s] [-n] [-p] [-x] [-e encoding] [-w] [-d output-dir] [-c] [-m] [-r] [-t] [-N] [file ...]\n"), prog);
   exit(rc);
   exit(rc);
 }
 }
 
 
+#if defined(__MINGW32__) && defined(XML_UNICODE)
+/* Silence warning about missing prototype */
+int wmain(int argc, XML_Char **argv);
+#endif
+
 int
 int
 tmain(int argc, XML_Char **argv)
 tmain(int argc, XML_Char **argv)
 {
 {
@@ -674,9 +912,11 @@ tmain(int argc, XML_Char **argv)
   int outputType = 0;
   int outputType = 0;
   int useNamespaces = 0;
   int useNamespaces = 0;
   int requireStandalone = 0;
   int requireStandalone = 0;
+  int requiresNotations = 0;
   enum XML_ParamEntityParsing paramEntityParsing = 
   enum XML_ParamEntityParsing paramEntityParsing = 
     XML_PARAM_ENTITY_PARSING_NEVER;
     XML_PARAM_ENTITY_PARSING_NEVER;
   int useStdin = 0;
   int useStdin = 0;
+  XmlwfUserData userData = { NULL, NULL, NULL };
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
   _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
   _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
@@ -731,6 +971,10 @@ tmain(int argc, XML_Char **argv)
       outputType = 't';
       outputType = 't';
       j++;
       j++;
       break;
       break;
+    case T('N'):
+      requiresNotations = 1;
+      j++;
+      break;
     case T('d'):
     case T('d'):
       if (argv[i][j + 1] == T('\0')) {
       if (argv[i][j + 1] == T('\0')) {
         if (++i == argc)
         if (++i == argc)
@@ -776,7 +1020,6 @@ tmain(int argc, XML_Char **argv)
     i--;
     i--;
   }
   }
   for (; i < argc; i++) {
   for (; i < argc; i++) {
-    FILE *fp = 0;
     XML_Char *outName = 0;
     XML_Char *outName = 0;
     int result;
     int result;
     XML_Parser parser;
     XML_Parser parser;
@@ -786,7 +1029,7 @@ tmain(int argc, XML_Char **argv)
       parser = XML_ParserCreate(encoding);
       parser = XML_ParserCreate(encoding);
 
 
     if (! parser) {
     if (! parser) {
-      tperror("Could not instantiate parser");
+      tperror(T("Could not instantiate parser"));
       exit(1);
       exit(1);
     }
     }
 
 
@@ -825,16 +1068,16 @@ tmain(int argc, XML_Char **argv)
       tcscpy(outName, outputDir);
       tcscpy(outName, outputDir);
       tcscat(outName, delim);
       tcscat(outName, delim);
       tcscat(outName, file);
       tcscat(outName, file);
-      fp = tfopen(outName, T("wb"));
-      if (!fp) {
+      userData.fp = tfopen(outName, T("wb"));
+      if (!userData.fp) {
         tperror(outName);
         tperror(outName);
         exit(1);
         exit(1);
       }
       }
-      setvbuf(fp, NULL, _IOFBF, 16384);
+      setvbuf(userData.fp, NULL, _IOFBF, 16384);
 #ifdef XML_UNICODE
 #ifdef XML_UNICODE
-      puttc(0xFEFF, fp);
+      puttc(0xFEFF, userData.fp);
 #endif
 #endif
-      XML_SetUserData(parser, fp);
+      XML_SetUserData(parser, &userData);
       switch (outputType) {
       switch (outputType) {
       case 'm':
       case 'm':
         XML_UseParserAsHandlerArg(parser);
         XML_UseParserAsHandlerArg(parser);
@@ -868,6 +1111,10 @@ tmain(int argc, XML_Char **argv)
         XML_SetCharacterDataHandler(parser, characterData);
         XML_SetCharacterDataHandler(parser, characterData);
 #ifndef W3C14N
 #ifndef W3C14N
         XML_SetProcessingInstructionHandler(parser, processingInstruction);
         XML_SetProcessingInstructionHandler(parser, processingInstruction);
+        if (requiresNotations) {
+          XML_SetDoctypeDeclHandler(parser, startDoctypeDecl, endDoctypeDecl);
+          XML_SetNotationDeclHandler(parser, notationDecl);
+        }
 #endif /* not W3C14N */
 #endif /* not W3C14N */
         break;
         break;
       }
       }
@@ -878,7 +1125,7 @@ tmain(int argc, XML_Char **argv)
     if (outputDir) {
     if (outputDir) {
       if (outputType == 'm')
       if (outputType == 'm')
         metaEndDocument(parser);
         metaEndDocument(parser);
-      fclose(fp);
+      fclose(userData.fp);
       if (!result) {
       if (!result) {
         tremove(outName);
         tremove(outName);
         exit(2);
         exit(2);

+ 5 - 4
libs/expat/xmlwf/xmlwf.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
       <Configuration>Debug</Configuration>
@@ -18,20 +18,21 @@
     <SccProjectName />
     <SccProjectName />
     <SccLocalPath />
     <SccLocalPath />
     <ProjectGuid>{E3C5991F-5238-4168-A179-275D1AC98D7E}</ProjectGuid>
     <ProjectGuid>{E3C5991F-5238-4168-A179-275D1AC98D7E}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v120</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <UseOfMfc>false</UseOfMfc>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

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