diff options
Diffstat (limited to 'contrib/expat/lib/xmlrole.c')
-rw-r--r-- | contrib/expat/lib/xmlrole.c | 129 |
1 files changed, 72 insertions, 57 deletions
diff --git a/contrib/expat/lib/xmlrole.c b/contrib/expat/lib/xmlrole.c index bec5bbc..9c5e25b 100644 --- a/contrib/expat/lib/xmlrole.c +++ b/contrib/expat/lib/xmlrole.c @@ -2,14 +2,23 @@ See the file COPYING for copying permission. */ +#include <stddef.h> + #ifdef COMPILED_FROM_DSP #include "winconfig.h" #elif defined(MACOS_CLASSIC) #include "macconfig.h" +#elif defined(__amigaos4__) +#include "amigaconfig.h" +#elif defined(__WATCOMC__) +#include "watcomconfig.h" #else +#ifdef HAVE_EXPAT_CONFIG_H #include <expat_config.h> +#endif #endif /* ndef COMPILED_FROM_DSP */ +#include "expat_external.h" #include "internal.h" #include "xmlrole.h" #include "ascii.h" @@ -46,12 +55,16 @@ static const char KW_IDREF[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; static const char KW_IDREFS[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; +#ifdef XML_DTD static const char KW_IGNORE[] = { ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; +#endif static const char KW_IMPLIED[] = { ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; +#ifdef XML_DTD static const char KW_INCLUDE[] = { ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; +#endif static const char KW_NDATA[] = { ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; static const char KW_NMTOKEN[] = { @@ -85,11 +98,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 +124,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 +161,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 +192,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 +213,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 +231,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 +261,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 +278,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 +295,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 +315,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 +332,7 @@ doctype5(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL internalSubset(PROLOG_STATE *state, int tok, const char *ptr, @@ -368,13 +381,15 @@ internalSubset(PROLOG_STATE *state, case XML_TOK_CLOSE_BRACKET: state->handler = doctype5; return XML_ROLE_DOCTYPE_NONE; + case XML_TOK_NONE: + return XML_ROLE_NONE; } return common(state, tok); } #ifdef XML_DTD -static int FASTCALL +static int PTRCALL externalSubset0(PROLOG_STATE *state, int tok, const char *ptr, @@ -387,7 +402,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 +434,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 +454,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 +471,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 +499,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 +516,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 +533,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 +556,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 +574,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 +602,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 +619,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 +636,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 +653,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 +670,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 +694,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 +711,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 +729,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 +750,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 +768,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 +789,7 @@ attlist1(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL attlist2(PROLOG_STATE *state, int tok, const char *ptr, @@ -786,7 +801,7 @@ attlist2(PROLOG_STATE *state, return XML_ROLE_ATTLIST_NONE; case XML_TOK_NAME: { - static const char *types[] = { + static const char * const types[] = { KW_CDATA, KW_ID, KW_IDREF, @@ -815,7 +830,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 +849,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 +869,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 +886,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 +903,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 +924,7 @@ attlist7(PROLOG_STATE *state, } /* default value */ -static int FASTCALL +static int PTRCALL attlist8(PROLOG_STATE *state, int tok, const char *ptr, @@ -949,7 +964,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 +981,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 +999,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 +1029,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 +1069,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 +1094,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 +1112,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 +1133,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 +1163,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 +1213,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 +1237,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 +1255,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 +1274,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 +1291,7 @@ declClose(PROLOG_STATE *state, return common(state, tok); } -static int FASTCALL +static int PTRCALL error(PROLOG_STATE *state, int tok, const char *ptr, |