Changeset 97 for trunk/include


Ignore:
Timestamp:
Aug 12, 2001, 5:34:51 PM (24 years ago)
Author:
umoeller
Message:

XML updates.

Location:
trunk/include
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/encodings/base.h

    r37 r97  
    77 */
    88
    9 /*
    10  *@@ XWPENCODINGMAP:
    11  *      entry in an 8-bit to Unicode conversion table.
    12  */
     9#if __cplusplus
     10extern "C" {
     11#endif
    1312
    14 typedef struct _XWPENCODINGMAP
    15 {
    16     unsigned short      usFrom;
    17     unsigned short      usUni;
    18 } XWPENCODINGMAP, *PXWPENCODINGMAP;
     13#ifndef ENC_BASE_HEADER_INCLUDED
     14    #define ENC_BASE_HEADER_INCLUDED
    1915
    20 /*
    21  *@@ XWPENCODINGID:
    22  *      enum identifying each encoding set which is
    23  *      generally supported. Each ID corresponds to
    24  *      one header file in include\encodings\.
    25  */
     16    /*
     17     *@@ XWPENCODINGMAP:
     18     *      entry in an 8-bit to Unicode conversion table.
     19     */
    2620
    27 typedef enum _XWPENCODINGID
    28 {
    29     enc_cp437,
    30     enc_cp737,
    31     enc_cp775,
    32     enc_cp850,
    33     enc_cp852,
    34     enc_cp855,
    35     enc_cp857,
    36     enc_cp860,
    37     enc_cp861,
    38     enc_cp862,
    39     enc_cp863,
    40     enc_cp864,
    41     enc_cp865,
    42     enc_cp866,
    43     enc_cp869,
    44     enc_cp874,
    45     enc_cp932,
    46     enc_cp936,
    47     enc_cp949,
    48     enc_cp950,
    49     enc_cp1250,
    50     enc_cp1251,
    51     enc_cp1252,
    52     enc_cp1253,
    53     enc_cp1254,
    54     enc_cp1255,
    55     enc_cp1256,
    56     enc_cp1257,
    57     enc_cp1258,
    58     enc_iso8859_1,
    59     enc_iso8859_2,
    60     enc_iso8859_3,
    61     enc_iso8859_4,
    62     enc_iso8859_5,
    63     enc_iso8859_6,
    64     enc_iso8859_7,
    65     enc_iso8859_8,
    66     enc_iso8859_9,
    67     enc_iso8859_10,
    68     enc_iso8859_13,
    69     enc_iso8859_14,
    70     enc_iso8859_15
    71 } XWPENCODINGID;
     21    typedef struct _XWPENCODINGMAP
     22    {
     23        unsigned short      usFrom;
     24        unsigned short      usUni;
     25    } XWPENCODINGMAP, *PXWPENCODINGMAP;
    7226
     27    /*
     28     *@@ XWPENCODINGID:
     29     *      enum identifying each encoding set which is
     30     *      generally supported. Each ID corresponds to
     31     *      one header file in include\encodings\.
     32     */
    7333
     34    typedef enum _XWPENCODINGID
     35    {
     36        enc_cp437,
     37        enc_cp737,
     38        enc_cp775,
     39        enc_cp850,
     40        enc_cp852,
     41        enc_cp855,
     42        enc_cp857,
     43        enc_cp860,
     44        enc_cp861,
     45        enc_cp862,
     46        enc_cp863,
     47        enc_cp864,
     48        enc_cp865,
     49        enc_cp866,
     50        enc_cp869,
     51        enc_cp874,
     52        enc_cp932,
     53        enc_cp936,
     54        enc_cp949,
     55        enc_cp950,
     56        enc_cp1250,
     57        enc_cp1251,
     58        enc_cp1252,
     59        enc_cp1253,
     60        enc_cp1254,
     61        enc_cp1255,
     62        enc_cp1256,
     63        enc_cp1257,
     64        enc_cp1258,
     65        enc_iso8859_1,
     66        enc_iso8859_2,
     67        enc_iso8859_3,
     68        enc_iso8859_4,
     69        enc_iso8859_5,
     70        enc_iso8859_6,
     71        enc_iso8859_7,
     72        enc_iso8859_8,
     73        enc_iso8859_9,
     74        enc_iso8859_10,
     75        enc_iso8859_13,
     76        enc_iso8859_14,
     77        enc_iso8859_15
     78    } XWPENCODINGID;
     79
     80    unsigned long encDecodeUTF8(const char **ppch);
     81
     82#endif
     83
     84#if __cplusplus
     85}
     86#endif
     87
  • trunk/include/expat/ascii.h

    r36 r97  
    7070
    7171#define ASCII_TAB 0x09
    72 #define ASCII_SPACE 0x20
     72#define ASCII_SPACE 0x20 
    7373#define ASCII_EXCL 0x21
    7474#define ASCII_QUOT 0x22
  • trunk/include/expat/expat.h

    r71 r97  
    1414
    1515#ifndef XMLPARSEAPI
    16 #  ifdef __declspec
    17 #    define XMLPARSEAPI __declspec(dllimport)
    18 #  else
    19 #    define XMLPARSEAPI /* nothing */
    20 #  endif
    21 #endif  /* not defined XMLPARSEAPI */
     16    #ifdef EXPATENTRY
     17        #define XMLPARSEAPI(type) type EXPATENTRY
     18            // V0.9.14 (2001-08-09) [umoeller]
     19    #else
     20        #define XMLPARSEAPI(type) type
     21    #endif
     22#endif
    2223
    2324#ifdef __cplusplus
     
    105106                    // -- XML_CQUANT_PLUS   plus sign
    106107
    107     const XML_Char              *name;
     108    XML_Char                    *name;
    108109
    109110    unsigned int                numchildren;
    110111
    111112    struct _XMLCONTENT          *children;
    112 
    113113} XMLCONTENT, *PXMLCONTENT;
    114114
     
    119119*/
    120120
    121 typedef void (* EXPATENTRY XML_ElementDeclHandler) (void *userData,
    122                                                     const XML_Char *name,
    123                                                     XMLCONTENT *model);
    124 
    125 void XMLPARSEAPI XML_SetElementDeclHandler(XML_Parser parser,
     121typedef void (*XML_ElementDeclHandler) (void *userData,
     122                                        const XML_Char *name,
     123                                        XMLCONTENT *model);
     124
     125XMLPARSEAPI(void)
     126XML_SetElementDeclHandler(XML_Parser parser,
    126127              XML_ElementDeclHandler eldecl);
    127128
     
    136137 */
    137138
    138 typedef void (* EXPATENTRY XML_AttlistDeclHandler) (void *userData,
    139                     const XML_Char  *elname,
    140                     const XML_Char  *attname,
    141                     const XML_Char  *att_type,
    142                     const XML_Char  *dflt,
    143                     int     isrequired);
    144 
    145 void XMLPARSEAPI XML_SetAttlistDeclHandler(XML_Parser parser,
     139typedef void (*XML_AttlistDeclHandler) (void           *userData,
     140                                        const XML_Char *elname,
     141                                        const XML_Char *attname,
     142                                        const XML_Char *att_type,
     143                                        const XML_Char *dflt,
     144                                        int     isrequired);
     145
     146XMLPARSEAPI(void)
     147XML_SetAttlistDeclHandler(XML_Parser parser,
    146148              XML_AttlistDeclHandler attdecl);
    147149
     
    155157  */
    156158
    157 typedef void (* EXPATENTRY XML_XmlDeclHandler) (void        *userData,
    158                     const XML_Char  *version,
    159                     const XML_Char  *encoding,
    160                     int         standalone);
    161 
    162 void XMLPARSEAPI XML_SetXmlDeclHandler(XML_Parser parser,
     159typedef void (*XML_XmlDeclHandler) (void        *userData,
     160                                    const XML_Char  *version,
     161                                    const XML_Char  *encoding,
     162                                    int          standalone);
     163
     164XMLPARSEAPI(void)
     165XML_SetXmlDeclHandler(XML_Parser parser,
    163166              XML_XmlDeclHandler xmldecl);
    164167
     
    170173} XML_Memory_Handling_Suite;
    171174
    172 /* Constructs a new parser; encoding is the encoding specified by the external
    173 protocol or null if there is none specified. */
    174 
    175 XML_Parser XMLPARSEAPI XML_ParserCreate(const XML_Char *encoding);
    176 
    177 /* Constructs a new parser and namespace processor.  Element type names
    178 and attribute names that belong to a namespace will be expanded;
     175/* Constructs a new parser; encoding is the encoding specified by the
     176external protocol or null if there is none specified. */
     177
     178XMLPARSEAPI(XML_Parser)
     179XML_ParserCreate(const XML_Char *encoding);
     180
     181/* Constructs a new parser and namespace processor.  Element type
     182names and attribute names that belong to a namespace will be expanded;
    179183unprefixed attribute names are never expanded; unprefixed element type
    180184names are expanded only if there is a default namespace. The expanded
    181 name is the concatenation of the namespace URI, the namespace separator character,
    182 and the local part of the name.  If the namespace separator is '\0' then
    183 the namespace URI and the local part will be concatenated without any
    184 separator.  When a namespace is not declared, the name and prefix will be
    185 passed through without expansion. */
    186 
    187 XML_Parser XMLPARSEAPI XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
     185name is the concatenation of the namespace URI, the namespace
     186separator character, and the local part of the name.  If the namespace
     187separator is '\0' then the namespace URI and the local part will be
     188concatenated without any separator.  When a namespace is not declared,
     189the name and prefix will be passed through without expansion. */
     190
     191XMLPARSEAPI(XML_Parser)
     192XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
    188193
    189194
     
    198203*/
    199204
    200 XML_Parser XMLPARSEAPI XML_ParserCreate_MM(const XML_Char *encoding,
     205XMLPARSEAPI(XML_Parser)
     206XML_ParserCreate_MM(const XML_Char *encoding,
    201207            const XML_Memory_Handling_Suite *memsuite,
    202208            const XML_Char *namespaceSeparator);
     
    205211   names and values are 0 terminated. */
    206212
    207 typedef void (* EXPATENTRY XML_StartElementHandler)(void *userData,
    208                                                  const XML_Char *name,
    209                                                  const XML_Char **atts);
    210 
    211 typedef void (* EXPATENTRY XML_EndElementHandler)(void *userData,
    212                                                const XML_Char *name);
     213typedef void (*XML_StartElementHandler)(void *userData,
     214                                        const XML_Char *name,
     215                                        const XML_Char **atts);
     216
     217typedef void (*XML_EndElementHandler)(void *userData,
     218                                      const XML_Char *name);
    213219
    214220
    215221/* s is not 0 terminated. */
    216 typedef void (* EXPATENTRY XML_CharacterDataHandler)(void *userData,
    217                                                   const XML_Char *s,
    218                                                   int len);
     222typedef void (*XML_CharacterDataHandler)(void *userData,
     223                                         const XML_Char *s,
     224                                         int len);
    219225
    220226/* target and data are 0 terminated */
    221 typedef void (* EXPATENTRY XML_ProcessingInstructionHandler)(void *userData,
    222                                                           const XML_Char *target,
    223                                                           const XML_Char *data);
     227typedef void (*XML_ProcessingInstructionHandler)(void *userData,
     228                                                 const XML_Char *target,
     229                                                 const XML_Char *data);
    224230
    225231/* data is 0 terminated */
    226 typedef void (* EXPATENTRY XML_CommentHandler)(void *userData, const XML_Char *data);
    227 
    228 typedef void (* EXPATENTRY XML_StartCdataSectionHandler)(void *userData);
    229 typedef void (* EXPATENTRY XML_EndCdataSectionHandler)(void *userData);
     232typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
     233
     234typedef void (*XML_StartCdataSectionHandler)(void *userData);
     235typedef void (*XML_EndCdataSectionHandler)(void *userData);
    230236
    231237/* This is called for any characters in the XML document for
     
    242248multiple calls. */
    243249
    244 typedef void (* EXPATENTRY XML_DefaultHandler)(void *userData,
    245                                             const XML_Char *s,
    246                                             int len);
     250typedef void (*XML_DefaultHandler)(void *userData,
     251                                   const XML_Char *s,
     252                                   int len);
    247253
    248254/* This is called for the start of the DOCTYPE declaration, before
    249255   any DTD or internal subset is parsed. */
    250256
    251 typedef void (* EXPATENTRY XML_StartDoctypeDeclHandler)(void *userData,
    252                                                      const XML_Char *doctypeName,
    253                                                      const XML_Char *sysid,
    254                                                      const XML_Char *pubid,
    255                                                      int has_internal_subset);
     257typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
     258                                            const XML_Char *doctypeName,
     259                                            const XML_Char *sysid,
     260                                            const XML_Char *pubid,
     261                                            int has_internal_subset);
    256262
    257263/* This is called for the start of the DOCTYPE declaration when the
    258264closing > is encountered, but after processing any external subset. */
    259 typedef void (* EXPATENTRY XML_EndDoctypeDeclHandler)(void *userData);
     265typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
    260266
    261267/* This is called for entity declarations. The is_parameter_entity
     
    275281*/
    276282
    277 typedef void (* EXPATENTRY XML_EntityDeclHandler)(void *userData,
    278                                                const XML_Char *entityName,
    279                                                int is_parameter_entity,
    280                                                const XML_Char *value,
    281                                                int value_length,
    282                                                const XML_Char *base,
    283                                                const XML_Char *systemId,
    284                                                const XML_Char *publicId,
    285                                                const XML_Char *notationName);
    286 
    287 void XMLPARSEAPI XML_SetEntityDeclHandler(XML_Parser parser,
    288                                           XML_EntityDeclHandler handler);
     283typedef void (*XML_EntityDeclHandler) (void *userData,
     284                                       const XML_Char *entityName,
     285                                       int is_parameter_entity,
     286                                       const XML_Char *value,
     287                                       int value_length,
     288                                       const XML_Char *base,
     289                                       const XML_Char *systemId,
     290                                       const XML_Char *publicId,
     291                                       const XML_Char *notationName);
     292
     293XMLPARSEAPI(void)
     294XML_SetEntityDeclHandler(XML_Parser parser,
     295             XML_EntityDeclHandler handler);
    289296
    290297/* OBSOLETE -- OBSOLETE -- OBSOLETE
     
    296303The other arguments may be. */
    297304
    298 typedef void (* EXPATENTRY XML_UnparsedEntityDeclHandler)(void *userData,
    299                           const XML_Char *entityName,
    300                           const XML_Char *base,
    301                           const XML_Char *systemId,
    302                           const XML_Char *publicId,
    303                           const XML_Char *notationName);
     305typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
     306                                              const XML_Char *entityName,
     307                                              const XML_Char *base,
     308                                              const XML_Char *systemId,
     309                                              const XML_Char *publicId,
     310                                              const XML_Char *notationName);
    304311
    305312/* This is called for a declaration of notation.
     
    307314The notationName will never be null.  The other arguments can be. */
    308315
    309 typedef void (* EXPATENTRY XML_NotationDeclHandler)(void *userData,
    310                     const XML_Char *notationName,
    311                     const XML_Char *base,
    312                     const XML_Char *systemId,
    313                     const XML_Char *publicId);
     316typedef void (*XML_NotationDeclHandler)(void *userData,
     317                                        const XML_Char *notationName,
     318                                        const XML_Char *base,
     319                                        const XML_Char *systemId,
     320                                        const XML_Char *publicId);
    314321
    315322/* When namespace processing is enabled, these are called once for
     
    319326For an xmlns="" attribute, uri will be null. */
    320327
    321 typedef void (* EXPATENTRY XML_StartNamespaceDeclHandler)(void *userData,
    322                           const XML_Char *prefix,
    323                           const XML_Char *uri);
    324 
    325 typedef void (* EXPATENTRY XML_EndNamespaceDeclHandler)(void *userData,
    326                         const XML_Char *prefix);
     328typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
     329                                              const XML_Char *prefix,
     330                                              const XML_Char *uri);
     331
     332typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
     333                                            const XML_Char *prefix);
    327334
    328335/* This is called if the document is not standalone (it has an
     
    332339ERROR_EXPAT_NOT_STANDALONE error. */
    333340
    334 typedef int (* EXPATENTRY XML_NotStandaloneHandler)(void *userData);
     341typedef int (*XML_NotStandaloneHandler)(void *userData);
    335342
    336343/* This is called for a reference to an external parsed general entity.
     
    340347The parser argument is the parser parsing the entity containing the reference;
    341348it can be passed as the parser argument to XML_ExternalEntityParserCreate.
    342 The systemId argument is the system identifier as specified in the entity declaration;
    343 it will not be null.
     349The systemId argument is the system identifier as specified in the entity
     350declaration; it will not be null.
    344351The base argument is the system identifier that should be used as the base for
    345352resolving systemId if systemId was relative; this is set by XML_SetBase;
    346353it may be null.
    347 The publicId argument is the public identifier as specified in the entity declaration,
    348 or null if none was specified; the whitespace in the public identifier
    349 will have been normalized as required by the XML spec.
     354The publicId argument is the public identifier as specified in the entity
     355declaration, or null if none was specified; the whitespace in the public
     356identifier will have been normalized as required by the XML spec.
    350357The context argument specifies the parsing context in the format
    351358expected by the context argument to
     
    354361The handler should return 0 if processing should not continue because of
    355362a fatal error in the handling of the external entity.
    356 In this case the calling parser will return an ERROR_EXPAT_EXTERNAL_ENTITY_HANDLING
    357 error.
    358 Note that unlike other handlers the first argument is the parser, not userData. */
    359 
    360 typedef int (* EXPATENTRY XML_ExternalEntityRefHandler)(XML_Parser parser,
    361                         const XML_Char *context,
    362                         const XML_Char *base,
    363                         const XML_Char *systemId,
    364                         const XML_Char *publicId);
     363In this case the calling parser will return an
     364ERROR_EXPAT_EXTERNAL_ENTITY_HANDLING error.
     365Note that unlike other handlers the first argument is the parser, not
     366userData. */
     367
     368typedef int (*XML_ExternalEntityRefHandler)(void *userData,     // added V0.9.14 (2001-08-09) [umoeller]
     369                                            XML_Parser parser,
     370                                            const XML_Char *context,
     371                                            const XML_Char *base,
     372                                            const XML_Char *systemId,
     373                                            const XML_Char *publicId);
    365374
    366375/* This structure is filled in by the XML_UnknownEncodingHandler
     
    369378The map[b] member gives information about byte sequences
    370379whose first byte is b.
    371 If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c.
     380If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar
     381value c.
    372382If map[b] is -1, then the byte sequence is malformed.
    373383If map[b] is -n, where n >= 2, then b is the first byte of an n-byte
     
    3974072. No character may require more than 4 bytes to encode.
    398408
    399 3. All characters encoded must have Unicode scalar values <= 0xFFFF,
    400 (ie characters that would be encoded by surrogates in UTF-16
    401 are  not allowed).  Note that this restriction doesn't apply to
    402 the built-in support for UTF-8 and UTF-16.
     4093. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e.,
     410characters that would be encoded by surrogates in UTF-16 are  not
     411allowed).  Note that this restriction doesn't apply to the built-in
     412support for UTF-8 and UTF-16.
    403413
    4044144. No Unicode character may be encoded by more than one distinct sequence
    405415of bytes. */
    406416
    407 /*
    408  *@@ XML_Encoding:
    409  *      structure passed with the UnknownEncodingHandler (see
    410  *      XML_SetUnknownEncodingHandler).
    411  *
    412  *      The map array contains information for every possible
    413  *      possible leading byte in a byte sequence.
    414  *
    415  *      --  If the corresponding value is >= 0, then it's a single byte
    416  *          sequence and the byte encodes that Unicode value.
    417  *
    418  *      --  If the value is -1, then that byte is invalid as the
    419  *          initial byte in a sequence.
    420  *
    421  *      --  If the value is -2, -3, or -4, then the byte is the beginning
    422  *          of a 2, 3, or 4 byte sequence, respectively. The actual
    423  *          conversion is then accomplished by a call to the function
    424  *          pointed at by "convert". This function should return the
    425  *          Unicode scalar value for the sequence or -1 if the sequence
    426  *          is malformed.
    427  *
    428  *          The "convert" pointer may be null if there are only
    429  *          single byte codes. The data parameter passed to the
    430  *          convert function is the data pointer from
    431  *          XML_Encoding. The string s is NOT null terminated and
    432  *          points at the sequence of bytes to be converted.
    433  *
    434  *      The function pointed at by "release" is called by the parser
    435  *      when it is finished with the encoding. It may be null.
    436  */
    437 
    438 typedef struct _XML_Encoding
    439 {
    440   int           map[256];
    441   void          *data;
    442   int           (* EXPATENTRY convert)(void *data, const char *s);
    443   void          (* EXPATENTRY release)(void *data);
     417typedef struct {
     418  int map[256];
     419  void *data;
     420  int (*convert)(void *data, const char *s);
     421  void (*release)(void *data);
    444422} XML_Encoding;
    445423
    446 typedef int (* EXPATENTRY XML_UnknownEncodingHandler)(void *encodingHandlerData,
    447                                                       const XML_Char *name,
    448                                                       XML_Encoding *info);
    449 
    450 void XMLPARSEAPI XML_SetElementHandler(XML_Parser parser,
    451                                        XML_StartElementHandler start,
    452                                        XML_EndElementHandler end);
    453 
    454 void XMLPARSEAPI XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
    455 
    456 void XMLPARSEAPI XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
    457 
    458 void XMLPARSEAPI XML_SetCharacterDataHandler(XML_Parser parser,
    459                                              XML_CharacterDataHandler handler);
    460 
    461 void XMLPARSEAPI XML_SetProcessingInstructionHandler(XML_Parser parser,
    462                                                      XML_ProcessingInstructionHandler handler);
    463 void XMLPARSEAPI XML_SetCommentHandler(XML_Parser parser,
    464                                        XML_CommentHandler handler);
    465 
    466 void XMLPARSEAPI XML_SetCdataSectionHandler(XML_Parser parser,
    467                                             XML_StartCdataSectionHandler start,
    468                                             XML_EndCdataSectionHandler end);
    469 
    470 void XMLPARSEAPI XML_SetStartCdataSectionHandler(XML_Parser parser,
     424/* This is called for an encoding that is unknown to the parser.
     425The encodingHandlerData argument is that which was passed as the
     426second argument to XML_SetUnknownEncodingHandler.
     427The name argument gives the name of the encoding as specified in
     428the encoding declaration.
     429If the callback can provide information about the encoding,
     430it must fill in the XML_Encoding structure, and return 1.
     431Otherwise it must return 0.
     432If info does not describe a suitable encoding,
     433then the parser will return an XML_UNKNOWN_ENCODING error. */
     434
     435typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
     436                                          const XML_Char *name,
     437                                          XML_Encoding *info);
     438
     439XMLPARSEAPI(void)
     440XML_SetElementHandler(XML_Parser parser,
     441              XML_StartElementHandler start,
     442              XML_EndElementHandler end);
     443
     444XMLPARSEAPI(void)
     445XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
     446
     447XMLPARSEAPI(void)
     448XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
     449
     450XMLPARSEAPI(void)
     451XML_SetCharacterDataHandler(XML_Parser parser,
     452                XML_CharacterDataHandler handler);
     453
     454XMLPARSEAPI(void)
     455XML_SetProcessingInstructionHandler(XML_Parser parser,
     456                    XML_ProcessingInstructionHandler handler);
     457XMLPARSEAPI(void)
     458XML_SetCommentHandler(XML_Parser parser,
     459                      XML_CommentHandler handler);
     460
     461XMLPARSEAPI(void)
     462XML_SetCdataSectionHandler(XML_Parser parser,
     463               XML_StartCdataSectionHandler start,
     464               XML_EndCdataSectionHandler end);
     465
     466XMLPARSEAPI(void)
     467XML_SetStartCdataSectionHandler(XML_Parser parser,
    471468                                XML_StartCdataSectionHandler start);
    472469
    473 void XMLPARSEAPI XML_SetEndCdataSectionHandler(XML_Parser parser,
     470XMLPARSEAPI(void)
     471XML_SetEndCdataSectionHandler(XML_Parser parser,
    474472                              XML_EndCdataSectionHandler end);
    475473
    476 /* This sets the default handler and also inhibits expansion of internal entities.
    477 The entity reference will be passed to the default handler. */
    478 
    479 void XMLPARSEAPI XML_SetDefaultHandler(XML_Parser parser,
     474/* This sets the default handler and also inhibits expansion of
     475internal entities.  The entity reference will be passed to the default
     476handler. */
     477
     478XMLPARSEAPI(void)
     479XML_SetDefaultHandler(XML_Parser parser,
    480480              XML_DefaultHandler handler);
    481481
    482 /* This sets the default handler but does not inhibit expansion of internal entities.
    483 The entity reference will not be passed to the default handler. */
    484 
    485 void XMLPARSEAPI XML_SetDefaultHandlerExpand(XML_Parser parser,
     482/* This sets the default handler but does not inhibit expansion of
     483internal entities.  The entity reference will not be passed to the
     484default handler. */
     485
     486XMLPARSEAPI(void)
     487XML_SetDefaultHandlerExpand(XML_Parser parser,
    486488                    XML_DefaultHandler handler);
    487489
    488 void XMLPARSEAPI XML_SetDoctypeDeclHandler(XML_Parser parser,
     490XMLPARSEAPI(void)
     491XML_SetDoctypeDeclHandler(XML_Parser parser,
    489492              XML_StartDoctypeDeclHandler start,
    490493              XML_EndDoctypeDeclHandler end);
    491494
    492 void XMLPARSEAPI XML_SetStartDoctypeDeclHandler(XML_Parser parser,
     495XMLPARSEAPI(void)
     496XML_SetStartDoctypeDeclHandler(XML_Parser parser,
    493497                   XML_StartDoctypeDeclHandler start);
    494498
    495 void XMLPARSEAPI XML_SetEndDoctypeDeclHandler(XML_Parser parser,
     499XMLPARSEAPI(void)
     500XML_SetEndDoctypeDeclHandler(XML_Parser parser,
    496501                 XML_EndDoctypeDeclHandler end);
    497502
    498 void XMLPARSEAPI XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
     503XMLPARSEAPI(void)
     504XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
    499505                 XML_UnparsedEntityDeclHandler handler);
    500506
    501 void XMLPARSEAPI XML_SetNotationDeclHandler(XML_Parser parser,
     507XMLPARSEAPI(void)
     508XML_SetNotationDeclHandler(XML_Parser parser,
    502509               XML_NotationDeclHandler handler);
    503510
    504 void XMLPARSEAPI XML_SetNamespaceDeclHandler(XML_Parser parser,
     511XMLPARSEAPI(void)
     512XML_SetNamespaceDeclHandler(XML_Parser parser,
    505513                XML_StartNamespaceDeclHandler start,
    506514                XML_EndNamespaceDeclHandler end);
    507515
    508 void XMLPARSEAPI XML_SetStartNamespaceDeclHandler(XML_Parser parser,
     516XMLPARSEAPI(void)
     517XML_SetStartNamespaceDeclHandler(XML_Parser parser,
    509518                 XML_StartNamespaceDeclHandler start);
    510519
    511 void XMLPARSEAPI XML_SetEndNamespaceDeclHandler(XML_Parser parser,
     520XMLPARSEAPI(void)
     521XML_SetEndNamespaceDeclHandler(XML_Parser parser,
    512522                   XML_EndNamespaceDeclHandler end);
    513523
    514 void XMLPARSEAPI XML_SetNotStandaloneHandler(XML_Parser parser,
     524XMLPARSEAPI(void)
     525XML_SetNotStandaloneHandler(XML_Parser parser,
    515526                XML_NotStandaloneHandler handler);
    516527
    517 void XMLPARSEAPI XML_SetExternalEntityRefHandler(XML_Parser parser,
     528XMLPARSEAPI(void)
     529XML_SetExternalEntityRefHandler(XML_Parser parser,
    518530                XML_ExternalEntityRefHandler handler);
    519531
     
    521533as the first argument to the external entity ref handler instead
    522534of the parser object. */
    523 void XMLPARSEAPI XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
    524 
    525 void XMLPARSEAPI XML_SetUnknownEncodingHandler(XML_Parser parser,
     535XMLPARSEAPI(void)
     536XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
     537
     538XMLPARSEAPI(void)
     539XML_SetUnknownEncodingHandler(XML_Parser parser,
    526540                  XML_UnknownEncodingHandler handler,
    527541                  void *encodingHandlerData);
     
    530544processing instruction or character data.  It causes the corresponding
    531545markup to be passed to the default handler. */
    532 void  XML_DefaultCurrent(XML_Parser parser);
     546XMLPARSEAPI(void)
     547XML_DefaultCurrent(XML_Parser parser);
    533548
    534549/* If do_nst is non-zero, and namespace processing is in effect, and
     
    543558*/
    544559
    545 void XMLPARSEAPI XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
     560XMLPARSEAPI(void)
     561XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
    546562
    547563/* This value is passed as the userData argument to callbacks. */
    548 void XMLPARSEAPI XML_SetUserData(XML_Parser parser, void *userData);
     564XMLPARSEAPI(void)
     565XML_SetUserData(XML_Parser parser, void *userData);
    549566
    550567/* Returns the last value set by XML_SetUserData or null. */
     
    555572or XML_ParseBuffer. */
    556573
    557 int XMLPARSEAPI XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
     574XMLPARSEAPI(int)
     575XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
    558576
    559577/* If this function is called, then the parser will be passed
     
    561579The userData will still be accessible using XML_GetUserData. */
    562580
    563 void XMLPARSEAPI XML_UseParserAsHandlerArg(XML_Parser parser);
    564 
    565 /* Sets the base to be used for resolving relative URIs in system identifiers in
    566 declarations.  Resolving relative identifiers is left to the application:
    567 this value will be passed through as the base argument to the
    568 XML_ExternalEntityRefHandler, XML_NotationDeclHandler
     581XMLPARSEAPI(void)
     582XML_UseParserAsHandlerArg(XML_Parser parser);
     583
     584/* Sets the base to be used for resolving relative URIs in system
     585identifiers in declarations.  Resolving relative identifiers is left
     586to the application: this value will be passed through as the base
     587argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler
    569588and XML_UnparsedEntityDeclHandler. The base argument will be copied.
    570589Returns zero if out of memory, non-zero otherwise. */
    571590
    572 int XMLPARSEAPI XML_SetBase(XML_Parser parser, const XML_Char *base);
    573 
    574 const XML_Char  XMLPARSEAPI * XML_GetBase(XML_Parser parser);
     591XMLPARSEAPI(int)
     592XML_SetBase(XML_Parser parser, const XML_Char *base);
     593
     594XMLPARSEAPI(const XML_Char *)
     595XML_GetBase(XML_Parser parser);
    575596
    576597/* Returns the number of the attribute/value pairs passed in last call
     
    580601XML_StartElementHandler. */
    581602
    582 int XMLPARSEAPI XML_GetSpecifiedAttributeCount(XML_Parser parser);
     603XMLPARSEAPI(int)
     604XML_GetSpecifiedAttributeCount(XML_Parser parser);
    583605
    584606/* Returns the index of the ID attribute passed in the last call to
     
    587609into the atts array passed to the XML_StartElementHandler. */
    588610
    589 int XMLPARSEAPI XML_GetIdAttributeIndex(XML_Parser parser);
     611XMLPARSEAPI(int)
     612XML_GetIdAttributeIndex(XML_Parser parser);
    590613
    591614/* Parses some input. Returns 0 if a fatal error is detected.
    592615The last call to XML_Parse must have isFinal true;
    593616len may be zero for this call (or any other). */
    594 int XMLPARSEAPI XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
    595 
    596 void XMLPARSEAPI * XML_GetBuffer(XML_Parser parser, int len);
    597 
    598 int XMLPARSEAPI XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
    599 
    600 /* Creates an XML_Parser object that can parse an external general entity;
    601 context is a '\0'-terminated string specifying the parse context;
    602 encoding is a '\0'-terminated string giving the name of the externally specified encoding,
    603 or null if there is no externally specified encoding.
    604 The context string consists of a sequence of tokens separated by formfeeds (\f);
    605 a token consisting of a name specifies that the general entity of the name
    606 is open; a token of the form prefix=uri specifies the namespace for a particular
    607 prefix; a token of the form =uri specifies the default namespace.
    608 This can be called at any point after the first call to an ExternalEntityRefHandler
    609 so longer as the parser has not yet been freed.
    610 The new parser is completely independent and may safely be used in a separate thread.
    611 The handlers and userData are initialized from the parser argument.
    612 Returns 0 if out of memory.  Otherwise returns a new XML_Parser object. */
    613 XML_Parser XMLPARSEAPI XML_ExternalEntityParserCreate(XML_Parser parser,
     617XMLPARSEAPI(int)
     618XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
     619
     620XMLPARSEAPI(void *)
     621XML_GetBuffer(XML_Parser parser, int len);
     622
     623XMLPARSEAPI(int)
     624XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
     625
     626/* Creates an XML_Parser object that can parse an external general
     627entity; context is a '\0'-terminated string specifying the parse
     628context; encoding is a '\0'-terminated string giving the name of the
     629externally specified encoding, or null if there is no externally
     630specified encoding.  The context string consists of a sequence of
     631tokens separated by formfeeds (\f); a token consisting of a name
     632specifies that the general entity of the name is open; a token of the
     633form prefix=uri specifies the namespace for a particular prefix; a
     634token of the form =uri specifies the default namespace.  This can be
     635called at any point after the first call to an
     636ExternalEntityRefHandler so longer as the parser has not yet been
     637freed.  The new parser is completely independent and may safely be
     638used in a separate thread.  The handlers and userData are initialized
     639from the parser argument.  Returns 0 if out of memory.  Otherwise
     640returns a new XML_Parser object. */
     641XMLPARSEAPI(XML_Parser)
     642XML_ExternalEntityParserCreate(XML_Parser parser,
    614643                   const XML_Char *context,
    615644                   const XML_Char *encoding);
     
    621650};
    622651
    623 int XMLPARSEAPI XML_SetParamEntityParsing(XML_Parser parser,
    624                                           enum XML_ParamEntityParsing parsing);
     652/* Controls parsing of parameter entities (including the external DTD
     653subset). If parsing of parameter entities is enabled, then references
     654to external parameter entities (including the external DTD subset)
     655will be passed to the handler set with
     656XML_SetExternalEntityRefHandler.  The context passed will be 0.
     657Unlike external general entities, external parameter entities can only
     658be parsed synchronously.  If the external parameter entity is to be
     659parsed, it must be parsed during the call to the external entity ref
     660handler: the complete sequence of XML_ExternalEntityParserCreate,
     661XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during
     662this call.  After XML_ExternalEntityParserCreate has been called to
     663create the parser for the external parameter entity (context must be 0
     664for this call), it is illegal to make any calls on the old parser
     665until XML_ParserFree has been called on the newly created parser.  If
     666the library has been compiled without support for parameter entity
     667parsing (ie without XML_DTD being defined), then
     668XML_SetParamEntityParsing will return 0 if parsing of parameter
     669entities is requested; otherwise it will return non-zero. */
     670
     671XMLPARSEAPI(int)
     672XML_SetParamEntityParsing(XML_Parser parser,
     673              enum XML_ParamEntityParsing parsing);
     674
     675/* XMLERROR {
     676    ERROR_EXPAT_NONE,
     677    ERROR_EXPAT_NO_MEMORY,
     678    ERROR_EXPAT_SYNTAX,
     679    ERROR_EXPAT_NO_ELEMENTS,
     680    ERROR_EXPAT_INVALID_TOKEN,
     681    ERROR_EXPAT_UNCLOSED_TOKEN,
     682    ERROR_EXPAT_PARTIAL_CHAR,
     683    ERROR_EXPAT_TAG_MISMATCH,
     684    ERROR_EXPAT_DUPLICATE_ATTRIBUTE,
     685    ERROR_EXPAT_JUNK_AFTER_DOC_ELEMENT,
     686    ERROR_EXPAT_PARAM_ENTITY_REF,
     687    ERROR_EXPAT_UNDEFINED_ENTITY,
     688    ERROR_EXPAT_RECURSIVE_ENTITY_REF,
     689    ERROR_EXPAT_ASYNC_ENTITY,
     690    ERROR_EXPAT_BAD_CHAR_REF,
     691    ERROR_EXPAT_BINARY_ENTITY_REF,
     692    ERROR_EXPAT_ATTRIBUTE_EXTERNAL_ENTITY_REF,
     693    ERROR_EXPAT_MISPLACED_XML_PI,
     694    ERROR_EXPAT_UNKNOWN_ENCODING,
     695    ERROR_EXPAT_INCORRECT_ENCODING,
     696    ERROR_EXPAT_UNCLOSED_CDATA_SECTION,
     697    ERROR_EXPAT_EXTERNAL_ENTITY_HANDLING,
     698    ERROR_EXPAT_NOT_STANDALONE,
     699    ERROR_EXPAT_UNEXPECTED_STATE
     700}; */
    625701
    626702#define ERROR_XML_FIRST         40000   // first error code used
     
    656732returns information about the error. */
    657733
    658 XMLERROR  XMLPARSEAPI XML_GetErrorCode(XML_Parser parser);
     734XMLPARSEAPI(XMLERROR)
     735XML_GetErrorCode(XML_Parser parser);
    659736
    660737/* These functions return information about the current parse location.
     
    666743of the sequence of characters that generated the event. */
    667744
    668 int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser);
    669 int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser);
    670 long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser);
     745XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
     746XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
     747XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
    671748
    672749/* Return the number of bytes in the current event.
    673750Returns 0 if the event is in an internal entity. */
    674751
    675 int XMLPARSEAPI XML_GetCurrentByteCount(XML_Parser parser);
     752XMLPARSEAPI(int)
     753XML_GetCurrentByteCount(XML_Parser parser);
    676754
    677755/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
     
    679757   of the current parse position, and sets the integer pointed to by size
    680758   to the size of this buffer (the number of input bytes). Otherwise
    681    returns a null pointer. Also returns a null pointer if a parse isn't active.
     759   returns a null pointer. Also returns a null pointer if a parse isn't
     760   active.
    682761
    683762   NOTE: The character pointer returned should not be used outside
    684763   the handler that makes the call. */
    685764
    686 const char XMLPARSEAPI * XML_GetInputContext(XML_Parser parser,
     765XMLPARSEAPI(const char *)
     766XML_GetInputContext(XML_Parser parser,
    687767            int *offset,
    688768            int *size);
     
    694774
    695775/* Frees memory used by the parser. */
    696 void XMLPARSEAPI XML_ParserFree(XML_Parser parser);
     776XMLPARSEAPI(void)
     777XML_ParserFree(XML_Parser parser);
    697778
    698779/* Returns a string describing the error. */
    699 // const XML_LChar XMLPARSEAPI * XML_ErrorString(int code);
    700         // moved this to xml.c V0.9.9 (2001-02-16) [umoeller]
     780XMLPARSEAPI(const XML_LChar *)
     781XML_ErrorString(int code);
    701782
    702783/* Return a string containing the version number of this expat */
    703 const XML_LChar XMLPARSEAPI *XML_ExpatVersion(void);
     784XMLPARSEAPI(const XML_LChar *)
     785XML_ExpatVersion(void);
     786
     787typedef struct {
     788  int major;
     789  int minor;
     790  int micro;
     791} XML_Expat_Version;
     792
     793/* Return an XML_Expat_Version structure containing numeric version
     794   number information for this version of expat */
     795
     796XMLPARSEAPI(XML_Expat_Version)
     797XML_ExpatVersionInfo(void);
     798
     799#define XML_MAJOR_VERSION @EXPAT_MAJOR_VERSION@
     800#define XML_MINOR_VERSION @EXPAT_MINOR_VERSION@
     801#define XML_MICRO_VERSION @EXPAT_EDIT@
    704802
    705803#ifdef __cplusplus
  • trunk/include/expat/expat_setup.h

    r38 r97  
    2020
    2121    #define XML_DTD 1
     22    #define XML_BYTE_ORDER 12
     23    #define XML_CONTEXT_BYTES 1024
    2224
    2325#endif
  • trunk/include/expat/xmlrole.h

    r38 r97  
    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
    128
    139#include "expat\xmltok.h"
     
    7874
    7975typedef struct prolog_state {
    80   int (* EXPATENTRY handler)(struct prolog_state *state,
    81                            int tok,
    82                            const char *ptr,
    83                            const char *end,
    84                            const ENCODING *enc);
     76  int (*handler)(struct prolog_state *state,
     77             int tok,
     78         const char *ptr,
     79         const char *end,
     80         const ENCODING *enc);
    8581  unsigned level;
    8682#ifdef XML_DTD
  • trunk/include/expat/xmltok.h

    r38 r97  
    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
    128
    139#ifdef __cplusplus
     
    2117#define XML_TOK_NONE -4    /* The string to be scanned is empty */
    2218#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
    23                                   might be part of CRLF sequence */
     19                                  might be part of CRLF sequence */ 
    2420#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
    2521#define XML_TOK_PARTIAL -1 /* only part of a token */
     
    116112} POSITION;
    117113
    118 typedef struct
    119 {
    120      const char *name;
    121      const char *valuePtr;
    122      const char *valueEnd;
    123      char normalized;
    124 } ATTRIBUTE, *PATTRIBUTE;
     114typedef struct {
     115  const char *name;
     116  const char *valuePtr;
     117  const char *valueEnd;
     118  char normalized;
     119} ATTRIBUTE;
    125120
    126121struct encoding;
    127 typedef struct encoding ENCODING, *PENCODING;
    128 
    129 typedef int EXPATENTRY SCANNERFUNC(const ENCODING *,
    130                                    const char *,
    131                                    const char *,
    132                                    const char **);
    133 typedef SCANNERFUNC *PSCANNERFUNC;
    134 
    135 struct encoding
    136 {
    137   PSCANNERFUNC      scanners[XML_N_STATES];
    138   PSCANNERFUNC      literalScanners[XML_N_LITERAL_TYPES];
    139   int (* EXPATENTRY sameName)(const ENCODING *,
    140                   const char *,
    141                   const char *);
    142   int (* EXPATENTRY nameMatchesAscii)(const ENCODING *,
    143                           const char *,
    144                           const char *,
    145                           const char *);
    146   int (* EXPATENTRY nameLength)(const ENCODING *,
    147                     const char *);
    148   const char *(*skipS)(const ENCODING *,
    149                        const char *);
    150   int (* EXPATENTRY getAtts)(const ENCODING *enc,
    151                  const char *ptr,
    152                  int attsMax,
    153                  ATTRIBUTE *atts);
    154   int (* EXPATENTRY charRefNumber)(const ENCODING *enc,
    155                        const char *ptr);
    156   int (* EXPATENTRY predefinedEntityName)(const ENCODING *,
    157                               const char *,
    158                               const char *);
    159   void (* EXPATENTRY updatePosition)(const ENCODING *,
    160                                      const char *ptr,
    161                                      const char *end,
    162                                      POSITION *);
    163   int (* EXPATENTRY isPublicId)(const ENCODING *enc,
    164                     const char *ptr,
    165                     const char *end,
    166                     const char **badPtr);
    167   void (* EXPATENTRY utf8Convert)(const ENCODING *enc,
    168                       const char **fromP,
    169                       const char *fromLim,
    170                       char **toP,
    171                       const char *toLim);
    172   void (* EXPATENTRY utf16Convert)(const ENCODING *enc,
    173                        const char **fromP,
    174                        const char *fromLim,
    175                        unsigned short **toP,
    176                        const unsigned short *toLim);
     122typedef struct encoding ENCODING;
     123
     124struct 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);
    177159  int minBytesPerChar;
    178160  char isUtf8;
     
    221203
    222204/* This is used for performing a 2nd-level tokenization on
    223 the content of a literal that has already been returned by XmlTok. */
     205the content of a literal that has already been returned by XmlTok. */ 
    224206
    225207#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
     
    270252
    271253int  XmlParseXmlDecl(int isGeneralTextEntity,
    272                   const ENCODING *enc,
    273                   const char *ptr,
    274                   const char *end,
    275                   const char **badPtr,
    276                   const char **versionPtr,
    277                   const char **versionEndPtr,
    278                   const char **encodingNamePtr,
    279                   const ENCODING **namedEncodingPtr,
    280                   int *standalonePtr);
     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);
    281263
    282264int  XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
     
    289271ENCODING  *
    290272XmlInitUnknownEncoding(void *mem,
    291                int *table,
    292                int (*conv)(void *userData, const char *p),
    293                void *userData);
     273                       int *table,
     274                       int (*conv)(void *userData, const char *p),
     275                       void *userData);
    294276
    295277int  XmlParseXmlDeclNS(int isGeneralTextEntity,
    296                     const ENCODING *enc,
    297                     const char *ptr,
    298                     const char *end,
    299                     const char **badPtr,
    300                     const char **versionPtr,
    301                 const char **versionEndPtr,
    302                     const char **encodingNamePtr,
    303                     const ENCODING **namedEncodingPtr,
    304                     int *standalonePtr);
     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);
    305287int  XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
    306288const ENCODING  *XmlGetUtf8InternalEncodingNS(void);
     
    308290ENCODING  *
    309291XmlInitUnknownEncodingNS(void *mem,
    310                  int *table,
    311                  int (*conv)(void *userData, const char *p),
    312                  void *userData);
     292                         int *table,
     293                         int (*conv)(void *userData, const char *p),
     294                         void *userData);
    313295#ifdef __cplusplus
    314296}
  • trunk/include/helpers/xml.h

    r84 r97  
    8585    #define ERROR_DOM_DUPLICATE_ATTRIBUTE (ERROR_XML_FIRST + 43)
    8686
    87         // @@@todo these
    8887    #define ERROR_DOM_VALIDATE_INVALID_ELEMENT (ERROR_XML_FIRST + 44)
    8988    #define ERROR_DOM_ELEMENT_DECL_OUTSIDE_DOCTYPE (ERROR_XML_FIRST + 45)
    9089    #define ERROR_DOM_ATTLIST_DECL_OUTSIDE_DOCTYPE (ERROR_XML_FIRST + 46)
     90
     91    #define ERROR_DOM_INCOMPLETE_ENCODING_MAP (ERROR_XML_FIRST + 47)
     92                // callback to UnknownEncodingHandler has provided
     93                // an incomplete encoding map V0.9.14 (2001-08-09) [umoeller]
     94
     95    #define ERROR_DOM_INVALID_EXTERNAL_HANDLER (ERROR_XML_FIRST + 48)
    9196
    9297    const char* xmlDescribeError(int code);
     
    619624     ********************************************************************/
    620625
     626    typedef struct _XMLDOM *PXMLDOM;
     627
     628    typedef int APIENTRY FNGETCPDATA(PXMLDOM pDom, ULONG ulCP, int *piMap);
     629    typedef FNGETCPDATA *PFNGETCPDATA;
     630
     631    typedef APIRET APIENTRY FNEXTERNALHANDLER(PXMLDOM pDom,
     632                                              XML_Parser *pSubParser,
     633                                              const char *pcszSystemID,
     634                                              const char *pcszPublicID);
     635    typedef FNEXTERNALHANDLER *PFNEXTERNALHANDLER;
     636
    621637    /*
    622638     *@@ XMLDOM:
     
    638654                        // != NULL only if the document has a DOCTYPE
    639655
    640         APIRET          arcDOM;         // validation errors etc.
    641         BOOL            fInvalid;       // TRUE after validation failed
    642 
    643         const char      *pcszErrorDescription;
    644         ULONG           ulErrorLine;
    645         ULONG           ulErrorColumn;
    646         PXSTRING        pxstrFailingNode; // element or attribute name
     656        // error handling
     657        APIRET          arcDOM;         // validation errors etc.;
     658                                        // if != 0, this has a detailed
     659                                        // expat or DOM error code
     660        BOOL            fInvalid;       // TRUE if validation failed
     661                                        // (parser error otherwise)
     662
     663        const char      *pcszErrorDescription;  // error description
     664        PXSTRING        pxstrSystemID;      // system ID of external entity
     665                                            // where error occured, or NULL
     666                                            // if in main document
     667        ULONG           ulErrorLine;        // line where error occured
     668        ULONG           ulErrorColumn;      // column where error occured
     669        PXSTRING        pxstrFailingNode;   // element or attribute name
     670                                            // or NULL
    647671
    648672        /*
     
    650674         */
    651675
     676        // params copied from xmlCreateDOM
     677        ULONG           flParserFlags;
     678        PFNGETCPDATA    pfnGetCPData;
     679        PFNEXTERNALHANDLER pfnExternalHandler;
     680        PVOID           pvCallbackUser;
     681
    652682        XML_Parser      pParser;
    653683                            // expat parser instance
     
    662692                            // cache for attribute declarations according
    663693                            // to attdecl element name
    664     } XMLDOM, *PXMLDOM;
     694    } XMLDOM;
    665695
    666696    #define DF_PARSECOMMENTS        0x0001
    667697    #define DF_PARSEDTD             0x0002
    668698    #define DF_FAIL_IF_NO_DTD       0x0004
     699    #define DF_DROP_WHITESPACE      0x0008
    669700
    670701    APIRET xmlCreateDOM(ULONG flParserFlags,
     702                        PFNGETCPDATA pfnGetCPData,
     703                        PFNEXTERNALHANDLER pfnExternalHandler,
     704                        PVOID pvCallbackUser,
    671705                        PXMLDOM *ppDom);
    672706
Note: See TracChangeset for help on using the changeset viewer.