From 4de4f141b6d28ce0f98ef2e359cafc10f8ad5c64 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 15 Jan 2006 00:06:16 +0000 Subject: [PATCH] update to Expat Version 2.0 svn path=/trunk/; revision=20874 --- reactos/lib/expat/COPYING | 2 +- reactos/lib/expat/Changes | 11 +- reactos/lib/expat/MANIFEST | 12 ++ reactos/lib/expat/README | 16 ++- reactos/lib/expat/configure.in | 6 +- reactos/lib/expat/doc/reference.html | 47 +++++--- reactos/lib/expat/examples/elements.c | 19 ++- reactos/lib/expat/examples/outline.c | 19 ++- reactos/lib/expat/lib/internal.h | 2 +- reactos/lib/expat/lib/xmlparse.c | 110 +++++++++++------- reactos/lib/expat/lib/xmlrole.c | 4 +- reactos/lib/expat/lib/xmltok.c | 4 +- reactos/lib/expat/lib/xmltok.h | 4 +- reactos/lib/expat/lib/xmltok_impl.c | 6 +- reactos/lib/expat/make-release.sh | 4 +- reactos/lib/expat/tests/README.txt | 6 +- reactos/lib/expat/tests/benchmark/README.txt | 4 +- reactos/lib/expat/tests/benchmark/benchmark.c | 15 ++- reactos/lib/expat/tests/runtests.c | 44 +++++-- reactos/lib/expat/win32/MANIFEST.txt | 2 +- reactos/lib/expat/win32/README.txt | 16 ++- reactos/lib/expat/win32/expat.iss | 79 +++++++------ reactos/lib/expat/xmlwf/codepage.c | 4 +- reactos/lib/expat/xmlwf/xmlfile.c | 20 +++- reactos/lib/expat/xmlwf/xmlfile.h | 10 ++ reactos/lib/expat/xmlwf/xmlwf.c | 12 +- 26 files changed, 331 insertions(+), 147 deletions(-) diff --git a/reactos/lib/expat/COPYING b/reactos/lib/expat/COPYING index 5c5d524a1f8..dcb45064296 100644 --- a/reactos/lib/expat/COPYING +++ b/reactos/lib/expat/COPYING @@ -1,6 +1,6 @@ Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001, 2002, 2003 Expat maintainers. +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/reactos/lib/expat/Changes b/reactos/lib/expat/Changes index c3ed3a669fa..63818663fca 100644 --- a/reactos/lib/expat/Changes +++ b/reactos/lib/expat/Changes @@ -1,9 +1,16 @@ -Release 1.95.9 TBD +Release 2.0.0 Wed Jan 11 2006 - We no longer use the "check" library for C unit testing; we always use the (partial) internal implementation of the API. - Report XML_NS setting via XML_GetFeatureList(). - Fixed headers for use from C++. - - Updated to use libtool 1.5.10 (the most recent). + - XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber() + now return unsigned integers. + - Added XML_LARGE_SIZE switch to enable 64-bit integers for + byte indexes and line/column numbers. + - Updated to use libtool 1.5.22 (the most recent). + - Added support for AmigaOS. + - Some mostly minor bug fixes. SF issues include: 1006708, + 1021776, 1023646, 1114960, 1156398, 1221160, 1271642. Release 1.95.8 Fri Jul 23 2004 - Major new feature: suspend/resume. Handlers can now request diff --git a/reactos/lib/expat/MANIFEST b/reactos/lib/expat/MANIFEST index 252a43918d3..aa83d5bf16f 100644 --- a/reactos/lib/expat/MANIFEST +++ b/reactos/lib/expat/MANIFEST @@ -1,3 +1,14 @@ +amiga/stdlib.c +amiga/launch.c +amiga/expat_vectors.c +amiga/expat_lib.c +amiga/expat.xml +amiga/README.txt +amiga/Makefile +amiga/include/proto/expat.h +amiga/include/libraries/expat.h +amiga/include/interfaces/expat.h +amiga/include/inline4/expat.h bcb5/README.txt bcb5/all_projects.bpg bcb5/elements.bpf @@ -55,6 +66,7 @@ examples/elements.dsp examples/outline.c examples/outline.dsp lib/Makefile.MPW +lib/amigaconfig.h lib/ascii.h lib/asciitab.h lib/expat.dsp diff --git a/reactos/lib/expat/README b/reactos/lib/expat/README index 0885292cf0b..585bcc1bf6e 100644 --- a/reactos/lib/expat/README +++ b/reactos/lib/expat/README @@ -1,5 +1,5 @@ - Expat, Release 1.95.8 + Expat, Release 2.0.0 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register @@ -9,7 +9,7 @@ document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Windows users should use the expat_win32bin package, which includes -both precompiled libraries and executalbes, and source code for +both precompiled libraries and executables, and source code for developers. Expat is free software. You may copy, distribute, and modify it under @@ -48,14 +48,20 @@ into /home/me/mystuff/lib, /home/me/mystuff/include, and /home/me/mystuff/bin, you can tell configure about that with: ./configure --prefix=/home/me/mystuff + +Another interesting option is to enable 64-bit integer support for +line and column numbers and the over-all byte index: + + ./configure CPPFLAGS=-DXML_LARGE_SIZE After running the configure script, the "make" command will build things and "make install" will install things into their proper -location. Note that you need to have write permission into the -directories into which things will be installed. +location. Have a look at the "Makefile" to learn about additional +"make" options. Note that you need to have write permission into +the directories into which things will be installed. If you are interested in building Expat to provide document -information in UTF-16 rather than the default UTF-8, following these +information in UTF-16 rather than the default UTF-8, follow these instructions: 1. For UTF-16 output as unsigned short (and version/error diff --git a/reactos/lib/expat/configure.in b/reactos/lib/expat/configure.in index b53e4556a0a..9d3a6f7beab 100644 --- a/reactos/lib/expat/configure.in +++ b/reactos/lib/expat/configure.in @@ -25,8 +25,8 @@ dnl test. I believe this test will work, but I don't have a place with non- dnl GNU M4 to test it right now. define([expat_version], ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], - [1.95.x])) -AC_INIT(expat, expat_version, expat-bugs@mail.libexpat.org) + [2.0.x])) +AC_INIT(expat, expat_version, expat-bugs@libexpat.org) undefine([expat_version]) AC_CONFIG_SRCDIR(Makefile.in) @@ -44,7 +44,7 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=5 +LIBCURRENT=6 LIBREVISION=0 LIBAGE=5 diff --git a/reactos/lib/expat/doc/reference.html b/reactos/lib/expat/doc/reference.html index ebcde6cf3a6..e812c7df2ef 100644 --- a/reactos/lib/expat/doc/reference.html +++ b/reactos/lib/expat/doc/reference.html @@ -19,7 +19,7 @@

The Expat XML Parser

- Release 1.95.8 + Release 2.0.0 @@ -344,6 +344,16 @@ defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE. +
XML_LARGE_SIZE
+
If defined, causes the XML_Size and XML_Index +integer types to be at least 64 bits in size. This is intended to support +processing of very large input streams, where the return values of +XML_GetCurrentByteIndex, +XML_GetCurrentLineNumber and +XML_GetCurrentColumnNumber +could overflow. It may not be supported by all compilers, and is turned +off by default.
+
XML_CONTEXT_BYTES
The number of input bytes of markup context which the parser will ensure are available for reporting via user data.

To state the obvious: the three parsing functions XML_Parse, XML_ParseBuffer and -XML_GetBuffer must not be -called from within a handler unless they operate on a separate parser -instance, that is, one that did not call the handler. For example, it -is OK to call the parsing functions from within an -XML_ExternalEntityRefHandler, if they apply to the parser -created by must not be called from within a handler +unless they operate on a separate parser instance, that is, one that +did not call the handler. For example, it is OK to call the parsing +functions from within an XML_ExternalEntityRefHandler, +if they apply to the parser created by +XML_ExternalEntityParserCreate.

+

Note: the len argument passed to these functions +should be considerably less than the maximum value for an integer, +as it could create an integer overflow situation if the added +lengths of a buffer and the unprocessed portion of the previous buffer +exceed the maximum integer value. Input data at the end of a buffer +will remain unprocessed if it is part of an XML token for which the +end is not part of that buffer.

+
 enum XML_Status XMLCALL
 XML_Parse(XML_Parser p,
@@ -1201,10 +1219,11 @@ appropriate handler setter. None of the handler setting functions have
 a return value.

Your handlers will be receiving strings in arrays of type -XML_Char. This type is defined in expat.h as char -* and contains bytes encoding UTF-8. Note that you'll receive -them in this form independent of the original encoding of the -document.

+XML_Char. This type is conditionally defined in expat.h as +either char, wchar_t or unsigned short. +The former implies UTF-8 encoding, the latter two imply UTF-16 encoding. +Note that you'll receive them in this form independent of the original +encoding of the document.

@@ -1896,7 +1915,7 @@ The code should be one of the enums that can be returned from
 
-long XMLCALL
+XML_Index XMLCALL
 XML_GetCurrentByteIndex(XML_Parser p);
 
@@ -1907,7 +1926,7 @@ the values returned by
-int XMLCALL
+XML_Size XMLCALL
 XML_GetCurrentLineNumber(XML_Parser p);
 
@@ -1916,7 +1935,7 @@ Return the line number of the position. The first line is reported as
-int XMLCALL
+XML_Size XMLCALL
 XML_GetCurrentColumnNumber(XML_Parser p);
 
diff --git a/reactos/lib/expat/examples/elements.c b/reactos/lib/expat/examples/elements.c index 52f47adf46d..421a1ce7793 100644 --- a/reactos/lib/expat/examples/elements.c +++ b/reactos/lib/expat/examples/elements.c @@ -2,11 +2,22 @@ reads an XML document from standard input and writes a line with the name of each element to standard output indenting child elements by one tab stop more than their parent element. + It must be used with Expat compiled for UTF-8 output. */ #include #include "expat.h" +#ifdef XML_LARGE_SIZE +#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 +#define XML_FMT_INT_MOD "I64" +#else +#define XML_FMT_INT_MOD "ll" +#endif +#else +#define XML_FMT_INT_MOD "l" +#endif + static void XMLCALL startElement(void *userData, const char *name, const char **atts) { @@ -25,8 +36,14 @@ endElement(void *userData, const char *name) *depthPtr -= 1; } +#ifdef AMIGA_SHARED_LIB +#include +int +amiga_main(int argc, char *argv[]) +#else int main(int argc, char *argv[]) +#endif { char buf[BUFSIZ]; XML_Parser parser = XML_ParserCreate(NULL); @@ -39,7 +56,7 @@ main(int argc, char *argv[]) done = len < sizeof(buf); if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { fprintf(stderr, - "%s at line %d\n", + "%s at line %" XML_FMT_INT_MOD "u\n", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser)); return 1; diff --git a/reactos/lib/expat/examples/outline.c b/reactos/lib/expat/examples/outline.c index 43ee74b6d40..807ddb89e03 100644 --- a/reactos/lib/expat/examples/outline.c +++ b/reactos/lib/expat/examples/outline.c @@ -18,12 +18,23 @@ * * Read an XML document from standard input and print an element * outline on standard output. + * Must be used with Expat compiled for UTF-8 output. */ #include #include +#ifdef XML_LARGE_SIZE +#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 +#define XML_FMT_INT_MOD "I64" +#else +#define XML_FMT_INT_MOD "ll" +#endif +#else +#define XML_FMT_INT_MOD "l" +#endif + #define BUFFSIZE 8192 char Buff[BUFFSIZE]; @@ -54,8 +65,14 @@ end(void *data, const char *el) Depth--; } +#ifdef AMIGA_SHARED_LIB +#include +int +amiga_main(int argc, char *argv[]) +#else int main(int argc, char *argv[]) +#endif { XML_Parser p = XML_ParserCreate(NULL); if (! p) { @@ -77,7 +94,7 @@ main(int argc, char *argv[]) done = feof(stdin); if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { - fprintf(stderr, "Parse error at line %d:\n%s\n", + fprintf(stderr, "Parse error at line %" XML_FMT_INT_MOD "u:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); exit(-1); diff --git a/reactos/lib/expat/lib/internal.h b/reactos/lib/expat/lib/internal.h index dd5454831da..ff056c659cd 100644 --- a/reactos/lib/expat/lib/internal.h +++ b/reactos/lib/expat/lib/internal.h @@ -20,7 +20,7 @@ and therefore subject to change. */ -#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) +#if defined(__GNUC__) && defined(__i386__) /* We'll use this version by default only where we know it helps. regparm() generates warnings on Solaris boxes. See SF bug #692878. diff --git a/reactos/lib/expat/lib/xmlparse.c b/reactos/lib/expat/lib/xmlparse.c index 5ac3fefaafa..04f8b91438d 100644 --- a/reactos/lib/expat/lib/xmlparse.c +++ b/reactos/lib/expat/lib/xmlparse.c @@ -12,11 +12,13 @@ #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" +#elif defined(__amigaos4__) +#include "amigaconfig.h" #elif defined(HAVE_EXPAT_CONFIG_H) #include #endif /* ndef COMPILED_FROM_DSP */ -#include +#include "expat.h" #ifdef XML_UNICODE #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX @@ -456,7 +458,7 @@ struct XML_ParserStruct { char *m_bufferEnd; /* allocated end of buffer */ const char *m_bufferLim; - long m_parseEndByteIndex; + XML_Index m_parseEndByteIndex; const char *m_parseEndPtr; XML_Char *m_dataBuf; XML_Char *m_dataBufEnd; @@ -1604,9 +1606,9 @@ XML_GetBuffer(XML_Parser parser, int len) if (len > bufferLim - bufferEnd) { /* FIXME avoid integer overflow */ - int neededSize = len + (bufferEnd - bufferPtr); + int neededSize = len + (int)(bufferEnd - bufferPtr); #ifdef XML_CONTEXT_BYTES - int keep = bufferPtr - buffer; + int keep = (int)(bufferPtr - buffer); if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; @@ -1615,7 +1617,7 @@ XML_GetBuffer(XML_Parser parser, int len) if (neededSize <= bufferLim - buffer) { #ifdef XML_CONTEXT_BYTES if (keep < bufferPtr - buffer) { - int offset = (bufferPtr - buffer) - keep; + int offset = (int)(bufferPtr - buffer) - keep; memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep); bufferEnd -= offset; bufferPtr -= offset; @@ -1628,7 +1630,7 @@ XML_GetBuffer(XML_Parser parser, int len) } else { char *newBuf; - int bufferSize = bufferLim - bufferPtr; + int bufferSize = (int)(bufferLim - bufferPtr); if (bufferSize == 0) bufferSize = INIT_BUFFER_SIZE; do { @@ -1642,7 +1644,7 @@ XML_GetBuffer(XML_Parser parser, int len) bufferLim = newBuf + bufferSize; #ifdef XML_CONTEXT_BYTES if (bufferPtr) { - int keep = bufferPtr - buffer; + int keep = (int)(bufferPtr - buffer); if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep); @@ -1749,7 +1751,7 @@ XML_GetErrorCode(XML_Parser parser) return errorCode; } -long XMLCALL +XML_Index XMLCALL XML_GetCurrentByteIndex(XML_Parser parser) { if (eventPtr) @@ -1761,7 +1763,7 @@ int XMLCALL XML_GetCurrentByteCount(XML_Parser parser) { if (eventEndPtr && eventPtr) - return eventEndPtr - eventPtr; + return (int)(eventEndPtr - eventPtr); return 0; } @@ -1770,15 +1772,15 @@ XML_GetInputContext(XML_Parser parser, int *offset, int *size) { #ifdef XML_CONTEXT_BYTES if (eventPtr && buffer) { - *offset = eventPtr - buffer; - *size = bufferEnd - buffer; + *offset = (int)(eventPtr - buffer); + *size = (int)(bufferEnd - buffer); return buffer; } #endif /* defined XML_CONTEXT_BYTES */ return (char *) 0; } -int XMLCALL +XML_Size XMLCALL XML_GetCurrentLineNumber(XML_Parser parser) { if (eventPtr && eventPtr >= positionPtr) { @@ -1788,7 +1790,7 @@ XML_GetCurrentLineNumber(XML_Parser parser) return position.lineNumber + 1; } -int XMLCALL +XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser parser) { if (eventPtr && eventPtr >= positionPtr) { @@ -2324,12 +2326,12 @@ doContent(XML_Parser parser, XmlConvert(enc, &fromPtr, rawNameEnd, (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); - convLen = toPtr - (XML_Char *)tag->buf; + convLen = (int)(toPtr - (XML_Char *)tag->buf); if (fromPtr == rawNameEnd) { tag->name.strLen = convLen; break; } - bufSize = (tag->bufEnd - tag->buf) << 1; + bufSize = (int)(tag->bufEnd - tag->buf) << 1; { char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) @@ -2517,12 +2519,12 @@ doContent(XML_Parser parser, ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); + (int)(dataPtr - (ICHAR *)dataBuf)); } else characterDataHandler(handlerArg, (XML_Char *)s, - (XML_Char *)end - (XML_Char *)s); + (int)((XML_Char *)end - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, end); @@ -2547,7 +2549,7 @@ doContent(XML_Parser parser, XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); + (int)(dataPtr - (ICHAR *)dataBuf)); if (s == next) break; *eventPP = s; @@ -2556,7 +2558,7 @@ doContent(XML_Parser parser, else characterDataHandler(handlerArg, (XML_Char *)s, - (XML_Char *)next - (XML_Char *)s); + (int)((XML_Char *)next - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, next); @@ -2854,8 +2856,10 @@ storeAtts(XML_Parser parser, const ENCODING *enc, nsAtts[j].hash = uriHash; nsAtts[j].uriName = s; - if (!--nPrefixes) + if (!--nPrefixes) { + i += 2; break; + } } else /* not prefixed */ ((XML_Char *)s)[-1] = 0; /* clear flag */ @@ -3125,7 +3129,7 @@ doCdataSection(XML_Parser parser, XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); + (int)(dataPtr - (ICHAR *)dataBuf)); if (s == next) break; *eventPP = s; @@ -3134,7 +3138,7 @@ doCdataSection(XML_Parser parser, else characterDataHandler(handlerArg, (XML_Char *)s, - (XML_Char *)next - (XML_Char *)s); + (int)((XML_Char *)next - (XML_Char *)s)); } else if (defaultHandler) reportDefault(parser, enc, s, next); @@ -3799,7 +3803,8 @@ doProlog(XML_Parser parser, */ #ifdef XML_DTD if (doctypeSysid || useForeignDTD) { - dtd->hasParamEntityRefs = XML_TRUE; /* when docTypeSysid == NULL */ + XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; + dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, @@ -3815,11 +3820,17 @@ doProlog(XML_Parser parser, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - if (dtd->paramEntityRead && - !dtd->standalone && - notStandaloneHandler && - !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; + if (dtd->paramEntityRead) { + if (!dtd->standalone && + notStandaloneHandler && + !notStandaloneHandler(handlerArg)) + return XML_ERROR_NOT_STANDALONE; + } + /* if we didn't read the foreign DTD then this means that there + is no external subset and we must reset dtd->hasParamEntityRefs + */ + else if (!doctypeSysid) + dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } useForeignDTD = XML_FALSE; @@ -3836,6 +3847,7 @@ doProlog(XML_Parser parser, last chance to read the foreign DTD */ if (useForeignDTD) { + XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, @@ -3851,11 +3863,17 @@ doProlog(XML_Parser parser, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - if (dtd->paramEntityRead && - !dtd->standalone && - notStandaloneHandler && - !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; + if (dtd->paramEntityRead) { + if (!dtd->standalone && + notStandaloneHandler && + !notStandaloneHandler(handlerArg)) + return XML_ERROR_NOT_STANDALONE; + } + /* if we didn't read the foreign DTD then this means that there + is no external subset and we must reset dtd->hasParamEntityRefs + */ + else + dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } } @@ -3996,7 +4014,7 @@ doProlog(XML_Parser parser, next - enc->minBytesPerChar); if (declEntity) { declEntity->textPtr = poolStart(&dtd->entityValuePool); - declEntity->textLen = poolLength(&dtd->entityValuePool); + declEntity->textLen = (int)(poolLength(&dtd->entityValuePool)); poolFinish(&dtd->entityValuePool); if (entityDeclHandler) { *eventEndPP = s; @@ -4681,7 +4699,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, if (result == XML_ERROR_NONE) { if (textEnd != next && ps_parsing == XML_SUSPENDED) { - entity->processed = next - textStart; + entity->processed = (int)(next - textStart); processor = internalEntityProcessor; } else { @@ -4727,7 +4745,7 @@ internalEntityProcessor(XML_Parser parser, if (result != XML_ERROR_NONE) return result; else if (textEnd != next && ps_parsing == XML_SUSPENDED) { - entity->processed = next - (char *)entity->textPtr; + entity->processed = (int)(next - (char *)entity->textPtr); return result; } else { @@ -4861,9 +4879,8 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); poolDiscard(&temp2Pool); - /* first, determine if a check for an existing declaration is needed; - if yes, check that the entity exists, and that it is internal, - otherwise call the default handler (if called from content) + /* First, determine if a check for an existing declaration is needed; + if yes, check that the entity exists, and that it is internal. */ if (pool == &dtd->pool) /* are we called from prolog? */ checkEntityDecl = @@ -4882,13 +4899,16 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { - /* cannot report skipped entity here - see comments on - skippedEntityHandler + /* Cannot report skipped entity here - see comments on + skippedEntityHandler. if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); */ + /* Cannot call the default handler because this would be + out of sync with the call to the startElementHandler. if ((pool == &tempPool) && defaultHandler) reportDefault(parser, enc, ptr, next); + */ break; } if (entity->open) { @@ -5188,12 +5208,12 @@ reportDefault(XML_Parser parser, const ENCODING *enc, ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; - defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); + defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf)); *eventPP = s; } while (s != end); } else - defaultHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); + defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s)); } @@ -6075,7 +6095,7 @@ poolGrow(STRING_POOL *pool) } } if (pool->blocks && pool->start == pool->blocks->s) { - int blockSize = (pool->end - pool->start)*2; + int blockSize = (int)(pool->end - pool->start)*2; pool->blocks = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, (offsetof(BLOCK, s) @@ -6089,7 +6109,7 @@ poolGrow(STRING_POOL *pool) } else { BLOCK *tem; - int blockSize = pool->end - pool->start; + int blockSize = (int)(pool->end - pool->start); if (blockSize < INIT_BLOCK_SIZE) blockSize = INIT_BLOCK_SIZE; else diff --git a/reactos/lib/expat/lib/xmlrole.c b/reactos/lib/expat/lib/xmlrole.c index 47f7c24c092..3782f1ec441 100644 --- a/reactos/lib/expat/lib/xmlrole.c +++ b/reactos/lib/expat/lib/xmlrole.c @@ -8,13 +8,15 @@ #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" +#elif defined(__amigaos4__) +#include "amigaconfig.h" #else #ifdef HAVE_EXPAT_CONFIG_H #include #endif #endif /* ndef COMPILED_FROM_DSP */ -#include +#include "expat_external.h" #include "internal.h" #include "xmlrole.h" #include "ascii.h" diff --git a/reactos/lib/expat/lib/xmltok.c b/reactos/lib/expat/lib/xmltok.c index e4b7e7d51cf..26cee4d4e55 100644 --- a/reactos/lib/expat/lib/xmltok.c +++ b/reactos/lib/expat/lib/xmltok.c @@ -8,13 +8,15 @@ #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" +#elif defined(__amigaos4__) +#include "amigaconfig.h" #else #ifdef HAVE_EXPAT_CONFIG_H #include #endif #endif /* ndef COMPILED_FROM_DSP */ -#include +#include "expat_external.h" #include "internal.h" #include "xmltok.h" #include "nametab.h" diff --git a/reactos/lib/expat/lib/xmltok.h b/reactos/lib/expat/lib/xmltok.h index 1ecd05f8862..ca867aa6b42 100644 --- a/reactos/lib/expat/lib/xmltok.h +++ b/reactos/lib/expat/lib/xmltok.h @@ -111,8 +111,8 @@ extern "C" { typedef struct position { /* first line and first column are 0 not 1 */ - unsigned long lineNumber; - unsigned long columnNumber; + XML_Size lineNumber; + XML_Size columnNumber; } POSITION; typedef struct { diff --git a/reactos/lib/expat/lib/xmltok_impl.c b/reactos/lib/expat/lib/xmltok_impl.c index 46569fe38aa..0ee57abb1f4 100644 --- a/reactos/lib/expat/lib/xmltok_impl.c +++ b/reactos/lib/expat/lib/xmltok_impl.c @@ -1714,7 +1714,7 @@ PREFIX(nameLength)(const ENCODING *enc, const char *ptr) ptr += MINBPC(enc); break; default: - return ptr - start; + return (int)(ptr - start); } } } @@ -1750,7 +1750,7 @@ PREFIX(updatePosition)(const ENCODING *enc, LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_LF: - pos->columnNumber = (unsigned)-1; + pos->columnNumber = (XML_Size)-1; pos->lineNumber++; ptr += MINBPC(enc); break; @@ -1759,7 +1759,7 @@ PREFIX(updatePosition)(const ENCODING *enc, ptr += MINBPC(enc); if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); - pos->columnNumber = (unsigned)-1; + pos->columnNumber = (XML_Size)-1; break; default: ptr += MINBPC(enc); diff --git a/reactos/lib/expat/make-release.sh b/reactos/lib/expat/make-release.sh index 917db681e88..818d41b1864 100644 --- a/reactos/lib/expat/make-release.sh +++ b/reactos/lib/expat/make-release.sh @@ -7,8 +7,8 @@ # Note: tagname may be HEAD to just grab the head revision (e.g. for testing) # -CVSROOT=':ext:cvs.libexpat.org:/cvsroot/expat' -#CVSROOT=':pserver:anonymous@cvs.libexpat.org:/cvsroot/expat' +#CVSROOT=':ext:cvs.libexpat.org:/cvsroot/expat' +CVSROOT=':pserver:anonymous@cvs.libexpat.org:/cvsroot/expat' if test $# != 1; then echo "USAGE: $0 tagname" diff --git a/reactos/lib/expat/tests/README.txt b/reactos/lib/expat/tests/README.txt index 1ee72edc520..33a47c34abc 100644 --- a/reactos/lib/expat/tests/README.txt +++ b/reactos/lib/expat/tests/README.txt @@ -3,12 +3,12 @@ tests provide general unit testing and regression coverage. The tests are not expected to be useful examples of Expat usage; see the examples/ directory for that. -The Expat tests use the "Check" unit testing framework for C. More -information on Check can be found at: +The Expat tests use a partial internal implementation of the "Check" +unit testing framework for C. More information on Check can be found at: http://check.sourceforge.net/ -Check 0.8 must be installed before the unit tests can be compiled & run. +Expat must be built and installed before "make check" can be executed. Since both Check and this test suite are young, it can all change in a later version. diff --git a/reactos/lib/expat/tests/benchmark/README.txt b/reactos/lib/expat/tests/benchmark/README.txt index 80a3ea3b3ac..7f9cca037ec 100644 --- a/reactos/lib/expat/tests/benchmark/README.txt +++ b/reactos/lib/expat/tests/benchmark/README.txt @@ -4,7 +4,7 @@ Use this benchmark command line utility as follows: The command line arguments are: - -n ... optional; if supplied, then namespace processing is turned on + -n ... optional; if supplied, namespace processing is turned on ... name/path of test xml file ... size of processing buffer; the file is parsed in chunks of this size @@ -13,4 +13,4 @@ The command line arguments are: Returns: The time (in seconds) it takes to parse the test file, - averaged of the number of iterations. \ No newline at end of file + averaged over the number of iterations. \ No newline at end of file diff --git a/reactos/lib/expat/tests/benchmark/benchmark.c b/reactos/lib/expat/tests/benchmark/benchmark.c index 99c51a12e9c..86266a00f33 100644 --- a/reactos/lib/expat/tests/benchmark/benchmark.c +++ b/reactos/lib/expat/tests/benchmark/benchmark.c @@ -4,6 +4,12 @@ #include #include "expat.h" +#ifdef XML_LARGE_SIZE +#define XML_FMT_INT_MOD "ll" +#else +#define XML_FMT_INT_MOD "l" +#endif + static void usage(const char *prog, int rc) { @@ -12,7 +18,13 @@ usage(const char *prog, int rc) exit(rc); } +#ifdef AMIGA_SHARED_LIB +#include +int +amiga_main(int argc, char *argv[]) +#else int main (int argc, char *argv[]) +#endif { XML_Parser parser; char *XMLBuf, *XMLBufEnd, *XMLBufPtr; @@ -77,7 +89,8 @@ int main (int argc, char *argv[]) else parseBufferSize = bufferSize; if (!XML_Parse (parser, XMLBufPtr, parseBufferSize, isFinal)) { - fprintf (stderr, "error '%s' at line %d character %d\n", + fprintf (stderr, "error '%s' at line %" XML_FMT_INT_MOD \ + "u character %" XML_FMT_INT_MOD "u\n", XML_ErrorString (XML_GetErrorCode (parser)), XML_GetCurrentLineNumber (parser), XML_GetCurrentColumnNumber (parser)); diff --git a/reactos/lib/expat/tests/runtests.c b/reactos/lib/expat/tests/runtests.c index f86b1247b00..088fe6f7388 100644 --- a/reactos/lib/expat/tests/runtests.c +++ b/reactos/lib/expat/tests/runtests.c @@ -17,6 +17,15 @@ #include "chardata.h" #include "minicheck.h" +#ifdef AMIGA_SHARED_LIB +#include +#endif + +#ifdef XML_LARGE_SIZE +#define XML_FMT_INT_MOD "ll" +#else +#define XML_FMT_INT_MOD "l" +#endif static XML_Parser parser; @@ -45,7 +54,8 @@ _xml_failure(XML_Parser parser, const char *file, int line) { char buffer[1024]; sprintf(buffer, - "\n %s (line %d, offset %d)\n reported from %s, line %d", + "\n %s (line %" XML_FMT_INT_MOD "u, offset %"\ + XML_FMT_INT_MOD "u)\n reported from %s, line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser), XML_GetCurrentColumnNumber(parser), @@ -397,14 +407,15 @@ START_TEST(test_line_number_after_parse) "\n" "\n" "\n"; - int lineno; + XML_Size lineno; if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR) xml_failure(parser); lineno = XML_GetCurrentLineNumber(parser); if (lineno != 4) { char buffer[100]; - sprintf(buffer, "expected 4 lines, saw %d", lineno); + sprintf(buffer, + "expected 4 lines, saw %" XML_FMT_INT_MOD "u", lineno); fail(buffer); } } @@ -414,14 +425,15 @@ END_TEST START_TEST(test_column_number_after_parse) { char *text = ""; - int colno; + XML_Size colno; if (XML_Parse(parser, text, strlen(text), XML_FALSE) == XML_STATUS_ERROR) xml_failure(parser); colno = XML_GetCurrentColumnNumber(parser); if (colno != 11) { char buffer[100]; - sprintf(buffer, "expected 11 columns, saw %d", colno); + sprintf(buffer, + "expected 11 columns, saw %" XML_FMT_INT_MOD "u", colno); fail(buffer); } } @@ -434,7 +446,9 @@ start_element_event_handler2(void *userData, const XML_Char *name, CharData *storage = (CharData *) userData; char buffer[100]; - sprintf(buffer, "<%s> at col:%d line:%d\n", name, + sprintf(buffer, + "<%s> at col:%" XML_FMT_INT_MOD "u line:%"\ + XML_FMT_INT_MOD "u\n", name, XML_GetCurrentColumnNumber(parser), XML_GetCurrentLineNumber(parser)); CharData_AppendString(storage, buffer); @@ -446,7 +460,9 @@ end_element_event_handler2(void *userData, const XML_Char *name) CharData *storage = (CharData *) userData; char buffer[100]; - sprintf(buffer, " at col:%d line:%d\n", name, + sprintf(buffer, + " at col:%" XML_FMT_INT_MOD "u line:%"\ + XML_FMT_INT_MOD "u\n", name, XML_GetCurrentColumnNumber(parser), XML_GetCurrentLineNumber(parser)); CharData_AppendString(storage, buffer); @@ -495,14 +511,14 @@ START_TEST(test_line_number_after_error) "\n" " \n" " "; /* missing */ - int lineno; + XML_Size lineno; if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR) fail("Expected a parse error"); lineno = XML_GetCurrentLineNumber(parser); if (lineno != 3) { char buffer[100]; - sprintf(buffer, "expected 3 lines, saw %d", lineno); + sprintf(buffer, "expected 3 lines, saw %" XML_FMT_INT_MOD "u", lineno); fail(buffer); } } @@ -515,14 +531,15 @@ START_TEST(test_column_number_after_error) "\n" " \n" " "; /* missing */ - int colno; + XML_Size colno; if (XML_Parse(parser, text, strlen(text), XML_FALSE) != XML_STATUS_ERROR) fail("Expected a parse error"); colno = XML_GetCurrentColumnNumber(parser); if (colno != 4) { char buffer[100]; - sprintf(buffer, "expected 4 columns, saw %d", colno); + sprintf(buffer, + "expected 4 columns, saw %" XML_FMT_INT_MOD "u", colno); fail(buffer); } } @@ -1385,8 +1402,13 @@ make_suite(void) } +#ifdef AMIGA_SHARED_LIB +int +amiga_main(int argc, char *argv[]) +#else int main(int argc, char *argv[]) +#endif { int i, nf; int forking = 0, forking_set = 0; diff --git a/reactos/lib/expat/win32/MANIFEST.txt b/reactos/lib/expat/win32/MANIFEST.txt index 66b780ed34c..e579c69f923 100644 --- a/reactos/lib/expat/win32/MANIFEST.txt +++ b/reactos/lib/expat/win32/MANIFEST.txt @@ -26,4 +26,4 @@ directory you specified to the installer. \Source\bcb5\ Project files for Borland C++ Builder 5 and BCC 5.5. - \Unistall\ The uninstaller and its data files. + diff --git a/reactos/lib/expat/win32/README.txt b/reactos/lib/expat/win32/README.txt index b54517163a4..2cad767ce01 100644 --- a/reactos/lib/expat/win32/README.txt +++ b/reactos/lib/expat/win32/README.txt @@ -13,9 +13,19 @@ Expat can be built on Windows in three ways: Based on the workspace file expat.dsw. The related project files (.dsp) are located in the lib subdirectory. -* MS Visual Studio .NET 2002, 2003: +* MS Visual Studio .NET 2002, 2003, 2005: The VC++ 6 workspace file (expat.dsw) and project files (.dsp) can be opened and imported in VS.NET without problems. + +* Creating MinGW dynamic libraries from MS VC++ DLLs: + + On the command line, execute these steps: + pexports libexpat.dll > expat.def + pexports libexpatw.dll > expatw.def + dlltool -d expat.def -l libexpat.a + dlltool -d expatw.def -l libexpatw.a + + The *.a files are mingw libraries. * Special note about MS VC++ and runtime libraries: @@ -46,6 +56,9 @@ Expat can be built on Windows in three ways: Multi-threaded Dll: libexpat(w)MD.lib The suffixes conform to the compiler switch settings /ML, /MT and /MD for MS VC++. + + Note: In Visual Studio 2005 (Visual C++ 8.0) and later, the + single-threaded runtime library is not supported anymore. By default, the expat-static and expatw-static projects are set up to link statically against the multithreaded run-time library, @@ -60,4 +73,3 @@ Expat can be built on Windows in three ways: An application linking to the static libraries must have the global macro XML_STATIC defined. - \ No newline at end of file diff --git a/reactos/lib/expat/win32/expat.iss b/reactos/lib/expat/win32/expat.iss index ce764d23915..5ff808c6132 100644 --- a/reactos/lib/expat/win32/expat.iss +++ b/reactos/lib/expat/win32/expat.iss @@ -1,4 +1,4 @@ -; Basic setup script for the Inno Setep installer builder. For more +; Basic setup script for the Inno Setup installer builder. For more ; information on the free installer builder, see www.jrsoftware.org. ; ; This script was contributed by Tim Peters. @@ -7,15 +7,15 @@ [Setup] AppName=expat AppId=expat -AppVersion=1.95.8 -AppVerName=expat 1.95.8 -AppCopyright=Copyright © 1998-2003 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers -DefaultDirName={sd}\Expat-1.95.8 +AppVersion=2.0.0 +AppVerName=expat 2.0.0 +AppCopyright=Copyright © 1998-2006 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers +DefaultDirName={sd}\Expat-2.0.0 AppPublisher=The Expat Developers AppPublisherURL=http://www.libexpat.org/ AppSupportURL=http://www.libexpat.org/ AppUpdatesURL=http://www.libexpat.org/ -UninstallDisplayName=Expat XML Parser (version 1.95.8) +UninstallDisplayName=Expat XML Parser (version 2.0.0) UninstallFilesDir={app}\Uninstall Compression=bzip/9 @@ -27,36 +27,43 @@ DisableProgramGroupPage=yes DisableReadyPage=yes [Files] -CopyMode: alwaysoverwrite; Source: xmlwf\Release\*.exe; DestDir: "{app}" -CopyMode: alwaysoverwrite; Source: win32\MANIFEST.txt; DestDir: "{app}" -CopyMode: alwaysoverwrite; Source: Changes; DestDir: "{app}"; DestName: Changes.txt -CopyMode: alwaysoverwrite; Source: COPYING; DestDir: "{app}"; DestName: COPYING.txt -CopyMode: alwaysoverwrite; Source: README; DestDir: "{app}"; DestName: README.txt -CopyMode: alwaysoverwrite; Source: doc\*.html; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: doc\*.css; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: doc\*.png; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: lib\Release\*.dll; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release\*.lib; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release-w\*.dll; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release-w\*.lib; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release_static\*.lib; DestDir: "{app}\StaticLibs" -CopyMode: alwaysoverwrite; Source: lib\Release-w_static\*.lib; DestDir: "{app}\StaticLibs" -CopyMode: alwaysoverwrite; Source: expat.dsw; DestDir: "{app}\Source" -CopyMode: alwaysoverwrite; Source: win32\README.txt; DestDir: "{app}\Source" -CopyMode: alwaysoverwrite; Source: bcb5\*.*; DestDir: "{app}\Source\bcb5" -CopyMode: alwaysoverwrite; Source: lib\*.c; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.h; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.def; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.dsp; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: examples\*.c; DestDir: "{app}\Source\examples" -CopyMode: alwaysoverwrite; Source: examples\*.dsp; DestDir: "{app}\Source\examples" -CopyMode: alwaysoverwrite; Source: tests\*.c; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: tests\*.cpp; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: tests\*.h; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: tests\README.txt; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: xmlwf\*.c*; DestDir: "{app}\Source\xmlwf" -CopyMode: alwaysoverwrite; Source: xmlwf\*.h; DestDir: "{app}\Source\xmlwf" -CopyMode: alwaysoverwrite; Source: xmlwf\*.dsp; DestDir: "{app}\Source\xmlwf" +Flags: ignoreversion; Source: xmlwf\Release\*.exe; DestDir: "{app}" +Flags: ignoreversion; Source: win32\MANIFEST.txt; DestDir: "{app}" +Flags: ignoreversion; Source: Changes; DestDir: "{app}"; DestName: Changes.txt +Flags: ignoreversion; Source: COPYING; DestDir: "{app}"; DestName: COPYING.txt +Flags: ignoreversion; Source: README; DestDir: "{app}"; DestName: README.txt +Flags: ignoreversion; Source: doc\*.html; DestDir: "{app}\Doc" +Flags: ignoreversion; Source: doc\*.css; DestDir: "{app}\Doc" +Flags: ignoreversion; Source: doc\*.png; DestDir: "{app}\Doc" +Flags: ignoreversion; Source: lib\Release\*.dll; DestDir: "{app}\Libs" +Flags: ignoreversion; Source: lib\Release\*.lib; DestDir: "{app}\Libs" +Flags: ignoreversion; Source: lib\Release-w\*.dll; DestDir: "{app}\Libs" +Flags: ignoreversion; Source: lib\Release-w\*.lib; DestDir: "{app}\Libs" +Flags: ignoreversion; Source: lib\Release_static\*.lib; DestDir: "{app}\StaticLibs" +Flags: ignoreversion; Source: lib\Release-w_static\*.lib; DestDir: "{app}\StaticLibs" +Flags: ignoreversion; Source: expat.dsw; DestDir: "{app}\Source" +Flags: ignoreversion; Source: win32\README.txt; DestDir: "{app}\Source" +Flags: ignoreversion; Source: bcb5\*.bp*; DestDir: "{app}\Source\bcb5" +Flags: ignoreversion; Source: bcb5\*.mak; DestDir: "{app}\Source\bcb5" +Flags: ignoreversion; Source: bcb5\*.def; DestDir: "{app}\Source\bcb5" +Flags: ignoreversion; Source: bcb5\*.txt; DestDir: "{app}\Source\bcb5" +Flags: ignoreversion; Source: bcb5\*.bat; DestDir: "{app}\Source\bcb5" +Flags: ignoreversion; Source: lib\*.c; DestDir: "{app}\Source\lib" +Flags: ignoreversion; Source: lib\*.h; DestDir: "{app}\Source\lib" +Flags: ignoreversion; Source: lib\*.def; DestDir: "{app}\Source\lib" +Flags: ignoreversion; Source: lib\*.dsp; DestDir: "{app}\Source\lib" +Flags: ignoreversion; Source: examples\*.c; DestDir: "{app}\Source\examples" +Flags: ignoreversion; Source: examples\*.dsp; DestDir: "{app}\Source\examples" +Flags: ignoreversion; Source: tests\*.c; DestDir: "{app}\Source\tests" +Flags: ignoreversion; Source: tests\*.cpp; DestDir: "{app}\Source\tests" +Flags: ignoreversion; Source: tests\*.h; DestDir: "{app}\Source\tests" +Flags: ignoreversion; Source: tests\README.txt; DestDir: "{app}\Source\tests" +Flags: ignoreversion; Source: tests\benchmark\*.c; DestDir: "{app}\Source\tests\benchmark" +Flags: ignoreversion; Source: tests\benchmark\*.ds*; DestDir: "{app}\Source\tests\benchmark" +Flags: ignoreversion; Source: tests\benchmark\README.txt; DestDir: "{app}\Source\tests\benchmark" +Flags: ignoreversion; Source: xmlwf\*.c*; DestDir: "{app}\Source\xmlwf" +Flags: ignoreversion; Source: xmlwf\*.h; DestDir: "{app}\Source\xmlwf" +Flags: ignoreversion; Source: xmlwf\*.dsp; DestDir: "{app}\Source\xmlwf" [Messages] WelcomeLabel1=Welcome to the Expat XML Parser Setup Wizard diff --git a/reactos/lib/expat/xmlwf/codepage.c b/reactos/lib/expat/xmlwf/codepage.c index b8fdb7a6c9a..e610c7c3683 100644 --- a/reactos/lib/expat/xmlwf/codepage.c +++ b/reactos/lib/expat/xmlwf/codepage.c @@ -20,12 +20,12 @@ codepageMap(int cp, int *map) for (i = 0; i < 256; i++) map[i] = -1; if (info.MaxCharSize > 1) { - for (i = 0; i < MAX_LEADBYTES; i++) { + for (i = 0; i < MAX_LEADBYTES; i+=2) { int j, lim; if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) break; lim = info.LeadByte[i + 1]; - for (j = info.LeadByte[i]; j < lim; j++) + for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2; } } diff --git a/reactos/lib/expat/xmlwf/xmlfile.c b/reactos/lib/expat/xmlwf/xmlfile.c index 32c6488d78f..88bb396b9c4 100644 --- a/reactos/lib/expat/xmlwf/xmlfile.c +++ b/reactos/lib/expat/xmlwf/xmlfile.c @@ -7,13 +7,17 @@ #include #include #include + #ifdef COMPILED_FROM_DSP #include "winconfig.h" -#else -#ifdef HAVE_EXPAT_CONFIG_H -#include "expat_config.h" -#endif -#endif +#elif defined(MACOS_CLASSIC) +#include "macconfig.h" +#elif defined(__amigaos4__) +#include "amigaconfig.h" +#elif defined(HAVE_EXPAT_CONFIG_H) +#include +#endif /* ndef COMPILED_FROM_DSP */ + #include "expat.h" #include "xmlfile.h" #include "xmltchar.h" @@ -23,6 +27,10 @@ #include #endif +#ifdef AMIGA_SHARED_LIB +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif @@ -53,7 +61,7 @@ reportError(XML_Parser parser, const XML_Char *filename) enum XML_Error code = XML_GetErrorCode(parser); const XML_Char *message = XML_ErrorString(code); if (message) - ftprintf(stdout, T("%s:%d:%d: %s\n"), + ftprintf(stdout, T("%s:%" XML_FMT_INT_MOD "u:%" XML_FMT_INT_MOD "u: %s\n"), filename, XML_GetErrorLineNumber(parser), XML_GetErrorColumnNumber(parser), diff --git a/reactos/lib/expat/xmlwf/xmlfile.h b/reactos/lib/expat/xmlwf/xmlfile.h index d053365e342..d093ecc06f9 100644 --- a/reactos/lib/expat/xmlwf/xmlfile.h +++ b/reactos/lib/expat/xmlwf/xmlfile.h @@ -5,6 +5,16 @@ #define XML_MAP_FILE 01 #define XML_EXTERNAL_ENTITIES 02 +#ifdef XML_LARGE_SIZE +#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 +#define XML_FMT_INT_MOD "I64" +#else +#define XML_FMT_INT_MOD "ll" +#endif +#else +#define XML_FMT_INT_MOD "l" +#endif + extern int XML_ProcessFile(XML_Parser parser, const XML_Char *filename, unsigned flags); diff --git a/reactos/lib/expat/xmlwf/xmlwf.c b/reactos/lib/expat/xmlwf/xmlwf.c index eae180e746e..2de9b92ea21 100644 --- a/reactos/lib/expat/xmlwf/xmlwf.c +++ b/reactos/lib/expat/xmlwf/xmlwf.c @@ -16,6 +16,10 @@ #include #endif +#ifdef AMIGA_SHARED_LIB +#include +#endif + /* This ensures proper sorting. */ #define NSSEP T('\001') @@ -305,7 +309,8 @@ metaLocation(XML_Parser parser) if (uri) ftprintf((FILE *)XML_GetUserData(parser), T(" uri=\"%s\""), uri); ftprintf((FILE *)XML_GetUserData(parser), - T(" byte=\"%ld\" nbytes=\"%d\" line=\"%d\" col=\"%d\""), + T(" byte=\"%" XML_FMT_INT_MOD "d\" nbytes=\"%d\" \ + line=\"%" XML_FMT_INT_MOD "u\" col=\"%" XML_FMT_INT_MOD "u\""), XML_GetCurrentByteIndex(parser), XML_GetCurrentByteCount(parser), XML_GetCurrentLineNumber(parser), @@ -634,8 +639,13 @@ usage(const XML_Char *prog, int rc) exit(rc); } +#ifdef AMIGA_SHARED_LIB +int +amiga_main(int argc, char *argv[]) +#else int tmain(int argc, XML_Char **argv) +#endif { int i, j; const XML_Char *outputDir = NULL;