Upgrade to expat-1.9.7.
CVS patchset: 7281 CVS date: 2004/05/30 22:27:38
This commit is contained in:
parent
99e2bddb67
commit
d99838e608
102
expat/Changes
102
expat/Changes
|
@ -1,3 +1,105 @@
|
|||
Release 1.95.7 Mon Oct 20 2003
|
||||
- Fixed enum XML_Status issue (reported on SourceForge many
|
||||
times), so compilers that are properly picky will be happy.
|
||||
- Introduced an XMLCALL macro to control the calling
|
||||
convention used by the Expat API; this macro should be used
|
||||
to annotate prototypes and definitions of callback
|
||||
implementations in code compiled with a calling convention
|
||||
other than the default convention for the host platform.
|
||||
- Improved ability to build without the configure-generated
|
||||
expat_config.h header. This is useful for applications
|
||||
which embed Expat rather than linking in the library.
|
||||
- Fixed a variety of bugs: see SF issues 458907, 609603,
|
||||
676844, 679754, 692878, 692964, 695401, 699323, 699487,
|
||||
820946.
|
||||
- Improved hash table lookups.
|
||||
- Added more regression tests and improved documentation.
|
||||
|
||||
Release 1.95.6 Tue Jan 28 2003
|
||||
- Added XML_FreeContentModel().
|
||||
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
|
||||
- Fixed a variety of bugs: see SF issues 615606, 616863,
|
||||
618199, 653180, 673791.
|
||||
- Enhanced the regression test suite.
|
||||
- Man page improvements: includes SF issue 632146.
|
||||
|
||||
Release 1.95.5 Fri Sep 6 2002
|
||||
- Added XML_UseForeignDTD() for improved SAX2 support.
|
||||
- Added XML_GetFeatureList().
|
||||
- Defined XML_Bool type and the values XML_TRUE and XML_FALSE.
|
||||
- Use an incomplete struct instead of a void* for the parser
|
||||
(may not retain).
|
||||
- Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected.
|
||||
- Finally fixed bug where default handler would report DTD
|
||||
events that were already handled by another handler.
|
||||
Initial patch contributed by Darryl Miles.
|
||||
- Removed unnecessary DllMain() function that caused static
|
||||
linking into a DLL to be difficult.
|
||||
- Added VC++ projects for building static libraries.
|
||||
- Reduced line-length for all source code and headers to be
|
||||
no longer than 80 characters, to help with AS/400 support.
|
||||
- Reduced memory copying during parsing (SF patch #600964).
|
||||
- Fixed a variety of bugs: see SF issues 580793, 434664,
|
||||
483514, 580503, 581069, 584041, 584183, 584832, 585537,
|
||||
596555, 596678, 598352, 598944, 599715, 600479, 600971.
|
||||
|
||||
Release 1.95.4 Fri Jul 12 2002
|
||||
- Added support for VMS, contributed by Craig Berry. See
|
||||
vms/README.vms for more information.
|
||||
- Added Mac OS (classic) support, with a makefile for MPW,
|
||||
contributed by Thomas Wegner and Daryle Walker.
|
||||
- Added Borland C++ Builder 5 / BCC 5.5 support, contributed
|
||||
by Patrick McConnell (SF patch #538032).
|
||||
- Fixed a variety of bugs: see SF issues 441449, 563184,
|
||||
564342, 566334, 566901, 569461, 570263, 575168, 579196.
|
||||
- Made skippedEntityHandler conform to SAX2 (see source comment)
|
||||
- Re-implemented WFC: Entity Declared from XML 1.0 spec and
|
||||
added a new error "entity declared in parameter entity":
|
||||
see SF bug report 569461 and SF patch 578161
|
||||
- Re-implemented section 5.1 from XML 1.0 spec:
|
||||
see SF bug report 570263 and SF patch 578161
|
||||
|
||||
Release 1.95.3 Mon Jun 3 2002
|
||||
- Added a project to the MSVC workspace to create a wchar_t
|
||||
version of the library; the DLLs are named libexpatw.dll.
|
||||
- Changed the name of the Windows DLLs from expat.dll to
|
||||
libexpat.dll; this fixes SF bug #432456.
|
||||
- Added the XML_ParserReset() API function.
|
||||
- Fixed XML_SetReturnNSTriplet() to work for element names.
|
||||
- Made the XML_UNICODE builds usable (thanks, Karl!).
|
||||
- Allow xmlwf to read from standard input.
|
||||
- Install a man page for xmlwf on Unix systems.
|
||||
- Fixed many bugs; see SF bug reports 231864, 461380, 464837,
|
||||
466885, 469226, 477667, 484419, 487840, 494749, 496505,
|
||||
547350. Other bugs which we can't test as easily may also
|
||||
have been fixed, especially in the area of build support.
|
||||
|
||||
Release 1.95.2 Fri Jul 27 2001
|
||||
- More changes to make MSVC happy with the build; add a single
|
||||
workspace to support both the library and xmlwf application.
|
||||
- Added a Windows installer for Windows users; includes
|
||||
xmlwf.exe.
|
||||
- Added compile-time constants that can be used to determine the
|
||||
Expat version
|
||||
- Removed a lot of GNU-specific dependencies to aide portability
|
||||
among the various Unix flavors.
|
||||
- Fix the UTF-8 BOM bug.
|
||||
- Cleaned up warning messages for several compilers.
|
||||
- Added the -Wall, -Wstrict-prototypes options for GCC.
|
||||
|
||||
Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000
|
||||
- Changes to get expat to build under Microsoft compiler
|
||||
- Removed all aborts and instead return an UNEXPECTED_STATE error.
|
||||
- Fixed a bug where a stray '%' in an entity value would cause an
|
||||
abort.
|
||||
- Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for
|
||||
finding this oversight.
|
||||
- Changed default patterns in lib/Makefile.in to fit non-GNU makes
|
||||
Thanks to robin@unrated.net for reporting and providing an
|
||||
account to test on.
|
||||
- The reference had the wrong label for XML_SetStartNamespaceDecl.
|
||||
Reported by an anonymous user.
|
||||
|
||||
Release 1.95.0 Fri Sep 29 2000
|
||||
- XML_ParserCreate_MM
|
||||
Allows you to set a memory management suite to replace the
|
||||
|
|
139
expat/README
139
expat/README
|
@ -1,50 +1,119 @@
|
|||
|
||||
Expat, Release 1.95.0
|
||||
Expat, Release 1.95.7
|
||||
|
||||
This is expat, the C library for parsing XML, written by James Clark. Expat
|
||||
is a stream oriented XML parser. This means that you register handlers with
|
||||
the parser prior to starting the parse. These handlers are called when
|
||||
the parser discovers the associated structures in the document being parsed.
|
||||
A start tag is an example of the kind of structures for which you may
|
||||
register handlers.
|
||||
This is Expat, a C library for parsing XML, written by James Clark.
|
||||
Expat is a stream-oriented XML parser. This means that you register
|
||||
handlers with the parser before starting the parse. These handlers
|
||||
are called when the parser discovers the associated structures in the
|
||||
document being parsed. A start tag is an example of the kind of
|
||||
structures for which you may register handlers.
|
||||
|
||||
Expat is free software. You may copy, distribute, and modify it under the
|
||||
terms of the License contained in the file, COPYING, distributed with this
|
||||
package. This license is the same as the MIT/X Consortium license.
|
||||
Windows users should use the expat_win32bin package, which includes
|
||||
both precompiled libraries and executalbes, and source code for
|
||||
developers.
|
||||
|
||||
Versions of expat that have an odd minor version (the middle number in the
|
||||
release above), are development releases and should be considered as
|
||||
beta software. Releases with even minor version numbers are intended to be
|
||||
production grade software.
|
||||
Expat is free software. You may copy, distribute, and modify it under
|
||||
the terms of the License contained in the file COPYING distributed
|
||||
with this package. This license is the same as the MIT/X Consortium
|
||||
license.
|
||||
|
||||
To build expat, you first run the configuration shell script in the top
|
||||
level distribution directory:
|
||||
Versions of Expat that have an odd minor version (the middle number in
|
||||
the release above), are development releases and should be considered
|
||||
as beta software. Releases with even minor version numbers are
|
||||
intended to be production grade software.
|
||||
|
||||
If you are building Expat from a check-out from the CVS repository,
|
||||
you need to run a script that generates the configure script using the
|
||||
GNU autoconf and libtool tools. To do this, you need to have
|
||||
autoconf 2.52 or newer and libtool 1.4 or newer. Run the script like
|
||||
this:
|
||||
|
||||
./buildconf.sh
|
||||
|
||||
Once this has been done, follow the same instructions as for building
|
||||
from a source distribution.
|
||||
|
||||
To build Expat from a source distribution, you first run the
|
||||
configuration shell script in the top level distribution directory:
|
||||
|
||||
./configure
|
||||
|
||||
There are many options which you may provide to configure (which you can
|
||||
discover by running configure with the --help option.) But the one of most
|
||||
interest is the one that sets the installation directory. By default,
|
||||
the configure script will set things up to install libexpat into
|
||||
/usr/local/lib and expat.h into /usr/local/include. If, for example, you'd
|
||||
prefer to install into /home/me/mystuff/lib and /home/me/mystuff/include,
|
||||
you can tell configure about that with:
|
||||
There are many options which you may provide to configure (which you
|
||||
can discover by running configure with the --help option). But the
|
||||
one of most interest is the one that sets the installation directory.
|
||||
By default, the configure script will set things up to install
|
||||
libexpat into /usr/local/lib, expat.h into /usr/local/include, and
|
||||
xmlwf into /usr/local/bin. If, for example, you'd prefer to install
|
||||
into /home/me/mystuff/lib, /home/me/mystuff/include, and
|
||||
/home/me/mystuff/bin, you can tell configure about that with:
|
||||
|
||||
./configure --prefix=/home/me/mystuff
|
||||
|
||||
After running the configure script, the "make" command will build things and
|
||||
"make install" will install things into their proper location. Note that
|
||||
you need to have write permission into the directories into which things
|
||||
will be installed.
|
||||
After running the configure script, the "make" command will build
|
||||
things and "make install" will install things into their proper
|
||||
location. Note that you need to have write permission into the
|
||||
directories into which things will be installed.
|
||||
|
||||
A reference manual is available in the doc/reference.html in this
|
||||
If you are interested in building Expat to provide document
|
||||
information in UTF-16 rather than the default UTF-8, following these
|
||||
instructions:
|
||||
|
||||
1. For UTF-16 output as unsigned short (and version/error
|
||||
strings as char), run:
|
||||
|
||||
./configure CPPFLAGS=-DXML_UNICODE
|
||||
|
||||
For UTF-16 output as wchar_t (incl. version/error strings),
|
||||
run:
|
||||
|
||||
./configure CFLAGS="-g -O2 -fshort-wchar" \
|
||||
CPPFLAGS=-DXML_UNICODE_WCHAR_T
|
||||
|
||||
2. Edit the MakeFile, changing:
|
||||
|
||||
LIBRARY = libexpat.la
|
||||
|
||||
to:
|
||||
|
||||
LIBRARY = libexpatw.la
|
||||
|
||||
(Note the additional "w" in the library name.)
|
||||
|
||||
3. Run "make buildlib" (which builds the library only).
|
||||
|
||||
4. Run "make installlib" (which installs the library only).
|
||||
|
||||
Note for Solaris users: The "ar" command is usually located in
|
||||
"/usr/ccs/bin", which is not in the default PATH. You will need to
|
||||
add this to your path for the "make" command, and probably also switch
|
||||
to GNU make (the "make" found in /usr/ccs/bin does not seem to work
|
||||
properly -- appearantly it does not understand .PHONY directives). If
|
||||
you're using ksh or bash, use this command to build:
|
||||
|
||||
PATH=/usr/ccs/bin:$PATH make
|
||||
|
||||
The unit and regression tests for Expat require the "check" library on
|
||||
Unix; more information is available at http://check.sourceforge.net/,
|
||||
and downloadable packages are available from the library's project
|
||||
page on SourceForge: http://sourceforge.net/projects/check/. You do
|
||||
not need to install the check library to build and use Expat, only to
|
||||
build and run Expat's test suite.
|
||||
|
||||
When using Expat with a project using autoconf for configuration, you
|
||||
can use the probing macro in conftools/expat.m4 to determine how to
|
||||
include Expat. See the comments at the top of that file for more
|
||||
information.
|
||||
|
||||
A reference manual is available in the file doc/reference.html in this
|
||||
distribution.
|
||||
|
||||
The homepage for this project is http://expat.sourceforge.net. There are
|
||||
links there to connect you to the bug reports page. If you need to report
|
||||
a bug when you don't have access to a browser, you may also send a bug
|
||||
report by email to expat-bugs@lists.sourceforge.net.
|
||||
The homepage for this project is http://www.libexpat.org/. There
|
||||
are links there to connect you to the bug reports page. If you need
|
||||
to report a bug when you don't have access to a browser, you may also
|
||||
send a bug report by email to expat-bugs@mail.libexpat.org.
|
||||
|
||||
Discussion related to the direction of future expat development takes place
|
||||
on expat-discuss@lists.sourceforge.net. Archives of this list may be found
|
||||
at http://www.geocrawler.com/redir-sf.php3?list=expat-discuss.
|
||||
Discussion related to the direction of future expat development takes
|
||||
place on expat-discuss@mail.libexpat.org. Archives of this list and
|
||||
other Expat-related lists may be found at:
|
||||
|
||||
http://mail.libexpat.org/mailman-21/listinfo/
|
||||
|
|
|
@ -10,18 +10,19 @@ dnl under the terms of the License (based on the MIT/X license) contained
|
|||
dnl in the file COPYING that comes with this distribution.
|
||||
dnl
|
||||
|
||||
|
||||
AC_PREREQ(2.52)
|
||||
AC_INIT(expat, 1.95.6, expat-bugs@mail.libexpat.org)
|
||||
AC_INIT(expat, 1.95.7, expat-bugs@mail.libexpat.org)
|
||||
|
||||
AC_CONFIG_SRCDIR(Makefile.in)
|
||||
AC_CONFIG_AUX_DIR(conftools)
|
||||
AM_CONFIG_HEADER(expat_config.h)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
|
||||
dnl
|
||||
dnl Increment LIBREVISION if source code has changed at all
|
||||
dnl
|
||||
|
@ -33,13 +34,15 @@ dnl
|
|||
dnl If the API changes incompatibly set LIBAGE back to 0
|
||||
dnl
|
||||
|
||||
LIBCURRENT=4
|
||||
LIBCURRENT=5
|
||||
LIBREVISION=0
|
||||
LIBAGE=4
|
||||
LIBAGE=5
|
||||
|
||||
|
||||
sinclude(conftools/libtool.m4)
|
||||
sinclude(conftools/ac_c_bigendian_cross.m4)
|
||||
|
||||
|
||||
AC_SUBST(LIBCURRENT)
|
||||
AC_SUBST(LIBREVISION)
|
||||
AC_SUBST(LIBAGE)
|
||||
|
@ -66,7 +69,6 @@ fi
|
|||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
|
||||
|
@ -75,12 +77,12 @@ dnl work in a cross compile.
|
|||
AC_C_BIGENDIAN_CROSS
|
||||
|
||||
AC_C_CONST
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_FUNCS(memmove bcopy)
|
||||
|
||||
dnl Checks for library functions.
|
||||
|
||||
AC_FUNC_MEMCMP
|
||||
dnl Only needed for xmlwf:
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h)
|
||||
AC_TYPE_OFF_T
|
||||
AC_FUNC_MMAP
|
||||
|
||||
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
|
||||
|
@ -90,9 +92,10 @@ else
|
|||
fi
|
||||
AC_SUBST(FILEMAP)
|
||||
|
||||
AC_CHECK_FUNCS(memmove bcopy)
|
||||
dnl Only needed for regression tests:
|
||||
AC_CHECK_HEADERS(check.h)
|
||||
|
||||
dnl some basic configuration
|
||||
dnl Some basic configuration:
|
||||
AC_DEFINE([XML_NS], 1,
|
||||
[Define to make XML Namespaces functionality available.])
|
||||
AC_DEFINE([XML_DTD], 1,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,26 +1,62 @@
|
|||
body {
|
||||
background-color: white
|
||||
background-color: white;
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.corner {
|
||||
width: 200px;
|
||||
height: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.banner {
|
||||
background-color: rgb(110,139,61);
|
||||
color: rgb(255,236,176);
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
.banner h1 {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0em 2em 1em 2em;
|
||||
}
|
||||
|
||||
.releaseno {
|
||||
background-color: rgb(110,139,61);
|
||||
color: rgb(255,236,176);
|
||||
padding-bottom: 0.3em;
|
||||
padding-top: 0.5em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.noborder {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
.eg {
|
||||
padding-left: 1em;
|
||||
padding-top: .5em;
|
||||
padding-bottom: .5em;
|
||||
border: solid thin;
|
||||
margin: 1em 0;
|
||||
background-color: tan;
|
||||
margin-left: 5%;
|
||||
margin-left: 2em;
|
||||
margin-right: 10%;
|
||||
}
|
||||
|
||||
.handler {
|
||||
width: 100%;
|
||||
border-top-width: thin;
|
||||
margin-left: 5%;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.handler p {
|
||||
margin-left: 3%;
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
.setter {
|
||||
|
@ -38,10 +74,17 @@ background-color: white
|
|||
}
|
||||
|
||||
.fcndef {
|
||||
margin-left: 5%;
|
||||
margin-left: 2em;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.cpp-symbols dt {
|
||||
font-family: monospace;
|
||||
}
|
||||
.cpp-symbols dd {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
/* This is simple demonstration of how to use expat. This program
|
||||
reads an XML document from standard input and writes a line with the
|
||||
name of each element to standard output indenting child elements by
|
||||
one tab stop more than their parent element. */
|
||||
reads an XML document from standard input and writes a line with
|
||||
the name of each element to standard output indenting child
|
||||
elements by one tab stop more than their parent element.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "expat.h"
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
startElement(void *userData, const char *name, const char **atts)
|
||||
{
|
||||
int i;
|
||||
|
@ -17,7 +18,7 @@ startElement(void *userData, const char *name, const char **atts)
|
|||
*depthPtr += 1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
endElement(void *userData, const char *name)
|
||||
{
|
||||
int *depthPtr = userData;
|
||||
|
@ -36,7 +37,7 @@ main(int argc, char *argv[])
|
|||
do {
|
||||
size_t len = fread(buf, 1, sizeof(buf), stdin);
|
||||
done = len < sizeof(buf);
|
||||
if (!XML_Parse(parser, buf, len, done)) {
|
||||
if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
|
||||
fprintf(stderr,
|
||||
"%s at line %d\n",
|
||||
XML_ErrorString(XML_GetErrorCode(parser)),
|
||||
|
|
|
@ -30,8 +30,9 @@ char Buff[BUFFSIZE];
|
|||
|
||||
int Depth;
|
||||
|
||||
void
|
||||
start(void *data, const char *el, const char **attr) {
|
||||
static void XMLCALL
|
||||
start(void *data, const char *el, const char **attr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Depth; i++)
|
||||
|
@ -45,14 +46,17 @@ start(void *data, const char *el, const char **attr) {
|
|||
|
||||
printf("\n");
|
||||
Depth++;
|
||||
} /* End of start handler */
|
||||
}
|
||||
|
||||
void
|
||||
end(void *data, const char *el) {
|
||||
static void XMLCALL
|
||||
end(void *data, const char *el)
|
||||
{
|
||||
Depth--;
|
||||
} /* End of end handler */
|
||||
}
|
||||
|
||||
main(int argc, char **argv) {
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
XML_Parser p = XML_ParserCreate(NULL);
|
||||
if (! p) {
|
||||
fprintf(stderr, "Couldn't allocate memory for parser\n");
|
||||
|
@ -72,7 +76,7 @@ main(int argc, char **argv) {
|
|||
}
|
||||
done = feof(stdin);
|
||||
|
||||
if (! XML_Parse(p, Buff, len, done)) {
|
||||
if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
|
||||
fprintf(stderr, "Parse error at line %d:\n%s\n",
|
||||
XML_GetCurrentLineNumber(p),
|
||||
XML_ErrorString(XML_GetErrorCode(p)));
|
||||
|
@ -82,5 +86,5 @@ main(int argc, char **argv) {
|
|||
if (done)
|
||||
break;
|
||||
}
|
||||
} /* End of main */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -16,17 +16,71 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef XMLPARSEAPI
|
||||
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
|
||||
#ifdef XML_STATIC
|
||||
#define XMLPARSEAPI(type) type __cdecl
|
||||
#else
|
||||
#define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl
|
||||
#define XML_USE_MSC_EXTENSIONS 1
|
||||
#endif
|
||||
|
||||
/* Expat tries very hard to make the API boundary very specifically
|
||||
defined. There are two macros defined to control this boundary;
|
||||
each of these can be defined before including this header to
|
||||
achieve some different behavior, but doing so it not recommended or
|
||||
tested frequently.
|
||||
|
||||
XMLCALL - The calling convention to use for all calls across the
|
||||
"library boundary." This will default to cdecl, and
|
||||
try really hard to tell the compiler that's what we
|
||||
want.
|
||||
|
||||
XMLIMPORT - Whatever magic is needed to note that a function is
|
||||
to be imported from a dynamically loaded library
|
||||
(.dll, .so, or .sl, depending on your platform).
|
||||
|
||||
The XMLCALL macro was added in Expat 1.95.7. The only one which is
|
||||
expected to be directly useful in client code is XMLCALL.
|
||||
|
||||
Note that on at least some Unix versions, the Expat library must be
|
||||
compiled with the cdecl calling convention as the default since
|
||||
system headers may assume the cdecl convention.
|
||||
*/
|
||||
#ifndef XMLCALL
|
||||
#if defined(XML_USE_MSC_EXTENSIONS)
|
||||
#define XMLCALL __cdecl
|
||||
#elif 0
|
||||
#define XMLCALL __attribute__((cdecl))
|
||||
#else
|
||||
#define XMLPARSEAPI(type) type
|
||||
/* For any platform which uses this definition and supports more than
|
||||
one calling convention, we need to extend this definition to
|
||||
declare the convention used on that platform, if it's possible to
|
||||
do so.
|
||||
|
||||
If this is the case for your platform, please file a bug report
|
||||
with information on how to identify your platform via the C
|
||||
pre-processor and how to specify the same calling convention as the
|
||||
platform's malloc() implementation.
|
||||
*/
|
||||
#define XMLCALL
|
||||
#endif
|
||||
#endif /* not defined XMLPARSEAPI */
|
||||
#endif /* not defined XMLCALL */
|
||||
|
||||
|
||||
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
|
||||
#ifndef XML_BUILDING_EXPAT
|
||||
/* using Expat from an application */
|
||||
|
||||
#ifdef XML_USE_MSC_EXTENSIONS
|
||||
#define XMLIMPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* not defined XML_STATIC */
|
||||
|
||||
/* If we didn't define it above, define it away: */
|
||||
#ifndef XMLIMPORT
|
||||
#define XMLIMPORT
|
||||
#endif
|
||||
|
||||
|
||||
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -57,6 +111,26 @@ typedef unsigned char XML_Bool;
|
|||
#define XML_TRUE ((XML_Bool) 1)
|
||||
#define XML_FALSE ((XML_Bool) 0)
|
||||
|
||||
/* The XML_Status enum gives the possible return values for several
|
||||
API functions. The preprocessor #defines are included so this
|
||||
stanza can be added to code that still needs to support older
|
||||
versions of Expat 1.95.x:
|
||||
|
||||
#ifndef XML_STATUS_OK
|
||||
#define XML_STATUS_OK 1
|
||||
#define XML_STATUS_ERROR 0
|
||||
#endif
|
||||
|
||||
Otherwise, the #define hackery is quite ugly and would have been
|
||||
dropped.
|
||||
*/
|
||||
enum XML_Status {
|
||||
XML_STATUS_ERROR = 0,
|
||||
#define XML_STATUS_ERROR XML_STATUS_ERROR
|
||||
XML_STATUS_OK = 1
|
||||
#define XML_STATUS_OK XML_STATUS_OK
|
||||
};
|
||||
|
||||
enum XML_Error {
|
||||
XML_ERROR_NONE,
|
||||
XML_ERROR_NO_MEMORY,
|
||||
|
@ -84,7 +158,8 @@ enum XML_Error {
|
|||
XML_ERROR_UNEXPECTED_STATE,
|
||||
XML_ERROR_ENTITY_DECLARED_IN_PE,
|
||||
XML_ERROR_FEATURE_REQUIRES_XML_DTD,
|
||||
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
|
||||
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
|
||||
XML_ERROR_UNBOUND_PREFIX
|
||||
};
|
||||
|
||||
enum XML_Content_Type {
|
||||
|
@ -136,15 +211,13 @@ struct XML_cp {
|
|||
description of the model argument. It's the caller's responsibility
|
||||
to free model when finished with it.
|
||||
*/
|
||||
typedef void (*XML_ElementDeclHandler) (void *userData,
|
||||
typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData,
|
||||
const XML_Char *name,
|
||||
XML_Content *model)
|
||||
/*@*/;
|
||||
XML_Content *model);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetElementDeclHandler(XML_Parser parser,
|
||||
XML_ElementDeclHandler eldecl)
|
||||
/*@modifies parser @*/;
|
||||
XML_ElementDeclHandler eldecl);
|
||||
|
||||
/* The Attlist declaration handler is called for *each* attribute. So
|
||||
a single Attlist declaration with multiple attributes declared will
|
||||
|
@ -154,18 +227,17 @@ XML_SetElementDeclHandler(XML_Parser parser,
|
|||
value will be NULL in the case of "#REQUIRED". If "isrequired" is
|
||||
true and default is non-NULL, then this is a "#FIXED" default.
|
||||
*/
|
||||
typedef void (*XML_AttlistDeclHandler) (void *userData,
|
||||
typedef void (XMLCALL *XML_AttlistDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *elname,
|
||||
const XML_Char *attname,
|
||||
const XML_Char *att_type,
|
||||
const XML_Char *dflt,
|
||||
int isrequired)
|
||||
/*@*/;
|
||||
int isrequired);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetAttlistDeclHandler(XML_Parser parser,
|
||||
XML_AttlistDeclHandler attdecl)
|
||||
/*@modifies parser @*/;
|
||||
XML_AttlistDeclHandler attdecl);
|
||||
|
||||
/* The XML declaration handler is called for *both* XML declarations
|
||||
and text declarations. The way to distinguish is that the version
|
||||
|
@ -175,31 +247,27 @@ XML_SetAttlistDeclHandler(XML_Parser parser,
|
|||
was no standalone parameter in the declaration, that it was given
|
||||
as no, or that it was given as yes.
|
||||
*/
|
||||
typedef void (*XML_XmlDeclHandler) (void *userData,
|
||||
typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData,
|
||||
const XML_Char *version,
|
||||
const XML_Char *encoding,
|
||||
int standalone)
|
||||
/*@*/;
|
||||
int standalone);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetXmlDeclHandler(XML_Parser parser,
|
||||
XML_XmlDeclHandler xmldecl)
|
||||
/*@modifies parser @*/;
|
||||
XML_XmlDeclHandler xmldecl);
|
||||
|
||||
|
||||
typedef struct {
|
||||
void *(*malloc_fcn)(size_t size);
|
||||
void *(*realloc_fcn)(void *ptr, size_t size);
|
||||
void (*free_fcn)(void *ptr);
|
||||
void *(XMLCALL *malloc_fcn)(size_t size);
|
||||
void *(XMLCALL *realloc_fcn)(void *ptr, size_t size);
|
||||
void (XMLCALL *free_fcn)(void *ptr);
|
||||
} XML_Memory_Handling_Suite;
|
||||
|
||||
/* Constructs a new parser; encoding is the encoding specified by the
|
||||
external protocol or NULL if there is none specified.
|
||||
*/
|
||||
/*@null@*/
|
||||
XMLPARSEAPI(XML_Parser)
|
||||
XML_ParserCreate(const XML_Char *encoding)
|
||||
/*@*/;
|
||||
XML_ParserCreate(const XML_Char *encoding);
|
||||
|
||||
/* Constructs a new parser and namespace processor. Element type
|
||||
names and attribute names that belong to a namespace will be
|
||||
|
@ -212,10 +280,8 @@ XML_ParserCreate(const XML_Char *encoding)
|
|||
When a namespace is not declared, the name and prefix will be
|
||||
passed through without expansion.
|
||||
*/
|
||||
/*@null@*/
|
||||
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
|
||||
|
@ -227,12 +293,10 @@ XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator)
|
|||
All further memory operations used for the created parser will come from
|
||||
the given suite.
|
||||
*/
|
||||
/*@null@*/
|
||||
XMLPARSEAPI(XML_Parser)
|
||||
XML_ParserCreate_MM(const XML_Char *encoding,
|
||||
/*@null@*/ const XML_Memory_Handling_Suite *memsuite,
|
||||
/*@null@*/ const XML_Char *namespaceSeparator)
|
||||
/*@*/;
|
||||
const XML_Memory_Handling_Suite *memsuite,
|
||||
const XML_Char *namespaceSeparator);
|
||||
|
||||
/* Prepare a parser object to be re-used. This is particularly
|
||||
valuable when memory allocation overhead is disproportionatly high,
|
||||
|
@ -244,42 +308,36 @@ XML_ParserCreate_MM(const XML_Char *encoding,
|
|||
Added in Expat 1.95.3.
|
||||
*/
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_ParserReset(XML_Parser parser, const XML_Char *encoding)
|
||||
/*@modifies parser @*/;
|
||||
XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
|
||||
|
||||
/* atts is array of name/value pairs, terminated by 0;
|
||||
names and values are 0 terminated.
|
||||
*/
|
||||
typedef void (*XML_StartElementHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_StartElementHandler) (void *userData,
|
||||
const XML_Char *name,
|
||||
const XML_Char **atts)
|
||||
/*@*/;
|
||||
const XML_Char **atts);
|
||||
|
||||
typedef void (*XML_EndElementHandler)(void *userData,
|
||||
const XML_Char *name)
|
||||
/*@*/;
|
||||
typedef void (XMLCALL *XML_EndElementHandler) (void *userData,
|
||||
const XML_Char *name);
|
||||
|
||||
|
||||
/* s is not 0 terminated. */
|
||||
typedef void (*XML_CharacterDataHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData,
|
||||
const XML_Char *s,
|
||||
int len)
|
||||
/*@*/;
|
||||
int len);
|
||||
|
||||
/* target and data are 0 terminated */
|
||||
typedef void (*XML_ProcessingInstructionHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_ProcessingInstructionHandler) (
|
||||
void *userData,
|
||||
const XML_Char *target,
|
||||
const XML_Char *data)
|
||||
/*@*/;
|
||||
const XML_Char *data);
|
||||
|
||||
/* data is 0 terminated */
|
||||
typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data)
|
||||
/*@*/;
|
||||
typedef void (XMLCALL *XML_CommentHandler) (void *userData,
|
||||
const XML_Char *data);
|
||||
|
||||
typedef void (*XML_StartCdataSectionHandler)(void *userData)
|
||||
/*@*/;
|
||||
typedef void (*XML_EndCdataSectionHandler)(void *userData)
|
||||
/*@*/;
|
||||
typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData);
|
||||
typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData);
|
||||
|
||||
/* This is called for any characters in the XML document for which
|
||||
there is no applicable handler. This includes both characters that
|
||||
|
@ -294,27 +352,25 @@ typedef void (*XML_EndCdataSectionHandler)(void *userData)
|
|||
default handler: for example, a comment might be split between
|
||||
multiple calls.
|
||||
*/
|
||||
typedef void (*XML_DefaultHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_DefaultHandler) (void *userData,
|
||||
const XML_Char *s,
|
||||
int len)
|
||||
/*@*/;
|
||||
int len);
|
||||
|
||||
/* This is called for the start of the DOCTYPE declaration, before
|
||||
any DTD or internal subset is parsed.
|
||||
*/
|
||||
typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_StartDoctypeDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *doctypeName,
|
||||
const XML_Char *sysid,
|
||||
const XML_Char *pubid,
|
||||
int has_internal_subset)
|
||||
/*@*/;
|
||||
int has_internal_subset);
|
||||
|
||||
/* This is called for the start of the DOCTYPE declaration when the
|
||||
closing > is encountered, but after processing any external
|
||||
subset.
|
||||
*/
|
||||
typedef void (*XML_EndDoctypeDeclHandler)(void *userData)
|
||||
/*@*/;
|
||||
typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
|
||||
|
||||
/* This is called for entity declarations. The is_parameter_entity
|
||||
argument will be non-zero if the entity is a parameter entity, zero
|
||||
|
@ -334,7 +390,8 @@ typedef void (*XML_EndDoctypeDeclHandler)(void *userData)
|
|||
Note that is_parameter_entity can't be changed to XML_Bool, since
|
||||
that would break binary compatibility.
|
||||
*/
|
||||
typedef void (*XML_EntityDeclHandler) (void *userData,
|
||||
typedef void (XMLCALL *XML_EntityDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *entityName,
|
||||
int is_parameter_entity,
|
||||
const XML_Char *value,
|
||||
|
@ -342,13 +399,11 @@ typedef void (*XML_EntityDeclHandler) (void *userData,
|
|||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId,
|
||||
const XML_Char *notationName)
|
||||
/*@*/;
|
||||
const XML_Char *notationName);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetEntityDeclHandler(XML_Parser parser,
|
||||
XML_EntityDeclHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_EntityDeclHandler handler);
|
||||
|
||||
/* OBSOLETE -- OBSOLETE -- OBSOLETE
|
||||
This handler has been superceded by the EntityDeclHandler above.
|
||||
|
@ -359,24 +414,24 @@ XML_SetEntityDeclHandler(XML_Parser parser,
|
|||
entityName, systemId and notationName arguments will never be
|
||||
NULL. The other arguments may be.
|
||||
*/
|
||||
typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *entityName,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId,
|
||||
const XML_Char *notationName)
|
||||
/*@*/;
|
||||
const XML_Char *notationName);
|
||||
|
||||
/* This is called for a declaration of notation. The base argument is
|
||||
whatever was set by XML_SetBase. The notationName will never be
|
||||
NULL. The other arguments can be.
|
||||
*/
|
||||
typedef void (*XML_NotationDeclHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_NotationDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *notationName,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
/*@*/;
|
||||
const XML_Char *publicId);
|
||||
|
||||
/* When namespace processing is enabled, these are called once for
|
||||
each namespace declaration. The call to the start and end element
|
||||
|
@ -384,14 +439,14 @@ typedef void (*XML_NotationDeclHandler)(void *userData,
|
|||
declaration handlers. For an xmlns attribute, prefix will be
|
||||
NULL. For an xmlns="" attribute, uri will be NULL.
|
||||
*/
|
||||
typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_StartNamespaceDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *prefix,
|
||||
const XML_Char *uri)
|
||||
/*@*/;
|
||||
const XML_Char *uri);
|
||||
|
||||
typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
|
||||
const XML_Char *prefix)
|
||||
/*@*/;
|
||||
typedef void (XMLCALL *XML_EndNamespaceDeclHandler) (
|
||||
void *userData,
|
||||
const XML_Char *prefix);
|
||||
|
||||
/* This is called if the document is not standalone, that is, it has an
|
||||
external subset or a reference to a parameter entity, but does not
|
||||
|
@ -402,8 +457,7 @@ typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
|
|||
conditions above this handler will only be called if the referenced
|
||||
entity was actually read.
|
||||
*/
|
||||
typedef int (*XML_NotStandaloneHandler)(void *userData)
|
||||
/*@*/;
|
||||
typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData);
|
||||
|
||||
/* This is called for a reference to an external parsed general
|
||||
entity. The referenced entity is not automatically parsed. The
|
||||
|
@ -439,12 +493,12 @@ typedef int (*XML_NotStandaloneHandler)(void *userData)
|
|||
Note that unlike other handlers the first argument is the parser,
|
||||
not userData.
|
||||
*/
|
||||
typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
|
||||
typedef int (XMLCALL *XML_ExternalEntityRefHandler) (
|
||||
XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *base,
|
||||
const XML_Char *systemId,
|
||||
const XML_Char *publicId)
|
||||
/*@*/;
|
||||
const XML_Char *publicId);
|
||||
|
||||
/* This is called in two situations:
|
||||
1) An entity reference is encountered for which no declaration
|
||||
|
@ -456,10 +510,10 @@ typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
|
|||
the event would be out of sync with the reporting of the
|
||||
declarations or attribute values
|
||||
*/
|
||||
typedef void (*XML_SkippedEntityHandler)(void *userData,
|
||||
typedef void (XMLCALL *XML_SkippedEntityHandler) (
|
||||
void *userData,
|
||||
const XML_Char *entityName,
|
||||
int is_parameter_entity)
|
||||
/*@*/;
|
||||
int is_parameter_entity);
|
||||
|
||||
/* This structure is filled in by the XML_UnknownEncodingHandler to
|
||||
provide information to the parser about encodings that are unknown
|
||||
|
@ -516,8 +570,8 @@ typedef void (*XML_SkippedEntityHandler)(void *userData,
|
|||
typedef struct {
|
||||
int map[256];
|
||||
void *data;
|
||||
int (*convert)(void *data, const char *s);
|
||||
void (*release)(void *data);
|
||||
int (XMLCALL *convert)(void *data, const char *s);
|
||||
void (XMLCALL *release)(void *data);
|
||||
} XML_Encoding;
|
||||
|
||||
/* This is called for an encoding that is unknown to the parser.
|
||||
|
@ -535,54 +589,45 @@ typedef struct {
|
|||
If info does not describe a suitable encoding, then the parser will
|
||||
return an XML_UNKNOWN_ENCODING error.
|
||||
*/
|
||||
typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
|
||||
typedef int (XMLCALL *XML_UnknownEncodingHandler) (
|
||||
void *encodingHandlerData,
|
||||
const XML_Char *name,
|
||||
XML_Encoding *info)
|
||||
/*@*/;
|
||||
XML_Encoding *info);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetElementHandler(XML_Parser parser,
|
||||
XML_StartElementHandler start,
|
||||
XML_EndElementHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndElementHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetCharacterDataHandler(XML_Parser parser,
|
||||
XML_CharacterDataHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_CharacterDataHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetProcessingInstructionHandler(XML_Parser parser,
|
||||
XML_ProcessingInstructionHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_ProcessingInstructionHandler handler);
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetCommentHandler(XML_Parser parser,
|
||||
XML_CommentHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_CommentHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetCdataSectionHandler(XML_Parser parser,
|
||||
XML_StartCdataSectionHandler start,
|
||||
XML_EndCdataSectionHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndCdataSectionHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetStartCdataSectionHandler(XML_Parser parser,
|
||||
XML_StartCdataSectionHandler start)
|
||||
/*@modifies parser @*/;
|
||||
XML_StartCdataSectionHandler start);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetEndCdataSectionHandler(XML_Parser parser,
|
||||
XML_EndCdataSectionHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndCdataSectionHandler end);
|
||||
|
||||
/* This sets the default handler and also inhibits expansion of
|
||||
internal entities. These entity references will be passed to the
|
||||
|
@ -590,8 +635,7 @@ XML_SetEndCdataSectionHandler(XML_Parser parser,
|
|||
*/
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetDefaultHandler(XML_Parser parser,
|
||||
XML_DefaultHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
/* This sets the default handler but does not inhibit expansion of
|
||||
internal entities. The entity reference will not be passed to the
|
||||
|
@ -599,87 +643,72 @@ XML_SetDefaultHandler(XML_Parser parser,
|
|||
*/
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetDefaultHandlerExpand(XML_Parser parser,
|
||||
XML_DefaultHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_DefaultHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetDoctypeDeclHandler(XML_Parser parser,
|
||||
XML_StartDoctypeDeclHandler start,
|
||||
XML_EndDoctypeDeclHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndDoctypeDeclHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetStartDoctypeDeclHandler(XML_Parser parser,
|
||||
XML_StartDoctypeDeclHandler start)
|
||||
/*@modifies parser @*/;
|
||||
XML_StartDoctypeDeclHandler start);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetEndDoctypeDeclHandler(XML_Parser parser,
|
||||
XML_EndDoctypeDeclHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndDoctypeDeclHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
|
||||
XML_UnparsedEntityDeclHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_UnparsedEntityDeclHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetNotationDeclHandler(XML_Parser parser,
|
||||
XML_NotationDeclHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_NotationDeclHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_StartNamespaceDeclHandler start,
|
||||
XML_EndNamespaceDeclHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndNamespaceDeclHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetStartNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_StartNamespaceDeclHandler start)
|
||||
/*@modifies parser @*/;
|
||||
XML_StartNamespaceDeclHandler start);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetEndNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_EndNamespaceDeclHandler end)
|
||||
/*@modifies parser @*/;
|
||||
XML_EndNamespaceDeclHandler end);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetNotStandaloneHandler(XML_Parser parser,
|
||||
XML_NotStandaloneHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_NotStandaloneHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetExternalEntityRefHandler(XML_Parser parser,
|
||||
XML_ExternalEntityRefHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_ExternalEntityRefHandler handler);
|
||||
|
||||
/* If a non-NULL value for arg is specified here, then it will be
|
||||
passed as the first argument to the external entity ref handler
|
||||
instead of the parser object.
|
||||
*/
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetSkippedEntityHandler(XML_Parser parser,
|
||||
XML_SkippedEntityHandler handler)
|
||||
/*@modifies parser @*/;
|
||||
XML_SkippedEntityHandler handler);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetUnknownEncodingHandler(XML_Parser parser,
|
||||
XML_UnknownEncodingHandler handler,
|
||||
void *encodingHandlerData)
|
||||
/*@modifies parser @*/;
|
||||
void *encodingHandlerData);
|
||||
|
||||
/* This can be called within a handler for a start element, end
|
||||
element, processing instruction or character data. It causes the
|
||||
corresponding markup to be passed to the default handler.
|
||||
*/
|
||||
XMLPARSEAPI(void)
|
||||
XML_DefaultCurrent(XML_Parser parser)
|
||||
/*@modifies parser @*/;
|
||||
XML_DefaultCurrent(XML_Parser parser);
|
||||
|
||||
/* If do_nst is non-zero, and namespace processing is in effect, and
|
||||
a name has a prefix (i.e. an explicit namespace qualifier) then
|
||||
|
@ -696,13 +725,11 @@ XML_DefaultCurrent(XML_Parser parser)
|
|||
*/
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetReturnNSTriplet(XML_Parser parser, int do_nst)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
|
||||
|
||||
/* This value is passed as the userData argument to callbacks. */
|
||||
XMLPARSEAPI(void)
|
||||
XML_SetUserData(XML_Parser parser, void *userData)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetUserData(XML_Parser parser, void *userData);
|
||||
|
||||
/* Returns the last value set by XML_SetUserData or NULL. */
|
||||
#define XML_GetUserData(parser) (*(void **)(parser))
|
||||
|
@ -714,16 +741,14 @@ XML_SetUserData(XML_Parser parser, void *userData)
|
|||
has no effect and returns XML_STATUS_ERROR.
|
||||
*/
|
||||
XMLPARSEAPI(enum XML_Status)
|
||||
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
|
||||
|
||||
/* If this function is called, then the parser will be passed as the
|
||||
first argument to callbacks instead of userData. The userData will
|
||||
still be accessible using XML_GetUserData.
|
||||
*/
|
||||
XMLPARSEAPI(void)
|
||||
XML_UseParserAsHandlerArg(XML_Parser parser)
|
||||
/*@modifies parser @*/;
|
||||
XML_UseParserAsHandlerArg(XML_Parser parser);
|
||||
|
||||
/* If useDTD == XML_TRUE is passed to this function, then the parser
|
||||
will assume that there is an external subset, even if none is
|
||||
|
@ -741,8 +766,7 @@ XML_UseParserAsHandlerArg(XML_Parser parser)
|
|||
XML_ERROR_FEATURE_REQUIRES_XML_DTD.
|
||||
*/
|
||||
XMLPARSEAPI(enum XML_Error)
|
||||
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
|
||||
/*@modifies parser @*/;
|
||||
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
|
||||
|
||||
|
||||
/* Sets the base to be used for resolving relative URIs in system
|
||||
|
@ -754,12 +778,10 @@ XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
|
|||
XML_STATUS_OK otherwise.
|
||||
*/
|
||||
XMLPARSEAPI(enum XML_Status)
|
||||
XML_SetBase(XML_Parser parser, const XML_Char *base)
|
||||
/*@modifies parser @*/;
|
||||
XML_SetBase(XML_Parser parser, const XML_Char *base);
|
||||
|
||||
XMLPARSEAPI(const XML_Char *)
|
||||
XML_GetBase(XML_Parser parser)
|
||||
/*@*/;
|
||||
XML_GetBase(XML_Parser parser);
|
||||
|
||||
/* Returns the number of the attribute/value pairs passed in last call
|
||||
to the XML_StartElementHandler that were specified in the start-tag
|
||||
|
@ -768,8 +790,7 @@ XML_GetBase(XML_Parser parser)
|
|||
XML_StartElementHandler.
|
||||
*/
|
||||
XMLPARSEAPI(int)
|
||||
XML_GetSpecifiedAttributeCount(XML_Parser parser)
|
||||
/*@*/;
|
||||
XML_GetSpecifiedAttributeCount(XML_Parser parser);
|
||||
|
||||
/* Returns the index of the ID attribute passed in the last call to
|
||||
XML_StartElementHandler, or -1 if there is no ID attribute. Each
|
||||
|
@ -777,47 +798,25 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser)
|
|||
index into the atts array passed to the XML_StartElementHandler.
|
||||
*/
|
||||
XMLPARSEAPI(int)
|
||||
XML_GetIdAttributeIndex(XML_Parser parser)
|
||||
/*@*/;
|
||||
XML_GetIdAttributeIndex(XML_Parser parser);
|
||||
|
||||
/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
|
||||
detected. The last call to XML_Parse must have isFinal true; len
|
||||
may be zero for this call (or any other).
|
||||
|
||||
The XML_Status enum gives the possible return values for the
|
||||
XML_Parse and XML_ParseBuffer functions. Though the return values
|
||||
for these functions has always been described as a Boolean value,
|
||||
the implementation, at least for the 1.95.x series, has always
|
||||
returned exactly one of these values. The preprocessor #defines
|
||||
are included so this stanza can be added to code that still needs
|
||||
to support older versions of Expat 1.95.x:
|
||||
|
||||
#ifndef XML_STATUS_OK
|
||||
#define XML_STATUS_OK 1
|
||||
#define XML_STATUS_ERROR 0
|
||||
#endif
|
||||
|
||||
Otherwise, the #define hackery is quite ugly and would have been dropped.
|
||||
Though the return values for these functions has always been
|
||||
described as a Boolean value, the implementation, at least for the
|
||||
1.95.x series, has always returned exactly one of the XML_Status
|
||||
values.
|
||||
*/
|
||||
enum XML_Status {
|
||||
XML_STATUS_ERROR = 0,
|
||||
#define XML_STATUS_ERROR XML_STATUS_ERROR
|
||||
XML_STATUS_OK = 1
|
||||
#define XML_STATUS_OK XML_STATUS_OK
|
||||
};
|
||||
|
||||
XMLPARSEAPI(enum XML_Status)
|
||||
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
|
||||
/*@modifies parser @*/;
|
||||
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
|
||||
|
||||
/*@null@*/
|
||||
XMLPARSEAPI(void *)
|
||||
XML_GetBuffer(XML_Parser parser, int len)
|
||||
/*@modifies parser @*/;
|
||||
XML_GetBuffer(XML_Parser parser, int len);
|
||||
|
||||
XMLPARSEAPI(enum XML_Status)
|
||||
XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
|
||||
/*@modifies parser @*/;
|
||||
XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
|
||||
|
||||
/* Creates an XML_Parser object that can parse an external general
|
||||
entity; context is a '\0'-terminated string specifying the parse
|
||||
|
@ -835,12 +834,10 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
|
|||
initialized from the parser argument. Returns NULL if out of memory.
|
||||
Otherwise returns a new XML_Parser object.
|
||||
*/
|
||||
/*@null@*/
|
||||
XMLPARSEAPI(XML_Parser)
|
||||
XML_ExternalEntityParserCreate(XML_Parser parser,
|
||||
const XML_Char *context,
|
||||
const XML_Char *encoding)
|
||||
/*@*/;
|
||||
const XML_Char *encoding);
|
||||
|
||||
enum XML_ParamEntityParsing {
|
||||
XML_PARAM_ENTITY_PARSING_NEVER,
|
||||
|
@ -873,20 +870,23 @@ enum XML_ParamEntityParsing {
|
|||
*/
|
||||
XMLPARSEAPI(int)
|
||||
XML_SetParamEntityParsing(XML_Parser parser,
|
||||
enum XML_ParamEntityParsing parsing)
|
||||
/*@modifies parser @*/;
|
||||
enum XML_ParamEntityParsing parsing);
|
||||
|
||||
/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
|
||||
XML_GetErrorCode returns information about the error.
|
||||
*/
|
||||
XMLPARSEAPI(enum XML_Error)
|
||||
XML_GetErrorCode(XML_Parser parser)
|
||||
/*@*/;
|
||||
XML_GetErrorCode(XML_Parser parser);
|
||||
|
||||
/* These functions return information about the current parse
|
||||
location. They may be called from any callback called to report
|
||||
some parse event; in this case the location is the location of
|
||||
the first of the sequence of characters that generated the event.
|
||||
some parse event; in this case the location is the location of the
|
||||
first of the sequence of characters that generated the event. When
|
||||
called from callbacks generated by declarations in the document
|
||||
prologue, the location identified isn't as neatly defined, but will
|
||||
be within the relevant markup. When called outside of the callback
|
||||
functions, the position indicated will be just past the last parse
|
||||
event (regardless of whether there was an associated callback).
|
||||
|
||||
They may also be called after returning from a call to XML_Parse
|
||||
or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then
|
||||
|
@ -894,19 +894,15 @@ XML_GetErrorCode(XML_Parser parser)
|
|||
was detected; otherwise the location is the location of the last
|
||||
parse event, as described above.
|
||||
*/
|
||||
XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser)
|
||||
/*@modifies parser @*/;
|
||||
XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser)
|
||||
/*@modifies parser @*/;
|
||||
XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser)
|
||||
/*@*/;
|
||||
XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
|
||||
XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
|
||||
XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
|
||||
|
||||
/* Return the number of bytes in the current event.
|
||||
Returns 0 if the event is in an internal entity.
|
||||
*/
|
||||
XMLPARSEAPI(int)
|
||||
XML_GetCurrentByteCount(XML_Parser parser)
|
||||
/*@*/;
|
||||
XML_GetCurrentByteCount(XML_Parser parser);
|
||||
|
||||
/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
|
||||
the integer pointed to by offset to the offset within this buffer
|
||||
|
@ -918,12 +914,10 @@ XML_GetCurrentByteCount(XML_Parser parser)
|
|||
NOTE: The character pointer returned should not be used outside
|
||||
the handler that makes the call.
|
||||
*/
|
||||
/*@null@*/
|
||||
XMLPARSEAPI(const char *)
|
||||
XML_GetInputContext(XML_Parser parser,
|
||||
/*@out@*/ int *offset,
|
||||
/*@out@*/ int *size)
|
||||
/*@modifies *offset, *size @*/;
|
||||
int *offset,
|
||||
int *size);
|
||||
|
||||
/* For backwards compatibility with previous versions. */
|
||||
#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
|
||||
|
@ -932,38 +926,29 @@ XML_GetInputContext(XML_Parser parser,
|
|||
|
||||
/* Frees the content model passed to the element declaration handler */
|
||||
XMLPARSEAPI(void)
|
||||
XML_FreeContentModel(XML_Parser parser, XML_Content *model)
|
||||
/*@*/;
|
||||
XML_FreeContentModel(XML_Parser parser, XML_Content *model);
|
||||
|
||||
/* Exposing the memory handling functions used in Expat */
|
||||
XMLPARSEAPI(void *)
|
||||
XML_MemMalloc(XML_Parser parser, size_t size)
|
||||
/*@*/;
|
||||
XML_MemMalloc(XML_Parser parser, size_t size);
|
||||
|
||||
XMLPARSEAPI(void *)
|
||||
XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
|
||||
/*@*/;
|
||||
XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
|
||||
|
||||
XMLPARSEAPI(void)
|
||||
XML_MemFree(XML_Parser parser, void *ptr)
|
||||
/*@*/;
|
||||
XML_MemFree(XML_Parser parser, void *ptr);
|
||||
|
||||
/* Frees memory used by the parser. */
|
||||
XMLPARSEAPI(void)
|
||||
XML_ParserFree(/*@only@*/ XML_Parser parser)
|
||||
/*@modifies parser @*/;
|
||||
XML_ParserFree(XML_Parser parser);
|
||||
|
||||
/* Returns a string describing the error. */
|
||||
/*@observer@*/ /*@null@*/
|
||||
XMLPARSEAPI(const XML_LChar *)
|
||||
XML_ErrorString(enum XML_Error code)
|
||||
/*@*/;
|
||||
XML_ErrorString(enum XML_Error code);
|
||||
|
||||
/* Return a string containing the version number of this expat */
|
||||
/*@observer@*/
|
||||
XMLPARSEAPI(const XML_LChar *)
|
||||
XML_ExpatVersion(void)
|
||||
/*@*/;
|
||||
XML_ExpatVersion(void);
|
||||
|
||||
typedef struct {
|
||||
int major;
|
||||
|
@ -975,8 +960,7 @@ typedef struct {
|
|||
number information for this version of expat.
|
||||
*/
|
||||
XMLPARSEAPI(XML_Expat_Version)
|
||||
XML_ExpatVersionInfo(void)
|
||||
/*@*/;
|
||||
XML_ExpatVersionInfo(void);
|
||||
|
||||
/* Added in Expat 1.95.5. */
|
||||
enum XML_FeatureEnum {
|
||||
|
@ -993,15 +977,12 @@ enum XML_FeatureEnum {
|
|||
|
||||
typedef struct {
|
||||
enum XML_FeatureEnum feature;
|
||||
/*@observer@*/
|
||||
const XML_LChar *name;
|
||||
long int value;
|
||||
} XML_Feature;
|
||||
|
||||
/*@observer@*/
|
||||
XMLPARSEAPI(const XML_Feature *)
|
||||
XML_GetFeatureList(void)
|
||||
/*@*/;
|
||||
XML_GetFeatureList(void);
|
||||
|
||||
|
||||
/* Expat follows the GNU/Linux convention of odd number minor version for
|
||||
|
@ -1011,7 +992,7 @@ XML_GetFeatureList(void)
|
|||
*/
|
||||
#define XML_MAJOR_VERSION 1
|
||||
#define XML_MINOR_VERSION 95
|
||||
#define XML_MICRO_VERSION 6
|
||||
#define XML_MICRO_VERSION 7
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -3,32 +3,59 @@
|
|||
Internal definitions used by Expat. This is not needed to compile
|
||||
client code.
|
||||
|
||||
The following definitions are made:
|
||||
The following calling convention macros are defined for frequently
|
||||
called functions:
|
||||
|
||||
FASTCALL -- Used for most internal functions to specify that the
|
||||
fastest possible calling convention be used.
|
||||
FASTCALL - Used for those internal functions that have a simple
|
||||
body and a low number of arguments and local variables.
|
||||
|
||||
inline -- Used for selected internal functions for which inlining
|
||||
PTRCALL - Used for functions called though function pointers.
|
||||
|
||||
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
|
||||
|
||||
inline - Used for selected internal functions for which inlining
|
||||
may improve performance on some platforms.
|
||||
|
||||
Note: Use of these macros is based on judgement, not hard rules,
|
||||
and therefore subject to change.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
/* Last minute instability reported with egcs on a RedHat Linux 7.3
|
||||
box; argh!
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
/* We'll use this version by default only where we know it helps.
|
||||
|
||||
regparm() generates warnings on Solaris boxes. See SF bug #692878.
|
||||
|
||||
Instability reported with egcs on a RedHat Linux 7.3.
|
||||
Let's comment out:
|
||||
#define FASTCALL __attribute__((stdcall, regparm(3)))
|
||||
and let's try this:
|
||||
*/
|
||||
/* #define FASTCALL __attribute__((stdcall, regparm(3))) */
|
||||
#elif defined(WIN32)
|
||||
/* XXX This seems to have an unexpected negative effect on Windows so
|
||||
we'll disable it for now on that platform. It may be reconsidered
|
||||
for a future release if it can be made more effective.
|
||||
*/
|
||||
/* #define FASTCALL __fastcall */
|
||||
#define FASTCALL __attribute__((regparm(3)))
|
||||
#define PTRFASTCALL __attribute__((regparm(3)))
|
||||
#endif
|
||||
|
||||
/* Using __fastcall seems to have an unexpected negative effect under
|
||||
MS VC++, especially for function pointers, so we won't use it for
|
||||
now on that platform. It may be reconsidered for a future release
|
||||
if it can be made more effective.
|
||||
Likely reason: __fastcall on Windows is like stdcall, therefore
|
||||
the compiler cannot perform stack optimizations for call clusters.
|
||||
*/
|
||||
|
||||
/* Make sure all of these are defined if they aren't already. */
|
||||
|
||||
#ifndef FASTCALL
|
||||
#define FASTCALL
|
||||
#endif
|
||||
|
||||
#ifndef PTRCALL
|
||||
#define PTRCALL
|
||||
#endif
|
||||
|
||||
#ifndef PTRFASTCALL
|
||||
#define PTRFASTCALL
|
||||
#endif
|
||||
|
||||
#ifndef XML_MIN_SIZE
|
||||
#if !defined(__cplusplus) && !defined(inline)
|
||||
#ifdef __GNUC__
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,9 @@
|
|||
#elif defined(MACOS_CLASSIC)
|
||||
#include "macconfig.h"
|
||||
#else
|
||||
#include <expat_config.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#endif /* ndef COMPILED_FROM_DSP */
|
||||
|
||||
#include "internal.h"
|
||||
|
|
|
@ -100,10 +100,10 @@ typedef struct prolog_state {
|
|||
#endif /* XML_DTD */
|
||||
} PROLOG_STATE;
|
||||
|
||||
void XmlPrologStateInit(PROLOG_STATE *state)
|
||||
void XmlPrologStateInit(PROLOG_STATE *)
|
||||
/*@modifies state @*/;
|
||||
#ifdef XML_DTD
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *state)
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *)
|
||||
/*@modifies state @*/;
|
||||
#endif /* XML_DTD */
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
#elif defined(MACOS_CLASSIC)
|
||||
#include "macconfig.h"
|
||||
#else
|
||||
#include <expat_config.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#endif /* ndef COMPILED_FROM_DSP */
|
||||
|
||||
#include "internal.h"
|
||||
|
@ -290,6 +292,7 @@ sb_byteToAscii(const ENCODING *enc, const char *p)
|
|||
(AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c))
|
||||
static int PTRCALL
|
||||
sb_charMatches(const ENCODING *enc, const char *p, int c)
|
||||
/*@*/
|
||||
{
|
||||
return *p == c;
|
||||
}
|
||||
|
@ -322,7 +325,6 @@ static void PTRCALL
|
|||
utf8_toUtf8(const ENCODING *enc,
|
||||
const char **fromP, const char *fromLim,
|
||||
char **toP, const char *toLim)
|
||||
/*@modifies *fromP, *toP @*/
|
||||
{
|
||||
char *to;
|
||||
const char *from;
|
||||
|
@ -342,7 +344,6 @@ static void PTRCALL
|
|||
utf8_toUtf16(const ENCODING *enc,
|
||||
const char **fromP, const char *fromLim,
|
||||
unsigned short **toP, const unsigned short *toLim)
|
||||
/*@modifies *fromP, *toP @*/
|
||||
{
|
||||
unsigned short *to = *toP;
|
||||
const char *from = *fromP;
|
||||
|
@ -733,6 +734,7 @@ little2_isNmstrtMin(const ENCODING *enc, const char *p)
|
|||
|
||||
#ifdef XML_NS
|
||||
|
||||
/*@unchecked@*/ /*@observer@*/
|
||||
static const struct normal_encoding little2_encoding_ns = {
|
||||
{ VTABLE, 2, 0,
|
||||
#if BYTEORDER == 1234
|
||||
|
@ -821,7 +823,6 @@ big2_byteType(const ENCODING *enc, const char *p)
|
|||
|
||||
static int PTRFASTCALL
|
||||
big2_byteToAscii(const ENCODING *enc, const char *p)
|
||||
/*@*/
|
||||
{
|
||||
return BIG2_BYTE_TO_ASCII(enc, p);
|
||||
}
|
||||
|
@ -1133,6 +1134,7 @@ doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *,
|
|||
/*@null@*/ int *standalone)
|
||||
/*@modifies ptr, *badPtr, *versionPtr, *versionEndPtr,
|
||||
*encodingName, *encoding, *standalone @*/
|
||||
|
||||
{
|
||||
const char *val = NULL;
|
||||
const char *name = NULL;
|
||||
|
@ -1517,7 +1519,6 @@ static int FASTCALL
|
|||
getEncodingIndex(/*@null@*/ const char *name)
|
||||
/*@*/
|
||||
{
|
||||
/*@unchecked@*/ /*@observer@*/
|
||||
static const char *encodingNames[] = {
|
||||
KW_ISO_8859_1,
|
||||
KW_US_ASCII,
|
||||
|
@ -1557,7 +1558,6 @@ initScan(const ENCODING **encodingTable,
|
|||
const char *ptr,
|
||||
const char *end,
|
||||
const char **nextTokPtr)
|
||||
/*@modifies enc, *nextTokPtr @*/
|
||||
{
|
||||
const ENCODING **encPtr;
|
||||
|
||||
|
|
|
@ -152,7 +152,8 @@ struct encoding {
|
|||
int attsMax,
|
||||
ATTRIBUTE *atts)
|
||||
/*@*/;
|
||||
int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
|
||||
int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr)
|
||||
/*@*/;
|
||||
int (PTRCALL *predefinedEntityName)(const ENCODING *,
|
||||
const char *,
|
||||
const char *)
|
||||
|
@ -283,26 +284,25 @@ int XmlParseXmlDecl(int isGeneralTextEntity,
|
|||
const char **versionEndPtr,
|
||||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr,
|
||||
int *standalonePtr);
|
||||
int *standalonePtr)
|
||||
/*@*/;
|
||||
|
||||
int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr,
|
||||
/*@null@*/ const char *name)
|
||||
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name)
|
||||
/*@modifies p, *encPtr @*/;
|
||||
const ENCODING *XmlGetUtf8InternalEncoding(void)
|
||||
/*@*/;
|
||||
const ENCODING *XmlGetUtf16InternalEncoding(void)
|
||||
/*@*/;
|
||||
int FASTCALL XmlUtf8Encode(int charNumber, char *buf)
|
||||
/*@modifies buf @*/;
|
||||
/*@*/;
|
||||
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf)
|
||||
/*@modifies buf @*/;
|
||||
/*@*/;
|
||||
int XmlSizeOfUnknownEncoding(void)
|
||||
/*@*/;
|
||||
|
||||
typedef int (*CONVERTER)(void *userData, const char *p)
|
||||
/*@*/;
|
||||
|
||||
/*@null@*/
|
||||
ENCODING *
|
||||
XmlInitUnknownEncoding(void *mem,
|
||||
int *table,
|
||||
|
@ -333,8 +333,7 @@ ENCODING *
|
|||
XmlInitUnknownEncodingNS(void *mem,
|
||||
int *table,
|
||||
CONVERTER convert,
|
||||
void *userData)
|
||||
/*@modifies mem @*/;
|
||||
void *userData);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -898,7 +898,7 @@ PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
|
|||
/*@modifies *nextTokPtr @*/
|
||||
{
|
||||
if (ptr == end)
|
||||
return XML_TOK_PARTIAL;
|
||||
return -XML_TOK_PERCENT;
|
||||
switch (BYTE_TYPE(enc, ptr)) {
|
||||
CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
|
||||
case BT_S: case BT_LF: case BT_CR: case BT_PERCNT:
|
||||
|
@ -1427,7 +1427,6 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
|
|||
case BT_NMSTRT:
|
||||
if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
|
||||
break;
|
||||
/*@fallthrough@*/
|
||||
default:
|
||||
switch (BYTE_TO_ASCII(enc, ptr)) {
|
||||
case 0x24: /* $ */
|
||||
|
@ -1448,7 +1447,6 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
|
|||
first attsMax attributes are stored in atts.
|
||||
*/
|
||||
|
||||
/*@-mods@*/
|
||||
static int PTRCALL
|
||||
PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
|
||||
int attsMax, ATTRIBUTE *atts)
|
||||
|
@ -1542,7 +1540,6 @@ PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
|
|||
}
|
||||
/*@notreached@*/
|
||||
}
|
||||
/*@=mods@*/
|
||||
|
||||
static int PTRFASTCALL
|
||||
PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
|
||||
|
@ -1656,7 +1653,7 @@ PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
|
|||
return 0;
|
||||
LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2)
|
||||
#undef LEAD_CASE
|
||||
/* fall through */
|
||||
/*@fallthrough@*/
|
||||
if (*ptr1++ != *ptr2++)
|
||||
return 0;
|
||||
break;
|
||||
|
|
|
@ -11,3 +11,7 @@ LDADD = $(top_builddir)/lib/libexpat.la
|
|||
noinst_HEADERS = chardata.h
|
||||
|
||||
runtests_SOURCES = chardata.c runtests.c
|
||||
runtests_LDFLAGGS = -all-static
|
||||
runtests_LDADD = $(LDADD) -lcheck
|
||||
|
||||
all: runtests
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
/* chardata.c
|
||||
*
|
||||
*
|
||||
/* Copyright (c) 1998-2003 Thai Open Source Software Center Ltd
|
||||
See the file COPYING for copying permission.
|
||||
|
||||
chardata.c
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#ifdef HAVE_CHECK_H
|
||||
#include <check.h>
|
||||
#else
|
||||
#error This test suite requires the 'check' unit test framework (http://check.sf.net/)
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <check.h>
|
||||
#include <stdio.h>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -38,6 +38,7 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
|||
IF F$SEARCH("$(LIBRARY)") .EQS. "" THEN $(LIBR) /CREATE /OBJECT $(LIBRARY)
|
||||
|
||||
all : $(LIBRARY)
|
||||
@ write sys$output "All made."
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : $(OLB) $(O) .C .H
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
[Setup]
|
||||
AppName=expat
|
||||
AppId=expat
|
||||
AppVersion=1.95.5
|
||||
AppVerName=expat 1.95.5
|
||||
AppCopyright=Copyright © 1998-2002 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
|
||||
DefaultDirName={sd}\Expat-1.95.5
|
||||
AppVersion=1.95.7
|
||||
AppVerName=expat 1.95.7
|
||||
AppCopyright=Copyright © 1998-2003 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
|
||||
DefaultDirName={sd}\Expat-1.95.7
|
||||
AppPublisher=The Expat Developers
|
||||
AppPublisherURL=http://www.libexpat.org/
|
||||
AppSupportURL=http://www.libexpat.org/
|
||||
AppUpdatesURL=http://www.libexpat.org/
|
||||
UninstallDisplayName=Expat XML Parser (version 1.95.5)
|
||||
UninstallDisplayName=Expat XML Parser (version 1.95.7)
|
||||
UninstallFilesDir={app}\Uninstall
|
||||
|
||||
Compression=bzip/9
|
||||
|
@ -42,9 +42,11 @@ CopyMode: alwaysoverwrite; Source: lib\Release-w\*.lib; DestDir: "{app}\L
|
|||
CopyMode: alwaysoverwrite; Source: lib\Release_static\*.lib; DestDir: "{app}\StaticLibs"
|
||||
CopyMode: alwaysoverwrite; Source: lib\Release-w_static\*.lib; DestDir: "{app}\StaticLibs"
|
||||
CopyMode: alwaysoverwrite; Source: expat.dsw; DestDir: "{app}\Source"
|
||||
CopyMode: alwaysoverwrite; Source: win32\README.txt; DestDir: "{app}\Source"
|
||||
CopyMode: alwaysoverwrite; Source: bcb5\*.*; DestDir: "{app}\Source\bcb5"
|
||||
CopyMode: alwaysoverwrite; Source: lib\*.c; DestDir: "{app}\Source\lib"
|
||||
CopyMode: alwaysoverwrite; Source: lib\*.h; DestDir: "{app}\Source\lib"
|
||||
CopyMode: alwaysoverwrite; Source: lib\*.def; DestDir: "{app}\Source\lib"
|
||||
CopyMode: alwaysoverwrite; Source: lib\*.dsp; DestDir: "{app}\Source\lib"
|
||||
CopyMode: alwaysoverwrite; Source: examples\*.c; DestDir: "{app}\Source\examples"
|
||||
CopyMode: alwaysoverwrite; Source: examples\*.dsp; DestDir: "{app}\Source\examples"
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
#ifdef COMPILED_FROM_DSP
|
||||
#include "winconfig.h"
|
||||
#else
|
||||
#include "expat_config.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
#include "expat.h"
|
||||
#include "xmlfile.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#define NSSEP T('\001')
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
characterData(void *userData, const XML_Char *s, int len)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -58,7 +58,7 @@ characterData(void *userData, const XML_Char *s, int len)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
attributeValue(FILE *fp, const XML_Char *s)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies fp, fileSystem @*/
|
||||
|
@ -118,7 +118,7 @@ attcmp(const void *att1, const void *att2)
|
|||
return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
startElement(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, *atts, fileSystem @*/
|
||||
|
@ -144,7 +144,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts)
|
|||
(void) puttc(T('>'), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
endElement(void *userData, const XML_Char *name)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -169,7 +169,7 @@ nsattcmp(const void *p1, const void *p2)
|
|||
return tcscmp(att1, att2);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, *atts, fileSystem @*/
|
||||
|
@ -220,7 +220,7 @@ startElementNS(void *userData, const XML_Char *name, const XML_Char **atts)
|
|||
(void) puttc(T('>'), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
endElementNS(void *userData, const XML_Char *name)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -241,7 +241,7 @@ endElementNS(void *userData, const XML_Char *name)
|
|||
|
||||
#ifndef W3C14N
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
processingInstruction(void *userData, const XML_Char *target,
|
||||
const XML_Char *data)
|
||||
/*@globals fileSystem @*/
|
||||
|
@ -259,7 +259,7 @@ processingInstruction(void *userData, const XML_Char *target,
|
|||
|
||||
#endif /* not W3C14N */
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
defaultCharacterData(void *userData, /*@unused@*/ const XML_Char *s,
|
||||
/*@unused@*/ int len)
|
||||
/*@modifies userData @*/
|
||||
|
@ -267,7 +267,7 @@ defaultCharacterData(void *userData, /*@unused@*/ const XML_Char *s,
|
|||
XML_DefaultCurrent((XML_Parser) userData);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
defaultStartElement(void *userData, /*@unused@*/ const XML_Char *name,
|
||||
/*@unused@*/ const XML_Char **atts)
|
||||
/*@modifies userData @*/
|
||||
|
@ -275,14 +275,14 @@ defaultStartElement(void *userData, /*@unused@*/ const XML_Char *name,
|
|||
XML_DefaultCurrent((XML_Parser) userData);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
defaultEndElement(void *userData, /*@unused@*/ const XML_Char *name)
|
||||
/*@modifies userData @*/
|
||||
{
|
||||
XML_DefaultCurrent((XML_Parser) userData);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
defaultProcessingInstruction(void *userData,
|
||||
/*@unused@*/ const XML_Char *target,
|
||||
/*@unused@*/ const XML_Char *data)
|
||||
|
@ -292,25 +292,25 @@ defaultProcessingInstruction(void *userData,
|
|||
}
|
||||
|
||||
/*@-paramuse@*/
|
||||
static void
|
||||
static void XMLCALL
|
||||
nopCharacterData(void *userData, const XML_Char *s, int len)
|
||||
/*@*/
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
nopStartElement(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
/*@*/
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
nopEndElement(void *userData, const XML_Char *name)
|
||||
/*@*/
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
nopProcessingInstruction(void *userData, const XML_Char *target,
|
||||
const XML_Char *data)
|
||||
/*@*/
|
||||
|
@ -318,7 +318,7 @@ nopProcessingInstruction(void *userData, const XML_Char *target,
|
|||
}
|
||||
/*@=paramuse@*/
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
markup(void *userData, const XML_Char *s, int len)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies fileSystem @*/
|
||||
|
@ -360,7 +360,7 @@ metaEndDocument(void *userData)
|
|||
(void) fputts(T("</document>\n"), XML_GetUserData((XML_Parser) userData));
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaStartElement(void *userData, const XML_Char *name,
|
||||
const XML_Char **atts)
|
||||
/*@globals fileSystem @*/
|
||||
|
@ -397,7 +397,7 @@ metaStartElement(void *userData, const XML_Char *name,
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaEndElement(void *userData, const XML_Char *name)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -409,7 +409,7 @@ metaEndElement(void *userData, const XML_Char *name)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaProcessingInstruction(void *userData, const XML_Char *target,
|
||||
const XML_Char *data)
|
||||
/*@globals fileSystem @*/
|
||||
|
@ -424,7 +424,7 @@ metaProcessingInstruction(void *userData, const XML_Char *target,
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaComment(void *userData, const XML_Char *data)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -438,7 +438,7 @@ metaComment(void *userData, const XML_Char *data)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaStartCdataSection(void *userData)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -450,7 +450,7 @@ metaStartCdataSection(void *userData)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaEndCdataSection(void *userData)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -462,7 +462,7 @@ metaEndCdataSection(void *userData)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaCharacterData(void *userData, const XML_Char *s, int len)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -476,7 +476,7 @@ metaCharacterData(void *userData, const XML_Char *s, int len)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaStartDoctypeDecl(void *userData,
|
||||
const XML_Char *doctypeName,
|
||||
/*@unused@*/ const XML_Char *sysid,
|
||||
|
@ -492,7 +492,7 @@ metaStartDoctypeDecl(void *userData,
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaEndDoctypeDecl(void *userData)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies userData, fileSystem @*/
|
||||
|
@ -504,7 +504,7 @@ metaEndDoctypeDecl(void *userData)
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaNotationDecl(void *userData,
|
||||
const XML_Char *notationName,
|
||||
/*@unused@*/ const XML_Char *base,
|
||||
|
@ -528,7 +528,7 @@ metaNotationDecl(void *userData,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaEntityDecl(void *userData,
|
||||
const XML_Char *entityName,
|
||||
/*@unused@*/ int is_param,
|
||||
|
@ -574,7 +574,7 @@ metaEntityDecl(void *userData,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaStartNamespaceDecl(void *userData,
|
||||
const XML_Char *prefix,
|
||||
const XML_Char *uri)
|
||||
|
@ -595,7 +595,7 @@ metaStartNamespaceDecl(void *userData,
|
|||
(void) fputts(T("/>\n"), fp);
|
||||
}
|
||||
|
||||
static void
|
||||
static void XMLCALL
|
||||
metaEndNamespaceDecl(void *userData, const XML_Char *prefix)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies fileSystem @*/
|
||||
|
@ -608,14 +608,14 @@ metaEndNamespaceDecl(void *userData, const XML_Char *prefix)
|
|||
ftprintf(fp, T("<endns prefix=\"%s\"/>\n"), prefix);
|
||||
}
|
||||
|
||||
static int
|
||||
static int XMLCALL
|
||||
unknownEncodingConvert(void *data, const char *p)
|
||||
/*@*/
|
||||
{
|
||||
return codepageConvert(*(int *)data, p);
|
||||
}
|
||||
|
||||
static int
|
||||
static int XMLCALL
|
||||
unknownEncoding(/*@unused@*/ void *userData, const XML_Char *name,
|
||||
XML_Encoding *info)
|
||||
/*@modifies info @*/
|
||||
|
@ -657,7 +657,7 @@ unknownEncoding(/*@unused@*/ void *userData, const XML_Char *name,
|
|||
/*@=compdef@*/
|
||||
}
|
||||
|
||||
static int
|
||||
static int XMLCALL
|
||||
notStandalone(/*@unused@*/ void *userData)
|
||||
/*@*/
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue