From kwaclaw at users.sourceforge.net Wed Mar 10 10:56:14 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Wed Mar 10 11:04:26 2004 Subject: [Expat-checkins] expat/lib expat.h,1.61,1.62 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25615 Modified Files: expat.h Log Message: Improved comments for XML_StopParser() and XML_ResumeParser(). Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- expat.h 27 Jan 2004 01:48:58 -0000 1.61 +++ expat.h 10 Mar 2004 15:56:11 -0000 1.62 @@ -827,20 +827,30 @@ XMLPARSEAPI(enum XML_Status) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); -/* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return as - soon as possible, but some handler call-backs - which would otherwise - get lost - may still follow. Examples: endElementHandler() for empty - elements when stopped in startElementHandler(), endNameSpaceDeclHandler() - when stopped in endElementHandler(), and possibly others. +/* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. + Must be called from within a call-back handler. Some handler call-backs + may still follow, because they would otherwise get lost. Examples: + - endElementHandler() for empty elements when stopped in + startElementHandler(), + - endNameSpaceDeclHandler() when stopped in endElementHandler(), + and possibly others. Can be called from most handlers, including DTD related call-backs. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. Possible error codes: XML_ERROR_SUSPENDED, XML_ERROR_FINISHED. + When resumable = XML_TRUE then parsing is suspended, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. + *Note*: + This will be applied to the current parser instance only, that is, if + there is a parent parser then it will continue parsing when the + externalEntityRefHandler() returns. It is up to the implementation of + the externalEntityRefHandler() to call XML_StopParser() on the parent + parser (recursively), if one wants to stop parsing altogether. + When suspended, parsing can be resumed by calling XML_ResumeParser(). */ XMLPARSEAPI(enum XML_Status) @@ -850,6 +860,13 @@ Must not be called from within a handler call-back. Returns same status codes as XML_Parse() or XML_ParseBuffer(). Additional error code XML_ERROR_NOT_SUSPENDED possible. + + *Note*: + This must be applied to the most deeply nested child parser instance + first, and to its parent parser only after the child parser has finished, + to be applied recursively until the document entity's parser is restarted. + That is, the parent parser will not resume by itself and it is up to the + application to call XML_ResumeParser() on it at the appropriate moment. */ XMLPARSEAPI(enum XML_Status) XML_ResumeParser(XML_Parser parser); From kwaclaw at users.sourceforge.net Sun Mar 14 19:34:15 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Sun Mar 14 21:37:22 2004 Subject: [Expat-checkins] expat/lib xmlparse.c,1.123,1.124 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31874 Modified Files: xmlparse.c Log Message: Fix for bug #916228. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- xmlparse.c 13 Feb 2004 18:11:51 -0000 1.123 +++ xmlparse.c 15 Mar 2004 00:34:12 -0000 1.124 @@ -5400,9 +5400,7 @@ if (p == NULL) return p; poolInit(&(p->pool), ms); -#ifdef XML_DTD poolInit(&(p->entityValuePool), ms); -#endif /* XML_DTD */ hashTableInit(&(p->generalEntities), ms); hashTableInit(&(p->elementTypes), ms); hashTableInit(&(p->attributeIds), ms); @@ -5449,9 +5447,7 @@ hashTableClear(&(p->attributeIds)); hashTableClear(&(p->prefixes)); poolClear(&(p->pool)); -#ifdef XML_DTD poolClear(&(p->entityValuePool)); -#endif /* XML_DTD */ p->defaultPrefix.name = NULL; p->defaultPrefix.binding = NULL; @@ -5492,9 +5488,7 @@ hashTableDestroy(&(p->attributeIds)); hashTableDestroy(&(p->prefixes)); poolDestroy(&(p->pool)); -#ifdef XML_DTD poolDestroy(&(p->entityValuePool)); -#endif /* XML_DTD */ if (isDocEntity) { ms->free_fcn(p->scaffIndex); ms->free_fcn(p->scaffold); From kwaclaw at users.sourceforge.net Mon Mar 15 22:50:23 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Mar 15 22:59:30 2004 Subject: [Expat-checkins] expat/lib expat.h,1.62,1.63 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19155 Modified Files: expat.h Log Message: Changed signature of XML_GetParsingStatus(), changing the return value to a parameter passed by reference (pointer). It seems that the processing of return values is not standardized, even when calling convention and platform are specified. This should make Expat more usable as a shared library. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- expat.h 10 Mar 2004 15:56:11 -0000 1.62 +++ expat.h 16 Mar 2004 03:50:21 -0000 1.63 @@ -828,8 +828,8 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. - Must be called from within a call-back handler. Some handler call-backs - may still follow, because they would otherwise get lost. Examples: + Must be called from within a call-back handler. Some call-backs + may still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in startElementHandler(), - endNameSpaceDeclHandler() when stopped in endElementHandler(), @@ -837,7 +837,8 @@ Can be called from most handlers, including DTD related call-backs. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. - Possible error codes: XML_ERROR_SUSPENDED, XML_ERROR_FINISHED. + Possible error codes: XML_ERROR_SUSPENDED - when the parser is already + suspended, XML_ERROR_FINISHED - when the parser has already finished. When resumable = XML_TRUE then parsing is suspended, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. @@ -862,8 +863,8 @@ Additional error code XML_ERROR_NOT_SUSPENDED possible. *Note*: - This must be applied to the most deeply nested child parser instance - first, and to its parent parser only after the child parser has finished, + This must be called on the most deeply nested child parser instance + first, and on its parent parser only after the child parser has finished, to be applied recursively until the document entity's parser is restarted. That is, the parent parser will not resume by itself and it is up to the application to call XML_ResumeParser() on it at the appropriate moment. @@ -888,8 +889,8 @@ XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus, XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED */ -XMLPARSEAPI(XML_ParsingStatus) -XML_GetParsingStatus(XML_Parser parser); +XMLPARSEAPI(void) +XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse From kwaclaw at users.sourceforge.net Mon Mar 15 22:53:26 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Mar 15 23:02:32 2004 Subject: [Expat-checkins] expat/lib xmlparse.c,1.124,1.125 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19673 Modified Files: xmlparse.c Log Message: Changed signature of XML_GetParsingStatus(), changing the return value to a parameter passed by reference (pointer). It seems that the processing of return values is not standardized, even when calling convention and platform are specified. This should make Expat more usable as a shared library. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- xmlparse.c 15 Mar 2004 00:34:12 -0000 1.124 +++ xmlparse.c 16 Mar 2004 03:53:24 -0000 1.125 @@ -1716,10 +1716,10 @@ return result; } -XML_ParsingStatus XMLCALL -XML_GetParsingStatus(XML_Parser parser) +void XMLCALL +XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status) { - return parser->m_parsingStatus; + *status = parser->m_parsingStatus; } enum XML_Error XMLCALL From kwaclaw at users.sourceforge.net Mon Mar 15 23:27:21 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Mar 15 23:36:28 2004 Subject: [Expat-checkins] expat/lib xmlparse.c,1.125,1.126 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24771 Modified Files: xmlparse.c Log Message: Fixed the XML_GetCurrentLine/ColumnNumber() functions so that they don't produce an access violation when the value of eventPtr is less than the value of positionPtr. This can happen when a handler raises an exception or potentially in some border cases. Also added some more updates of eventPtr. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- xmlparse.c 16 Mar 2004 03:53:24 -0000 1.125 +++ xmlparse.c 16 Mar 2004 04:27:18 -0000 1.126 @@ -1760,7 +1760,7 @@ int XMLCALL XML_GetCurrentLineNumber(XML_Parser parser) { - if (eventPtr) { + if (eventPtr && eventPtr >= positionPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } @@ -1770,7 +1770,7 @@ int XMLCALL XML_GetCurrentColumnNumber(XML_Parser parser) { - if (eventPtr) { + if (eventPtr && eventPtr >= positionPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } @@ -2043,8 +2043,12 @@ const char *end, const char **endPtr) { + int tok; const char *next = start; /* XmlContentTok doesn't always set the last arg */ - int tok = XmlContentTok(encoding, start, end, &next); + eventPtr = start; + tok = XmlContentTok(encoding, start, end, &next); + eventEndPtr = next; + switch (tok) { case XML_TOK_XML_DECL: { @@ -2068,14 +2072,12 @@ *endPtr = start; return XML_ERROR_NONE; } - eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } - eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityContentProcessor; @@ -3369,12 +3371,14 @@ const char *end, const char **nextPtr) { - const char *start = s; - const char *next = s; int tok; + const char *start = s; + const char *next = start; + eventPtr = start; for (;;) { tok = XmlPrologTok(encoding, start, end, &next); + eventEndPtr = next; if (tok <= 0) { if (!finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; @@ -3424,6 +3428,7 @@ return XML_ERROR_NONE; } start = next; + eventPtr = start; } } @@ -4489,7 +4494,6 @@ /* report partial linebreak - it might be the last token */ case -XML_TOK_PROLOG_S: if (defaultHandler) { - eventEndPtr = next; reportDefault(parser, encoding, s, next); if (parsing == XML_FINISHED) return XML_ERROR_ABORTED; From kwaclaw at users.sourceforge.net Mon Mar 15 23:41:57 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Mon Mar 15 23:51:04 2004 Subject: [Expat-checkins] expat/lib xmlparse.c,1.126,1.127 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27040 Modified Files: xmlparse.c Log Message: When the parser was suspended while processing an internal entity, an XML_ERROR_NO_ELEMENTS condition could happen. The reason was that the internal entity's start tag level was not preserved when parsing was suspended. This has been corrected. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- xmlparse.c 16 Mar 2004 04:27:18 -0000 1.126 +++ xmlparse.c 16 Mar 2004 04:41:54 -0000 1.127 @@ -284,6 +284,7 @@ const char *internalEventEndPtr; struct open_internal_entity *next; ENTITY *entity; + int startTagLevel; XML_Bool betweenDecl; /* WFC: PE Between Declarations */ } OPEN_INTERNAL_ENTITY; @@ -4568,6 +4569,7 @@ openEntity->next = openInternalEntities; openInternalEntities = openEntity; openEntity->entity = entity; + openEntity->startTagLevel = tagLevel; openEntity->betweenDecl = betweenDecl; openEntity->internalEventPtr = NULL; openEntity->internalEventEndPtr = NULL; @@ -4610,7 +4612,6 @@ ENTITY *entity; const char *textStart, *textEnd; const char *next; - int processorTagLevel; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity = openInternalEntities; if (!openEntity) @@ -4619,11 +4620,6 @@ entity = openEntity->entity; textStart = ((char *)entity->textPtr) + entity->processed; textEnd = (char *)(entity->textPtr + entity->textLen); - /* compare with cdataSectionProcessor */ - if (parentParser) - processorTagLevel = 1; - else - processorTagLevel = 0; #ifdef XML_DTD if (entity->is_param) { @@ -4633,7 +4629,7 @@ } else #endif /* XML_DTD */ - result = doContent(parser, processorTagLevel, internalEncoding, + result = doContent(parser, openEntity->startTagLevel, internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result != XML_ERROR_NONE) @@ -4662,8 +4658,9 @@ #endif /* XML_DTD */ { processor = contentProcessor; - return doContent(parser, processorTagLevel, encoding, s, end, nextPtr, - (XML_Bool)!finalBuffer); + /* see externalEntityContentProcessor vs contentProcessor */ + return doContent(parser, parentParser ? 1 : 0, encoding, s, end, + nextPtr, (XML_Bool)!finalBuffer); } } From kwaclaw at users.sourceforge.net Tue Mar 16 15:29:31 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Tue Mar 16 15:38:45 2004 Subject: [Expat-checkins] expat/lib expat.h, 1.63, 1.64 xmlparse.c, 1.127, 1.128 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31106 Modified Files: expat.h xmlparse.c Log Message: Removed ability to suspend while parsing an external parameter entity. The problem is that on return from the externalEntityRefHandler() call-back the parser currently assumes that parsing of the parameter entity is finished, and updates its internal state accordingly. I do not have the time at this point to implement and test a solution. Being able to suspend while parsing the DTD is also less desirable than doing the same while parsing content. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- expat.h 16 Mar 2004 03:50:21 -0000 1.63 +++ expat.h 16 Mar 2004 20:29:28 -0000 1.64 @@ -165,7 +165,8 @@ XML_ERROR_SUSPENDED, XML_ERROR_NOT_SUSPENDED, XML_ERROR_ABORTED, - XML_ERROR_FINISHED + XML_ERROR_FINISHED, + XML_ERROR_SUSPEND_PE }; enum XML_Content_Type { @@ -835,12 +836,15 @@ - endNameSpaceDeclHandler() when stopped in endElementHandler(), and possibly others. - Can be called from most handlers, including DTD related call-backs. + Can be called from most handlers, including DTD related call-backs, + except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. - Possible error codes: XML_ERROR_SUSPENDED - when the parser is already - suspended, XML_ERROR_FINISHED - when the parser has already finished. + Possible error codes: + - XML_ERROR_SUSPENDED: when the parser is already suspended. + - XML_ERROR_FINISHED: when the parser has already finished. + - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. - When resumable = XML_TRUE then parsing is suspended, that is, + When resumable != 0 (true) then parsing is suspended, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.127 retrieving revision 1.128 diff -u -d -r1.127 -r1.128 --- xmlparse.c 16 Mar 2004 04:41:54 -0000 1.127 +++ xmlparse.c 16 Mar 2004 20:29:28 -0000 1.128 @@ -1674,7 +1674,15 @@ errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; default: - parsing = resumable ? XML_SUSPENDED : XML_FINISHED; + if (resumable) { + if (isParamEntity) { + errorCode = XML_ERROR_SUSPEND_PE; + return XML_STATUS_ERROR; + } + parsing = XML_SUSPENDED; + } + else + parsing = XML_FINISHED; } return XML_STATUS_OK; } @@ -1851,7 +1859,8 @@ XML_L("parser suspended"), XML_L("parser not suspended"), XML_L("parsing aborted"), - XML_L("parsing finished") + XML_L("parsing finished"), + XML_L("cannot suspend in external parameter entity") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) return message[code]; From kwaclaw at users.sourceforge.net Tue Mar 16 17:14:46 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Tue Mar 16 17:24:01 2004 Subject: [Expat-checkins] expat/lib expat.h, 1.64, 1.65 xmlparse.c, 1.128, 1.129 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23180 Modified Files: expat.h xmlparse.c Log Message: Changed to allow aborting a suspended parser instance. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- expat.h 16 Mar 2004 20:29:28 -0000 1.64 +++ expat.h 16 Mar 2004 22:14:30 -0000 1.65 @@ -829,8 +829,9 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. - Must be called from within a call-back handler. Some call-backs - may still follow because they would otherwise get lost. Examples: + Must be called from within a call-back handler, except when aborting + (resumable = 0) an already suspended parser. Some call-backs may + still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in startElementHandler(), - endNameSpaceDeclHandler() when stopped in endElementHandler(), @@ -840,8 +841,8 @@ except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. Possible error codes: - - XML_ERROR_SUSPENDED: when the parser is already suspended. - - XML_ERROR_FINISHED: when the parser has already finished. + - XML_ERROR_SUSPENDED: when suspending an already suspended parser. + - XML_ERROR_FINISHED: when the parser has already finished. - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. When resumable != 0 (true) then parsing is suspended, that is, Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- xmlparse.c 16 Mar 2004 20:29:28 -0000 1.128 +++ xmlparse.c 16 Mar 2004 22:14:31 -0000 1.129 @@ -1668,8 +1668,12 @@ { switch (parsing) { case XML_SUSPENDED: - errorCode = XML_ERROR_SUSPENDED; - return XML_STATUS_ERROR; + if (resumable) { + errorCode = XML_ERROR_SUSPENDED; + return XML_STATUS_ERROR; + } + parsing = XML_FINISHED; + break; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; From kwaclaw at users.sourceforge.net Fri Mar 26 09:24:15 2004 From: kwaclaw at users.sourceforge.net (Karl Waclawek) Date: Fri Mar 26 09:35:09 2004 Subject: [Expat-checkins] expat/lib external.h, NONE, 1.1 expat.dsp, 1.10, 1.11 expat.h, 1.65, 1.66 expat_static.dsp, 1.2, 1.3 expatw.dsp, 1.3, 1.4 expatw_static.dsp, 1.2, 1.3 xmlparse.c, 1.129, 1.130 xmlrole.c, 1.16, 1.17 xmltok.c, 1.29, 1.30 xmltok.h, 1.9, 1.10 Message-ID: Update of /cvsroot/expat/expat/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6105 Modified Files: expat.dsp expat.h expat_static.dsp expatw.dsp expatw_static.dsp xmlparse.c xmlrole.c xmltok.c xmltok.h Added Files: external.h Log Message: Fix for bug #923913, Calling convention problems. For details see bug description. --- NEW FILE: external.h --- /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* External API definitions */ #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) #define XML_USE_MSC_EXTENSIONS 1 #endif /* Expat tries very hard to make the API boundary very specifically defined. There are two macros defined to control this boundary; each of these can be defined before including this header to achieve some different behavior, but doing so it not recommended or tested frequently. XMLCALL - The calling convention to use for all calls across the "library boundary." This will default to cdecl, and try really hard to tell the compiler that's what we want. XMLIMPORT - Whatever magic is needed to note that a function is to be imported from a dynamically loaded library (.dll, .so, or .sl, depending on your platform). The XMLCALL macro was added in Expat 1.95.7. The only one which is expected to be directly useful in client code is XMLCALL. Note that on at least some Unix versions, the Expat library must be compiled with the cdecl calling convention as the default since system headers may assume the cdecl convention. */ #ifndef XMLCALL #if defined(XML_USE_MSC_EXTENSIONS) #define XMLCALL __cdecl #elif defined(__GNUC__) && defined(__i386) #define XMLCALL __attribute__((cdecl)) #else /* For any platform which uses this definition and supports more than one calling convention, we need to extend this definition to declare the convention used on that platform, if it's possible to do so. If this is the case for your platform, please file a bug report with information on how to identify your platform via the C pre-processor and how to specify the same calling convention as the platform's malloc() implementation. */ #define XMLCALL #endif #endif /* not defined XMLCALL */ #if !defined(XML_STATIC) && !defined(XMLIMPORT) #ifndef XML_BUILDING_EXPAT /* using Expat from an application */ #ifdef XML_USE_MSC_EXTENSIONS #define XMLIMPORT __declspec(dllimport) #endif #endif #endif /* not defined XML_STATIC */ /* If we didn't define it above, define it away: */ #ifndef XMLIMPORT #define XMLIMPORT #endif #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL #ifdef __cplusplus extern "C" { #endif #ifdef XML_UNICODE_WCHAR_T #define XML_UNICODE #endif #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ #ifdef XML_UNICODE_WCHAR_T typedef wchar_t XML_Char; typedef wchar_t XML_LChar; #else typedef unsigned short XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE_WCHAR_T */ #else /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE */ Index: expat.dsp =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.dsp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- expat.dsp 15 Oct 2003 21:38:15 -0000 1.10 +++ expat.dsp 26 Mar 2004 14:24:09 -0000 1.11 @@ -133,10 +133,18 @@ # End Source File # Begin Source File +SOURCE=.\external.h +# End Source File +# Begin Source File + SOURCE=.\iasciitab.h # End Source File # Begin Source File +SOURCE=.\internal.h +# End Source File +# Begin Source File + SOURCE=.\latin1tab.h # End Source File # Begin Source File Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- expat.h 16 Mar 2004 22:14:30 -0000 1.65 +++ expat.h 26 Mar 2004 14:24:09 -0000 1.66 @@ -15,97 +15,11 @@ #endif #include - -#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) -#define XML_USE_MSC_EXTENSIONS 1 -#endif - -/* Expat tries very hard to make the API boundary very specifically - defined. There are two macros defined to control this boundary; - each of these can be defined before including this header to - achieve some different behavior, but doing so it not recommended or - tested frequently. - - XMLCALL - The calling convention to use for all calls across the - "library boundary." This will default to cdecl, and - try really hard to tell the compiler that's what we - want. - - XMLIMPORT - Whatever magic is needed to note that a function is - to be imported from a dynamically loaded library - (.dll, .so, or .sl, depending on your platform). - - The XMLCALL macro was added in Expat 1.95.7. The only one which is - expected to be directly useful in client code is XMLCALL. - - Note that on at least some Unix versions, the Expat library must be - compiled with the cdecl calling convention as the default since - system headers may assume the cdecl convention. -*/ -#ifndef XMLCALL -#if defined(XML_USE_MSC_EXTENSIONS) -#define XMLCALL __cdecl -#elif defined(__GNUC__) && defined(__i386) -#define XMLCALL __attribute__((cdecl)) -#else -/* For any platform which uses this definition and supports more than - one calling convention, we need to extend this definition to - declare the convention used on that platform, if it's possible to - do so. - - If this is the case for your platform, please file a bug report - with information on how to identify your platform via the C - pre-processor and how to specify the same calling convention as the - platform's malloc() implementation. -*/ -#define XMLCALL -#endif -#endif /* not defined XMLCALL */ - - -#if !defined(XML_STATIC) && !defined(XMLIMPORT) -#ifndef XML_BUILDING_EXPAT -/* using Expat from an application */ - -#ifdef XML_USE_MSC_EXTENSIONS -#define XMLIMPORT __declspec(dllimport) -#endif - -#endif -#endif /* not defined XML_STATIC */ - -/* If we didn't define it above, define it away: */ -#ifndef XMLIMPORT -#define XMLIMPORT -#endif - - -#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef XML_UNICODE_WCHAR_T -#define XML_UNICODE -#endif +#include "external.h" struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; -#ifdef XML_UNICODE /* Information is UTF-16 encoded. */ -#ifdef XML_UNICODE_WCHAR_T -typedef wchar_t XML_Char; -typedef wchar_t XML_LChar; -#else -typedef unsigned short XML_Char; -typedef char XML_LChar; -#endif /* XML_UNICODE_WCHAR_T */ -#else /* Information is UTF-8 encoded. */ -typedef char XML_Char; -typedef char XML_LChar; -#endif /* XML_UNICODE */ - /* Should this be defined using stdbool.h when C99 is available? */ typedef unsigned char XML_Bool; #define XML_TRUE ((XML_Bool) 1) @@ -265,9 +179,9 @@ typedef struct { - void *(XMLCALL *malloc_fcn)(size_t size); - void *(XMLCALL *realloc_fcn)(void *ptr, size_t size); - void (XMLCALL *free_fcn)(void *ptr); + void *(*malloc_fcn)(size_t size); + void *(*realloc_fcn)(void *ptr, size_t size); + void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; /* Constructs a new parser; encoding is the encoding specified by the Index: expat_static.dsp =================================================================== RCS file: /cvsroot/expat/expat/lib/expat_static.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- expat_static.dsp 21 Oct 2002 21:19:41 -0000 1.2 +++ expat_static.dsp 26 Mar 2004 14:24:10 -0000 1.3 @@ -115,10 +115,18 @@ # End Source File # Begin Source File +SOURCE=.\external.h +# End Source File +# Begin Source File + SOURCE=.\iasciitab.h # End Source File # Begin Source File +SOURCE=.\internal.h +# End Source File +# Begin Source File + SOURCE=.\latin1tab.h # End Source File # Begin Source File Index: expatw.dsp =================================================================== RCS file: /cvsroot/expat/expat/lib/expatw.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- expatw.dsp 15 Oct 2003 21:38:15 -0000 1.3 +++ expatw.dsp 26 Mar 2004 14:24:10 -0000 1.4 @@ -134,10 +134,18 @@ # End Source File # Begin Source File +SOURCE=.\external.h +# End Source File +# Begin Source File + SOURCE=.\iasciitab.h # End Source File # Begin Source File +SOURCE=.\internal.h +# End Source File +# Begin Source File + SOURCE=.\latin1tab.h # End Source File # Begin Source File Index: expatw_static.dsp =================================================================== RCS file: /cvsroot/expat/expat/lib/expatw_static.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- expatw_static.dsp 21 Oct 2002 21:19:41 -0000 1.2 +++ expatw_static.dsp 26 Mar 2004 14:24:10 -0000 1.3 @@ -115,10 +115,18 @@ # End Source File # Begin Source File +SOURCE=.\external.h +# End Source File +# Begin Source File + SOURCE=.\iasciitab.h # End Source File # Begin Source File +SOURCE=.\internal.h +# End Source File +# Begin Source File + SOURCE=.\latin1tab.h # End Source File # Begin Source File Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.129 retrieving revision 1.130 diff -u -d -r1.129 -r1.130 --- xmlparse.c 16 Mar 2004 22:14:31 -0000 1.129 +++ xmlparse.c 26 Mar 2004 14:24:10 -0000 1.130 @@ -491,7 +491,7 @@ void *m_unknownEncodingMem; void *m_unknownEncodingData; void *m_unknownEncodingHandlerData; - void (*m_unknownEncodingRelease)(void *); + void (XMLCALL *m_unknownEncodingRelease)(void *); PROLOG_STATE m_prologState; Processor *m_processor; enum XML_Error m_errorCode; Index: xmlrole.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlrole.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- xmlrole.c 13 Feb 2004 18:11:51 -0000 1.16 +++ xmlrole.c 26 Mar 2004 14:24:11 -0000 1.17 @@ -12,6 +12,7 @@ #endif #endif /* ndef COMPILED_FROM_DSP */ +#include "external.h" #include "internal.h" #include "xmlrole.h" #include "ascii.h" Index: xmltok.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- xmltok.c 16 Oct 2003 04:51:11 -0000 1.29 +++ xmltok.c 26 Mar 2004 14:24:11 -0000 1.30 @@ -12,6 +12,7 @@ #endif #endif /* ndef COMPILED_FROM_DSP */ +#include "external.h" #include "internal.h" #include "xmltok.h" #include "nametab.h" @@ -1233,7 +1234,7 @@ struct unknown_encoding { struct normal_encoding normal; - int (*convert)(void *userData, const char *p); + CONVERTER convert; void *userData; unsigned short utf16[256]; char utf8[256][4]; Index: xmltok.h =================================================================== RCS file: /cvsroot/expat/expat/lib/xmltok.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- xmltok.h 14 Dec 2002 03:12:18 -0000 1.9 +++ xmltok.h 26 Mar 2004 14:24:11 -0000 1.10 @@ -281,7 +281,8 @@ int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); int XmlSizeOfUnknownEncoding(void); -typedef int (*CONVERTER)(void *userData, const char *p); + +typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); ENCODING * XmlInitUnknownEncoding(void *mem,