Commit b63a5c88 authored by Brad King's avatar Brad King
Browse files

Merge branch 'upstream-expat' into update-expat

* upstream-expat:
  expat 2019-09-25 (a7bc26b6)
parents 512fabaa 1712885b
...@@ -21,7 +21,7 @@ check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE) ...@@ -21,7 +21,7 @@ check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE)
check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP) check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP)
check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM) check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM)
if(USE_libbsd) if(EXPAT_WITH_LIBBSD)
set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}") set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}")
set(_bsd "bsd/") set(_bsd "bsd/")
else() else()
...@@ -62,8 +62,5 @@ check_c_source_compiles(" ...@@ -62,8 +62,5 @@ check_c_source_compiles("
}" }"
HAVE_SYSCALL_GETRANDOM) HAVE_SYSCALL_GETRANDOM)
configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
add_definitions(-DHAVE_EXPAT_CONFIG_H)
check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING) check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY) check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
# Expat, Release 2.2.7 # Expat, Release 2.2.9
This is Expat, a C library for parsing XML, started by This is Expat, a C library for parsing XML, started by
[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. [James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
...@@ -13,6 +13,11 @@ are called when the parser discovers the associated structures in the ...@@ -13,6 +13,11 @@ are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of document being parsed. A start tag is an example of the kind of
structures for which you may register handlers. structures for which you may register handlers.
Expat supports the following compilers:
- GNU GCC >=4.5
- LLVM Clang >=3.5
- Microsoft Visual Studio >=8.0/2005
Windows users should use the Windows users should use the
[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), [`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
which includes both precompiled libraries and executables, and source code for which includes both precompiled libraries and executables, and source code for
...@@ -125,3 +130,59 @@ information. ...@@ -125,3 +130,59 @@ information.
A reference manual is available in the file `doc/reference.html` in this A reference manual is available in the file `doc/reference.html` in this
distribution. distribution.
The CMake build system is still *experimental* and will replace the primary
build system based on GNU Autotools at some point when it is ready.
For an idea of the available (non-advanced) options for building with CMake:
```console
# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,'
// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=
// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
// Path to a program.
DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
// build man page for xmlwf
EXPAT_BUILD_DOCS:BOOL=ON
// build the examples for expat library
EXPAT_BUILD_EXAMPLES:BOOL=ON
// build fuzzers for the expat library
EXPAT_BUILD_FUZZERS:BOOL=OFF
// build the tests for expat library
EXPAT_BUILD_TESTS:BOOL=ON
// build the xmlwf tool for expat library
EXPAT_BUILD_TOOLS:BOOL=ON
// Character type to use (char|ushort|wchar_t) [default=char]
EXPAT_CHAR_TYPE:STRING=char
// install expat files in cmake install target
EXPAT_ENABLE_INSTALL:BOOL=ON
// Use /MT flag (static CRT) when compiling in MSVC
EXPAT_MSVC_STATIC_CRT:BOOL=OFF
// build a shared expat library
EXPAT_SHARED_LIBS:BOOL=ON
// Treat all compiler warnings as errors
EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
EXPAT_WITH_GETRANDOM:STRING=AUTO
// utilize libbsd (for arc4random_buf)
EXPAT_WITH_LIBBSD:BOOL=OFF
// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO
```
...@@ -63,27 +63,25 @@ ...@@ -63,27 +63,25 @@
/* whether byteorder is bigendian */ /* whether byteorder is bigendian */
#cmakedefine WORDS_BIGENDIAN #cmakedefine WORDS_BIGENDIAN
/* Define to allow retrieving the byte offsets for attribute names and values.
*/
#cmakedefine XML_ATTR_INFO
/* Define to specify how much context to retain around the current parse /* Define to specify how much context to retain around the current parse
point. */ point. */
#define XML_CONTEXT_BYTES 1024 #define XML_CONTEXT_BYTES 1024
#if ! defined(_WIN32)
/* Define to include code reading entropy from `/dev/urandom'. */
#cmakedefine XML_DEV_URANDOM
#endif
/* Define to make parameter entity parsing functionality available. */ /* Define to make parameter entity parsing functionality available. */
/* #undef XML_DTD */ /* #undef XML_DTD */
/* Define to make XML Namespaces functionality available. */ /* Define to make XML Namespaces functionality available. */
/* #undef XML_NS */ /* #undef XML_NS */
#if ! defined(_WIN32)
/* Define to extract entropy from /dev/urandom. */
#cmakedefine XML_DEV_URANDOM
#endif
/* Define to use UTF-16 chars (two bytes). */
#cmakedefine XML_UNICODE
/* Define to use wchar_t as UTF-16 char type instead of unsigned short. */
#cmakedefine XML_UNICODE_WCHAR_T
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
#ifdef _MSC_VER #ifdef _MSC_VER
# define __func__ __FUNCTION__ # define __func__ __FUNCTION__
......
...@@ -31,34 +31,34 @@ ...@@ -31,34 +31,34 @@
*/ */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
...@@ -33,15 +33,6 @@ ...@@ -33,15 +33,6 @@
#ifndef Expat_INCLUDED #ifndef Expat_INCLUDED
#define Expat_INCLUDED 1 #define Expat_INCLUDED 1
#ifdef __VMS
/* 0 1 2 3 0 1 2 3
1234567890123456789012345678901 1234567890123456789012345678901 */
#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler
#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler
#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler
#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg
#endif
#include <stdlib.h> #include <stdlib.h>
#include "expat_external.h" #include "expat_external.h"
...@@ -53,8 +44,8 @@ struct XML_ParserStruct; ...@@ -53,8 +44,8 @@ struct XML_ParserStruct;
typedef struct XML_ParserStruct *XML_Parser; typedef struct XML_ParserStruct *XML_Parser;
typedef unsigned char XML_Bool; typedef unsigned char XML_Bool;
#define XML_TRUE ((XML_Bool) 1) #define XML_TRUE ((XML_Bool)1)
#define XML_FALSE ((XML_Bool) 0) #define XML_FALSE ((XML_Bool)0)
/* The XML_Status enum gives the possible return values for several /* The XML_Status enum gives the possible return values for several
API functions. The preprocessor #defines are included so this API functions. The preprocessor #defines are included so this
...@@ -166,23 +157,21 @@ typedef struct XML_cp XML_Content; ...@@ -166,23 +157,21 @@ typedef struct XML_cp XML_Content;
struct XML_cp { struct XML_cp {
enum XML_Content_Type type; enum XML_Content_Type type;
enum XML_Content_Quant quant; enum XML_Content_Quant quant;
XML_Char * name; XML_Char *name;
unsigned int numchildren; unsigned int numchildren;
XML_Content * children; XML_Content *children;
}; };
/* This is called for an element declaration. See above for /* This is called for an element declaration. See above for
description of the model argument. It's the caller's responsibility description of the model argument. It's the caller's responsibility
to free model when finished with it. to free model when finished with it.
*/ */
typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
const XML_Char *name, const XML_Char *name,
XML_Content *model); XML_Content *model);
XMLPARSEAPI(void) XMLPARSEAPI(void)
XML_SetElementDeclHandler(XML_Parser parser, XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl);
XML_ElementDeclHandler eldecl);
/* The Attlist declaration handler is called for *each* attribute. So /* The Attlist declaration handler is called for *each* attribute. So
a single Attlist declaration with multiple attributes declared will a single Attlist declaration with multiple attributes declared will
...@@ -192,17 +181,12 @@ XML_SetElementDeclHandler(XML_Parser parser, ...@@ -192,17 +181,12 @@ XML_SetElementDeclHandler(XML_Parser parser,
value will be NULL in the case of "#REQUIRED". If "isrequired" is value will be NULL in the case of "#REQUIRED". If "isrequired" is
true and default is non-NULL, then this is a "#FIXED" default. true and default is non-NULL, then this is a "#FIXED" default.
*/ */
typedef void (XMLCALL *XML_AttlistDeclHandler) ( typedef void(XMLCALL *XML_AttlistDeclHandler)(
void *userData, void *userData, const XML_Char *elname, const XML_Char *attname,
const XML_Char *elname, const XML_Char *att_type, const XML_Char *dflt, int isrequired);
const XML_Char *attname,
const XML_Char *att_type,
const XML_Char *dflt,
int isrequired);
XMLPARSEAPI(void) XMLPARSEAPI(void)
XML_SetAttlistDeclHandler(XML_Parser parser, XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl);
XML_AttlistDeclHandler attdecl);
/* The XML declaration handler is called for *both* XML declarations /* The XML declaration handler is called for *both* XML declarations
and text declarations. The way to distinguish is that the version and text declarations. The way to distinguish is that the version
...@@ -212,15 +196,13 @@ XML_SetAttlistDeclHandler(XML_Parser parser, ...@@ -212,15 +196,13 @@ XML_SetAttlistDeclHandler(XML_Parser parser,
was no standalone parameter in the declaration, that it was given was no standalone parameter in the declaration, that it was given
as no, or that it was given as yes. as no, or that it was given as yes.
*/ */
typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData,
const XML_Char *version, const XML_Char *version,
const XML_Char *encoding, const XML_Char *encoding,
int standalone); int standalone);
XMLPARSEAPI(void) XMLPARSEAPI(void)
XML_SetXmlDeclHandler(XML_Parser parser, XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl);
XML_XmlDeclHandler xmldecl);
typedef struct { typedef struct {
void *(*malloc_fcn)(size_t size); void *(*malloc_fcn)(size_t size);
...@@ -248,7 +230,6 @@ XML_ParserCreate(const XML_Char *encoding); ...@@ -248,7 +230,6 @@ XML_ParserCreate(const XML_Char *encoding);
XMLPARSEAPI(XML_Parser) XMLPARSEAPI(XML_Parser)
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
/* Constructs a new parser using the memory management suite referred to /* Constructs a new parser using the memory management suite referred to
by memsuite. If memsuite is NULL, then use the standard library memory by memsuite. If memsuite is NULL, then use the standard library memory
suite. If namespaceSeparator is non-NULL it creates a parser with suite. If namespaceSeparator is non-NULL it creates a parser with
...@@ -278,31 +259,27 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encoding); ...@@ -278,31 +259,27 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
/* atts is array of name/value pairs, terminated by 0; /* atts is array of name/value pairs, terminated by 0;
names and values are 0 terminated. names and values are 0 terminated.
*/ */
typedef void (XMLCALL *XML_StartElementHandler) (void *userData, typedef void(XMLCALL *XML_StartElementHandler)(void *userData,
const XML_Char *name, const XML_Char *name,
const XML_Char **atts); const XML_Char **atts);
typedef void (XMLCALL *XML_EndElementHandler) (void *userData, typedef void(XMLCALL *XML_EndElementHandler)(void *userData,
const XML_Char *name); const XML_Char *name);
/* s is not 0 terminated. */ /* s is not 0 terminated. */
typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData,
const XML_Char *s, const XML_Char *s, int len);
int len);
/* target and data are 0 terminated */ /* target and data are 0 terminated */
typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData,
void *userData,
const XML_Char *target, const XML_Char *target,
const XML_Char *data); const XML_Char *data);
/* data is 0 terminated */ /* data is 0 terminated */
typedef void (XMLCALL *XML_CommentHandler) (void *userData, typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data);
const XML_Char *data);
typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData);
typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData);
/* This is called for any characters in the XML document for which /* This is called for any characters in the XML document for which
there is no applicable handler. This includes both characters that there is no applicable handler. This includes both characters that
...@@ -317,15 +294,13 @@ typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); ...@@ -317,15 +294,13 @@ typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData);
default handler: for example, a comment might be split between default handler: for example, a comment might be split between
multiple calls. multiple calls.
*/ */
typedef void (XMLCALL *XML_DefaultHandler) (void *userData, typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s,
const XML_Char *s,
int len); int len);
/* This is called for the start of the DOCTYPE declaration, before /* This is called for the start of the DOCTYPE declaration, before
any DTD or internal subset is parsed. any DTD or internal subset is parsed.
*/ */
typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
void *userData,
const XML_Char *doctypeName, const XML_Char *doctypeName,
const XML_Char *sysid, const XML_Char *sysid,
const XML_Char *pubid, const XML_Char *pubid,
...@@ -335,7 +310,7 @@ typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( ...@@ -335,7 +310,7 @@ typedef void (XMLCALL *XML_StartDoctypeDeclHandler) (
closing > is encountered, but after processing any external closing > is encountered, but after processing any external
subset. subset.
*/ */
typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
/* This is called for entity declarations. The is_parameter_entity /* This is called for entity declarations. The is_parameter_entity
argument will be non-zero if the entity is a parameter entity, zero argument will be non-zero if the entity is a parameter entity, zero
...@@ -355,20 +330,14 @@ typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); ...@@ -355,20 +330,14 @@ typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
Note that is_parameter_entity can't be changed to XML_Bool, since Note that is_parameter_entity can't be changed to XML_Bool, since
that would break binary compatibility. that would break binary compatibility.
*/ */
typedef void (XMLCALL *XML_EntityDeclHandler) ( typedef void(XMLCALL *XML_EntityDeclHandler)(
void *userData, void *userData, const XML_Char *entityName, int is_parameter_entity,
const XML_Char *entityName, const XML_Char *value, int value_length, const XML_Char *base,
int is_parameter_entity, const XML_Char *systemId, const XML_Char *publicId,
const XML_Char *value,
int value_length,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
const XML_Char *notationName); const XML_Char *notationName);
XMLPARSEAPI(void) XMLPARSEAPI(void)
XML_SetEntityDeclHandler(XML_Parser parser, XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler);
XML_EntityDeclHandler handler);
/* OBSOLETE -- OBSOLETE -- OBSOLETE /* OBSOLETE -- OBSOLETE -- OBSOLETE
This handler has been superseded by the EntityDeclHandler above. This handler has been superseded by the EntityDeclHandler above.
...@@ -379,20 +348,16 @@ XML_SetEntityDeclHandler(XML_Parser parser, ...@@ -379,20 +348,16 @@ XML_SetEntityDeclHandler(XML_Parser parser,
entityName, systemId and notationName arguments will never be entityName, systemId and notationName arguments will never be
NULL. The other arguments may be. NULL. The other arguments may be.
*/ */
typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)(
void *userData, void *userData, const XML_Char *entityName, const XML_Char *base,
const XML_Char *entityName, const XML_Char *systemId, const XML_Char *publicId,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
const XML_Char *notationName); const XML_Char *notationName);
/* This is called for a declaration of notation. The base argument is /* This is called for a declaration of notation. The base argument is
whatever was set by XML_SetBase. The notationName will never be whatever was set by XML_SetBase. The notationName will never be
NULL. The other arguments can be. NULL. The other arguments can be.
*/ */
typedef void (XMLCALL *XML_NotationDeclHandler) ( typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData,
void *userData,
const XML_Char *notationName, const XML_Char *notationName,
const XML_Char *base, const XML_Char *base,
const XML_Char *systemId, const XML_Char *systemId,
...@@ -404,13 +369,11 @@ typedef void (XMLCALL *XML_NotationDeclHandler) ( ...@@ -404,13 +369,11 @@ typedef void (XMLCALL *XML_NotationDeclHandler) (
declaration handlers. For an xmlns attribute, prefix will be declaration handlers. For an xmlns attribute, prefix will be
NULL. For an xmlns="" attribute, uri will be NULL. NULL. For an xmlns="" attribute, uri will be NULL.
*/ */
typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData,
void *userData,
const XML_Char *prefix, const XML_Char *prefix,
const XML_Char *uri); const XML_Char *uri);
typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData,
void *userData,
const XML_Char *prefix); const XML_Char *prefix);
/* This is called if the document is not standalone, that is, it has an /* This is called if the document is not standalone, that is, it has an
...@@ -422,7 +385,7 @@ typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( ...@@ -422,7 +385,7 @@ typedef void (XMLCALL *XML_EndNamespaceDeclHandler) (
conditions above this handler will only be called if the referenced conditions above this handler will only be called if the referenced
entity was actually read. entity was actually read.
*/ */
typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData);
/* This is called for a reference to an external parsed general /* This is called for a reference to an external parsed general
entity. The referenced entity is not automatically parsed. The entity. The referenced entity is not automatically parsed. The
...@@ -458,8 +421,7 @@ typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); ...@@ -458,8 +421,7 @@ typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData);
Note that unlike other handlers the first argument is the parser, Note that unlike other handlers the first argument is the parser,
not userData. not userData.
*/ */
typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser,
XML_Parser parser,
const XML_Char *context, const XML_Char *context,
const XML_Char *base, const XML_Char *base,
const XML_Char *systemId, const XML_Char *systemId,
...@@ -475,8 +437,7 @@ typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( ...@@ -475,8 +437,7 @@ typedef int (XMLCALL *XML_ExternalEntityRefHandler) (
the event would be out of sync with the reporting of the the event would be out of sync with the reporting of the
declarations or attribute values declarations or attribute values
*/ */
typedef void (XMLCALL *XML_SkippedEntityHandler) ( typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData,
void *userData,
const XML_Char *entityName, const XML_Char *entityName,
int is_parameter_entity); int is_parameter_entity);
...@@ -535,8 +496,8 @@ typedef void (XMLCALL *XML_SkippedEntityHandler) ( ...@@ -535,8 +496,8 @@ typedef void (XMLCALL *XML_SkippedEntityHandler) (
typedef struct { typedef struct {
int map[256]; int map[256];
void *data; void *data;
int (XMLCALL *convert)(void *data, const char *s); int(XMLCALL *convert)(void *data, const char *s);
void (XMLCALL *release)(void *data); void(XMLCALL *release)(void *data);
} XML_Encoding; } XML_Encoding;