├── .editorconfig ├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── benchmark.js ├── binding.gyp ├── deps └── libexpat │ ├── AUTHORS │ ├── CMake.README │ ├── CMakeLists.txt │ ├── COPYING │ ├── Changes │ ├── ConfigureChecks.cmake │ ├── MANIFEST │ ├── Makefile.in │ ├── README │ ├── aclocal.m4 │ ├── configure │ ├── configure.ac │ ├── conftools │ ├── PrintPath │ ├── ac_c_bigendian_cross.m4 │ ├── config.guess │ ├── config.sub │ ├── expat.m4 │ ├── get-version.sh │ ├── install-sh │ ├── ltmain.sh │ └── mkinstalldirs │ ├── doc │ ├── expat.png │ ├── reference.html │ ├── style.css │ ├── valid-xhtml10.png │ ├── xmlwf.1 │ └── xmlwf.xml │ ├── examples │ ├── elements.c │ └── outline.c │ ├── expat.pc.in │ ├── expat_config.h │ ├── expat_config.h.cmake │ ├── expat_config.h.in │ ├── lib │ ├── ascii.h │ ├── asciitab.h │ ├── expat.h │ ├── expat_external.h │ ├── iasciitab.h │ ├── internal.h │ ├── latin1tab.h │ ├── libexpat.def │ ├── libexpatw.def │ ├── nametab.h │ ├── siphash.h │ ├── utf8tab.h │ ├── winconfig.h │ ├── xmlparse.c │ ├── xmlrole.c │ ├── xmlrole.h │ ├── xmltok.c │ ├── xmltok.h │ ├── xmltok_impl.c │ ├── xmltok_impl.h │ └── xmltok_ns.c │ ├── libexpat.gyp │ ├── m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 │ ├── run.sh.in │ ├── tests │ ├── README.txt │ ├── benchmark │ │ ├── README.txt │ │ └── benchmark.c │ ├── chardata.c │ ├── chardata.h │ ├── memcheck.c │ ├── memcheck.h │ ├── minicheck.c │ ├── minicheck.h │ ├── runtests.c │ ├── runtestspp.cpp │ └── xmltest.sh │ ├── win32 │ ├── MANIFEST.txt │ ├── README.txt │ └── expat.iss │ └── xmlwf │ ├── codepage.c │ ├── codepage.h │ ├── ct.c │ ├── filemap.h │ ├── readfilemap.c │ ├── unixfilemap.c │ ├── win32filemap.c │ ├── xmlfile.c │ ├── xmlfile.h │ ├── xmlmime.c │ ├── xmlmime.h │ ├── xmltchar.h │ ├── xmlurl.h │ ├── xmlwf.c │ └── xmlwin32url.cxx ├── lib └── node-expat.js ├── node-expat.cc ├── package-lock.json ├── package.json └── test ├── index.js └── mystic-library.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | node_modules/ 3 | 4 | !.editorconfig 5 | !.gitignore 6 | !.npmignore 7 | !.travis.yml 8 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | 3 | .editorconfig 4 | .gitignore 5 | .npmignore 6 | .travis.yml 7 | 8 | benchmark.js 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | dist: focal 4 | 5 | language: node_js 6 | 7 | node_js: 8 | - '8' 9 | - '10' 10 | - '12' 11 | - '14' 12 | - '15' 13 | 14 | before_script: npm install -g standard 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Stephan Maka 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-expat 2 | 3 | [![build status](https://img.shields.io/travis/astro/node-expat/master.svg?style=flat-square)](https://travis-ci.org/astro/node-expat/branches) 4 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/) 5 | 6 | ## Motivation 7 | 8 | You use [Node.js](https://nodejs.org) for speed? You process XML streams? Then you want the fastest XML parser: [libexpat](http://expat.sourceforge.net/)! 9 | 10 | ## Install 11 | 12 | ``` 13 | npm install node-expat 14 | ``` 15 | 16 | ## Usage 17 | 18 | Important events emitted by a parser: 19 | 20 | ```javascript 21 | (function () { 22 | "use strict"; 23 | 24 | var expat = require('node-expat') 25 | var parser = new expat.Parser('UTF-8') 26 | 27 | parser.on('startElement', function (name, attrs) { 28 | console.log(name, attrs) 29 | }) 30 | 31 | parser.on('endElement', function (name) { 32 | console.log(name) 33 | }) 34 | 35 | parser.on('text', function (text) { 36 | console.log(text) 37 | }) 38 | 39 | parser.on('error', function (error) { 40 | console.error(error) 41 | }) 42 | 43 | parser.write('Hello World

Foobar

') 44 | 45 | }()) 46 | 47 | ``` 48 | 49 | ## API 50 | 51 | * `#on('startElement' function (name, attrs) {})` 52 | * `#on('endElement' function (name) {})` 53 | * `#on('text' function (text) {})` 54 | * `#on('processingInstruction', function (target, data) {})` 55 | * `#on('comment', function (s) {})` 56 | * `#on('xmlDecl', function (version, encoding, standalone) {})` 57 | * `#on('startCdata', function () {})` 58 | * `#on('endCdata', function () {})` 59 | * `#on('entityDecl', function (entityName, isParameterEntity, value, base, systemId, publicId, notationName) {})` 60 | * `#on('error', function (e) {})` 61 | * `#stop()` pauses 62 | * `#resume()` resumes 63 | 64 | ## Error handling 65 | 66 | We don't emit an error event because libexpat doesn't use a callback 67 | either. Instead, check that `parse()` returns `true`. A descriptive 68 | string can be obtained via `getError()` to provide user feedback. 69 | 70 | Alternatively, use the Parser like a node Stream. `write()` will emit 71 | error events. 72 | 73 | ## Namespace handling 74 | 75 | A word about special parsing of *xmlns:* this is not necessary in a 76 | bare SAX parser like this, given that the DOM replacement you are 77 | using (if any) is not relevant to the parser. 78 | 79 | ## Benchmark 80 | 81 | `npm run benchmark` 82 | 83 | | module | ops/sec | native | XML compliant | stream | 84 | |---------------------------------------------------------------------------------------|--------:|:------:|:-------------:|:--------------:| 85 | | [sax-js](https://github.com/isaacs/sax-js) | 99,412 | ☐ | ☑ | ☑ | 86 | | [node-xml](https://github.com/dylang/node-xml) | 130,631 | ☐ | ☑ | ☑ | 87 | | [libxmljs](https://github.com/polotek/libxmljs) | 276,136 | ☑ | ☑ | ☐ | 88 | | **node-expat** | 322,769 | ☑ | ☑ | ☑ | 89 | 90 | Higher is better. 91 | 92 | ## Testing 93 | 94 | ``` 95 | npm install -g standard 96 | npm test 97 | ``` 98 | 99 | ## Windows 100 | 101 | If you fail to install node-expat as a dependency of node-xmpp, please update node-xmpp as it doesn't use node-expat anymore. 102 | 103 | Dependencies for `node-gyp` https://github.com/TooTallNate/node-gyp#installation 104 | 105 | See https://github.com/astro/node-expat/issues/78 if you are getting errors about not finding `nan.h`. 106 | 107 | ### expat.vcproj 108 | 109 | ``` 110 | VCBUILD : error : project file 'node-expat\build\deps\libexpat\expat.vcproj' was not found or not a valid proj 111 | ect file. [C:\Users\admin\AppData\Roaming\npm\node_modules\node-expat\build\bin 112 | ding.sln] 113 | ``` 114 | 115 | Install [Visual Studio C++ 2012](http://go.microsoft.com/?linkid=9816758) and run npm with the [`--msvs_version=2012` flag](http://stackoverflow.com/a/16854333/937891). 116 | -------------------------------------------------------------------------------- /benchmark.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const benchmark = require('benchmark') 4 | const nodeXml = require('node-xml') 5 | let libxml = null 6 | const expat = require('./') 7 | const sax = require('sax') 8 | const LtxSaxParser = require('ltx/lib/parsers/ltx') 9 | 10 | try { 11 | libxml = require('libxmljs') 12 | } catch (err) { 13 | console.error('Cannot load libxmljs, please install it manually:', err) 14 | } 15 | 16 | function NodeXmlParser () { 17 | const parser = new nodeXml.SaxParser(function (cb) {}) 18 | this.parse = function (s) { 19 | parser.parseString(s) 20 | } 21 | this.name = 'node-xml' 22 | } 23 | function LibXmlJsParser () { 24 | const parser = new libxml.SaxPushParser(function (cb) {}) 25 | this.parse = function (s) { 26 | parser.push(s, false) 27 | } 28 | this.name = 'libxmljs' 29 | } 30 | function SaxParser () { 31 | const parser = sax.parser() 32 | this.parse = function (s) { 33 | parser.write(s).close() 34 | } 35 | this.name = 'sax' 36 | } 37 | function ExpatParser () { 38 | const parser = new expat.Parser() 39 | this.parse = function (s) { 40 | parser.parse(s, false) 41 | } 42 | this.name = 'node-expat' 43 | } 44 | function LtxParser () { 45 | const parser = new LtxSaxParser() 46 | this.parse = function (s) { 47 | parser.write(s) 48 | } 49 | this.name = 'ltx' 50 | } 51 | 52 | const parsers = [ 53 | SaxParser, 54 | NodeXmlParser, 55 | ExpatParser, 56 | LtxParser 57 | ].map(function (Parser) { 58 | return new Parser() 59 | }) 60 | 61 | if (libxml) { 62 | parsers.push(new LibXmlJsParser()) 63 | } 64 | 65 | const suite = new benchmark.Suite('parse') 66 | 67 | parsers.forEach(function (parser) { 68 | parser.parse('') 69 | suite.add(parser.name, function () { 70 | parser.parse('quux') 71 | }) 72 | }) 73 | 74 | suite.on('cycle', function (event) { 75 | console.log(event.target.toString()) 76 | }) 77 | .on('complete', function () { 78 | console.log('Fastest is ' + this.filter('fastest').map('name')) 79 | }) 80 | .run({ async: true }) 81 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'node_expat', 5 | 'sources': [ 'node-expat.cc' ], 6 | 'include_dirs': [ 7 | ' 3 | 4 | project(expat) 5 | 6 | cmake_minimum_required(VERSION 2.6) 7 | set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") 8 | set(PACKAGE_NAME "expat") 9 | set(PACKAGE_VERSION "2.2.1") 10 | set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 11 | set(PACKAGE_TARNAME "${PACKAGE_NAME}") 12 | 13 | option(BUILD_tools "build the xmlwf tool for expat library" ON) 14 | option(BUILD_examples "build the examples for expat library" ON) 15 | option(BUILD_tests "build the tests for expat library" ON) 16 | option(BUILD_shared "build a shared expat library" ON) 17 | option(BUILD_doc "build man page for xmlwf" ON) 18 | option(INSTALL "install expat files in cmake install target" ON) 19 | 20 | # configuration options 21 | set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point") 22 | option(XML_DTD "Define to make parameter entity parsing functionality available" ON) 23 | option(XML_NS "Define to make XML Namespaces functionality available" ON) 24 | 25 | if(XML_DTD) 26 | set(XML_DTD 1) 27 | else(XML_DTD) 28 | set(XML_DTD 0) 29 | endif(XML_DTD) 30 | if(XML_NS) 31 | set(XML_NS 1) 32 | else(XML_NS) 33 | set(XML_NS 0) 34 | endif(XML_NS) 35 | 36 | if(BUILD_tests) 37 | enable_testing() 38 | endif(BUILD_tests) 39 | 40 | include(ConfigureChecks.cmake) 41 | 42 | set(EXTRA_LINK_AND_COMPILE_FLAGS "-fno-strict-aliasing") 43 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_LINK_AND_COMPILE_FLAGS}") 44 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_LINK_AND_COMPILE_FLAGS}") 45 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LINK_AND_COMPILE_FLAGS}") 46 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${EXTRA_LINK_AND_COMPILE_FLAGS}") 47 | 48 | include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib) 49 | if(MSVC) 50 | add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996) 51 | endif(MSVC) 52 | if(WIN32) 53 | set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Add a suffix, usually d on Windows") 54 | endif(WIN32) 55 | 56 | set(expat_SRCS 57 | lib/xmlparse.c 58 | lib/xmlrole.c 59 | lib/xmltok.c 60 | lib/xmltok_impl.c 61 | lib/xmltok_ns.c 62 | ) 63 | 64 | if(BUILD_shared) 65 | set(_SHARED SHARED) 66 | if(WIN32) 67 | set(expat_SRCS ${expat_SRCS} lib/libexpat.def) 68 | endif(WIN32) 69 | else(BUILD_shared) 70 | set(_SHARED STATIC) 71 | if(WIN32) 72 | add_definitions(-DXML_STATIC) 73 | endif(WIN32) 74 | endif(BUILD_shared) 75 | 76 | add_library(expat ${_SHARED} ${expat_SRCS}) 77 | 78 | set(LIBCURRENT 7) # sync 79 | set(LIBREVISION 3) # with 80 | set(LIBAGE 6) # configure.ac! 81 | math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}") 82 | 83 | if(NOT WIN32) 84 | set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION}) 85 | set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE}) 86 | set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME}) 87 | endif(NOT WIN32) 88 | 89 | macro(expat_install) 90 | if(INSTALL) 91 | install(${ARGN}) 92 | endif() 93 | endmacro() 94 | 95 | expat_install(TARGETS expat RUNTIME DESTINATION bin 96 | LIBRARY DESTINATION lib 97 | ARCHIVE DESTINATION lib) 98 | 99 | set(prefix ${CMAKE_INSTALL_PREFIX}) 100 | set(exec_prefix "\${prefix}/bin") 101 | set(libdir "\${prefix}/lib") 102 | set(includedir "\${prefix}/include") 103 | configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc) 104 | 105 | expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION include) 106 | expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION lib/pkgconfig) 107 | 108 | if(BUILD_tools AND NOT WINCE) 109 | set(xmlwf_SRCS 110 | xmlwf/xmlwf.c 111 | xmlwf/xmlfile.c 112 | xmlwf/codepage.c 113 | xmlwf/readfilemap.c 114 | ) 115 | 116 | add_executable(xmlwf ${xmlwf_SRCS}) 117 | set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) 118 | target_link_libraries(xmlwf expat) 119 | expat_install(TARGETS xmlwf DESTINATION bin) 120 | if(BUILD_doc AND NOT MSVC) 121 | if(CMAKE_GENERATOR STREQUAL "Unix Makefiles") 122 | set(make_command "$(MAKE)") 123 | else() 124 | set(make_command "make") 125 | endif() 126 | 127 | add_custom_command(TARGET expat PRE_BUILD COMMAND "${make_command}" -C "${PROJECT_SOURCE_DIR}/doc" xmlwf.1) 128 | expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1) 129 | endif() 130 | endif(BUILD_tools AND NOT WINCE) 131 | 132 | if(BUILD_examples) 133 | add_executable(elements examples/elements.c) 134 | set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) 135 | target_link_libraries(elements expat) 136 | 137 | add_executable(outline examples/outline.c) 138 | set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) 139 | target_link_libraries(outline expat) 140 | endif(BUILD_examples) 141 | 142 | if(BUILD_tests) 143 | ## these are unittests that can be run on any platform 144 | add_executable(runtests tests/runtests.c tests/chardata.c tests/minicheck.c tests/memcheck.c) 145 | set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) 146 | target_link_libraries(runtests expat) 147 | add_test(runtests tests/runtests) 148 | 149 | add_executable(runtestspp tests/runtestspp.cpp tests/chardata.c tests/minicheck.c tests/memcheck.c) 150 | set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) 151 | target_link_libraries(runtestspp expat) 152 | add_test(runtestspp tests/runtestspp) 153 | endif(BUILD_tests) 154 | -------------------------------------------------------------------------------- /deps/libexpat/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper 2 | Copyright (c) 2001-2017 Expat maintainers 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /deps/libexpat/ConfigureChecks.cmake: -------------------------------------------------------------------------------- 1 | include(CheckIncludeFile) 2 | include(CheckIncludeFiles) 3 | include(CheckFunctionExists) 4 | include(CheckSymbolExists) 5 | include(TestBigEndian) 6 | 7 | check_include_file("dlfcn.h" HAVE_DLFCN_H) 8 | check_include_file("fcntl.h" HAVE_FCNTL_H) 9 | check_include_file("inttypes.h" HAVE_INTTYPES_H) 10 | check_include_file("memory.h" HAVE_MEMORY_H) 11 | check_include_file("stdint.h" HAVE_STDINT_H) 12 | check_include_file("stdlib.h" HAVE_STDLIB_H) 13 | check_include_file("strings.h" HAVE_STRINGS_H) 14 | check_include_file("string.h" HAVE_STRING_H) 15 | check_include_file("sys/stat.h" HAVE_SYS_STAT_H) 16 | check_include_file("sys/types.h" HAVE_SYS_TYPES_H) 17 | check_include_file("unistd.h" HAVE_UNISTD_H) 18 | 19 | check_function_exists("getpagesize" HAVE_GETPAGESIZE) 20 | check_function_exists("bcopy" HAVE_BCOPY) 21 | check_symbol_exists("memmove" "string.h" HAVE_MEMMOVE) 22 | check_function_exists("mmap" HAVE_MMAP) 23 | 24 | #/* Define to 1 if you have the ANSI C header files. */ 25 | check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) 26 | 27 | test_big_endian(WORDS_BIGENDIAN) 28 | #/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 29 | if(WORDS_BIGENDIAN) 30 | set(BYTEORDER 4321) 31 | else(WORDS_BIGENDIAN) 32 | set(BYTEORDER 1234) 33 | endif(WORDS_BIGENDIAN) 34 | 35 | if(HAVE_SYS_TYPES_H) 36 | check_symbol_exists("off_t" "sys/types.h" OFF_T) 37 | check_symbol_exists("size_t" "sys/types.h" SIZE_T) 38 | else(HAVE_SYS_TYPES_H) 39 | set(OFF_T "long") 40 | set(SIZE_T "unsigned") 41 | endif(HAVE_SYS_TYPES_H) 42 | 43 | configure_file(expat_config.h.cmake expat_config.h) 44 | add_definitions(-DHAVE_EXPAT_CONFIG_H) 45 | -------------------------------------------------------------------------------- /deps/libexpat/MANIFEST: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | doc/expat.png 3 | doc/reference.html 4 | doc/style.css 5 | doc/valid-xhtml10.png 6 | doc/xmlwf.1 7 | doc/xmlwf.xml 8 | CMakeLists.txt 9 | CMake.README 10 | COPYING 11 | Changes 12 | ConfigureChecks.cmake 13 | MANIFEST 14 | Makefile.in 15 | README 16 | configure 17 | configure.ac 18 | expat_config.h.in 19 | expat_config.h.cmake 20 | expat.pc.in 21 | aclocal.m4 22 | run.sh.in 23 | conftools/PrintPath 24 | conftools/ac_c_bigendian_cross.m4 25 | conftools/expat.m4 26 | conftools/get-version.sh 27 | conftools/mkinstalldirs 28 | conftools/config.guess 29 | conftools/config.sub 30 | conftools/install-sh 31 | conftools/ltmain.sh 32 | m4/libtool.m4 33 | m4/ltversion.m4 34 | m4/ltoptions.m4 35 | m4/ltsugar.m4 36 | m4/lt~obsolete.m4 37 | examples/elements.c 38 | examples/outline.c 39 | lib/ascii.h 40 | lib/asciitab.h 41 | lib/expat.h 42 | lib/expat_external.h 43 | lib/iasciitab.h 44 | lib/internal.h 45 | lib/latin1tab.h 46 | lib/libexpat.def 47 | lib/libexpatw.def 48 | lib/nametab.h 49 | lib/siphash.h 50 | lib/utf8tab.h 51 | lib/winconfig.h 52 | lib/xmlparse.c 53 | lib/xmlrole.c 54 | lib/xmlrole.h 55 | lib/xmltok.c 56 | lib/xmltok.h 57 | lib/xmltok_impl.c 58 | lib/xmltok_impl.h 59 | lib/xmltok_ns.c 60 | tests/benchmark/README.txt 61 | tests/benchmark/benchmark.c 62 | tests/README.txt 63 | tests/chardata.c 64 | tests/chardata.h 65 | tests/memcheck.c 66 | tests/memcheck.h 67 | tests/minicheck.c 68 | tests/minicheck.h 69 | tests/runtests.c 70 | tests/runtestspp.cpp 71 | tests/xmltest.sh 72 | win32/MANIFEST.txt 73 | win32/README.txt 74 | win32/expat.iss 75 | xmlwf/codepage.c 76 | xmlwf/codepage.h 77 | xmlwf/ct.c 78 | xmlwf/filemap.h 79 | xmlwf/readfilemap.c 80 | xmlwf/unixfilemap.c 81 | xmlwf/win32filemap.c 82 | xmlwf/xmlfile.c 83 | xmlwf/xmlfile.h 84 | xmlwf/xmlmime.c 85 | xmlwf/xmlmime.h 86 | xmlwf/xmltchar.h 87 | xmlwf/xmlurl.h 88 | xmlwf/xmlwf.c 89 | xmlwf/xmlwin32url.cxx 90 | -------------------------------------------------------------------------------- /deps/libexpat/Makefile.in: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # Process this file with top-level configure script to produce Makefile 3 | # 4 | # Copyright 2000 Clark Cooper 5 | # 6 | # This file is part of EXPAT. 7 | # 8 | # EXPAT is free software; you can redistribute it and/or modify it 9 | # under the terms of the License (based on the MIT/X license) contained 10 | # in the file COPYING that comes with this distribution. 11 | # 12 | # EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 16 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 17 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. 19 | # 20 | 21 | SHELL = @SHELL@ 22 | 23 | srcdir = @srcdir@ 24 | top_srcdir = @top_srcdir@ 25 | VPATH = @srcdir@ 26 | 27 | prefix = @prefix@ 28 | exec_prefix = @exec_prefix@ 29 | 30 | bindir = @bindir@ 31 | libdir = @libdir@ 32 | includedir = @includedir@ 33 | man1dir = @mandir@/man1 34 | pkgconfigdir = $(libdir)/pkgconfig 35 | 36 | top_builddir = . 37 | 38 | 39 | INSTALL = @INSTALL@ 40 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 41 | INSTALL_DATA = @INSTALL_DATA@ 42 | mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs 43 | 44 | MANFILE = $(srcdir)/doc/xmlwf.1 45 | APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h expat_config.h 46 | LIBRARY = libexpat.la 47 | 48 | DESTDIR = $(INSTALL_ROOT) 49 | 50 | default: buildlib xmlwf/xmlwf@EXEEXT@ 51 | 52 | buildlib: $(LIBRARY) expat.pc 53 | 54 | all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline $(MANFILE) 55 | 56 | clean: 57 | cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs 58 | cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs 59 | cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs 60 | cd tests && rm -rf .libs runtests@EXEEXT@ runtests.@OBJEXT@ runtestspp@EXEEXT@ runtestspp.@OBJEXT@ 61 | cd tests && rm -f chardata.@OBJEXT@ memcheck.@OBJEXT@ minicheck.@OBJEXT@ 62 | rm -rf .libs libexpat.la 63 | rm -f examples/core tests/core xmlwf/core 64 | 65 | clobber: clean 66 | 67 | distclean: clean 68 | rm -f expat_config.h config.status config.log config.cache libtool 69 | rm -f Makefile expat.pc 70 | 71 | extraclean: distclean 72 | rm -f expat_config.h.in configure 73 | rm -f aclocal.m4 m4/* 74 | rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub 75 | 76 | check: tests/runtests@EXEEXT@ tests/runtestspp@EXEEXT@ 77 | ./run.sh tests/runtests@EXEEXT@ 78 | ./run.sh tests/runtestspp@EXEEXT@ 79 | 80 | $(MANFILE): 81 | $(MAKE) -C doc xmlwf.1 82 | 83 | install: xmlwf/xmlwf@EXEEXT@ installlib $(MANFILE) 84 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) 85 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf 86 | $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) 87 | 88 | installlib: $(LIBRARY) $(APIHEADER) expat.pc 89 | $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir) 90 | $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) 91 | for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done 92 | $(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc 93 | 94 | uninstall: uninstalllib 95 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@ 96 | rm -f $(DESTDIR)$(man1dir)/xmlwf.1 97 | 98 | uninstalllib: 99 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) 100 | rm -f $(DESTDIR)$(includedir)/expat.h 101 | rm -f $(DESTDIR)$(includedir)/expat_external.h 102 | rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc 103 | 104 | # for VPATH builds (invoked by configure) 105 | mkdir-init: 106 | @for d in lib xmlwf examples tests ; do \ 107 | (mkdir $$d 2> /dev/null || test 1) ; \ 108 | done 109 | 110 | CC = @CC@ 111 | CXX = @CXX@ 112 | LIBTOOL = @LIBTOOL@ 113 | 114 | INCLUDES = -I$(srcdir)/lib -I. 115 | LDFLAGS = @LDFLAGS@ 116 | CPPFLAGS = @CPPFLAGS@ -DHAVE_EXPAT_CONFIG_H 117 | CFLAGS = @CFLAGS@ 118 | CXXFLAGS = @CXXFLAGS@ 119 | VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ 120 | 121 | ### autoconf this? 122 | LTFLAGS = --verbose 123 | 124 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS) 125 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS) 126 | LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) 127 | LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) @LIBS@ -o $@ 128 | LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ 129 | LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@ 130 | 131 | LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo 132 | $(LIBRARY): $(LIB_OBJS) 133 | $(LINK_LIB) $(LIB_OBJS) 134 | 135 | expat.pc: $(top_builddir)/config.status 136 | cd $(top_builddir) && $(SHELL) ./config.status $@ 137 | 138 | lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/siphash.h lib/xmlrole.h lib/xmltok.h \ 139 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h 140 | 141 | lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ 142 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h 143 | 144 | lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ 145 | lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ 146 | lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ 147 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h 148 | 149 | 150 | XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@ 151 | xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c 152 | xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c 153 | xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c 154 | xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c xmlwf/filemap.h 155 | xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY) 156 | $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) 157 | 158 | examples/elements.@OBJEXT@: examples/elements.c 159 | examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) 160 | $(LINK_EXE) examples/elements.@OBJEXT@ $(LIBRARY) 161 | 162 | examples/outline.@OBJEXT@: examples/outline.c 163 | examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) 164 | $(LINK_EXE) examples/outline.@OBJEXT@ $(LIBRARY) 165 | 166 | tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h 167 | tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h 168 | tests/memcheck.@OBJEXT@: tests/memcheck.c tests/memcheck.h 169 | tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h tests/memcheck.h lib/siphash.h 170 | tests/runtests@EXEEXT@: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) 171 | $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) 172 | tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h tests/memcheck.h 173 | tests/runtestspp@EXEEXT@: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) 174 | $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ tests/memcheck.@OBJEXT@ $(LIBRARY) 175 | 176 | tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c 177 | tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) 178 | $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) 179 | 180 | run-benchmark: tests/benchmark/benchmark 181 | tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 182 | 183 | tests/xmlts.zip: 184 | wget --output-document=tests/xmlts.zip \ 185 | https://www.w3.org/XML/Test/xmlts20080827.zip 186 | 187 | tests/xmlconf: tests/xmlts.zip 188 | cd tests && unzip -q xmlts.zip 189 | 190 | run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/xmlconf 191 | tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log 192 | diff -u -b tests/xmltest.log.expected tests/xmltest.log 193 | 194 | .PHONY: qa 195 | qa: 196 | ./qa.sh address 197 | ./qa.sh memory 198 | ./qa.sh undefined 199 | ./qa.sh coverage 200 | 201 | .SUFFIXES: .c .cpp .lo .@OBJEXT@ 202 | 203 | .cpp.@OBJEXT@: 204 | $(CXXCOMPILE) -o $@ -c $< 205 | .c.@OBJEXT@: 206 | $(COMPILE) -o $@ -c $< 207 | .c.lo: 208 | $(LTCOMPILE) -o $@ -c $< 209 | 210 | .PHONY: buildlib all \ 211 | clean distclean extraclean maintainer-clean \ 212 | dist distdir \ 213 | install uninstall 214 | -------------------------------------------------------------------------------- /deps/libexpat/README: -------------------------------------------------------------------------------- 1 | 2 | Expat, Release 2.2.1 3 | 4 | This is Expat, a C library for parsing XML, written by James Clark. 5 | Expat is a stream-oriented XML parser. This means that you register 6 | handlers with the parser before starting the parse. These handlers 7 | are called when the parser discovers the associated structures in the 8 | document being parsed. A start tag is an example of the kind of 9 | structures for which you may register handlers. 10 | 11 | Windows users should use the expat_win32bin package, which includes 12 | both precompiled libraries and executables, and source code for 13 | developers. 14 | 15 | Expat is free software. You may copy, distribute, and modify it under 16 | the terms of the License contained in the file COPYING distributed 17 | with this package. This license is the same as the MIT/X Consortium 18 | license. 19 | 20 | Versions of Expat that have an odd minor version (the middle number in 21 | the release above), are development releases and should be considered 22 | as beta software. Releases with even minor version numbers are 23 | intended to be production grade software. 24 | 25 | If you are building Expat from a check-out from the CVS repository, 26 | you need to run a script that generates the configure script using the 27 | GNU autoconf and libtool tools. To do this, you need to have 28 | autoconf 2.58 or newer. Run the script like this: 29 | 30 | ./buildconf.sh 31 | 32 | Once this has been done, follow the same instructions as for building 33 | from a source distribution. 34 | 35 | To build Expat from a source distribution, you first run the 36 | configuration shell script in the top level distribution directory: 37 | 38 | ./configure 39 | 40 | There are many options which you may provide to configure (which you 41 | can discover by running configure with the --help option). But the 42 | one of most interest is the one that sets the installation directory. 43 | By default, the configure script will set things up to install 44 | libexpat into /usr/local/lib, expat.h into /usr/local/include, and 45 | xmlwf into /usr/local/bin. If, for example, you'd prefer to install 46 | into /home/me/mystuff/lib, /home/me/mystuff/include, and 47 | /home/me/mystuff/bin, you can tell configure about that with: 48 | 49 | ./configure --prefix=/home/me/mystuff 50 | 51 | Another interesting option is to enable 64-bit integer support for 52 | line and column numbers and the over-all byte index: 53 | 54 | ./configure CPPFLAGS=-DXML_LARGE_SIZE 55 | 56 | However, such a modification would be a breaking change to the ABI 57 | and is therefore not recommended for general use - e.g. as part of 58 | a Linux distribution - but rather for builds with special requirements. 59 | 60 | After running the configure script, the "make" command will build 61 | things and "make install" will install things into their proper 62 | location. Have a look at the "Makefile" to learn about additional 63 | "make" options. Note that you need to have write permission into 64 | the directories into which things will be installed. 65 | 66 | If you are interested in building Expat to provide document 67 | information in UTF-16 encoding rather than the default UTF-8, follow 68 | these instructions (after having run "make distclean"): 69 | 70 | 1. For UTF-16 output as unsigned short (and version/error 71 | strings as char), run: 72 | 73 | ./configure CPPFLAGS=-DXML_UNICODE 74 | 75 | For UTF-16 output as wchar_t (incl. version/error strings), 76 | run: 77 | 78 | ./configure CFLAGS="-g -O2 -fshort-wchar" \ 79 | CPPFLAGS=-DXML_UNICODE_WCHAR_T 80 | 81 | 2. Edit the MakeFile, changing: 82 | 83 | LIBRARY = libexpat.la 84 | 85 | to: 86 | 87 | LIBRARY = libexpatw.la 88 | 89 | (Note the additional "w" in the library name.) 90 | 91 | 3. Run "make buildlib" (which builds the library only). 92 | Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la". 93 | 94 | 4. Run "make installlib" (which installs the library only). 95 | Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la". 96 | 97 | Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default 98 | value for DESTDIR, and the rest of the make file using only DESTDIR. 99 | It works as follows: 100 | $ make install DESTDIR=/path/to/image 101 | overrides the in-makefile set DESTDIR, while both 102 | $ INSTALL_ROOT=/path/to/image make install 103 | $ make install INSTALL_ROOT=/path/to/image 104 | use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the 105 | environment, because variable-setting priority is 106 | 1) commandline 107 | 2) in-makefile 108 | 3) environment 109 | 110 | Note: This only applies to the Expat library itself, building UTF-16 versions 111 | of xmlwf and the tests is currently not supported. 112 | 113 | Note for Solaris users: The "ar" command is usually located in 114 | "/usr/ccs/bin", which is not in the default PATH. You will need to 115 | add this to your path for the "make" command, and probably also switch 116 | to GNU make (the "make" found in /usr/ccs/bin does not seem to work 117 | properly -- apparently it does not understand .PHONY directives). If 118 | you're using ksh or bash, use this command to build: 119 | 120 | PATH=/usr/ccs/bin:$PATH make 121 | 122 | When using Expat with a project using autoconf for configuration, you 123 | can use the probing macro in conftools/expat.m4 to determine how to 124 | include Expat. See the comments at the top of that file for more 125 | information. 126 | 127 | A reference manual is available in the file doc/reference.html in this 128 | distribution. 129 | 130 | The homepage for this project is http://www.libexpat.org/. There 131 | are links there to connect you to the bug reports page. If you need 132 | to report a bug when you don't have access to a browser, you may also 133 | send a bug report by email to expat-bugs@mail.libexpat.org. 134 | 135 | Discussion related to the direction of future expat development takes 136 | place on expat-discuss@mail.libexpat.org. Archives of this list and 137 | other Expat-related lists may be found at: 138 | 139 | http://mail.libexpat.org/mailman/listinfo/ 140 | -------------------------------------------------------------------------------- /deps/libexpat/aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.15 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. 4 | 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15 | m4_include([m4/libtool.m4]) 16 | m4_include([m4/ltoptions.m4]) 17 | m4_include([m4/ltsugar.m4]) 18 | m4_include([m4/ltversion.m4]) 19 | m4_include([m4/lt~obsolete.m4]) 20 | -------------------------------------------------------------------------------- /deps/libexpat/configure.ac: -------------------------------------------------------------------------------- 1 | dnl configuration script for expat 2 | dnl Process this file with autoconf to produce a configure script. 3 | dnl 4 | dnl Copyright 2000 Clark Cooper 5 | dnl 6 | dnl This file is part of EXPAT. 7 | dnl 8 | dnl EXPAT is free software; you can redistribute it and/or modify it 9 | dnl under the terms of the License (based on the MIT/X license) contained 10 | dnl in the file COPYING that comes with this distribution. 11 | dnl 12 | 13 | dnl Ensure that Expat is configured with autoconf 2.58 or newer 14 | AC_PREREQ(2.58) 15 | 16 | dnl Get the version number of Expat, using m4's esyscmd() command to run 17 | dnl the command at m4-generation time. This allows us to create an m4 18 | dnl symbol holding the correct version number. AC_INIT() requires the 19 | dnl version number at m4-time, rather than when ./configure is run, so 20 | dnl all this must happen as part of m4, not as part of the shell code 21 | dnl contained in ./configure. 22 | dnl 23 | dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate 24 | dnl test. I believe this test will work, but I don't have a place with non- 25 | dnl GNU M4 to test it right now. 26 | define([expat_version], ifdef([__gnu__], 27 | [esyscmd(conftools/get-version.sh lib/expat.h)], 28 | [2.2.x])) 29 | AC_INIT(expat, expat_version, expat-bugs@libexpat.org) 30 | undefine([expat_version]) 31 | 32 | AC_CONFIG_SRCDIR(Makefile.in) 33 | AC_CONFIG_AUX_DIR(conftools) 34 | AC_CONFIG_MACRO_DIR([m4]) 35 | 36 | 37 | dnl 38 | dnl Increment LIBREVISION if source code has changed at all 39 | dnl 40 | dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 41 | dnl 42 | dnl If the API changes compatibly (i.e. simply adding a new function 43 | dnl without changing or removing earlier interfaces), then increment LIBAGE. 44 | dnl 45 | dnl If the API changes incompatibly set LIBAGE back to 0 46 | dnl 47 | 48 | LIBCURRENT=7 # sync 49 | LIBREVISION=3 # with 50 | LIBAGE=6 # CMakeLists.txt! 51 | 52 | AC_CONFIG_HEADER(expat_config.h) 53 | 54 | sinclude(conftools/ac_c_bigendian_cross.m4) 55 | 56 | AC_LIBTOOL_WIN32_DLL 57 | AC_PROG_LIBTOOL 58 | 59 | AC_SUBST(LIBCURRENT) 60 | AC_SUBST(LIBREVISION) 61 | AC_SUBST(LIBAGE) 62 | 63 | dnl Checks for programs. 64 | AC_PROG_CC 65 | AC_PROG_CXX 66 | AC_PROG_INSTALL 67 | 68 | if test "$GCC" = yes ; then 69 | dnl 70 | dnl Be careful about adding the -fexceptions option; some versions of 71 | dnl GCC don't support it and it causes extra warnings that are only 72 | dnl distracting; avoid. 73 | dnl 74 | OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" 75 | CFLAGS="$OLDCFLAGS -fexceptions" 76 | AC_MSG_CHECKING(whether $CC accepts -fexceptions) 77 | AC_TRY_LINK( , , 78 | AC_MSG_RESULT(yes), 79 | AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") 80 | if test "x$CXXFLAGS" = x ; then 81 | CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'` 82 | fi 83 | 84 | CFLAGS="${CFLAGS} -fno-strict-aliasing" 85 | CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" 86 | LDFLAGS="${LDFLAGS} -fno-strict-aliasing" 87 | fi 88 | 89 | dnl Checks for header files. 90 | AC_HEADER_STDC 91 | 92 | dnl Checks for typedefs, structures, and compiler characteristics. 93 | 94 | dnl Note: Avoid using AC_C_BIGENDIAN because it does not 95 | dnl work in a cross compile. 96 | AC_C_BIGENDIAN_CROSS 97 | 98 | AC_C_CONST 99 | AC_TYPE_SIZE_T 100 | AC_CHECK_FUNCS(memmove bcopy) 101 | 102 | 103 | AC_ARG_WITH([libbsd], [ 104 | AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)]) 105 | ], [], [with_libbsd=no]) 106 | AS_IF([test "x${with_libbsd}" != xno], [ 107 | AC_CHECK_LIB([bsd], [arc4random_buf], [], [ 108 | AS_IF([test "x${with_libbsd}" = xyes], [ 109 | AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.]) 110 | ]) 111 | ]) 112 | ]) 113 | AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) 114 | AC_LINK_IFELSE([AC_LANG_SOURCE([ 115 | #include /* for arc4random_buf on BSD, for NULL */ 116 | #if defined(HAVE_LIBBSD) 117 | # include 118 | #endif 119 | int main() { 120 | arc4random_buf(NULL, 0U); 121 | return 0; 122 | } 123 | ])], [ 124 | AC_DEFINE([HAVE_ARC4RANDOM_BUF], [1], 125 | [Define to 1 if you have the `arc4random_buf' function.]) 126 | AC_MSG_RESULT([yes]) 127 | ], [ 128 | AC_MSG_RESULT([no]) 129 | ]) 130 | 131 | 132 | AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)]) 133 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ 134 | #include /* for NULL */ 135 | #include 136 | int main() { 137 | return getrandom(NULL, 0U, 0U); 138 | } 139 | ])], [ 140 | AC_DEFINE([HAVE_GETRANDOM], [1], 141 | [Define to 1 if you have the `getrandom' function.]) 142 | AC_MSG_RESULT([yes]) 143 | ], [ 144 | AC_MSG_RESULT([no]) 145 | 146 | AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) 147 | AC_LINK_IFELSE([AC_LANG_SOURCE([ 148 | #include /* for NULL */ 149 | #include /* for syscall */ 150 | #include /* for SYS_getrandom */ 151 | int main() { 152 | syscall(SYS_getrandom, NULL, 0, 0); 153 | return 0; 154 | } 155 | ])], [ 156 | AC_DEFINE([HAVE_SYSCALL_GETRANDOM], [1], 157 | [Define to 1 if you have `syscall' and `SYS_getrandom'.]) 158 | AC_MSG_RESULT([yes]) 159 | ], [ 160 | AC_MSG_RESULT([no]) 161 | ]) 162 | ]) 163 | 164 | 165 | dnl Only needed for xmlwf: 166 | AC_CHECK_HEADERS(fcntl.h unistd.h) 167 | AC_TYPE_OFF_T 168 | AC_FUNC_MMAP 169 | 170 | if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then 171 | FILEMAP=unixfilemap 172 | else 173 | FILEMAP=readfilemap 174 | fi 175 | AC_SUBST(FILEMAP) 176 | 177 | dnl Needed for the test support code; this was found at 178 | dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html 179 | 180 | # AC_CPP_FUNC 181 | # ------------------ # 182 | # Checks to see if ANSI C99 CPP variable __func__ works. 183 | # If not, perhaps __FUNCTION__ works instead. 184 | # If not, we'll just define __func__ to "". 185 | AC_DEFUN([AC_CPP_FUNC], 186 | [AC_REQUIRE([AC_PROG_CC_STDC])dnl 187 | AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, 188 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], 189 | [[const char *foo = __func__;]])], 190 | [ac_cv_cpp_func=yes], 191 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], 192 | [[const char *foo = __FUNCTION__;]])], 193 | [ac_cv_cpp_func=__FUNCTION__], 194 | [ac_cv_cpp_func=no])])]) 195 | if test $ac_cv_cpp_func = __FUNCTION__; then 196 | AC_DEFINE(__func__,__FUNCTION__, 197 | [Define to __FUNCTION__ or "" if `__func__' does not conform to 198 | ANSI C.]) 199 | elif test $ac_cv_cpp_func = no; then 200 | AC_DEFINE(__func__,"", 201 | [Define to __FUNCTION__ or "" if `__func__' does not conform to 202 | ANSI C.]) 203 | fi 204 | ])# AC_CPP_FUNC 205 | 206 | AC_CPP_FUNC 207 | 208 | 209 | dnl Some basic configuration: 210 | AC_DEFINE([XML_NS], 1, 211 | [Define to make XML Namespaces functionality available.]) 212 | AC_DEFINE([XML_DTD], 1, 213 | [Define to make parameter entity parsing functionality available.]) 214 | 215 | AC_ARG_ENABLE([xml-context], 216 | AS_HELP_STRING([--enable-xml-context @<:@COUNT@:>@], 217 | [Retain context around the current parse point; 218 | default is enabled and a size of 1024 bytes]) 219 | AS_HELP_STRING([--disable-xml-context], 220 | [Do not retain context around the current parse point]), 221 | [enable_xml_context=${enableval}]) 222 | AS_IF([test "x${enable_xml_context}" != "xno"], [ 223 | AS_IF([test "x${enable_xml_context}" == "xyes" \ 224 | -o "x${enable_xml_context}" == "x"], [ 225 | enable_xml_context=1024 226 | ]) 227 | AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], 228 | [Define to specify how much context to retain around the current parse point.]) 229 | ]) 230 | 231 | AC_CONFIG_FILES([Makefile expat.pc]) 232 | AC_CONFIG_FILES([run.sh], [chmod +x run.sh]) 233 | AC_OUTPUT 234 | 235 | abs_srcdir="`cd $srcdir && pwd`" 236 | abs_builddir="`pwd`" 237 | if test "$abs_srcdir" != "$abs_builddir"; then 238 | make mkdir-init 239 | fi 240 | -------------------------------------------------------------------------------- /deps/libexpat/conftools/PrintPath: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Look for program[s] somewhere in $PATH. 3 | # 4 | # Options: 5 | # -s 6 | # Do not print out full pathname. (silent) 7 | # -pPATHNAME 8 | # Look in PATHNAME instead of $PATH 9 | # 10 | # Usage: 11 | # PrintPath [-s] [-pPATHNAME] program [program ...] 12 | # 13 | # Initially written by Jim Jagielski for the Apache configuration mechanism 14 | # (with kudos to Kernighan/Pike) 15 | # 16 | # This script falls under the Apache License. 17 | # See http://www.apache.org/licenses/LICENSE 18 | 19 | ## 20 | # Some "constants" 21 | ## 22 | pathname=$PATH 23 | echo="yes" 24 | 25 | ## 26 | # Find out what OS we are running for later on 27 | ## 28 | os=`(uname) 2>/dev/null` 29 | 30 | ## 31 | # Parse command line 32 | ## 33 | for args in $* 34 | do 35 | case $args in 36 | -s ) echo="no" ;; 37 | -p* ) pathname="`echo $args | sed 's/^..//'`" ;; 38 | * ) programs="$programs $args" ;; 39 | esac 40 | done 41 | 42 | ## 43 | # Now we make the adjustments required for OS/2 and everyone 44 | # else :) 45 | # 46 | # First of all, all OS/2 programs have the '.exe' extension. 47 | # Next, we adjust PATH (or what was given to us as PATH) to 48 | # be whitespace separated directories. 49 | # Finally, we try to determine the best flag to use for 50 | # test/[] to look for an executable file. OS/2 just has '-r' 51 | # but with other OSs, we do some funny stuff to check to see 52 | # if test/[] knows about -x, which is the preferred flag. 53 | ## 54 | 55 | if [ "x$os" = "xOS/2" ] 56 | then 57 | ext=".exe" 58 | pathname=`echo -E $pathname | 59 | sed 's/^;/.;/ 60 | s/;;/;.;/g 61 | s/;$/;./ 62 | s/;/ /g 63 | s/\\\\/\\//g' ` 64 | test_exec_flag="-r" 65 | else 66 | ext="" # No default extensions 67 | pathname=`echo $pathname | 68 | sed 's/^:/.:/ 69 | s/::/:.:/g 70 | s/:$/:./ 71 | s/:/ /g' ` 72 | # Here is how we test to see if test/[] can handle -x 73 | testfile="pp.t.$$" 74 | 75 | cat > $testfile </dev/null`; then 84 | test_exec_flag="-x" 85 | else 86 | test_exec_flag="-r" 87 | fi 88 | rm -f $testfile 89 | fi 90 | 91 | for program in $programs 92 | do 93 | for path in $pathname 94 | do 95 | if [ $test_exec_flag $path/${program}${ext} ] && \ 96 | [ ! -d $path/${program}${ext} ]; then 97 | if [ "x$echo" = "xyes" ]; then 98 | echo $path/${program}${ext} 99 | fi 100 | exit 0 101 | fi 102 | 103 | # Next try without extension (if one was used above) 104 | if [ "x$ext" != "x" ]; then 105 | if [ $test_exec_flag $path/${program} ] && \ 106 | [ ! -d $path/${program} ]; then 107 | if [ "x$echo" = "xyes" ]; then 108 | echo $path/${program} 109 | fi 110 | exit 0 111 | fi 112 | fi 113 | done 114 | done 115 | exit 1 116 | 117 | -------------------------------------------------------------------------------- /deps/libexpat/conftools/ac_c_bigendian_cross.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_C_BIGENDIAN_CROSS 2 | dnl 3 | dnl Check endianess even when crosscompiling 4 | dnl (partially based on the original AC_C_BIGENDIAN). 5 | dnl 6 | dnl The implementation will create a binary, and instead of running 7 | dnl the binary it will be grep'ed for some symbols that will look 8 | dnl different for different endianess of the binary. 9 | dnl 10 | dnl @version $Id: ac_c_bigendian_cross.m4,v 1.1 2001/07/24 19:51:35 fdrake Exp $ 11 | dnl @author Guido Draheim 12 | dnl 13 | AC_DEFUN([AC_C_BIGENDIAN_CROSS], 14 | [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, 15 | [ac_cv_c_bigendian=unknown 16 | # See if sys/param.h defines the BYTE_ORDER macro. 17 | AC_TRY_COMPILE([#include 18 | #include ], [ 19 | #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN 20 | bogus endian macros 21 | #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. 22 | AC_TRY_COMPILE([#include 23 | #include ], [ 24 | #if BYTE_ORDER != BIG_ENDIAN 25 | not big endian 26 | #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) 27 | if test $ac_cv_c_bigendian = unknown; then 28 | AC_TRY_RUN([main () { 29 | /* Are we little or big endian? From Harbison&Steele. */ 30 | union 31 | { 32 | long l; 33 | char c[sizeof (long)]; 34 | } u; 35 | u.l = 1; 36 | exit (u.c[sizeof (long) - 1] == 1); 37 | }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, 38 | [ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) 39 | fi]) 40 | if test $ac_cv_c_bigendian = unknown; then 41 | AC_MSG_CHECKING(to probe for byte ordering) 42 | [ 43 | cat >conftest.c <&AC_FD_MSG 56 | ac_cv_c_bigendian=yes 57 | fi 58 | if test `grep -l LiTTleEnDian conftest.o` ; then 59 | echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG 60 | if test $ac_cv_c_bigendian = yes ; then 61 | ac_cv_c_bigendian=unknown; 62 | else 63 | ac_cv_c_bigendian=no 64 | fi 65 | fi 66 | echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG 67 | fi 68 | fi 69 | AC_MSG_RESULT($ac_cv_c_bigendian) 70 | fi 71 | if test $ac_cv_c_bigendian = yes; then 72 | AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) 73 | BYTEORDER=4321 74 | else 75 | BYTEORDER=1234 76 | fi 77 | AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) 78 | if test $ac_cv_c_bigendian = unknown; then 79 | AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) 80 | fi 81 | ]) 82 | -------------------------------------------------------------------------------- /deps/libexpat/conftools/expat.m4: -------------------------------------------------------------------------------- 1 | dnl Check if --with-expat[=PREFIX] is specified and 2 | dnl Expat >= 1.95.0 is installed in the system. 3 | dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to 4 | dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX 5 | dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined. 6 | dnl If --with-expat has not been specified, set with_expat to 'no'. 7 | dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly. 8 | dnl This is necessary to adapt a whole lot of packages that have expat 9 | dnl bundled as a static library. 10 | AC_DEFUN([AM_WITH_EXPAT], 11 | [ AC_ARG_WITH(expat, 12 | [ --with-expat=PREFIX Use system Expat library], 13 | , with_expat=no) 14 | 15 | AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no) 16 | 17 | EXPAT_CFLAGS= 18 | EXPAT_LIBS= 19 | if test $with_expat != no; then 20 | if test $with_expat != yes; then 21 | EXPAT_CFLAGS="-I$with_expat/include" 22 | EXPAT_LIBS="-L$with_expat/lib" 23 | fi 24 | AC_CHECK_LIB(expat, XML_ParserCreate, 25 | [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" 26 | expat_found=yes ], 27 | [ expat_found=no ], 28 | "$EXPAT_LIBS") 29 | if test $expat_found = no; then 30 | AC_MSG_ERROR([Could not find the Expat library]) 31 | fi 32 | expat_save_CFLAGS="$CFLAGS" 33 | CFLAGS="$CFLAGS $EXPAT_CFLAGS" 34 | AC_CHECK_HEADERS(expat.h, , expat_found=no) 35 | if test $expat_found = no; then 36 | AC_MSG_ERROR([Could not find expat.h]) 37 | fi 38 | CFLAGS="$expat_save_CFLAGS" 39 | fi 40 | 41 | AC_SUBST(EXPAT_CFLAGS) 42 | AC_SUBST(EXPAT_LIBS) 43 | ]) 44 | -------------------------------------------------------------------------------- /deps/libexpat/conftools/get-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # USAGE: get-version.sh path/to/expat.h 4 | # 5 | # This script will print Expat's version number on stdout. For example: 6 | # 7 | # $ ./conftools/get-version.sh ./lib/expat.h 8 | # 1.95.3 9 | # $ 10 | # 11 | 12 | if test $# = 0; then 13 | echo "ERROR: pathname for expat.h was not provided." 14 | echo "" 15 | echo "USAGE: $0 path/to/expat.h" 16 | exit 1 17 | fi 18 | if test $# != 1; then 19 | echo "ERROR: too many arguments were provided." 20 | echo "" 21 | echo "USAGE: $0 path/to/expat.h" 22 | exit 1 23 | fi 24 | 25 | hdr="$1" 26 | if test ! -r "$hdr"; then 27 | echo "ERROR: '$hdr' does not exist, or is not readable." 28 | exit 1 29 | fi 30 | 31 | MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`" 32 | MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`" 33 | MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`" 34 | 35 | # Determine how to tell echo not to print the trailing \n. This is 36 | # similar to Autoconf's @ECHO_C@ and @ECHO_N@; however, we don't 37 | # generate this file via autoconf (in fact, get-version.sh is used 38 | # to *create* ./configure), so we just do something similar inline. 39 | case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in 40 | *c*,-n*) ECHO_N= ECHO_C=' 41 | ' ;; 42 | *c*,* ) ECHO_N=-n ECHO_C= ;; 43 | *) ECHO_N= ECHO_C='\c' ;; 44 | esac 45 | 46 | echo $ECHO_N "$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$ECHO_C" 47 | -------------------------------------------------------------------------------- /deps/libexpat/conftools/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /deps/libexpat/doc/expat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmppo/node-expat/78e559baa908942097330f7967dfbf623ebc2529/deps/libexpat/doc/expat.png -------------------------------------------------------------------------------- /deps/libexpat/doc/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: white; 3 | border: 0px; 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | .corner { 9 | width: 200px; 10 | height: 80px; 11 | text-align: center; 12 | } 13 | 14 | .banner { 15 | background-color: rgb(110,139,61); 16 | color: rgb(255,236,176); 17 | padding-left: 2em; 18 | } 19 | 20 | .banner h1 { 21 | font-size: 200%; 22 | } 23 | 24 | .content { 25 | padding: 0em 2em 1em 2em; 26 | } 27 | 28 | .releaseno { 29 | background-color: rgb(110,139,61); 30 | color: rgb(255,236,176); 31 | padding-bottom: 0.3em; 32 | padding-top: 0.5em; 33 | text-align: center; 34 | font-weight: bold; 35 | } 36 | 37 | .noborder { 38 | border-width: 0px; 39 | } 40 | 41 | .eg { 42 | padding-left: 1em; 43 | padding-top: .5em; 44 | padding-bottom: .5em; 45 | border: solid thin; 46 | margin: 1em 0; 47 | background-color: tan; 48 | margin-left: 2em; 49 | margin-right: 10%; 50 | } 51 | 52 | .pseudocode { 53 | padding-left: 1em; 54 | padding-top: .5em; 55 | padding-bottom: .5em; 56 | border: solid thin; 57 | margin: 1em 0; 58 | background-color: rgb(250,220,180); 59 | margin-left: 2em; 60 | margin-right: 10%; 61 | } 62 | 63 | .handler { 64 | width: 100%; 65 | border-top-width: thin; 66 | margin-bottom: 1em; 67 | } 68 | 69 | .handler p { 70 | margin-left: 2em; 71 | } 72 | 73 | .setter { 74 | font-weight: bold; 75 | } 76 | 77 | .signature { 78 | color: navy; 79 | } 80 | 81 | .fcndec { 82 | width: 100%; 83 | border-top-width: thin; 84 | font-weight: bold; 85 | } 86 | 87 | .fcndef { 88 | margin-left: 2em; 89 | margin-bottom: 2em; 90 | } 91 | 92 | dd { 93 | margin-bottom: 2em; 94 | } 95 | 96 | .cpp-symbols dt { 97 | font-family: monospace; 98 | } 99 | .cpp-symbols dd { 100 | margin-bottom: 1em; 101 | } 102 | -------------------------------------------------------------------------------- /deps/libexpat/doc/valid-xhtml10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xmppo/node-expat/78e559baa908942097330f7967dfbf623ebc2529/deps/libexpat/doc/valid-xhtml10.png -------------------------------------------------------------------------------- /deps/libexpat/doc/xmlwf.1: -------------------------------------------------------------------------------- 1 | '\" -*- coding: us-ascii -*- 2 | .if \n(.g .ds T< \\FC 3 | .if \n(.g .ds T> \\F[\n[.fam]] 4 | .de URL 5 | \\$2 \(la\\$1\(ra\\$3 6 | .. 7 | .if \n(.g .mso www.tmac 8 | .TH XMLWF 1 "March 11, 2016" "" "" 9 | .SH NAME 10 | xmlwf \- Determines if an XML document is well-formed 11 | .SH SYNOPSIS 12 | 'nh 13 | .fi 14 | .ad l 15 | \fBxmlwf\fR \kx 16 | .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 17 | 'in \n(.iu+\nxu 18 | [\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 ...] 19 | 'in \n(.iu-\nxu 20 | .ad b 21 | 'hy 22 | .SH DESCRIPTION 23 | \fBxmlwf\fR uses the Expat library to 24 | determine if an XML document is well-formed. It is 25 | non-validating. 26 | .PP 27 | If you do not specify any files on the command-line, and you 28 | have a recent version of \fBxmlwf\fR, the 29 | input file will be read from standard input. 30 | .SH "WELL-FORMED DOCUMENTS" 31 | A well-formed document must adhere to the 32 | following rules: 33 | .TP 0.2i 34 | \(bu 35 | The file begins with an XML declaration. For instance, 36 | \*(T<\*(T>. 37 | \fINOTE:\fR 38 | \fBxmlwf\fR does not currently 39 | check for a valid XML declaration. 40 | .TP 0.2i 41 | \(bu 42 | Every start tag is either empty () 43 | or has a corresponding end tag. 44 | .TP 0.2i 45 | \(bu 46 | There is exactly one root element. This element must contain 47 | all other elements in the document. Only comments, white 48 | space, and processing instructions may come after the close 49 | of the root element. 50 | .TP 0.2i 51 | \(bu 52 | All elements nest properly. 53 | .TP 0.2i 54 | \(bu 55 | All attribute values are enclosed in quotes (either single 56 | or double). 57 | .PP 58 | If the document has a DTD, and it strictly complies with that 59 | DTD, then the document is also considered \fIvalid\fR. 60 | \fBxmlwf\fR is a non-validating parser -- 61 | it does not check the DTD. However, it does support 62 | external entities (see the \*(T<\fB\-x\fR\*(T> option). 63 | .SH OPTIONS 64 | When an option includes an argument, you may specify the argument either 65 | separately ("\*(T<\fB\-d\fR\*(T> output") or concatenated with the 66 | option ("\*(T<\fB\-d\fR\*(T>output"). \fBxmlwf\fR 67 | supports both. 68 | .TP 69 | \*(T<\fB\-c\fR\*(T> 70 | If the input file is well-formed and \fBxmlwf\fR 71 | doesn't encounter any errors, the input file is simply copied to 72 | the output directory unchanged. 73 | This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and 74 | requires \*(T<\fB\-d\fR\*(T> to specify an output file. 75 | .TP 76 | \*(T<\fB\-d output\-dir\fR\*(T> 77 | Specifies a directory to contain transformed 78 | representations of the input files. 79 | By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation 80 | (described below). 81 | You can select different output formats using \*(T<\fB\-c\fR\*(T> 82 | and \*(T<\fB\-m\fR\*(T>. 83 | 84 | The output filenames will 85 | be exactly the same as the input filenames or "STDIN" if the input is 86 | coming from standard input. Therefore, you must be careful that the 87 | output file does not go into the same directory as the input 88 | file. Otherwise, \fBxmlwf\fR will delete the 89 | input file before it generates the output file (just like running 90 | \*(T file\*(T> in most shells). 91 | 92 | Two structurally equivalent XML documents have a byte-for-byte 93 | identical canonical XML representation. 94 | Note that ignorable white space is considered significant and 95 | is treated equivalently to data. 96 | More on canonical XML can be found at 97 | http://www.jclark.com/xml/canonxml.html . 98 | .TP 99 | \*(T<\fB\-e encoding\fR\*(T> 100 | Specifies the character encoding for the document, overriding 101 | any document encoding declaration. \fBxmlwf\fR 102 | supports four built-in encodings: 103 | \*(T, 104 | \*(T, 105 | \*(T, and 106 | \*(T. 107 | Also see the \*(T<\fB\-w\fR\*(T> option. 108 | .TP 109 | \*(T<\fB\-m\fR\*(T> 110 | Outputs some strange sort of XML file that completely 111 | describes the input file, including character positions. 112 | Requires \*(T<\fB\-d\fR\*(T> to specify an output file. 113 | .TP 114 | \*(T<\fB\-n\fR\*(T> 115 | Turns on namespace processing. (describe namespaces) 116 | \*(T<\fB\-c\fR\*(T> disables namespaces. 117 | .TP 118 | \*(T<\fB\-p\fR\*(T> 119 | Tells xmlwf to process external DTDs and parameter 120 | entities. 121 | 122 | Normally \fBxmlwf\fR never parses parameter 123 | entities. \*(T<\fB\-p\fR\*(T> tells it to always parse them. 124 | \*(T<\fB\-p\fR\*(T> implies \*(T<\fB\-x\fR\*(T>. 125 | .TP 126 | \*(T<\fB\-r\fR\*(T> 127 | Normally \fBxmlwf\fR memory-maps the XML file 128 | before parsing; this can result in faster parsing on many 129 | platforms. 130 | \*(T<\fB\-r\fR\*(T> turns off memory-mapping and uses normal file 131 | IO calls instead. 132 | Of course, memory-mapping is automatically turned off 133 | when reading from standard input. 134 | 135 | Use of memory-mapping can cause some platforms to report 136 | substantially higher memory usage for 137 | \fBxmlwf\fR, but this appears to be a matter of 138 | the operating system reporting memory in a strange way; there is 139 | not a leak in \fBxmlwf\fR. 140 | .TP 141 | \*(T<\fB\-s\fR\*(T> 142 | Prints an error if the document is not standalone. 143 | A document is standalone if it has no external subset and no 144 | references to parameter entities. 145 | .TP 146 | \*(T<\fB\-t\fR\*(T> 147 | Turns on timings. This tells Expat to parse the entire file, 148 | but not perform any processing. 149 | This gives a fairly accurate idea of the raw speed of Expat itself 150 | without client overhead. 151 | \*(T<\fB\-t\fR\*(T> turns off most of the output options 152 | (\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-m\fR\*(T>, \*(T<\fB\-c\fR\*(T>, ...). 153 | .TP 154 | \*(T<\fB\-v\fR\*(T> 155 | Prints the version of the Expat library being used, including some 156 | information on the compile-time configuration of the library, and 157 | then exits. 158 | .TP 159 | \*(T<\fB\-w\fR\*(T> 160 | Enables support for Windows code pages. 161 | Normally, \fBxmlwf\fR will throw an error if it 162 | runs across an encoding that it is not equipped to handle itself. With 163 | \*(T<\fB\-w\fR\*(T>, xmlwf will try to use a Windows code 164 | page. See also \*(T<\fB\-e\fR\*(T>. 165 | .TP 166 | \*(T<\fB\-x\fR\*(T> 167 | Turns on parsing external entities. 168 | 169 | Non-validating parsers are not required to resolve external 170 | entities, or even expand entities at all. 171 | Expat always expands internal entities (?), 172 | but external entity parsing must be enabled explicitly. 173 | 174 | External entities are simply entities that obtain their 175 | data from outside the XML file currently being parsed. 176 | 177 | This is an example of an internal entity: 178 | 179 | .nf 180 | 181 | 182 | .fi 183 | 184 | And here are some examples of external entities: 185 | 186 | .nf 187 | 188 | (parsed) 189 | (unparsed) 190 | .fi 191 | .TP 192 | \*(T<\fB\-\-\fR\*(T> 193 | (Two hyphens.) 194 | Terminates the list of options. This is only needed if a filename 195 | starts with a hyphen. For example: 196 | 197 | .nf 198 | 199 | xmlwf \-\- \-myfile.xml 200 | .fi 201 | 202 | will run \fBxmlwf\fR on the file 203 | \*(T<\fI\-myfile.xml\fR\*(T>. 204 | .PP 205 | Older versions of \fBxmlwf\fR do not support 206 | reading from standard input. 207 | .SH OUTPUT 208 | If an input file is not well-formed, 209 | \fBxmlwf\fR prints a single line describing 210 | the problem to standard output. If a file is well formed, 211 | \fBxmlwf\fR outputs nothing. 212 | Note that the result code is \fInot\fR set. 213 | .SH BUGS 214 | \fBxmlwf\fR returns a 0 - noerr result, 215 | even if the file is not well-formed. There is no good way for 216 | a program to use \fBxmlwf\fR to quickly 217 | check a file -- it must parse \fBxmlwf\fR's 218 | standard output. 219 | .PP 220 | The errors should go to standard error, not standard output. 221 | .PP 222 | There should be a way to get \*(T<\fB\-d\fR\*(T> to send its 223 | output to standard output rather than forcing the user to send 224 | it to a file. 225 | .PP 226 | I have no idea why anyone would want to use the 227 | \*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and 228 | \*(T<\fB\-m\fR\*(T> options. If someone could explain it to 229 | me, I'd like to add this information to this manpage. 230 | .SH ALTERNATIVES 231 | Here are some XML validators on the web: 232 | 233 | .nf 234 | 235 | http://www.hcrc.ed.ac.uk/~richard/xml\-check.html 236 | http://www.stg.brown.edu/service/xmlvalid/ 237 | http://www.scripting.com/frontier5/xml/code/xmlValidator.html 238 | http://www.xml.com/pub/a/tools/ruwf/check.html 239 | .fi 240 | .SH "SEE ALSO" 241 | .nf 242 | 243 | The Expat home page: http://www.libexpat.org/ 244 | The W3 XML specification: http://www.w3.org/TR/REC\-xml 245 | .fi 246 | .SH AUTHOR 247 | This manual page was written by Scott Bronson <\*(T> for 248 | the Debian GNU/Linux system (but may be used by others). Permission is 249 | granted to copy, distribute and/or modify this document under 250 | the terms of the GNU Free Documentation 251 | License, Version 1.1. 252 | -------------------------------------------------------------------------------- /deps/libexpat/examples/elements.c: -------------------------------------------------------------------------------- 1 | /* This is simple demonstration of how to use expat. This program 2 | reads an XML document from standard input and writes a line with 3 | the name of each element to standard output indenting child 4 | elements by one tab stop more than their parent element. 5 | It must be used with Expat compiled for UTF-8 output. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef XML_LARGE_SIZE 12 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 13 | #define XML_FMT_INT_MOD "I64" 14 | #else 15 | #define XML_FMT_INT_MOD "ll" 16 | #endif 17 | #else 18 | #define XML_FMT_INT_MOD "l" 19 | #endif 20 | 21 | static void XMLCALL 22 | startElement(void *userData, const char *name, const char **atts) 23 | { 24 | int i; 25 | int *depthPtr = (int *)userData; 26 | (void)atts; 27 | 28 | for (i = 0; i < *depthPtr; i++) 29 | putchar('\t'); 30 | puts(name); 31 | *depthPtr += 1; 32 | } 33 | 34 | static void XMLCALL 35 | endElement(void *userData, const char *name) 36 | { 37 | int *depthPtr = (int *)userData; 38 | (void)name; 39 | 40 | *depthPtr -= 1; 41 | } 42 | 43 | int 44 | main(int argc, char *argv[]) 45 | { 46 | char buf[BUFSIZ]; 47 | XML_Parser parser = XML_ParserCreate(NULL); 48 | int done; 49 | int depth = 0; 50 | (void)argc; 51 | (void)argv; 52 | 53 | XML_SetUserData(parser, &depth); 54 | XML_SetElementHandler(parser, startElement, endElement); 55 | do { 56 | size_t len = fread(buf, 1, sizeof(buf), stdin); 57 | done = len < sizeof(buf); 58 | if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { 59 | fprintf(stderr, 60 | "%s at line %" XML_FMT_INT_MOD "u\n", 61 | XML_ErrorString(XML_GetErrorCode(parser)), 62 | XML_GetCurrentLineNumber(parser)); 63 | return 1; 64 | } 65 | } while (!done); 66 | XML_ParserFree(parser); 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /deps/libexpat/examples/outline.c: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * outline.c 3 | * 4 | * Copyright 1999, Clark Cooper 5 | * All rights reserved. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the license contained in the 9 | * COPYING file that comes with the expat distribution. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 12 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 13 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 15 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 16 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | * 19 | * Read an XML document from standard input and print an element 20 | * outline on standard output. 21 | * Must be used with Expat compiled for UTF-8 output. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | 28 | #ifdef XML_LARGE_SIZE 29 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 30 | #define XML_FMT_INT_MOD "I64" 31 | #else 32 | #define XML_FMT_INT_MOD "ll" 33 | #endif 34 | #else 35 | #define XML_FMT_INT_MOD "l" 36 | #endif 37 | 38 | #define BUFFSIZE 8192 39 | 40 | char Buff[BUFFSIZE]; 41 | 42 | int Depth; 43 | 44 | static void XMLCALL 45 | start(void *data, const char *el, const char **attr) 46 | { 47 | int i; 48 | (void)data; 49 | 50 | for (i = 0; i < Depth; i++) 51 | printf(" "); 52 | 53 | printf("%s", el); 54 | 55 | for (i = 0; attr[i]; i += 2) { 56 | printf(" %s='%s'", attr[i], attr[i + 1]); 57 | } 58 | 59 | printf("\n"); 60 | Depth++; 61 | } 62 | 63 | static void XMLCALL 64 | end(void *data, const char *el) 65 | { 66 | (void)data; 67 | (void)el; 68 | 69 | Depth--; 70 | } 71 | 72 | int 73 | main(int argc, char *argv[]) 74 | { 75 | XML_Parser p = XML_ParserCreate(NULL); 76 | (void)argc; 77 | (void)argv; 78 | 79 | if (! p) { 80 | fprintf(stderr, "Couldn't allocate memory for parser\n"); 81 | exit(-1); 82 | } 83 | 84 | XML_SetElementHandler(p, start, end); 85 | 86 | for (;;) { 87 | int done; 88 | int len; 89 | 90 | len = (int)fread(Buff, 1, BUFFSIZE, stdin); 91 | if (ferror(stdin)) { 92 | fprintf(stderr, "Read error\n"); 93 | exit(-1); 94 | } 95 | done = feof(stdin); 96 | 97 | if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { 98 | fprintf(stderr, "Parse error at line %" XML_FMT_INT_MOD "u:\n%s\n", 99 | XML_GetCurrentLineNumber(p), 100 | XML_ErrorString(XML_GetErrorCode(p))); 101 | exit(-1); 102 | } 103 | 104 | if (done) 105 | break; 106 | } 107 | XML_ParserFree(p); 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /deps/libexpat/expat.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: expat 7 | Version: @PACKAGE_VERSION@ 8 | Description: expat XML parser 9 | URL: http://www.libexpat.org 10 | Libs: -L${libdir} -lexpat 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /deps/libexpat/expat_config.h: -------------------------------------------------------------------------------- 1 | /* expat_config.h. Generated from expat_config.h.in by configure. */ 2 | /* expat_config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 1234 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_DLFCN_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_FCNTL_H 1 15 | 16 | /* Define to 1 if you have the `getpagesize' function. */ 17 | #define HAVE_GETPAGESIZE 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_INTTYPES_H 1 21 | 22 | /* Define to 1 if you have the `memmove' function. */ 23 | #define HAVE_MEMMOVE 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_MEMORY_H 1 27 | 28 | /* Define to 1 if you have a working `mmap' system call. */ 29 | #define HAVE_MMAP 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STDINT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_STDLIB_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #define HAVE_STRINGS_H 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_STRING_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_SYS_PARAM_H 1 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #define HAVE_SYS_STAT_H 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_SYS_TYPES_H 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_UNISTD_H 1 54 | 55 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 56 | */ 57 | #define LT_OBJDIR ".libs/" 58 | 59 | /* Define to the address where bug reports for this package should be sent. */ 60 | #define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" 61 | 62 | /* Define to the full name of this package. */ 63 | #define PACKAGE_NAME "expat" 64 | 65 | /* Define to the full name and version of this package. */ 66 | #define PACKAGE_STRING "expat 2.1.0" 67 | 68 | /* Define to the one symbol short name of this package. */ 69 | #define PACKAGE_TARNAME "expat" 70 | 71 | /* Define to the home page for this package. */ 72 | #define PACKAGE_URL "" 73 | 74 | /* Define to the version of this package. */ 75 | #define PACKAGE_VERSION "2.1.0" 76 | 77 | /* Define to 1 if you have the ANSI C header files. */ 78 | #define STDC_HEADERS 1 79 | 80 | /* whether byteorder is bigendian */ 81 | /* #undef WORDS_BIGENDIAN */ 82 | 83 | /* Define to specify how much context to retain around the current parse 84 | point. */ 85 | #define XML_CONTEXT_BYTES 1024 86 | 87 | /* Define to make parameter entity parsing functionality available. */ 88 | #define XML_DTD 1 89 | 90 | /* Define to make XML Namespaces functionality available. */ 91 | #define XML_NS 1 92 | 93 | /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ 94 | /* #undef __func__ */ 95 | 96 | /* Define to empty if `const' does not conform to ANSI C. */ 97 | /* #undef const */ 98 | 99 | /* Define to `long int' if does not define. */ 100 | /* #undef off_t */ 101 | 102 | /* Define to `unsigned int' if does not define. */ 103 | /* #undef size_t */ 104 | -------------------------------------------------------------------------------- /deps/libexpat/expat_config.h.cmake: -------------------------------------------------------------------------------- 1 | /* expat_config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 4 | #cmakedefine BYTEORDER @BYTEORDER@ 5 | 6 | /* Define to 1 if you have the `bcopy' function. */ 7 | #cmakedefine HAVE_BCOPY 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #cmakedefine HAVE_DLFCN_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #cmakedefine HAVE_FCNTL_H 14 | 15 | /* Define to 1 if you have the `getpagesize' function. */ 16 | #cmakedefine HAVE_GETPAGESIZE 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #cmakedefine HAVE_INTTYPES_H 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #cmakedefine HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #cmakedefine HAVE_MEMORY_H 26 | 27 | /* Define to 1 if you have a working `mmap' system call. */ 28 | #cmakedefine HAVE_MMAP 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #cmakedefine HAVE_STDINT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #cmakedefine HAVE_STDLIB_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #cmakedefine HAVE_STRINGS_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #cmakedefine HAVE_STRING_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #cmakedefine HAVE_SYS_STAT_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #cmakedefine HAVE_SYS_TYPES_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #cmakedefine HAVE_UNISTD_H 50 | 51 | /* Define to the address where bug reports for this package should be sent. */ 52 | #cmakedefine PACKAGE_BUGREPORT 53 | 54 | /* Define to the full name of this package. */ 55 | #cmakedefine PACKAGE_NAME 56 | 57 | /* Define to the full name and version of this package. */ 58 | #cmakedefine PACKAGE_STRING 59 | 60 | /* Define to the one symbol short name of this package. */ 61 | #cmakedefine PACKAGE_TARNAME 62 | 63 | /* Define to the version of this package. */ 64 | #cmakedefine PACKAGE_VERSION 65 | 66 | /* Define to 1 if you have the ANSI C header files. */ 67 | #cmakedefine STDC_HEADERS 68 | 69 | /* whether byteorder is bigendian */ 70 | #cmakedefine WORDS_BIGENDIAN 71 | 72 | /* Define to specify how much context to retain around the current parse 73 | point. */ 74 | #cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@ 75 | 76 | /* Define to make parameter entity parsing functionality available. */ 77 | #cmakedefine XML_DTD 78 | 79 | /* Define to make XML Namespaces functionality available. */ 80 | #cmakedefine XML_NS 81 | 82 | /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ 83 | #ifdef _MSC_VER 84 | # define __func__ __FUNCTION__ 85 | #endif 86 | 87 | /* Define to `long' if does not define. */ 88 | #cmakedefine off_t @OFF_T@ 89 | 90 | /* Define to `unsigned' if does not define. */ 91 | #cmakedefine size_t @SIZE_T@ 92 | -------------------------------------------------------------------------------- /deps/libexpat/expat_config.h.in: -------------------------------------------------------------------------------- 1 | /* expat_config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 4 | #undef BYTEORDER 5 | 6 | /* Define to 1 if you have the `arc4random_buf' function. */ 7 | #undef HAVE_ARC4RANDOM_BUF 8 | 9 | /* Define to 1 if you have the `bcopy' function. */ 10 | #undef HAVE_BCOPY 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_DLFCN_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_FCNTL_H 17 | 18 | /* Define to 1 if you have the `getpagesize' function. */ 19 | #undef HAVE_GETPAGESIZE 20 | 21 | /* Define to 1 if you have the `getrandom' function. */ 22 | #undef HAVE_GETRANDOM 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_INTTYPES_H 26 | 27 | /* Define to 1 if you have the `bsd' library (-lbsd). */ 28 | #undef HAVE_LIBBSD 29 | 30 | /* Define to 1 if you have the `memmove' function. */ 31 | #undef HAVE_MEMMOVE 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_MEMORY_H 35 | 36 | /* Define to 1 if you have a working `mmap' system call. */ 37 | #undef HAVE_MMAP 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_STDINT_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_STDLIB_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_STRINGS_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_STRING_H 50 | 51 | /* Define to 1 if you have `syscall' and `SYS_getrandom'. */ 52 | #undef HAVE_SYSCALL_GETRANDOM 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_SYS_PARAM_H 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_SYS_STAT_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_SYS_TYPES_H 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_UNISTD_H 65 | 66 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 67 | #undef LT_OBJDIR 68 | 69 | /* Define to the address where bug reports for this package should be sent. */ 70 | #undef PACKAGE_BUGREPORT 71 | 72 | /* Define to the full name of this package. */ 73 | #undef PACKAGE_NAME 74 | 75 | /* Define to the full name and version of this package. */ 76 | #undef PACKAGE_STRING 77 | 78 | /* Define to the one symbol short name of this package. */ 79 | #undef PACKAGE_TARNAME 80 | 81 | /* Define to the home page for this package. */ 82 | #undef PACKAGE_URL 83 | 84 | /* Define to the version of this package. */ 85 | #undef PACKAGE_VERSION 86 | 87 | /* Define to 1 if you have the ANSI C header files. */ 88 | #undef STDC_HEADERS 89 | 90 | /* whether byteorder is bigendian */ 91 | #undef WORDS_BIGENDIAN 92 | 93 | /* Define to specify how much context to retain around the current parse 94 | point. */ 95 | #undef XML_CONTEXT_BYTES 96 | 97 | /* Define to make parameter entity parsing functionality available. */ 98 | #undef XML_DTD 99 | 100 | /* Define to make XML Namespaces functionality available. */ 101 | #undef XML_NS 102 | 103 | /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ 104 | #undef __func__ 105 | 106 | /* Define to empty if `const' does not conform to ANSI C. */ 107 | #undef const 108 | 109 | /* Define to `long int' if does not define. */ 110 | #undef off_t 111 | 112 | /* Define to `unsigned int' if does not define. */ 113 | #undef size_t 114 | -------------------------------------------------------------------------------- /deps/libexpat/lib/ascii.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define ASCII_A 0x41 6 | #define ASCII_B 0x42 7 | #define ASCII_C 0x43 8 | #define ASCII_D 0x44 9 | #define ASCII_E 0x45 10 | #define ASCII_F 0x46 11 | #define ASCII_G 0x47 12 | #define ASCII_H 0x48 13 | #define ASCII_I 0x49 14 | #define ASCII_J 0x4A 15 | #define ASCII_K 0x4B 16 | #define ASCII_L 0x4C 17 | #define ASCII_M 0x4D 18 | #define ASCII_N 0x4E 19 | #define ASCII_O 0x4F 20 | #define ASCII_P 0x50 21 | #define ASCII_Q 0x51 22 | #define ASCII_R 0x52 23 | #define ASCII_S 0x53 24 | #define ASCII_T 0x54 25 | #define ASCII_U 0x55 26 | #define ASCII_V 0x56 27 | #define ASCII_W 0x57 28 | #define ASCII_X 0x58 29 | #define ASCII_Y 0x59 30 | #define ASCII_Z 0x5A 31 | 32 | #define ASCII_a 0x61 33 | #define ASCII_b 0x62 34 | #define ASCII_c 0x63 35 | #define ASCII_d 0x64 36 | #define ASCII_e 0x65 37 | #define ASCII_f 0x66 38 | #define ASCII_g 0x67 39 | #define ASCII_h 0x68 40 | #define ASCII_i 0x69 41 | #define ASCII_j 0x6A 42 | #define ASCII_k 0x6B 43 | #define ASCII_l 0x6C 44 | #define ASCII_m 0x6D 45 | #define ASCII_n 0x6E 46 | #define ASCII_o 0x6F 47 | #define ASCII_p 0x70 48 | #define ASCII_q 0x71 49 | #define ASCII_r 0x72 50 | #define ASCII_s 0x73 51 | #define ASCII_t 0x74 52 | #define ASCII_u 0x75 53 | #define ASCII_v 0x76 54 | #define ASCII_w 0x77 55 | #define ASCII_x 0x78 56 | #define ASCII_y 0x79 57 | #define ASCII_z 0x7A 58 | 59 | #define ASCII_0 0x30 60 | #define ASCII_1 0x31 61 | #define ASCII_2 0x32 62 | #define ASCII_3 0x33 63 | #define ASCII_4 0x34 64 | #define ASCII_5 0x35 65 | #define ASCII_6 0x36 66 | #define ASCII_7 0x37 67 | #define ASCII_8 0x38 68 | #define ASCII_9 0x39 69 | 70 | #define ASCII_TAB 0x09 71 | #define ASCII_SPACE 0x20 72 | #define ASCII_EXCL 0x21 73 | #define ASCII_QUOT 0x22 74 | #define ASCII_AMP 0x26 75 | #define ASCII_APOS 0x27 76 | #define ASCII_MINUS 0x2D 77 | #define ASCII_PERIOD 0x2E 78 | #define ASCII_COLON 0x3A 79 | #define ASCII_SEMI 0x3B 80 | #define ASCII_LT 0x3C 81 | #define ASCII_EQUALS 0x3D 82 | #define ASCII_GT 0x3E 83 | #define ASCII_LSQB 0x5B 84 | #define ASCII_RSQB 0x5D 85 | #define ASCII_UNDERSCORE 0x5F 86 | #define ASCII_LPAREN 0x28 87 | #define ASCII_RPAREN 0x29 88 | #define ASCII_FF 0x0C 89 | #define ASCII_SLASH 0x2F 90 | #define ASCII_HASH 0x23 91 | #define ASCII_PIPE 0x7C 92 | #define ASCII_COMMA 0x2C 93 | -------------------------------------------------------------------------------- /deps/libexpat/lib/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /deps/libexpat/lib/expat_external.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef Expat_External_INCLUDED 6 | #define Expat_External_INCLUDED 1 7 | 8 | /* External API definitions */ 9 | 10 | #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) 11 | #define XML_USE_MSC_EXTENSIONS 1 12 | #endif 13 | 14 | /* Expat tries very hard to make the API boundary very specifically 15 | defined. There are two macros defined to control this boundary; 16 | each of these can be defined before including this header to 17 | achieve some different behavior, but doing so it not recommended or 18 | tested frequently. 19 | 20 | XMLCALL - The calling convention to use for all calls across the 21 | "library boundary." This will default to cdecl, and 22 | try really hard to tell the compiler that's what we 23 | want. 24 | 25 | XMLIMPORT - Whatever magic is needed to note that a function is 26 | to be imported from a dynamically loaded library 27 | (.dll, .so, or .sl, depending on your platform). 28 | 29 | The XMLCALL macro was added in Expat 1.95.7. The only one which is 30 | expected to be directly useful in client code is XMLCALL. 31 | 32 | Note that on at least some Unix versions, the Expat library must be 33 | compiled with the cdecl calling convention as the default since 34 | system headers may assume the cdecl convention. 35 | */ 36 | #ifndef XMLCALL 37 | #if defined(_MSC_VER) 38 | #define XMLCALL __cdecl 39 | #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) 40 | #define XMLCALL __attribute__((cdecl)) 41 | #else 42 | /* For any platform which uses this definition and supports more than 43 | one calling convention, we need to extend this definition to 44 | declare the convention used on that platform, if it's possible to 45 | do so. 46 | 47 | If this is the case for your platform, please file a bug report 48 | with information on how to identify your platform via the C 49 | pre-processor and how to specify the same calling convention as the 50 | platform's malloc() implementation. 51 | */ 52 | #define XMLCALL 53 | #endif 54 | #endif /* not defined XMLCALL */ 55 | 56 | 57 | #if !defined(XML_STATIC) && !defined(XMLIMPORT) 58 | #ifndef XML_BUILDING_EXPAT 59 | /* using Expat from an application */ 60 | 61 | #ifdef XML_USE_MSC_EXTENSIONS 62 | #define XMLIMPORT __declspec(dllimport) 63 | #endif 64 | 65 | #endif 66 | #endif /* not defined XML_STATIC */ 67 | 68 | #if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4) 69 | #define XMLIMPORT __attribute__ ((visibility ("default"))) 70 | #endif 71 | 72 | /* If we didn't define it above, define it away: */ 73 | #ifndef XMLIMPORT 74 | #define XMLIMPORT 75 | #endif 76 | 77 | #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) 78 | #define XML_ATTR_MALLOC __attribute__((__malloc__)) 79 | #else 80 | #define XML_ATTR_MALLOC 81 | #endif 82 | 83 | #if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 84 | #define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) 85 | #else 86 | #define XML_ATTR_ALLOC_SIZE(x) 87 | #endif 88 | 89 | #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL 90 | 91 | #ifdef __cplusplus 92 | extern "C" { 93 | #endif 94 | 95 | #ifdef XML_UNICODE_WCHAR_T 96 | # define XML_UNICODE 97 | # if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2) 98 | # error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc" 99 | # endif 100 | #endif 101 | 102 | #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ 103 | #ifdef XML_UNICODE_WCHAR_T 104 | typedef wchar_t XML_Char; 105 | typedef wchar_t XML_LChar; 106 | #else 107 | typedef unsigned short XML_Char; 108 | typedef char XML_LChar; 109 | #endif /* XML_UNICODE_WCHAR_T */ 110 | #else /* Information is UTF-8 encoded. */ 111 | typedef char XML_Char; 112 | typedef char XML_LChar; 113 | #endif /* XML_UNICODE */ 114 | 115 | #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ 116 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 117 | typedef __int64 XML_Index; 118 | typedef unsigned __int64 XML_Size; 119 | #else 120 | typedef long long XML_Index; 121 | typedef unsigned long long XML_Size; 122 | #endif 123 | #else 124 | typedef long XML_Index; 125 | typedef unsigned long XML_Size; 126 | #endif /* XML_LARGE_SIZE */ 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | 132 | #endif /* not Expat_External_INCLUDED */ 133 | -------------------------------------------------------------------------------- /deps/libexpat/lib/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /deps/libexpat/lib/internal.h: -------------------------------------------------------------------------------- 1 | /* internal.h 2 | 3 | Internal definitions used by Expat. This is not needed to compile 4 | client code. 5 | 6 | The following calling convention macros are defined for frequently 7 | called functions: 8 | 9 | FASTCALL - Used for those internal functions that have a simple 10 | body and a low number of arguments and local variables. 11 | 12 | PTRCALL - Used for functions called though function pointers. 13 | 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. 15 | 16 | inline - Used for selected internal functions for which inlining 17 | may improve performance on some platforms. 18 | 19 | Note: Use of these macros is based on judgement, not hard rules, 20 | and therefore subject to change. 21 | */ 22 | 23 | #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) 24 | /* We'll use this version by default only where we know it helps. 25 | 26 | regparm() generates warnings on Solaris boxes. See SF bug #692878. 27 | 28 | Instability reported with egcs on a RedHat Linux 7.3. 29 | Let's comment out: 30 | #define FASTCALL __attribute__((stdcall, regparm(3))) 31 | and let's try this: 32 | */ 33 | #define FASTCALL __attribute__((regparm(3))) 34 | #define PTRFASTCALL __attribute__((regparm(3))) 35 | #endif 36 | 37 | /* Using __fastcall seems to have an unexpected negative effect under 38 | MS VC++, especially for function pointers, so we won't use it for 39 | now on that platform. It may be reconsidered for a future release 40 | if it can be made more effective. 41 | Likely reason: __fastcall on Windows is like stdcall, therefore 42 | the compiler cannot perform stack optimizations for call clusters. 43 | */ 44 | 45 | /* Make sure all of these are defined if they aren't already. */ 46 | 47 | #ifndef FASTCALL 48 | #define FASTCALL 49 | #endif 50 | 51 | #ifndef PTRCALL 52 | #define PTRCALL 53 | #endif 54 | 55 | #ifndef PTRFASTCALL 56 | #define PTRFASTCALL 57 | #endif 58 | 59 | #ifndef XML_MIN_SIZE 60 | #if !defined(__cplusplus) && !defined(inline) 61 | #ifdef __GNUC__ 62 | #define inline __inline 63 | #endif /* __GNUC__ */ 64 | #endif 65 | #endif /* XML_MIN_SIZE */ 66 | 67 | #ifdef __cplusplus 68 | #define inline inline 69 | #else 70 | #ifndef inline 71 | #define inline 72 | #endif 73 | #endif 74 | 75 | #ifndef UNUSED_P 76 | # ifdef __GNUC__ 77 | # define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__)) 78 | # else 79 | # define UNUSED_P(p) UNUSED_ ## p 80 | # endif 81 | #endif 82 | 83 | 84 | #ifdef __cplusplus 85 | extern "C" { 86 | #endif 87 | 88 | 89 | void 90 | align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef); 91 | 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | -------------------------------------------------------------------------------- /deps/libexpat/lib/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /deps/libexpat/lib/libexpat.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | ; added with version 2.1.1 75 | ; XML_GetAttributeInfo @66 76 | XML_SetHashSalt @67@ 77 | -------------------------------------------------------------------------------- /deps/libexpat/lib/libexpatw.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | ; added with version 2.1.1 75 | ; XML_GetAttributeInfo @66 76 | XML_SetHashSalt @67@ 77 | -------------------------------------------------------------------------------- /deps/libexpat/lib/nametab.h: -------------------------------------------------------------------------------- 1 | static const unsigned namingBitmap[] = { 2 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 5 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 6 | 0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, 7 | 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, 8 | 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 9 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, 10 | 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 11 | 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 12 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 13 | 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 14 | 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 15 | 0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 16 | 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 17 | 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 18 | 0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, 19 | 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, 20 | 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 21 | 0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, 22 | 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, 23 | 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 24 | 0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, 25 | 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, 26 | 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 27 | 0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, 28 | 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, 29 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 30 | 0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, 31 | 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, 32 | 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 33 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 34 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 35 | 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 36 | 0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, 37 | 0x40000000, 0xF580C900, 0x00000007, 0x02010800, 38 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 39 | 0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, 40 | 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, 41 | 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 42 | 0x00000000, 0x00004C40, 0x00000000, 0x00000000, 43 | 0x00000007, 0x00000000, 0x00000000, 0x00000000, 44 | 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 45 | 0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, 46 | 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, 47 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 48 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 49 | 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, 50 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 51 | 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, 52 | 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, 53 | 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 54 | 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 55 | 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, 56 | 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 57 | 0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 58 | 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 59 | 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 60 | 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 61 | 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, 62 | 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 63 | 0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, 64 | 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, 65 | 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 66 | 0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, 67 | 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, 68 | 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 69 | 0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, 70 | 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, 71 | 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 72 | 0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, 73 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 74 | 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 75 | 0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, 76 | 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, 77 | 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 78 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 79 | 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, 80 | 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 81 | 0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, 82 | }; 83 | static const unsigned char nmstrtPages[] = { 84 | 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 85 | 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 86 | 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 88 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 90 | 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 94 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 95 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 96 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 97 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 98 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 99 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 100 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 101 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 102 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 103 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 104 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 106 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 107 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 108 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 109 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 110 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 113 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 114 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 116 | }; 117 | static const unsigned char namePages[] = { 118 | 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 119 | 0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 120 | 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 122 | 0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 123 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 124 | 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 125 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 126 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 127 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 128 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 129 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 130 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 131 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 132 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 133 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 134 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 135 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 136 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 137 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 138 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 139 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 140 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 141 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 142 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 143 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 144 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 145 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 146 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 147 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 148 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 150 | }; 151 | -------------------------------------------------------------------------------- /deps/libexpat/lib/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /deps/libexpat/lib/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | 21 | #if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */ 22 | # include 23 | #else /* !defined(HAVE_EXPAT_CONFIG_H) */ 24 | 25 | 26 | #define XML_NS 1 27 | #define XML_DTD 1 28 | #define XML_CONTEXT_BYTES 1024 29 | 30 | /* we will assume all Windows platforms are little endian */ 31 | #define BYTEORDER 1234 32 | 33 | /* Windows has memmove() available. */ 34 | #define HAVE_MEMMOVE 35 | 36 | 37 | #endif /* !defined(HAVE_EXPAT_CONFIG_H) */ 38 | 39 | 40 | #endif /* ndef WINCONFIG_H */ 41 | -------------------------------------------------------------------------------- /deps/libexpat/lib/xmlrole.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef XmlRole_INCLUDED 6 | #define XmlRole_INCLUDED 1 7 | 8 | #ifdef __VMS 9 | /* 0 1 2 3 0 1 2 3 10 | 1234567890123456789012345678901 1234567890123456789012345678901 */ 11 | #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt 12 | #endif 13 | 14 | #include "xmltok.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | enum { 21 | XML_ROLE_ERROR = -1, 22 | XML_ROLE_NONE = 0, 23 | XML_ROLE_XML_DECL, 24 | XML_ROLE_INSTANCE_START, 25 | XML_ROLE_DOCTYPE_NONE, 26 | XML_ROLE_DOCTYPE_NAME, 27 | XML_ROLE_DOCTYPE_SYSTEM_ID, 28 | XML_ROLE_DOCTYPE_PUBLIC_ID, 29 | XML_ROLE_DOCTYPE_INTERNAL_SUBSET, 30 | XML_ROLE_DOCTYPE_CLOSE, 31 | XML_ROLE_GENERAL_ENTITY_NAME, 32 | XML_ROLE_PARAM_ENTITY_NAME, 33 | XML_ROLE_ENTITY_NONE, 34 | XML_ROLE_ENTITY_VALUE, 35 | XML_ROLE_ENTITY_SYSTEM_ID, 36 | XML_ROLE_ENTITY_PUBLIC_ID, 37 | XML_ROLE_ENTITY_COMPLETE, 38 | XML_ROLE_ENTITY_NOTATION_NAME, 39 | XML_ROLE_NOTATION_NONE, 40 | XML_ROLE_NOTATION_NAME, 41 | XML_ROLE_NOTATION_SYSTEM_ID, 42 | XML_ROLE_NOTATION_NO_SYSTEM_ID, 43 | XML_ROLE_NOTATION_PUBLIC_ID, 44 | XML_ROLE_ATTRIBUTE_NAME, 45 | XML_ROLE_ATTRIBUTE_TYPE_CDATA, 46 | XML_ROLE_ATTRIBUTE_TYPE_ID, 47 | XML_ROLE_ATTRIBUTE_TYPE_IDREF, 48 | XML_ROLE_ATTRIBUTE_TYPE_IDREFS, 49 | XML_ROLE_ATTRIBUTE_TYPE_ENTITY, 50 | XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, 51 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, 52 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, 53 | XML_ROLE_ATTRIBUTE_ENUM_VALUE, 54 | XML_ROLE_ATTRIBUTE_NOTATION_VALUE, 55 | XML_ROLE_ATTLIST_NONE, 56 | XML_ROLE_ATTLIST_ELEMENT_NAME, 57 | XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, 58 | XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, 59 | XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, 60 | XML_ROLE_FIXED_ATTRIBUTE_VALUE, 61 | XML_ROLE_ELEMENT_NONE, 62 | XML_ROLE_ELEMENT_NAME, 63 | XML_ROLE_CONTENT_ANY, 64 | XML_ROLE_CONTENT_EMPTY, 65 | XML_ROLE_CONTENT_PCDATA, 66 | XML_ROLE_GROUP_OPEN, 67 | XML_ROLE_GROUP_CLOSE, 68 | XML_ROLE_GROUP_CLOSE_REP, 69 | XML_ROLE_GROUP_CLOSE_OPT, 70 | XML_ROLE_GROUP_CLOSE_PLUS, 71 | XML_ROLE_GROUP_CHOICE, 72 | XML_ROLE_GROUP_SEQUENCE, 73 | XML_ROLE_CONTENT_ELEMENT, 74 | XML_ROLE_CONTENT_ELEMENT_REP, 75 | XML_ROLE_CONTENT_ELEMENT_OPT, 76 | XML_ROLE_CONTENT_ELEMENT_PLUS, 77 | XML_ROLE_PI, 78 | XML_ROLE_COMMENT, 79 | #ifdef XML_DTD 80 | XML_ROLE_TEXT_DECL, 81 | XML_ROLE_IGNORE_SECT, 82 | XML_ROLE_INNER_PARAM_ENTITY_REF, 83 | #endif /* XML_DTD */ 84 | XML_ROLE_PARAM_ENTITY_REF 85 | }; 86 | 87 | typedef struct prolog_state { 88 | int (PTRCALL *handler) (struct prolog_state *state, 89 | int tok, 90 | const char *ptr, 91 | const char *end, 92 | const ENCODING *enc); 93 | unsigned level; 94 | int role_none; 95 | #ifdef XML_DTD 96 | unsigned includeLevel; 97 | int documentEntity; 98 | int inEntityValue; 99 | #endif /* XML_DTD */ 100 | } PROLOG_STATE; 101 | 102 | void XmlPrologStateInit(PROLOG_STATE *); 103 | #ifdef XML_DTD 104 | void XmlPrologStateInitExternalEntity(PROLOG_STATE *); 105 | #endif /* XML_DTD */ 106 | 107 | #define XmlTokenRole(state, tok, ptr, end, enc) \ 108 | (((state)->handler)(state, tok, ptr, end, enc)) 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* not XmlRole_INCLUDED */ 115 | -------------------------------------------------------------------------------- /deps/libexpat/lib/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /deps/libexpat/lib/xmltok_ns.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* This file is included! */ 6 | #ifdef XML_TOK_NS_C 7 | 8 | const ENCODING * 9 | NS(XmlGetUtf8InternalEncoding)(void) 10 | { 11 | return &ns(internal_utf8_encoding).enc; 12 | } 13 | 14 | const ENCODING * 15 | NS(XmlGetUtf16InternalEncoding)(void) 16 | { 17 | #if BYTEORDER == 1234 18 | return &ns(internal_little2_encoding).enc; 19 | #elif BYTEORDER == 4321 20 | return &ns(internal_big2_encoding).enc; 21 | #else 22 | const short n = 1; 23 | return (*(const char *)&n 24 | ? &ns(internal_little2_encoding).enc 25 | : &ns(internal_big2_encoding).enc); 26 | #endif 27 | } 28 | 29 | static const ENCODING * const NS(encodings)[] = { 30 | &ns(latin1_encoding).enc, 31 | &ns(ascii_encoding).enc, 32 | &ns(utf8_encoding).enc, 33 | &ns(big2_encoding).enc, 34 | &ns(big2_encoding).enc, 35 | &ns(little2_encoding).enc, 36 | &ns(utf8_encoding).enc /* NO_ENC */ 37 | }; 38 | 39 | static int PTRCALL 40 | NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 41 | const char **nextTokPtr) 42 | { 43 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 44 | XML_PROLOG_STATE, ptr, end, nextTokPtr); 45 | } 46 | 47 | static int PTRCALL 48 | NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 49 | const char **nextTokPtr) 50 | { 51 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 52 | XML_CONTENT_STATE, ptr, end, nextTokPtr); 53 | } 54 | 55 | int 56 | NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, 57 | const char *name) 58 | { 59 | int i = getEncodingIndex(name); 60 | if (i == UNKNOWN_ENC) 61 | return 0; 62 | SET_INIT_ENC_INDEX(p, i); 63 | p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); 64 | p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); 65 | p->initEnc.updatePosition = initUpdatePosition; 66 | p->encPtr = encPtr; 67 | *encPtr = &(p->initEnc); 68 | return 1; 69 | } 70 | 71 | static const ENCODING * 72 | NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) 73 | { 74 | #define ENCODING_MAX 128 75 | char buf[ENCODING_MAX]; 76 | char *p = buf; 77 | int i; 78 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); 79 | if (ptr != end) 80 | return 0; 81 | *p = 0; 82 | if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) 83 | return enc; 84 | i = getEncodingIndex(buf); 85 | if (i == UNKNOWN_ENC) 86 | return 0; 87 | return NS(encodings)[i]; 88 | } 89 | 90 | int 91 | NS(XmlParseXmlDecl)(int isGeneralTextEntity, 92 | const ENCODING *enc, 93 | const char *ptr, 94 | const char *end, 95 | const char **badPtr, 96 | const char **versionPtr, 97 | const char **versionEndPtr, 98 | const char **encodingName, 99 | const ENCODING **encoding, 100 | int *standalone) 101 | { 102 | return doParseXmlDecl(NS(findEncoding), 103 | isGeneralTextEntity, 104 | enc, 105 | ptr, 106 | end, 107 | badPtr, 108 | versionPtr, 109 | versionEndPtr, 110 | encodingName, 111 | encoding, 112 | standalone); 113 | } 114 | 115 | #endif /* XML_TOK_NS_C */ 116 | -------------------------------------------------------------------------------- /deps/libexpat/libexpat.gyp: -------------------------------------------------------------------------------- 1 | # This file is used with the GYP meta build system. 2 | # http://code.google.com/p/gyp 3 | # To build try this: 4 | # svn co http://gyp.googlecode.com/svn/trunk gyp 5 | # ./gyp/gyp -f make --depth=`pwd` libexpat.gyp 6 | # make 7 | # ./out/Debug/test 8 | 9 | { 10 | 'target_defaults': { 11 | 'default_configuration': 'Debug', 12 | 'configurations': { 13 | # TODO: hoist these out and put them somewhere common, because 14 | # RuntimeLibrary MUST MATCH across the entire project 15 | 'Debug': { 16 | 'defines': [ 'DEBUG', '_DEBUG' ], 17 | 'msvs_settings': { 18 | 'VCCLCompilerTool': { 19 | 'RuntimeLibrary': 1, # static debug 20 | }, 21 | }, 22 | }, 23 | 'Release': { 24 | 'defines': [ 'NDEBUG' ], 25 | 'msvs_settings': { 26 | 'VCCLCompilerTool': { 27 | 'RuntimeLibrary': 0, # static release 28 | }, 29 | }, 30 | } 31 | }, 32 | 'msvs_settings': { 33 | 'VCCLCompilerTool': { 34 | }, 35 | 'VCLibrarianTool': { 36 | }, 37 | 'VCLinkerTool': { 38 | 'GenerateDebugInformation': 'true', 39 | }, 40 | }, 41 | }, 42 | 43 | 'targets': [ 44 | { 45 | 'variables': { 'target_arch%': 'ia32' }, # default for node v0.6.x 46 | 'target_name': 'expat', 47 | 'product_prefix': 'lib', 48 | 'type': 'static_library', 49 | 'sources': [ 50 | 'lib/xmlparse.c', 51 | 'lib/xmltok.c', 52 | 'lib/xmlrole.c', 53 | ], 54 | 'defines': [ 55 | 'PIC', 56 | 'HAVE_EXPAT_CONFIG_H' 57 | ], 58 | 'cflags': [ 59 | '-Wno-missing-field-initializers' 60 | ], 61 | 'xcode_settings': { 62 | 'OTHER_CFLAGS': [ 63 | '-Wno-missing-field-initializers' 64 | ] 65 | }, 66 | 'include_dirs': [ 67 | '.', 68 | 'lib', 69 | ], 70 | 'direct_dependent_settings': { 71 | 'include_dirs': [ 72 | '.', 73 | 'lib', 74 | ], 75 | 'conditions': [ 76 | ['OS=="win"', { 77 | 'defines': [ 78 | 'XML_STATIC' 79 | ] 80 | }] 81 | ], 82 | }, 83 | }, 84 | 85 | { 86 | 'target_name': 'version', 87 | 'type': 'executable', 88 | 'dependencies': [ 'expat' ], 89 | 'sources': [ 'version.c' ] 90 | }, 91 | ] 92 | } 93 | -------------------------------------------------------------------------------- /deps/libexpat/m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software 4 | # Foundation, Inc. 5 | # Written by Gary V. Vaughan, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # serial 6 ltsugar.m4 12 | 13 | # This is to help aclocal find these macros, as it can't see m4_define. 14 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 15 | 16 | 17 | # lt_join(SEP, ARG1, [ARG2...]) 18 | # ----------------------------- 19 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 20 | # associated separator. 21 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 22 | # versions in m4sugar had bugs. 23 | m4_define([lt_join], 24 | [m4_if([$#], [1], [], 25 | [$#], [2], [[$2]], 26 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 27 | m4_define([_lt_join], 28 | [m4_if([$#$2], [2], [], 29 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 30 | 31 | 32 | # lt_car(LIST) 33 | # lt_cdr(LIST) 34 | # ------------ 35 | # Manipulate m4 lists. 36 | # These macros are necessary as long as will still need to support 37 | # Autoconf-2.59, which quotes differently. 38 | m4_define([lt_car], [[$1]]) 39 | m4_define([lt_cdr], 40 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 41 | [$#], 1, [], 42 | [m4_dquote(m4_shift($@))])]) 43 | m4_define([lt_unquote], $1) 44 | 45 | 46 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 47 | # ------------------------------------------ 48 | # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. 49 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 50 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 51 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 52 | # than defined and empty). 53 | # 54 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 55 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 56 | m4_define([lt_append], 57 | [m4_define([$1], 58 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 59 | 60 | 61 | 62 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 63 | # ---------------------------------------------------------- 64 | # Produce a SEP delimited list of all paired combinations of elements of 65 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 66 | # has the form PREFIXmINFIXSUFFIXn. 67 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 68 | m4_define([lt_combine], 69 | [m4_if(m4_eval([$# > 3]), [1], 70 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 71 | [[m4_foreach([_Lt_prefix], [$2], 72 | [m4_foreach([_Lt_suffix], 73 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 74 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 75 | 76 | 77 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 78 | # ----------------------------------------------------------------------- 79 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 80 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 81 | m4_define([lt_if_append_uniq], 82 | [m4_ifdef([$1], 83 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 84 | [lt_append([$1], [$2], [$3])$4], 85 | [$5])], 86 | [lt_append([$1], [$2], [$3])$4])]) 87 | 88 | 89 | # lt_dict_add(DICT, KEY, VALUE) 90 | # ----------------------------- 91 | m4_define([lt_dict_add], 92 | [m4_define([$1($2)], [$3])]) 93 | 94 | 95 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 96 | # -------------------------------------------- 97 | m4_define([lt_dict_add_subkey], 98 | [m4_define([$1($2:$3)], [$4])]) 99 | 100 | 101 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 102 | # ---------------------------------- 103 | m4_define([lt_dict_fetch], 104 | [m4_ifval([$3], 105 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 106 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 107 | 108 | 109 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 110 | # ----------------------------------------------------------------- 111 | m4_define([lt_if_dict_fetch], 112 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 113 | [$5], 114 | [$6])]) 115 | 116 | 117 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 118 | # -------------------------------------------------------------- 119 | m4_define([lt_dict_filter], 120 | [m4_if([$5], [], [], 121 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 122 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 123 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 124 | ]) 125 | -------------------------------------------------------------------------------- /deps/libexpat/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /deps/libexpat/m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software 4 | # Foundation, Inc. 5 | # Written by Scott James Remnant, 2004. 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # serial 5 lt~obsolete.m4 12 | 13 | # These exist entirely to fool aclocal when bootstrapping libtool. 14 | # 15 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), 16 | # which have later been changed to m4_define as they aren't part of the 17 | # exported API, or moved to Autoconf or Automake where they belong. 18 | # 19 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 20 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 21 | # using a macro with the same name in our local m4/libtool.m4 it'll 22 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 23 | # and doesn't know about Autoconf macros at all.) 24 | # 25 | # So we provide this file, which has a silly filename so it's always 26 | # included after everything else. This provides aclocal with the 27 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 28 | # because those macros already exist, or will be overwritten later. 29 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 30 | # 31 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 32 | # Yes, that means every name once taken will need to remain here until 33 | # we give up compatibility with versions before 1.7, at which point 34 | # we need to keep only those names which we still refer to. 35 | 36 | # This is to help aclocal find these macros, as it can't see m4_define. 37 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 38 | 39 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 40 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 41 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 42 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 43 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 44 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 45 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 46 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 47 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 48 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 49 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 50 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 51 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 52 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 53 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 54 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 55 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 56 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 57 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 58 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 59 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 60 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 61 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 62 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 63 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 65 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 66 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 67 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 68 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 69 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 70 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 71 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 72 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 73 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 74 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 75 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 76 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 77 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 78 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 79 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 80 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 81 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 82 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 83 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 84 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 85 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 86 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 87 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 89 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 90 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 91 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 92 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 93 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 94 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 95 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 96 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 97 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 98 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 99 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 100 | -------------------------------------------------------------------------------- /deps/libexpat/run.sh.in: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | # Copyright (C) 2017 Expat development team 3 | # Licensed under the MIT license 4 | 5 | case "@host@" in 6 | *-mingw*) 7 | exec wine "$@" 8 | ;; 9 | *) 10 | exec "$@" 11 | ;; 12 | esac 13 | -------------------------------------------------------------------------------- /deps/libexpat/tests/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains the (fledgling) test suite for Expat. The 2 | tests provide general unit testing and regression coverage. The tests 3 | are not expected to be useful examples of Expat usage; see the 4 | examples/ directory for that. 5 | 6 | The Expat tests use a partial internal implementation of the "Check" 7 | unit testing framework for C. More information on Check can be found at: 8 | 9 | http://check.sourceforge.net/ 10 | 11 | Expat must be built and, depending on platform, must be installed, before "make check" can be executed. 12 | 13 | This test suite can all change in a later version. 14 | -------------------------------------------------------------------------------- /deps/libexpat/tests/benchmark/README.txt: -------------------------------------------------------------------------------- 1 | Use this benchmark command line utility as follows: 2 | 3 | benchmark [-n] <# iterations> 4 | 5 | The command line arguments are: 6 | 7 | -n ... optional; if supplied, namespace processing is turned on 8 | ... name/path of test xml file 9 | ... size of processing buffer; 10 | the file is parsed in chunks of this size 11 | <# iterations> ... how often will the file be parsed 12 | 13 | Returns: 14 | 15 | The time (in seconds) it takes to parse the test file, 16 | averaged over the number of iterations.@ 17 | -------------------------------------------------------------------------------- /deps/libexpat/tests/benchmark/benchmark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "expat.h" 6 | 7 | #ifdef XML_LARGE_SIZE 8 | #define XML_FMT_INT_MOD "ll" 9 | #else 10 | #define XML_FMT_INT_MOD "l" 11 | #endif 12 | 13 | static void 14 | usage(const char *prog, int rc) 15 | { 16 | fprintf(stderr, 17 | "usage: %s [-n] filename bufferSize nr_of_loops\n", prog); 18 | exit(rc); 19 | } 20 | 21 | int main (int argc, char *argv[]) 22 | { 23 | XML_Parser parser; 24 | char *XMLBuf, *XMLBufEnd, *XMLBufPtr; 25 | FILE *fd; 26 | struct stat fileAttr; 27 | int nrOfLoops, bufferSize, fileSize, i, isFinal; 28 | int j = 0, ns = 0; 29 | clock_t tstart, tend; 30 | double cpuTime = 0.0; 31 | 32 | if (argc > 1) { 33 | if (argv[1][0] == '-') { 34 | if (argv[1][1] == 'n' && argv[1][2] == '\0') { 35 | ns = 1; 36 | j = 1; 37 | } 38 | else 39 | usage(argv[0], 1); 40 | } 41 | } 42 | 43 | if (argc != j + 4) 44 | usage(argv[0], 1); 45 | 46 | if (stat (argv[j + 1], &fileAttr) != 0) { 47 | fprintf (stderr, "could not access file '%s'\n", argv[j + 1]); 48 | return 2; 49 | } 50 | 51 | fd = fopen (argv[j + 1], "r"); 52 | if (!fd) { 53 | fprintf (stderr, "could not open file '%s'\n", argv[j + 1]); 54 | exit(2); 55 | } 56 | 57 | bufferSize = atoi (argv[j + 2]); 58 | nrOfLoops = atoi (argv[j + 3]); 59 | if (bufferSize <= 0 || nrOfLoops <= 0) { 60 | fprintf (stderr, 61 | "buffer size and nr of loops must be greater than zero.\n"); 62 | exit(3); 63 | } 64 | 65 | XMLBuf = malloc (fileAttr.st_size); 66 | fileSize = fread (XMLBuf, sizeof (char), fileAttr.st_size, fd); 67 | fclose (fd); 68 | 69 | if (ns) 70 | parser = XML_ParserCreateNS(NULL, '!'); 71 | else 72 | parser = XML_ParserCreate(NULL); 73 | 74 | i = 0; 75 | XMLBufEnd = XMLBuf + fileSize; 76 | while (i < nrOfLoops) { 77 | XMLBufPtr = XMLBuf; 78 | isFinal = 0; 79 | tstart = clock(); 80 | do { 81 | int parseBufferSize = XMLBufEnd - XMLBufPtr; 82 | if (parseBufferSize <= bufferSize) 83 | isFinal = 1; 84 | else 85 | parseBufferSize = bufferSize; 86 | if (!XML_Parse (parser, XMLBufPtr, parseBufferSize, isFinal)) { 87 | fprintf (stderr, "error '%s' at line %" XML_FMT_INT_MOD \ 88 | "u character %" XML_FMT_INT_MOD "u\n", 89 | XML_ErrorString (XML_GetErrorCode (parser)), 90 | XML_GetCurrentLineNumber (parser), 91 | XML_GetCurrentColumnNumber (parser)); 92 | free (XMLBuf); 93 | XML_ParserFree (parser); 94 | exit (4); 95 | } 96 | XMLBufPtr += bufferSize; 97 | } while (!isFinal); 98 | tend = clock(); 99 | cpuTime += ((double) (tend - tstart)) / CLOCKS_PER_SEC; 100 | XML_ParserReset(parser, NULL); 101 | i++; 102 | } 103 | 104 | XML_ParserFree (parser); 105 | free (XMLBuf); 106 | 107 | printf ("%d loops, with buffer size %d. Average time per loop: %f\n", 108 | nrOfLoops, bufferSize, cpuTime / (double) nrOfLoops); 109 | return 0; 110 | } 111 | -------------------------------------------------------------------------------- /deps/libexpat/tests/chardata.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998-2003 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | 4 | chardata.c 5 | */ 6 | 7 | #ifdef HAVE_EXPAT_CONFIG_H 8 | #include 9 | #endif 10 | #include "minicheck.h" 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "chardata.h" 17 | 18 | 19 | static int 20 | xmlstrlen(const XML_Char *s) 21 | { 22 | int len = 0; 23 | assert(s != NULL); 24 | while (s[len] != 0) 25 | ++len; 26 | return len; 27 | } 28 | 29 | 30 | void 31 | CharData_Init(CharData *storage) 32 | { 33 | assert(storage != NULL); 34 | storage->count = -1; 35 | } 36 | 37 | void 38 | CharData_AppendString(CharData *storage, const char *s) 39 | { 40 | int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); 41 | int len; 42 | 43 | assert(s != NULL); 44 | len = strlen(s); 45 | if (storage->count < 0) 46 | storage->count = 0; 47 | if ((len + storage->count) > maxchars) { 48 | len = (maxchars - storage->count); 49 | } 50 | if (len + storage->count < (int)sizeof(storage->data)) { 51 | memcpy(storage->data + storage->count, s, len); 52 | storage->count += len; 53 | } 54 | } 55 | 56 | void 57 | CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) 58 | { 59 | int maxchars; 60 | 61 | assert(storage != NULL); 62 | assert(s != NULL); 63 | maxchars = sizeof(storage->data) / sizeof(storage->data[0]); 64 | if (storage->count < 0) 65 | storage->count = 0; 66 | if (len < 0) 67 | len = xmlstrlen(s); 68 | if ((len + storage->count) > maxchars) { 69 | len = (maxchars - storage->count); 70 | } 71 | if (len + storage->count < (int)sizeof(storage->data)) { 72 | memcpy(storage->data + storage->count, s, 73 | len * sizeof(storage->data[0])); 74 | storage->count += len; 75 | } 76 | } 77 | 78 | int 79 | CharData_CheckString(CharData *storage, const char *expected) 80 | { 81 | char buffer[1280]; 82 | int len; 83 | int count; 84 | 85 | assert(storage != NULL); 86 | assert(expected != NULL); 87 | count = (storage->count < 0) ? 0 : storage->count; 88 | len = strlen(expected); 89 | if (len != count) { 90 | if (sizeof(XML_Char) == 1) 91 | sprintf(buffer, "wrong number of data characters:" 92 | " got %d, expected %d:\n%s", count, len, storage->data); 93 | else 94 | sprintf(buffer, 95 | "wrong number of data characters: got %d, expected %d", 96 | count, len); 97 | fail(buffer); 98 | return 0; 99 | } 100 | if (memcmp(expected, storage->data, len) != 0) { 101 | fail("got bad data bytes"); 102 | return 0; 103 | } 104 | return 1; 105 | } 106 | 107 | int 108 | CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) 109 | { 110 | char buffer[1024]; 111 | int len = xmlstrlen(expected); 112 | int count; 113 | 114 | assert(storage != NULL); 115 | count = (storage->count < 0) ? 0 : storage->count; 116 | if (len != count) { 117 | sprintf(buffer, "wrong number of data characters: got %d, expected %d", 118 | count, len); 119 | fail(buffer); 120 | return 0; 121 | } 122 | if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) { 123 | fail("got bad data bytes"); 124 | return 0; 125 | } 126 | return 1; 127 | } 128 | -------------------------------------------------------------------------------- /deps/libexpat/tests/chardata.h: -------------------------------------------------------------------------------- 1 | /* chardata.h 2 | 3 | Interface to some helper routines used to accumulate and check text 4 | and attribute content. 5 | */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #ifndef XML_CHARDATA_H 12 | #define XML_CHARDATA_H 1 13 | 14 | #ifndef XML_VERSION 15 | #include "expat.h" /* need XML_Char */ 16 | #endif 17 | 18 | 19 | typedef struct { 20 | int count; /* # of chars, < 0 if not set */ 21 | XML_Char data[1024]; 22 | } CharData; 23 | 24 | 25 | void CharData_Init(CharData *storage); 26 | 27 | void CharData_AppendString(CharData *storage, const char *s); 28 | 29 | void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len); 30 | 31 | int CharData_CheckString(CharData *storage, const char *s); 32 | 33 | int CharData_CheckXMLChars(CharData *storage, const XML_Char *s); 34 | 35 | 36 | #endif /* XML_CHARDATA_H */ 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /deps/libexpat/tests/memcheck.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017 The Expat Maintainers 2 | * Copying is permitted under the MIT license. See the file COPYING 3 | * for details. 4 | * 5 | * memcheck.c : debug allocators for the Expat test suite 6 | */ 7 | 8 | #include 9 | #include 10 | #include "memcheck.h" 11 | 12 | 13 | /* Structures to keep track of what has been allocated. Speed isn't a 14 | * big issue for the tests this is required for, so we will use a 15 | * doubly-linked list to make deletion easier. 16 | */ 17 | 18 | typedef struct allocation_entry { 19 | struct allocation_entry * next; 20 | struct allocation_entry * prev; 21 | void * allocation; 22 | size_t num_bytes; 23 | } AllocationEntry; 24 | 25 | static AllocationEntry *alloc_head = NULL; 26 | static AllocationEntry *alloc_tail = NULL; 27 | 28 | static AllocationEntry *find_allocation(void *ptr); 29 | 30 | 31 | /* Allocate some memory and keep track of it. */ 32 | void * 33 | tracking_malloc(size_t size) 34 | { 35 | AllocationEntry *entry = malloc(sizeof(AllocationEntry)); 36 | 37 | if (entry == NULL) { 38 | printf("Allocator failure\n"); 39 | return NULL; 40 | } 41 | entry->num_bytes = size; 42 | entry->allocation = malloc(size); 43 | if (entry->allocation == NULL) { 44 | free(entry); 45 | return NULL; 46 | } 47 | entry->next = NULL; 48 | 49 | /* Add to the list of allocations */ 50 | if (alloc_head == NULL) { 51 | entry->prev = NULL; 52 | alloc_head = alloc_tail = entry; 53 | } else { 54 | entry->prev = alloc_tail; 55 | alloc_tail->next = entry; 56 | alloc_tail = entry; 57 | } 58 | 59 | return entry->allocation; 60 | } 61 | 62 | static AllocationEntry * 63 | find_allocation(void *ptr) 64 | { 65 | AllocationEntry *entry; 66 | 67 | for (entry = alloc_head; entry != NULL; entry = entry->next) { 68 | if (entry->allocation == ptr) { 69 | return entry; 70 | } 71 | } 72 | return NULL; 73 | } 74 | 75 | /* Free some memory and remove the tracking for it */ 76 | void 77 | tracking_free(void *ptr) 78 | { 79 | AllocationEntry *entry; 80 | 81 | if (ptr == NULL) { 82 | /* There won't be an entry for this */ 83 | return; 84 | } 85 | 86 | entry = find_allocation(ptr); 87 | if (entry != NULL) { 88 | /* This is the relevant allocation. Unlink it */ 89 | if (entry->prev != NULL) 90 | entry->prev->next = entry->next; 91 | else 92 | alloc_head = entry->next; 93 | if (entry->next != NULL) 94 | entry->next->prev = entry->prev; 95 | else 96 | alloc_tail = entry->next; 97 | free(entry); 98 | } else { 99 | printf("Attempting to free unallocated memory at %p\n", ptr); 100 | } 101 | free(ptr); 102 | } 103 | 104 | /* Reallocate some memory and keep track of it */ 105 | void * 106 | tracking_realloc(void *ptr, size_t size) 107 | { 108 | AllocationEntry *entry; 109 | 110 | if (ptr == NULL) { 111 | /* By definition, this is equivalent to malloc(size) */ 112 | return tracking_malloc(size); 113 | } 114 | if (size == 0) { 115 | /* By definition, this is equivalent to free(ptr) */ 116 | tracking_free(ptr); 117 | return NULL; 118 | } 119 | 120 | /* Find the allocation entry for this memory */ 121 | entry = find_allocation(ptr); 122 | if (entry == NULL) { 123 | printf("Attempting to realloc unallocated memory at %p\n", ptr); 124 | entry = malloc(sizeof(AllocationEntry)); 125 | if (entry == NULL) { 126 | printf("Reallocator failure\n"); 127 | return NULL; 128 | } 129 | entry->allocation = realloc(ptr, size); 130 | if (entry->allocation == NULL) { 131 | free(entry); 132 | return NULL; 133 | } 134 | 135 | /* Add to the list of allocations */ 136 | entry->next = NULL; 137 | if (alloc_head == NULL) { 138 | entry->prev = NULL; 139 | alloc_head = alloc_tail = entry; 140 | } else { 141 | entry->prev = alloc_tail; 142 | alloc_tail->next = entry; 143 | alloc_tail = entry; 144 | } 145 | } else { 146 | entry->allocation = realloc(ptr, size); 147 | if (entry->allocation == NULL) { 148 | /* Realloc semantics say the original is still allocated */ 149 | entry->allocation = ptr; 150 | return NULL; 151 | } 152 | } 153 | 154 | entry->num_bytes = size; 155 | return entry->allocation; 156 | } 157 | 158 | int 159 | tracking_report(void) 160 | { 161 | AllocationEntry *entry; 162 | 163 | if (alloc_head == NULL) 164 | return 1; 165 | 166 | /* Otherwise we have allocations that haven't been freed */ 167 | for (entry = alloc_head; entry != NULL; entry = entry->next) 168 | { 169 | printf("Allocated %lu bytes at %p\n", 170 | entry->num_bytes, entry->allocation); 171 | } 172 | return 0; 173 | } 174 | -------------------------------------------------------------------------------- /deps/libexpat/tests/memcheck.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017 The Expat Maintainers 2 | * Copying is permitted under the MIT license. See the file COPYING 3 | * for details. 4 | * 5 | * memcheck.h 6 | * 7 | * Interface to allocation functions that will track what has or has 8 | * not been freed. 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef XML_MEMCHECK_H 16 | #define XML_MEMCHECK_H 1 17 | 18 | /* Allocation declarations */ 19 | 20 | void *tracking_malloc(size_t size); 21 | void tracking_free(void *ptr); 22 | void *tracking_realloc(void *ptr, size_t size); 23 | 24 | /* End-of-test check to see if unfreed allocations remain. Returns 25 | * TRUE (1) if there is nothing, otherwise prints a report of the 26 | * remaining allocations and returns FALSE (0). 27 | */ 28 | int tracking_report(void); 29 | 30 | #endif /* XML_MEMCHECK_H */ 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /deps/libexpat/tests/minicheck.c: -------------------------------------------------------------------------------- 1 | /* Miniature re-implementation of the "check" library. 2 | * 3 | * This is intended to support just enough of check to run the Expat 4 | * tests. This interface is based entirely on the portion of the 5 | * check library being used. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "internal.h" /* for UNUSED_P only */ 14 | #include "minicheck.h" 15 | 16 | Suite * 17 | suite_create(const char *name) 18 | { 19 | Suite *suite = (Suite *) calloc(1, sizeof(Suite)); 20 | if (suite != NULL) { 21 | suite->name = name; 22 | } 23 | return suite; 24 | } 25 | 26 | TCase * 27 | tcase_create(const char *name) 28 | { 29 | TCase *tc = (TCase *) calloc(1, sizeof(TCase)); 30 | if (tc != NULL) { 31 | tc->name = name; 32 | } 33 | return tc; 34 | } 35 | 36 | void 37 | suite_add_tcase(Suite *suite, TCase *tc) 38 | { 39 | assert(suite != NULL); 40 | assert(tc != NULL); 41 | assert(tc->next_tcase == NULL); 42 | 43 | tc->next_tcase = suite->tests; 44 | suite->tests = tc; 45 | } 46 | 47 | void 48 | tcase_add_checked_fixture(TCase *tc, 49 | tcase_setup_function setup, 50 | tcase_teardown_function teardown) 51 | { 52 | assert(tc != NULL); 53 | tc->setup = setup; 54 | tc->teardown = teardown; 55 | } 56 | 57 | void 58 | tcase_add_test(TCase *tc, tcase_test_function test) 59 | { 60 | assert(tc != NULL); 61 | if (tc->allocated == tc->ntests) { 62 | int nalloc = tc->allocated + 100; 63 | size_t new_size = sizeof(tcase_test_function) * nalloc; 64 | tcase_test_function *new_tests = realloc(tc->tests, new_size); 65 | assert(new_tests != NULL); 66 | tc->tests = new_tests; 67 | tc->allocated = nalloc; 68 | } 69 | tc->tests[tc->ntests] = test; 70 | tc->ntests++; 71 | } 72 | 73 | SRunner * 74 | srunner_create(Suite *suite) 75 | { 76 | SRunner *runner = calloc(1, sizeof(SRunner)); 77 | if (runner != NULL) { 78 | runner->suite = suite; 79 | } 80 | return runner; 81 | } 82 | 83 | static jmp_buf env; 84 | 85 | static char const *_check_current_function = NULL; 86 | static int _check_current_lineno = -1; 87 | static char const *_check_current_filename = NULL; 88 | 89 | void 90 | _check_set_test_info(char const *function, char const *filename, int lineno) 91 | { 92 | _check_current_function = function; 93 | _check_current_lineno = lineno; 94 | _check_current_filename = filename; 95 | } 96 | 97 | 98 | static void 99 | add_failure(SRunner *runner, int verbosity) 100 | { 101 | runner->nfailures++; 102 | if (verbosity >= CK_VERBOSE) { 103 | printf("%s:%d: %s\n", _check_current_filename, 104 | _check_current_lineno, _check_current_function); 105 | } 106 | } 107 | 108 | void 109 | srunner_run_all(SRunner *runner, int verbosity) 110 | { 111 | Suite *suite; 112 | TCase *tc; 113 | assert(runner != NULL); 114 | suite = runner->suite; 115 | tc = suite->tests; 116 | while (tc != NULL) { 117 | int i; 118 | for (i = 0; i < tc->ntests; ++i) { 119 | runner->nchecks++; 120 | 121 | if (tc->setup != NULL) { 122 | /* setup */ 123 | if (setjmp(env)) { 124 | add_failure(runner, verbosity); 125 | continue; 126 | } 127 | tc->setup(); 128 | } 129 | /* test */ 130 | if (setjmp(env)) { 131 | add_failure(runner, verbosity); 132 | continue; 133 | } 134 | (tc->tests[i])(); 135 | 136 | /* teardown */ 137 | if (tc->teardown != NULL) { 138 | if (setjmp(env)) { 139 | add_failure(runner, verbosity); 140 | continue; 141 | } 142 | tc->teardown(); 143 | } 144 | } 145 | tc = tc->next_tcase; 146 | } 147 | if (verbosity) { 148 | int passed = runner->nchecks - runner->nfailures; 149 | double percentage = ((double) passed) / runner->nchecks; 150 | int display = (int) (percentage * 100); 151 | printf("%d%%: Checks: %d, Failed: %d\n", 152 | display, runner->nchecks, runner->nfailures); 153 | } 154 | } 155 | 156 | void 157 | _fail_unless(int UNUSED_P(condition), const char *UNUSED_P(file), int UNUSED_P(line), const char *msg) 158 | { 159 | /* Always print the error message so it isn't lost. In this case, 160 | we have a failure, so there's no reason to be quiet about what 161 | it is. 162 | */ 163 | if (msg != NULL) 164 | printf("%s", msg); 165 | longjmp(env, 1); 166 | } 167 | 168 | int 169 | srunner_ntests_failed(SRunner *runner) 170 | { 171 | assert(runner != NULL); 172 | return runner->nfailures; 173 | } 174 | 175 | void 176 | srunner_free(SRunner *runner) 177 | { 178 | free(runner->suite); 179 | free(runner); 180 | } 181 | -------------------------------------------------------------------------------- /deps/libexpat/tests/minicheck.h: -------------------------------------------------------------------------------- 1 | /* Miniature re-implementation of the "check" library. 2 | * 3 | * This is intended to support just enough of check to run the Expat 4 | * tests. This interface is based entirely on the portion of the 5 | * check library being used. 6 | * 7 | * This is *source* compatible, but not necessary *link* compatible. 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define CK_NOFORK 0 15 | #define CK_FORK 1 16 | 17 | #define CK_SILENT 0 18 | #define CK_NORMAL 1 19 | #define CK_VERBOSE 2 20 | 21 | /* Workaround for Microsoft's compiler and Tru64 Unix systems where the 22 | C compiler has a working __func__, but the C++ compiler only has a 23 | working __FUNCTION__. This could be fixed in configure.in, but it's 24 | not worth it right now. */ 25 | #if defined (_MSC_VER) || (defined(__osf__) && defined(__cplusplus)) 26 | #define __func__ __FUNCTION__ 27 | #endif 28 | 29 | /* ISO C90 does not support '__func__' predefined identifier */ 30 | #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901)) || \ 31 | (defined(__GNUC__) && !defined(__STDC_VERSION__)) 32 | # define __func__ "(unknown)" 33 | #endif 34 | 35 | #define START_TEST(testname) static void testname(void) { \ 36 | _check_set_test_info(__func__, __FILE__, __LINE__); \ 37 | { 38 | #define END_TEST } } 39 | 40 | #define fail(msg) _fail_unless(0, __FILE__, __LINE__, msg) 41 | 42 | typedef void (*tcase_setup_function)(void); 43 | typedef void (*tcase_teardown_function)(void); 44 | typedef void (*tcase_test_function)(void); 45 | 46 | typedef struct SRunner SRunner; 47 | typedef struct Suite Suite; 48 | typedef struct TCase TCase; 49 | 50 | struct SRunner { 51 | Suite *suite; 52 | int nchecks; 53 | int nfailures; 54 | }; 55 | 56 | struct Suite { 57 | const char *name; 58 | TCase *tests; 59 | }; 60 | 61 | struct TCase { 62 | const char *name; 63 | tcase_setup_function setup; 64 | tcase_teardown_function teardown; 65 | tcase_test_function *tests; 66 | int ntests; 67 | int allocated; 68 | TCase *next_tcase; 69 | }; 70 | 71 | 72 | /* Internal helper. */ 73 | void _check_set_test_info(char const *function, 74 | char const *filename, int lineno); 75 | 76 | 77 | /* 78 | * Prototypes for the actual implementation. 79 | */ 80 | 81 | void _fail_unless(int condition, const char *file, int line, const char *msg); 82 | Suite *suite_create(const char *name); 83 | TCase *tcase_create(const char *name); 84 | void suite_add_tcase(Suite *suite, TCase *tc); 85 | void tcase_add_checked_fixture(TCase *, 86 | tcase_setup_function, 87 | tcase_teardown_function); 88 | void tcase_add_test(TCase *tc, tcase_test_function test); 89 | SRunner *srunner_create(Suite *suite); 90 | void srunner_run_all(SRunner *runner, int verbosity); 91 | int srunner_ntests_failed(SRunner *runner); 92 | void srunner_free(SRunner *runner); 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | -------------------------------------------------------------------------------- /deps/libexpat/tests/runtestspp.cpp: -------------------------------------------------------------------------------- 1 | // C++ compilation harness for the test suite. 2 | // 3 | // This is used to ensure the Expat headers can be included from C++ 4 | // and have everything work as expected. 5 | // 6 | #include "runtests.c" 7 | -------------------------------------------------------------------------------- /deps/libexpat/tests/xmltest.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # EXPAT TEST SCRIPT FOR W3C XML TEST SUITE 4 | 5 | # This script can be used to exercise Expat against the 6 | # w3c.org xml test suite, available from 7 | # http://www.w3.org/XML/Test/xmlts20020606.zip. 8 | 9 | # To run this script, first set XMLWF below so that xmlwf can be 10 | # found, then set the output directory with OUTPUT. 11 | 12 | # The script lists all test cases where Expat shows a discrepancy 13 | # from the expected result. Test cases where only the canonical 14 | # output differs are prefixed with "Output differs:", and a diff file 15 | # is generated in the appropriate subdirectory under $OUTPUT. 16 | 17 | # If there are output files provided, the script will use 18 | # output from xmlwf and compare the desired output against it. 19 | # However, one has to take into account that the canonical output 20 | # produced by xmlwf conforms to an older definition of canonical XML 21 | # and does not generate notation declarations. 22 | 23 | shopt -s nullglob 24 | 25 | MYDIR="`dirname \"$0\"`" 26 | cd "$MYDIR" 27 | MYDIR="`pwd`" 28 | XMLWF="${1:-`dirname \"$MYDIR\"`/xmlwf/xmlwf}" 29 | # XMLWF=/usr/local/bin/xmlwf 30 | TS="$MYDIR" 31 | # OUTPUT must terminate with the directory separator. 32 | OUTPUT="$TS/out/" 33 | # OUTPUT=/home/tmp/xml-testsuite-out/ 34 | 35 | 36 | # RunXmlwfNotWF file reldir 37 | # reldir includes trailing slash 38 | RunXmlwfNotWF() { 39 | file="$1" 40 | reldir="$2" 41 | $XMLWF -p "$file" > outfile || return $? 42 | read outdata < outfile 43 | if test "$outdata" = "" ; then 44 | echo "Expected not well-formed: $reldir$file" 45 | return 1 46 | else 47 | return 0 48 | fi 49 | } 50 | 51 | # RunXmlwfWF file reldir 52 | # reldir includes trailing slash 53 | RunXmlwfWF() { 54 | file="$1" 55 | reldir="$2" 56 | $XMLWF -p -d "$OUTPUT$reldir" "$file" > outfile || return $? 57 | read outdata < outfile 58 | if test "$outdata" = "" ; then 59 | if [ -f "out/$file" ] ; then 60 | diff -u "$OUTPUT$reldir$file" "out/$file" > outfile 61 | if [ -s outfile ] ; then 62 | cp outfile "$OUTPUT$reldir$file.diff" 63 | echo "Output differs: $reldir$file" 64 | return 1 65 | fi 66 | fi 67 | return 0 68 | else 69 | echo "In $reldir: $outdata" 70 | return 1 71 | fi 72 | } 73 | 74 | SUCCESS=0 75 | ERROR=0 76 | 77 | UpdateStatus() { 78 | if [ "$1" -eq 0 ] ; then 79 | SUCCESS=`expr $SUCCESS + 1` 80 | else 81 | ERROR=`expr $ERROR + 1` 82 | fi 83 | } 84 | 85 | ########################## 86 | # well-formed test cases # 87 | ########################## 88 | 89 | cd "$TS/xmlconf" 90 | for xmldir in ibm/valid/P* \ 91 | ibm/invalid/P* \ 92 | xmltest/valid/ext-sa \ 93 | xmltest/valid/not-sa \ 94 | xmltest/invalid \ 95 | xmltest/invalid/not-sa \ 96 | xmltest/valid/sa \ 97 | sun/valid \ 98 | sun/invalid ; do 99 | cd "$TS/xmlconf/$xmldir" 100 | mkdir -p "$OUTPUT$xmldir" 101 | for xmlfile in $(ls -1 *.xml | sort -d) ; do 102 | [[ -f "$xmlfile" ]] || continue 103 | RunXmlwfWF "$xmlfile" "$xmldir/" 104 | UpdateStatus $? 105 | done 106 | rm -f outfile 107 | done 108 | 109 | cd "$TS/xmlconf/oasis" 110 | mkdir -p "$OUTPUT"oasis 111 | for xmlfile in *pass*.xml ; do 112 | RunXmlwfWF "$xmlfile" "oasis/" 113 | UpdateStatus $? 114 | done 115 | rm outfile 116 | 117 | ############################## 118 | # not well-formed test cases # 119 | ############################## 120 | 121 | cd "$TS/xmlconf" 122 | for xmldir in ibm/not-wf/P* \ 123 | ibm/not-wf/p28a \ 124 | ibm/not-wf/misc \ 125 | xmltest/not-wf/ext-sa \ 126 | xmltest/not-wf/not-sa \ 127 | xmltest/not-wf/sa \ 128 | sun/not-wf ; do 129 | cd "$TS/xmlconf/$xmldir" 130 | for xmlfile in *.xml ; do 131 | RunXmlwfNotWF "$xmlfile" "$xmldir/" 132 | UpdateStatus $? 133 | done 134 | rm outfile 135 | done 136 | 137 | cd "$TS/xmlconf/oasis" 138 | for xmlfile in *fail*.xml ; do 139 | RunXmlwfNotWF "$xmlfile" "oasis/" 140 | UpdateStatus $? 141 | done 142 | rm outfile 143 | 144 | echo "Passed: $SUCCESS" 145 | echo "Failed: $ERROR" 146 | -------------------------------------------------------------------------------- /deps/libexpat/win32/MANIFEST.txt: -------------------------------------------------------------------------------- 1 | Overview of the Expat distribution 2 | 3 | The Expat distribution creates several subdirectories on your system. 4 | Some of these directories contain components of interest to all Expat 5 | users, and some contain material of interest to developers who wish to 6 | use Expat in their applications. In the list below, is the 7 | directory you specified to the installer. 8 | 9 | Directory Contents 10 | --------------------------------------------------------------------- 11 | \ Some general information files. 12 | 13 | \Doc\ API documentation for developers. 14 | 15 | \Bin\ Pre-compiled dynamic libraries for developers. 16 | Pre-compiled static libraries for developers (*MT.lib). 17 | The XML well-formedness checker xmlwf. 18 | 19 | \Source\ Source code, which may interest some developers, 20 | including a workspace for Microsft Visual C++. 21 | The source code includes the parser, the well- 22 | formedness checker, and a couple of small sample 23 | applications. 24 | 25 | 26 | -------------------------------------------------------------------------------- /deps/libexpat/win32/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Expat can be built on Windows in two ways: 3 | using MS Visual Studio .NET or Cygwin. 4 | 5 | * Cygwin: 6 | This follows the Unix build procedures. 7 | 8 | * MS Visual Studio 2013, 2015 and 2017: 9 | A solution file for Visual Studio 2013 is provided: expat.sln. 10 | The associated project files (*.vcxproj) reside in the appropriate 11 | project directories. This solution file can be opened in VS 2015 or VS 2017 12 | and should be upgraded automatically if VS 2013 is not also installed. 13 | Note: Tests have their own solution files. 14 | 15 | * All MS C/C++ compilers: 16 | The output for all projects will be generated in the win32\bin 17 | directory, intermediate files will be located in project-specific 18 | subdirectories of win32\tmp. 19 | 20 | * Creating MinGW dynamic libraries from MS VC++ DLLs: 21 | 22 | On the command line, execute these steps: 23 | pexports libexpat.dll > expat.def 24 | pexports libexpatw.dll > expatw.def 25 | dlltool -d expat.def -l libexpat.a 26 | dlltool -d expatw.def -l libexpatw.a 27 | 28 | The *.a files are mingw libraries. 29 | 30 | * Special note about MS VC++ and runtime libraries: 31 | 32 | There are three possible configurations: using the 33 | single threaded or multithreaded run-time library, 34 | or using the multi-threaded run-time Dll. That is, 35 | one can build three different Expat libraries depending 36 | on the needs of the application. 37 | 38 | Dynamic Linking: 39 | 40 | By default the Expat Dlls are built to link statically 41 | with the multi-threaded run-time library. 42 | The libraries are named 43 | - libexpat(w).dll 44 | - libexpat(w).lib (import library) 45 | The "w" indicates the UTF-16 version of the library. 46 | 47 | One rarely uses other versions of the Dll, but they can 48 | be built easily by specifying a different RTL linkage in 49 | the IDE on the C/C++ tab under the category Code Generation. 50 | 51 | Static Linking: 52 | 53 | The libraries should be named like this: 54 | Single-theaded: libexpat(w)ML.lib 55 | Multi-threaded: libexpat(w)MT.lib 56 | Multi-threaded Dll: libexpat(w)MD.lib 57 | The suffixes conform to the compiler switch settings 58 | /ML, /MT and /MD for MS VC++. 59 | 60 | Note: In Visual Studio 2005 (Visual C++ 8.0) and later, the 61 | single-threaded runtime library is not supported anymore. 62 | 63 | By default, the expat-static and expatw-static projects are set up 64 | to link statically against the multithreaded run-time library, 65 | so they will build libexpatMT.lib or libexpatwMT.lib files. 66 | 67 | To build the other versions of the static library, 68 | go to Project - Settings: 69 | - specify a different RTL linkage on the C/C++ tab 70 | under the category Code Generation. 71 | - then, on the Library tab, change the output file name 72 | accordingly, as described above 73 | 74 | An application linking to the static libraries must 75 | have the global macro XML_STATIC defined. 76 | -------------------------------------------------------------------------------- /deps/libexpat/win32/expat.iss: -------------------------------------------------------------------------------- 1 | ; Basic setup script for the Inno Setup installer builder. For more 2 | ; information on the free installer builder, see www.jrsoftware.org. 3 | ; 4 | ; This script was contributed by Tim Peters. 5 | ; It was designed for Inno Setup 2.0.19 but works with later versions as well. 6 | 7 | [Setup] 8 | AppName=Expat 9 | AppId=expat 10 | AppVersion=2.2.1 11 | AppVerName=Expat 2.2.1 12 | AppCopyright=Copyright � 1998-2017 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers 13 | AppPublisher=The Expat Developers 14 | AppPublisherURL=http://www.libexpat.org/ 15 | AppSupportURL=http://www.libexpat.org/ 16 | AppUpdatesURL=http://www.libexpat.org/ 17 | UninstallDisplayName=Expat XML Parser 2.2.1 18 | VersionInfoVersion=2.2.1 19 | 20 | DefaultDirName={pf}\Expat 2.2.1 21 | UninstallFilesDir={app}\Uninstall 22 | 23 | Compression=lzma 24 | SolidCompression=yes 25 | SourceDir=.. 26 | OutputDir=win32 27 | DisableStartupPrompt=yes 28 | AllowNoIcons=yes 29 | DisableProgramGroupPage=yes 30 | DisableReadyPage=yes 31 | 32 | [Files] 33 | Flags: ignoreversion; Source: win32\bin\Release\xmlwf.exe; DestDir: "{app}\Bin" 34 | Flags: ignoreversion; Source: win32\MANIFEST.txt; DestDir: "{app}" 35 | Flags: ignoreversion; Source: AUTHORS; DestDir: "{app}"; DestName: AUTHORS.txt 36 | Flags: ignoreversion; Source: Changes; DestDir: "{app}"; DestName: Changes.txt 37 | Flags: ignoreversion; Source: COPYING; DestDir: "{app}"; DestName: COPYING.txt 38 | Flags: ignoreversion; Source: README; DestDir: "{app}"; DestName: README.txt 39 | Flags: ignoreversion; Source: doc\*.html; DestDir: "{app}\Doc" 40 | Flags: ignoreversion; Source: doc\*.css; DestDir: "{app}\Doc" 41 | Flags: ignoreversion; Source: doc\*.png; DestDir: "{app}\Doc" 42 | Flags: ignoreversion; Source: win32\bin\Release\*.dll; DestDir: "{app}\Bin" 43 | Flags: ignoreversion; Source: win32\bin\Release\*.lib; DestDir: "{app}\Bin" 44 | Flags: ignoreversion; Source: expat.sln; DestDir: "{app}\Source" 45 | Flags: ignoreversion; Source: win32\README.txt; DestDir: "{app}\Source" 46 | Flags: ignoreversion; Source: lib\*.c; DestDir: "{app}\Source\lib" 47 | Flags: ignoreversion; Source: lib\*.h; DestDir: "{app}\Source\lib" 48 | Flags: ignoreversion; Source: lib\*.def; DestDir: "{app}\Source\lib" 49 | Flags: ignoreversion; Source: lib\*.vcxproj; DestDir: "{app}\Source\lib" 50 | Flags: ignoreversion; Source: lib\*.vcxproj.filters; DestDir: "{app}\Source\lib" 51 | Flags: ignoreversion; Source: examples\*.c; DestDir: "{app}\Source\examples" 52 | Flags: ignoreversion; Source: examples\*.vcxproj; DestDir: "{app}\Source\examples" 53 | Flags: ignoreversion; Source: examples\*.vcxproj.filters; DestDir: "{app}\Source\examples" 54 | Flags: ignoreversion; Source: tests\*.c; DestDir: "{app}\Source\tests" 55 | Flags: ignoreversion; Source: tests\*.cpp; DestDir: "{app}\Source\tests" 56 | Flags: ignoreversion; Source: tests\*.h; DestDir: "{app}\Source\tests" 57 | Flags: ignoreversion; Source: tests\*.sln; DestDir: "{app}\Source\tests" 58 | Flags: ignoreversion; Source: tests\*.vcxproj; DestDir: "{app}\Source\tests" 59 | Flags: ignoreversion; Source: tests\*.vcxproj.filters; DestDir: "{app}\Source\tests" 60 | Flags: ignoreversion; Source: tests\README.txt; DestDir: "{app}\Source\tests" 61 | Flags: ignoreversion; Source: tests\benchmark\*.c; DestDir: "{app}\Source\tests\benchmark" 62 | Flags: ignoreversion; Source: tests\benchmark\*.sln; DestDir: "{app}\Source\tests\benchmark" 63 | Flags: ignoreversion; Source: tests\benchmark\*.vcxproj; DestDir: "{app}\Source\tests\benchmark" 64 | Flags: ignoreversion; Source: tests\benchmark\README.txt; DestDir: "{app}\Source\tests\benchmark" 65 | Flags: ignoreversion; Source: xmlwf\*.c*; DestDir: "{app}\Source\xmlwf" 66 | Flags: ignoreversion; Source: xmlwf\*.h; DestDir: "{app}\Source\xmlwf" 67 | Flags: ignoreversion; Source: xmlwf\*.vcxproj; DestDir: "{app}\Source\xmlwf" 68 | Flags: ignoreversion; Source: xmlwf\*.vcxproj.filters; DestDir: "{app}\Source\xmlwf" 69 | 70 | [Messages] 71 | WelcomeLabel1=Welcome to the Expat XML Parser Setup Wizard 72 | WelcomeLabel2=This will install [name/ver] on your computer.%n%nExpat is an XML parser with a C-language API, and is primarily made available to allow developers to build applications which use XML using a portable API and fast implementation.%n%nIt is strongly recommended that you close all other applications you have running before continuing. This will help prevent any conflicts during the installation process. 73 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/codepage.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include "codepage.h" 6 | #include "internal.h" /* for UNUSED_P only */ 7 | 8 | #if defined(_WIN32) 9 | #define STRICT 1 10 | #define WIN32_LEAN_AND_MEAN 1 11 | 12 | #include 13 | 14 | int 15 | codepageMap(int cp, int *map) 16 | { 17 | int i; 18 | CPINFO info; 19 | if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) 20 | return 0; 21 | for (i = 0; i < 256; i++) 22 | map[i] = -1; 23 | if (info.MaxCharSize > 1) { 24 | for (i = 0; i < MAX_LEADBYTES; i+=2) { 25 | int j, lim; 26 | if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) 27 | break; 28 | lim = info.LeadByte[i + 1]; 29 | for (j = info.LeadByte[i]; j <= lim; j++) 30 | map[j] = -2; 31 | } 32 | } 33 | for (i = 0; i < 256; i++) { 34 | if (map[i] == -1) { 35 | char c = (char)i; 36 | unsigned short n; 37 | if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, 38 | &c, 1, &n, 1) == 1) 39 | map[i] = n; 40 | } 41 | } 42 | return 1; 43 | } 44 | 45 | int 46 | codepageConvert(int cp, const char *p) 47 | { 48 | unsigned short c; 49 | if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, 50 | p, 2, &c, 1) == 1) 51 | return c; 52 | return -1; 53 | } 54 | 55 | #else /* not _WIN32 */ 56 | 57 | int 58 | codepageMap(int UNUSED_P(cp), int *UNUSED_P(map)) 59 | { 60 | return 0; 61 | } 62 | 63 | int 64 | codepageConvert(int UNUSED_P(cp), const char *UNUSED_P(p)) 65 | { 66 | return -1; 67 | } 68 | 69 | #endif /* not _WIN32 */ 70 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/codepage.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | int codepageMap(int cp, int *map); 6 | int codepageConvert(int cp, const char *p); 7 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/ct.c: -------------------------------------------------------------------------------- 1 | #define CHARSET_MAX 41 2 | 3 | static const char * 4 | getTok(const char **pp) 5 | { 6 | enum { inAtom, inString, init, inComment }; 7 | int state = init; 8 | const char *tokStart = 0; 9 | for (;;) { 10 | switch (**pp) { 11 | case '\0': 12 | return 0; 13 | case ' ': 14 | case '\r': 15 | case '\t': 16 | case '\n': 17 | if (state == inAtom) 18 | return tokStart; 19 | break; 20 | case '(': 21 | if (state == inAtom) 22 | return tokStart; 23 | if (state != inString) 24 | state++; 25 | break; 26 | case ')': 27 | if (state > init) 28 | --state; 29 | else if (state != inString) 30 | return 0; 31 | break; 32 | case ';': 33 | case '/': 34 | case '=': 35 | if (state == inAtom) 36 | return tokStart; 37 | if (state == init) 38 | return (*pp)++; 39 | break; 40 | case '\\': 41 | ++*pp; 42 | if (**pp == '\0') 43 | return 0; 44 | break; 45 | case '"': 46 | switch (state) { 47 | case inString: 48 | ++*pp; 49 | return tokStart; 50 | case inAtom: 51 | return tokStart; 52 | case init: 53 | tokStart = *pp; 54 | state = inString; 55 | break; 56 | } 57 | break; 58 | default: 59 | if (state == init) { 60 | tokStart = *pp; 61 | state = inAtom; 62 | } 63 | break; 64 | } 65 | ++*pp; 66 | } 67 | /* not reached */ 68 | } 69 | 70 | /* key must be lowercase ASCII */ 71 | 72 | static int 73 | matchkey(const char *start, const char *end, const char *key) 74 | { 75 | if (!start) 76 | return 0; 77 | for (; start != end; start++, key++) 78 | if (*start != *key && *start != 'A' + (*key - 'a')) 79 | return 0; 80 | return *key == '\0'; 81 | } 82 | 83 | void 84 | getXMLCharset(const char *buf, char *charset) 85 | { 86 | const char *next, *p; 87 | 88 | charset[0] = '\0'; 89 | next = buf; 90 | p = getTok(&next); 91 | if (matchkey(p, next, "text")) 92 | strcpy(charset, "us-ascii"); 93 | else if (!matchkey(p, next, "application")) 94 | return; 95 | p = getTok(&next); 96 | if (!p || *p != '/') 97 | return; 98 | p = getTok(&next); 99 | if (matchkey(p, next, "xml")) 100 | isXml = 1; 101 | p = getTok(&next); 102 | while (p) { 103 | if (*p == ';') { 104 | p = getTok(&next); 105 | if (matchkey(p, next, "charset")) { 106 | p = getTok(&next); 107 | if (p && *p == '=') { 108 | p = getTok(&next); 109 | if (p) { 110 | char *s = charset; 111 | if (*p == '"') { 112 | while (++p != next - 1) { 113 | if (*p == '\\') 114 | ++p; 115 | if (s == charset + CHARSET_MAX - 1) { 116 | charset[0] = '\0'; 117 | break; 118 | } 119 | *s++ = *p; 120 | } 121 | *s++ = '\0'; 122 | } 123 | else { 124 | if (next - p > CHARSET_MAX - 1) 125 | break; 126 | while (p != next) 127 | *s++ = *p++; 128 | *s = 0; 129 | break; 130 | } 131 | } 132 | } 133 | } 134 | } 135 | else 136 | p = getTok(&next); 137 | } 138 | } 139 | 140 | int 141 | main(int argc, char **argv) 142 | { 143 | char buf[CHARSET_MAX]; 144 | getXMLCharset(argv[1], buf); 145 | printf("charset = \"%s\"\n", buf); 146 | return 0; 147 | } 148 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/filemap.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include /* INT_MAX */ 6 | #include 7 | 8 | 9 | /* The following limit (for XML_Parse's int len) derives from 10 | * this loop in xmparse.c: 11 | * 12 | * do { 13 | * bufferSize = (int) (2U * (unsigned) bufferSize); 14 | * } while (bufferSize < neededSize && bufferSize > 0); 15 | */ 16 | #define XML_MAX_CHUNK_LEN (INT_MAX / 2 + 1) 17 | 18 | 19 | #ifdef XML_UNICODE 20 | int filemap(const wchar_t *name, 21 | void (*processor)(const void *, size_t, 22 | const wchar_t *, void *arg), 23 | void *arg); 24 | #else 25 | int filemap(const char *name, 26 | void (*processor)(const void *, size_t, 27 | const char *, void *arg), 28 | void *arg); 29 | #endif 30 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/readfilemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | /* Functions close(2) and read(2) */ 12 | #if !defined(_WIN32) && !defined(_WIN64) 13 | # include 14 | #endif 15 | 16 | #ifndef S_ISREG 17 | #ifndef S_IFREG 18 | #define S_IFREG _S_IFREG 19 | #endif 20 | #ifndef S_IFMT 21 | #define S_IFMT _S_IFMT 22 | #endif 23 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 24 | #endif /* not S_ISREG */ 25 | 26 | #ifndef O_BINARY 27 | #ifdef _O_BINARY 28 | #define O_BINARY _O_BINARY 29 | #else 30 | #define O_BINARY 0 31 | #endif 32 | #endif 33 | 34 | #include "filemap.h" 35 | 36 | int 37 | filemap(const char *name, 38 | void (*processor)(const void *, size_t, const char *, void *arg), 39 | void *arg) 40 | { 41 | size_t nbytes; 42 | int fd; 43 | int n; 44 | struct stat sb; 45 | void *p; 46 | 47 | fd = open(name, O_RDONLY|O_BINARY); 48 | if (fd < 0) { 49 | perror(name); 50 | return 0; 51 | } 52 | if (fstat(fd, &sb) < 0) { 53 | perror(name); 54 | close(fd); 55 | return 0; 56 | } 57 | if (!S_ISREG(sb.st_mode)) { 58 | fprintf(stderr, "%s: not a regular file\n", name); 59 | close(fd); 60 | return 0; 61 | } 62 | if (sb.st_size > XML_MAX_CHUNK_LEN) { 63 | close(fd); 64 | return 2; /* Cannot be passed to XML_Parse in one go */ 65 | } 66 | 67 | nbytes = sb.st_size; 68 | /* malloc will return NULL with nbytes == 0, handle files with size 0 */ 69 | if (nbytes == 0) { 70 | static const char c = '\0'; 71 | processor(&c, 0, name, arg); 72 | close(fd); 73 | return 1; 74 | } 75 | p = malloc(nbytes); 76 | if (!p) { 77 | fprintf(stderr, "%s: out of memory\n", name); 78 | close(fd); 79 | return 0; 80 | } 81 | n = read(fd, p, nbytes); 82 | if (n < 0) { 83 | perror(name); 84 | free(p); 85 | close(fd); 86 | return 0; 87 | } 88 | if (n != nbytes) { 89 | fprintf(stderr, "%s: read unexpected number of bytes\n", name); 90 | free(p); 91 | close(fd); 92 | return 0; 93 | } 94 | processor(p, nbytes, name, arg); 95 | free(p); 96 | close(fd); 97 | return 1; 98 | } 99 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/unixfilemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifndef MAP_FILE 15 | #define MAP_FILE 0 16 | #endif 17 | 18 | #include "filemap.h" 19 | 20 | int 21 | filemap(const char *name, 22 | void (*processor)(const void *, size_t, const char *, void *arg), 23 | void *arg) 24 | { 25 | int fd; 26 | size_t nbytes; 27 | struct stat sb; 28 | void *p; 29 | 30 | fd = open(name, O_RDONLY); 31 | if (fd < 0) { 32 | perror(name); 33 | return 0; 34 | } 35 | if (fstat(fd, &sb) < 0) { 36 | perror(name); 37 | close(fd); 38 | return 0; 39 | } 40 | if (!S_ISREG(sb.st_mode)) { 41 | close(fd); 42 | fprintf(stderr, "%s: not a regular file\n", name); 43 | return 0; 44 | } 45 | if (sb.st_size > XML_MAX_CHUNK_LEN) { 46 | close(fd); 47 | return 2; /* Cannot be passed to XML_Parse in one go */ 48 | } 49 | 50 | nbytes = sb.st_size; 51 | /* mmap fails for zero length files */ 52 | if (nbytes == 0) { 53 | static const char c = '\0'; 54 | processor(&c, 0, name, arg); 55 | close(fd); 56 | return 1; 57 | } 58 | p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ, 59 | MAP_FILE|MAP_PRIVATE, fd, (off_t)0); 60 | if (p == (void *)-1) { 61 | perror(name); 62 | close(fd); 63 | return 0; 64 | } 65 | processor(p, nbytes, name, arg); 66 | munmap((void *)p, nbytes); 67 | close(fd); 68 | return 1; 69 | } 70 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/win32filemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define STRICT 1 6 | #define WIN32_LEAN_AND_MEAN 1 7 | 8 | #ifdef XML_UNICODE_WCHAR_T 9 | #ifndef XML_UNICODE 10 | #define XML_UNICODE 11 | #endif 12 | #endif 13 | 14 | #ifdef XML_UNICODE 15 | #define UNICODE 16 | #define _UNICODE 17 | #endif /* XML_UNICODE */ 18 | #include 19 | #include 20 | #include 21 | #include "filemap.h" 22 | 23 | static void win32perror(const TCHAR *); 24 | 25 | int 26 | filemap(const TCHAR *name, 27 | void (*processor)(const void *, size_t, const TCHAR *, void *arg), 28 | void *arg) 29 | { 30 | HANDLE f; 31 | HANDLE m; 32 | DWORD size; 33 | DWORD sizeHi; 34 | void *p; 35 | 36 | f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 37 | FILE_FLAG_SEQUENTIAL_SCAN, NULL); 38 | if (f == INVALID_HANDLE_VALUE) { 39 | win32perror(name); 40 | return 0; 41 | } 42 | size = GetFileSize(f, &sizeHi); 43 | if (size == (DWORD)-1) { 44 | win32perror(name); 45 | CloseHandle(f); 46 | return 0; 47 | } 48 | if (sizeHi || (size > XML_MAX_CHUNK_LEN)) { 49 | CloseHandle(f); 50 | return 2; /* Cannot be passed to XML_Parse in one go */ 51 | } 52 | /* CreateFileMapping barfs on zero length files */ 53 | if (size == 0) { 54 | static const char c = '\0'; 55 | processor(&c, 0, name, arg); 56 | CloseHandle(f); 57 | return 1; 58 | } 59 | m = CreateFileMapping(f, NULL, PAGE_READONLY, 0, 0, NULL); 60 | if (m == NULL) { 61 | win32perror(name); 62 | CloseHandle(f); 63 | return 0; 64 | } 65 | p = MapViewOfFile(m, FILE_MAP_READ, 0, 0, 0); 66 | if (p == NULL) { 67 | win32perror(name); 68 | CloseHandle(m); 69 | CloseHandle(f); 70 | return 0; 71 | } 72 | processor(p, size, name, arg); 73 | UnmapViewOfFile(p); 74 | CloseHandle(m); 75 | CloseHandle(f); 76 | return 1; 77 | } 78 | 79 | static void 80 | win32perror(const TCHAR *s) 81 | { 82 | LPVOID buf; 83 | if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER 84 | | FORMAT_MESSAGE_FROM_SYSTEM, 85 | NULL, 86 | GetLastError(), 87 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 88 | (LPTSTR) &buf, 89 | 0, 90 | NULL)) { 91 | _ftprintf(stderr, _T("%s: %s"), s, buf); 92 | fflush(stderr); 93 | LocalFree(buf); 94 | } 95 | else 96 | _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); 97 | } 98 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlfile.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef _WIN32 12 | #include "winconfig.h" 13 | #elif defined(HAVE_EXPAT_CONFIG_H) 14 | #include 15 | #endif /* ndef _WIN32 */ 16 | 17 | #include "expat.h" 18 | #include "internal.h" /* for UNUSED_P only */ 19 | #include "xmlfile.h" 20 | #include "xmltchar.h" 21 | #include "filemap.h" 22 | 23 | #if defined(_MSC_VER) 24 | #include 25 | #endif 26 | 27 | #ifdef HAVE_UNISTD_H 28 | #include 29 | #endif 30 | 31 | #ifndef O_BINARY 32 | #ifdef _O_BINARY 33 | #define O_BINARY _O_BINARY 34 | #else 35 | #define O_BINARY 0 36 | #endif 37 | #endif 38 | 39 | #ifdef _DEBUG 40 | #define READ_SIZE 16 41 | #else 42 | #define READ_SIZE (1024*8) 43 | #endif 44 | 45 | 46 | typedef struct { 47 | XML_Parser parser; 48 | int *retPtr; 49 | } PROCESS_ARGS; 50 | 51 | static int 52 | processStream(const XML_Char *filename, XML_Parser parser); 53 | 54 | static void 55 | reportError(XML_Parser parser, const XML_Char *filename) 56 | { 57 | enum XML_Error code = XML_GetErrorCode(parser); 58 | const XML_Char *message = XML_ErrorString(code); 59 | if (message) 60 | ftprintf(stdout, T("%s:%" XML_FMT_INT_MOD "u:%" XML_FMT_INT_MOD "u: %s\n"), 61 | filename, 62 | XML_GetErrorLineNumber(parser), 63 | XML_GetErrorColumnNumber(parser), 64 | message); 65 | else 66 | ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); 67 | } 68 | 69 | /* This implementation will give problems on files larger than INT_MAX. */ 70 | static void 71 | processFile(const void *data, size_t size, 72 | const XML_Char *filename, void *args) 73 | { 74 | XML_Parser parser = ((PROCESS_ARGS *)args)->parser; 75 | int *retPtr = ((PROCESS_ARGS *)args)->retPtr; 76 | if (XML_Parse(parser, (const char *)data, (int)size, 1) == XML_STATUS_ERROR) { 77 | reportError(parser, filename); 78 | *retPtr = 0; 79 | } 80 | else 81 | *retPtr = 1; 82 | } 83 | 84 | #if defined(_WIN32) 85 | 86 | static int 87 | isAsciiLetter(XML_Char c) 88 | { 89 | return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); 90 | } 91 | 92 | #endif /* _WIN32 */ 93 | 94 | static const XML_Char * 95 | resolveSystemId(const XML_Char *base, const XML_Char *systemId, 96 | XML_Char **toFree) 97 | { 98 | XML_Char *s; 99 | *toFree = 0; 100 | if (!base 101 | || *systemId == T('/') 102 | #if defined(_WIN32) 103 | || *systemId == T('\\') 104 | || (isAsciiLetter(systemId[0]) && systemId[1] == T(':')) 105 | #endif 106 | ) 107 | return systemId; 108 | *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2) 109 | * sizeof(XML_Char)); 110 | if (!*toFree) 111 | return systemId; 112 | tcscpy(*toFree, base); 113 | s = *toFree; 114 | if (tcsrchr(s, T('/'))) 115 | s = tcsrchr(s, T('/')) + 1; 116 | #if defined(_WIN32) 117 | if (tcsrchr(s, T('\\'))) 118 | s = tcsrchr(s, T('\\')) + 1; 119 | #endif 120 | tcscpy(s, systemId); 121 | return *toFree; 122 | } 123 | 124 | static int 125 | externalEntityRefFilemap(XML_Parser parser, 126 | const XML_Char *context, 127 | const XML_Char *base, 128 | const XML_Char *systemId, 129 | const XML_Char *UNUSED_P(publicId)) 130 | { 131 | int result; 132 | XML_Char *s; 133 | const XML_Char *filename; 134 | XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0); 135 | int filemapRes; 136 | PROCESS_ARGS args; 137 | args.retPtr = &result; 138 | args.parser = entParser; 139 | filename = resolveSystemId(base, systemId, &s); 140 | XML_SetBase(entParser, filename); 141 | filemapRes = filemap(filename, processFile, &args); 142 | switch (filemapRes) { 143 | case 0: 144 | result = 0; 145 | break; 146 | case 2: 147 | ftprintf(stderr, T("%s: file too large for memory-mapping") 148 | T(", switching to streaming\n"), filename); 149 | result = processStream(filename, entParser); 150 | break; 151 | } 152 | free(s); 153 | XML_ParserFree(entParser); 154 | return result; 155 | } 156 | 157 | static int 158 | processStream(const XML_Char *filename, XML_Parser parser) 159 | { 160 | /* passing NULL for filename means read intput from stdin */ 161 | int fd = 0; /* 0 is the fileno for stdin */ 162 | 163 | if (filename != NULL) { 164 | fd = topen(filename, O_BINARY|O_RDONLY); 165 | if (fd < 0) { 166 | tperror(filename); 167 | return 0; 168 | } 169 | } 170 | for (;;) { 171 | int nread; 172 | char *buf = (char *)XML_GetBuffer(parser, READ_SIZE); 173 | if (!buf) { 174 | if (filename != NULL) 175 | close(fd); 176 | ftprintf(stderr, T("%s: out of memory\n"), 177 | filename != NULL ? filename : "xmlwf"); 178 | return 0; 179 | } 180 | nread = read(fd, buf, READ_SIZE); 181 | if (nread < 0) { 182 | tperror(filename != NULL ? filename : "STDIN"); 183 | if (filename != NULL) 184 | close(fd); 185 | return 0; 186 | } 187 | if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) { 188 | reportError(parser, filename != NULL ? filename : "STDIN"); 189 | if (filename != NULL) 190 | close(fd); 191 | return 0; 192 | } 193 | if (nread == 0) { 194 | if (filename != NULL) 195 | close(fd); 196 | break;; 197 | } 198 | } 199 | return 1; 200 | } 201 | 202 | static int 203 | externalEntityRefStream(XML_Parser parser, 204 | const XML_Char *context, 205 | const XML_Char *base, 206 | const XML_Char *systemId, 207 | const XML_Char *UNUSED_P(publicId)) 208 | { 209 | XML_Char *s; 210 | const XML_Char *filename; 211 | int ret; 212 | XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0); 213 | filename = resolveSystemId(base, systemId, &s); 214 | XML_SetBase(entParser, filename); 215 | ret = processStream(filename, entParser); 216 | free(s); 217 | XML_ParserFree(entParser); 218 | return ret; 219 | } 220 | 221 | int 222 | XML_ProcessFile(XML_Parser parser, 223 | const XML_Char *filename, 224 | unsigned flags) 225 | { 226 | int result; 227 | 228 | if (!XML_SetBase(parser, filename)) { 229 | ftprintf(stderr, T("%s: out of memory"), filename); 230 | exit(1); 231 | } 232 | 233 | if (flags & XML_EXTERNAL_ENTITIES) 234 | XML_SetExternalEntityRefHandler(parser, 235 | (flags & XML_MAP_FILE) 236 | ? externalEntityRefFilemap 237 | : externalEntityRefStream); 238 | if (flags & XML_MAP_FILE) { 239 | int filemapRes; 240 | PROCESS_ARGS args; 241 | args.retPtr = &result; 242 | args.parser = parser; 243 | filemapRes = filemap(filename, processFile, &args); 244 | switch (filemapRes) { 245 | case 0: 246 | result = 0; 247 | break; 248 | case 2: 249 | ftprintf(stderr, T("%s: file too large for memory-mapping") 250 | T(", switching to streaming\n"), filename); 251 | result = processStream(filename, parser); 252 | break; 253 | } 254 | } 255 | else 256 | result = processStream(filename, parser); 257 | return result; 258 | } 259 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlfile.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define XML_MAP_FILE 01 6 | #define XML_EXTERNAL_ENTITIES 02 7 | 8 | #ifdef XML_LARGE_SIZE 9 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 10 | #define XML_FMT_INT_MOD "I64" 11 | #else 12 | #define XML_FMT_INT_MOD "ll" 13 | #endif 14 | #else 15 | #define XML_FMT_INT_MOD "l" 16 | #endif 17 | 18 | extern int XML_ProcessFile(XML_Parser parser, 19 | const XML_Char *filename, 20 | unsigned flags); 21 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlmime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "xmlmime.h" 3 | 4 | static const char * 5 | getTok(const char **pp) 6 | { 7 | /* inComment means one level of nesting; inComment+1 means two levels etc */ 8 | enum { inAtom, inString, init, inComment }; 9 | int state = init; 10 | const char *tokStart = 0; 11 | for (;;) { 12 | switch (**pp) { 13 | case '\0': 14 | if (state == inAtom) 15 | return tokStart; 16 | return 0; 17 | case ' ': 18 | case '\r': 19 | case '\t': 20 | case '\n': 21 | if (state == inAtom) 22 | return tokStart; 23 | break; 24 | case '(': 25 | if (state == inAtom) 26 | return tokStart; 27 | if (state != inString) 28 | state++; 29 | break; 30 | case ')': 31 | if (state > init) 32 | --state; 33 | else if (state != inString) 34 | return 0; 35 | break; 36 | case ';': 37 | case '/': 38 | case '=': 39 | if (state == inAtom) 40 | return tokStart; 41 | if (state == init) 42 | return (*pp)++; 43 | break; 44 | case '\\': 45 | ++*pp; 46 | if (**pp == '\0') 47 | return 0; 48 | break; 49 | case '"': 50 | switch (state) { 51 | case inString: 52 | ++*pp; 53 | return tokStart; 54 | case inAtom: 55 | return tokStart; 56 | case init: 57 | tokStart = *pp; 58 | state = inString; 59 | break; 60 | } 61 | break; 62 | default: 63 | if (state == init) { 64 | tokStart = *pp; 65 | state = inAtom; 66 | } 67 | break; 68 | } 69 | ++*pp; 70 | } 71 | /* not reached */ 72 | } 73 | 74 | /* key must be lowercase ASCII */ 75 | 76 | static int 77 | matchkey(const char *start, const char *end, const char *key) 78 | { 79 | if (!start) 80 | return 0; 81 | for (; start != end; start++, key++) 82 | if (*start != *key && *start != 'A' + (*key - 'a')) 83 | return 0; 84 | return *key == '\0'; 85 | } 86 | 87 | void 88 | getXMLCharset(const char *buf, char *charset) 89 | { 90 | const char *next, *p; 91 | 92 | charset[0] = '\0'; 93 | next = buf; 94 | p = getTok(&next); 95 | if (matchkey(p, next, "text")) 96 | strcpy(charset, "us-ascii"); 97 | else if (!matchkey(p, next, "application")) 98 | return; 99 | p = getTok(&next); 100 | if (!p || *p != '/') 101 | return; 102 | p = getTok(&next); 103 | #if 0 104 | if (!matchkey(p, next, "xml") && charset[0] == '\0') 105 | return; 106 | #endif 107 | p = getTok(&next); 108 | while (p) { 109 | if (*p == ';') { 110 | p = getTok(&next); 111 | if (matchkey(p, next, "charset")) { 112 | p = getTok(&next); 113 | if (p && *p == '=') { 114 | p = getTok(&next); 115 | if (p) { 116 | char *s = charset; 117 | if (*p == '"') { 118 | while (++p != next - 1) { 119 | if (*p == '\\') 120 | ++p; 121 | if (s == charset + CHARSET_MAX - 1) { 122 | charset[0] = '\0'; 123 | break; 124 | } 125 | *s++ = *p; 126 | } 127 | *s++ = '\0'; 128 | } 129 | else { 130 | if (next - p > CHARSET_MAX - 1) 131 | break; 132 | while (p != next) 133 | *s++ = *p++; 134 | *s = 0; 135 | break; 136 | } 137 | } 138 | } 139 | break; 140 | } 141 | } 142 | else 143 | p = getTok(&next); 144 | } 145 | } 146 | 147 | #ifdef TEST 148 | 149 | #include 150 | 151 | int 152 | main(int argc, char *argv[]) 153 | { 154 | char buf[CHARSET_MAX]; 155 | if (argc <= 1) 156 | return 1; 157 | printf("%s\n", argv[1]); 158 | getXMLCharset(argv[1], buf); 159 | printf("charset=\"%s\"\n", buf); 160 | return 0; 161 | } 162 | 163 | #endif /* TEST */ 164 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlmime.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | /* Registered charset names are at most 40 characters long. */ 6 | 7 | #define CHARSET_MAX 41 8 | 9 | /* Figure out the charset to use from the ContentType. 10 | buf contains the body of the header field (the part after "Content-Type:"). 11 | charset gets the charset to use. It must be at least CHARSET_MAX chars 12 | long. charset will be empty if the default charset should be used. 13 | */ 14 | 15 | void getXMLCharset(const char *buf, char *charset); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmltchar.h: -------------------------------------------------------------------------------- 1 | #ifdef XML_UNICODE 2 | #ifndef XML_UNICODE_WCHAR_T 3 | #error xmlwf requires a 16-bit Unicode-compatible wchar_t 4 | #endif 5 | #define T(x) L ## x 6 | #define ftprintf fwprintf 7 | #define tfopen _wfopen 8 | #define fputts fputws 9 | #define puttc putwc 10 | #define tcscmp wcscmp 11 | #define tcscpy wcscpy 12 | #define tcscat wcscat 13 | #define tcschr wcschr 14 | #define tcsrchr wcsrchr 15 | #define tcslen wcslen 16 | #define tperror _wperror 17 | #define topen _wopen 18 | #define tmain wmain 19 | #define tremove _wremove 20 | #else /* not XML_UNICODE */ 21 | #define T(x) x 22 | #define ftprintf fprintf 23 | #define tfopen fopen 24 | #define fputts fputs 25 | #define puttc putc 26 | #define tcscmp strcmp 27 | #define tcscpy strcpy 28 | #define tcscat strcat 29 | #define tcschr strchr 30 | #define tcsrchr strrchr 31 | #define tcslen strlen 32 | #define tperror perror 33 | #define topen open 34 | #define tmain main 35 | #define tremove remove 36 | #endif /* not XML_UNICODE */ 37 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlurl.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | int XML_URLInit(); 6 | void XML_URLUninit(); 7 | int XML_ProcessURL(XML_Parser parser, 8 | const XML_Char *url, 9 | unsigned flags); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /deps/libexpat/xmlwf/xmlwin32url.cxx: -------------------------------------------------------------------------------- 1 | #include "expat.h" 2 | #ifdef XML_UNICODE 3 | #define UNICODE 4 | #endif 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "xmlurl.h" 11 | #include "xmlmime.h" 12 | 13 | static int 14 | processURL(XML_Parser parser, IMoniker *baseMoniker, const XML_Char *url); 15 | 16 | typedef void (*StopHandler)(void *, HRESULT); 17 | 18 | class Callback : public IBindStatusCallback { 19 | public: 20 | // IUnknown methods 21 | STDMETHODIMP QueryInterface(REFIID,void **); 22 | STDMETHODIMP_(ULONG) AddRef(); 23 | STDMETHODIMP_(ULONG) Release(); 24 | // IBindStatusCallback methods 25 | STDMETHODIMP OnStartBinding(DWORD, IBinding *); 26 | STDMETHODIMP GetPriority(LONG *); 27 | STDMETHODIMP OnLowResource(DWORD); 28 | STDMETHODIMP OnProgress(ULONG, ULONG, ULONG, LPCWSTR); 29 | STDMETHODIMP OnStopBinding(HRESULT, LPCWSTR); 30 | STDMETHODIMP GetBindInfo(DWORD *, BINDINFO *); 31 | STDMETHODIMP OnDataAvailable(DWORD, DWORD, FORMATETC *, STGMEDIUM *); 32 | STDMETHODIMP OnObjectAvailable(REFIID, IUnknown *); 33 | Callback(XML_Parser, IMoniker *, StopHandler, void *); 34 | ~Callback(); 35 | int externalEntityRef(const XML_Char *context, 36 | const XML_Char *systemId, const XML_Char *publicId); 37 | private: 38 | XML_Parser parser_; 39 | IMoniker *baseMoniker_; 40 | DWORD totalRead_; 41 | ULONG ref_; 42 | IBinding *pBinding_; 43 | StopHandler stopHandler_; 44 | void *stopArg_; 45 | }; 46 | 47 | STDMETHODIMP_(ULONG) 48 | Callback::AddRef() 49 | { 50 | return ref_++; 51 | } 52 | 53 | STDMETHODIMP_(ULONG) 54 | Callback::Release() 55 | { 56 | if (--ref_ == 0) { 57 | delete this; 58 | return 0; 59 | } 60 | return ref_; 61 | } 62 | 63 | STDMETHODIMP 64 | Callback::QueryInterface(REFIID riid, void** ppv) 65 | { 66 | if (IsEqualGUID(riid, IID_IUnknown)) 67 | *ppv = (IUnknown *)this; 68 | else if (IsEqualGUID(riid, IID_IBindStatusCallback)) 69 | *ppv = (IBindStatusCallback *)this; 70 | else 71 | return E_NOINTERFACE; 72 | ((LPUNKNOWN)*ppv)->AddRef(); 73 | return S_OK; 74 | } 75 | 76 | STDMETHODIMP 77 | Callback::OnStartBinding(DWORD, IBinding* pBinding) 78 | { 79 | pBinding_ = pBinding; 80 | pBinding->AddRef(); 81 | return S_OK; 82 | } 83 | 84 | STDMETHODIMP 85 | Callback::GetPriority(LONG *) 86 | { 87 | return E_NOTIMPL; 88 | } 89 | 90 | STDMETHODIMP 91 | Callback::OnLowResource(DWORD) 92 | { 93 | return E_NOTIMPL; 94 | } 95 | 96 | STDMETHODIMP 97 | Callback::OnProgress(ULONG, ULONG, ULONG, LPCWSTR) 98 | { 99 | return S_OK; 100 | } 101 | 102 | STDMETHODIMP 103 | Callback::OnStopBinding(HRESULT hr, LPCWSTR szError) 104 | { 105 | if (pBinding_) { 106 | pBinding_->Release(); 107 | pBinding_ = 0; 108 | } 109 | if (baseMoniker_) { 110 | baseMoniker_->Release(); 111 | baseMoniker_ = 0; 112 | } 113 | stopHandler_(stopArg_, hr); 114 | return S_OK; 115 | } 116 | 117 | STDMETHODIMP 118 | Callback::GetBindInfo(DWORD* pgrfBINDF, BINDINFO* pbindinfo) 119 | { 120 | *pgrfBINDF = BINDF_ASYNCHRONOUS; 121 | return S_OK; 122 | } 123 | 124 | static void 125 | reportError(XML_Parser parser) 126 | { 127 | int code = XML_GetErrorCode(parser); 128 | const XML_Char *message = XML_ErrorString(code); 129 | if (message) 130 | _ftprintf(stderr, _T("%s:%d:%ld: %s\n"), 131 | XML_GetBase(parser), 132 | XML_GetErrorLineNumber(parser), 133 | XML_GetErrorColumnNumber(parser), 134 | message); 135 | else 136 | _ftprintf(stderr, _T("%s: (unknown message %d)\n"), 137 | XML_GetBase(parser), code); 138 | } 139 | 140 | STDMETHODIMP 141 | Callback::OnDataAvailable(DWORD grfBSCF, 142 | DWORD dwSize, 143 | FORMATETC *pfmtetc, 144 | STGMEDIUM* pstgmed) 145 | { 146 | if (grfBSCF & BSCF_FIRSTDATANOTIFICATION) { 147 | IWinInetHttpInfo *hp; 148 | HRESULT hr = pBinding_->QueryInterface(IID_IWinInetHttpInfo, 149 | (void **)&hp); 150 | if (SUCCEEDED(hr)) { 151 | char contentType[1024]; 152 | DWORD bufSize = sizeof(contentType); 153 | DWORD flags = 0; 154 | contentType[0] = 0; 155 | hr = hp->QueryInfo(HTTP_QUERY_CONTENT_TYPE, contentType, 156 | &bufSize, 0, NULL); 157 | if (SUCCEEDED(hr)) { 158 | char charset[CHARSET_MAX]; 159 | getXMLCharset(contentType, charset); 160 | if (charset[0]) { 161 | #ifdef XML_UNICODE 162 | XML_Char wcharset[CHARSET_MAX]; 163 | XML_Char *p1 = wcharset; 164 | const char *p2 = charset; 165 | while ((*p1++ = (unsigned char)*p2++) != 0) 166 | ; 167 | XML_SetEncoding(parser_, wcharset); 168 | #else 169 | XML_SetEncoding(parser_, charset); 170 | #endif 171 | } 172 | } 173 | hp->Release(); 174 | } 175 | } 176 | if (!parser_) 177 | return E_ABORT; 178 | if (pstgmed->tymed == TYMED_ISTREAM) { 179 | while (totalRead_ < dwSize) { 180 | #define READ_MAX (64*1024) 181 | DWORD nToRead = dwSize - totalRead_; 182 | if (nToRead > READ_MAX) 183 | nToRead = READ_MAX; 184 | void *buf = XML_GetBuffer(parser_, nToRead); 185 | if (!buf) { 186 | _ftprintf(stderr, _T("out of memory\n")); 187 | return E_ABORT; 188 | } 189 | DWORD nRead; 190 | HRESULT hr = pstgmed->pstm->Read(buf, nToRead, &nRead); 191 | if (SUCCEEDED(hr)) { 192 | totalRead_ += nRead; 193 | if (!XML_ParseBuffer(parser_, 194 | nRead, 195 | (grfBSCF & BSCF_LASTDATANOTIFICATION) != 0 196 | && totalRead_ == dwSize)) { 197 | reportError(parser_); 198 | return E_ABORT; 199 | } 200 | } 201 | } 202 | } 203 | return S_OK; 204 | } 205 | 206 | STDMETHODIMP 207 | Callback::OnObjectAvailable(REFIID, IUnknown *) 208 | { 209 | return S_OK; 210 | } 211 | 212 | int 213 | Callback::externalEntityRef(const XML_Char *context, 214 | const XML_Char *systemId, 215 | const XML_Char *publicId) 216 | { 217 | XML_Parser entParser = XML_ExternalEntityParserCreate(parser_, context, 0); 218 | XML_SetBase(entParser, systemId); 219 | int ret = processURL(entParser, baseMoniker_, systemId); 220 | XML_ParserFree(entParser); 221 | return ret; 222 | } 223 | 224 | Callback::Callback(XML_Parser parser, IMoniker *baseMoniker, 225 | StopHandler stopHandler, void *stopArg) 226 | : parser_(parser), 227 | baseMoniker_(baseMoniker), 228 | ref_(0), 229 | pBinding_(0), 230 | totalRead_(0), 231 | stopHandler_(stopHandler), 232 | stopArg_(stopArg) 233 | { 234 | if (baseMoniker_) 235 | baseMoniker_->AddRef(); 236 | } 237 | 238 | Callback::~Callback() 239 | { 240 | if (pBinding_) 241 | pBinding_->Release(); 242 | if (baseMoniker_) 243 | baseMoniker_->Release(); 244 | } 245 | 246 | static int 247 | externalEntityRef(void *arg, 248 | const XML_Char *context, 249 | const XML_Char *base, 250 | const XML_Char *systemId, 251 | const XML_Char *publicId) 252 | { 253 | return ((Callback *)arg)->externalEntityRef(context, systemId, publicId); 254 | } 255 | 256 | 257 | static HRESULT 258 | openStream(XML_Parser parser, 259 | IMoniker *baseMoniker, 260 | const XML_Char *uri, 261 | StopHandler stopHandler, void *stopArg) 262 | { 263 | if (!XML_SetBase(parser, uri)) 264 | return E_OUTOFMEMORY; 265 | HRESULT hr; 266 | IMoniker *m; 267 | #ifdef XML_UNICODE 268 | hr = CreateURLMoniker(0, uri, &m); 269 | #else 270 | LPWSTR uriw = new wchar_t[strlen(uri) + 1]; 271 | for (int i = 0;; i++) { 272 | uriw[i] = uri[i]; 273 | if (uriw[i] == 0) 274 | break; 275 | } 276 | hr = CreateURLMoniker(baseMoniker, uriw, &m); 277 | delete [] uriw; 278 | #endif 279 | if (FAILED(hr)) 280 | return hr; 281 | IBindStatusCallback *cb = new Callback(parser, m, stopHandler, stopArg); 282 | XML_SetExternalEntityRefHandler(parser, externalEntityRef); 283 | XML_SetExternalEntityRefHandlerArg(parser, cb); 284 | cb->AddRef(); 285 | IBindCtx *b; 286 | if (FAILED(hr = CreateAsyncBindCtx(0, cb, 0, &b))) { 287 | cb->Release(); 288 | m->Release(); 289 | return hr; 290 | } 291 | cb->Release(); 292 | IStream *pStream; 293 | hr = m->BindToStorage(b, 0, IID_IStream, (void **)&pStream); 294 | if (SUCCEEDED(hr)) { 295 | if (pStream) 296 | pStream->Release(); 297 | } 298 | if (hr == MK_S_ASYNCHRONOUS) 299 | hr = S_OK; 300 | m->Release(); 301 | b->Release(); 302 | return hr; 303 | } 304 | 305 | struct QuitInfo { 306 | const XML_Char *url; 307 | HRESULT hr; 308 | int stop; 309 | }; 310 | 311 | static void 312 | winPerror(const XML_Char *url, HRESULT hr) 313 | { 314 | LPVOID buf; 315 | if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER 316 | | FORMAT_MESSAGE_FROM_HMODULE, 317 | GetModuleHandleA("urlmon.dll"), 318 | hr, 319 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 320 | (LPTSTR) &buf, 321 | 0, 322 | NULL) 323 | || FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER 324 | | FORMAT_MESSAGE_FROM_SYSTEM, 325 | 0, 326 | hr, 327 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 328 | (LPTSTR) &buf, 329 | 0, 330 | NULL)) { 331 | /* The system error messages seem to end with a newline. */ 332 | _ftprintf(stderr, _T("%s: %s"), url, buf); 333 | fflush(stderr); 334 | LocalFree(buf); 335 | } 336 | else 337 | _ftprintf(stderr, _T("%s: error %x\n"), url, hr); 338 | } 339 | 340 | static void 341 | threadQuit(void *p, HRESULT hr) 342 | { 343 | QuitInfo *qi = (QuitInfo *)p; 344 | qi->hr = hr; 345 | qi->stop = 1; 346 | } 347 | 348 | extern "C" 349 | int 350 | XML_URLInit(void) 351 | { 352 | return SUCCEEDED(CoInitialize(0)); 353 | } 354 | 355 | extern "C" 356 | void 357 | XML_URLUninit(void) 358 | { 359 | CoUninitialize(); 360 | } 361 | 362 | static int 363 | processURL(XML_Parser parser, IMoniker *baseMoniker, 364 | const XML_Char *url) 365 | { 366 | QuitInfo qi; 367 | qi.stop = 0; 368 | qi.url = url; 369 | 370 | XML_SetBase(parser, url); 371 | HRESULT hr = openStream(parser, baseMoniker, url, threadQuit, &qi); 372 | if (FAILED(hr)) { 373 | winPerror(url, hr); 374 | return 0; 375 | } 376 | else if (FAILED(qi.hr)) { 377 | winPerror(url, qi.hr); 378 | return 0; 379 | } 380 | MSG msg; 381 | while (!qi.stop && GetMessage (&msg, NULL, 0, 0)) { 382 | TranslateMessage (&msg); 383 | DispatchMessage (&msg); 384 | } 385 | return 1; 386 | } 387 | 388 | extern "C" 389 | int 390 | XML_ProcessURL(XML_Parser parser, 391 | const XML_Char *url, 392 | unsigned flags) 393 | { 394 | return processURL(parser, 0, url); 395 | } 396 | -------------------------------------------------------------------------------- /lib/node-expat.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const util = require('util') 4 | const expat = require('bindings')('node_expat') 5 | const Stream = require('stream').Stream 6 | 7 | const Parser = function (encoding) { 8 | this.encoding = encoding 9 | this._getNewParser() 10 | this.parser.emit = this.emit.bind(this) 11 | 12 | // Stream API 13 | this.writable = true 14 | this.readable = true 15 | } 16 | util.inherits(Parser, Stream) 17 | 18 | Parser.prototype._getNewParser = function () { 19 | this.parser = new expat.Parser(this.encoding) 20 | } 21 | 22 | Parser.prototype.parse = function (buf, isFinal) { 23 | return this.parser.parse(buf, isFinal) 24 | } 25 | 26 | Parser.prototype.setEncoding = function (encoding) { 27 | this.encoding = encoding 28 | return this.parser.setEncoding(this.encoding) 29 | } 30 | 31 | Parser.prototype.setUnknownEncoding = function (map, convert) { 32 | return this.parser.setUnknownEncoding(map, convert) 33 | } 34 | 35 | Parser.prototype.getError = function () { 36 | return this.parser.getError() 37 | } 38 | Parser.prototype.stop = function () { 39 | return this.parser.stop() 40 | } 41 | Parser.prototype.pause = function () { 42 | return this.stop() 43 | } 44 | Parser.prototype.resume = function () { 45 | return this.parser.resume() 46 | } 47 | 48 | Parser.prototype.destroy = function () { 49 | this.parser.stop() 50 | this.end() 51 | return this 52 | } 53 | 54 | Parser.prototype.destroySoon = function () { 55 | this.destroy() 56 | } 57 | 58 | Parser.prototype.write = function (data) { 59 | let error, result 60 | try { 61 | result = this.parse(data) 62 | if (!result) { 63 | error = this.getError() 64 | } 65 | } catch (e) { 66 | error = e 67 | } 68 | if (error) { 69 | this.emit('error', error) 70 | this.emit('close') 71 | } 72 | return result 73 | } 74 | 75 | Parser.prototype.end = function (data) { 76 | let error, result 77 | try { 78 | result = this.parse(data || '', true) 79 | if (!result) { 80 | error = this.getError() 81 | } 82 | } catch (e) { 83 | error = e 84 | } 85 | 86 | if (!error) { 87 | this.emit('end') 88 | } else { 89 | this.emit('error', error) 90 | } 91 | this.emit('close') 92 | } 93 | 94 | Parser.prototype.reset = function () { 95 | return this.parser.reset() 96 | } 97 | Parser.prototype.getCurrentLineNumber = function () { 98 | return this.parser.getCurrentLineNumber() 99 | } 100 | Parser.prototype.getCurrentColumnNumber = function () { 101 | return this.parser.getCurrentColumnNumber() 102 | } 103 | Parser.prototype.getCurrentByteIndex = function () { 104 | return this.parser.getCurrentByteIndex() 105 | } 106 | 107 | exports.Parser = Parser 108 | 109 | exports.createParser = function (cb) { 110 | const parser = new Parser() 111 | if (cb) { 112 | parser.on('startElement', cb) 113 | } 114 | return parser 115 | } 116 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-expat", 3 | "version": "2.4.1", 4 | "main": "./lib/node-expat", 5 | "description": "NodeJS binding for fast XML parsing.", 6 | "keywords": [ 7 | "xml", 8 | "sax", 9 | "expat", 10 | "libexpat", 11 | "parse", 12 | "parsing" 13 | ], 14 | "scripts": { 15 | "preversion": "npm test", 16 | "lint": "standard", 17 | "unit": "vows --spec ./test/**/*.js", 18 | "test": "npm run unit && npm run lint", 19 | "benchmark": "node ./benchmark.js" 20 | }, 21 | "dependencies": { 22 | "bindings": "^1.5.0", 23 | "nan": "^2.19.0" 24 | }, 25 | "devDependencies": { 26 | "benchmark": "^2.1.0", 27 | "debug": "^4.3.4", 28 | "iconv": "^3.0.1", 29 | "ltx": "^3.0.0", 30 | "node-xml": "^1.0.2", 31 | "sax": "^1.3.0", 32 | "standard": "^17.1.0", 33 | "vows": "^0.8.1" 34 | }, 35 | "repository": "github:astro/node-expat", 36 | "homepage": "http://github.com/astro/node-expat", 37 | "bugs": "https://github.com/astro/node-expat/issues", 38 | "author": { 39 | "name": "Astro", 40 | "email": "astro@spaceboyz.net", 41 | "web": "http://spaceboyz.net/~astro/" 42 | }, 43 | "contributors": [ 44 | "Stephan Maka", 45 | "Derek Hammer", 46 | "Iein Valdez", 47 | "Peter Körner", 48 | "Camilo Aguilar", 49 | "Michael Weibel", 50 | "Alexey Zhuchkov", 51 | "Satyam Shekhar", 52 | "Dhruv Matani", 53 | "Andreas Botsikas", 54 | "Tom Hughes-Croucher", 55 | "Nathan Rajlich", 56 | "Julien Genestoux", 57 | "Sonny Piers", 58 | "Lloyd Watkin", 59 | "AJ ONeal", 60 | "Rod Vagg", 61 | "Christoph Hartmann", 62 | "Corbin Uselton", 63 | "Julian Duque", 64 | "Lovell Fuller", 65 | "Antonio Bustos" 66 | ], 67 | "licenses": [ 68 | { 69 | "type": "MIT" 70 | } 71 | ], 72 | "license": "MIT" 73 | } 74 | --------------------------------------------------------------------------------