Commit 1afc96e2 authored by alanh's avatar alanh
Browse files

add expat

parent 1fd9d0ba
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
and Clark Cooper
Copyright (c) 2001, 2002 Expat maintainers.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
standard malloc,realloc, and free.
- XML_SetReturnNSTriplet
If you turn this feature on when namespace processing is in
effect, then qualified, prefixed element and attribute names
are returned as "uri|name|prefix" where '|' is whatever
separator character is used in namespace processing.
- Merged in features from perl-expat
o XML_SetElementDeclHandler
o XML_SetAttlistDeclHandler
o XML_SetXmlDeclHandler
o XML_SetEntityDeclHandler
o StartDoctypeDeclHandler takes 3 additional parameters:
sysid, pubid, has_internal_subset
o Many paired handler setters (like XML_SetElementHandler)
now have corresponding individual handler setters
o XML_GetInputContext for getting the input context of
the current parse position.
- Added reference material
- Packaged into a distribution that builds a sharable library
Changes
COPYING
MANIFEST
Makefile.in
README
configure
configure.in
expat_config.h.in
bcb5/README.txt
bcb5/elements.bpf
bcb5/elements.bpr
bcb5/elements.mak
bcb5/expat.bpf
bcb5/expat.bpr
bcb5/expat.mak
bcb5/expat_static.bpf
bcb5/expat_static.bpr
bcb5/expat_static.mak
bcb5/expatw.bpf
bcb5/expatw.bpr
bcb5/expatw.mak
bcb5/expatw_static.bpf
bcb5/expatw_static.bpr
bcb5/expatw_static.mak
bcb5/libexpat_mtd.def
bcb5/libexpatw_mtd.def
bcb5/makefile.mak
bcb5/outline.bpf
bcb5/outline.bpr
bcb5/outline.mak
bcb5/setup.bat
bcb5/xmlwf.bpf
bcb5/xmlwf.bpr
bcb5/xmlwf.mak
conftools/PrintPath
conftools/ac_c_bigendian_cross.m4
conftools/config.guess
conftools/config.sub
conftools/expat.m4
conftools/install-sh
conftools/libtool.m4
conftools/ltmain.sh
conftools/mkinstalldirs
doc/reference.html
doc/style.css
doc/valid-xhtml10.png
doc/xmlwf.1
doc/xmlwf.sgml
examples/elements.c
examples/outline.c
lib/ascii.h
lib/asciitab.h
lib/expat.h
lib/iasciitab.h
lib/internal.h
lib/latin1tab.h
lib/nametab.h
lib/utf8tab.h
lib/xmlparse.c
lib/xmlrole.c
lib/xmlrole.h
lib/xmltok.c
lib/xmltok.h
lib/xmltok_impl.c
lib/xmltok_impl.h
lib/xmltok_ns.c
lib/winconfig.h
tests/README.txt
tests/chardata.c
tests/chardata.h
tests/runtests.c
tests/xmltest.sh
vms/descrip.mms
vms/expat_config.h
vms/README.vms
win32/expat.iss
win32/MANIFEST.txt
xmlwf/codepage.c
xmlwf/codepage.h
xmlwf/ct.c
xmlwf/filemap.h
xmlwf/readfilemap.c
xmlwf/unixfilemap.c
xmlwf/win32filemap.c
xmlwf/xmlfile.c
xmlwf/xmlfile.h
xmlwf/xmlmime.c
xmlwf/xmlmime.h
xmlwf/xmltchar.h
xmlwf/xmlurl.h
xmlwf/xmlwf.c
xmlwf/xmlwin32url.cxx
################################################################
# Process this file with top-level configure script to produce Makefile
#
# Copyright 2000 Clark Cooper
#
# This file is part of EXPAT.
#
# EXPAT is free software; you can redistribute it and/or modify it
# under the terms of the License (based on the MIT/X license) contained
# in the file COPYING that comes with this distribution.
#
# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
mandir = ${prefix}/man/man1
top_builddir = .
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs
MANFILE = $(srcdir)/doc/xmlwf.1
APIHEADER = $(srcdir)/lib/expat.h
LIBRARY = libexpat.la
default: buildlib xmlwf/xmlwf
buildlib: $(LIBRARY)
all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
clean:
cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
cd tests && rm -rf .libs runtests runtests.o chardata.o
rm -rf .libs libexpat.la
rm -f examples/core tests/core xmlwf/core
clobber: clean
distclean: clean
rm -f expat_config.h config.status config.log config.cache libtool
rm -f Makefile
extraclean: distclean
rm -f expat_config.h.in configure
rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
check: tests/runtests
tests/runtests
install: xmlwf/xmlwf installlib
$(mkinstalldirs) $(bindir) $(mandir)
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf
$(INSTALL_DATA) $(MANFILE) $(mandir)
installlib: $(LIBRARY) $(APIHEADER)
$(mkinstalldirs) $(libdir) $(includedir)
$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY)
$(INSTALL_DATA) $(APIHEADER) $(includedir)
uninstall: uninstalllib
$(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf
rm -f $(mandir)/xmlwf.1
uninstalllib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY)
rm -f $(includedir)/$(APIHEADER)
# for VPATH builds (invoked by configure)
mkdir-init:
@for d in lib xmlwf examples tests ; do \
(mkdir $$d 2> /dev/null || test 1) ; \
done
CC = @CC@
LIBTOOL = @LIBTOOL@
INCLUDES = -I$(srcdir)/lib -I.
LDFLAGS = @LDFLAGS@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
### autoconf this?
LTFLAGS = --silent
COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES)
LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@
LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@
LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
$(LIBRARY): $(LIB_OBJS)
$(LINK_LIB) $(LIB_OBJS)
lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
$(top_builddir)/expat_config.h lib/internal.h
lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \
$(top_builddir)/expat_config.h lib/internal.h
lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \
lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \
lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \
$(top_builddir)/expat_config.h
XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o
xmlwf/xmlwf.o: xmlwf/xmlwf.c
xmlwf/xmlfile.o: xmlwf/xmlfile.c
xmlwf/codepage.o: xmlwf/codepage.c
xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
$(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
examples/elements.o: examples/elements.c
examples/elements: examples/elements.o $(LIBRARY)
$(LINK_EXE) $< $(LIBRARY)
examples/outline.o: examples/outline.c
examples/outline: examples/outline.o $(LIBRARY)
$(LINK_EXE) $< $(LIBRARY)
tests/chardata.o: tests/chardata.c tests/chardata.h
tests/runtests.o: tests/runtests.c tests/chardata.h
tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY)
$(LINK_EXE) $^ -lcheck
tests/xmlts.zip:
wget --output-document=tests/xmlts.zip \
http://www.w3.org/XML/Test/xmlts20020606.zip
tests/XML-Test-Suite: tests/xmlts.zip
cd tests && unzip -q xmlts.zip
run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite
tests/xmltest.sh
.SUFFIXES: .c .lo .o
.c.o:
$(COMPILE) -o $@ -c $<
.c.lo:
$(LTCOMPILE) -o $@ -c $<
.PHONY: buildlib all \
clean distclean extraclean maintainer-clean \
dist distdir \
install uninstall
Expat, Release 1.95.6
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.
Windows users should use the expat_win32bin package, which includes
both precompiled libraries and executalbes, and source code for
developers.
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.
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, 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.
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
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://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@mail.libexpat.org. Archives of this list and
other Expat-related lists may be found at:
http://mail.libexpat.org/mailman-21/listinfo/
Using a Borland compiler product
The files in this directory support using both the free Borland command-line
compiler tools and the Borland C++ Builder IDE. The project files have been
tested with both versions 5 and 6 of the C++ Builder product.
Using the free BCC32 command line compiler
After downloading and installing the free C++ Builder commandline version,
perform the following steps (assuming it was installed under C:\Borland\BCC55):
1) Add "C:\Borland\BCC55\BIN" to your path
2) Set the environment variable BCB to "C:\Borland\BCC55".
3) edit makefile.mak: enable or comment out the appropriate commands under
clean & distclean, depending on whether your OS can use deltree /y or
del /s/f/q.
After that, you should simply cd to the bcb5 directory in your Expat directory
tree (same structure as CVS) and run "make all" or just "make".
Naming
The libraries have the base name "libexpat" followed optionally by an "s"
(static) or a "w" (unicode version), then an underscore and optionally
"mt" (multi-threaded) and "d" (dynamic RTL).
To change the name of the library a project file produces, edit the project
option source (see step 1 under Unicode below) and change the name contained in
the PROJECT tag. In a make file, change the value assigned to the PROJECT
variable. Also, the LIBRARY entry in the .def file has to be changed to
correspond to the new executable name.
Unicode Considerations
There are no facilities in the BCB 5 GUI to create a unicode-enabled
application. Fortunately, it is not hard to do by hand.
1. The startup .obj system file must be changed to the unicode version.
Go to Project|Edit Option Source, and scroll down to the ALLOBJ tag. Change
c0x32.obj to c0x32w.obj. Editing this file can be quirky, but usually the
following kludge will make the change stick. Close and save the file
(CTRL-F4) then open the options dialog (CTRL-Shift-F11), then click OK on
the dialog immediately without changing anything in it. If this doesn't work,
you will have to close the project completely and edit the .bpr file by hand.
If you are using a make file, just change the startup .obj file assigned
to the ALLOBJ variable.
2. Add the macro define XML_UNICODE_WCHAR_T. In the GUI that goes in the options
dialog, Directories/Conditionals tab, in the Conditional define box. In a
make file, put it in the USERDEFINES variable.
3. Of course, your code has to be written for unicode. As a start, the "main"
function is called "wmain". The tchar macros are an interesting way to
write code that can easily switch between unicode and utf-8. If these macros
are used, then simply adding the conditional define _UNICODE as well as
XML_UNICODE_WCHAR_T will bring in the unicode versions of the tchar macros.
Otherwise the utf-8 versions are used. xmlwf uses its own versions of the
tchar macros which are switched on and off by the XML_UNICODE macro, which
itself is set by the XML_UNICODE_WCHAR_T define.
Threading
The libexpat libraries are all built with the multi-threaded dynamic RTL's.
To create single-threaded libs, do the following:
1. The compiler option for multi-threading must be turned off. Following the
instructions above to edit the option source, remove the -tWM option from
the CFLAG1 tag. In a make file, remove it from the CFLAG1 variable.
2. The single threaded RTL must be called. change the RTL in the ALLLIB tag or
variable (GUI or makefile repectively) to the version without the "mt" in the
name. For example, change cw32mti.lib to cw32i.lib.
Static RTL's
To build the libs with static RTL's do the following,
1. For the static expatlibs, in the Tlib tab on the options dialog, uncheck the
"Use dynamic RTL" box. For the dynamic expatlibs, in the Linker tab on the
options dialog, uncheck "Use dynamic RTL". If you are using a make file,
remove the _RTLDLL assignment to the SYSDEFINES variable, and change the RTL
to the version without an "i" in the ALLLIB variable. For example,
cw32mti.lib would become cw32mt.lib.
USEUNIT("..\examples\elements.c");
USELIB("Release\libexpats_mtd.lib");
//---------------------------------------------------------------------------
main
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.05.03"/>
<PROJECT value="Release\elements.exe"/>
<OBJFILES value="Release\obj\examples\elements.obj"/>
<RESFILES value=""/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value="Release\libexpats_mtd.lib"/>