diff --git a/expat/lib/internal.h b/expat/lib/internal.h index 6e2c5ed4..1bf6baa5 100644 --- a/expat/lib/internal.h +++ b/expat/lib/internal.h @@ -3,32 +3,59 @@ Internal definitions used by Expat. This is not needed to compile client code. - The following definitions are made: + The following calling convention macros are defined for frequently + called functions: - FASTCALL -- Used for most internal functions to specify that the - fastest possible calling convention be used. + FASTCALL - Used for those internal functions that have a simple + body and a low number of arguments and local variables. - inline -- Used for selected internal functions for which inlining - may improve performance on some platforms. + PTRCALL - Used for functions called though function pointers. + + PTRFASTCALL - Like PTRCALL, but for low number of arguments. + + inline - Used for selected internal functions for which inlining + may improve performance on some platforms. + + Note: Use of these macros is based on judgement, not hard rules, + and therefore subject to change. */ #if defined(__GNUC__) -/* Last minute instability reported with egcs on a RedHat Linux 7.3 - box; argh! +/* Instability reported with egcs on a RedHat Linux 7.3. + Let's comment it out: + #define FASTCALL __attribute__((stdcall, regparm(3))) + and let's try this: */ -/* #define FASTCALL __attribute__((stdcall, regparm(3))) */ +#define FASTCALL __attribute__((regparm(3))) +#define PTRCALL +#define PTRFASTCALL __attribute__((regparm(3))) + #elif defined(WIN32) -/* XXX This seems to have an unexpected negative effect on Windows so - we'll disable it for now on that platform. It may be reconsidered - for a future release if it can be made more effective. +/* Using __fastcall seems to have an unexpected negative effect under + MS VC++, especially for function pointers, so we won't use it for + now on that platform. It may be reconsidered for a future release + if it can be made more effective. + Likely reason: __fastcall on Windows is like stdcall, therefore + the compiler cannot perform stack optimizations for call clusters. */ -/* #define FASTCALL __fastcall */ +#define FASTCALL +#define PTRCALL +#define PTRFASTCALL + #endif #ifndef FASTCALL #define FASTCALL #endif +#ifndef PTRCALL +#define PTRCALL +#endif + +#ifndef PTRFASTCALL +#define PTRFASTCALL +#endif + #ifndef XML_MIN_SIZE #if !defined(__cplusplus) && !defined(inline) #ifdef __GNUC__ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index ab877fef..9d2c225c 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -272,10 +272,10 @@ typedef struct open_internal_entity { ENTITY *entity; } OPEN_INTERNAL_ENTITY; -typedef enum XML_Error FASTCALL Processor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr); +typedef enum XML_Error PTRCALL Processor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr); static Processor prologProcessor; static Processor prologInitProcessor; @@ -295,85 +295,85 @@ static Processor externalEntityInitProcessor2; static Processor externalEntityInitProcessor3; static Processor externalEntityContentProcessor; -static enum XML_Error FASTCALL +static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); -static enum XML_Error FASTCALL +static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); -static enum XML_Error FASTCALL +static enum XML_Error initializeEncoding(XML_Parser parser); -static enum XML_Error FASTCALL +static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr); -static enum XML_Error FASTCALL +static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity); -static enum XML_Error FASTCALL +static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *start, const char *end, const char **endPtr); -static enum XML_Error FASTCALL +static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #ifdef XML_DTD -static enum XML_Error FASTCALL +static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #endif /* XML_DTD */ -static enum XML_Error FASTCALL +static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); -static int FASTCALL +static int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); -static int FASTCALL +static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser); -static enum XML_Error FASTCALL +static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); -static enum XML_Error FASTCALL +static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); -static ATTRIBUTE_ID * FASTCALL +static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static int FASTCALL +static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); -static enum XML_Error FASTCALL +static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static int FASTCALL +static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static int FASTCALL +static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static void FASTCALL +static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static const XML_Char * FASTCALL getContext(XML_Parser parser); -static XML_Bool FASTCALL +static const XML_Char * getContext(XML_Parser parser); +static XML_Bool setContext(XML_Parser parser, const XML_Char *context); static void FASTCALL normalizePublicId(XML_Char *s); -static void FASTCALL dtdInit(DTD *, XML_Parser parser); +static void dtdInit(DTD *, XML_Parser parser); /* do not call if parentParser != NULL */ -static void FASTCALL dtdReset(DTD *, XML_Parser parser); -static void FASTCALL dtdDestroy(DTD *, XML_Parser parser); +static void dtdReset(DTD *, XML_Parser parser); +static void dtdDestroy(DTD *, XML_Parser parser); -static int FASTCALL dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser); +static int dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser); -static int FASTCALL copyEntityTable(HASH_TABLE *, STRING_POOL *, - const HASH_TABLE *, XML_Parser parser); +static int copyEntityTable(HASH_TABLE *, STRING_POOL *, + const HASH_TABLE *, XML_Parser parser); #ifdef XML_DTD static void FASTCALL dtdSwap(DTD *, DTD *); #endif /* XML_DTD */ -static NAMED * FASTCALL +static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize); static void FASTCALL @@ -386,29 +386,29 @@ static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); static void FASTCALL poolInit(STRING_POOL *, XML_Memory_Handling_Suite *ms); static void FASTCALL poolClear(STRING_POOL *); static void FASTCALL poolDestroy(STRING_POOL *); -static XML_Char * FASTCALL +static XML_Char * poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); -static XML_Char * FASTCALL +static XML_Char * poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Bool FASTCALL poolGrow(STRING_POOL *pool); static int FASTCALL nextScaffoldPart(XML_Parser parser); -static XML_Content * FASTCALL build_model(XML_Parser parser); +static XML_Content * build_model(XML_Parser parser); static const XML_Char * FASTCALL poolCopyString(STRING_POOL *pool, const XML_Char *s); -static const XML_Char * FASTCALL +static const XML_Char * poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); static const XML_Char * FASTCALL poolAppendString(STRING_POOL *pool, const XML_Char *s); -static ELEMENT_TYPE * FASTCALL +static ELEMENT_TYPE * getElementType(XML_Parser Paraser, const ENCODING *enc, const char *ptr, const char *end); -static void FASTCALL +static void parserInit(XML_Parser parser, const XML_Char *encodingName); #define poolStart(pool) ((pool)->start) @@ -727,7 +727,7 @@ XML_ParserCreate_MM(const XML_Char *encodingName, return parser; } -static void FASTCALL +static void parserInit(XML_Parser parser, const XML_Char *encodingName) { processor = prologInitProcessor; @@ -1647,7 +1647,7 @@ XML_GetFeatureList(void) processed, and not yet closed, we need to store tag->rawName in a more permanent location, since the parse buffer is about to be discarded. */ -static XML_Bool FASTCALL +static XML_Bool storeRawNames(XML_Parser parser) { TAG *tag = tagStack; @@ -1682,7 +1682,7 @@ storeRawNames(XML_Parser parser) return XML_TRUE; } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL contentProcessor(XML_Parser parser, const char *start, const char *end, @@ -1697,7 +1697,7 @@ contentProcessor(XML_Parser parser, return result; } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalEntityInitProcessor(XML_Parser parser, const char *start, const char *end, @@ -1710,7 +1710,7 @@ externalEntityInitProcessor(XML_Parser parser, return externalEntityInitProcessor2(parser, start, end, endPtr); } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, @@ -1750,7 +1750,7 @@ externalEntityInitProcessor2(XML_Parser parser, return externalEntityInitProcessor3(parser, start, end, endPtr); } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalEntityInitProcessor3(XML_Parser parser, const char *start, const char *end, @@ -1787,7 +1787,7 @@ externalEntityInitProcessor3(XML_Parser parser, return externalEntityContentProcessor(parser, start, end, endPtr); } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalEntityContentProcessor(XML_Parser parser, const char *start, const char *end, @@ -1802,7 +1802,7 @@ externalEntityContentProcessor(XML_Parser parser, return result; } -static enum XML_Error FASTCALL +static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, @@ -2256,7 +2256,7 @@ doContent(XML_Parser parser, /* If tagNamePtr is non-null, build a real list of attributes, otherwise just check the attributes for well-formedness. */ -static enum XML_Error FASTCALL +static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr, TAG_NAME *tagNamePtr, BINDING **bindingsPtr) @@ -2510,7 +2510,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc, return XML_ERROR_NONE; } -static int FASTCALL +static int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { @@ -2565,7 +2565,7 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, /* The idea here is to avoid using stack for each CDATA section when the whole file is parsed with one call. */ -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL cdataSectionProcessor(XML_Parser parser, const char *start, const char *end, @@ -2589,7 +2589,7 @@ cdataSectionProcessor(XML_Parser parser, /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ -static enum XML_Error FASTCALL +static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, @@ -2687,7 +2687,7 @@ doCdataSection(XML_Parser parser, /* The idea here is to avoid using stack for each IGNORE section when the whole file is parsed with one call. */ -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL ignoreSectionProcessor(XML_Parser parser, const char *start, const char *end, @@ -2705,7 +2705,7 @@ ignoreSectionProcessor(XML_Parser parser, /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ -static enum XML_Error FASTCALL +static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, @@ -2761,7 +2761,7 @@ doIgnoreSection(XML_Parser parser, #endif /* XML_DTD */ -static enum XML_Error FASTCALL +static enum XML_Error initializeEncoding(XML_Parser parser) { const char *s; @@ -2790,7 +2790,7 @@ initializeEncoding(XML_Parser parser) return handleUnknownEncoding(parser, protocolEncodingName); } -static enum XML_Error FASTCALL +static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, const char *next) { @@ -2875,7 +2875,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, return XML_ERROR_NONE; } -static enum XML_Error FASTCALL +static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) { if (unknownEncodingHandler) { @@ -2914,7 +2914,7 @@ handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) return XML_ERROR_UNKNOWN_ENCODING; } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL prologInitProcessor(XML_Parser parser, const char *s, const char *end, @@ -2929,7 +2929,7 @@ prologInitProcessor(XML_Parser parser, #ifdef XML_DTD -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalParEntInitProcessor(XML_Parser parser, const char *s, const char *end, @@ -2953,7 +2953,7 @@ externalParEntInitProcessor(XML_Parser parser, } } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL entityValueInitProcessor(XML_Parser parser, const char *s, const char *end, @@ -3007,7 +3007,7 @@ entityValueInitProcessor(XML_Parser parser, } } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL externalParEntProcessor(XML_Parser parser, const char *s, const char *end, @@ -3048,7 +3048,7 @@ externalParEntProcessor(XML_Parser parser, return doProlog(parser, encoding, s, end, tok, next, nextPtr); } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL entityValueProcessor(XML_Parser parser, const char *s, const char *end, @@ -3085,7 +3085,7 @@ entityValueProcessor(XML_Parser parser, #endif /* XML_DTD */ -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL prologProcessor(XML_Parser parser, const char *s, const char *end, @@ -3096,7 +3096,7 @@ prologProcessor(XML_Parser parser, return doProlog(parser, encoding, s, end, tok, next, nextPtr); } -static enum XML_Error FASTCALL +static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, @@ -4028,7 +4028,7 @@ doProlog(XML_Parser parser, /* not reached */ } -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL epilogProcessor(XML_Parser parser, const char *s, const char *end, @@ -4090,7 +4090,7 @@ epilogProcessor(XML_Parser parser, #ifdef XML_DTD -static enum XML_Error FASTCALL +static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity) { const char *s, *end, *next; @@ -4114,7 +4114,7 @@ processInternalParamEntity(XML_Parser parser, ENTITY *entity) #endif /* XML_DTD */ -static enum XML_Error FASTCALL +static enum XML_Error PTRCALL errorProcessor(XML_Parser parser, const char *s, const char *end, @@ -4123,7 +4123,7 @@ errorProcessor(XML_Parser parser, return errorCode; } -static enum XML_Error FASTCALL +static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) @@ -4139,7 +4139,7 @@ storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, return XML_ERROR_NONE; } -static enum XML_Error FASTCALL +static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) @@ -4286,7 +4286,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, /* not reached */ } -static enum XML_Error FASTCALL +static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *entityTextPtr, @@ -4474,7 +4474,7 @@ normalizeLines(XML_Char *s) *p = XML_T('\0'); } -static int FASTCALL +static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { @@ -4503,7 +4503,7 @@ reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, return 1; } -static int FASTCALL +static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { @@ -4525,7 +4525,7 @@ reportComment(XML_Parser parser, const ENCODING *enc, return 1; } -static void FASTCALL +static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) { @@ -4553,7 +4553,7 @@ reportDefault(XML_Parser parser, const ENCODING *enc, } -static int FASTCALL +static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata, XML_Bool isId, const XML_Char *value, XML_Parser parser) { @@ -4596,7 +4596,7 @@ defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata, return 1; } -static int FASTCALL +static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) { const XML_Char *name; @@ -4625,7 +4625,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) return 1; } -static ATTRIBUTE_ID * FASTCALL +static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { @@ -4685,7 +4685,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, #define CONTEXT_SEP XML_T('\f') -static const XML_Char * FASTCALL +static const XML_Char * getContext(XML_Parser parser) { HASH_TABLE_ITER iter; @@ -4753,7 +4753,7 @@ getContext(XML_Parser parser) return tempPool.start; } -static XML_Bool FASTCALL +static XML_Bool setContext(XML_Parser parser, const XML_Char *context) { const XML_Char *s = context; @@ -4835,7 +4835,7 @@ normalizePublicId(XML_Char *publicId) *p = XML_T('\0'); } -static void FASTCALL +static void dtdInit(DTD *p, XML_Parser parser) { XML_Memory_Handling_Suite *ms = &parser->m_mem; @@ -4880,7 +4880,7 @@ dtdSwap(DTD *p1, DTD *p2) #endif /* XML_DTD */ -static void FASTCALL +static void dtdReset(DTD *p, XML_Parser parser) { HASH_TABLE_ITER iter; @@ -4926,7 +4926,7 @@ dtdReset(DTD *p, XML_Parser parser) p->standalone = XML_FALSE; } -static void FASTCALL +static void dtdDestroy(DTD *p, XML_Parser parser) { HASH_TABLE_ITER iter; @@ -4960,7 +4960,7 @@ dtdDestroy(DTD *p, XML_Parser parser) /* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise. The new DTD has already been initialized. */ -static int FASTCALL +static int dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser) { HASH_TABLE_ITER iter; @@ -5090,7 +5090,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser) return 1; } /* End dtdCopy */ -static int FASTCALL +static int copyEntityTable(HASH_TABLE *newTable, STRING_POOL *newPool, const HASH_TABLE *oldTable, @@ -5177,7 +5177,7 @@ hash(KEY s) return h; } -static NAMED * FASTCALL +static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize) { size_t i; @@ -5345,7 +5345,7 @@ poolDestroy(STRING_POOL *pool) } } -static XML_Char * FASTCALL +static XML_Char * poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { @@ -5373,7 +5373,7 @@ poolCopyString(STRING_POOL *pool, const XML_Char *s) return s; } -static const XML_Char * FASTCALL +static const XML_Char * poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) { if (!pool->ptr && !poolGrow(pool)) @@ -5398,7 +5398,7 @@ poolAppendString(STRING_POOL *pool, const XML_Char *s) return pool->start; } -static XML_Char * FASTCALL +static XML_Char * poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { @@ -5518,7 +5518,7 @@ nextScaffoldPart(XML_Parser parser) return next; } -static void FASTCALL +static void build_node(XML_Parser parser, int src_node, XML_Content *dest, @@ -5555,7 +5555,7 @@ build_node(XML_Parser parser, } } -static XML_Content * FASTCALL +static XML_Content * build_model (XML_Parser parser) { XML_Content *ret; @@ -5575,7 +5575,7 @@ build_model (XML_Parser parser) return ret; } -static ELEMENT_TYPE * FASTCALL +static ELEMENT_TYPE * getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr, diff --git a/expat/lib/xmlrole.c b/expat/lib/xmlrole.c index bec5bbcc..8ef185d5 100644 --- a/expat/lib/xmlrole.c +++ b/expat/lib/xmlrole.c @@ -85,11 +85,11 @@ static const char KW_SYSTEM[] = { #define setTopLevel(state) ((state)->handler = internalSubset) #endif /* not XML_DTD */ -typedef int FASTCALL PROLOG_HANDLER(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); +typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc); static PROLOG_HANDLER prolog0, prolog1, prolog2, @@ -111,7 +111,7 @@ static PROLOG_HANDLER static int FASTCALL common(PROLOG_STATE *state, int tok); -static int FASTCALL +static int PTRCALL prolog0(PROLOG_STATE *state, int tok, const char *ptr, @@ -148,7 +148,7 @@ prolog0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL prolog1(PROLOG_STATE *state, int tok, const char *ptr, @@ -179,7 +179,7 @@ prolog1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL prolog2(PROLOG_STATE *state, int tok, const char *ptr, @@ -200,7 +200,7 @@ prolog2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype0(PROLOG_STATE *state, int tok, const char *ptr, @@ -218,7 +218,7 @@ doctype0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype1(PROLOG_STATE *state, int tok, const char *ptr, @@ -248,7 +248,7 @@ doctype1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype2(PROLOG_STATE *state, int tok, const char *ptr, @@ -265,7 +265,7 @@ doctype2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype3(PROLOG_STATE *state, int tok, const char *ptr, @@ -282,7 +282,7 @@ doctype3(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype4(PROLOG_STATE *state, int tok, const char *ptr, @@ -302,7 +302,7 @@ doctype4(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL doctype5(PROLOG_STATE *state, int tok, const char *ptr, @@ -319,7 +319,7 @@ doctype5(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL internalSubset(PROLOG_STATE *state, int tok, const char *ptr, @@ -374,7 +374,7 @@ internalSubset(PROLOG_STATE *state, #ifdef XML_DTD -static int FASTCALL +static int PTRCALL externalSubset0(PROLOG_STATE *state, int tok, const char *ptr, @@ -387,7 +387,7 @@ externalSubset0(PROLOG_STATE *state, return externalSubset1(state, tok, ptr, end, enc); } -static int FASTCALL +static int PTRCALL externalSubset1(PROLOG_STATE *state, int tok, const char *ptr, @@ -419,7 +419,7 @@ externalSubset1(PROLOG_STATE *state, #endif /* XML_DTD */ -static int FASTCALL +static int PTRCALL entity0(PROLOG_STATE *state, int tok, const char *ptr, @@ -439,7 +439,7 @@ entity0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity1(PROLOG_STATE *state, int tok, const char *ptr, @@ -456,7 +456,7 @@ entity1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity2(PROLOG_STATE *state, int tok, const char *ptr, @@ -484,7 +484,7 @@ entity2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity3(PROLOG_STATE *state, int tok, const char *ptr, @@ -501,7 +501,7 @@ entity3(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity4(PROLOG_STATE *state, int tok, const char *ptr, @@ -518,7 +518,7 @@ entity4(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity5(PROLOG_STATE *state, int tok, const char *ptr, @@ -541,7 +541,7 @@ entity5(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity6(PROLOG_STATE *state, int tok, const char *ptr, @@ -559,7 +559,7 @@ entity6(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity7(PROLOG_STATE *state, int tok, const char *ptr, @@ -587,7 +587,7 @@ entity7(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity8(PROLOG_STATE *state, int tok, const char *ptr, @@ -604,7 +604,7 @@ entity8(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity9(PROLOG_STATE *state, int tok, const char *ptr, @@ -621,7 +621,7 @@ entity9(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL entity10(PROLOG_STATE *state, int tok, const char *ptr, @@ -638,7 +638,7 @@ entity10(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL notation0(PROLOG_STATE *state, int tok, const char *ptr, @@ -655,7 +655,7 @@ notation0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL notation1(PROLOG_STATE *state, int tok, const char *ptr, @@ -679,7 +679,7 @@ notation1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL notation2(PROLOG_STATE *state, int tok, const char *ptr, @@ -696,7 +696,7 @@ notation2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL notation3(PROLOG_STATE *state, int tok, const char *ptr, @@ -714,7 +714,7 @@ notation3(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL notation4(PROLOG_STATE *state, int tok, const char *ptr, @@ -735,7 +735,7 @@ notation4(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist0(PROLOG_STATE *state, int tok, const char *ptr, @@ -753,7 +753,7 @@ attlist0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist1(PROLOG_STATE *state, int tok, const char *ptr, @@ -774,7 +774,7 @@ attlist1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist2(PROLOG_STATE *state, int tok, const char *ptr, @@ -815,7 +815,7 @@ attlist2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist3(PROLOG_STATE *state, int tok, const char *ptr, @@ -834,7 +834,7 @@ attlist3(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist4(PROLOG_STATE *state, int tok, const char *ptr, @@ -854,7 +854,7 @@ attlist4(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist5(PROLOG_STATE *state, int tok, const char *ptr, @@ -871,7 +871,7 @@ attlist5(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist6(PROLOG_STATE *state, int tok, const char *ptr, @@ -888,7 +888,7 @@ attlist6(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist7(PROLOG_STATE *state, int tok, const char *ptr, @@ -909,7 +909,7 @@ attlist7(PROLOG_STATE *state, } /* default value */ -static int FASTCALL +static int PTRCALL attlist8(PROLOG_STATE *state, int tok, const char *ptr, @@ -949,7 +949,7 @@ attlist8(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist9(PROLOG_STATE *state, int tok, const char *ptr, @@ -966,7 +966,7 @@ attlist9(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element0(PROLOG_STATE *state, int tok, const char *ptr, @@ -984,7 +984,7 @@ element0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element1(PROLOG_STATE *state, int tok, const char *ptr, @@ -1014,7 +1014,7 @@ element1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element2(PROLOG_STATE *state, int tok, const char *ptr, @@ -1054,7 +1054,7 @@ element2(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element3(PROLOG_STATE *state, int tok, const char *ptr, @@ -1079,7 +1079,7 @@ element3(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element4(PROLOG_STATE *state, int tok, const char *ptr, @@ -1097,7 +1097,7 @@ element4(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element5(PROLOG_STATE *state, int tok, const char *ptr, @@ -1118,7 +1118,7 @@ element5(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element6(PROLOG_STATE *state, int tok, const char *ptr, @@ -1148,7 +1148,7 @@ element6(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL element7(PROLOG_STATE *state, int tok, const char *ptr, @@ -1198,7 +1198,7 @@ element7(PROLOG_STATE *state, #ifdef XML_DTD -static int FASTCALL +static int PTRCALL condSect0(PROLOG_STATE *state, int tok, const char *ptr, @@ -1222,7 +1222,7 @@ condSect0(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL condSect1(PROLOG_STATE *state, int tok, const char *ptr, @@ -1240,7 +1240,7 @@ condSect1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL condSect2(PROLOG_STATE *state, int tok, const char *ptr, @@ -1259,7 +1259,7 @@ condSect2(PROLOG_STATE *state, #endif /* XML_DTD */ -static int FASTCALL +static int PTRCALL declClose(PROLOG_STATE *state, int tok, const char *ptr, @@ -1276,7 +1276,7 @@ declClose(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL error(PROLOG_STATE *state, int tok, const char *ptr, diff --git a/expat/lib/xmlrole.h b/expat/lib/xmlrole.h index 281aba04..0e547625 100644 --- a/expat/lib/xmlrole.h +++ b/expat/lib/xmlrole.h @@ -85,7 +85,7 @@ enum { }; typedef struct prolog_state { - int (FASTCALL *handler) (struct prolog_state *state, + int (PTRCALL *handler) (struct prolog_state *state, int tok, const char *ptr, const char *end, diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c index 4b887228..95b67915 100644 --- a/expat/lib/xmltok.c +++ b/expat/lib/xmltok.c @@ -112,19 +112,19 @@ || \ ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0))) -static int FASTCALL +static int PTRFASTCALL isNever(const ENCODING *enc, const char *p) { return 0; } -static int FASTCALL +static int PTRFASTCALL utf8_isName2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); } -static int FASTCALL +static int PTRFASTCALL utf8_isName3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); @@ -132,13 +132,13 @@ utf8_isName3(const ENCODING *enc, const char *p) #define utf8_isName4 isNever -static int FASTCALL +static int PTRFASTCALL utf8_isNmstrt2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); } -static int FASTCALL +static int PTRFASTCALL utf8_isNmstrt3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); @@ -146,19 +146,19 @@ utf8_isNmstrt3(const ENCODING *enc, const char *p) #define utf8_isNmstrt4 isNever -static int FASTCALL +static int PTRFASTCALL utf8_isInvalid2(const ENCODING *enc, const char *p) { return UTF8_INVALID2((const unsigned char *)p); } -static int FASTCALL +static int PTRFASTCALL utf8_isInvalid3(const ENCODING *enc, const char *p) { return UTF8_INVALID3((const unsigned char *)p); } -static int FASTCALL +static int PTRFASTCALL utf8_isInvalid4(const ENCODING *enc, const char *p) { return UTF8_INVALID4((const unsigned char *)p); @@ -168,21 +168,21 @@ struct normal_encoding { ENCODING enc; unsigned char type[256]; #ifdef XML_MIN_SIZE - int (FASTCALL *byteType)(const ENCODING *, const char *); - int (FASTCALL *isNameMin)(const ENCODING *, const char *); - int (FASTCALL *isNmstrtMin)(const ENCODING *, const char *); - int (FASTCALL *byteToAscii)(const ENCODING *, const char *); - int (FASTCALL *charMatches)(const ENCODING *, const char *, int); + int (PTRFASTCALL *byteType)(const ENCODING *, const char *); + int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *); + int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *); + int (PTRCALL *charMatches)(const ENCODING *, const char *, int); #endif /* XML_MIN_SIZE */ - int (FASTCALL *isName2)(const ENCODING *, const char *); - int (FASTCALL *isName3)(const ENCODING *, const char *); - int (FASTCALL *isName4)(const ENCODING *, const char *); - int (FASTCALL *isNmstrt2)(const ENCODING *, const char *); - int (FASTCALL *isNmstrt3)(const ENCODING *, const char *); - int (FASTCALL *isNmstrt4)(const ENCODING *, const char *); - int (FASTCALL *isInvalid2)(const ENCODING *, const char *); - int (FASTCALL *isInvalid3)(const ENCODING *, const char *); - int (FASTCALL *isInvalid4)(const ENCODING *, const char *); + int (PTRFASTCALL *isName2)(const ENCODING *, const char *); + int (PTRFASTCALL *isName3)(const ENCODING *, const char *); + int (PTRFASTCALL *isName4)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *); }; #define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc)) @@ -234,7 +234,7 @@ static int FASTCALL checkCharRefNumber(int); (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) #ifdef XML_MIN_SIZE -static int FASTCALL +static int PTRFASTCALL sb_byteType(const ENCODING *enc, const char *p) { return SB_BYTE_TYPE(enc, p); @@ -248,7 +248,7 @@ sb_byteType(const ENCODING *enc, const char *p) #ifdef XML_MIN_SIZE #define BYTE_TO_ASCII(enc, p) \ (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p)) -static int FASTCALL +static int PTRFASTCALL sb_byteToAscii(const ENCODING *enc, const char *p) { return *p; @@ -277,7 +277,7 @@ sb_byteToAscii(const ENCODING *enc, const char *p) #ifdef XML_MIN_SIZE #define CHAR_MATCHES(enc, p, c) \ (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c)) -static int FASTCALL +static int PTRCALL sb_charMatches(const ENCODING *enc, const char *p, int c) { return *p == c; @@ -307,7 +307,7 @@ enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ UTF8_cval4 = 0xf0 }; -static void FASTCALL +static void PTRCALL utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) @@ -326,7 +326,7 @@ utf8_toUtf8(const ENCODING *enc, *toP = to; } -static void FASTCALL +static void PTRCALL utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) @@ -414,7 +414,7 @@ static const struct normal_encoding internal_utf8_encoding = { STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; -static void FASTCALL +static void PTRCALL latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) @@ -439,7 +439,7 @@ latin1_toUtf8(const ENCODING *enc, } } -static void FASTCALL +static void PTRCALL latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) @@ -472,7 +472,7 @@ static const struct normal_encoding latin1_encoding = { STANDARD_VTABLE(sb_) }; -static void FASTCALL +static void PTRCALL ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) @@ -505,7 +505,7 @@ static const struct normal_encoding ascii_encoding = { STANDARD_VTABLE(sb_) }; -static int FASTCALL +static int PTRFASTCALL unicode_byte_type(char hi, char lo) { switch ((unsigned char)hi) { @@ -525,7 +525,7 @@ unicode_byte_type(char hi, char lo) } #define DEFINE_UTF16_TO_UTF8(E) \ -static void FASTCALL \ +static void PTRCALL \ E ## toUtf8(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ char **toP, const char *toLim) \ @@ -588,7 +588,7 @@ E ## toUtf8(const ENCODING *enc, \ } #define DEFINE_UTF16_TO_UTF16(E) \ -static void FASTCALL \ +static void PTRCALL \ E ## toUtf16(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ unsigned short **toP, const unsigned short *toLim) \ @@ -638,31 +638,31 @@ DEFINE_UTF16_TO_UTF16(big2_) #ifdef XML_MIN_SIZE -static int FASTCALL +static int PTRFASTCALL little2_byteType(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TYPE(enc, p); } -static int FASTCALL +static int PTRFASTCALL little2_byteToAscii(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TO_ASCII(enc, p); } -static int FASTCALL +static int PTRCALL little2_charMatches(const ENCODING *enc, const char *p, int c) { return LITTLE2_CHAR_MATCHES(enc, p, c); } -static int FASTCALL +static int PTRFASTCALL little2_isNameMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); } -static int FASTCALL +static int PTRFASTCALL little2_isNmstrtMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); @@ -777,31 +777,31 @@ static const struct normal_encoding internal_little2_encoding = { #ifdef XML_MIN_SIZE -static int FASTCALL +static int PTRFASTCALL big2_byteType(const ENCODING *enc, const char *p) { return BIG2_BYTE_TYPE(enc, p); } -static int FASTCALL +static int PTRFASTCALL big2_byteToAscii(const ENCODING *enc, const char *p) { return BIG2_BYTE_TO_ASCII(enc, p); } -static int FASTCALL +static int PTRCALL big2_charMatches(const ENCODING *enc, const char *p, int c) { return BIG2_CHAR_MATCHES(enc, p, c); } -static int FASTCALL +static int PTRFASTCALL big2_isNameMin(const ENCODING *enc, const char *p) { return BIG2_IS_NAME_CHAR_MINBPC(enc, p); } -static int FASTCALL +static int PTRFASTCALL big2_isNmstrtMin(const ENCODING *enc, const char *p) { return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); @@ -922,14 +922,14 @@ streqci(const char *s1, const char *s2) return 1; } -static void FASTCALL +static void PTRCALL initUpdatePosition(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos) { normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); } -static int FASTCALL +static int toAscii(const ENCODING *enc, const char *ptr, const char *end) { char buf[1]; @@ -957,7 +957,7 @@ isSpace(int c) /* Return 1 if there's just optional white space or there's an S followed by name=val. */ -static int FASTCALL +static int parsePseudoAttribute(const ENCODING *enc, const char *ptr, const char *end, @@ -1174,7 +1174,7 @@ checkCharRefNumber(int result) return result; } -int +int FASTCALL XmlUtf8Encode(int c, char *buf) { enum { @@ -1211,7 +1211,7 @@ XmlUtf8Encode(int c, char *buf) return 0; } -int +int FASTCALL XmlUtf16Encode(int charNum, unsigned short *buf) { if (charNum < 0) @@ -1245,7 +1245,7 @@ XmlSizeOfUnknownEncoding(void) return sizeof(struct unknown_encoding); } -static int FASTCALL +static int PTRFASTCALL unknown_isName(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); @@ -1255,7 +1255,7 @@ unknown_isName(const ENCODING *enc, const char *p) return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); } -static int FASTCALL +static int PTRFASTCALL unknown_isNmstrt(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); @@ -1265,7 +1265,7 @@ unknown_isNmstrt(const ENCODING *enc, const char *p) return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); } -static int FASTCALL +static int PTRFASTCALL unknown_isInvalid(const ENCODING *enc, const char *p) { const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); @@ -1273,7 +1273,7 @@ unknown_isInvalid(const ENCODING *enc, const char *p) return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; } -static void FASTCALL +static void PTRCALL unknown_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) @@ -1307,7 +1307,7 @@ unknown_toUtf8(const ENCODING *enc, } } -static void FASTCALL +static void PTRCALL unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) @@ -1478,7 +1478,7 @@ getEncodingIndex(const char *name) */ -static int FASTCALL +static int initScan(const ENCODING **encodingTable, const INIT_ENCODING *enc, int state, diff --git a/expat/lib/xmltok.h b/expat/lib/xmltok.h index 55cc181e..6f648d70 100644 --- a/expat/lib/xmltok.h +++ b/expat/lib/xmltok.h @@ -125,49 +125,49 @@ typedef struct { struct encoding; typedef struct encoding ENCODING; -typedef int (FASTCALL *SCANNER)(const ENCODING *, - const char *, - const char *, - const char **); +typedef int (PTRCALL *SCANNER)(const ENCODING *, + const char *, + const char *, + const char **); struct encoding { SCANNER scanners[XML_N_STATES]; SCANNER literalScanners[XML_N_LITERAL_TYPES]; - int (FASTCALL *sameName)(const ENCODING *, - const char *, - const char *); - int (FASTCALL *nameMatchesAscii)(const ENCODING *, - const char *, - const char *, - const char *); - int (FASTCALL *nameLength)(const ENCODING *, const char *); - const char *(FASTCALL *skipS)(const ENCODING *, const char *); - int (FASTCALL *getAtts)(const ENCODING *enc, - const char *ptr, - int attsMax, - ATTRIBUTE *atts); - int (FASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); - int (FASTCALL *predefinedEntityName)(const ENCODING *, - const char *, - const char *); - void (FASTCALL *updatePosition)(const ENCODING *, - const char *ptr, - const char *end, - POSITION *); - int (FASTCALL *isPublicId)(const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr); - void (FASTCALL *utf8Convert)(const ENCODING *enc, + int (PTRCALL *sameName)(const ENCODING *, + const char *, + const char *); + int (PTRCALL *nameMatchesAscii)(const ENCODING *, + const char *, + const char *, + const char *); + int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); + const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); + int (PTRCALL *getAtts)(const ENCODING *enc, + const char *ptr, + int attsMax, + ATTRIBUTE *atts); + int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); + int (PTRCALL *predefinedEntityName)(const ENCODING *, + const char *, + const char *); + void (PTRCALL *updatePosition)(const ENCODING *, + const char *ptr, + const char *end, + POSITION *); + int (PTRCALL *isPublicId)(const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr); + void (PTRCALL *utf8Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + char **toP, + const char *toLim); + void (PTRCALL *utf16Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, - char **toP, - const char *toLim); - void (FASTCALL *utf16Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - unsigned short **toP, - const unsigned short *toLim); + unsigned short **toP, + const unsigned short *toLim); int minBytesPerChar; char isUtf8; char isUtf16; @@ -263,44 +263,42 @@ typedef struct { const ENCODING **encPtr; } INIT_ENCODING; -int XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncoding(void); -const ENCODING *XmlGetUtf16InternalEncoding(void); -int XmlUtf8Encode(int charNumber, char *buf); -int XmlUtf16Encode(int charNumber, unsigned short *buf); - -int XmlSizeOfUnknownEncoding(void); -ENCODING * +int XmlParseXmlDecl(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingNamePtr, + const ENCODING **namedEncodingPtr, + int *standalonePtr); +int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); +const ENCODING *XmlGetUtf8InternalEncoding(void); +const ENCODING *XmlGetUtf16InternalEncoding(void); +int FASTCALL XmlUtf8Encode(int charNumber, char *buf); +int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); +int XmlSizeOfUnknownEncoding(void); +ENCODING * XmlInitUnknownEncoding(void *mem, int *table, int (*conv)(void *userData, const char *p), void *userData); -int XmlParseXmlDeclNS(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); -int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncodingNS(void); -const ENCODING *XmlGetUtf16InternalEncodingNS(void); -ENCODING * +int XmlParseXmlDeclNS(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingNamePtr, + const ENCODING **namedEncodingPtr, + int *standalonePtr); +int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); +const ENCODING *XmlGetUtf8InternalEncodingNS(void); +const ENCODING *XmlGetUtf16InternalEncodingNS(void); +ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, int (*conv)(void *userData, const char *p), diff --git a/expat/lib/xmltok_impl.c b/expat/lib/xmltok_impl.c index be3d1d31..84a32679 100644 --- a/expat/lib/xmltok_impl.c +++ b/expat/lib/xmltok_impl.c @@ -86,7 +86,7 @@ /* ptr points to character following "