├── MODULE_LICENSE_BSD_LIKE ├── doc ├── expat.png ├── valid-xhtml10.png └── style.css ├── lib ├── Makefile.MPW ├── winconfig.h ├── xmltok_impl.h ├── amigaconfig.h ├── macconfig.h ├── asciitab.h ├── utf8tab.h ├── latin1tab.h ├── iasciitab.h ├── internal.h ├── libexpat.def ├── libexpatw.def ├── ascii.h ├── xmlrole.h ├── xmltok_ns.c ├── expat_external.h ├── expat_static.dsp └── expatw_static.dsp ├── win32 ├── expat.iss ├── MANIFEST.txt └── README.txt ├── bcb5 ├── elements.bpf ├── outline.bpf ├── expat_static.bpf ├── expatw_static.bpf ├── expat.bpf ├── expatw.bpf ├── xmlwf.bpf ├── setup.bat ├── makefile.mak ├── all_projects.bpg ├── outline.bpr ├── expat_static.bpr ├── xmlwf.bpr ├── README.txt ├── expat.bpr ├── expatw.bpr ├── expatw_static.bpr ├── elements.bpr ├── expat_static.mak └── expatw_static.mak ├── tests ├── runtestspp.cpp ├── benchmark │ ├── README.txt │ ├── benchmark.dsw │ ├── benchmark.c │ └── benchmark.dsp ├── README.txt ├── chardata.h ├── minicheck.h ├── chardata.c ├── xmltest.sh └── minicheck.c ├── xmlwf ├── codepage.h ├── xmlurl.h ├── filemap.h ├── xmlmime.h ├── xmlfile.h ├── xmltchar.h ├── unixfilemap.c ├── codepage.c ├── readfilemap.c ├── win32filemap.c ├── ct.c ├── xmlmime.c └── xmlwf.dsp ├── ThirdPartyProject.prop ├── vms ├── README.vms ├── expat_config.h └── descrip.mms ├── conftools ├── mkinstalldirs ├── get-version.sh ├── expat.m4 ├── PrintPath └── ac_c_bigendian_cross.m4 ├── NOTICE ├── Android.mk ├── amiga ├── include │ └── proto │ │ └── expat.h ├── launch.c ├── README.txt ├── stdlib.c └── Makefile ├── examples ├── elements.c ├── outline.c ├── elements.dsp └── outline.dsp ├── CleanSpec.mk ├── expat.dsw ├── expat_config.h.in ├── MANIFEST ├── expat_config.h └── configure.in /MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/expat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vault/expat/master/doc/expat.png -------------------------------------------------------------------------------- /lib/Makefile.MPW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vault/expat/master/lib/Makefile.MPW -------------------------------------------------------------------------------- /win32/expat.iss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vault/expat/master/win32/expat.iss -------------------------------------------------------------------------------- /doc/valid-xhtml10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vault/expat/master/doc/valid-xhtml10.png -------------------------------------------------------------------------------- /bcb5/elements.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\examples\elements.c"); 2 | USELIB("Release\libexpats_mtd.lib"); 3 | //--------------------------------------------------------------------------- 4 | main 5 | -------------------------------------------------------------------------------- /bcb5/outline.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\examples\outline.c"); 2 | USELIB("Release\libexpat_mtd.lib"); 3 | //--------------------------------------------------------------------------- 4 | main 5 | -------------------------------------------------------------------------------- /bcb5/expat_static.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\lib\xmlparse.c"); 2 | USEUNIT("..\lib\xmlrole.c"); 3 | USEUNIT("..\lib\xmltok.c"); 4 | //--------------------------------------------------------------------------- 5 | #define Library 6 | -------------------------------------------------------------------------------- /bcb5/expatw_static.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\lib\xmlparse.c"); 2 | USEUNIT("..\lib\xmlrole.c"); 3 | USEUNIT("..\lib\xmltok.c"); 4 | //--------------------------------------------------------------------------- 5 | #define Library 6 | -------------------------------------------------------------------------------- /tests/runtestspp.cpp: -------------------------------------------------------------------------------- 1 | // C++ compilation harness for the test suite. 2 | // 3 | // This is used to ensure the Expat headers can be included from C++ 4 | // and have everything work as expected. 5 | // 6 | #include "runtests.c" 7 | -------------------------------------------------------------------------------- /xmlwf/codepage.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | int codepageMap(int cp, int *map); 6 | int codepageConvert(int cp, const char *p); 7 | -------------------------------------------------------------------------------- /bcb5/expat.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\lib\xmlparse.c"); 2 | USEUNIT("..\lib\xmlrole.c"); 3 | USEUNIT("..\lib\xmltok.c"); 4 | USEDEF("libexpat_mtd.def"); 5 | //--------------------------------------------------------------------------- 6 | #define DllEntryPoint 7 | -------------------------------------------------------------------------------- /bcb5/expatw.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\lib\xmlparse.c"); 2 | USEUNIT("..\lib\xmlrole.c"); 3 | USEUNIT("..\lib\xmltok.c"); 4 | USEDEF("libexpatw_mtd.def"); 5 | //--------------------------------------------------------------------------- 6 | #define DllEntryPoint 7 | -------------------------------------------------------------------------------- /bcb5/xmlwf.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\xmlwf\codepage.c"); 2 | USEUNIT("..\xmlwf\win32filemap.c"); 3 | USEUNIT("..\xmlwf\xmlfile.c"); 4 | USEUNIT("..\xmlwf\xmlwf.c"); 5 | USELIB("Release\libexpat_mtd.lib"); 6 | //--------------------------------------------------------------------------- 7 | main 8 | -------------------------------------------------------------------------------- /xmlwf/xmlurl.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | int XML_URLInit(); 6 | void XML_URLUninit(); 7 | int XML_ProcessURL(XML_Parser parser, 8 | const XML_Char *url, 9 | unsigned flags); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /ThirdPartyProject.prop: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. All Rights Reserved. 2 | #Fri Jul 16 10:03:09 PDT 2010 3 | currentVersion=2.0.1 4 | version=2.0.1 5 | isNative=true 6 | feedurl=http\://expat.sourceforge.net/ 7 | name=expat 8 | keywords=expat 9 | onDevice=true 10 | homepage=http\://expat.sourceforge.net/ 11 | -------------------------------------------------------------------------------- /xmlwf/filemap.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | 7 | #ifdef XML_UNICODE 8 | int filemap(const wchar_t *name, 9 | void (*processor)(const void *, size_t, 10 | const wchar_t *, void *arg), 11 | void *arg); 12 | #else 13 | int filemap(const char *name, 14 | void (*processor)(const void *, size_t, 15 | const char *, void *arg), 16 | void *arg); 17 | #endif 18 | -------------------------------------------------------------------------------- /xmlwf/xmlmime.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | /* Registered charset names are at most 40 characters long. */ 6 | 7 | #define CHARSET_MAX 41 8 | 9 | /* Figure out the charset to use from the ContentType. 10 | buf contains the body of the header field (the part after "Content-Type:"). 11 | charset gets the charset to use. It must be at least CHARSET_MAX chars 12 | long. charset will be empty if the default charset should be used. 13 | */ 14 | 15 | void getXMLCharset(const char *buf, char *charset); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /bcb5/setup.bat: -------------------------------------------------------------------------------- 1 | REM CommandInterpreter: $(COMSPEC) 2 | if not exist .\release\nul mkdir release 3 | if not exist .\release\obj\nul mkdir release\obj 4 | if not exist .\release\obj\libexpat\nul mkdir release\obj\libexpat 5 | if not exist .\release\obj\libexpatw\nul mkdir release\obj\libexpatw 6 | if not exist .\release\obj\libexpat_static\nul mkdir release\obj\libexpat_static 7 | if not exist .\release\obj\libexpatw_static\nul mkdir release\obj\libexpatw_static 8 | if not exist .\release\obj\examples\nul mkdir release\obj\examples 9 | if not exist .\release\obj\xmlwf\nul mkdir release\obj\xmlwf 10 | -------------------------------------------------------------------------------- /xmlwf/xmlfile.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define XML_MAP_FILE 01 6 | #define XML_EXTERNAL_ENTITIES 02 7 | 8 | #ifdef XML_LARGE_SIZE 9 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 10 | #define XML_FMT_INT_MOD "I64" 11 | #else 12 | #define XML_FMT_INT_MOD "ll" 13 | #endif 14 | #else 15 | #define XML_FMT_INT_MOD "l" 16 | #endif 17 | 18 | extern int XML_ProcessFile(XML_Parser parser, 19 | const XML_Char *filename, 20 | unsigned flags); 21 | -------------------------------------------------------------------------------- /tests/benchmark/README.txt: -------------------------------------------------------------------------------- 1 | Use this benchmark command line utility as follows: 2 | 3 | benchmark [-n] <# iterations> 4 | 5 | The command line arguments are: 6 | 7 | -n ... optional; if supplied, namespace processing is turned on 8 | ... name/path of test xml file 9 | ... size of processing buffer; 10 | the file is parsed in chunks of this size 11 | <# iterations> ... how often will the file be parsed 12 | 13 | Returns: 14 | 15 | The time (in seconds) it takes to parse the test file, 16 | averaged over the number of iterations. -------------------------------------------------------------------------------- /tests/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains the (fledgling) test suite for Expat. The 2 | tests provide general unit testing and regression coverage. The tests 3 | are not expected to be useful examples of Expat usage; see the 4 | examples/ directory for that. 5 | 6 | The Expat tests use a partial internal implementation of the "Check" 7 | unit testing framework for C. More information on Check can be found at: 8 | 9 | http://check.sourceforge.net/ 10 | 11 | Expat must be built and installed before "make check" can be executed. 12 | 13 | Since both Check and this test suite are young, it can all change in a 14 | later version. 15 | -------------------------------------------------------------------------------- /vms/README.vms: -------------------------------------------------------------------------------- 1 | 4-jun-2002 Craig A. Berry 2 | Added rudimentary build procedures for 3 | OpenVMS based on work by Martin Vorlaender. 4 | 5 | 6 | You'll need MMS or its freeware equivalent MMK. Just go to the 7 | top-level directory and type 8 | 9 | $ MMS/DESCRIPTION=[.vms] 10 | 11 | or 12 | 13 | $ MMK/DESCRIPTION=[.vms] 14 | 15 | You'll end up with the object library expat.olb. For now, installation 16 | consists merely of copying the object library, include files, and 17 | documentation to a suitable location. 18 | 19 | To-do list: 20 | 21 | -- create a shareable image 22 | -- build and run the tests and build the xmlwf utility 23 | -- create an install target 24 | -------------------------------------------------------------------------------- /bcb5/makefile.mak: -------------------------------------------------------------------------------- 1 | all: setup expat expatw expat_static expatw_static elements outline xmlwf 2 | 3 | setup: 4 | setup 5 | 6 | expat: 7 | make -l -fexpat.mak 8 | 9 | expatw: 10 | make -l -fexpatw.mak 11 | 12 | expat_static: 13 | make -l -fexpat_static.mak 14 | 15 | expatw_static: 16 | make -l -fexpatw_static.mak 17 | 18 | elements: 19 | make -l -felements.mak 20 | 21 | outline: 22 | make -l -foutline.mak 23 | 24 | xmlwf: 25 | make -l -fxmlwf.mak 26 | 27 | clean: 28 | # works on Win98/ME 29 | # deltree /y release\obj 30 | # works on WinNT/2000 31 | del /s/f/q release\obj 32 | 33 | distclean: 34 | # works on Win98/ME 35 | # deltree /y release\*.* 36 | # works on WinNT/2000 37 | del /s/f/q release\* 38 | -------------------------------------------------------------------------------- /lib/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | #define XML_NS 1 21 | #define XML_DTD 1 22 | #define XML_CONTEXT_BYTES 1024 23 | 24 | /* we will assume all Windows platforms are little endian */ 25 | #define BYTEORDER 1234 26 | 27 | /* Windows has memmove() available. */ 28 | #define HAVE_MEMMOVE 29 | 30 | #endif /* ndef WINCONFIG_H */ 31 | -------------------------------------------------------------------------------- /lib/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /conftools/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1 2000/09/18 16:26:21 coopercc Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /lib/amigaconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef AMIGACONFIG_H 2 | #define AMIGACONFIG_H 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 4321 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #undef HAVE_CHECK_H 12 | 13 | /* Define to 1 if you have the `memmove' function. */ 14 | #define HAVE_MEMMOVE 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_UNISTD_H 1 18 | 19 | /* whether byteorder is bigendian */ 20 | #define WORDS_BIGENDIAN 21 | 22 | /* Define to specify how much context to retain around the current parse 23 | point. */ 24 | #define XML_CONTEXT_BYTES 1024 25 | 26 | /* Define to make parameter entity parsing functionality available. */ 27 | #define XML_DTD 28 | 29 | /* Define to make XML Namespaces functionality available. */ 30 | #define XML_NS 31 | 32 | #endif /* AMIGACONFIG_H */ 33 | -------------------------------------------------------------------------------- /tests/chardata.h: -------------------------------------------------------------------------------- 1 | /* chardata.h 2 | 3 | Interface to some helper routines used to accumulate and check text 4 | and attribute content. 5 | */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #ifndef XML_CHARDATA_H 12 | #define XML_CHARDATA_H 1 13 | 14 | #ifndef XML_VERSION 15 | #include "expat.h" /* need XML_Char */ 16 | #endif 17 | 18 | 19 | typedef struct { 20 | int count; /* # of chars, < 0 if not set */ 21 | XML_Char data[1024]; 22 | } CharData; 23 | 24 | 25 | void CharData_Init(CharData *storage); 26 | 27 | void CharData_AppendString(CharData *storage, const char *s); 28 | 29 | void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len); 30 | 31 | int CharData_CheckString(CharData *storage, const char *s); 32 | 33 | int CharData_CheckXMLChars(CharData *storage, const XML_Char *s); 34 | 35 | 36 | #endif /* XML_CHARDATA_H */ 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /xmlwf/xmltchar.h: -------------------------------------------------------------------------------- 1 | #ifdef XML_UNICODE 2 | #ifndef XML_UNICODE_WCHAR_T 3 | #error xmlwf requires a 16-bit Unicode-compatible wchar_t 4 | #endif 5 | #define T(x) L ## x 6 | #define ftprintf fwprintf 7 | #define tfopen _wfopen 8 | #define fputts fputws 9 | #define puttc putwc 10 | #define tcscmp wcscmp 11 | #define tcscpy wcscpy 12 | #define tcscat wcscat 13 | #define tcschr wcschr 14 | #define tcsrchr wcsrchr 15 | #define tcslen wcslen 16 | #define tperror _wperror 17 | #define topen _wopen 18 | #define tmain wmain 19 | #define tremove _wremove 20 | #else /* not XML_UNICODE */ 21 | #define T(x) x 22 | #define ftprintf fprintf 23 | #define tfopen fopen 24 | #define fputts fputs 25 | #define puttc putc 26 | #define tcscmp strcmp 27 | #define tcscpy strcpy 28 | #define tcscat strcat 29 | #define tcschr strchr 30 | #define tcsrchr strrchr 31 | #define tcslen strlen 32 | #define tperror perror 33 | #define topen open 34 | #define tmain main 35 | #define tremove remove 36 | #endif /* not XML_UNICODE */ 37 | -------------------------------------------------------------------------------- /tests/benchmark/benchmark.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "benchmark"=.\benchmark.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name expat 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "expat"=..\..\lib\expat.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | and Clark Cooper 3 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /win32/MANIFEST.txt: -------------------------------------------------------------------------------- 1 | Overview of the Expat distribution 2 | 3 | The Expat distribution creates several subdirectories on your system. 4 | Some of these directories contain components of interest to all Expat 5 | users, and some contain material of interest to developers who wish to 6 | use Expat in their applications. In the list below, is the 7 | directory you specified to the installer. 8 | 9 | Directory Contents 10 | --------------------------------------------------------------------- 11 | \ Some general information files. 12 | 13 | \Doc\ API documentation for developers. 14 | 15 | \Bin\ Pre-compiled dynamic libraries for developers. 16 | Pre-compiled static libraries for developers (*MT.lib). 17 | The XML well-formedness checker xmlwf. 18 | 19 | \Source\ Source code, which may interest some developers, 20 | including a workspace for Microsft Visual C++. 21 | The source code includes the parser, the well- 22 | formedness checker, and a couple of small sample 23 | applications. 24 | 25 | \Source\bcb5\ Project files for Borland C++ Builder 5 and BCC 5.5. 26 | 27 | 28 | -------------------------------------------------------------------------------- /vms/expat_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2000, Clark Cooper 2 | All rights reserved. 3 | 4 | This is free software. You are permitted to copy, distribute, or modify 5 | it under the terms of the MIT/X license (contained in the COPYING file 6 | with this distribution.) 7 | */ 8 | 9 | /* Define to empty if the keyword does not work. */ 10 | #undef const 11 | 12 | /* Define if you have a working `mmap' system call. */ 13 | #undef HAVE_MMAP 14 | 15 | /* Define to `long' if doesn't define. */ 16 | #undef off_t 17 | 18 | /* Define to `unsigned' if doesn't define. */ 19 | #undef size_t 20 | 21 | /* Define if your processor stores words with the most significant 22 | byte first (like Motorola and SPARC, unlike Intel and VAX). */ 23 | #undef WORDS_BIGENDIAN 24 | 25 | /* Define if you have the bcopy function. */ 26 | #undef HAVE_BCOPY 27 | 28 | /* Define if you have the memmove function. */ 29 | #define HAVE_MEMMOVE 1 30 | 31 | /* Define if you have the header file. */ 32 | #define HAVE_UNISTD_H 1 33 | 34 | #define XML_NS 35 | #define XML_DTD 36 | 37 | #ifdef WORDS_BIGENDIAN 38 | #define XML_BYTE_ORDER 21 39 | #else 40 | #define XML_BYTE_ORDER 12 41 | #endif 42 | 43 | #define XML_CONTEXT_BYTES 1024 44 | 45 | #ifndef HAVE_MEMMOVE 46 | #ifdef HAVE_BCOPY 47 | #define memmove(d,s,l) bcopy((s),(d),(l)) 48 | #else 49 | #define memmove(d,s,l) ;punting on memmove; 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /conftools/get-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # USAGE: get-version.sh path/to/expat.h 4 | # 5 | # This script will print Expat's version number on stdout. For example: 6 | # 7 | # $ ./conftools/get-version.sh ./lib/expat.h 8 | # 1.95.3 9 | # $ 10 | # 11 | 12 | if test $# = 0; then 13 | echo "ERROR: pathname for expat.h was not provided." 14 | echo "" 15 | echo "USAGE: $0 path/to/expat.h" 16 | exit 1 17 | fi 18 | if test $# != 1; then 19 | echo "ERROR: too many arguments were provided." 20 | echo "" 21 | echo "USAGE: $0 path/to/expat.h" 22 | exit 1 23 | fi 24 | 25 | hdr="$1" 26 | if test ! -r "$hdr"; then 27 | echo "ERROR: '$hdr' does not exist, or is not readable." 28 | exit 1 29 | fi 30 | 31 | MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`" 32 | MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`" 33 | MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`" 34 | 35 | # Determine how to tell echo not to print the trailing \n. This is 36 | # similar to Autoconf's @ECHO_C@ and @ECHO_N@; however, we don't 37 | # generate this file via autoconf (in fact, get-version.sh is used 38 | # to *create* ./configure), so we just do something similar inline. 39 | case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in 40 | *c*,-n*) ECHO_N= ECHO_C=' 41 | ' ;; 42 | *c*,* ) ECHO_N=-n ECHO_C= ;; 43 | *) ECHO_N= ECHO_C='\c' ;; 44 | esac 45 | 46 | echo $ECHO_N "$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$ECHO_C" 47 | -------------------------------------------------------------------------------- /lib/macconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | ** 9 | */ 10 | 11 | #ifndef MACCONFIG_H 12 | #define MACCONFIG_H 13 | 14 | 15 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 16 | #define BYTEORDER 4321 17 | 18 | /* Define to 1 if you have the `bcopy' function. */ 19 | #undef HAVE_BCOPY 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #define HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have a working `mmap' system call. */ 25 | #undef HAVE_MMAP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* whether byteorder is bigendian */ 31 | #define WORDS_BIGENDIAN 32 | 33 | /* Define to specify how much context to retain around the current parse 34 | point. */ 35 | #undef XML_CONTEXT_BYTES 36 | 37 | /* Define to make parameter entity parsing functionality available. */ 38 | #define XML_DTD 39 | 40 | /* Define to make XML Namespaces functionality available. */ 41 | #define XML_NS 42 | 43 | /* Define to empty if `const' does not conform to ANSI C. */ 44 | #undef const 45 | 46 | /* Define to `long' if does not define. */ 47 | #define off_t long 48 | 49 | /* Define to `unsigned' if does not define. */ 50 | #undef size_t 51 | 52 | 53 | #endif /* ifndef MACCONFIG_H */ 54 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | # We need to build this for both the device (as a shared library) 4 | # and the host (as a static library for tools to use). 5 | 6 | common_SRC_FILES := \ 7 | lib/xmlparse.c \ 8 | lib/xmlrole.c \ 9 | lib/xmltok.c 10 | 11 | common_CFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H 12 | 13 | common_C_INCLUDES += \ 14 | $(LOCAL_PATH)/lib 15 | 16 | common_COPY_HEADERS_TO := libexpat 17 | common_COPY_HEADERS := \ 18 | lib/expat.h \ 19 | lib/expat_external.h 20 | 21 | # For the host 22 | # ===================================================== 23 | 24 | include $(CLEAR_VARS) 25 | 26 | LOCAL_SRC_FILES := $(common_SRC_FILES) 27 | LOCAL_CFLAGS += $(common_CFLAGS) 28 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) 29 | 30 | ifeq ($(HOST_OS),darwin) 31 | LOCAL_CFLAGS += -fno-common 32 | endif 33 | 34 | LOCAL_MODULE:= libexpat 35 | LOCAL_MODULE_TAGS := optional 36 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 37 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 38 | 39 | include $(BUILD_HOST_STATIC_LIBRARY) 40 | 41 | 42 | # For the device 43 | # ===================================================== 44 | 45 | include $(CLEAR_VARS) 46 | 47 | LOCAL_SRC_FILES := $(common_SRC_FILES) 48 | LOCAL_CFLAGS += $(common_CFLAGS) 49 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) 50 | 51 | LOCAL_MODULE:= libexpat 52 | LOCAL_MODULE_TAGS := optional 53 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 54 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 55 | 56 | include $(BUILD_SHARED_LIBRARY) 57 | 58 | -------------------------------------------------------------------------------- /amiga/include/proto/expat.h: -------------------------------------------------------------------------------- 1 | #ifndef PROTO_EXPAT_H 2 | #define PROTO_EXPAT_H 3 | 4 | #ifndef LIBRARIES_EXPAT_H 5 | #include 6 | #endif 7 | 8 | /****************************************************************************/ 9 | 10 | #ifndef __NOLIBBASE__ 11 | #ifndef __USE_BASETYPE__ 12 | extern struct Library * ExpatBase; 13 | #else 14 | extern struct Library * ExpatBase; 15 | #endif /* __USE_BASETYPE__ */ 16 | #endif /* __NOLIBBASE__ */ 17 | 18 | /****************************************************************************/ 19 | 20 | #ifdef __amigaos4__ 21 | #include 22 | #ifdef __USE_INLINE__ 23 | #include 24 | #endif /* __USE_INLINE__ */ 25 | #ifndef CLIB_EXPAT_PROTOS_H 26 | #define CLIB_EXPAT_PROTOS_H 1 27 | #endif /* CLIB_EXPAT_PROTOS_H */ 28 | #ifndef __NOGLOBALIFACE__ 29 | extern struct ExpatIFace *IExpat; 30 | #endif /* __NOGLOBALIFACE__ */ 31 | #else /* __amigaos4__ */ 32 | #ifndef CLIB_EXPAT_PROTOS_H 33 | #include 34 | #endif /* CLIB_EXPAT_PROTOS_H */ 35 | #if defined(__GNUC__) 36 | #ifndef __PPC__ 37 | #include 38 | #else 39 | #include 40 | #endif /* __PPC__ */ 41 | #elif defined(__VBCC__) 42 | #ifndef __PPC__ 43 | #include 44 | #endif /* __PPC__ */ 45 | #else 46 | #include 47 | #endif /* __GNUC__ */ 48 | #endif /* __amigaos4__ */ 49 | 50 | /****************************************************************************/ 51 | 52 | #endif /* PROTO_EXPAT_H */ 53 | -------------------------------------------------------------------------------- /xmlwf/unixfilemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifndef MAP_FILE 15 | #define MAP_FILE 0 16 | #endif 17 | 18 | #include "filemap.h" 19 | 20 | int 21 | filemap(const char *name, 22 | void (*processor)(const void *, size_t, const char *, void *arg), 23 | void *arg) 24 | { 25 | int fd; 26 | size_t nbytes; 27 | struct stat sb; 28 | void *p; 29 | 30 | fd = open(name, O_RDONLY); 31 | if (fd < 0) { 32 | perror(name); 33 | return 0; 34 | } 35 | if (fstat(fd, &sb) < 0) { 36 | perror(name); 37 | close(fd); 38 | return 0; 39 | } 40 | if (!S_ISREG(sb.st_mode)) { 41 | close(fd); 42 | fprintf(stderr, "%s: not a regular file\n", name); 43 | return 0; 44 | } 45 | 46 | nbytes = sb.st_size; 47 | /* mmap fails for zero length files */ 48 | if (nbytes == 0) { 49 | static const char c = '\0'; 50 | processor(&c, 0, name, arg); 51 | close(fd); 52 | return 1; 53 | } 54 | p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, 55 | MAP_FILE|MAP_PRIVATE, fd, (off_t)0); 56 | if (p == (void *)-1) { 57 | perror(name); 58 | close(fd); 59 | return 0; 60 | } 61 | processor(p, nbytes, name, arg); 62 | munmap((caddr_t)p, nbytes); 63 | close(fd); 64 | return 1; 65 | } 66 | -------------------------------------------------------------------------------- /conftools/expat.m4: -------------------------------------------------------------------------------- 1 | dnl Check if --with-expat[=PREFIX] is specified and 2 | dnl Expat >= 1.95.0 is installed in the system. 3 | dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to 4 | dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX 5 | dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined. 6 | dnl If --with-expat has not been specified, set with_expat to 'no'. 7 | dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly. 8 | dnl This is necessary to adapt a whole lot of packages that have expat 9 | dnl bundled as a static library. 10 | AC_DEFUN(AM_WITH_EXPAT, 11 | [ AC_ARG_WITH(expat, 12 | [ --with-expat=PREFIX Use system Expat library], 13 | , with_expat=no) 14 | 15 | AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no) 16 | 17 | EXPAT_CFLAGS= 18 | EXPAT_LIBS= 19 | if test $with_expat != no; then 20 | if test $with_expat != yes; then 21 | EXPAT_CFLAGS="-I$with_expat/include" 22 | EXPAT_LIBS="-L$with_expat/lib" 23 | fi 24 | AC_CHECK_LIB(expat, XML_ParserCreate, 25 | [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" 26 | expat_found=yes ], 27 | [ expat_found=no ], 28 | "$EXPAT_LIBS") 29 | if test $expat_found = no; then 30 | AC_MSG_ERROR([Could not find the Expat library]) 31 | fi 32 | expat_save_CFLAGS="$CFLAGS" 33 | CFLAGS="$CFLAGS $EXPAT_CFLAGS" 34 | AC_CHECK_HEADERS(expat.h, , expat_found=no) 35 | if test $expat_found = no; then 36 | AC_MSG_ERROR([Could not find expat.h]) 37 | fi 38 | CFLAGS="$expat_save_CFLAGS" 39 | fi 40 | 41 | AC_SUBST(EXPAT_CFLAGS) 42 | AC_SUBST(EXPAT_LIBS) 43 | ]) 44 | -------------------------------------------------------------------------------- /xmlwf/codepage.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include "codepage.h" 6 | 7 | #if (defined(WIN32) || (defined(__WATCOMC__) && defined(__NT__))) 8 | #define STRICT 1 9 | #define WIN32_LEAN_AND_MEAN 1 10 | 11 | #include 12 | 13 | int 14 | codepageMap(int cp, int *map) 15 | { 16 | int i; 17 | CPINFO info; 18 | if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) 19 | return 0; 20 | for (i = 0; i < 256; i++) 21 | map[i] = -1; 22 | if (info.MaxCharSize > 1) { 23 | for (i = 0; i < MAX_LEADBYTES; i+=2) { 24 | int j, lim; 25 | if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) 26 | break; 27 | lim = info.LeadByte[i + 1]; 28 | for (j = info.LeadByte[i]; j <= lim; j++) 29 | map[j] = -2; 30 | } 31 | } 32 | for (i = 0; i < 256; i++) { 33 | if (map[i] == -1) { 34 | char c = (char)i; 35 | unsigned short n; 36 | if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, 37 | &c, 1, &n, 1) == 1) 38 | map[i] = n; 39 | } 40 | } 41 | return 1; 42 | } 43 | 44 | int 45 | codepageConvert(int cp, const char *p) 46 | { 47 | unsigned short c; 48 | if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, 49 | p, 2, &c, 1) == 1) 50 | return c; 51 | return -1; 52 | } 53 | 54 | #else /* not WIN32 */ 55 | 56 | int 57 | codepageMap(int cp, int *map) 58 | { 59 | return 0; 60 | } 61 | 62 | int 63 | codepageConvert(int cp, const char *p) 64 | { 65 | return -1; 66 | } 67 | 68 | #endif /* not WIN32 */ 69 | -------------------------------------------------------------------------------- /bcb5/all_projects.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = setup libexpat_mtd.dll libexpats_mtd.lib libexpatw_mtd.dll \ 13 | libexpatws_mtd.lib elements.exe outline.exe xmlwf.exe 14 | #------------------------------------------------------------------------------ 15 | default: $(PROJECTS) 16 | #------------------------------------------------------------------------------ 17 | 18 | libexpat_mtd.dll: expat.bpr 19 | $(ROOT)\bin\bpr2mak $** 20 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 21 | 22 | libexpats_mtd.lib: expat_static.bpr 23 | $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** 24 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 25 | 26 | libexpatw_mtd.dll: expatw.bpr 27 | $(ROOT)\bin\bpr2mak $** 28 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 29 | 30 | libexpatws_mtd.lib: expatw_static.bpr 31 | $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** 32 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 33 | 34 | elements.exe: elements.bpr 35 | $(ROOT)\bin\bpr2mak $** 36 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 37 | 38 | outline.exe: outline.bpr 39 | $(ROOT)\bin\bpr2mak $** 40 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 41 | 42 | xmlwf.exe: xmlwf.bpr 43 | $(ROOT)\bin\bpr2mak $** 44 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 45 | 46 | setup: setup.bat 47 | call $** 48 | 49 | 50 | -------------------------------------------------------------------------------- /lib/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /doc/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: white; 3 | border: 0px; 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | .corner { 9 | width: 200px; 10 | height: 80px; 11 | text-align: center; 12 | } 13 | 14 | .banner { 15 | background-color: rgb(110,139,61); 16 | color: rgb(255,236,176); 17 | padding-left: 2em; 18 | } 19 | 20 | .banner h1 { 21 | font-size: 200%; 22 | } 23 | 24 | .content { 25 | padding: 0em 2em 1em 2em; 26 | } 27 | 28 | .releaseno { 29 | background-color: rgb(110,139,61); 30 | color: rgb(255,236,176); 31 | padding-bottom: 0.3em; 32 | padding-top: 0.5em; 33 | text-align: center; 34 | font-weight: bold; 35 | } 36 | 37 | .noborder { 38 | border-width: 0px; 39 | } 40 | 41 | .eg { 42 | padding-left: 1em; 43 | padding-top: .5em; 44 | padding-bottom: .5em; 45 | border: solid thin; 46 | margin: 1em 0; 47 | background-color: tan; 48 | margin-left: 2em; 49 | margin-right: 10%; 50 | } 51 | 52 | .pseudocode { 53 | padding-left: 1em; 54 | padding-top: .5em; 55 | padding-bottom: .5em; 56 | border: solid thin; 57 | margin: 1em 0; 58 | background-color: rgb(250,220,180); 59 | margin-left: 2em; 60 | margin-right: 10%; 61 | } 62 | 63 | .handler { 64 | width: 100%; 65 | border-top-width: thin; 66 | margin-bottom: 1em; 67 | } 68 | 69 | .handler p { 70 | margin-left: 2em; 71 | } 72 | 73 | .setter { 74 | font-weight: bold; 75 | } 76 | 77 | .signature { 78 | color: navy; 79 | } 80 | 81 | .fcndec { 82 | width: 100%; 83 | border-top-width: thin; 84 | font-weight: bold; 85 | } 86 | 87 | .fcndef { 88 | margin-left: 2em; 89 | margin-bottom: 2em; 90 | } 91 | 92 | dd { 93 | margin-bottom: 2em; 94 | } 95 | 96 | .cpp-symbols dt { 97 | font-family: monospace; 98 | } 99 | .cpp-symbols dd { 100 | margin-bottom: 1em; 101 | } 102 | -------------------------------------------------------------------------------- /examples/elements.c: -------------------------------------------------------------------------------- 1 | /* This is simple demonstration of how to use expat. This program 2 | reads an XML document from standard input and writes a line with 3 | the name of each element to standard output indenting child 4 | elements by one tab stop more than their parent element. 5 | It must be used with Expat compiled for UTF-8 output. 6 | */ 7 | 8 | #include 9 | #include "expat.h" 10 | 11 | #if defined(__amigaos__) && defined(__USE_INLINE__) 12 | #include 13 | #endif 14 | 15 | #ifdef XML_LARGE_SIZE 16 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 17 | #define XML_FMT_INT_MOD "I64" 18 | #else 19 | #define XML_FMT_INT_MOD "ll" 20 | #endif 21 | #else 22 | #define XML_FMT_INT_MOD "l" 23 | #endif 24 | 25 | static void XMLCALL 26 | startElement(void *userData, const char *name, const char **atts) 27 | { 28 | int i; 29 | int *depthPtr = (int *)userData; 30 | for (i = 0; i < *depthPtr; i++) 31 | putchar('\t'); 32 | puts(name); 33 | *depthPtr += 1; 34 | } 35 | 36 | static void XMLCALL 37 | endElement(void *userData, const char *name) 38 | { 39 | int *depthPtr = (int *)userData; 40 | *depthPtr -= 1; 41 | } 42 | 43 | int 44 | main(int argc, char *argv[]) 45 | { 46 | char buf[BUFSIZ]; 47 | XML_Parser parser = XML_ParserCreate(NULL); 48 | int done; 49 | int depth = 0; 50 | XML_SetUserData(parser, &depth); 51 | XML_SetElementHandler(parser, startElement, endElement); 52 | do { 53 | int len = (int)fread(buf, 1, sizeof(buf), stdin); 54 | done = len < sizeof(buf); 55 | if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { 56 | fprintf(stderr, 57 | "%s at line %" XML_FMT_INT_MOD "u\n", 58 | XML_ErrorString(XML_GetErrorCode(parser)), 59 | XML_GetCurrentLineNumber(parser)); 60 | return 1; 61 | } 62 | } while (!done); 63 | XML_ParserFree(parser); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /lib/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /amiga/launch.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2001-2007 Expat maintainers. 3 | ** 4 | ** Permission is hereby granted, free of charge, to any person obtaining 5 | ** a copy of this software and associated documentation files (the 6 | ** "Software"), to deal in the Software without restriction, including 7 | ** without limitation the rights to use, copy, modify, merge, publish, 8 | ** distribute, sublicense, and/or sell copies of the Software, and to 9 | ** permit persons to whom the Software is furnished to do so, subject to 10 | ** the following conditions: 11 | ** 12 | ** The above copyright notice and this permission notice shall be included 13 | ** in all copies or substantial portions of the Software. 14 | ** 15 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | struct Library* ExpatBase = 0; 28 | struct ExpatIFace* IExpat = 0; 29 | 30 | 31 | void setup() __attribute__((constructor)); 32 | void cleanup() __attribute__((destructor)); 33 | 34 | 35 | void setup() 36 | { 37 | ExpatBase = OpenLibrary("expat.library", 4); 38 | IExpat = (struct ExpatIFace*)GetInterface(ExpatBase, "main", 1, NULL); 39 | if ( IExpat == 0 ) { 40 | DebugPrintF("Can't open expat.library\n"); 41 | } 42 | } 43 | 44 | 45 | void cleanup() 46 | { 47 | if ( IExpat != 0 ) { 48 | DropInterface((struct Interface*)IExpat); 49 | IExpat = 0; 50 | } 51 | 52 | if ( ExpatBase != 0 ) { 53 | CloseLibrary(ExpatBase); 54 | ExpatBase = 0; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /lib/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /amiga/README.txt: -------------------------------------------------------------------------------- 1 | SUMMARY 2 | ======= 3 | This is a port of expat for AmigaOS 4.0 which includes the 4 | SDK, some XML tools and the libraries. 5 | 6 | Both static and shared library versions are supported. 7 | 8 | The static library version is limited to clib2 although it should 9 | be possible to use newlib with the appopriate compile options. 10 | 11 | The shared library version is based on the work of Fredrik Wikstrom 12 | and is currently limited to PPC only. 13 | 14 | 15 | HISTORY 16 | ======= 17 | 4.2 - updated to correspond to Expat 2.0.1 release 18 | - bumped copyright banners and versions 19 | - simplified amigaconfig.h 20 | - updated include/libraries/expat.h file 21 | - modified launch.c to use contructor/deconstructor 22 | - removed need for amiga_main() from expat utilities 23 | 24 | 4.1 - fixed memory freeing bug in shared library version 25 | - now allocates shared memory 26 | 27 | 4.0 - updated for corresponding Expat 2.0 release 28 | - some minor CVS related changes 29 | 30 | 3.1 - removed obsolete sfd file 31 | - added library description xml file 32 | - refactored Makefile 33 | - removed extraneous VARARGS68K keywords 34 | - reworked default memory handling functions in shared lib 35 | - updated amigaconfig.h 36 | 37 | 3.0 - initial release 38 | - based on expat 1.95.8 39 | 40 | 41 | BUILDING 42 | ======== 43 | To build expat.library, xmlwf tool, examples and run the test suite, 44 | simply type 'make all' in the amiga subdirectory. 45 | 46 | The test suite will compile and run for both the static and shared 47 | library versions. 48 | 49 | 50 | INSTALLATION 51 | ============ 52 | To install both static and shared versions of expat into the 53 | AmigaOS SDK type 'make install' in the amiga subdirectory. 54 | 55 | 56 | CONFIGURATION 57 | ============= 58 | You may want to edit the lib/amigaconfig.h file to remove 59 | DTD and/or XML namespace support if they are not required by your 60 | specific application for a smaller and faster implementation. 61 | 62 | 63 | TO DO 64 | ===== 65 | - wide character support (UTF-16) 66 | - provide 68k backwards compatibility 67 | -------------------------------------------------------------------------------- /xmlwf/readfilemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef __WATCOMC__ 12 | #ifndef __LINUX__ 13 | #include 14 | #else 15 | #include 16 | #endif 17 | #endif 18 | 19 | #ifdef __BEOS__ 20 | #include 21 | #endif 22 | 23 | #ifndef S_ISREG 24 | #ifndef S_IFREG 25 | #define S_IFREG _S_IFREG 26 | #endif 27 | #ifndef S_IFMT 28 | #define S_IFMT _S_IFMT 29 | #endif 30 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 31 | #endif /* not S_ISREG */ 32 | 33 | #ifndef O_BINARY 34 | #ifdef _O_BINARY 35 | #define O_BINARY _O_BINARY 36 | #else 37 | #define O_BINARY 0 38 | #endif 39 | #endif 40 | 41 | #include "filemap.h" 42 | 43 | int 44 | filemap(const char *name, 45 | void (*processor)(const void *, size_t, const char *, void *arg), 46 | void *arg) 47 | { 48 | size_t nbytes; 49 | int fd; 50 | int n; 51 | struct stat sb; 52 | void *p; 53 | 54 | fd = open(name, O_RDONLY|O_BINARY); 55 | if (fd < 0) { 56 | perror(name); 57 | return 0; 58 | } 59 | if (fstat(fd, &sb) < 0) { 60 | perror(name); 61 | return 0; 62 | } 63 | if (!S_ISREG(sb.st_mode)) { 64 | fprintf(stderr, "%s: not a regular file\n", name); 65 | return 0; 66 | } 67 | nbytes = sb.st_size; 68 | /* malloc will return NULL with nbytes == 0, handle files with size 0 */ 69 | if (nbytes == 0) { 70 | static const char c = '\0'; 71 | processor(&c, 0, name, arg); 72 | close(fd); 73 | return 1; 74 | } 75 | p = malloc(nbytes); 76 | if (!p) { 77 | fprintf(stderr, "%s: out of memory\n", name); 78 | close(fd); 79 | return 0; 80 | } 81 | n = read(fd, p, nbytes); 82 | if (n < 0) { 83 | perror(name); 84 | free(p); 85 | close(fd); 86 | return 0; 87 | } 88 | if (n != nbytes) { 89 | fprintf(stderr, "%s: read unexpected number of bytes\n", name); 90 | free(p); 91 | close(fd); 92 | return 0; 93 | } 94 | processor(p, nbytes, name, arg); 95 | free(p); 96 | close(fd); 97 | return 1; 98 | } 99 | -------------------------------------------------------------------------------- /lib/internal.h: -------------------------------------------------------------------------------- 1 | /* internal.h 2 | 3 | Internal definitions used by Expat. This is not needed to compile 4 | client code. 5 | 6 | The following calling convention macros are defined for frequently 7 | called functions: 8 | 9 | FASTCALL - Used for those internal functions that have a simple 10 | body and a low number of arguments and local variables. 11 | 12 | PTRCALL - Used for functions called though function pointers. 13 | 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. 15 | 16 | inline - Used for selected internal functions for which inlining 17 | may improve performance on some platforms. 18 | 19 | Note: Use of these macros is based on judgement, not hard rules, 20 | and therefore subject to change. 21 | */ 22 | 23 | #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) 24 | /* We'll use this version by default only where we know it helps. 25 | 26 | regparm() generates warnings on Solaris boxes. See SF bug #692878. 27 | 28 | Instability reported with egcs on a RedHat Linux 7.3. 29 | Let's comment out: 30 | #define FASTCALL __attribute__((stdcall, regparm(3))) 31 | and let's try this: 32 | */ 33 | #define FASTCALL __attribute__((regparm(3))) 34 | #define PTRFASTCALL __attribute__((regparm(3))) 35 | #endif 36 | 37 | /* Using __fastcall seems to have an unexpected negative effect under 38 | MS VC++, especially for function pointers, so we won't use it for 39 | now on that platform. It may be reconsidered for a future release 40 | if it can be made more effective. 41 | Likely reason: __fastcall on Windows is like stdcall, therefore 42 | the compiler cannot perform stack optimizations for call clusters. 43 | */ 44 | 45 | /* Make sure all of these are defined if they aren't already. */ 46 | 47 | #ifndef FASTCALL 48 | #define FASTCALL 49 | #endif 50 | 51 | #ifndef PTRCALL 52 | #define PTRCALL 53 | #endif 54 | 55 | #ifndef PTRFASTCALL 56 | #define PTRFASTCALL 57 | #endif 58 | 59 | #ifndef XML_MIN_SIZE 60 | #if !defined(__cplusplus) && !defined(inline) 61 | #ifdef __GNUC__ 62 | #define inline __inline 63 | #endif /* __GNUC__ */ 64 | #endif 65 | #endif /* XML_MIN_SIZE */ 66 | 67 | #ifdef __cplusplus 68 | #define inline inline 69 | #else 70 | #ifndef inline 71 | #define inline 72 | #endif 73 | #endif 74 | -------------------------------------------------------------------------------- /lib/libexpat.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | -------------------------------------------------------------------------------- /lib/libexpatw.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | -------------------------------------------------------------------------------- /vms/descrip.mms: -------------------------------------------------------------------------------- 1 | # Bare bones description file (Makefile) for OpenVMS 2 | 3 | PACKAGE = expat 4 | VERSION = 1.95.8 5 | EXPAT_MAJOR_VERSION=1 6 | EXPAT_MINOR_VERSION=95 7 | EXPAT_EDIT=8 8 | 9 | O = .obj 10 | OLB = .olb 11 | 12 | LIBRARY = expat$(OLB) 13 | LIBDIR = [.lib] 14 | SOURCES = $(LIBDIR)xmlparse.c $(LIBDIR)xmltok.c $(LIBDIR)xmlrole.c 15 | OBJECTS = xmlparse$(O) xmltok$(O) xmlrole$(O) 16 | 17 | TEMPLATES = xmltok_impl.c xmltok_ns.c 18 | APIHEADER = $(LIBDIR)expat.h 19 | HEADERS = $(LIBDIR)ascii.h $(LIBDIR)iasciitab.h $(LIBDIR)utf8tab.h $(LIBDIR)xmltok.h \ 20 | $(LIBDIR)asciitab.h $(LIBDIR)latin1tab.h \ 21 | $(LIBDIR)nametab.h $(LIBDIR)xmldef.h $(LIBDIR)xmlrole.h $(LIBDIR)xmltok_impl.h 22 | 23 | CONFIG_HEADER = expat_config.h 24 | INCLUDES = /INCLUDE=([],[.lib]) 25 | DEFS = /DEFINE=(PACKAGE="""$(PACKAGE)""",VERSION="""$(PACKAGE)_$(VERSION)""",HAVE_EXPAT_CONFIG_H) 26 | LIBREVISION = 0 27 | LIBCURRENT = 1 28 | LIBAGE = 0 29 | # 30 | COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) 31 | # 32 | # DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEMPLATES) $(APIHEADER) $(HEADERS) 33 | # 34 | # TAR = gtar 35 | # GZIP_ENV = --best 36 | # 37 | .FIRST : 38 | IF F$SEARCH("$(LIBRARY)") .EQS. "" THEN $(LIBR) /CREATE /OBJECT $(LIBRARY) 39 | 40 | all : $(LIBRARY) 41 | @ write sys$output "All made." 42 | 43 | .SUFFIXES : 44 | .SUFFIXES : $(OLB) $(O) .C .H 45 | 46 | .c$(O) : 47 | $(COMPILE) $(MMS$SOURCE) 48 | 49 | $(O)$(OLB) : 50 | @ IF F$SEARCH("$(MMS$TARGET)") .EQS. "" - 51 | THEN LIBRARY/CREATE/LOG $(MMS$TARGET) 52 | @ LIBRARY /REPLACE /LOG $(MMS$TARGET) $(MMS$SOURCE) 53 | 54 | clean : 55 | DELETE $(LIBRARY);*,*$(O);* 56 | 57 | $(LIBRARY) : $(LIBRARY)( $(OBJECTS) ) 58 | $(LIBR) /COMPRESS $(MMS$TARGET) 59 | 60 | $(CONFIG_HEADER) : [.vms]expat_config.h 61 | COPY/LOG $(MMS$SOURCE) $(MMS$TARGET) 62 | 63 | xmlparse$(O) : $(LIBDIR)xmlparse.c $(LIBDIR)expat.h $(LIBDIR)xmlrole.h $(LIBDIR)xmltok.h $(CONFIG_HEADER) 64 | 65 | xmlrole$(O) : $(LIBDIR)xmlrole.c $(LIBDIR)ascii.h $(LIBDIR)xmlrole.h $(CONFIG_HEADER) 66 | 67 | xmltok$(O) : $(LIBDIR)xmltok.c $(LIBDIR)xmltok_impl.c $(LIBDIR)xmltok_ns.c \ 68 | $(LIBDIR)ascii.h $(LIBDIR)asciitab.h $(LIBDIR)iasciitab.h $(LIBDIR)latin1tab.h \ 69 | $(LIBDIR)nametab.h $(LIBDIR)utf8tab.h $(LIBDIR)xmltok.h $(LIBDIR)xmltok_impl.h $(CONFIG_HEADER) 70 | 71 | -------------------------------------------------------------------------------- /lib/ascii.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define ASCII_A 0x41 6 | #define ASCII_B 0x42 7 | #define ASCII_C 0x43 8 | #define ASCII_D 0x44 9 | #define ASCII_E 0x45 10 | #define ASCII_F 0x46 11 | #define ASCII_G 0x47 12 | #define ASCII_H 0x48 13 | #define ASCII_I 0x49 14 | #define ASCII_J 0x4A 15 | #define ASCII_K 0x4B 16 | #define ASCII_L 0x4C 17 | #define ASCII_M 0x4D 18 | #define ASCII_N 0x4E 19 | #define ASCII_O 0x4F 20 | #define ASCII_P 0x50 21 | #define ASCII_Q 0x51 22 | #define ASCII_R 0x52 23 | #define ASCII_S 0x53 24 | #define ASCII_T 0x54 25 | #define ASCII_U 0x55 26 | #define ASCII_V 0x56 27 | #define ASCII_W 0x57 28 | #define ASCII_X 0x58 29 | #define ASCII_Y 0x59 30 | #define ASCII_Z 0x5A 31 | 32 | #define ASCII_a 0x61 33 | #define ASCII_b 0x62 34 | #define ASCII_c 0x63 35 | #define ASCII_d 0x64 36 | #define ASCII_e 0x65 37 | #define ASCII_f 0x66 38 | #define ASCII_g 0x67 39 | #define ASCII_h 0x68 40 | #define ASCII_i 0x69 41 | #define ASCII_j 0x6A 42 | #define ASCII_k 0x6B 43 | #define ASCII_l 0x6C 44 | #define ASCII_m 0x6D 45 | #define ASCII_n 0x6E 46 | #define ASCII_o 0x6F 47 | #define ASCII_p 0x70 48 | #define ASCII_q 0x71 49 | #define ASCII_r 0x72 50 | #define ASCII_s 0x73 51 | #define ASCII_t 0x74 52 | #define ASCII_u 0x75 53 | #define ASCII_v 0x76 54 | #define ASCII_w 0x77 55 | #define ASCII_x 0x78 56 | #define ASCII_y 0x79 57 | #define ASCII_z 0x7A 58 | 59 | #define ASCII_0 0x30 60 | #define ASCII_1 0x31 61 | #define ASCII_2 0x32 62 | #define ASCII_3 0x33 63 | #define ASCII_4 0x34 64 | #define ASCII_5 0x35 65 | #define ASCII_6 0x36 66 | #define ASCII_7 0x37 67 | #define ASCII_8 0x38 68 | #define ASCII_9 0x39 69 | 70 | #define ASCII_TAB 0x09 71 | #define ASCII_SPACE 0x20 72 | #define ASCII_EXCL 0x21 73 | #define ASCII_QUOT 0x22 74 | #define ASCII_AMP 0x26 75 | #define ASCII_APOS 0x27 76 | #define ASCII_MINUS 0x2D 77 | #define ASCII_PERIOD 0x2E 78 | #define ASCII_COLON 0x3A 79 | #define ASCII_SEMI 0x3B 80 | #define ASCII_LT 0x3C 81 | #define ASCII_EQUALS 0x3D 82 | #define ASCII_GT 0x3E 83 | #define ASCII_LSQB 0x5B 84 | #define ASCII_RSQB 0x5D 85 | #define ASCII_UNDERSCORE 0x5F 86 | #define ASCII_LPAREN 0x28 87 | #define ASCII_RPAREN 0x29 88 | #define ASCII_FF 0x0C 89 | #define ASCII_SLASH 0x2F 90 | #define ASCII_HASH 0x23 91 | #define ASCII_PIPE 0x7C 92 | #define ASCII_COMMA 0x2C 93 | -------------------------------------------------------------------------------- /CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | -------------------------------------------------------------------------------- /xmlwf/win32filemap.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define STRICT 1 6 | #define WIN32_LEAN_AND_MEAN 1 7 | 8 | #ifdef XML_UNICODE_WCHAR_T 9 | #ifndef XML_UNICODE 10 | #define XML_UNICODE 11 | #endif 12 | #endif 13 | 14 | #ifdef XML_UNICODE 15 | #define UNICODE 16 | #define _UNICODE 17 | #endif /* XML_UNICODE */ 18 | #include 19 | #include 20 | #include 21 | #include "filemap.h" 22 | 23 | static void win32perror(const TCHAR *); 24 | 25 | int 26 | filemap(const TCHAR *name, 27 | void (*processor)(const void *, size_t, const TCHAR *, void *arg), 28 | void *arg) 29 | { 30 | HANDLE f; 31 | HANDLE m; 32 | DWORD size; 33 | DWORD sizeHi; 34 | void *p; 35 | 36 | f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 37 | FILE_FLAG_SEQUENTIAL_SCAN, NULL); 38 | if (f == INVALID_HANDLE_VALUE) { 39 | win32perror(name); 40 | return 0; 41 | } 42 | size = GetFileSize(f, &sizeHi); 43 | if (size == (DWORD)-1) { 44 | win32perror(name); 45 | return 0; 46 | } 47 | if (sizeHi) { 48 | _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name); 49 | return 0; 50 | } 51 | /* CreateFileMapping barfs on zero length files */ 52 | if (size == 0) { 53 | static const char c = '\0'; 54 | processor(&c, 0, name, arg); 55 | CloseHandle(f); 56 | return 1; 57 | } 58 | m = CreateFileMapping(f, NULL, PAGE_READONLY, 0, 0, NULL); 59 | if (m == NULL) { 60 | win32perror(name); 61 | CloseHandle(f); 62 | return 0; 63 | } 64 | p = MapViewOfFile(m, FILE_MAP_READ, 0, 0, 0); 65 | if (p == NULL) { 66 | win32perror(name); 67 | CloseHandle(m); 68 | CloseHandle(f); 69 | return 0; 70 | } 71 | processor(p, size, name, arg); 72 | UnmapViewOfFile(p); 73 | CloseHandle(m); 74 | CloseHandle(f); 75 | return 1; 76 | } 77 | 78 | static void 79 | win32perror(const TCHAR *s) 80 | { 81 | LPVOID buf; 82 | if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER 83 | | FORMAT_MESSAGE_FROM_SYSTEM, 84 | NULL, 85 | GetLastError(), 86 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 87 | (LPTSTR) &buf, 88 | 0, 89 | NULL)) { 90 | _ftprintf(stderr, _T("%s: %s"), s, buf); 91 | fflush(stderr); 92 | LocalFree(buf); 93 | } 94 | else 95 | _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); 96 | } 97 | -------------------------------------------------------------------------------- /expat.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "elements"=.\examples\elements.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name expat_static 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "expat"=.\lib\expat.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "expat_static"=.\lib\expat_static.dsp - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | Project: "expatw"=.\lib\expatw.dsp - Package Owner=<4> 46 | 47 | Package=<5> 48 | {{{ 49 | }}} 50 | 51 | Package=<4> 52 | {{{ 53 | }}} 54 | 55 | ############################################################################### 56 | 57 | Project: "expatw_static"=.\lib\expatw_static.dsp - Package Owner=<4> 58 | 59 | Package=<5> 60 | {{{ 61 | }}} 62 | 63 | Package=<4> 64 | {{{ 65 | }}} 66 | 67 | ############################################################################### 68 | 69 | Project: "outline"=.\examples\outline.dsp - Package Owner=<4> 70 | 71 | Package=<5> 72 | {{{ 73 | }}} 74 | 75 | Package=<4> 76 | {{{ 77 | Begin Project Dependency 78 | Project_Dep_Name expat 79 | End Project Dependency 80 | }}} 81 | 82 | ############################################################################### 83 | 84 | Project: "xmlwf"=.\xmlwf\xmlwf.dsp - Package Owner=<4> 85 | 86 | Package=<5> 87 | {{{ 88 | }}} 89 | 90 | Package=<4> 91 | {{{ 92 | Begin Project Dependency 93 | Project_Dep_Name expat 94 | End Project Dependency 95 | }}} 96 | 97 | ############################################################################### 98 | 99 | Global: 100 | 101 | Package=<5> 102 | {{{ 103 | }}} 104 | 105 | Package=<3> 106 | {{{ 107 | }}} 108 | 109 | ############################################################################### 110 | 111 | -------------------------------------------------------------------------------- /tests/minicheck.h: -------------------------------------------------------------------------------- 1 | /* Miniature re-implementation of the "check" library. 2 | * 3 | * This is intended to support just enough of check to run the Expat 4 | * tests. This interface is based entirely on the portion of the 5 | * check library being used. 6 | * 7 | * This is *source* compatible, but not necessary *link* compatible. 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define CK_NOFORK 0 15 | #define CK_FORK 1 16 | 17 | #define CK_SILENT 0 18 | #define CK_NORMAL 1 19 | #define CK_VERBOSE 2 20 | 21 | /* Workaround for Tru64 Unix systems where the C compiler has a working 22 | __func__, but the C++ compiler only has a working __FUNCTION__. This 23 | could be fixed in configure.in, but it's not worth it right now. */ 24 | #if defined(__osf__) && defined(__cplusplus) 25 | #define __func__ __FUNCTION__ 26 | #endif 27 | 28 | #define START_TEST(testname) static void testname(void) { \ 29 | _check_set_test_info(__func__, __FILE__, __LINE__); \ 30 | { 31 | #define END_TEST } } 32 | 33 | #define fail(msg) _fail_unless(0, __FILE__, __LINE__, msg) 34 | 35 | typedef void (*tcase_setup_function)(void); 36 | typedef void (*tcase_teardown_function)(void); 37 | typedef void (*tcase_test_function)(void); 38 | 39 | typedef struct SRunner SRunner; 40 | typedef struct Suite Suite; 41 | typedef struct TCase TCase; 42 | 43 | struct SRunner { 44 | Suite *suite; 45 | int nchecks; 46 | int nfailures; 47 | }; 48 | 49 | struct Suite { 50 | char *name; 51 | TCase *tests; 52 | }; 53 | 54 | struct TCase { 55 | char *name; 56 | tcase_setup_function setup; 57 | tcase_teardown_function teardown; 58 | tcase_test_function *tests; 59 | int ntests; 60 | int allocated; 61 | TCase *next_tcase; 62 | }; 63 | 64 | 65 | /* Internal helper. */ 66 | void _check_set_test_info(char const *function, 67 | char const *filename, int lineno); 68 | 69 | 70 | /* 71 | * Prototypes for the actual implementation. 72 | */ 73 | 74 | void _fail_unless(int condition, const char *file, int line, char *msg); 75 | Suite *suite_create(char *name); 76 | TCase *tcase_create(char *name); 77 | void suite_add_tcase(Suite *suite, TCase *tc); 78 | void tcase_add_checked_fixture(TCase *, 79 | tcase_setup_function, 80 | tcase_teardown_function); 81 | void tcase_add_test(TCase *tc, tcase_test_function test); 82 | SRunner *srunner_create(Suite *suite); 83 | void srunner_run_all(SRunner *runner, int verbosity); 84 | int srunner_ntests_failed(SRunner *runner); 85 | void srunner_free(SRunner *runner); 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | -------------------------------------------------------------------------------- /expat_config.h.in: -------------------------------------------------------------------------------- 1 | /* expat_config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 4 | #undef BYTEORDER 5 | 6 | /* Define to 1 if you have the `bcopy' function. */ 7 | #undef HAVE_BCOPY 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_DLFCN_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_FCNTL_H 14 | 15 | /* Define to 1 if you have the `getpagesize' function. */ 16 | #undef HAVE_GETPAGESIZE 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_INTTYPES_H 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #undef HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_MEMORY_H 26 | 27 | /* Define to 1 if you have a working `mmap' system call. */ 28 | #undef HAVE_MMAP 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STDINT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STDLIB_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_STRINGS_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_STRING_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_STAT_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_SYS_TYPES_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_UNISTD_H 50 | 51 | /* Define to the address where bug reports for this package should be sent. */ 52 | #undef PACKAGE_BUGREPORT 53 | 54 | /* Define to the full name of this package. */ 55 | #undef PACKAGE_NAME 56 | 57 | /* Define to the full name and version of this package. */ 58 | #undef PACKAGE_STRING 59 | 60 | /* Define to the one symbol short name of this package. */ 61 | #undef PACKAGE_TARNAME 62 | 63 | /* Define to the version of this package. */ 64 | #undef PACKAGE_VERSION 65 | 66 | /* Define to 1 if you have the ANSI C header files. */ 67 | #undef STDC_HEADERS 68 | 69 | /* whether byteorder is bigendian */ 70 | #undef WORDS_BIGENDIAN 71 | 72 | /* Define to specify how much context to retain around the current parse 73 | point. */ 74 | #undef XML_CONTEXT_BYTES 75 | 76 | /* Define to make parameter entity parsing functionality available. */ 77 | #undef XML_DTD 78 | 79 | /* Define to make XML Namespaces functionality available. */ 80 | #undef XML_NS 81 | 82 | /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ 83 | #undef __func__ 84 | 85 | /* Define to empty if `const' does not conform to ANSI C. */ 86 | #undef const 87 | 88 | /* Define to `long' if does not define. */ 89 | #undef off_t 90 | 91 | /* Define to `unsigned' if does not define. */ 92 | #undef size_t 93 | -------------------------------------------------------------------------------- /amiga/stdlib.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2001-2007 Expat maintainers. 3 | ** 4 | ** Permission is hereby granted, free of charge, to any person obtaining 5 | ** a copy of this software and associated documentation files (the 6 | ** "Software"), to deal in the Software without restriction, including 7 | ** without limitation the rights to use, copy, modify, merge, publish, 8 | ** distribute, sublicense, and/or sell copies of the Software, and to 9 | ** permit persons to whom the Software is furnished to do so, subject to 10 | ** the following conditions: 11 | ** 12 | ** The above copyright notice and this permission notice shall be included 13 | ** in all copies or substantial portions of the Software. 14 | ** 15 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | void * malloc (size_t len) 30 | { 31 | uint32 size = sizeof(uint32) + len; 32 | 33 | uint32 *mem = AllocMem(size, MEMF_SHARED); 34 | if ( mem != 0 ) { 35 | *mem = size; 36 | ++mem; 37 | } 38 | 39 | return mem; 40 | } 41 | 42 | 43 | void * realloc (void * mem, size_t len2) 44 | { 45 | if ( mem == 0 ) { 46 | return malloc(len2); 47 | } 48 | 49 | if ( len2 == 0 ) { 50 | free(mem); 51 | return 0; 52 | } 53 | 54 | void * new_mem = malloc(len2); 55 | if ( new_mem == 0 ) { 56 | return 0; 57 | } 58 | 59 | uint32 mem_size = *(((uint32*)mem) - 1); 60 | CopyMem(mem, new_mem, mem_size); 61 | free(mem); 62 | 63 | return new_mem; 64 | } 65 | 66 | 67 | void free (void * mem) 68 | { 69 | if ( mem != 0 ) { 70 | uint32 * size_ptr = ((uint32*)mem) - 1; 71 | FreeMem(size_ptr, *size_ptr); 72 | } 73 | } 74 | 75 | 76 | int memcmp (const void * a, const void * b, size_t len) 77 | { 78 | size_t i; 79 | int diff; 80 | 81 | for ( i = 0; i < len; ++i ) { 82 | diff = *((uint8 *)a++) - *((uint8 *)b++); 83 | if ( diff ) { 84 | return diff; 85 | } 86 | } 87 | 88 | return 0; 89 | } 90 | 91 | 92 | void * memcpy (void * t, const void * a, size_t len) 93 | { 94 | CopyMem((APTR)a, t, len); 95 | return t; 96 | } 97 | 98 | 99 | void * memmove (void * t1, const void * t2, size_t len) 100 | { 101 | MoveMem((APTR)t2, t1, len); 102 | return t1; 103 | } 104 | 105 | 106 | void * memset (void * t, int c, size_t len) 107 | { 108 | return SetMem(t, c, len); 109 | } 110 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | amiga/stdlib.c 2 | amiga/launch.c 3 | amiga/expat_vectors.c 4 | amiga/expat_lib.c 5 | amiga/expat.xml 6 | amiga/README.txt 7 | amiga/Makefile 8 | amiga/include/proto/expat.h 9 | amiga/include/libraries/expat.h 10 | amiga/include/interfaces/expat.h 11 | amiga/include/inline4/expat.h 12 | bcb5/README.txt 13 | bcb5/all_projects.bpg 14 | bcb5/elements.bpf 15 | bcb5/elements.bpr 16 | bcb5/elements.mak 17 | bcb5/expat.bpf 18 | bcb5/expat.bpr 19 | bcb5/expat.mak 20 | bcb5/expat_static.bpf 21 | bcb5/expat_static.bpr 22 | bcb5/expat_static.mak 23 | bcb5/expatw.bpf 24 | bcb5/expatw.bpr 25 | bcb5/expatw.mak 26 | bcb5/expatw_static.bpf 27 | bcb5/expatw_static.bpr 28 | bcb5/expatw_static.mak 29 | bcb5/libexpat_mtd.def 30 | bcb5/libexpatw_mtd.def 31 | bcb5/makefile.mak 32 | bcb5/outline.bpf 33 | bcb5/outline.bpr 34 | bcb5/outline.mak 35 | bcb5/setup.bat 36 | bcb5/xmlwf.bpf 37 | bcb5/xmlwf.bpr 38 | bcb5/xmlwf.mak 39 | doc/expat.png 40 | doc/reference.html 41 | doc/style.css 42 | doc/valid-xhtml10.png 43 | doc/xmlwf.1 44 | doc/xmlwf.sgml 45 | COPYING 46 | Changes 47 | MANIFEST 48 | Makefile.in 49 | README 50 | configure 51 | configure.in 52 | expat_config.h.in 53 | expat.dsw 54 | conftools/PrintPath 55 | conftools/ac_c_bigendian_cross.m4 56 | conftools/config.guess 57 | conftools/config.sub 58 | conftools/expat.m4 59 | conftools/get-version.sh 60 | conftools/install-sh 61 | conftools/libtool.m4 62 | conftools/ltmain.sh 63 | conftools/mkinstalldirs 64 | examples/elements.c 65 | examples/elements.dsp 66 | examples/outline.c 67 | examples/outline.dsp 68 | lib/Makefile.MPW 69 | lib/amigaconfig.h 70 | lib/ascii.h 71 | lib/asciitab.h 72 | lib/expat.dsp 73 | lib/expat.h 74 | lib/expat_external.h 75 | lib/expat_static.dsp 76 | lib/expatw.dsp 77 | lib/expatw_static.dsp 78 | lib/iasciitab.h 79 | lib/internal.h 80 | lib/latin1tab.h 81 | lib/libexpat.def 82 | lib/libexpatw.def 83 | lib/macconfig.h 84 | lib/nametab.h 85 | lib/utf8tab.h 86 | lib/winconfig.h 87 | lib/xmlparse.c 88 | lib/xmlrole.c 89 | lib/xmlrole.h 90 | lib/xmltok.c 91 | lib/xmltok.h 92 | lib/xmltok_impl.c 93 | lib/xmltok_impl.h 94 | lib/xmltok_ns.c 95 | tests/benchmark/README.txt 96 | tests/benchmark/benchmark.c 97 | tests/benchmark/benchmark.dsp 98 | tests/benchmark/benchmark.dsw 99 | tests/README.txt 100 | tests/chardata.c 101 | tests/chardata.h 102 | tests/minicheck.c 103 | tests/minicheck.h 104 | tests/runtests.c 105 | tests/runtestspp.cpp 106 | tests/xmltest.sh 107 | vms/README.vms 108 | vms/descrip.mms 109 | vms/expat_config.h 110 | win32/MANIFEST.txt 111 | win32/README.txt 112 | win32/expat.iss 113 | xmlwf/codepage.c 114 | xmlwf/codepage.h 115 | xmlwf/ct.c 116 | xmlwf/filemap.h 117 | xmlwf/readfilemap.c 118 | xmlwf/unixfilemap.c 119 | xmlwf/win32filemap.c 120 | xmlwf/xmlfile.c 121 | xmlwf/xmlfile.h 122 | xmlwf/xmlmime.c 123 | xmlwf/xmlmime.h 124 | xmlwf/xmltchar.h 125 | xmlwf/xmlurl.h 126 | xmlwf/xmlwf.c 127 | xmlwf/xmlwf.dsp 128 | xmlwf/xmlwin32url.cxx 129 | -------------------------------------------------------------------------------- /examples/outline.c: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * outline.c 3 | * 4 | * Copyright 1999, Clark Cooper 5 | * All rights reserved. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the license contained in the 9 | * COPYING file that comes with the expat distribution. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 12 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 13 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 15 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 16 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | * 19 | * Read an XML document from standard input and print an element 20 | * outline on standard output. 21 | * Must be used with Expat compiled for UTF-8 output. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | 28 | #if defined(__amigaos__) && defined(__USE_INLINE__) 29 | #include 30 | #endif 31 | 32 | #ifdef XML_LARGE_SIZE 33 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 34 | #define XML_FMT_INT_MOD "I64" 35 | #else 36 | #define XML_FMT_INT_MOD "ll" 37 | #endif 38 | #else 39 | #define XML_FMT_INT_MOD "l" 40 | #endif 41 | 42 | #define BUFFSIZE 8192 43 | 44 | char Buff[BUFFSIZE]; 45 | 46 | int Depth; 47 | 48 | static void XMLCALL 49 | start(void *data, const char *el, const char **attr) 50 | { 51 | int i; 52 | 53 | for (i = 0; i < Depth; i++) 54 | printf(" "); 55 | 56 | printf("%s", el); 57 | 58 | for (i = 0; attr[i]; i += 2) { 59 | printf(" %s='%s'", attr[i], attr[i + 1]); 60 | } 61 | 62 | printf("\n"); 63 | Depth++; 64 | } 65 | 66 | static void XMLCALL 67 | end(void *data, const char *el) 68 | { 69 | Depth--; 70 | } 71 | 72 | int 73 | main(int argc, char *argv[]) 74 | { 75 | XML_Parser p = XML_ParserCreate(NULL); 76 | if (! p) { 77 | fprintf(stderr, "Couldn't allocate memory for parser\n"); 78 | exit(-1); 79 | } 80 | 81 | XML_SetElementHandler(p, start, end); 82 | 83 | for (;;) { 84 | int done; 85 | int len; 86 | 87 | len = (int)fread(Buff, 1, BUFFSIZE, stdin); 88 | if (ferror(stdin)) { 89 | fprintf(stderr, "Read error\n"); 90 | exit(-1); 91 | } 92 | done = feof(stdin); 93 | 94 | if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { 95 | fprintf(stderr, "Parse error at line %" XML_FMT_INT_MOD "u:\n%s\n", 96 | XML_GetCurrentLineNumber(p), 97 | XML_ErrorString(XML_GetErrorCode(p))); 98 | exit(-1); 99 | } 100 | 101 | if (done) 102 | break; 103 | } 104 | XML_ParserFree(p); 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /expat_config.h: -------------------------------------------------------------------------------- 1 | /* expat_config.h. Generated by configure. */ 2 | /* expat_config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 1234 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_DLFCN_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_FCNTL_H 1 15 | 16 | /* Define to 1 if you have the `getpagesize' function. */ 17 | #define HAVE_GETPAGESIZE 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_INTTYPES_H 1 21 | 22 | /* Define to 1 if you have the `memmove' function. */ 23 | #define HAVE_MEMMOVE 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_MEMORY_H 1 27 | 28 | /* Define to 1 if you have a working `mmap' system call. */ 29 | #define HAVE_MMAP 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STDINT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_STDLIB_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #define HAVE_STRINGS_H 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_STRING_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_SYS_STAT_H 1 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #define HAVE_SYS_TYPES_H 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_UNISTD_H 1 51 | 52 | /* Define to the address where bug reports for this package should be sent. */ 53 | #define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" 54 | 55 | /* Define to the full name of this package. */ 56 | #define PACKAGE_NAME "expat" 57 | 58 | /* Define to the full name and version of this package. */ 59 | #define PACKAGE_STRING "expat 2.0.1" 60 | 61 | /* Define to the one symbol short name of this package. */ 62 | #define PACKAGE_TARNAME "expat" 63 | 64 | /* Define to the version of this package. */ 65 | #define PACKAGE_VERSION "2.0.1" 66 | 67 | /* Define to 1 if you have the ANSI C header files. */ 68 | #define STDC_HEADERS 1 69 | 70 | /* whether byteorder is bigendian */ 71 | /* #undef WORDS_BIGENDIAN */ 72 | 73 | /* Define to specify how much context to retain around the current parse 74 | point. */ 75 | #define XML_CONTEXT_BYTES 1024 76 | 77 | /* Define to make parameter entity parsing functionality available. */ 78 | #define XML_DTD 1 79 | 80 | /* Define to make XML Namespaces functionality available. */ 81 | #define XML_NS 1 82 | 83 | /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ 84 | /* #undef __func__ */ 85 | 86 | /* Define to empty if `const' does not conform to ANSI C. */ 87 | /* #undef const */ 88 | 89 | /* Define to `long' if does not define. */ 90 | /* #undef off_t */ 91 | 92 | /* Define to `unsigned' if does not define. */ 93 | /* #undef size_t */ 94 | -------------------------------------------------------------------------------- /conftools/PrintPath: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Look for program[s] somewhere in $PATH. 3 | # 4 | # Options: 5 | # -s 6 | # Do not print out full pathname. (silent) 7 | # -pPATHNAME 8 | # Look in PATHNAME instead of $PATH 9 | # 10 | # Usage: 11 | # PrintPath [-s] [-pPATHNAME] program [program ...] 12 | # 13 | # Initially written by Jim Jagielski for the Apache configuration mechanism 14 | # (with kudos to Kernighan/Pike) 15 | # 16 | # This script falls under the Apache License. 17 | # See http://www.apache.org/licenses/LICENSE 18 | 19 | ## 20 | # Some "constants" 21 | ## 22 | pathname=$PATH 23 | echo="yes" 24 | 25 | ## 26 | # Find out what OS we are running for later on 27 | ## 28 | os=`(uname) 2>/dev/null` 29 | 30 | ## 31 | # Parse command line 32 | ## 33 | for args in $* 34 | do 35 | case $args in 36 | -s ) echo="no" ;; 37 | -p* ) pathname="`echo $args | sed 's/^..//'`" ;; 38 | * ) programs="$programs $args" ;; 39 | esac 40 | done 41 | 42 | ## 43 | # Now we make the adjustments required for OS/2 and everyone 44 | # else :) 45 | # 46 | # First of all, all OS/2 programs have the '.exe' extension. 47 | # Next, we adjust PATH (or what was given to us as PATH) to 48 | # be whitespace separated directories. 49 | # Finally, we try to determine the best flag to use for 50 | # test/[] to look for an executable file. OS/2 just has '-r' 51 | # but with other OSs, we do some funny stuff to check to see 52 | # if test/[] knows about -x, which is the preferred flag. 53 | ## 54 | 55 | if [ "x$os" = "xOS/2" ] 56 | then 57 | ext=".exe" 58 | pathname=`echo -E $pathname | 59 | sed 's/^;/.;/ 60 | s/;;/;.;/g 61 | s/;$/;./ 62 | s/;/ /g 63 | s/\\\\/\\//g' ` 64 | test_exec_flag="-r" 65 | else 66 | ext="" # No default extensions 67 | pathname=`echo $pathname | 68 | sed 's/^:/.:/ 69 | s/::/:.:/g 70 | s/:$/:./ 71 | s/:/ /g' ` 72 | # Here is how we test to see if test/[] can handle -x 73 | testfile="pp.t.$$" 74 | 75 | cat > $testfile </dev/null`; then 84 | test_exec_flag="-x" 85 | else 86 | test_exec_flag="-r" 87 | fi 88 | rm -f $testfile 89 | fi 90 | 91 | for program in $programs 92 | do 93 | for path in $pathname 94 | do 95 | if [ $test_exec_flag $path/${program}${ext} ] && \ 96 | [ ! -d $path/${program}${ext} ]; then 97 | if [ "x$echo" = "xyes" ]; then 98 | echo $path/${program}${ext} 99 | fi 100 | exit 0 101 | fi 102 | 103 | # Next try without extension (if one was used above) 104 | if [ "x$ext" != "x" ]; then 105 | if [ $test_exec_flag $path/${program} ] && \ 106 | [ ! -d $path/${program} ]; then 107 | if [ "x$echo" = "xyes" ]; then 108 | echo $path/${program} 109 | fi 110 | exit 0 111 | fi 112 | fi 113 | done 114 | done 115 | exit 1 116 | 117 | -------------------------------------------------------------------------------- /win32/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Expat can be built on Windows in three ways: 3 | using MS Visual C++ (6.0 or .NET), Borland C++ Builder 5 or Cygwin. 4 | 5 | * Cygwin: 6 | This follows the Unix build procedures. 7 | 8 | * C++ Builder 5: 9 | Possible with make files in the BCB5 subdirectory. 10 | Details can be found in the ReadMe file located there. 11 | 12 | * MS Visual C++ 6: 13 | Based on the workspace file expat.dsw. The related project 14 | files (.dsp) are located in the lib subdirectory. 15 | 16 | * MS Visual Studio .NET 2002, 2003, 2005: 17 | The VC++ 6 workspace file (expat.dsw) and project files (.dsp) 18 | can be opened and imported in VS.NET without problems. 19 | 20 | * All MS C/C++ compilers: 21 | The output for all projects will be generated in the win32\bin 22 | directory, intermediate files will be located in project-specific 23 | subdirectories of win32\tmp. 24 | 25 | * Creating MinGW dynamic libraries from MS VC++ DLLs: 26 | 27 | On the command line, execute these steps: 28 | pexports libexpat.dll > expat.def 29 | pexports libexpatw.dll > expatw.def 30 | dlltool -d expat.def -l libexpat.a 31 | dlltool -d expatw.def -l libexpatw.a 32 | 33 | The *.a files are mingw libraries. 34 | 35 | * Special note about MS VC++ and runtime libraries: 36 | 37 | There are three possible configurations: using the 38 | single threaded or multithreaded run-time library, 39 | or using the multi-threaded run-time Dll. That is, 40 | one can build three different Expat libraries depending 41 | on the needs of the application. 42 | 43 | Dynamic Linking: 44 | 45 | By default the Expat Dlls are built to link statically 46 | with the multi-threaded run-time library. 47 | The libraries are named 48 | - libexpat(w).dll 49 | - libexpat(w).lib (import library) 50 | The "w" indicates the UTF-16 version of the library. 51 | 52 | One rarely uses other versions of the Dll, but they can 53 | be built easily by specifying a different RTL linkage in 54 | the IDE on the C/C++ tab under the category Code Generation. 55 | 56 | Static Linking: 57 | 58 | The libraries should be named like this: 59 | Single-theaded: libexpat(w)ML.lib 60 | Multi-threaded: libexpat(w)MT.lib 61 | Multi-threaded Dll: libexpat(w)MD.lib 62 | The suffixes conform to the compiler switch settings 63 | /ML, /MT and /MD for MS VC++. 64 | 65 | Note: In Visual Studio 2005 (Visual C++ 8.0) and later, the 66 | single-threaded runtime library is not supported anymore. 67 | 68 | By default, the expat-static and expatw-static projects are set up 69 | to link statically against the multithreaded run-time library, 70 | so they will build libexpatMT.lib or libexpatwMT.lib files. 71 | 72 | To build the other versions of the static library, 73 | go to Project - Settings: 74 | - specify a different RTL linkage on the C/C++ tab 75 | under the category Code Generation. 76 | - then, on the Library tab, change the output file name 77 | accordingly, as described above 78 | 79 | An application linking to the static libraries must 80 | have the global macro XML_STATIC defined. 81 | -------------------------------------------------------------------------------- /conftools/ac_c_bigendian_cross.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_C_BIGENDIAN_CROSS 2 | dnl 3 | dnl Check endianess even when crosscompiling 4 | dnl (partially based on the original AC_C_BIGENDIAN). 5 | dnl 6 | dnl The implementation will create a binary, and instead of running 7 | dnl the binary it will be grep'ed for some symbols that will look 8 | dnl different for different endianess of the binary. 9 | dnl 10 | dnl @version $Id: ac_c_bigendian_cross.m4,v 1.2 2001/10/01 20:03:13 fdrake Exp $ 11 | dnl @author Guido Draheim 12 | dnl 13 | AC_DEFUN([AC_C_BIGENDIAN_CROSS], 14 | [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, 15 | [ac_cv_c_bigendian=unknown 16 | # See if sys/param.h defines the BYTE_ORDER macro. 17 | AC_TRY_COMPILE([#include 18 | #include ], [ 19 | #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN 20 | bogus endian macros 21 | #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. 22 | AC_TRY_COMPILE([#include 23 | #include ], [ 24 | #if BYTE_ORDER != BIG_ENDIAN 25 | not big endian 26 | #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) 27 | if test $ac_cv_c_bigendian = unknown; then 28 | AC_TRY_RUN([main () { 29 | /* Are we little or big endian? From Harbison&Steele. */ 30 | union 31 | { 32 | long l; 33 | char c[sizeof (long)]; 34 | } u; 35 | u.l = 1; 36 | exit (u.c[sizeof (long) - 1] == 1); 37 | }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, 38 | [ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) 39 | fi]) 40 | if test $ac_cv_c_bigendian = unknown; then 41 | AC_MSG_CHECKING(to probe for byte ordering) 42 | [ 43 | cat >conftest.c <&AC_FD_MSG 56 | ac_cv_c_bigendian=yes 57 | fi 58 | if test `grep -l LiTTleEnDian conftest.o` ; then 59 | echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG 60 | if test $ac_cv_c_bigendian = yes ; then 61 | ac_cv_c_bigendian=unknown; 62 | else 63 | ac_cv_c_bigendian=no 64 | fi 65 | fi 66 | echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG 67 | fi 68 | fi 69 | AC_MSG_RESULT($ac_cv_c_bigendian) 70 | fi 71 | if test $ac_cv_c_bigendian = yes; then 72 | AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) 73 | BYTEORDER=4321 74 | else 75 | BYTEORDER=1234 76 | fi 77 | AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) 78 | if test $ac_cv_c_bigendian = unknown; then 79 | AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) 80 | fi 81 | ]) 82 | -------------------------------------------------------------------------------- /tests/benchmark/benchmark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "expat.h" 6 | 7 | #if defined(__amigaos__) && defined(__USE_INLINE__) 8 | #include 9 | #endif 10 | 11 | #ifdef XML_LARGE_SIZE 12 | #define XML_FMT_INT_MOD "ll" 13 | #else 14 | #define XML_FMT_INT_MOD "l" 15 | #endif 16 | 17 | static void 18 | usage(const char *prog, int rc) 19 | { 20 | fprintf(stderr, 21 | "usage: %s [-n] filename bufferSize nr_of_loops\n", prog); 22 | exit(rc); 23 | } 24 | 25 | int main (int argc, char *argv[]) 26 | { 27 | XML_Parser parser; 28 | char *XMLBuf, *XMLBufEnd, *XMLBufPtr; 29 | FILE *fd; 30 | struct stat fileAttr; 31 | int nrOfLoops, bufferSize, fileSize, i, isFinal; 32 | int j = 0, ns = 0; 33 | clock_t tstart, tend; 34 | double cpuTime = 0.0; 35 | 36 | if (argc > 1) { 37 | if (argv[1][0] == '-') { 38 | if (argv[1][1] == 'n' && argv[1][2] == '\0') { 39 | ns = 1; 40 | j = 1; 41 | } 42 | else 43 | usage(argv[0], 1); 44 | } 45 | } 46 | 47 | if (argc != j + 4) 48 | usage(argv[0], 1); 49 | 50 | if (stat (argv[j + 1], &fileAttr) != 0) { 51 | fprintf (stderr, "could not access file '%s'\n", argv[j + 1]); 52 | return 2; 53 | } 54 | 55 | fd = fopen (argv[j + 1], "r"); 56 | if (!fd) { 57 | fprintf (stderr, "could not open file '%s'\n", argv[j + 1]); 58 | exit(2); 59 | } 60 | 61 | bufferSize = atoi (argv[j + 2]); 62 | nrOfLoops = atoi (argv[j + 3]); 63 | if (bufferSize <= 0 || nrOfLoops <= 0) { 64 | fprintf (stderr, 65 | "buffer size and nr of loops must be greater than zero.\n"); 66 | exit(3); 67 | } 68 | 69 | XMLBuf = malloc (fileAttr.st_size); 70 | fileSize = fread (XMLBuf, sizeof (char), fileAttr.st_size, fd); 71 | fclose (fd); 72 | 73 | if (ns) 74 | parser = XML_ParserCreateNS(NULL, '!'); 75 | else 76 | parser = XML_ParserCreate(NULL); 77 | 78 | i = 0; 79 | XMLBufEnd = XMLBuf + fileSize; 80 | while (i < nrOfLoops) { 81 | XMLBufPtr = XMLBuf; 82 | isFinal = 0; 83 | tstart = clock(); 84 | do { 85 | int parseBufferSize = XMLBufEnd - XMLBufPtr; 86 | if (parseBufferSize <= bufferSize) 87 | isFinal = 1; 88 | else 89 | parseBufferSize = bufferSize; 90 | if (!XML_Parse (parser, XMLBufPtr, parseBufferSize, isFinal)) { 91 | fprintf (stderr, "error '%s' at line %" XML_FMT_INT_MOD \ 92 | "u character %" XML_FMT_INT_MOD "u\n", 93 | XML_ErrorString (XML_GetErrorCode (parser)), 94 | XML_GetCurrentLineNumber (parser), 95 | XML_GetCurrentColumnNumber (parser)); 96 | free (XMLBuf); 97 | XML_ParserFree (parser); 98 | exit (4); 99 | } 100 | XMLBufPtr += bufferSize; 101 | } while (!isFinal); 102 | tend = clock(); 103 | cpuTime += ((double) (tend - tstart)) / CLOCKS_PER_SEC; 104 | XML_ParserReset(parser, NULL); 105 | i++; 106 | } 107 | 108 | XML_ParserFree (parser); 109 | free (XMLBuf); 110 | 111 | printf ("%d loops, with buffer size %d. Average time per loop: %f\n", 112 | nrOfLoops, bufferSize, cpuTime / (double) nrOfLoops); 113 | return 0; 114 | } 115 | -------------------------------------------------------------------------------- /lib/xmlrole.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef XmlRole_INCLUDED 6 | #define XmlRole_INCLUDED 1 7 | 8 | #ifdef __VMS 9 | /* 0 1 2 3 0 1 2 3 10 | 1234567890123456789012345678901 1234567890123456789012345678901 */ 11 | #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt 12 | #endif 13 | 14 | #include "xmltok.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | enum { 21 | XML_ROLE_ERROR = -1, 22 | XML_ROLE_NONE = 0, 23 | XML_ROLE_XML_DECL, 24 | XML_ROLE_INSTANCE_START, 25 | XML_ROLE_DOCTYPE_NONE, 26 | XML_ROLE_DOCTYPE_NAME, 27 | XML_ROLE_DOCTYPE_SYSTEM_ID, 28 | XML_ROLE_DOCTYPE_PUBLIC_ID, 29 | XML_ROLE_DOCTYPE_INTERNAL_SUBSET, 30 | XML_ROLE_DOCTYPE_CLOSE, 31 | XML_ROLE_GENERAL_ENTITY_NAME, 32 | XML_ROLE_PARAM_ENTITY_NAME, 33 | XML_ROLE_ENTITY_NONE, 34 | XML_ROLE_ENTITY_VALUE, 35 | XML_ROLE_ENTITY_SYSTEM_ID, 36 | XML_ROLE_ENTITY_PUBLIC_ID, 37 | XML_ROLE_ENTITY_COMPLETE, 38 | XML_ROLE_ENTITY_NOTATION_NAME, 39 | XML_ROLE_NOTATION_NONE, 40 | XML_ROLE_NOTATION_NAME, 41 | XML_ROLE_NOTATION_SYSTEM_ID, 42 | XML_ROLE_NOTATION_NO_SYSTEM_ID, 43 | XML_ROLE_NOTATION_PUBLIC_ID, 44 | XML_ROLE_ATTRIBUTE_NAME, 45 | XML_ROLE_ATTRIBUTE_TYPE_CDATA, 46 | XML_ROLE_ATTRIBUTE_TYPE_ID, 47 | XML_ROLE_ATTRIBUTE_TYPE_IDREF, 48 | XML_ROLE_ATTRIBUTE_TYPE_IDREFS, 49 | XML_ROLE_ATTRIBUTE_TYPE_ENTITY, 50 | XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, 51 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, 52 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, 53 | XML_ROLE_ATTRIBUTE_ENUM_VALUE, 54 | XML_ROLE_ATTRIBUTE_NOTATION_VALUE, 55 | XML_ROLE_ATTLIST_NONE, 56 | XML_ROLE_ATTLIST_ELEMENT_NAME, 57 | XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, 58 | XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, 59 | XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, 60 | XML_ROLE_FIXED_ATTRIBUTE_VALUE, 61 | XML_ROLE_ELEMENT_NONE, 62 | XML_ROLE_ELEMENT_NAME, 63 | XML_ROLE_CONTENT_ANY, 64 | XML_ROLE_CONTENT_EMPTY, 65 | XML_ROLE_CONTENT_PCDATA, 66 | XML_ROLE_GROUP_OPEN, 67 | XML_ROLE_GROUP_CLOSE, 68 | XML_ROLE_GROUP_CLOSE_REP, 69 | XML_ROLE_GROUP_CLOSE_OPT, 70 | XML_ROLE_GROUP_CLOSE_PLUS, 71 | XML_ROLE_GROUP_CHOICE, 72 | XML_ROLE_GROUP_SEQUENCE, 73 | XML_ROLE_CONTENT_ELEMENT, 74 | XML_ROLE_CONTENT_ELEMENT_REP, 75 | XML_ROLE_CONTENT_ELEMENT_OPT, 76 | XML_ROLE_CONTENT_ELEMENT_PLUS, 77 | XML_ROLE_PI, 78 | XML_ROLE_COMMENT, 79 | #ifdef XML_DTD 80 | XML_ROLE_TEXT_DECL, 81 | XML_ROLE_IGNORE_SECT, 82 | XML_ROLE_INNER_PARAM_ENTITY_REF, 83 | #endif /* XML_DTD */ 84 | XML_ROLE_PARAM_ENTITY_REF 85 | }; 86 | 87 | typedef struct prolog_state { 88 | int (PTRCALL *handler) (struct prolog_state *state, 89 | int tok, 90 | const char *ptr, 91 | const char *end, 92 | const ENCODING *enc); 93 | unsigned level; 94 | int role_none; 95 | #ifdef XML_DTD 96 | unsigned includeLevel; 97 | int documentEntity; 98 | int inEntityValue; 99 | #endif /* XML_DTD */ 100 | } PROLOG_STATE; 101 | 102 | void XmlPrologStateInit(PROLOG_STATE *); 103 | #ifdef XML_DTD 104 | void XmlPrologStateInitExternalEntity(PROLOG_STATE *); 105 | #endif /* XML_DTD */ 106 | 107 | #define XmlTokenRole(state, tok, ptr, end, enc) \ 108 | (((state)->handler)(state, tok, ptr, end, enc)) 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* not XmlRole_INCLUDED */ 115 | -------------------------------------------------------------------------------- /xmlwf/ct.c: -------------------------------------------------------------------------------- 1 | #define CHARSET_MAX 41 2 | 3 | static const char * 4 | getTok(const char **pp) 5 | { 6 | enum { inAtom, inString, init, inComment }; 7 | int state = init; 8 | const char *tokStart = 0; 9 | for (;;) { 10 | switch (**pp) { 11 | case '\0': 12 | return 0; 13 | case ' ': 14 | case '\r': 15 | case '\t': 16 | case '\n': 17 | if (state == inAtom) 18 | return tokStart; 19 | break; 20 | case '(': 21 | if (state == inAtom) 22 | return tokStart; 23 | if (state != inString) 24 | state++; 25 | break; 26 | case ')': 27 | if (state > init) 28 | --state; 29 | else if (state != inString) 30 | return 0; 31 | break; 32 | case ';': 33 | case '/': 34 | case '=': 35 | if (state == inAtom) 36 | return tokStart; 37 | if (state == init) 38 | return (*pp)++; 39 | break; 40 | case '\\': 41 | ++*pp; 42 | if (**pp == '\0') 43 | return 0; 44 | break; 45 | case '"': 46 | switch (state) { 47 | case inString: 48 | ++*pp; 49 | return tokStart; 50 | case inAtom: 51 | return tokStart; 52 | case init: 53 | tokStart = *pp; 54 | state = inString; 55 | break; 56 | } 57 | break; 58 | default: 59 | if (state == init) { 60 | tokStart = *pp; 61 | state = inAtom; 62 | } 63 | break; 64 | } 65 | ++*pp; 66 | } 67 | /* not reached */ 68 | } 69 | 70 | /* key must be lowercase ASCII */ 71 | 72 | static int 73 | matchkey(const char *start, const char *end, const char *key) 74 | { 75 | if (!start) 76 | return 0; 77 | for (; start != end; start++, key++) 78 | if (*start != *key && *start != 'A' + (*key - 'a')) 79 | return 0; 80 | return *key == '\0'; 81 | } 82 | 83 | void 84 | getXMLCharset(const char *buf, char *charset) 85 | { 86 | const char *next, *p; 87 | 88 | charset[0] = '\0'; 89 | next = buf; 90 | p = getTok(&next); 91 | if (matchkey(p, next, "text")) 92 | strcpy(charset, "us-ascii"); 93 | else if (!matchkey(p, next, "application")) 94 | return; 95 | p = getTok(&next); 96 | if (!p || *p != '/') 97 | return; 98 | p = getTok(&next); 99 | if (matchkey(p, next, "xml")) 100 | isXml = 1; 101 | p = getTok(&next); 102 | while (p) { 103 | if (*p == ';') { 104 | p = getTok(&next); 105 | if (matchkey(p, next, "charset")) { 106 | p = getTok(&next); 107 | if (p && *p == '=') { 108 | p = getTok(&next); 109 | if (p) { 110 | char *s = charset; 111 | if (*p == '"') { 112 | while (++p != next - 1) { 113 | if (*p == '\\') 114 | ++p; 115 | if (s == charset + CHARSET_MAX - 1) { 116 | charset[0] = '\0'; 117 | break; 118 | } 119 | *s++ = *p; 120 | } 121 | *s++ = '\0'; 122 | } 123 | else { 124 | if (next - p > CHARSET_MAX - 1) 125 | break; 126 | while (p != next) 127 | *s++ = *p++; 128 | *s = 0; 129 | break; 130 | } 131 | } 132 | } 133 | } 134 | } 135 | else 136 | p = getTok(&next); 137 | } 138 | } 139 | 140 | int 141 | main(int argc, char **argv) 142 | { 143 | char buf[CHARSET_MAX]; 144 | getXMLCharset(argv[1], buf); 145 | printf("charset = \"%s\"\n", buf); 146 | return 0; 147 | } 148 | -------------------------------------------------------------------------------- /tests/chardata.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998-2003 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | 4 | chardata.c 5 | */ 6 | 7 | #ifdef HAVE_EXPAT_CONFIG_H 8 | #include 9 | #endif 10 | #ifdef HAVE_CHECK_H 11 | #include 12 | #else 13 | #include "minicheck.h" 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include "chardata.h" 21 | 22 | 23 | static int 24 | xmlstrlen(const XML_Char *s) 25 | { 26 | int len = 0; 27 | assert(s != NULL); 28 | while (s[len] != 0) 29 | ++len; 30 | return len; 31 | } 32 | 33 | 34 | void 35 | CharData_Init(CharData *storage) 36 | { 37 | assert(storage != NULL); 38 | storage->count = -1; 39 | } 40 | 41 | void 42 | CharData_AppendString(CharData *storage, const char *s) 43 | { 44 | int maxchars = sizeof(storage->data) / sizeof(storage->data[0]); 45 | int len; 46 | 47 | assert(s != NULL); 48 | len = strlen(s); 49 | if (storage->count < 0) 50 | storage->count = 0; 51 | if ((len + storage->count) > maxchars) { 52 | len = (maxchars - storage->count); 53 | } 54 | if (len + storage->count < sizeof(storage->data)) { 55 | memcpy(storage->data + storage->count, s, len); 56 | storage->count += len; 57 | } 58 | } 59 | 60 | void 61 | CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len) 62 | { 63 | int maxchars; 64 | 65 | assert(storage != NULL); 66 | assert(s != NULL); 67 | maxchars = sizeof(storage->data) / sizeof(storage->data[0]); 68 | if (storage->count < 0) 69 | storage->count = 0; 70 | if (len < 0) 71 | len = xmlstrlen(s); 72 | if ((len + storage->count) > maxchars) { 73 | len = (maxchars - storage->count); 74 | } 75 | if (len + storage->count < sizeof(storage->data)) { 76 | memcpy(storage->data + storage->count, s, 77 | len * sizeof(storage->data[0])); 78 | storage->count += len; 79 | } 80 | } 81 | 82 | int 83 | CharData_CheckString(CharData *storage, const char *expected) 84 | { 85 | char buffer[1280]; 86 | int len; 87 | int count; 88 | 89 | assert(storage != NULL); 90 | assert(expected != NULL); 91 | count = (storage->count < 0) ? 0 : storage->count; 92 | len = strlen(expected); 93 | if (len != count) { 94 | if (sizeof(XML_Char) == 1) 95 | sprintf(buffer, "wrong number of data characters:" 96 | " got %d, expected %d:\n%s", count, len, storage->data); 97 | else 98 | sprintf(buffer, 99 | "wrong number of data characters: got %d, expected %d", 100 | count, len); 101 | fail(buffer); 102 | return 0; 103 | } 104 | if (memcmp(expected, storage->data, len) != 0) { 105 | fail("got bad data bytes"); 106 | return 0; 107 | } 108 | return 1; 109 | } 110 | 111 | int 112 | CharData_CheckXMLChars(CharData *storage, const XML_Char *expected) 113 | { 114 | char buffer[1024]; 115 | int len = xmlstrlen(expected); 116 | int count; 117 | 118 | assert(storage != NULL); 119 | count = (storage->count < 0) ? 0 : storage->count; 120 | if (len != count) { 121 | sprintf(buffer, "wrong number of data characters: got %d, expected %d", 122 | count, len); 123 | fail(buffer); 124 | return 0; 125 | } 126 | if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) { 127 | fail("got bad data bytes"); 128 | return 0; 129 | } 130 | return 1; 131 | } 132 | -------------------------------------------------------------------------------- /lib/xmltok_ns.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* This file is included! */ 6 | #ifdef XML_TOK_NS_C 7 | 8 | const ENCODING * 9 | NS(XmlGetUtf8InternalEncoding)(void) 10 | { 11 | return &ns(internal_utf8_encoding).enc; 12 | } 13 | 14 | const ENCODING * 15 | NS(XmlGetUtf16InternalEncoding)(void) 16 | { 17 | #if BYTEORDER == 1234 18 | return &ns(internal_little2_encoding).enc; 19 | #elif BYTEORDER == 4321 20 | return &ns(internal_big2_encoding).enc; 21 | #else 22 | const short n = 1; 23 | return (*(const char *)&n 24 | ? &ns(internal_little2_encoding).enc 25 | : &ns(internal_big2_encoding).enc); 26 | #endif 27 | } 28 | 29 | static const ENCODING * const NS(encodings)[] = { 30 | &ns(latin1_encoding).enc, 31 | &ns(ascii_encoding).enc, 32 | &ns(utf8_encoding).enc, 33 | &ns(big2_encoding).enc, 34 | &ns(big2_encoding).enc, 35 | &ns(little2_encoding).enc, 36 | &ns(utf8_encoding).enc /* NO_ENC */ 37 | }; 38 | 39 | static int PTRCALL 40 | NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 41 | const char **nextTokPtr) 42 | { 43 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 44 | XML_PROLOG_STATE, ptr, end, nextTokPtr); 45 | } 46 | 47 | static int PTRCALL 48 | NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 49 | const char **nextTokPtr) 50 | { 51 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 52 | XML_CONTENT_STATE, ptr, end, nextTokPtr); 53 | } 54 | 55 | int 56 | NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, 57 | const char *name) 58 | { 59 | int i = getEncodingIndex(name); 60 | if (i == UNKNOWN_ENC) 61 | return 0; 62 | SET_INIT_ENC_INDEX(p, i); 63 | p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); 64 | p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); 65 | p->initEnc.updatePosition = initUpdatePosition; 66 | p->encPtr = encPtr; 67 | *encPtr = &(p->initEnc); 68 | return 1; 69 | } 70 | 71 | static const ENCODING * 72 | NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) 73 | { 74 | #define ENCODING_MAX 128 75 | char buf[ENCODING_MAX]; 76 | char *p = buf; 77 | int i; 78 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); 79 | if (ptr != end) 80 | return 0; 81 | *p = 0; 82 | if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) 83 | return enc; 84 | i = getEncodingIndex(buf); 85 | if (i == UNKNOWN_ENC) 86 | return 0; 87 | return NS(encodings)[i]; 88 | } 89 | 90 | int 91 | NS(XmlParseXmlDecl)(int isGeneralTextEntity, 92 | const ENCODING *enc, 93 | const char *ptr, 94 | const char *end, 95 | const char **badPtr, 96 | const char **versionPtr, 97 | const char **versionEndPtr, 98 | const char **encodingName, 99 | const ENCODING **encoding, 100 | int *standalone) 101 | { 102 | return doParseXmlDecl(NS(findEncoding), 103 | isGeneralTextEntity, 104 | enc, 105 | ptr, 106 | end, 107 | badPtr, 108 | versionPtr, 109 | versionEndPtr, 110 | encodingName, 111 | encoding, 112 | standalone); 113 | } 114 | 115 | #endif /* XML_TOK_NS_C */ 116 | -------------------------------------------------------------------------------- /tests/benchmark/benchmark.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="benchmark" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=benchmark - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "benchmark.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "benchmark.mak" CFG="benchmark - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "benchmark - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "benchmark - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "benchmark - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /I "..\..\lib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD BASE RSC /l 0x1009 /d "NDEBUG" 46 | # ADD RSC /l 0x1009 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "benchmark - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\lib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 68 | # ADD BASE RSC /l 0x1009 /d "_DEBUG" 69 | # ADD RSC /l 0x1009 /d "_DEBUG" 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LINK32=link.exe 74 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 75 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "benchmark - Win32 Release" 82 | # Name "benchmark - Win32 Debug" 83 | # Begin Source File 84 | 85 | SOURCE=.\benchmark.c 86 | # End Source File 87 | # End Target 88 | # End Project 89 | -------------------------------------------------------------------------------- /lib/expat_external.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef Expat_External_INCLUDED 6 | #define Expat_External_INCLUDED 1 7 | 8 | /* External API definitions */ 9 | 10 | #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) 11 | #define XML_USE_MSC_EXTENSIONS 1 12 | #endif 13 | 14 | /* Expat tries very hard to make the API boundary very specifically 15 | defined. There are two macros defined to control this boundary; 16 | each of these can be defined before including this header to 17 | achieve some different behavior, but doing so it not recommended or 18 | tested frequently. 19 | 20 | XMLCALL - The calling convention to use for all calls across the 21 | "library boundary." This will default to cdecl, and 22 | try really hard to tell the compiler that's what we 23 | want. 24 | 25 | XMLIMPORT - Whatever magic is needed to note that a function is 26 | to be imported from a dynamically loaded library 27 | (.dll, .so, or .sl, depending on your platform). 28 | 29 | The XMLCALL macro was added in Expat 1.95.7. The only one which is 30 | expected to be directly useful in client code is XMLCALL. 31 | 32 | Note that on at least some Unix versions, the Expat library must be 33 | compiled with the cdecl calling convention as the default since 34 | system headers may assume the cdecl convention. 35 | */ 36 | #ifndef XMLCALL 37 | #if defined(_MSC_VER) 38 | #define XMLCALL __cdecl 39 | #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) 40 | #define XMLCALL __attribute__((cdecl)) 41 | #else 42 | /* For any platform which uses this definition and supports more than 43 | one calling convention, we need to extend this definition to 44 | declare the convention used on that platform, if it's possible to 45 | do so. 46 | 47 | If this is the case for your platform, please file a bug report 48 | with information on how to identify your platform via the C 49 | pre-processor and how to specify the same calling convention as the 50 | platform's malloc() implementation. 51 | */ 52 | #define XMLCALL 53 | #endif 54 | #endif /* not defined XMLCALL */ 55 | 56 | 57 | #if !defined(XML_STATIC) && !defined(XMLIMPORT) 58 | #ifndef XML_BUILDING_EXPAT 59 | /* using Expat from an application */ 60 | 61 | #ifdef XML_USE_MSC_EXTENSIONS 62 | #define XMLIMPORT __declspec(dllimport) 63 | #endif 64 | 65 | #endif 66 | #endif /* not defined XML_STATIC */ 67 | 68 | 69 | /* If we didn't define it above, define it away: */ 70 | #ifndef XMLIMPORT 71 | #define XMLIMPORT 72 | #endif 73 | 74 | 75 | #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL 76 | 77 | #ifdef __cplusplus 78 | extern "C" { 79 | #endif 80 | 81 | #ifdef XML_UNICODE_WCHAR_T 82 | #define XML_UNICODE 83 | #endif 84 | 85 | #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ 86 | #ifdef XML_UNICODE_WCHAR_T 87 | typedef wchar_t XML_Char; 88 | typedef wchar_t XML_LChar; 89 | #else 90 | typedef unsigned short XML_Char; 91 | typedef char XML_LChar; 92 | #endif /* XML_UNICODE_WCHAR_T */ 93 | #else /* Information is UTF-8 encoded. */ 94 | typedef char XML_Char; 95 | typedef char XML_LChar; 96 | #endif /* XML_UNICODE */ 97 | 98 | #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ 99 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 100 | typedef __int64 XML_Index; 101 | typedef unsigned __int64 XML_Size; 102 | #else 103 | typedef long long XML_Index; 104 | typedef unsigned long long XML_Size; 105 | #endif 106 | #else 107 | typedef long XML_Index; 108 | typedef unsigned long XML_Size; 109 | #endif /* XML_LARGE_SIZE */ 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif /* not Expat_External_INCLUDED */ 116 | -------------------------------------------------------------------------------- /xmlwf/xmlmime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "xmlmime.h" 3 | 4 | static const char * 5 | getTok(const char **pp) 6 | { 7 | /* inComment means one level of nesting; inComment+1 means two levels etc */ 8 | enum { inAtom, inString, init, inComment }; 9 | int state = init; 10 | const char *tokStart = 0; 11 | for (;;) { 12 | switch (**pp) { 13 | case '\0': 14 | if (state == inAtom) 15 | return tokStart; 16 | return 0; 17 | case ' ': 18 | case '\r': 19 | case '\t': 20 | case '\n': 21 | if (state == inAtom) 22 | return tokStart; 23 | break; 24 | case '(': 25 | if (state == inAtom) 26 | return tokStart; 27 | if (state != inString) 28 | state++; 29 | break; 30 | case ')': 31 | if (state > init) 32 | --state; 33 | else if (state != inString) 34 | return 0; 35 | break; 36 | case ';': 37 | case '/': 38 | case '=': 39 | if (state == inAtom) 40 | return tokStart; 41 | if (state == init) 42 | return (*pp)++; 43 | break; 44 | case '\\': 45 | ++*pp; 46 | if (**pp == '\0') 47 | return 0; 48 | break; 49 | case '"': 50 | switch (state) { 51 | case inString: 52 | ++*pp; 53 | return tokStart; 54 | case inAtom: 55 | return tokStart; 56 | case init: 57 | tokStart = *pp; 58 | state = inString; 59 | break; 60 | } 61 | break; 62 | default: 63 | if (state == init) { 64 | tokStart = *pp; 65 | state = inAtom; 66 | } 67 | break; 68 | } 69 | ++*pp; 70 | } 71 | /* not reached */ 72 | } 73 | 74 | /* key must be lowercase ASCII */ 75 | 76 | static int 77 | matchkey(const char *start, const char *end, const char *key) 78 | { 79 | if (!start) 80 | return 0; 81 | for (; start != end; start++, key++) 82 | if (*start != *key && *start != 'A' + (*key - 'a')) 83 | return 0; 84 | return *key == '\0'; 85 | } 86 | 87 | void 88 | getXMLCharset(const char *buf, char *charset) 89 | { 90 | const char *next, *p; 91 | 92 | charset[0] = '\0'; 93 | next = buf; 94 | p = getTok(&next); 95 | if (matchkey(p, next, "text")) 96 | strcpy(charset, "us-ascii"); 97 | else if (!matchkey(p, next, "application")) 98 | return; 99 | p = getTok(&next); 100 | if (!p || *p != '/') 101 | return; 102 | p = getTok(&next); 103 | #if 0 104 | if (!matchkey(p, next, "xml") && charset[0] == '\0') 105 | return; 106 | #endif 107 | p = getTok(&next); 108 | while (p) { 109 | if (*p == ';') { 110 | p = getTok(&next); 111 | if (matchkey(p, next, "charset")) { 112 | p = getTok(&next); 113 | if (p && *p == '=') { 114 | p = getTok(&next); 115 | if (p) { 116 | char *s = charset; 117 | if (*p == '"') { 118 | while (++p != next - 1) { 119 | if (*p == '\\') 120 | ++p; 121 | if (s == charset + CHARSET_MAX - 1) { 122 | charset[0] = '\0'; 123 | break; 124 | } 125 | *s++ = *p; 126 | } 127 | *s++ = '\0'; 128 | } 129 | else { 130 | if (next - p > CHARSET_MAX - 1) 131 | break; 132 | while (p != next) 133 | *s++ = *p++; 134 | *s = 0; 135 | break; 136 | } 137 | } 138 | } 139 | break; 140 | } 141 | } 142 | else 143 | p = getTok(&next); 144 | } 145 | } 146 | 147 | #ifdef TEST 148 | 149 | #include 150 | 151 | int 152 | main(int argc, char *argv[]) 153 | { 154 | char buf[CHARSET_MAX]; 155 | if (argc <= 1) 156 | return 1; 157 | printf("%s\n", argv[1]); 158 | getXMLCharset(argv[1], buf); 159 | printf("charset=\"%s\"\n", buf); 160 | return 0; 161 | } 162 | 163 | #endif /* TEST */ 164 | -------------------------------------------------------------------------------- /bcb5/outline.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | [Version Info] 49 | IncludeVerInfo=0 50 | AutoIncBuild=0 51 | MajorVer=1 52 | MinorVer=0 53 | Release=0 54 | Build=0 55 | Debug=0 56 | PreRelease=0 57 | Special=0 58 | Private=0 59 | DLL=0 60 | Locale=1033 61 | CodePage=1252 62 | 63 | [Version Info Keys] 64 | CompanyName= 65 | FileDescription= 66 | FileVersion=1.0.0.0 67 | InternalName= 68 | LegalCopyright= 69 | LegalTrademarks= 70 | OriginalFilename= 71 | ProductName= 72 | ProductVersion=1.0.0.0 73 | Comments= 74 | 75 | [HistoryLists\hlIncludePath] 76 | Count=3 77 | Item0=..\examples;$(BCB)\include 78 | Item1=$(BCB)\include 79 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 80 | 81 | [HistoryLists\hlLibraryPath] 82 | Count=4 83 | Item0=..\examples;$(BCB)\lib;$(RELEASELIBPATH) 84 | Item1=..\examples;$(BCB)\lib;..\examples\$(RELEASELIBPATH) 85 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 86 | Item3=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 87 | 88 | [HistoryLists\hlDebugSourcePath] 89 | Count=1 90 | Item0=$(BCB)\source\vcl 91 | 92 | [HistoryLists\hlConditionals] 93 | Count=6 94 | Item0=WIN32;NDEBUG;_CONSOLE 95 | Item1=WIN32;NDEBUG;_CONSOLE;XML_STATIC 96 | Item2=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_STATIC 97 | Item3=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE;XML_STATIC 98 | Item4=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE 99 | Item5=WIN32;NDEBUG;_CONSOLE;_DEBUG 100 | 101 | [HistoryLists\hlIntOutputDir] 102 | Count=4 103 | Item0=Release\obj\examples 104 | Item1=Release\obj\outline 105 | Item2=..\examples\Release 106 | Item3=Release 107 | 108 | [HistoryLists\hlFinalOutputDir] 109 | Count=1 110 | Item0=Release\ 111 | 112 | [Debugging] 113 | DebugSourceDirs= 114 | 115 | [Parameters] 116 | RunParams= 117 | HostApplication= 118 | RemoteHost= 119 | RemotePath= 120 | RemoteDebug=0 121 | 122 | [Compiler] 123 | ShowInfoMsgs=0 124 | LinkDebugVcl=0 125 | LinkCGLIB=0 126 | 127 | [Language] 128 | ActiveLang= 129 | ProjectLang= 130 | RootDir= 131 | 132 | -------------------------------------------------------------------------------- /tests/xmltest.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # EXPAT TEST SCRIPT FOR W3C XML TEST SUITE 4 | 5 | # This script can be used to exercise Expat against the 6 | # w3c.org xml test suite, available from 7 | # http://www.w3.org/XML/Test/xmlts20020606.zip. 8 | 9 | # To run this script, first set XMLWF so that xmlwf can be 10 | # found, then set the output directory with OUTPUT. 11 | 12 | # The script lists all test cases where Expat shows a discrepancy 13 | # from the expected result. Test cases where only the canonical 14 | # output differs are prefixed with "Output differs:", and a diff file 15 | # is generated in the appropriate subdirectory under $OUTPUT. 16 | 17 | # If there are output files provided, the script will use 18 | # output from xmlwf and compare the desired output against it. 19 | # However, one has to take into account that the canonical output 20 | # produced by xmlwf conforms to an older definition of canonical XML 21 | # and does not generate notation declarations. 22 | 23 | MYDIR="`dirname \"$0\"`" 24 | cd "$MYDIR" 25 | MYDIR="`pwd`" 26 | XMLWF="`dirname \"$MYDIR\"`/xmlwf/xmlwf" 27 | # XMLWF=/usr/local/bin/xmlwf 28 | TS="$MYDIR/XML-Test-Suite" 29 | # OUTPUT must terminate with the directory separator. 30 | OUTPUT="$TS/out/" 31 | # OUTPUT=/home/tmp/xml-testsuite-out/ 32 | 33 | 34 | # RunXmlwfNotWF file reldir 35 | # reldir includes trailing slash 36 | RunXmlwfNotWF() { 37 | file="$1" 38 | reldir="$2" 39 | $XMLWF -p "$file" > outfile || return $? 40 | read outdata < outfile 41 | if test "$outdata" = "" ; then 42 | echo "Expected well-formed: $reldir$file" 43 | return 1 44 | else 45 | return 0 46 | fi 47 | } 48 | 49 | # RunXmlwfWF file reldir 50 | # reldir includes trailing slash 51 | RunXmlwfWF() { 52 | file="$1" 53 | reldir="$2" 54 | $XMLWF -p -d "$OUTPUT$reldir" "$file" > outfile || return $? 55 | read outdata < outfile 56 | if test "$outdata" = "" ; then 57 | if [ -f "out/$file" ] ; then 58 | diff "$OUTPUT$reldir$file" "out/$file" > outfile 59 | if [ -s outfile ] ; then 60 | cp outfile "$OUTPUT$reldir$file.diff" 61 | echo "Output differs: $reldir$file" 62 | return 1 63 | fi 64 | fi 65 | return 0 66 | else 67 | echo "In $reldir: $outdata" 68 | return 1 69 | fi 70 | } 71 | 72 | SUCCESS=0 73 | ERROR=0 74 | 75 | UpdateStatus() { 76 | if [ "$1" -eq 0 ] ; then 77 | SUCCESS=`expr $SUCCESS + 1` 78 | else 79 | ERROR=`expr $ERROR + 1` 80 | fi 81 | } 82 | 83 | ########################## 84 | # well-formed test cases # 85 | ########################## 86 | 87 | cd "$TS/xmlconf" 88 | for xmldir in ibm/valid/P* \ 89 | ibm/invalid/P* \ 90 | xmltest/valid/ext-sa \ 91 | xmltest/valid/not-sa \ 92 | xmltest/invalid \ 93 | xmltest/invalid/not-sa \ 94 | xmltest/valid/sa \ 95 | sun/valid \ 96 | sun/invalid ; do 97 | cd "$TS/xmlconf/$xmldir" 98 | mkdir -p "$OUTPUT$xmldir" 99 | for xmlfile in *.xml ; do 100 | RunXmlwfWF "$xmlfile" "$xmldir/" 101 | UpdateStatus $? 102 | done 103 | rm outfile 104 | done 105 | 106 | cd "$TS/xmlconf/oasis" 107 | mkdir -p "$OUTPUT"oasis 108 | for xmlfile in *pass*.xml ; do 109 | RunXmlwfWF "$xmlfile" "oasis/" 110 | UpdateStatus $? 111 | done 112 | rm outfile 113 | 114 | ############################## 115 | # not well-formed test cases # 116 | ############################## 117 | 118 | cd "$TS/xmlconf" 119 | for xmldir in ibm/not-wf/P* \ 120 | ibm/not-wf/misc \ 121 | xmltest/not-wf/ext-sa \ 122 | xmltest/not-wf/not-sa \ 123 | xmltest/not-wf/sa \ 124 | sun/not-wf ; do 125 | cd "$TS/xmlconf/$xmldir" 126 | for xmlfile in *.xml ; do 127 | RunXmlwfNotWF "$xmlfile" "$xmldir/" 128 | UpdateStatus $? 129 | done 130 | rm outfile 131 | done 132 | 133 | cd "$TS/xmlconf/oasis" 134 | for xmlfile in *fail*.xml ; do 135 | RunXmlwfNotWF "$xmlfile" "oasis/" 136 | UpdateStatus $? 137 | done 138 | rm outfile 139 | 140 | echo "Passed: $SUCCESS" 141 | echo "Failed: $ERROR" 142 | -------------------------------------------------------------------------------- /bcb5/expat_static.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | [Version Info] 49 | IncludeVerInfo=0 50 | AutoIncBuild=0 51 | MajorVer=1 52 | MinorVer=0 53 | Release=0 54 | Build=0 55 | Debug=0 56 | PreRelease=0 57 | Special=0 58 | Private=0 59 | DLL=0 60 | Locale=1033 61 | CodePage=1252 62 | 63 | [Version Info Keys] 64 | CompanyName= 65 | FileDescription= 66 | FileVersion=1.0.0.0 67 | InternalName= 68 | LegalCopyright= 69 | LegalTrademarks= 70 | OriginalFilename= 71 | ProductName= 72 | ProductVersion=1.0.0.0 73 | Comments= 74 | 75 | [HistoryLists\hlIncludePath] 76 | Count=4 77 | Item0=..\lib;$(BCB)\include 78 | Item1=$(BCB)\include 79 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 80 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 81 | 82 | [HistoryLists\hlLibraryPath] 83 | Count=5 84 | Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) 85 | Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) 86 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 87 | Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 88 | Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 89 | 90 | [HistoryLists\hlDebugSourcePath] 91 | Count=1 92 | Item0=$(BCB)\source\vcl 93 | 94 | [HistoryLists\hlConditionals] 95 | Count=7 96 | Item0=_WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC 97 | Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC 98 | Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC 99 | Item3=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_DEBUG 100 | Item4=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP 101 | Item5=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_MBCS 102 | Item6=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP 103 | 104 | [HistoryLists\hlIntOutputDir] 105 | Count=6 106 | Item0=Release\obj\libexpat_static 107 | Item1=Release\obj\mts 108 | Item2=Release\obj\mt 109 | Item3=Release 110 | Item4=..\lib\Release_static 111 | Item5=Release_static 112 | 113 | [HistoryLists\hlFinalOutputDir] 114 | Count=3 115 | Item0=Release\ 116 | Item1=Release 117 | Item2=Release_static\ 118 | 119 | [HistoryLists\hlTlibPageSize] 120 | Count=1 121 | Item0=0x0010 122 | 123 | [Debugging] 124 | DebugSourceDirs= 125 | 126 | [Parameters] 127 | RunParams= 128 | HostApplication= 129 | RemoteHost= 130 | RemotePath= 131 | RemoteDebug=0 132 | 133 | [Compiler] 134 | ShowInfoMsgs=0 135 | LinkDebugVcl=0 136 | LinkCGLIB=0 137 | 138 | [Language] 139 | ActiveLang= 140 | ProjectLang= 141 | RootDir= 142 | 143 | -------------------------------------------------------------------------------- /bcb5/xmlwf.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | [Version Info] 50 | IncludeVerInfo=0 51 | AutoIncBuild=0 52 | MajorVer=1 53 | MinorVer=0 54 | Release=0 55 | Build=0 56 | Debug=0 57 | PreRelease=0 58 | Special=0 59 | Private=0 60 | DLL=0 61 | Locale=1033 62 | CodePage=1252 63 | 64 | [Version Info Keys] 65 | CompanyName= 66 | FileDescription= 67 | FileVersion=1.0.0.0 68 | InternalName= 69 | LegalCopyright= 70 | LegalTrademarks= 71 | OriginalFilename= 72 | ProductName= 73 | ProductVersion=1.0.0.0 74 | Comments= 75 | 76 | [HistoryLists\hlIncludePath] 77 | Count=4 78 | Item0=..\xmlwf;$(BCB)\include 79 | Item1=$(BCB)\include 80 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 81 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 82 | 83 | [HistoryLists\hlLibraryPath] 84 | Count=5 85 | Item0=..\xmlwf;$(BCB)\lib;$(RELEASELIBPATH) 86 | Item1=..\xmlwf;$(BCB)\lib;..\xmlwf\$(RELEASELIBPATH) 87 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 88 | Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 89 | Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 90 | 91 | [HistoryLists\hlDebugSourcePath] 92 | Count=1 93 | Item0=$(BCB)\source\vcl 94 | 95 | [HistoryLists\hlConditionals] 96 | Count=6 97 | Item0=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP 98 | Item1=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE 99 | Item2=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T 100 | Item3=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG 101 | Item4=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;_UNICODE;XML_UNICODE_WCHAR_T 102 | Item5=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;_UNICODE 103 | 104 | [HistoryLists\hlIntOutputDir] 105 | Count=3 106 | Item0=Release\obj\xmlwf 107 | Item1=..\xmlwf\Release 108 | Item2=Release 109 | 110 | [HistoryLists\hlFinalOutputDir] 111 | Count=3 112 | Item0=Release\ 113 | Item1=Release 114 | Item2=.\Release\ 115 | 116 | [Debugging] 117 | DebugSourceDirs= 118 | 119 | [Parameters] 120 | RunParams=sample.xml 121 | HostApplication= 122 | RemoteHost= 123 | RemotePath= 124 | RemoteDebug=0 125 | 126 | [Compiler] 127 | ShowInfoMsgs=0 128 | LinkDebugVcl=0 129 | LinkCGLIB=0 130 | 131 | [Language] 132 | ActiveLang= 133 | ProjectLang= 134 | RootDir= 135 | 136 | -------------------------------------------------------------------------------- /bcb5/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Using a Borland compiler product 3 | 4 | The files in this directory support using both the free Borland command-line 5 | compiler tools and the Borland C++ Builder IDE. The project files have been 6 | tested with both versions 5 and 6 of the C++ Builder product. 7 | 8 | Using the free BCC32 command line compiler 9 | 10 | After downloading and installing the free C++ Builder commandline version, 11 | perform the following steps (assuming it was installed under C:\Borland\BCC55): 12 | 13 | 1) Add "C:\Borland\BCC55\BIN" to your path 14 | 2) Set the environment variable BCB to "C:\Borland\BCC55". 15 | 3) edit makefile.mak: enable or comment out the appropriate commands under 16 | clean & distclean, depending on whether your OS can use deltree /y or 17 | del /s/f/q. 18 | 19 | After that, you should simply cd to the bcb5 directory in your Expat directory 20 | tree (same structure as CVS) and run "make all" or just "make". 21 | 22 | Naming 23 | 24 | The libraries have the base name "libexpat" followed optionally by an "s" 25 | (static) or a "w" (unicode version), then an underscore and optionally 26 | "mt" (multi-threaded) and "d" (dynamic RTL). 27 | 28 | To change the name of the library a project file produces, edit the project 29 | option source (see step 1 under Unicode below) and change the name contained in 30 | the PROJECT tag. In a make file, change the value assigned to the PROJECT 31 | variable. Also, the LIBRARY entry in the .def file has to be changed to 32 | correspond to the new executable name. 33 | 34 | 35 | Unicode Considerations 36 | 37 | There are no facilities in the BCB 5 GUI to create a unicode-enabled 38 | application. Fortunately, it is not hard to do by hand. 39 | 40 | 1. The startup .obj system file must be changed to the unicode version. 41 | Go to Project|Edit Option Source, and scroll down to the ALLOBJ tag. Change 42 | c0x32.obj to c0x32w.obj. Editing this file can be quirky, but usually the 43 | following kludge will make the change stick. Close and save the file 44 | (CTRL-F4) then open the options dialog (CTRL-Shift-F11), then click OK on 45 | the dialog immediately without changing anything in it. If this doesn't work, 46 | you will have to close the project completely and edit the .bpr file by hand. 47 | 48 | If you are using a make file, just change the startup .obj file assigned 49 | to the ALLOBJ variable. 50 | 51 | 2. Add the macro define XML_UNICODE_WCHAR_T. In the GUI that goes in the options 52 | dialog, Directories/Conditionals tab, in the Conditional define box. In a 53 | make file, put it in the USERDEFINES variable. 54 | 55 | 3. Of course, your code has to be written for unicode. As a start, the "main" 56 | function is called "wmain". The tchar macros are an interesting way to 57 | write code that can easily switch between unicode and utf-8. If these macros 58 | are used, then simply adding the conditional define _UNICODE as well as 59 | XML_UNICODE_WCHAR_T will bring in the unicode versions of the tchar macros. 60 | Otherwise the utf-8 versions are used. xmlwf uses its own versions of the 61 | tchar macros which are switched on and off by the XML_UNICODE macro, which 62 | itself is set by the XML_UNICODE_WCHAR_T define. 63 | 64 | Threading 65 | 66 | The libexpat libraries are all built to link with the multi-threaded dynamic RTL's. 67 | That means they require CC32xxMT.DLL present on the installation target. 68 | To create single-threaded libs, do the following: 69 | 70 | 1. The compiler option for multi-threading must be turned off. Following the 71 | instructions above to edit the option source, remove the -tWM option from 72 | the CFLAG1 tag. In a make file, remove it from the CFLAG1 variable. 73 | 74 | 2. The single threaded RTL must be called. change the RTL in the ALLLIB tag or 75 | variable (GUI or makefile repectively) to the version without the "mt" in the 76 | name. For example, change cw32mti.lib to cw32i.lib. 77 | 78 | Static RTL's 79 | 80 | To build the libs with static RTL's do the following, 81 | 82 | 1. For the static expatlibs, in the Tlib tab on the options dialog, uncheck the 83 | "Use dynamic RTL" box. For the dynamic expatlibs, in the Linker tab on the 84 | options dialog, uncheck "Use dynamic RTL". If you are using a make file, 85 | remove the _RTLDLL assignment to the SYSDEFINES variable, and change the RTL 86 | to the version without an "i" in the ALLLIB variable. For example, 87 | cw32mti.lib would become cw32mt.lib. 88 | -------------------------------------------------------------------------------- /bcb5/expat.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | [Version Info] 50 | IncludeVerInfo=0 51 | AutoIncBuild=0 52 | MajorVer=1 53 | MinorVer=0 54 | Release=0 55 | Build=0 56 | Debug=0 57 | PreRelease=0 58 | Special=0 59 | Private=0 60 | DLL=0 61 | Locale=1033 62 | CodePage=1252 63 | 64 | [Version Info Keys] 65 | CompanyName= 66 | FileDescription= 67 | FileVersion=1.0.0.0 68 | InternalName= 69 | LegalCopyright= 70 | LegalTrademarks= 71 | OriginalFilename= 72 | ProductName= 73 | ProductVersion=1.0.0.0 74 | Comments= 75 | 76 | [HistoryLists\hlIncludePath] 77 | Count=4 78 | Item0=..\lib;$(BCB)\include 79 | Item1=$(BCB)\include 80 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 81 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 82 | 83 | [HistoryLists\hlLibraryPath] 84 | Count=5 85 | Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) 86 | Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) 87 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 88 | Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 89 | Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 90 | 91 | [HistoryLists\hlDebugSourcePath] 92 | Count=1 93 | Item0=$(BCB)\source\vcl 94 | 95 | [HistoryLists\hlConditionals] 96 | Count=8 97 | Item0=_WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS 98 | Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS 99 | Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS 100 | Item3=WIN32;_WINDOWS;NDEBUG;_DEBUG;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP 101 | Item4=NDEBUG;WIN32;_WINDOWS;_USRDLL;_DEBUG;EXPAT_EXPORTS;COMPILED_FROM_DSP 102 | Item5=NDEBUG;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;_DEBUG 103 | Item6=NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;_DEBUG 104 | Item7=NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP 105 | 106 | [HistoryLists\hlIntOutputDir] 107 | Count=7 108 | Item0=Release\obj\libexpat 109 | Item1=Release\obj\libexpat_static 110 | Item2=Release\obj\mtd 111 | Item3=Release\obj\mt 112 | Item4=Release\obj 113 | Item5=Release 114 | Item6=..\lib\Release 115 | 116 | [HistoryLists\hlFinalOutputDir] 117 | Count=1 118 | Item0=Release\ 119 | 120 | [Debugging] 121 | DebugSourceDirs= 122 | 123 | [Parameters] 124 | RunParams= 125 | HostApplication= 126 | RemoteHost= 127 | RemotePath= 128 | RemoteDebug=0 129 | 130 | [Compiler] 131 | ShowInfoMsgs=0 132 | LinkDebugVcl=0 133 | LinkCGLIB=0 134 | 135 | [Language] 136 | ActiveLang= 137 | ProjectLang= 138 | RootDir= 139 | 140 | -------------------------------------------------------------------------------- /examples/elements.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="elements" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=elements - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "elements.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "elements.mak" CFG="elements - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "elements - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "elements - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "elements - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "..\win32\bin\Release" 41 | # PROP Intermediate_Dir "..\win32\tmp\Release-elements" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "XML_STATIC" /FD /c 46 | # SUBTRACT CPP /X /YX 47 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 48 | # ADD RSC /l 0x409 /d "NDEBUG" 49 | BSC32=bscmake.exe 50 | # ADD BASE BSC32 /nologo 51 | # ADD BSC32 /nologo 52 | LINK32=link.exe 53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | # ADD LINK32 odbccp32.lib libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /machine:I386 /libpath:"..\win32\bin\Release" 55 | 56 | !ELSEIF "$(CFG)" == "elements - Win32 Debug" 57 | 58 | # PROP BASE Use_MFC 0 59 | # PROP BASE Use_Debug_Libraries 1 60 | # PROP BASE Output_Dir "Debug" 61 | # PROP BASE Intermediate_Dir "Debug" 62 | # PROP BASE Target_Dir "" 63 | # PROP Use_MFC 0 64 | # PROP Use_Debug_Libraries 1 65 | # PROP Output_Dir "..\win32\bin\Debug" 66 | # PROP Intermediate_Dir "..\win32\tmp\Debug-elements" 67 | # PROP Ignore_Export_Lib 0 68 | # PROP Target_Dir "" 69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 70 | # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /I "..\lib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "XML_STATIC" /FR /FD /GZ /c 71 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 72 | # ADD RSC /l 0x409 /d "_DEBUG" 73 | BSC32=bscmake.exe 74 | # ADD BASE BSC32 /nologo 75 | # ADD BSC32 /nologo 76 | LINK32=link.exe 77 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | # ADD LINK32 odbccp32.lib libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /libpath:"..\win32\bin\Debug" 79 | 80 | !ENDIF 81 | 82 | # Begin Target 83 | 84 | # Name "elements - Win32 Release" 85 | # Name "elements - Win32 Debug" 86 | # Begin Group "Source Files" 87 | 88 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 89 | # Begin Source File 90 | 91 | SOURCE=.\elements.c 92 | # End Source File 93 | # End Group 94 | # Begin Group "Header Files" 95 | 96 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 97 | # End Group 98 | # Begin Group "Resource Files" 99 | 100 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 101 | # End Group 102 | # End Target 103 | # End Project 104 | -------------------------------------------------------------------------------- /examples/outline.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="outline" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=outline - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "outline.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "outline.mak" CFG="outline - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "outline - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "outline - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "outline - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "..\win32\bin\Release" 41 | # PROP Intermediate_Dir "..\win32\tmp\Release-outline" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c 46 | # SUBTRACT CPP /X /YX 47 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 48 | # ADD RSC /l 0x409 /d "NDEBUG" 49 | BSC32=bscmake.exe 50 | # ADD BASE BSC32 /nologo 51 | # ADD BSC32 /nologo 52 | LINK32=link.exe 53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /machine:I386 55 | 56 | !ELSEIF "$(CFG)" == "outline - Win32 Debug" 57 | 58 | # PROP BASE Use_MFC 0 59 | # PROP BASE Use_Debug_Libraries 1 60 | # PROP BASE Output_Dir "Debug" 61 | # PROP BASE Intermediate_Dir "Debug" 62 | # PROP BASE Target_Dir "" 63 | # PROP Use_MFC 0 64 | # PROP Use_Debug_Libraries 1 65 | # PROP Output_Dir "..\win32\bin\Debug" 66 | # PROP Intermediate_Dir "..\win32\tmp\Debug-outline" 67 | # PROP Ignore_Export_Lib 0 68 | # PROP Target_Dir "" 69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 70 | # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\lib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 71 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 72 | # ADD RSC /l 0x409 /d "_DEBUG" 73 | BSC32=bscmake.exe 74 | # ADD BASE BSC32 /nologo 75 | # ADD BSC32 /nologo 76 | LINK32=link.exe 77 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 79 | 80 | !ENDIF 81 | 82 | # Begin Target 83 | 84 | # Name "outline - Win32 Release" 85 | # Name "outline - Win32 Debug" 86 | # Begin Group "Source Files" 87 | 88 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 89 | # Begin Source File 90 | 91 | SOURCE=.\outline.c 92 | # End Source File 93 | # End Group 94 | # Begin Group "Header Files" 95 | 96 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 97 | # End Group 98 | # Begin Group "Resource Files" 99 | 100 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 101 | # End Group 102 | # End Target 103 | # End Project 104 | -------------------------------------------------------------------------------- /amiga/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for AmigaOS 3 | # 4 | 5 | .PHONY: help all staticlib sharedlib check clean install 6 | 7 | vpath %.c ../lib ../examples ../xmlwf ../tests 8 | vpath %.h ../lib ../tests 9 | 10 | 11 | # 12 | # Set these for SDK installation. 13 | # 14 | tooldir = SDK:Local/C 15 | staticlibdir = SDK:Local/clib2/lib 16 | staticincludedir = SDK:Local/clib2/include 17 | sharedlibdir = SDK:Local/Libs 18 | sharedincludedir = SDK:Local/common/include 19 | 20 | 21 | ifeq ($(MAKECMDGOALS), staticlib) 22 | DESTDIR = lib 23 | else 24 | DESTDIR = libs 25 | endif 26 | 27 | STATICLIB = $(DESTDIR)/libexpat.a 28 | SHAREDLIB = $(DESTDIR)/expat.library 29 | 30 | XMLWF = $(DESTDIR)/xmlwf 31 | ELEMENTS = $(DESTDIR)/elements 32 | OUTLINE = $(DESTDIR)/outline 33 | RUNTESTS = $(DESTDIR)/runtests 34 | BENCHMARK = $(DESTDIR)/benchmark 35 | 36 | 37 | help: 38 | @echo "Requires:" 39 | @echo " AmigaOS 4.0" 40 | @echo " SDK 51.22" 41 | @echo " clib2 1.202" 42 | @echo "" 43 | @echo "Targets:" 44 | @echo " all - make expat libraries, xmlwf, examples and run test suite" 45 | @echo " install - install expat libraries and tools into SDK" 46 | 47 | all: 48 | -makedir force lib libs 49 | $(MAKE) staticlib 50 | $(MAKE) sharedlib 51 | 52 | staticlib: $(STATICLIB) $(XMLWF) $(ELEMENTS) $(OUTLINE) $(RUNTESTS) $(BENCHMARK) check 53 | @echo done 54 | 55 | sharedlib: $(SHAREDLIB) $(XMLWF) $(ELEMENTS) $(OUTLINE) $(RUNTESTS) $(BENCHMARK) check 56 | @echo done 57 | 58 | check: 59 | $(RUNTESTS) 60 | 61 | clean: 62 | -delete lib/#?.o quiet 63 | -delete libs/#?.o quiet 64 | 65 | install: 66 | copy libs/xmlwf $(tooldir) quiet 67 | copy /lib/expat.h /lib/expat_external.h $(staticincludedir) quiet 68 | copy lib/libexpat.a $(staticlibdir) quiet 69 | copy libs/expat.library $(sharedlibdir) quiet 70 | copy include $(sharedincludedir) quiet all 71 | 72 | 73 | CC = gcc 74 | LIBTOOL = ar 75 | STRIP = strip 76 | 77 | LDFLAGS = 78 | LIBS = 79 | CFLAGS = -DNDEBUG -O2 80 | LTFLAGS = -crs 81 | STRIPFLAGS = -R.comment 82 | LAUNCH = 83 | 84 | ifeq ($(MAKECMDGOALS), staticlib) 85 | CFLAGS += -mcrt=clib2 86 | LDFLAGS += -mcrt=clib2 87 | LIBS += $(STATICLIB) 88 | INCLUDES = -I../lib 89 | endif 90 | 91 | ifeq ($(MAKECMDGOALS), sharedlib) 92 | CFLAGS += -mcrt=newlib -D__USE_INLINE__ 93 | LDFLAGS += -mcrt=newlib 94 | INCLUDES = -I. -Iinclude -Iinclude/libraries -I../lib 95 | LAUNCH = $(DESTDIR)/launch.o 96 | endif 97 | 98 | 99 | COMPILE = $(CC) $(CFLAGS) $(INCLUDES) -c 100 | 101 | LINK = $(CC) $(LDFLAGS) -o $@ 102 | 103 | 104 | $(STATICLIB): $(DESTDIR)/xmlparse.o $(DESTDIR)/xmltok.o $(DESTDIR)/xmlrole.o 105 | $(LIBTOOL) $(LTFLAGS) $@ $^ 106 | 107 | $(DESTDIR)/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \ 108 | expat_external.h internal.h amigaconfig.h 109 | $(COMPILE) $< -o $@ 110 | 111 | $(DESTDIR)/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \ 112 | internal.h amigaconfig.h 113 | $(COMPILE) $< -o $@ 114 | 115 | $(DESTDIR)/xmltok.o: xmltok.c xmltok_impl.c xmltok_ns.c ascii.h asciitab.h \ 116 | iasciitab.h latin1tab.h nametab.h utf8tab.h xmltok.h xmltok_impl.h \ 117 | expat_external.h internal.h amigaconfig.h 118 | $(COMPILE) $< -o $@ 119 | 120 | 121 | $(SHAREDLIB): $(DESTDIR)/expat_lib.o $(DESTDIR)/expat_vectors.o $(DESTDIR)/stdlib.o lib/libexpat.a 122 | $(LINK) -nostartfiles -nostdlib -o $@ $^ 123 | 124 | $(DESTDIR)/expat_lib.o: expat_lib.c 125 | $(COMPILE) $< -o $@ 126 | 127 | $(DESTDIR)/expat_vectors.o: expat_vectors.c 128 | $(COMPILE) $< -o $@ 129 | 130 | $(DESTDIR)/stdlib.o: stdlib.c 131 | $(COMPILE) $< -o $@ 132 | 133 | $(LAUNCH): launch.c 134 | $(COMPILE) $< -o $@ 135 | 136 | 137 | $(XMLWF): $(DESTDIR)/xmlwf.o $(DESTDIR)/xmlfile.o $(DESTDIR)/codepage.o $(DESTDIR)/readfilemap.o $(LAUNCH) 138 | $(LINK) $^ $(LIBS) 139 | $(STRIP) $(STRIPFLAGS) $@ 140 | 141 | $(DESTDIR)/xmlwf.o: xmlwf.c 142 | $(COMPILE) $< -o $@ 143 | 144 | $(DESTDIR)/xmlfile.o: xmlfile.c 145 | $(COMPILE) $< -o $@ 146 | 147 | $(DESTDIR)/codepage.o: codepage.c 148 | $(COMPILE) $< -o $@ 149 | 150 | $(DESTDIR)/readfilemap.o: readfilemap.c 151 | $(COMPILE) $< -o $@ 152 | 153 | 154 | $(ELEMENTS): $(DESTDIR)/elements.o $(LAUNCH) 155 | $(LINK) $^ $(LIBS) 156 | $(STRIP) $(STRIPFLAGS) $@ 157 | 158 | $(DESTDIR)/elements.o: elements.c 159 | $(COMPILE) $< -o $@ 160 | 161 | 162 | $(OUTLINE): $(DESTDIR)/outline.o $(LAUNCH) 163 | $(LINK) $^ $(LIBS) 164 | $(STRIP) $(STRIPFLAGS) $@ 165 | 166 | $(DESTDIR)/outline.o: outline.c 167 | $(COMPILE) $< -o $@ 168 | 169 | 170 | $(RUNTESTS): $(DESTDIR)/runtests.o $(DESTDIR)/chardata.o $(DESTDIR)/minicheck.o $(LAUNCH) 171 | $(LINK) $^ $(LIBS) 172 | 173 | $(DESTDIR)/chardata.o: chardata.c chardata.h 174 | $(COMPILE) $< -o $@ 175 | 176 | $(DESTDIR)/minicheck.o: minicheck.c minicheck.h 177 | $(COMPILE) $< -o $@ 178 | 179 | $(DESTDIR)/runtests.o: runtests.c chardata.h 180 | $(COMPILE) $< -o $@ 181 | 182 | 183 | $(BENCHMARK): $(DESTDIR)/benchmark.o $(LAUNCH) 184 | $(LINK) $^ $(LIBS) -lm 185 | 186 | $(DESTDIR)/benchmark.o: benchmark/benchmark.c 187 | $(COMPILE) $< -o $@ 188 | -------------------------------------------------------------------------------- /lib/expat_static.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="expat_static" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104 6 | 7 | CFG=expat_static - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "expat_static.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "expat_static.mak" CFG="expat_static - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "expat_static - Win32 Release" (based on "Win32 (x86) Static Library") 21 | !MESSAGE "expat_static - Win32 Debug" (based on "Win32 (x86) Static Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "expat_static - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "expat_static___Win32_Release" 36 | # PROP BASE Intermediate_Dir "expat_static___Win32_Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "..\win32\bin\Release" 41 | # PROP Intermediate_Dir "..\win32\tmp\Release_static" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 44 | # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILED_FROM_DSP" /FD /c 45 | # SUBTRACT CPP /YX 46 | # ADD BASE RSC /l 0x1009 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LIB32=link.exe -lib 52 | # ADD BASE LIB32 /nologo 53 | # ADD LIB32 /nologo /out:"..\win32\bin\Release/libexpatMT.lib" 54 | 55 | !ELSEIF "$(CFG)" == "expat_static - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "expat_static___Win32_Debug" 60 | # PROP BASE Intermediate_Dir "expat_static___Win32_Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "..\win32\bin\Debug" 65 | # PROP Intermediate_Dir "..\win32\tmp\Debug_static" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 68 | # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "COMPILED_FROM_DSP" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x1009 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LIB32=link.exe -lib 76 | # ADD BASE LIB32 /nologo 77 | # ADD LIB32 /nologo /out:"..\win32\bin\Debug\libexpatMT.lib" 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "expat_static - Win32 Release" 84 | # Name "expat_static - Win32 Debug" 85 | # Begin Group "Source Files" 86 | 87 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 88 | # Begin Source File 89 | 90 | SOURCE=.\xmlparse.c 91 | # End Source File 92 | # Begin Source File 93 | 94 | SOURCE=.\xmlrole.c 95 | # End Source File 96 | # Begin Source File 97 | 98 | SOURCE=.\xmltok.c 99 | # End Source File 100 | # Begin Source File 101 | 102 | SOURCE=.\xmltok_impl.c 103 | # End Source File 104 | # Begin Source File 105 | 106 | SOURCE=.\xmltok_ns.c 107 | # End Source File 108 | # End Group 109 | # Begin Group "Header Files" 110 | 111 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 112 | # Begin Source File 113 | 114 | SOURCE=.\ascii.h 115 | # End Source File 116 | # Begin Source File 117 | 118 | SOURCE=.\asciitab.h 119 | # End Source File 120 | # Begin Source File 121 | 122 | SOURCE=.\expat.h 123 | # End Source File 124 | # Begin Source File 125 | 126 | SOURCE=.\expat_external.h 127 | # End Source File 128 | # Begin Source File 129 | 130 | SOURCE=.\iasciitab.h 131 | # End Source File 132 | # Begin Source File 133 | 134 | SOURCE=.\internal.h 135 | # End Source File 136 | # Begin Source File 137 | 138 | SOURCE=.\latin1tab.h 139 | # End Source File 140 | # Begin Source File 141 | 142 | SOURCE=.\nametab.h 143 | # End Source File 144 | # Begin Source File 145 | 146 | SOURCE=.\utf8tab.h 147 | # End Source File 148 | # Begin Source File 149 | 150 | SOURCE=.\xmlrole.h 151 | # End Source File 152 | # Begin Source File 153 | 154 | SOURCE=.\xmltok.h 155 | # End Source File 156 | # Begin Source File 157 | 158 | SOURCE=.\xmltok_impl.h 159 | # End Source File 160 | # End Group 161 | # End Target 162 | # End Project 163 | -------------------------------------------------------------------------------- /bcb5/expatw.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | [Version Info] 50 | IncludeVerInfo=0 51 | AutoIncBuild=0 52 | MajorVer=1 53 | MinorVer=0 54 | Release=0 55 | Build=0 56 | Debug=0 57 | PreRelease=0 58 | Special=0 59 | Private=0 60 | DLL=0 61 | Locale=1033 62 | CodePage=1252 63 | 64 | [Version Info Keys] 65 | CompanyName= 66 | FileDescription= 67 | FileVersion=1.0.0.0 68 | InternalName= 69 | LegalCopyright= 70 | LegalTrademarks= 71 | OriginalFilename= 72 | ProductName= 73 | ProductVersion=1.0.0.0 74 | Comments= 75 | 76 | [HistoryLists\hlIncludePath] 77 | Count=4 78 | Item0=..\lib;$(BCB)\include 79 | Item1=$(BCB)\include 80 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 81 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 82 | 83 | [HistoryLists\hlLibraryPath] 84 | Count=5 85 | Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) 86 | Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) 87 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 88 | Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 89 | Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 90 | 91 | [HistoryLists\hlDebugSourcePath] 92 | Count=1 93 | Item0=$(BCB)\source\vcl 94 | 95 | [HistoryLists\hlConditionals] 96 | Count=9 97 | Item0=_WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T 98 | Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T 99 | Item2=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T 100 | Item3=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;_DEBUG;XML_UNICODE_WCHAR_T 101 | Item4=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;_DEBUG 102 | Item5=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_UNICODE;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;_DEBUG 103 | Item6=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_UNICODE;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T 104 | Item7=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;XML_UNICODE 105 | Item8=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T 106 | 107 | [HistoryLists\hlIntOutputDir] 108 | Count=8 109 | Item0=Release\obj\libexpatw 110 | Item1=Release\obj\libexpat 111 | Item2=Release\obj\mtd 112 | Item3=Release\obj\mt 113 | Item4=Release_w\obj 114 | Item5=Release-w\obj 115 | Item6=Release-w 116 | Item7=..\lib\Release-w 117 | 118 | [HistoryLists\hlFinalOutputDir] 119 | Count=5 120 | Item0=Release\ 121 | Item1=Release 122 | Item2=Release_w\ 123 | Item3=Release-w\ 124 | Item4=Release-w 125 | 126 | [Debugging] 127 | DebugSourceDirs= 128 | 129 | [Parameters] 130 | RunParams= 131 | HostApplication= 132 | RemoteHost= 133 | RemotePath= 134 | RemoteDebug=0 135 | 136 | [Compiler] 137 | ShowInfoMsgs=0 138 | LinkDebugVcl=0 139 | LinkCGLIB=0 140 | 141 | [Language] 142 | ActiveLang= 143 | ProjectLang= 144 | RootDir= 145 | 146 | -------------------------------------------------------------------------------- /lib/expatw_static.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="expatw_static" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104 6 | 7 | CFG=expatw_static - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "expatw_static.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "expatw_static.mak" CFG="expatw_static - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "expatw_static - Win32 Release" (based on "Win32 (x86) Static Library") 21 | !MESSAGE "expatw_static - Win32 Debug" (based on "Win32 (x86) Static Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "expatw_static - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "expatw_static___Win32_Release" 36 | # PROP BASE Intermediate_Dir "expatw_static___Win32_Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "..\win32\bin\Release" 41 | # PROP Intermediate_Dir "..\win32\tmp\Release-w_static" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 44 | # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILED_FROM_DSP" /D "XML_UNICODE_WCHAR_T" /FD /c 45 | # SUBTRACT CPP /YX 46 | # ADD BASE RSC /l 0x1009 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LIB32=link.exe -lib 52 | # ADD BASE LIB32 /nologo 53 | # ADD LIB32 /nologo /out:"..\win32\bin\Release\libexpatwMT.lib" 54 | 55 | !ELSEIF "$(CFG)" == "expatw_static - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "expatw_static___Win32_Debug" 60 | # PROP BASE Intermediate_Dir "expatw_static___Win32_Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "..\win32\bin\Debug" 65 | # PROP Intermediate_Dir "..\win32\tmp\Debug-w_static" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 68 | # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /D "COMPILED_FROM_DSP" /D "XML_UNICODE_WCHAR_T" /FR /FD /GZ /c 69 | # SUBTRACT CPP /YX 70 | # ADD BASE RSC /l 0x1009 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LIB32=link.exe -lib 76 | # ADD BASE LIB32 /nologo 77 | # ADD LIB32 /nologo /out:"..\win32\bin\Debug\libexpatwMT.lib" 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "expatw_static - Win32 Release" 84 | # Name "expatw_static - Win32 Debug" 85 | # Begin Group "Source Files" 86 | 87 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 88 | # Begin Source File 89 | 90 | SOURCE=.\xmlparse.c 91 | # End Source File 92 | # Begin Source File 93 | 94 | SOURCE=.\xmlrole.c 95 | # End Source File 96 | # Begin Source File 97 | 98 | SOURCE=.\xmltok.c 99 | # End Source File 100 | # Begin Source File 101 | 102 | SOURCE=.\xmltok_impl.c 103 | # End Source File 104 | # Begin Source File 105 | 106 | SOURCE=.\xmltok_ns.c 107 | # End Source File 108 | # End Group 109 | # Begin Group "Header Files" 110 | 111 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 112 | # Begin Source File 113 | 114 | SOURCE=.\ascii.h 115 | # End Source File 116 | # Begin Source File 117 | 118 | SOURCE=.\asciitab.h 119 | # End Source File 120 | # Begin Source File 121 | 122 | SOURCE=.\expat.h 123 | # End Source File 124 | # Begin Source File 125 | 126 | SOURCE=.\expat_external.h 127 | # End Source File 128 | # Begin Source File 129 | 130 | SOURCE=.\iasciitab.h 131 | # End Source File 132 | # Begin Source File 133 | 134 | SOURCE=.\internal.h 135 | # End Source File 136 | # Begin Source File 137 | 138 | SOURCE=.\latin1tab.h 139 | # End Source File 140 | # Begin Source File 141 | 142 | SOURCE=.\nametab.h 143 | # End Source File 144 | # Begin Source File 145 | 146 | SOURCE=.\utf8tab.h 147 | # End Source File 148 | # Begin Source File 149 | 150 | SOURCE=.\xmlrole.h 151 | # End Source File 152 | # Begin Source File 153 | 154 | SOURCE=.\xmltok.h 155 | # End Source File 156 | # Begin Source File 157 | 158 | SOURCE=.\xmltok_impl.h 159 | # End Source File 160 | # End Group 161 | # End Target 162 | # End Project 163 | -------------------------------------------------------------------------------- /tests/minicheck.c: -------------------------------------------------------------------------------- 1 | /* Miniature re-implementation of the "check" library. 2 | * 3 | * This is intended to support just enough of check to run the Expat 4 | * tests. This interface is based entirely on the portion of the 5 | * check library being used. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "minicheck.h" 14 | 15 | Suite * 16 | suite_create(char *name) 17 | { 18 | Suite *suite = (Suite *) calloc(1, sizeof(Suite)); 19 | if (suite != NULL) { 20 | suite->name = name; 21 | } 22 | return suite; 23 | } 24 | 25 | TCase * 26 | tcase_create(char *name) 27 | { 28 | TCase *tc = (TCase *) calloc(1, sizeof(TCase)); 29 | if (tc != NULL) { 30 | tc->name = name; 31 | } 32 | return tc; 33 | } 34 | 35 | void 36 | suite_add_tcase(Suite *suite, TCase *tc) 37 | { 38 | assert(suite != NULL); 39 | assert(tc != NULL); 40 | assert(tc->next_tcase == NULL); 41 | 42 | tc->next_tcase = suite->tests; 43 | suite->tests = tc; 44 | } 45 | 46 | void 47 | tcase_add_checked_fixture(TCase *tc, 48 | tcase_setup_function setup, 49 | tcase_teardown_function teardown) 50 | { 51 | assert(tc != NULL); 52 | tc->setup = setup; 53 | tc->teardown = teardown; 54 | } 55 | 56 | void 57 | tcase_add_test(TCase *tc, tcase_test_function test) 58 | { 59 | assert(tc != NULL); 60 | if (tc->allocated == tc->ntests) { 61 | int nalloc = tc->allocated + 100; 62 | size_t new_size = sizeof(tcase_test_function) * nalloc; 63 | tcase_test_function *new_tests = realloc(tc->tests, new_size); 64 | assert(new_tests != NULL); 65 | if (new_tests != tc->tests) { 66 | free(tc->tests); 67 | tc->tests = new_tests; 68 | } 69 | tc->allocated = nalloc; 70 | } 71 | tc->tests[tc->ntests] = test; 72 | tc->ntests++; 73 | } 74 | 75 | SRunner * 76 | srunner_create(Suite *suite) 77 | { 78 | SRunner *runner = calloc(1, sizeof(SRunner)); 79 | if (runner != NULL) { 80 | runner->suite = suite; 81 | } 82 | return runner; 83 | } 84 | 85 | static jmp_buf env; 86 | 87 | static char const *_check_current_function = NULL; 88 | static int _check_current_lineno = -1; 89 | static char const *_check_current_filename = NULL; 90 | 91 | void 92 | _check_set_test_info(char const *function, char const *filename, int lineno) 93 | { 94 | _check_current_function = function; 95 | _check_current_lineno = lineno; 96 | _check_current_filename = filename; 97 | } 98 | 99 | 100 | static void 101 | add_failure(SRunner *runner, int verbosity) 102 | { 103 | runner->nfailures++; 104 | if (verbosity >= CK_VERBOSE) { 105 | printf("%s:%d: %s\n", _check_current_filename, 106 | _check_current_lineno, _check_current_function); 107 | } 108 | } 109 | 110 | void 111 | srunner_run_all(SRunner *runner, int verbosity) 112 | { 113 | Suite *suite; 114 | TCase *tc; 115 | assert(runner != NULL); 116 | suite = runner->suite; 117 | tc = suite->tests; 118 | while (tc != NULL) { 119 | int i; 120 | for (i = 0; i < tc->ntests; ++i) { 121 | runner->nchecks++; 122 | 123 | if (tc->setup != NULL) { 124 | /* setup */ 125 | if (setjmp(env)) { 126 | add_failure(runner, verbosity); 127 | continue; 128 | } 129 | tc->setup(); 130 | } 131 | /* test */ 132 | if (setjmp(env)) { 133 | add_failure(runner, verbosity); 134 | continue; 135 | } 136 | (tc->tests[i])(); 137 | 138 | /* teardown */ 139 | if (tc->teardown != NULL) { 140 | if (setjmp(env)) { 141 | add_failure(runner, verbosity); 142 | continue; 143 | } 144 | tc->teardown(); 145 | } 146 | } 147 | tc = tc->next_tcase; 148 | } 149 | if (verbosity) { 150 | int passed = runner->nchecks - runner->nfailures; 151 | double percentage = ((double) passed) / runner->nchecks; 152 | int display = (int) (percentage * 100); 153 | printf("%d%%: Checks: %d, Failed: %d\n", 154 | display, runner->nchecks, runner->nfailures); 155 | } 156 | } 157 | 158 | void 159 | _fail_unless(int condition, const char *file, int line, char *msg) 160 | { 161 | /* Always print the error message so it isn't lost. In this case, 162 | we have a failure, so there's no reason to be quiet about what 163 | it is. 164 | */ 165 | if (msg != NULL) 166 | printf("%s", msg); 167 | longjmp(env, 1); 168 | } 169 | 170 | int 171 | srunner_ntests_failed(SRunner *runner) 172 | { 173 | assert(runner != NULL); 174 | return runner->nfailures; 175 | } 176 | 177 | void 178 | srunner_free(SRunner *runner) 179 | { 180 | free(runner->suite); 181 | free(runner); 182 | } 183 | -------------------------------------------------------------------------------- /xmlwf/xmlwf.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="xmlwf" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=xmlwf - Win32 Release 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "xmlwf.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "xmlwf.mak" CFG="xmlwf - Win32 Release" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "xmlwf - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "xmlwf - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "xmlwf - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir ".\Release" 36 | # PROP BASE Intermediate_Dir ".\Release" 37 | # PROP BASE Target_Dir "." 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "..\win32\bin\Release" 41 | # PROP Intermediate_Dir "..\win32\tmp\Release-xmlwf" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "." 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "COMPILED_FROM_DSP" /FD /c 46 | # SUBTRACT CPP /YX /Yc /Yu 47 | # ADD BASE RSC /l 0x809 /d "NDEBUG" 48 | # ADD RSC /l 0x409 /d "NDEBUG" 49 | BSC32=bscmake.exe 50 | # ADD BASE BSC32 /nologo 51 | # ADD BSC32 /nologo 52 | LINK32=link.exe 53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | # ADD LINK32 setargv.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /machine:I386 55 | # SUBTRACT LINK32 /nodefaultlib 56 | 57 | !ELSEIF "$(CFG)" == "xmlwf - Win32 Debug" 58 | 59 | # PROP BASE Use_MFC 0 60 | # PROP BASE Use_Debug_Libraries 1 61 | # PROP BASE Output_Dir ".\Debug" 62 | # PROP BASE Intermediate_Dir ".\Debug" 63 | # PROP BASE Target_Dir "." 64 | # PROP Use_MFC 0 65 | # PROP Use_Debug_Libraries 1 66 | # PROP Output_Dir "..\win32\bin\Debug" 67 | # PROP Intermediate_Dir "..\win32\tmp\Debug-xmlwf" 68 | # PROP Ignore_Export_Lib 0 69 | # PROP Target_Dir "." 70 | # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c 71 | # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /I "..\lib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "COMPILED_FROM_DSP" /FD /c 72 | # SUBTRACT CPP /Fr /YX 73 | # ADD BASE RSC /l 0x809 /d "_DEBUG" 74 | # ADD RSC /l 0x409 /d "_DEBUG" 75 | BSC32=bscmake.exe 76 | # ADD BASE BSC32 /nologo 77 | # ADD BSC32 /nologo 78 | LINK32=link.exe 79 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 80 | # ADD LINK32 setargv.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 81 | 82 | !ENDIF 83 | 84 | # Begin Target 85 | 86 | # Name "xmlwf - Win32 Release" 87 | # Name "xmlwf - Win32 Debug" 88 | # Begin Group "Source Files" 89 | 90 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" 91 | # Begin Source File 92 | 93 | SOURCE=.\codepage.c 94 | # End Source File 95 | # Begin Source File 96 | 97 | SOURCE=.\readfilemap.c 98 | # PROP Exclude_From_Build 1 99 | # End Source File 100 | # Begin Source File 101 | 102 | SOURCE=.\unixfilemap.c 103 | # PROP Exclude_From_Build 1 104 | # End Source File 105 | # Begin Source File 106 | 107 | SOURCE=.\win32filemap.c 108 | # End Source File 109 | # Begin Source File 110 | 111 | SOURCE=.\xmlfile.c 112 | # End Source File 113 | # Begin Source File 114 | 115 | SOURCE=.\xmlwf.c 116 | # End Source File 117 | # End Group 118 | # Begin Group "Header Files" 119 | 120 | # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" 121 | # Begin Source File 122 | 123 | SOURCE=.\codepage.h 124 | # End Source File 125 | # Begin Source File 126 | 127 | SOURCE=.\xmlfile.h 128 | # End Source File 129 | # Begin Source File 130 | 131 | SOURCE=.\xmltchar.h 132 | # End Source File 133 | # End Group 134 | # Begin Group "Resource Files" 135 | 136 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" 137 | # End Group 138 | # End Target 139 | # End Project 140 | -------------------------------------------------------------------------------- /bcb5/expatw_static.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | [Version Info] 50 | IncludeVerInfo=0 51 | AutoIncBuild=0 52 | MajorVer=1 53 | MinorVer=0 54 | Release=0 55 | Build=0 56 | Debug=0 57 | PreRelease=0 58 | Special=0 59 | Private=0 60 | DLL=0 61 | Locale=1033 62 | CodePage=1252 63 | 64 | [Version Info Keys] 65 | CompanyName= 66 | FileDescription= 67 | FileVersion=1.0.0.0 68 | InternalName= 69 | LegalCopyright= 70 | LegalTrademarks= 71 | OriginalFilename= 72 | ProductName= 73 | ProductVersion=1.0.0.0 74 | Comments= 75 | 76 | [HistoryLists\hlIncludePath] 77 | Count=4 78 | Item0=..\lib;$(BCB)\include 79 | Item1=$(BCB)\include 80 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 81 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 82 | 83 | [HistoryLists\hlLibraryPath] 84 | Count=5 85 | Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) 86 | Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) 87 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 88 | Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 89 | Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 90 | 91 | [HistoryLists\hlDebugSourcePath] 92 | Count=1 93 | Item0=$(BCB)\source\vcl 94 | 95 | [HistoryLists\hlConditionals] 96 | Count=15 97 | Item0=_WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T 98 | Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T 99 | Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T 100 | Item3=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;XML_STATIC;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T 101 | Item4=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T 102 | Item5=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG 103 | Item6=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;__cplusplus 104 | Item7=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG 105 | Item8=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG 106 | Item9=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;__WCHAR_T 107 | Item10=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;_UNICODE 108 | Item11=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG;_UNICODE 109 | Item12=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG 110 | Item13=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T 111 | Item14=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;XML_UNICODE 112 | 113 | [HistoryLists\hlIntOutputDir] 114 | Count=6 115 | Item0=Release\obj\libexpatw_static 116 | Item1=Release\obj\libexpat_static 117 | Item2=Release\obj\mts 118 | Item3=Release\obj\mt 119 | Item4=..\lib\Release-w_static 120 | Item5=Release-w_static 121 | 122 | [HistoryLists\hlFinalOutputDir] 123 | Count=3 124 | Item0=Release\ 125 | Item1=Release 126 | Item2=Release-w_static\ 127 | 128 | [HistoryLists\hlTlibPageSize] 129 | Count=1 130 | Item0=0x0010 131 | 132 | [Debugging] 133 | DebugSourceDirs= 134 | 135 | [Parameters] 136 | RunParams= 137 | HostApplication= 138 | RemoteHost= 139 | RemotePath= 140 | RemoteDebug=0 141 | 142 | [Compiler] 143 | ShowInfoMsgs=0 144 | LinkDebugVcl=0 145 | LinkCGLIB=0 146 | 147 | [Language] 148 | ActiveLang= 149 | ProjectLang= 150 | RootDir= 151 | 152 | -------------------------------------------------------------------------------- /bcb5/elements.bpr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | [Version Info] 49 | IncludeVerInfo=0 50 | AutoIncBuild=0 51 | MajorVer=1 52 | MinorVer=0 53 | Release=0 54 | Build=0 55 | Debug=0 56 | PreRelease=0 57 | Special=0 58 | Private=0 59 | DLL=0 60 | Locale=1033 61 | CodePage=1252 62 | 63 | [Version Info Keys] 64 | CompanyName= 65 | FileDescription= 66 | FileVersion=1.0.0.0 67 | InternalName= 68 | LegalCopyright= 69 | LegalTrademarks= 70 | OriginalFilename= 71 | ProductName= 72 | ProductVersion=1.0.0.0 73 | Comments= 74 | 75 | [HistoryLists\hlIncludePath] 76 | Count=4 77 | Item0=..\examples;$(BCB)\include 78 | Item1=$(BCB)\include 79 | Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl 80 | Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; 81 | 82 | [HistoryLists\hlLibraryPath] 83 | Count=8 84 | Item0=..\examples;$(BCB)\lib;$(RELEASELIBPATH) 85 | Item1=..\examples;$(BCB)\lib;..\examples\$(RELEASELIBPATH) 86 | Item2=$(BCB)\lib;$(RELEASELIBPATH) 87 | Item3=$(BCB)\lib;$(RELEASELIBPATH);..\lib\Release-w_static 88 | Item4=$(BCB)\lib;$(RELEASELIBPATH);..\lib\Release_static 89 | Item5=$(BCB)\lib;$(RELEASELIBPATH);C:\src\expat\lib\Release_static 90 | Item6=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk 91 | Item7=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; 92 | 93 | [HistoryLists\hlDebugSourcePath] 94 | Count=1 95 | Item0=$(BCB)\source\vcl 96 | 97 | [HistoryLists\hlConditionals] 98 | Count=17 99 | Item0=WIN32;NDEBUG;_CONSOLE;XML_STATIC 100 | Item1=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_STATIC 101 | Item2=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE;XML_STATIC 102 | Item3=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE 103 | Item4=WIN32;NDEBUG;_CONSOLE;_DEBUG 104 | Item5=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG 105 | Item6=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG;_UNICODE 106 | Item7=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T 107 | Item8=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T 108 | Item9=WIN32;NDEBUG;_CONSOLE;_UNICODE;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T 109 | Item10=WIN32;NDEBUG;_CONSOLE;_UNICODE;XML_STATIC;_DEBUG;XML_UNICODE 110 | Item11=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T;__WCHAR_T 111 | Item12=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE 112 | Item13=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE;_UNICODE 113 | Item14=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE 114 | Item15=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG 115 | Item16=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC 116 | 117 | [HistoryLists\hlIntOutputDir] 118 | Count=5 119 | Item0=Release\obj\examples 120 | Item1=Release\obj\elements 121 | Item2=Release\obj\mts 122 | Item3=..\examples\Release 123 | Item4=Release 124 | 125 | [HistoryLists\hlFinalOutputDir] 126 | Count=1 127 | Item0=Release\ 128 | 129 | [Debugging] 130 | DebugSourceDirs= 131 | 132 | [Parameters] 133 | RunParams= 134 | HostApplication= 135 | RemoteHost= 136 | RemotePath= 137 | RemoteDebug=0 138 | 139 | [Compiler] 140 | ShowInfoMsgs=0 141 | LinkDebugVcl=0 142 | LinkCGLIB=0 143 | 144 | [Language] 145 | ActiveLang= 146 | ProjectLang= 147 | RootDir= 148 | 149 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | dnl configuration script for expat 2 | dnl Process this file with autoconf to produce a configure script. 3 | dnl 4 | dnl Copyright 2000 Clark Cooper 5 | dnl 6 | dnl This file is part of EXPAT. 7 | dnl 8 | dnl EXPAT is free software; you can redistribute it and/or modify it 9 | dnl under the terms of the License (based on the MIT/X license) contained 10 | dnl in the file COPYING that comes with this distribution. 11 | dnl 12 | 13 | dnl Ensure that Expat is configured with autoconf 2.52 or newer 14 | AC_PREREQ(2.52) 15 | 16 | dnl Get the version number of Expat, using m4's esyscmd() command to run 17 | dnl the command at m4-generation time. This allows us to create an m4 18 | dnl symbol holding the correct version number. AC_INIT() requires the 19 | dnl version number at m4-time, rather than when ./configure is run, so 20 | dnl all this must happen as part of m4, not as part of the shell code 21 | dnl contained in ./configure. 22 | dnl 23 | dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate 24 | dnl test. I believe this test will work, but I don't have a place with non- 25 | dnl GNU M4 to test it right now. 26 | define([expat_version], ifdef([__gnu__], 27 | [esyscmd(conftools/get-version.sh lib/expat.h)], 28 | [2.0.x])) 29 | AC_INIT(expat, expat_version, expat-bugs@libexpat.org) 30 | undefine([expat_version]) 31 | 32 | AC_CONFIG_SRCDIR(Makefile.in) 33 | AC_CONFIG_AUX_DIR(conftools) 34 | 35 | 36 | dnl 37 | dnl Increment LIBREVISION if source code has changed at all 38 | dnl 39 | dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 40 | dnl 41 | dnl If the API changes compatibly (i.e. simply adding a new function 42 | dnl without changing or removing earlier interfaces), then increment LIBAGE. 43 | dnl 44 | dnl If the API changes incompatibly set LIBAGE back to 0 45 | dnl 46 | 47 | LIBCURRENT=6 48 | LIBREVISION=2 49 | LIBAGE=5 50 | 51 | AC_CONFIG_HEADER(expat_config.h) 52 | 53 | sinclude(conftools/libtool.m4) 54 | sinclude(conftools/ac_c_bigendian_cross.m4) 55 | 56 | AC_LIBTOOL_WIN32_DLL 57 | AC_PROG_LIBTOOL 58 | 59 | AC_SUBST(LIBCURRENT) 60 | AC_SUBST(LIBREVISION) 61 | AC_SUBST(LIBAGE) 62 | 63 | dnl Checks for programs. 64 | AC_PROG_CC 65 | AC_PROG_INSTALL 66 | 67 | if test "$GCC" = yes ; then 68 | dnl 69 | dnl Be careful about adding the -fexceptions option; some versions of 70 | dnl GCC don't support it and it causes extra warnings that are only 71 | dnl distracting; avoid. 72 | dnl 73 | OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" 74 | CFLAGS="$OLDCFLAGS -fexceptions" 75 | AC_MSG_CHECKING(whether $CC accepts -fexceptions) 76 | AC_TRY_LINK( , , 77 | AC_MSG_RESULT(yes), 78 | AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") 79 | CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'` 80 | fi 81 | 82 | dnl Checks for header files. 83 | AC_HEADER_STDC 84 | 85 | dnl Checks for typedefs, structures, and compiler characteristics. 86 | 87 | dnl Note: Avoid using AC_C_BIGENDIAN because it does not 88 | dnl work in a cross compile. 89 | AC_C_BIGENDIAN_CROSS 90 | 91 | AC_C_CONST 92 | AC_TYPE_SIZE_T 93 | AC_CHECK_FUNCS(memmove bcopy) 94 | 95 | dnl Only needed for xmlwf: 96 | AC_CHECK_HEADERS(fcntl.h unistd.h) 97 | AC_TYPE_OFF_T 98 | AC_FUNC_MMAP 99 | 100 | if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then 101 | FILEMAP=unixfilemap 102 | else 103 | FILEMAP=readfilemap 104 | fi 105 | AC_SUBST(FILEMAP) 106 | 107 | dnl Needed for the test support code; this was found at 108 | dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html 109 | 110 | # AC_CPP_FUNC 111 | # ------------------ # 112 | # Checks to see if ANSI C99 CPP variable __func__ works. 113 | # If not, perhaps __FUNCTION__ works instead. 114 | # If not, we'll just define __func__ to "". 115 | AC_DEFUN([AC_CPP_FUNC], 116 | [AC_REQUIRE([AC_PROG_CC_STDC])dnl 117 | AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, 118 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], 119 | [[char *foo = __func__;]])], 120 | [ac_cv_cpp_func=yes], 121 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], 122 | [[char *foo = __FUNCTION__;]])], 123 | [ac_cv_cpp_func=__FUNCTION__], 124 | [ac_cv_cpp_func=no])])]) 125 | if test $ac_cv_cpp_func = __FUNCTION__; then 126 | AC_DEFINE(__func__,__FUNCTION__, 127 | [Define to __FUNCTION__ or "" if `__func__' does not conform to 128 | ANSI C.]) 129 | elif test $ac_cv_cpp_func = no; then 130 | AC_DEFINE(__func__,"", 131 | [Define to __FUNCTION__ or "" if `__func__' does not conform to 132 | ANSI C.]) 133 | fi 134 | ])# AC_CPP_FUNC 135 | 136 | AC_CPP_FUNC 137 | 138 | 139 | dnl Some basic configuration: 140 | AC_DEFINE([XML_NS], 1, 141 | [Define to make XML Namespaces functionality available.]) 142 | AC_DEFINE([XML_DTD], 1, 143 | [Define to make parameter entity parsing functionality available.]) 144 | AC_DEFINE([XML_CONTEXT_BYTES], 1024, 145 | [Define to specify how much context to retain around the current parse point.]) 146 | 147 | AC_CONFIG_FILES(Makefile) 148 | AC_OUTPUT 149 | 150 | abs_srcdir="`cd $srcdir && pwd`" 151 | abs_builddir="`pwd`" 152 | if test "$abs_srcdir" != "$abs_builddir"; then 153 | make mkdir-init 154 | fi 155 | -------------------------------------------------------------------------------- /bcb5/expat_static.mak: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | !if !$d(BCB) 3 | BCB = $(MAKEDIR)\.. 4 | !endif 5 | 6 | # --------------------------------------------------------------------------- 7 | # IDE SECTION 8 | # --------------------------------------------------------------------------- 9 | # The following section of the project makefile is managed by the BCB IDE. 10 | # It is recommended to use the IDE to change any of the values in this 11 | # section. 12 | # --------------------------------------------------------------------------- 13 | 14 | VERSION = BCB.05.03 15 | # --------------------------------------------------------------------------- 16 | PROJECT = Release\libexpats_mtd.lib 17 | OBJFILES = Release\obj\libexpat_static\xmlparse.obj \ 18 | Release\obj\libexpat_static\xmlrole.obj \ 19 | Release\obj\libexpat_static\xmltok.obj 20 | RESFILES = 21 | MAINSOURCE = expat_static.bpf 22 | RESDEPEN = $(RESFILES) 23 | LIBFILES = 24 | IDLFILES = 25 | IDLGENFILES = 26 | LIBRARIES = 27 | PACKAGES = 28 | SPARELIBS = 29 | DEFFILE = 30 | # --------------------------------------------------------------------------- 31 | PATHCPP = .;..\lib 32 | PATHASM = .; 33 | PATHPAS = .; 34 | PATHRC = .; 35 | LINKER = TLib 36 | DEBUGLIBPATH = $(BCB)\lib\debug 37 | RELEASELIBPATH = $(BCB)\lib\release 38 | USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC 39 | SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL 40 | INCLUDEPATH = ..\lib;$(BCB)\include 41 | LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) 42 | WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc 43 | LISTFILE = 44 | # --------------------------------------------------------------------------- 45 | CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -c 46 | IDLCFLAGS = -I$(BCB)\include 47 | PFLAGS = -N2Release\obj\libexpat_static -N0Release\obj\libexpat_static -$Y- -$L- -$D- 48 | RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include 49 | AFLAGS = /mx /w2 /zn 50 | LFLAGS = 51 | # --------------------------------------------------------------------------- 52 | ALLOBJ = $(OBJFILES) 53 | ALLRES = $(RESFILES) 54 | ALLLIB = $(LIBFILES) $(LIBRARIES) 55 | # --------------------------------------------------------------------------- 56 | !ifdef IDEOPTIONS 57 | 58 | [Version Info] 59 | IncludeVerInfo=0 60 | AutoIncBuild=0 61 | MajorVer=1 62 | MinorVer=0 63 | Release=0 64 | Build=0 65 | Debug=0 66 | PreRelease=0 67 | Special=0 68 | Private=0 69 | DLL=0 70 | 71 | [Version Info Keys] 72 | CompanyName= 73 | FileDescription= 74 | FileVersion=1.0.0.0 75 | InternalName= 76 | LegalCopyright= 77 | LegalTrademarks= 78 | OriginalFilename= 79 | ProductName= 80 | ProductVersion=1.0.0.0 81 | Comments= 82 | 83 | [Debugging] 84 | DebugSourceDirs=$(BCB)\source\vcl 85 | 86 | !endif 87 | 88 | 89 | 90 | 91 | 92 | # --------------------------------------------------------------------------- 93 | # MAKE SECTION 94 | # --------------------------------------------------------------------------- 95 | # This section of the project file is not used by the BCB IDE. It is for 96 | # the benefit of building from the command-line using the MAKE utility. 97 | # --------------------------------------------------------------------------- 98 | 99 | .autodepend 100 | # --------------------------------------------------------------------------- 101 | !if "$(USERDEFINES)" != "" 102 | AUSERDEFINES = -d$(USERDEFINES:;= -d) 103 | !else 104 | AUSERDEFINES = 105 | !endif 106 | 107 | !if !$d(BCC32) 108 | BCC32 = bcc32 109 | !endif 110 | 111 | !if !$d(CPP32) 112 | CPP32 = cpp32 113 | !endif 114 | 115 | !if !$d(DCC32) 116 | DCC32 = dcc32 117 | !endif 118 | 119 | !if !$d(TASM32) 120 | TASM32 = tasm32 121 | !endif 122 | 123 | !if !$d(LINKER) 124 | LINKER = TLib 125 | !endif 126 | 127 | !if !$d(BRCC32) 128 | BRCC32 = brcc32 129 | !endif 130 | 131 | 132 | # --------------------------------------------------------------------------- 133 | !if $d(PATHCPP) 134 | .PATH.CPP = $(PATHCPP) 135 | .PATH.C = $(PATHCPP) 136 | !endif 137 | 138 | !if $d(PATHPAS) 139 | .PATH.PAS = $(PATHPAS) 140 | !endif 141 | 142 | !if $d(PATHASM) 143 | .PATH.ASM = $(PATHASM) 144 | !endif 145 | 146 | !if $d(PATHRC) 147 | .PATH.RC = $(PATHRC) 148 | !endif 149 | # --------------------------------------------------------------------------- 150 | !if "$(LISTFILE)" == "" 151 | COMMA = 152 | !else 153 | COMMA = , 154 | !endif 155 | 156 | $(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) 157 | $(BCB)\BIN\$(LINKER) /u $@ @&&! 158 | $(LFLAGS) $? $(COMMA) $(LISTFILE) 159 | 160 | ! 161 | # --------------------------------------------------------------------------- 162 | .pas.hpp: 163 | $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } 164 | 165 | .pas.obj: 166 | $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } 167 | 168 | .cpp.obj: 169 | $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } 170 | 171 | .c.obj: 172 | $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } 173 | 174 | .c.i: 175 | $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } 176 | 177 | .cpp.i: 178 | $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } 179 | 180 | .asm.obj: 181 | $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ 182 | 183 | .rc.res: 184 | $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< 185 | # --------------------------------------------------------------------------- 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /bcb5/expatw_static.mak: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | !if !$d(BCB) 3 | BCB = $(MAKEDIR)\.. 4 | !endif 5 | 6 | # --------------------------------------------------------------------------- 7 | # IDE SECTION 8 | # --------------------------------------------------------------------------- 9 | # The following section of the project makefile is managed by the BCB IDE. 10 | # It is recommended to use the IDE to change any of the values in this 11 | # section. 12 | # --------------------------------------------------------------------------- 13 | 14 | VERSION = BCB.05.03 15 | # --------------------------------------------------------------------------- 16 | PROJECT = Release\libexpatws_mtd.lib 17 | OBJFILES = Release\obj\libexpatw_static\xmlparse.obj \ 18 | Release\obj\libexpatw_static\xmlrole.obj \ 19 | Release\obj\libexpatw_static\xmltok.obj 20 | RESFILES = 21 | MAINSOURCE = expatw_static.bpf 22 | RESDEPEN = $(RESFILES) 23 | LIBFILES = 24 | IDLFILES = 25 | IDLGENFILES = 26 | LIBRARIES = 27 | PACKAGES = 28 | SPARELIBS = 29 | DEFFILE = 30 | # --------------------------------------------------------------------------- 31 | PATHCPP = .;..\lib 32 | PATHASM = .; 33 | PATHPAS = .; 34 | PATHRC = .; 35 | LINKER = TLib 36 | DEBUGLIBPATH = $(BCB)\lib\debug 37 | RELEASELIBPATH = $(BCB)\lib\release 38 | USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T 39 | SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL 40 | INCLUDEPATH = ..\lib;$(BCB)\include 41 | LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) 42 | WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc 43 | LISTFILE = 44 | # --------------------------------------------------------------------------- 45 | CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -c 46 | IDLCFLAGS = -I$(BCB)\include 47 | PFLAGS = -N2Release\obj\libexpatw_static -N0Release\obj\libexpatw_static -$Y- -$L- \ 48 | -$D- 49 | RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include 50 | AFLAGS = /mx /w2 /zn 51 | LFLAGS = 52 | # --------------------------------------------------------------------------- 53 | ALLOBJ = $(OBJFILES) 54 | ALLRES = $(RESFILES) 55 | ALLLIB = $(LIBFILES) $(LIBRARIES) 56 | # --------------------------------------------------------------------------- 57 | !ifdef IDEOPTIONS 58 | 59 | [Version Info] 60 | IncludeVerInfo=0 61 | AutoIncBuild=0 62 | MajorVer=1 63 | MinorVer=0 64 | Release=0 65 | Build=0 66 | Debug=0 67 | PreRelease=0 68 | Special=0 69 | Private=0 70 | DLL=0 71 | 72 | [Version Info Keys] 73 | CompanyName= 74 | FileDescription= 75 | FileVersion=1.0.0.0 76 | InternalName= 77 | LegalCopyright= 78 | LegalTrademarks= 79 | OriginalFilename= 80 | ProductName= 81 | ProductVersion=1.0.0.0 82 | Comments= 83 | 84 | [Debugging] 85 | DebugSourceDirs=$(BCB)\source\vcl 86 | 87 | !endif 88 | 89 | 90 | 91 | 92 | 93 | # --------------------------------------------------------------------------- 94 | # MAKE SECTION 95 | # --------------------------------------------------------------------------- 96 | # This section of the project file is not used by the BCB IDE. It is for 97 | # the benefit of building from the command-line using the MAKE utility. 98 | # --------------------------------------------------------------------------- 99 | 100 | .autodepend 101 | # --------------------------------------------------------------------------- 102 | !if "$(USERDEFINES)" != "" 103 | AUSERDEFINES = -d$(USERDEFINES:;= -d) 104 | !else 105 | AUSERDEFINES = 106 | !endif 107 | 108 | !if !$d(BCC32) 109 | BCC32 = bcc32 110 | !endif 111 | 112 | !if !$d(CPP32) 113 | CPP32 = cpp32 114 | !endif 115 | 116 | !if !$d(DCC32) 117 | DCC32 = dcc32 118 | !endif 119 | 120 | !if !$d(TASM32) 121 | TASM32 = tasm32 122 | !endif 123 | 124 | !if !$d(LINKER) 125 | LINKER = TLib 126 | !endif 127 | 128 | !if !$d(BRCC32) 129 | BRCC32 = brcc32 130 | !endif 131 | 132 | 133 | # --------------------------------------------------------------------------- 134 | !if $d(PATHCPP) 135 | .PATH.CPP = $(PATHCPP) 136 | .PATH.C = $(PATHCPP) 137 | !endif 138 | 139 | !if $d(PATHPAS) 140 | .PATH.PAS = $(PATHPAS) 141 | !endif 142 | 143 | !if $d(PATHASM) 144 | .PATH.ASM = $(PATHASM) 145 | !endif 146 | 147 | !if $d(PATHRC) 148 | .PATH.RC = $(PATHRC) 149 | !endif 150 | # --------------------------------------------------------------------------- 151 | !if "$(LISTFILE)" == "" 152 | COMMA = 153 | !else 154 | COMMA = , 155 | !endif 156 | 157 | $(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) 158 | $(BCB)\BIN\$(LINKER) /u $@ @&&! 159 | $(LFLAGS) $? $(COMMA) $(LISTFILE) 160 | 161 | ! 162 | # --------------------------------------------------------------------------- 163 | .pas.hpp: 164 | $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } 165 | 166 | .pas.obj: 167 | $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } 168 | 169 | .cpp.obj: 170 | $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } 171 | 172 | .c.obj: 173 | $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } 174 | 175 | .c.i: 176 | $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } 177 | 178 | .cpp.i: 179 | $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } 180 | 181 | .asm.obj: 182 | $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ 183 | 184 | .rc.res: 185 | $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< 186 | # --------------------------------------------------------------------------- 187 | 188 | 189 | 190 | 191 | --------------------------------------------------------------------------------