Changeset 98


Ignore:
Timestamp:
Aug 21, 2001, 7:29:38 PM (24 years ago)
Author:
umoeller
Message:

Misc updates.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/expat/expat.h

    r97 r98  
    1313                        // to save the app from having to include this as well
    1414
    15 #ifndef XMLPARSEAPI
     15/* #ifndef XMLPARSEAPI
    1616    #ifdef EXPATENTRY
    17         #define XMLPARSEAPI(type) type EXPATENTRY
     17        // #define XMLPARSEAPI(type) type EXPATENTRY
     18        #define XMLPARSEAPI(type)
    1819            // V0.9.14 (2001-08-09) [umoeller]
    1920    #else
    2021        #define XMLPARSEAPI(type) type
    2122    #endif
    22 #endif
     23#endif */
     24
     25#ifndef XMLPARSEAPI
     26#  ifdef __declspec
     27#    define XMLPARSEAPI __declspec(dllimport)
     28#  else
     29#    define XMLPARSEAPI /* nothing */
     30#  endif
     31#endif  /* not defined XMLPARSEAPI */
    2332
    2433#ifdef __cplusplus
     
    119128*/
    120129
    121 typedef void (*XML_ElementDeclHandler) (void *userData,
     130typedef void (* EXPATENTRY XML_ElementDeclHandler) (void *userData,
    122131                                        const XML_Char *name,
    123132                                        XMLCONTENT *model);
    124133
    125 XMLPARSEAPI(void)
    126 XML_SetElementDeclHandler(XML_Parser parser,
    127               XML_ElementDeclHandler eldecl);
     134void EXPATENTRY XML_SetElementDeclHandler(XML_Parser parser,
     135                                            XML_ElementDeclHandler eldecl);
    128136
    129137/*
     
    137145 */
    138146
    139 typedef void (*XML_AttlistDeclHandler) (void           *userData,
     147typedef void (* EXPATENTRY XML_AttlistDeclHandler) (void           *userData,
    140148                                        const XML_Char *elname,
    141149                                        const XML_Char *attname,
     
    144152                                        int     isrequired);
    145153
    146 XMLPARSEAPI(void)
     154void EXPATENTRY
    147155XML_SetAttlistDeclHandler(XML_Parser parser,
    148156              XML_AttlistDeclHandler attdecl);
     
    157165  */
    158166
    159 typedef void (*XML_XmlDeclHandler) (void        *userData,
     167typedef void (* EXPATENTRY XML_XmlDeclHandler) (void        *userData,
    160168                                    const XML_Char  *version,
    161169                                    const XML_Char  *encoding,
    162170                                    int          standalone);
    163171
    164 XMLPARSEAPI(void)
     172void EXPATENTRY
    165173XML_SetXmlDeclHandler(XML_Parser parser,
    166174              XML_XmlDeclHandler xmldecl);
     
    176184external protocol or null if there is none specified. */
    177185
    178 XMLPARSEAPI(XML_Parser)
     186XML_Parser EXPATENTRY
    179187XML_ParserCreate(const XML_Char *encoding);
    180188
     
    189197the name and prefix will be passed through without expansion. */
    190198
    191 XMLPARSEAPI(XML_Parser)
     199XML_Parser EXPATENTRY
    192200XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
    193201
     
    203211*/
    204212
    205 XMLPARSEAPI(XML_Parser)
     213XML_Parser EXPATENTRY
    206214XML_ParserCreate_MM(const XML_Char *encoding,
    207215            const XML_Memory_Handling_Suite *memsuite,
     
    211219   names and values are 0 terminated. */
    212220
    213 typedef void (*XML_StartElementHandler)(void *userData,
     221typedef void (* EXPATENTRY XML_StartElementHandler)(void *userData,
    214222                                        const XML_Char *name,
    215223                                        const XML_Char **atts);
    216224
    217 typedef void (*XML_EndElementHandler)(void *userData,
     225typedef void (* EXPATENTRY XML_EndElementHandler)(void *userData,
    218226                                      const XML_Char *name);
    219227
    220228
    221229/* s is not 0 terminated. */
    222 typedef void (*XML_CharacterDataHandler)(void *userData,
     230typedef void (* EXPATENTRY XML_CharacterDataHandler)(void *userData,
    223231                                         const XML_Char *s,
    224232                                         int len);
    225233
    226234/* target and data are 0 terminated */
    227 typedef void (*XML_ProcessingInstructionHandler)(void *userData,
     235typedef void (* EXPATENTRY XML_ProcessingInstructionHandler)(void *userData,
    228236                                                 const XML_Char *target,
    229237                                                 const XML_Char *data);
    230238
    231239/* data is 0 terminated */
    232 typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
    233 
    234 typedef void (*XML_StartCdataSectionHandler)(void *userData);
    235 typedef void (*XML_EndCdataSectionHandler)(void *userData);
     240typedef void (* EXPATENTRY XML_CommentHandler)(void *userData, const XML_Char *data);
     241
     242typedef void (* EXPATENTRY XML_StartCdataSectionHandler)(void *userData);
     243typedef void (* EXPATENTRY XML_EndCdataSectionHandler)(void *userData);
    236244
    237245/* This is called for any characters in the XML document for
     
    248256multiple calls. */
    249257
    250 typedef void (*XML_DefaultHandler)(void *userData,
     258typedef void (* EXPATENTRY XML_DefaultHandler)(void *userData,
    251259                                   const XML_Char *s,
    252260                                   int len);
     
    255263   any DTD or internal subset is parsed. */
    256264
    257 typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
     265typedef void (* EXPATENTRY XML_StartDoctypeDeclHandler)(void *userData,
    258266                                            const XML_Char *doctypeName,
    259267                                            const XML_Char *sysid,
     
    263271/* This is called for the start of the DOCTYPE declaration when the
    264272closing > is encountered, but after processing any external subset. */
    265 typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
     273typedef void (* EXPATENTRY XML_EndDoctypeDeclHandler)(void *userData);
    266274
    267275/* This is called for entity declarations. The is_parameter_entity
     
    281289*/
    282290
    283 typedef void (*XML_EntityDeclHandler) (void *userData,
     291typedef void (* EXPATENTRY XML_EntityDeclHandler) (void *userData,
    284292                                       const XML_Char *entityName,
    285293                                       int is_parameter_entity,
     
    291299                                       const XML_Char *notationName);
    292300
    293 XMLPARSEAPI(void)
     301void EXPATENTRY
    294302XML_SetEntityDeclHandler(XML_Parser parser,
    295303             XML_EntityDeclHandler handler);
     
    303311The other arguments may be. */
    304312
    305 typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
     313typedef void (* EXPATENTRY XML_UnparsedEntityDeclHandler)(void *userData,
    306314                                              const XML_Char *entityName,
    307315                                              const XML_Char *base,
     
    314322The notationName will never be null.  The other arguments can be. */
    315323
    316 typedef void (*XML_NotationDeclHandler)(void *userData,
     324typedef void (* EXPATENTRY XML_NotationDeclHandler)(void *userData,
    317325                                        const XML_Char *notationName,
    318326                                        const XML_Char *base,
     
    326334For an xmlns="" attribute, uri will be null. */
    327335
    328 typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
     336typedef void (* EXPATENTRY XML_StartNamespaceDeclHandler)(void *userData,
    329337                                              const XML_Char *prefix,
    330338                                              const XML_Char *uri);
    331339
    332 typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
     340typedef void (* EXPATENTRY XML_EndNamespaceDeclHandler)(void *userData,
    333341                                            const XML_Char *prefix);
    334342
     
    339347ERROR_EXPAT_NOT_STANDALONE error. */
    340348
    341 typedef int (*XML_NotStandaloneHandler)(void *userData);
     349typedef int (* EXPATENTRY XML_NotStandaloneHandler)(void *userData);
    342350
    343351/* This is called for a reference to an external parsed general entity.
     
    366374userData. */
    367375
    368 typedef int (*XML_ExternalEntityRefHandler)(void *userData,     // added V0.9.14 (2001-08-09) [umoeller]
     376typedef int (* EXPATENTRY XML_ExternalEntityRefHandler)(void *userData,     // added V0.9.14 (2001-08-09) [umoeller]
    369377                                            XML_Parser parser,
    370378                                            const XML_Char *context,
     
    418426  int map[256];
    419427  void *data;
    420   int (*convert)(void *data, const char *s);
    421   void (*release)(void *data);
     428  int (* EXPATENTRY convert)(void *data, const char *s);
     429  void (* EXPATENTRY release)(void *data);
    422430} XML_Encoding;
    423431
     
    433441then the parser will return an XML_UNKNOWN_ENCODING error. */
    434442
    435 typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
     443typedef int (* EXPATENTRY XML_UnknownEncodingHandler)(void *encodingHandlerData,
    436444                                          const XML_Char *name,
    437445                                          XML_Encoding *info);
    438446
    439 XMLPARSEAPI(void)
     447void EXPATENTRY
    440448XML_SetElementHandler(XML_Parser parser,
    441449              XML_StartElementHandler start,
    442450              XML_EndElementHandler end);
    443451
    444 XMLPARSEAPI(void)
     452void EXPATENTRY
    445453XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
    446454
    447 XMLPARSEAPI(void)
     455void EXPATENTRY
    448456XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
    449457
    450 XMLPARSEAPI(void)
     458void EXPATENTRY
    451459XML_SetCharacterDataHandler(XML_Parser parser,
    452460                XML_CharacterDataHandler handler);
    453461
    454 XMLPARSEAPI(void)
     462void EXPATENTRY
    455463XML_SetProcessingInstructionHandler(XML_Parser parser,
    456464                    XML_ProcessingInstructionHandler handler);
    457 XMLPARSEAPI(void)
     465void EXPATENTRY
    458466XML_SetCommentHandler(XML_Parser parser,
    459467                      XML_CommentHandler handler);
    460468
    461 XMLPARSEAPI(void)
     469void EXPATENTRY
    462470XML_SetCdataSectionHandler(XML_Parser parser,
    463471               XML_StartCdataSectionHandler start,
    464472               XML_EndCdataSectionHandler end);
    465473
    466 XMLPARSEAPI(void)
     474void EXPATENTRY
    467475XML_SetStartCdataSectionHandler(XML_Parser parser,
    468476                                XML_StartCdataSectionHandler start);
    469477
    470 XMLPARSEAPI(void)
     478void EXPATENTRY
    471479XML_SetEndCdataSectionHandler(XML_Parser parser,
    472480                              XML_EndCdataSectionHandler end);
     
    476484handler. */
    477485
    478 XMLPARSEAPI(void)
     486void EXPATENTRY
    479487XML_SetDefaultHandler(XML_Parser parser,
    480488              XML_DefaultHandler handler);
     
    484492default handler. */
    485493
    486 XMLPARSEAPI(void)
     494void EXPATENTRY
    487495XML_SetDefaultHandlerExpand(XML_Parser parser,
    488496                    XML_DefaultHandler handler);
    489497
    490 XMLPARSEAPI(void)
     498void EXPATENTRY
    491499XML_SetDoctypeDeclHandler(XML_Parser parser,
    492500              XML_StartDoctypeDeclHandler start,
    493501              XML_EndDoctypeDeclHandler end);
    494502
    495 XMLPARSEAPI(void)
     503void EXPATENTRY
    496504XML_SetStartDoctypeDeclHandler(XML_Parser parser,
    497505                   XML_StartDoctypeDeclHandler start);
    498506
    499 XMLPARSEAPI(void)
     507void EXPATENTRY
    500508XML_SetEndDoctypeDeclHandler(XML_Parser parser,
    501509                 XML_EndDoctypeDeclHandler end);
    502510
    503 XMLPARSEAPI(void)
     511void EXPATENTRY
    504512XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
    505513                 XML_UnparsedEntityDeclHandler handler);
    506514
    507 XMLPARSEAPI(void)
     515void EXPATENTRY
    508516XML_SetNotationDeclHandler(XML_Parser parser,
    509517               XML_NotationDeclHandler handler);
    510518
    511 XMLPARSEAPI(void)
     519void EXPATENTRY
    512520XML_SetNamespaceDeclHandler(XML_Parser parser,
    513521                XML_StartNamespaceDeclHandler start,
    514522                XML_EndNamespaceDeclHandler end);
    515523
    516 XMLPARSEAPI(void)
     524void EXPATENTRY
    517525XML_SetStartNamespaceDeclHandler(XML_Parser parser,
    518526                 XML_StartNamespaceDeclHandler start);
    519527
    520 XMLPARSEAPI(void)
     528void EXPATENTRY
    521529XML_SetEndNamespaceDeclHandler(XML_Parser parser,
    522530                   XML_EndNamespaceDeclHandler end);
    523531
    524 XMLPARSEAPI(void)
     532void EXPATENTRY
    525533XML_SetNotStandaloneHandler(XML_Parser parser,
    526534                XML_NotStandaloneHandler handler);
    527535
    528 XMLPARSEAPI(void)
     536void EXPATENTRY
    529537XML_SetExternalEntityRefHandler(XML_Parser parser,
    530538                XML_ExternalEntityRefHandler handler);
     
    533541as the first argument to the external entity ref handler instead
    534542of the parser object. */
    535 XMLPARSEAPI(void)
     543void EXPATENTRY
    536544XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
    537545
    538 XMLPARSEAPI(void)
     546void EXPATENTRY
    539547XML_SetUnknownEncodingHandler(XML_Parser parser,
    540548                  XML_UnknownEncodingHandler handler,
     
    544552processing instruction or character data.  It causes the corresponding
    545553markup to be passed to the default handler. */
    546 XMLPARSEAPI(void)
     554void EXPATENTRY
    547555XML_DefaultCurrent(XML_Parser parser);
    548556
     
    558566*/
    559567
    560 XMLPARSEAPI(void)
     568void EXPATENTRY
    561569XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
    562570
    563571/* This value is passed as the userData argument to callbacks. */
    564 XMLPARSEAPI(void)
     572void EXPATENTRY
    565573XML_SetUserData(XML_Parser parser, void *userData);
    566574
     
    572580or XML_ParseBuffer. */
    573581
    574 XMLPARSEAPI(int)
     582int EXPATENTRY
    575583XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
    576584
     
    579587The userData will still be accessible using XML_GetUserData. */
    580588
    581 XMLPARSEAPI(void)
     589void EXPATENTRY
    582590XML_UseParserAsHandlerArg(XML_Parser parser);
    583591
     
    589597Returns zero if out of memory, non-zero otherwise. */
    590598
    591 XMLPARSEAPI(int)
     599int EXPATENTRY
    592600XML_SetBase(XML_Parser parser, const XML_Char *base);
    593601
    594 XMLPARSEAPI(const XML_Char *)
     602const XML_Char * EXPATENTRY
    595603XML_GetBase(XML_Parser parser);
    596604
     
    601609XML_StartElementHandler. */
    602610
    603 XMLPARSEAPI(int)
     611int EXPATENTRY
    604612XML_GetSpecifiedAttributeCount(XML_Parser parser);
    605613
     
    609617into the atts array passed to the XML_StartElementHandler. */
    610618
    611 XMLPARSEAPI(int)
     619int EXPATENTRY
    612620XML_GetIdAttributeIndex(XML_Parser parser);
    613621
     
    615623The last call to XML_Parse must have isFinal true;
    616624len may be zero for this call (or any other). */
    617 XMLPARSEAPI(int)
     625int EXPATENTRY
    618626XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
    619627
    620 XMLPARSEAPI(void *)
     628void * EXPATENTRY
    621629XML_GetBuffer(XML_Parser parser, int len);
    622630
    623 XMLPARSEAPI(int)
     631int EXPATENTRY
    624632XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
    625633
     
    639647from the parser argument.  Returns 0 if out of memory.  Otherwise
    640648returns a new XML_Parser object. */
    641 XMLPARSEAPI(XML_Parser)
     649XML_Parser EXPATENTRY
    642650XML_ExternalEntityParserCreate(XML_Parser parser,
    643651                   const XML_Char *context,
     
    669677entities is requested; otherwise it will return non-zero. */
    670678
    671 XMLPARSEAPI(int)
     679int EXPATENTRY
    672680XML_SetParamEntityParsing(XML_Parser parser,
    673681              enum XML_ParamEntityParsing parsing);
     
    732740returns information about the error. */
    733741
    734 XMLPARSEAPI(XMLERROR)
     742XMLERROR EXPATENTRY
    735743XML_GetErrorCode(XML_Parser parser);
    736744
     
    743751of the sequence of characters that generated the event. */
    744752
    745 XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
    746 XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
    747 XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
     753int EXPATENTRY XML_GetCurrentLineNumber(XML_Parser parser);
     754int EXPATENTRY XML_GetCurrentColumnNumber(XML_Parser parser);
     755long EXPATENTRY XML_GetCurrentByteIndex(XML_Parser parser);
    748756
    749757/* Return the number of bytes in the current event.
    750758Returns 0 if the event is in an internal entity. */
    751759
    752 XMLPARSEAPI(int)
     760int EXPATENTRY
    753761XML_GetCurrentByteCount(XML_Parser parser);
    754762
     
    763771   the handler that makes the call. */
    764772
    765 XMLPARSEAPI(const char *)
     773const char * EXPATENTRY
    766774XML_GetInputContext(XML_Parser parser,
    767775            int *offset,
     
    774782
    775783/* Frees memory used by the parser. */
    776 XMLPARSEAPI(void)
     784void EXPATENTRY
    777785XML_ParserFree(XML_Parser parser);
    778786
    779787/* Returns a string describing the error. */
    780 XMLPARSEAPI(const XML_LChar *)
     788const XML_LChar * EXPATENTRY
    781789XML_ErrorString(int code);
    782790
    783791/* Return a string containing the version number of this expat */
    784 XMLPARSEAPI(const XML_LChar *)
     792const XML_LChar * EXPATENTRY
    785793XML_ExpatVersion(void);
    786794
     
    794802   number information for this version of expat */
    795803
    796 XMLPARSEAPI(XML_Expat_Version)
     804XML_Expat_Version EXPATENTRY
    797805XML_ExpatVersionInfo(void);
    798806
  • trunk/include/expat/xmlrole.h

    r97 r98  
    66#ifndef XmlRole_INCLUDED
    77#define XmlRole_INCLUDED 1
     8
     9#include "expat\expat_setup.h"
     10                        // V0.9.9 (2001-02-10) [umoeller]
     11                        // to save the app from having to include this as well
    812
    913#include "expat\xmltok.h"
     
    7377};
    7478
     79struct prolog_state;
     80typedef int EXPATENTRY FNHANDLER(struct prolog_state *state,
     81                      int tok,
     82                      const char *ptr,
     83                      const char *end,
     84                      const ENCODING *enc);
     85
    7586typedef struct prolog_state {
    76   int (*handler)(struct prolog_state *state,
    77              int tok,
    78          const char *ptr,
    79          const char *end,
    80          const ENCODING *enc);
     87  FNHANDLER *handler;
    8188  unsigned level;
    8289#ifdef XML_DTD
  • trunk/include/expat/xmltok.h

    r97 r98  
    66#ifndef XmlTok_INCLUDED
    77#define XmlTok_INCLUDED 1
     8
     9#include "expat\expat_setup.h"
     10                        // V0.9.9 (2001-02-10) [umoeller]
     11                        // to save the app from having to include this as well
    812
    913#ifdef __cplusplus
     
    1721#define XML_TOK_NONE -4    /* The string to be scanned is empty */
    1822#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
    19                                   might be part of CRLF sequence */ 
     23                                  might be part of CRLF sequence */
    2024#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
    2125#define XML_TOK_PARTIAL -1 /* only part of a token */
     
    122126typedef struct encoding ENCODING;
    123127
     128typedef int EXPATENTRY SCANNERFUNC(const ENCODING *,
     129                                   const char *,
     130                                   const char *,
     131                                   const char **);
     132typedef SCANNERFUNC *PSCANNERFUNC;
     133
    124134struct encoding {
    125   int (*scanners[XML_N_STATES])(const ENCODING *,
    126                                 const char *,
    127                                 const char *,
    128                                 const char **);
    129   int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *,
    130                                               const char *,
    131                                               const char *,
    132                                               const char **);
    133   int (*sameName)(const ENCODING *,
    134                   const char *, const char *);
    135   int (*nameMatchesAscii)(const ENCODING *,
    136                           const char *, const char *, const char *);
    137   int (*nameLength)(const ENCODING *, const char *);
    138   const char *(*skipS)(const ENCODING *, const char *);
    139   int (*getAtts)(const ENCODING *enc, const char *ptr,
    140                  int attsMax, ATTRIBUTE *atts);
    141   int (*charRefNumber)(const ENCODING *enc, const char *ptr);
    142   int (*predefinedEntityName)(const ENCODING *, const char *, const char *);
    143   void (*updatePosition)(const ENCODING *,
    144                          const char *ptr,
    145                          const char *end,
    146                          POSITION *);
    147   int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
    148                     const char **badPtr);
    149   void (*utf8Convert)(const ENCODING *enc,
    150                       const char **fromP,
    151                       const char *fromLim,
    152                       char **toP,
    153                       const char *toLim);
    154   void (*utf16Convert)(const ENCODING *enc,
    155                        const char **fromP,
    156                        const char *fromLim,
    157                        unsigned short **toP,
    158                        const unsigned short *toLim);
     135  PSCANNERFUNC scanners[XML_N_STATES];
     136  PSCANNERFUNC      literalScanners[XML_N_LITERAL_TYPES];
     137  /* int (* EXPATENTRY literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *,
     138                          const char *,
     139                          const char *,
     140                          const char **); */
     141  int (* EXPATENTRY sameName)(const ENCODING *,
     142              const char *, const char *);
     143  int (* EXPATENTRY nameMatchesAscii)(const ENCODING *,
     144              const char *, const char *, const char *);
     145  int (* EXPATENTRY nameLength)(const ENCODING *, const char *);
     146  const char *(* EXPATENTRY skipS)(const ENCODING *, const char *);
     147  int (* EXPATENTRY getAtts)(const ENCODING *enc, const char *ptr,
     148             int attsMax, ATTRIBUTE *atts);
     149  int (* EXPATENTRY charRefNumber)(const ENCODING *enc, const char *ptr);
     150  int (* EXPATENTRY predefinedEntityName)(const ENCODING *, const char *, const char *);
     151  void (* EXPATENTRY updatePosition)(const ENCODING *,
     152             const char *ptr,
     153             const char *end,
     154             POSITION *);
     155  int (* EXPATENTRY isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
     156            const char **badPtr);
     157  void (* EXPATENTRY utf8Convert)(const ENCODING *enc,
     158              const char **fromP,
     159              const char *fromLim,
     160              char **toP,
     161              const char *toLim);
     162  void (* EXPATENTRY utf16Convert)(const ENCODING *enc,
     163               const char **fromP,
     164               const char *fromLim,
     165               unsigned short **toP,
     166               const unsigned short *toLim);
    159167  int minBytesPerChar;
    160168  char isUtf8;
     
    203211
    204212/* This is used for performing a 2nd-level tokenization on
    205 the content of a literal that has already been returned by XmlTok. */ 
     213the content of a literal that has already been returned by XmlTok. */
    206214
    207215#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
     
    252260
    253261int  XmlParseXmlDecl(int isGeneralTextEntity,
    254                               const ENCODING *enc,
    255                               const char *ptr,
    256                               const char *end,
    257                               const char **badPtr,
    258                               const char **versionPtr,
    259                               const char **versionEndPtr,
    260                               const char **encodingNamePtr,
    261                               const ENCODING **namedEncodingPtr,
    262                               int *standalonePtr);
     262                  const ENCODING *enc,
     263                  const char *ptr,
     264                  const char *end,
     265                  const char **badPtr,
     266                  const char **versionPtr,
     267                  const char **versionEndPtr,
     268                  const char **encodingNamePtr,
     269                  const ENCODING **namedEncodingPtr,
     270                  int *standalonePtr);
    263271
    264272int  XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
     
    271279ENCODING  *
    272280XmlInitUnknownEncoding(void *mem,
    273                        int *table,
    274                        int (*conv)(void *userData, const char *p),
    275                        void *userData);
     281               int *table,
     282               int (*conv)(void *userData, const char *p),
     283               void *userData);
    276284
    277285int  XmlParseXmlDeclNS(int isGeneralTextEntity,
    278                                 const ENCODING *enc,
    279                                 const char *ptr,
    280                                 const char *end,
    281                                 const char **badPtr,
    282                                 const char **versionPtr,
    283                                 const char **versionEndPtr,
    284                                 const char **encodingNamePtr,
    285                                 const ENCODING **namedEncodingPtr,
    286                                 int *standalonePtr);
     286                    const ENCODING *enc,
     287                    const char *ptr,
     288                    const char *end,
     289                    const char **badPtr,
     290                    const char **versionPtr,
     291                const char **versionEndPtr,
     292                    const char **encodingNamePtr,
     293                    const ENCODING **namedEncodingPtr,
     294                    int *standalonePtr);
    287295int  XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
    288296const ENCODING  *XmlGetUtf8InternalEncodingNS(void);
     
    290298ENCODING  *
    291299XmlInitUnknownEncodingNS(void *mem,
    292                          int *table,
    293                          int (*conv)(void *userData, const char *p),
    294                          void *userData);
     300                 int *table,
     301                 int (*conv)(void *userData, const char *p),
     302                 void *userData);
    295303#ifdef __cplusplus
    296304}
  • trunk/include/helpers/xml.h

    r97 r98  
    630630
    631631    typedef APIRET APIENTRY FNEXTERNALHANDLER(PXMLDOM pDom,
    632                                               XML_Parser *pSubParser,
     632                                              XML_Parser pSubParser,
    633633                                              const char *pcszSystemID,
    634634                                              const char *pcszPublicID);
  • trunk/src/helpers/cctl_splitwin.c

    r46 r98  
    510510
    511511            case WM_MOUSEMOVE:
    512                 pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove);
     512                if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE)
     513                    // V0.9.14 (2001-08-21) [umoeller]
     514                    // split bar is moveable:
     515                    pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove);
     516                else
     517                    mrc = OldStaticProc(hwndBar, msg, mp1, mp2);
    513518            break;
    514519
     
    521526            case WM_BUTTON1DOWN:
    522527            case WM_BUTTON2DOWN:
    523                 TrackSplitBar(hwndBar, pData);
     528                if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE)
     529                    // V0.9.14 (2001-08-21) [umoeller]
     530                    // split bar is moveable:
     531                    TrackSplitBar(hwndBar, pData);
     532                else
     533                    mrc = OldStaticProc(hwndBar, msg, mp1, mp2);
    524534            break;
    525535
  • trunk/src/helpers/dialog.c

    r95 r98  
    100100    LINKLIST    llTables;
    101101
    102     HWND        hwndFirstFocus;
     102    HWND        hwndFirstFocus,
     103                hwndDefPushbutton;      // V0.9.14 (2001-08-21) [umoeller]
    103104
    104105    POINTL      ptlTotalOfs;
     
    719720                       )
    720721                        pDlgData->hwndFirstFocus = pColumnDef->hwndControl;
     722
     723                    // if this is the first default push button,
     724                    // go store it too
     725                    // V0.9.14 (2001-08-21) [umoeller]
     726                    if (    (!pDlgData->hwndDefPushbutton)
     727                         && ((ULONG)pControlDef->pcszClass == 0xffff0003L)
     728                         && (pControlDef->flStyle & BS_DEFAULT)
     729                       )
     730                        pDlgData->hwndDefPushbutton = pColumnDef->hwndControl;
    721731                }
    722732                else
     
    10481058 *      This does NOT use regular dialog templates from
    10491059 *      module resources. Instead, you pass in an array
    1050  *      of _DLGHITEM structures, which define the controls
     1060 *      of DLGHITEM structures, which define the controls
    10511061 *      and how they are to be formatted.
     1062 *
     1063 *      The main advantage compared to dialog resources is
     1064 *      that with this  function, you will never have to
     1065 *      define control _positions_. Instead, you only specify
     1066 *      the control _sizes_, and all positions are computed
     1067 *      automatically here. Even better, for many controls,
     1068 *      auto-sizing is supported according to the control's
     1069 *      text (e.g. for statics and checkboxes).
    10521070 *
    10531071 *      A regular standard dialog would use something like
     
    10681086 *      your dlg proc, use WinDefDlgProc as usual.
    10691087 *
    1070  *      There is NO run-time overhead after creation; after this
    1071  *      function returns, the dialog is a standard dialog as if
    1072  *      loaded from WinLoadDlg.
    1073  *
    1074  *      The array of _DLGHITEM structures defines how the
     1088 *      There is NO run-time overhead for either code or memory
     1089 *      after dialog creation; after this function returns, the
     1090 *      dialog is a standard dialog as if loaded from WinLoadDlg.
     1091 *      The array of DLGHITEM structures defines how the
    10751092 *      dialog is set up. All this is ONLY used by this function
    10761093 *      and NOT needed after the dialog has been created.
    10771094 *
    1078  *      In _DLGHITEM, the "Type" field determines what this
     1095 *      In DLGHITEM, the "Type" field determines what this
    10791096 *      structure defines. A number of handy macros have been
    10801097 *      defined to make this easier and to provide type-checking
    1081  *      at compile time.
     1098 *      at compile time. See dialog.h for more.
    10821099 *
    10831100 *      Essentially, such a dialog item operates similarly to
     
    11111128 *
    11121129 *      --  CONTROL_DEF(pDef) defines a control in a table row.
    1113  *          pDef must point to a _CONTROLDEF structure.
    1114  *
    1115  *          The main difference (and advantage) of this
    1116  *          function is that there is NO information in
    1117  *          _CONTROLDEF about a control's _position_.
     1130 *          pDef must point to a CONTROLDEF structure.
     1131 *
     1132 *          Again, there is is NO information in
     1133 *          CONTROLDEF about a control's _position_.
    11181134 *          Instead, the structure only contains the _size_
    11191135 *          of the control. All positions are computed by
     
    12511267 +                                        DlgTemplate,      // DLGHITEM array
    12521268 +                                        ARRAYITEMCOUNT(DlgTemplate),
    1253  +                                        NULL))
     1269 +                                        NULL,             // mp2 for WM_INITDLG
     1270 +                                        "9.WarpSans"))    // default font
    12541271 +          {
    12551272 +              ULONG idReturn = WinProcessDlg(hwndDlg);
     
    12591276 *@@changed V0.9.14 (2001-07-07) [umoeller]: fixed disabled mouse with hwndOwner == HWND_DESKTOP
    12601277 *@@changed V0.9.14 (2001-08-01) [umoeller]: fixed major memory leaks with nested tables
     1278 *@@changed V0.9.14 (2001-08-21) [umoeller]: fixed default push button problems
    12611279 */
    12621280
     
    13171335
    13181336                // push the current table on the stack
    1319                 PSTACKITEM pStackItem = NEW(STACKITEM);
    1320                 if (pStackItem)
     1337                PSTACKITEM pStackItem;
     1338                if (!(pStackItem = NEW(STACKITEM)))
     1339                {
     1340                    arc = ERROR_NOT_ENOUGH_MEMORY;
     1341                    break;
     1342                }
     1343                else
    13211344                {
    13221345                    pStackItem->pLastTable = pCurrentTable;
     
    13261349
    13271350                // create new table
    1328                 pCurrentTable = NEW(TABLEDEF);
    1329                 if (!pCurrentTable)
     1351                if (!(pCurrentTable = NEW(TABLEDEF)))
    13301352                    arc = ERROR_NOT_ENOUGH_MEMORY;
    13311353                else
     
    13721394                {
    13731395                    // create new row
    1374                     pCurrentRow = NEW(ROWDEF);
    1375                     if (!pCurrentRow)
     1396                    if (!(pCurrentRow = NEW(ROWDEF)))
    13761397                        arc = ERROR_NOT_ENOUGH_MEMORY;
    13771398                    else
     
    14651486            hwndOwner = NULLHANDLE;
    14661487
    1467         pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP,
    1468                                             WC_FRAME,
    1469                                             (PSZ)pcszDlgTitle,
    1470                                             flStyle,        // style; invisible for now
    1471                                             0, 0, 0, 0,
    1472                                             hwndOwner,
    1473                                             HWND_TOP,
    1474                                             0,              // ID
    1475                                             &fcData,
    1476                                             NULL);          // presparams
    1477 
    1478         if (!pDlgData->hwndDlg)
     1488        if (!(pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP,
     1489                                                  WC_FRAME,
     1490                                                  (PSZ)pcszDlgTitle,
     1491                                                  flStyle,        // style; invisible for now
     1492                                                  0, 0, 0, 0,
     1493                                                  hwndOwner,
     1494                                                  HWND_TOP,
     1495                                                  0,              // ID
     1496                                                  &fcData,
     1497                                                  NULL)))          // presparams
    14791498            arc = DLGERR_CANNOT_CREATE_FRAME;
    14801499        else
     
    14931512                       &szlClient,
    14941513                       PROCESS_CALC_SIZES);
    1495 
     1514                // this goes into major recursions...
     1515
     1516            // free the cached font resources that
     1517            // might have been created here
    14961518            if (pDlgData->lcidLast)
    14971519            {
     
    15011523            if (pDlgData->hps)
    15021524                WinReleasePS(pDlgData->hps);
     1525
     1526            WinSubclassWindow(hwndDlg, pfnwpDialogProc);
    15031527
    15041528            /*
     
    15061530             *     size of all controls
    15071531             */
    1508 
    1509             WinSubclassWindow(hwndDlg, pfnwpDialogProc);
    15101532
    15111533            // calculate the frame size from the client size
     
    15461568                       &szlClient,
    15471569                       PROCESS_CREATE_CONTROLS);
     1570
     1571            if (pDlgData->hwndDefPushbutton)
     1572                // we had a default pushbutton:
     1573                // go set it V0.9.14 (2001-08-21) [umoeller]
     1574                WinSetWindowULong(pDlgData->hwndDlg,
     1575                                  QWL_DEFBUTTON,
     1576                                  pDlgData->hwndDefPushbutton);
    15481577
    15491578            /*
  • trunk/src/helpers/xmlparse.c

    r97 r98  
    947947    inheritedBindings = 0;
    948948    attsSize = INIT_ATTS_SIZE;
    949     atts = MALLOC(attsSize * sizeof(ATTRIBUTE));
     949    atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE));
    950950    nSpecifiedAtts = 0;
    951     dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
     951    dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
    952952    groupSize = 0;
    953953    groupConnector = 0;
     
    10651065
    10661066#ifdef XML_DTD
    1067     int oldParamEntityParsing = paramEntityParsing;
     1067    enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
    10681068
    10691069#endif
     
    22522252            }
    22532253            while (bufferSize < neededSize);
    2254             newBuf = MALLOC(bufferSize);
     2254            newBuf = (char*)MALLOC(bufferSize);
    22552255            if (newBuf == 0)
    22562256            {
     
    27832783                    else
    27842784                    {
    2785                         tag = MALLOC(sizeof(TAG));
     2785                        tag = (TAG*)MALLOC(sizeof(TAG));
    27862786                        if (!tag)
    27872787                            return ERROR_EXPAT_NO_MEMORY;
    2788                         tag->buf = MALLOC(INIT_TAG_BUF_SIZE);
     2788                        tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE);
    27892789                        if (!tag->buf)
    27902790                            return ERROR_EXPAT_NO_MEMORY;
     
    28062806
    28072807                            bufSize = ROUND_UP(bufSize, sizeof(XML_Char));
    2808                             tag->buf = REALLOC(tag->buf, bufSize);
     2808                            tag->buf = (char*)REALLOC(tag->buf, bufSize);
    28092809                            if (!tag->buf)
    28102810                                return ERROR_EXPAT_NO_MEMORY;
     
    28372837                                break;
    28382838                            bufSize = (tag->bufEnd - tag->buf) << 1;
    2839                             tag->buf = REALLOC(tag->buf, bufSize);
     2839                            tag->buf = (char*)REALLOC(tag->buf, bufSize);
    28402840                            if (!tag->buf)
    28412841                                return ERROR_EXPAT_NO_MEMORY;
     
    31403140
    31413141        attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
    3142         atts = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
     3142        atts = (ATTRIBUTE*)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
    31433143        if (!atts)
    31443144            return ERROR_EXPAT_NO_MEMORY;
     
    33653365    {
    33663366        TAG *p;
    3367         XML_Char *uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
     3367        XML_Char *uri = (XML_Char*)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
    33683368
    33693369        if (!uri)
     
    33973397        if (len > b->uriAlloc)
    33983398        {
    3399             b->uri = REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
     3399            b->uri = (XML_Char*)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
    34003400            if (!b->uri)
    34013401                return 0;
     
    34063406    else
    34073407    {
    3408         b = MALLOC(sizeof(BINDING));
     3408        b = (BINDING*)MALLOC(sizeof(BINDING));
    34093409        if (!b)
    34103410            return 0;
    3411         b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
     3411        b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
    34123412        if (!b->uri)
    34133413        {
     
    38193819            {
    38203820                unknownEncodingData = info.data;
    3821                 unknownEncodingRelease = info.release;
     3821                unknownEncodingRelease = (void(*)(void*))info.release;
    38223822                encoding = enc;
    38233823                return ERROR_EXPAT_NONE;
     
    44534453                    if (groupSize)
    44544454                    {
    4455                         groupConnector = REALLOC(groupConnector, groupSize *= 2);
     4455                        groupConnector = (char*)REALLOC(groupConnector, groupSize *= 2);
    44564456                        if (dtd.scaffIndex)
    4457                             dtd.scaffIndex = REALLOC(dtd.scaffIndex, groupSize * sizeof(int));
     4457                            dtd.scaffIndex = (int*)REALLOC(dtd.scaffIndex, groupSize * sizeof(int));
    44584458                    }
    44594459                    else
    4460                         groupConnector = MALLOC(groupSize = 32);
     4460                        groupConnector = (char*)MALLOC(groupSize = 32);
    44614461                    if (!groupConnector)
    44624462                        return ERROR_EXPAT_NO_MEMORY;
     
    52325232        {
    52335233            type->allocDefaultAtts = 8;
    5234             type->defaultAtts = MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
     5234            type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
    52355235        }
    52365236        else
    52375237        {
    52385238            type->allocDefaultAtts *= 2;
    5239             type->defaultAtts = REALLOC(type->defaultAtts,
     5239            type->defaultAtts = (DEFAULT_ATTRIBUTE*)REALLOC(type->defaultAtts,
    52405240                          type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
    52415241        }
     
    58145814            return 0;
    58155815        tsize = INIT_SIZE * sizeof(NAMED *);
    5816         table->v = table->mem->malloc_fcn(tsize);
     5816        table->v = (NAMED**)table->mem->malloc_fcn(tsize);
    58175817        if (!table->v)
    58185818            return 0;
     
    58405840            size_t newSize = table->size * 2;
    58415841            size_t tsize = newSize * sizeof(NAMED *);
    5842             NAMED **newV = table->mem->malloc_fcn(tsize);
     5842            NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize);
    58435843
    58445844            if (!newV)
     
    58665866        }
    58675867    }
    5868     table->v[i] = table->mem->malloc_fcn(createSize);
     5868    table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize);
    58695869    if (!table->v[i])
    58705870        return 0;
     
    61406140        int blockSize = (pool->end - pool->start) * 2;
    61416141
    6142         pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
     6142        pool->blocks = (BLOCK*)pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
    61436143        if (!pool->blocks)
    61446144            return 0;
     
    61576157        else
    61586158            blockSize *= 2;
    6159         tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
     6159        tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
    61606160        if (!tem)
    61616161            return 0;
     
    61806180    if (!dtd.scaffIndex)
    61816181    {
    6182         dtd.scaffIndex = MALLOC(groupSize * sizeof(int));
     6182        dtd.scaffIndex = (int*)MALLOC(groupSize * sizeof(int));
    61836183
    61846184        if (!dtd.scaffIndex)
     
    62736273    int allocsize = dtd.scaffCount * sizeof(XMLCONTENT) + dtd.contentStringLen;
    62746274
    6275     ret = MALLOC(allocsize);
     6275    ret = (XMLCONTENT*)MALLOC(allocsize);
    62766276    if (!ret)
    62776277        return 0;
  • trunk/src/helpers/xmlrole.c

    r97 r98  
    6464#endif /* not XML_DTD */
    6565
    66 typedef int PROLOG_HANDLER(PROLOG_STATE *state,
    67                int tok,
    68                const char *ptr,
    69                const char *end,
    70                const ENCODING *enc);
     66typedef int EXPATENTRY PROLOG_HANDLER(PROLOG_STATE *state,
     67                                      int tok,
     68                                      const char *ptr,
     69                                      const char *end,
     70                                      const ENCODING *enc);
    7171
    7272static PROLOG_HANDLER
     
    9292
    9393static
    94 int prolog0(PROLOG_STATE *state,
     94int EXPATENTRY prolog0(PROLOG_STATE *state,
    9595        int tok,
    9696        const char *ptr,
  • trunk/src/helpers/xmltok.c

    r97 r98  
    8686
    8787static
    88 int isNever(const ENCODING * enc, const char *p)
     88int EXPATENTRY isNever(const ENCODING * enc, const char *p)
    8989{
    9090    return 0;
     
    9292
    9393static
    94 int utf8_isName2(const ENCODING * enc, const char *p)
     94int EXPATENTRY utf8_isName2(const ENCODING * enc, const char *p)
    9595{
    9696    return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
     
    9898
    9999static
    100 int utf8_isName3(const ENCODING * enc, const char *p)
     100int EXPATENTRY utf8_isName3(const ENCODING * enc, const char *p)
    101101{
    102102    return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
     
    106106
    107107static
    108 int utf8_isNmstrt2(const ENCODING * enc, const char *p)
     108int EXPATENTRY utf8_isNmstrt2(const ENCODING * enc, const char *p)
    109109{
    110110    return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
     
    112112
    113113static
    114 int utf8_isNmstrt3(const ENCODING * enc, const char *p)
     114int EXPATENTRY utf8_isNmstrt3(const ENCODING * enc, const char *p)
    115115{
    116116    return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
     
    122122
    123123static
    124 int utf8_isInvalid3(const ENCODING * enc, const char *p)
     124int EXPATENTRY utf8_isInvalid3(const ENCODING * enc, const char *p)
    125125{
    126126    return UTF8_INVALID3((const unsigned char *)p);
     
    128128
    129129static
    130 int utf8_isInvalid4(const ENCODING * enc, const char *p)
     130int EXPATENTRY utf8_isInvalid4(const ENCODING * enc, const char *p)
    131131{
    132132    return UTF8_INVALID4((const unsigned char *)p);
     
    138138    unsigned char type[256];
    139139#ifdef XML_MIN_SIZE
    140     int (*byteType) (const ENCODING *, const char *);
    141     int (*isNameMin) (const ENCODING *, const char *);
    142     int (*isNmstrtMin) (const ENCODING *, const char *);
    143     int (*byteToAscii) (const ENCODING *, const char *);
    144     int (*charMatches) (const ENCODING *, const char *, int);
     140    int (* EXPATENTRY byteType) (const ENCODING *, const char *);
     141    int (* EXPATENTRY isNameMin) (const ENCODING *, const char *);
     142    int (* EXPATENTRY isNmstrtMin) (const ENCODING *, const char *);
     143    int (* EXPATENTRY byteToAscii) (const ENCODING *, const char *);
     144    int (* EXPATENTRY charMatches) (const ENCODING *, const char *, int);
    145145#endif                          /* XML_MIN_SIZE */
    146     int (*isName2) (const ENCODING *, const char *);
    147     int (*isName3) (const ENCODING *, const char *);
    148     int (*isName4) (const ENCODING *, const char *);
    149     int (*isNmstrt2) (const ENCODING *, const char *);
    150     int (*isNmstrt3) (const ENCODING *, const char *);
    151     int (*isNmstrt4) (const ENCODING *, const char *);
    152     int (*isInvalid2) (const ENCODING *, const char *);
    153     int (*isInvalid3) (const ENCODING *, const char *);
    154     int (*isInvalid4) (const ENCODING *, const char *);
     146    int (* EXPATENTRY isName2) (const ENCODING *, const char *);
     147    int (* EXPATENTRY isName3) (const ENCODING *, const char *);
     148    int (* EXPATENTRY isName4) (const ENCODING *, const char *);
     149    int (* EXPATENTRY isNmstrt2) (const ENCODING *, const char *);
     150    int (* EXPATENTRY isNmstrt3) (const ENCODING *, const char *);
     151    int (* EXPATENTRY isNmstrt4) (const ENCODING *, const char *);
     152    int (* EXPATENTRY isInvalid2) (const ENCODING *, const char *);
     153    int (* EXPATENTRY isInvalid3) (const ENCODING *, const char *);
     154    int (* EXPATENTRY isInvalid4) (const ENCODING *, const char *);
    155155};
    156156
     
    202202
    203203#ifdef XML_MIN_SIZE
    204 static
    205 int sb_byteType(const ENCODING * enc, const char *p)
     204static int EXPATENTRY sb_byteType(const ENCODING * enc, const char *p)
    206205{
    207206    return SB_BYTE_TYPE(enc, p);
     
    217216 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p))
    218217static
    219 int sb_byteToAscii(const ENCODING * enc, const char *p)
     218int EXPATENTRY sb_byteToAscii(const ENCODING * enc, const char *p)
    220219{
    221220    return *p;
     
    246245 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c))
    247246static
    248 int sb_charMatches(const ENCODING * enc, const char *p, int c)
     247int EXPATENTRY sb_charMatches(const ENCODING * enc, const char *p, int c)
    249248{
    250249    return *p == c;
     
    276275};
    277276
    278 static void utf8_toUtf8(const ENCODING * enc,
     277static void EXPATENTRY utf8_toUtf8(const ENCODING * enc,
    279278                        const char **fromP,
    280279                        const char *fromLim,
     
    302301}
    303302
    304 static void utf8_toUtf16(const ENCODING * enc,
     303static void EXPATENTRY utf8_toUtf16(const ENCODING * enc,
    305304                         const char **fromP,
    306305                         const char *fromLim,
     
    397396};
    398397
    399 static void latin1_toUtf8(const ENCODING * enc,
     398static void  EXPATENTRY latin1_toUtf8(const ENCODING * enc,
    400399                          const char **fromP,
    401400                          const char *fromLim,
     
    427426}
    428427
    429 static void latin1_toUtf16(const ENCODING * enc,
     428static void  EXPATENTRY latin1_toUtf16(const ENCODING * enc,
    430429                           const char **fromP,
    431430                           const char *fromLim,
     
    463462};
    464463
    465 static void ascii_toUtf8(const ENCODING * enc,
     464static void EXPATENTRY ascii_toUtf8(const ENCODING * enc,
    466465                         const char **fromP,
    467466                         const char *fromLim,
     
    526525
    527526#define DEFINE_UTF16_TO_UTF8(E) \
    528 static \
    529 void E ## toUtf8(const ENCODING *enc, \
     527static void EXPATENTRY E ## toUtf8(const ENCODING *enc, \
    530528         const char **fromP, const char *fromLim, \
    531529         char **toP, const char *toLim) \
     
    589587
    590588#define DEFINE_UTF16_TO_UTF16(E) \
    591 static \
    592 void E ## toUtf16(const ENCODING *enc, \
     589static void EXPATENTRY E ## toUtf16(const ENCODING *enc, \
    593590          const char **fromP, const char *fromLim, \
    594591          unsigned short **toP, const unsigned short *toLim) \
     
    638635
    639636#ifdef XML_MIN_SIZE
    640 
    641      static
    642      int little2_byteType(const ENCODING * enc, const char *p)
     637static int  EXPATENTRY little2_byteType(const ENCODING * enc, const char *p)
    643638{
    644639    return LITTLE2_BYTE_TYPE(enc, p);
    645640}
    646641
    647 static int little2_byteToAscii(const ENCODING * enc, const char *p)
     642static int  EXPATENTRY little2_byteToAscii(const ENCODING * enc, const char *p)
    648643{
    649644    return LITTLE2_BYTE_TO_ASCII(enc, p);
    650645}
    651646
    652 static int little2_charMatches(const ENCODING * enc, const char *p, int c)
     647static int  EXPATENTRY little2_charMatches(const ENCODING * enc, const char *p, int c)
    653648{
    654649    return LITTLE2_CHAR_MATCHES(enc, p, c);
    655650}
    656651
    657 static int little2_isNameMin(const ENCODING * enc, const char *p)
     652static int  EXPATENTRY little2_isNameMin(const ENCODING * enc, const char *p)
    658653{
    659654    return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
    660655}
    661656
    662 static int little2_isNmstrtMin(const ENCODING * enc, const char *p)
     657static int  EXPATENTRY little2_isNmstrtMin(const ENCODING * enc, const char *p)
    663658{
    664659    return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
     
    778773#ifdef XML_MIN_SIZE
    779774
    780 static int big2_byteType(const ENCODING * enc, const char *p)
     775static int  EXPATENTRY big2_byteType(const ENCODING * enc, const char *p)
    781776{
    782777    return BIG2_BYTE_TYPE(enc, p);
    783778}
    784779
    785 static int big2_byteToAscii(const ENCODING * enc, const char *p)
     780static int  EXPATENTRY big2_byteToAscii(const ENCODING * enc, const char *p)
    786781{
    787782    return BIG2_BYTE_TO_ASCII(enc, p);
    788783}
    789784
    790 static int big2_charMatches(const ENCODING * enc, const char *p, int c)
     785static int  EXPATENTRY big2_charMatches(const ENCODING * enc, const char *p, int c)
    791786{
    792787    return BIG2_CHAR_MATCHES(enc, p, c);
    793788}
    794789
    795 static int big2_isNameMin(const ENCODING * enc, const char *p)
     790static int  EXPATENTRY big2_isNameMin(const ENCODING * enc, const char *p)
    796791{
    797792    return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
    798793}
    799794
    800 static int big2_isNmstrtMin(const ENCODING * enc, const char *p)
     795static int  EXPATENTRY big2_isNmstrtMin(const ENCODING * enc, const char *p)
    801796{
    802797    return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
     
    923918}
    924919
    925 static void initUpdatePosition(const ENCODING * enc, const char *ptr,
     920static void  EXPATENTRY initUpdatePosition(const ENCODING * enc, const char *ptr,
    926921                        const char *end, POSITION * pos)
    927922{
     
    929924}
    930925
    931 static int toAscii(const ENCODING * enc, const char *ptr, const char *end)
     926static int  EXPATENTRY toAscii(const ENCODING * enc, const char *ptr, const char *end)
    932927{
    933928    char buf[1];
     
    941936}
    942937
    943 static int isSpace(int c)
     938static int  EXPATENTRY isSpace(int c)
    944939{
    945940    switch (c)
     
    956951/* Return 1 if there's just optional white space
    957952 * or there's an S followed by name=val. */
    958 static int parsePseudoAttribute(const ENCODING * enc,
     953static int  EXPATENTRY parsePseudoAttribute(const ENCODING * enc,
    959954                                const char *ptr,
    960955                                const char *end,
     
    12881283}
    12891284
    1290 static int unknown_isName(const ENCODING * enc, const char *p)
     1285static int  EXPATENTRY unknown_isName(const ENCODING * enc, const char *p)
    12911286{
    12921287    int c = ((const struct unknown_encoding *)enc)
     
    12981293}
    12991294
    1300 static int unknown_isNmstrt(const ENCODING * enc, const char *p)
     1295static int  EXPATENTRY unknown_isNmstrt(const ENCODING * enc, const char *p)
    13011296{
    13021297    int c = ((const struct unknown_encoding *)enc)
     
    13081303}
    13091304
    1310 static int unknown_isInvalid(const ENCODING * enc, const char *p)
     1305static int  EXPATENTRY unknown_isInvalid(const ENCODING * enc, const char *p)
    13111306{
    13121307    int c = ((const struct unknown_encoding *)enc)
     
    13161311}
    13171312
    1318 static void unknown_toUtf8(const ENCODING * enc,
     1313static void  EXPATENTRY unknown_toUtf8(const ENCODING * enc,
    13191314                           const char **fromP,
    13201315                           const char *fromLim,
     
    13591354}
    13601355
    1361 static void unknown_toUtf16(const ENCODING * enc,
     1356static void  EXPATENTRY unknown_toUtf16(const ENCODING * enc,
    13621357                            const char **fromP,
    13631358                            const char *fromLim,
     
    13951390{
    13961391    int i;
    1397     struct unknown_encoding *e = mem;
     1392    struct unknown_encoding *e = (struct unknown_encoding*)mem;
    13981393
    13991394    // gee, isn't this a regular memcpy?!?
     
    15631558
    15641559
    1565 static int initScan(const ENCODING ** encodingTable,
     1560static int EXPATENTRY initScan(const ENCODING ** encodingTable,
    15661561                    const INIT_ENCODING * enc,
    15671562                    int state,
     
    17081703ENCODING * XmlInitUnknownEncodingNS(void *mem,
    17091704                                    int *table,
    1710                                     int (*convert) (void *userData, const char *p),
     1705                                    int (* EXPATENTRY convert) (void *userData, const char *p),
    17111706                                    void *userData)
    17121707{
  • trunk/src/helpers/xmltok_impl.c

    r97 r98  
     1
    12/*
    2 Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
    3 See the file COPYING for copying permission.
    4 */
     3 *sourcefile xmltok_impl.c
     4 *      part of the expat implementation. See xmlparse.c.
     5 *
     6 *      NOTE: This file must not be compiled directly. It is
     7 *      #include'd from xmltok.c several times.
     8 */
     9
     10/*
     11 *      Copyright (C) 2001 Ulrich M”ller.
     12 *      Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
     13 *                                     and Clark Cooper.
     14 *
     15 *      Permission is hereby granted, free of charge, to any person obtaining
     16 *      a copy of this software and associated documentation files (the
     17 *      "Software"), to deal in the Software without restriction, including
     18 *      without limitation the rights to use, copy, modify, merge, publish,
     19 *      distribute, sublicense, and/or sell copies of the Software, and to
     20 *      permit persons to whom the Software is furnished to do so, subject to
     21 *      the following conditions:
     22 *
     23 *      The above copyright notice and this permission notice shall be included
     24 *      in all copies or substantial portions of the Software.
     25 *
     26 *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     27 *      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     28 *      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     29 *      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     30 *      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     31 *      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     32 *      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     33 */
    534
    635#ifndef IS_INVALID_CHAR
     
    88117/* ptr points to character following "<!-" */
    89118
    90 static
    91 int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end,
    92             const char **nextTokPtr)
     119static int EXPATENTRY PREFIX(scanComment)(const ENCODING *enc,
     120                                          const char *ptr,
     121                                          const char *end,
     122                                          const char **nextTokPtr)
    93123{
    94124  if (ptr != end) {
     
    126156/* ptr points to character following "<!" */
    127157
    128 static
    129 int PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
     158static int EXPATENTRY PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
    130159             const char **nextTokPtr)
    131160{
     
    173202}
    174203
    175 static
    176 int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr)
     204static int EXPATENTRY PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr)
    177205{
    178206  int upper = 0;
     
    217245/* ptr points to character following "<?" */
    218246
    219 static
    220 int PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
     247static int EXPATENTRY PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
    221248           const char **nextTokPtr)
    222249{
     
    280307
    281308
    282 static
    283 int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
     309static int EXPATENTRY PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
    284310                 const char **nextTokPtr)
    285311{
     
    299325}
    300326
    301 static
    302 int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
     327static int EXPATENTRY PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
    303328                const char **nextTokPtr)
    304329{
     
    377402/* ptr points to character following "</" */
    378403
    379 static
    380 int PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
     404static int EXPATENTRY PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
    381405               const char **nextTokPtr)
    382406{
     
    425449/* ptr points to character following "&#X" */
    426450
    427 static
    428 int PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
     451static int EXPATENTRY PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
    429452               const char **nextTokPtr)
    430453{
     
    457480/* ptr points to character following "&#" */
    458481
    459 static
    460 int PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
     482static int EXPATENTRY PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
    461483            const char **nextTokPtr)
    462484{
     
    489511/* ptr points to character following "&" */
    490512
    491 static
    492 int PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
     513static int EXPATENTRY PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
    493514            const char **nextTokPtr)
    494515{
     
    519540/* ptr points to character following first character of attribute name */
    520541
    521 static
    522 int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
     542static int EXPATENTRY PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
    523543             const char **nextTokPtr)
    524544{
     
    679699/* ptr points to character following "<" */
    680700
    681 static
    682 int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
     701static int EXPATENTRY PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
    683702           const char **nextTokPtr)
    684703{
     
    778797}
    779798
    780 static
    781 int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
     799static int EXPATENTRY PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
    782800               const char **nextTokPtr)
    783801{
     
    877895/* ptr points to character following "%" */
    878896
    879 static
    880 int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
     897static int EXPATENTRY PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
    881898            const char **nextTokPtr)
    882899{
     
    906923}
    907924
    908 static
    909 int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
     925static int EXPATENTRY PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
    910926              const char **nextTokPtr)
    911927{
     
    933949}
    934950
    935 static
    936 int PREFIX(scanLit)(int open, const ENCODING *enc,
     951static int EXPATENTRY PREFIX(scanLit)(int open, const ENCODING *enc,
    937952            const char *ptr, const char *end,
    938953            const char **nextTokPtr)
     
    965980}
    966981
    967 static
    968 int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
     982static int EXPATENTRY PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
    969983              const char **nextTokPtr)
    970984{
     
    11931207}
    11941208
    1195 static
    1196 int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
     1209static int EXPATENTRY PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
    11971210                  const char **nextTokPtr)
    11981211{
     
    12511264}
    12521265
    1253 static
    1254 int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
     1266static int EXPATENTRY PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
    12551267               const char **nextTokPtr)
    12561268{
     
    13081320#ifdef XML_DTD
    13091321
    1310 static
    1311 int PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
     1322static int EXPATENTRY PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
    13121323                 const char **nextTokPtr)
    13131324{
     
    13611372#endif /* XML_DTD */
    13621373
    1363 static
    1364 int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
     1374static int EXPATENTRY PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
    13651375               const char **badPtr)
    13661376{
     
    14201430are stored in atts. */
    14211431
    1422 static
    1423 int PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
     1432static int EXPATENTRY PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
    14241433            int attsMax, ATTRIBUTE *atts)
    14251434{
     
    15131522}
    15141523
    1515 static
    1516 int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
     1524static int EXPATENTRY PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
    15171525{
    15181526  int result = 0;
     
    15531561}
    15541562
    1555 static
    1556 int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end)
     1563static int EXPATENTRY PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end)
    15571564{
    15581565  switch ((end - ptr)/MINBPC(enc)) {
     
    16061613}
    16071614
    1608 static
    1609 int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
     1615static int EXPATENTRY PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
    16101616{
    16111617  for (;;) {
     
    16701676}
    16711677
    1672 static
    1673 int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
     1678static int EXPATENTRY PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
    16741679                 const char *end1, const char *ptr2)
    16751680{
     
    16831688}
    16841689
    1685 static
    1686 int PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
     1690static int EXPATENTRY PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
    16871691{
    16881692  const char *start = ptr;
     
    17101714}
    17111715
    1712 static
    1713 const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr)
     1716static const char* EXPATENTRY PREFIX(skipS)(const ENCODING *enc, const char *ptr)
    17141717{
    17151718  for (;;) {
     
    17261729}
    17271730
    1728 static
    1729 void PREFIX(updatePosition)(const ENCODING *enc,
     1731static void EXPATENTRY PREFIX(updatePosition)(const ENCODING *enc,
    17301732                const char *ptr,
    17311733                const char *end,
  • trunk/src/helpers/xmltok_ns.c

    r97 r98  
    2727};
    2828
    29 static
    30 int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
     29static int EXPATENTRY NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
    3130               const char **nextTokPtr)
    3231{
     
    3433}
    3534
    36 static
    37 int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
     35static int EXPATENTRY NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
    3836               const char **nextTokPtr)
    3937{
Note: See TracChangeset for help on using the changeset viewer.