blob: 5322bea77e31e6fc3e327b1e841e5b6c0ee23c8f [file] [log] [blame]
Martin v. Löwisfc03a942003-01-25 22:41:29 +00001/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
2 See the file COPYING for copying permission.
Martin v. Löwisb48d1982002-02-12 09:52:22 +00003*/
4
5#ifndef XmlParse_INCLUDED
6#define XmlParse_INCLUDED 1
7
Martin v. Löwisfc03a942003-01-25 22:41:29 +00008#ifdef __VMS
9/* 0 1 2 3 0 1 2 3
10 1234567890123456789012345678901 1234567890123456789012345678901 */
11#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler
12#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler
13#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler
14#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg
15#endif
16
Martin v. Löwisb48d1982002-02-12 09:52:22 +000017#include <stdlib.h>
18
19#ifndef XMLPARSEAPI
Martin v. Löwisfc03a942003-01-25 22:41:29 +000020#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
21#ifdef XML_STATIC
22#define XMLPARSEAPI(type) type __cdecl
23#else
24#define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl
25#endif
26#else
27#define XMLPARSEAPI(type) type
28#endif
Martin v. Löwisb48d1982002-02-12 09:52:22 +000029#endif /* not defined XMLPARSEAPI */
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
Martin v. Löwisfc03a942003-01-25 22:41:29 +000035#ifdef XML_UNICODE_WCHAR_T
36#define XML_UNICODE
37#endif
Martin v. Löwisb48d1982002-02-12 09:52:22 +000038
Martin v. Löwisfc03a942003-01-25 22:41:29 +000039struct XML_ParserStruct;
40typedef struct XML_ParserStruct *XML_Parser;
41
42#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
43#ifdef XML_UNICODE_WCHAR_T
44typedef wchar_t XML_Char;
45typedef wchar_t XML_LChar;
46#else
47typedef unsigned short XML_Char;
48typedef char XML_LChar;
49#endif /* XML_UNICODE_WCHAR_T */
50#else /* Information is UTF-8 encoded. */
Martin v. Löwisb48d1982002-02-12 09:52:22 +000051typedef char XML_Char;
52typedef char XML_LChar;
Martin v. Löwisfc03a942003-01-25 22:41:29 +000053#endif /* XML_UNICODE */
54
55/* Should this be defined using stdbool.h when C99 is available? */
56typedef unsigned char XML_Bool;
57#define XML_TRUE ((XML_Bool) 1)
58#define XML_FALSE ((XML_Bool) 0)
59
Fred Drakedab8b0a2003-02-07 02:15:56 +000060/* The XML_Status enum gives the possible return values for several
61 API functions. The preprocessor #defines are included so this
62 stanza can be added to code that still needs to support older
63 versions of Expat 1.95.x:
64
65 #ifndef XML_STATUS_OK
66 #define XML_STATUS_OK 1
67 #define XML_STATUS_ERROR 0
68 #endif
69
70 Otherwise, the #define hackery is quite ugly and would have been
71 dropped.
72*/
73enum XML_Status {
74 XML_STATUS_ERROR = 0,
75#define XML_STATUS_ERROR XML_STATUS_ERROR
76 XML_STATUS_OK = 1
77#define XML_STATUS_OK XML_STATUS_OK
78};
79
Martin v. Löwisfc03a942003-01-25 22:41:29 +000080enum XML_Error {
81 XML_ERROR_NONE,
82 XML_ERROR_NO_MEMORY,
83 XML_ERROR_SYNTAX,
84 XML_ERROR_NO_ELEMENTS,
85 XML_ERROR_INVALID_TOKEN,
86 XML_ERROR_UNCLOSED_TOKEN,
87 XML_ERROR_PARTIAL_CHAR,
88 XML_ERROR_TAG_MISMATCH,
89 XML_ERROR_DUPLICATE_ATTRIBUTE,
90 XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
91 XML_ERROR_PARAM_ENTITY_REF,
92 XML_ERROR_UNDEFINED_ENTITY,
93 XML_ERROR_RECURSIVE_ENTITY_REF,
94 XML_ERROR_ASYNC_ENTITY,
95 XML_ERROR_BAD_CHAR_REF,
96 XML_ERROR_BINARY_ENTITY_REF,
97 XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
98 XML_ERROR_MISPLACED_XML_PI,
99 XML_ERROR_UNKNOWN_ENCODING,
100 XML_ERROR_INCORRECT_ENCODING,
101 XML_ERROR_UNCLOSED_CDATA_SECTION,
102 XML_ERROR_EXTERNAL_ENTITY_HANDLING,
103 XML_ERROR_NOT_STANDALONE,
104 XML_ERROR_UNEXPECTED_STATE,
105 XML_ERROR_ENTITY_DECLARED_IN_PE,
106 XML_ERROR_FEATURE_REQUIRES_XML_DTD,
107 XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
108};
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000109
110enum XML_Content_Type {
111 XML_CTYPE_EMPTY = 1,
112 XML_CTYPE_ANY,
113 XML_CTYPE_MIXED,
114 XML_CTYPE_NAME,
115 XML_CTYPE_CHOICE,
116 XML_CTYPE_SEQ
117};
118
119enum XML_Content_Quant {
120 XML_CQUANT_NONE,
121 XML_CQUANT_OPT,
122 XML_CQUANT_REP,
123 XML_CQUANT_PLUS
124};
125
126/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
127 XML_CQUANT_NONE, and the other fields will be zero or NULL.
128 If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
129 numchildren will contain number of elements that may be mixed in
130 and children point to an array of XML_Content cells that will be
131 all of XML_CTYPE_NAME type with no quantification.
132
133 If type == XML_CTYPE_NAME, then the name points to the name, and
134 the numchildren field will be zero and children will be NULL. The
135 quant fields indicates any quantifiers placed on the name.
136
137 CHOICE and SEQ will have name NULL, the number of children in
138 numchildren and children will point, recursively, to an array
139 of XML_Content cells.
140
141 The EMPTY, ANY, and MIXED types will only occur at top level.
142*/
143
144typedef struct XML_cp XML_Content;
145
146struct XML_cp {
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000147 enum XML_Content_Type type;
148 enum XML_Content_Quant quant;
149 XML_Char * name;
150 unsigned int numchildren;
151 XML_Content * children;
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000152};
153
154
155/* This is called for an element declaration. See above for
156 description of the model argument. It's the caller's responsibility
157 to free model when finished with it.
158*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000159typedef void (*XML_ElementDeclHandler) (void *userData,
160 const XML_Char *name,
161 XML_Content *model);
162
163XMLPARSEAPI(void)
164XML_SetElementDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000165 XML_ElementDeclHandler eldecl);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000166
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000167/* The Attlist declaration handler is called for *each* attribute. So
168 a single Attlist declaration with multiple attributes declared will
169 generate multiple calls to this handler. The "default" parameter
170 may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
171 keyword. The "isrequired" parameter will be true and the default
172 value will be NULL in the case of "#REQUIRED". If "isrequired" is
173 true and default is non-NULL, then this is a "#FIXED" default.
174*/
175typedef void (*XML_AttlistDeclHandler) (void *userData,
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000176 const XML_Char *elname,
177 const XML_Char *attname,
178 const XML_Char *att_type,
179 const XML_Char *dflt,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000180 int isrequired);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000181
182XMLPARSEAPI(void)
183XML_SetAttlistDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000184 XML_AttlistDeclHandler attdecl);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000185
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000186/* The XML declaration handler is called for *both* XML declarations
187 and text declarations. The way to distinguish is that the version
188 parameter will be NULL for text declarations. The encoding
189 parameter may be NULL for XML declarations. The standalone
190 parameter will be -1, 0, or 1 indicating respectively that there
191 was no standalone parameter in the declaration, that it was given
192 as no, or that it was given as yes.
193*/
194typedef void (*XML_XmlDeclHandler) (void *userData,
195 const XML_Char *version,
196 const XML_Char *encoding,
197 int standalone);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000198
199XMLPARSEAPI(void)
200XML_SetXmlDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000201 XML_XmlDeclHandler xmldecl);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000202
203
204typedef struct {
205 void *(*malloc_fcn)(size_t size);
206 void *(*realloc_fcn)(void *ptr, size_t size);
207 void (*free_fcn)(void *ptr);
208} XML_Memory_Handling_Suite;
209
210/* Constructs a new parser; encoding is the encoding specified by the
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000211 external protocol or NULL if there is none specified.
212*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000213XMLPARSEAPI(XML_Parser)
214XML_ParserCreate(const XML_Char *encoding);
215
216/* Constructs a new parser and namespace processor. Element type
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000217 names and attribute names that belong to a namespace will be
218 expanded; unprefixed attribute names are never expanded; unprefixed
219 element type names are expanded only if there is a default
220 namespace. The expanded name is the concatenation of the namespace
221 URI, the namespace separator character, and the local part of the
222 name. If the namespace separator is '\0' then the namespace URI
223 and the local part will be concatenated without any separator.
224 When a namespace is not declared, the name and prefix will be
225 passed through without expansion.
226*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000227XMLPARSEAPI(XML_Parser)
228XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
229
230
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000231/* Constructs a new parser using the memory management suite referred to
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000232 by memsuite. If memsuite is NULL, then use the standard library memory
233 suite. If namespaceSeparator is non-NULL it creates a parser with
234 namespace processing as described above. The character pointed at
235 will serve as the namespace separator.
236
237 All further memory operations used for the created parser will come from
238 the given suite.
239*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000240XMLPARSEAPI(XML_Parser)
241XML_ParserCreate_MM(const XML_Char *encoding,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000242 const XML_Memory_Handling_Suite *memsuite,
243 const XML_Char *namespaceSeparator);
244
245/* Prepare a parser object to be re-used. This is particularly
246 valuable when memory allocation overhead is disproportionatly high,
247 such as when a large number of small documnents need to be parsed.
248 All handlers are cleared from the parser, except for the
249 unknownEncodingHandler. The parser's external state is re-initialized
250 except for the values of ns and ns_triplets.
251
252 Added in Expat 1.95.3.
253*/
254XMLPARSEAPI(XML_Bool)
255XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000256
257/* atts is array of name/value pairs, terminated by 0;
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000258 names and values are 0 terminated.
259*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000260typedef void (*XML_StartElementHandler)(void *userData,
261 const XML_Char *name,
262 const XML_Char **atts);
263
264typedef void (*XML_EndElementHandler)(void *userData,
265 const XML_Char *name);
266
267
268/* s is not 0 terminated. */
269typedef void (*XML_CharacterDataHandler)(void *userData,
270 const XML_Char *s,
271 int len);
272
273/* target and data are 0 terminated */
274typedef void (*XML_ProcessingInstructionHandler)(void *userData,
275 const XML_Char *target,
276 const XML_Char *data);
277
278/* data is 0 terminated */
279typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
280
281typedef void (*XML_StartCdataSectionHandler)(void *userData);
282typedef void (*XML_EndCdataSectionHandler)(void *userData);
283
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000284/* This is called for any characters in the XML document for which
285 there is no applicable handler. This includes both characters that
286 are part of markup which is of a kind that is not reported
287 (comments, markup declarations), or characters that are part of a
288 construct which could be reported but for which no handler has been
289 supplied. The characters are passed exactly as they were in the XML
290 document except that they will be encoded in UTF-8 or UTF-16.
291 Line boundaries are not normalized. Note that a byte order mark
292 character is not passed to the default handler. There are no
293 guarantees about how characters are divided between calls to the
294 default handler: for example, a comment might be split between
295 multiple calls.
296*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000297typedef void (*XML_DefaultHandler)(void *userData,
298 const XML_Char *s,
299 int len);
300
301/* This is called for the start of the DOCTYPE declaration, before
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000302 any DTD or internal subset is parsed.
303*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000304typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
305 const XML_Char *doctypeName,
306 const XML_Char *sysid,
307 const XML_Char *pubid,
308 int has_internal_subset);
309
310/* This is called for the start of the DOCTYPE declaration when the
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000311 closing > is encountered, but after processing any external
312 subset.
313*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000314typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
315
316/* This is called for entity declarations. The is_parameter_entity
317 argument will be non-zero if the entity is a parameter entity, zero
318 otherwise.
319
320 For internal entities (<!ENTITY foo "bar">), value will
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000321 be non-NULL and systemId, publicID, and notationName will be NULL.
322 The value string is NOT nul-terminated; the length is provided in
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000323 the value_length argument. Since it is legal to have zero-length
324 values, do not use this argument to test for internal entities.
325
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000326 For external entities, value will be NULL and systemId will be
327 non-NULL. The publicId argument will be NULL unless a public
328 identifier was provided. The notationName argument will have a
329 non-NULL value only for unparsed entity declarations.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000330
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000331 Note that is_parameter_entity can't be changed to XML_Bool, since
332 that would break binary compatibility.
333*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000334typedef void (*XML_EntityDeclHandler) (void *userData,
335 const XML_Char *entityName,
336 int is_parameter_entity,
337 const XML_Char *value,
338 int value_length,
339 const XML_Char *base,
340 const XML_Char *systemId,
341 const XML_Char *publicId,
342 const XML_Char *notationName);
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000343
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000344XMLPARSEAPI(void)
345XML_SetEntityDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000346 XML_EntityDeclHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000347
348/* OBSOLETE -- OBSOLETE -- OBSOLETE
349 This handler has been superceded by the EntityDeclHandler above.
350 It is provided here for backward compatibility.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000351
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000352 This is called for a declaration of an unparsed (NDATA) entity.
353 The base argument is whatever was set by XML_SetBase. The
354 entityName, systemId and notationName arguments will never be
355 NULL. The other arguments may be.
356*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000357typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
358 const XML_Char *entityName,
359 const XML_Char *base,
360 const XML_Char *systemId,
361 const XML_Char *publicId,
362 const XML_Char *notationName);
363
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000364/* This is called for a declaration of notation. The base argument is
365 whatever was set by XML_SetBase. The notationName will never be
366 NULL. The other arguments can be.
367*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000368typedef void (*XML_NotationDeclHandler)(void *userData,
369 const XML_Char *notationName,
370 const XML_Char *base,
371 const XML_Char *systemId,
372 const XML_Char *publicId);
373
374/* When namespace processing is enabled, these are called once for
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000375 each namespace declaration. The call to the start and end element
376 handlers occur between the calls to the start and end namespace
377 declaration handlers. For an xmlns attribute, prefix will be
378 NULL. For an xmlns="" attribute, uri will be NULL.
379*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000380typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
381 const XML_Char *prefix,
382 const XML_Char *uri);
383
384typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
385 const XML_Char *prefix);
386
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000387/* This is called if the document is not standalone, that is, it has an
388 external subset or a reference to a parameter entity, but does not
389 have standalone="yes". If this handler returns XML_STATUS_ERROR,
390 then processing will not continue, and the parser will return a
391 XML_ERROR_NOT_STANDALONE error.
392 If parameter entity parsing is enabled, then in addition to the
393 conditions above this handler will only be called if the referenced
394 entity was actually read.
395*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000396typedef int (*XML_NotStandaloneHandler)(void *userData);
397
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000398/* This is called for a reference to an external parsed general
399 entity. The referenced entity is not automatically parsed. The
400 application can parse it immediately or later using
401 XML_ExternalEntityParserCreate.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000402
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000403 The parser argument is the parser parsing the entity containing the
404 reference; it can be passed as the parser argument to
405 XML_ExternalEntityParserCreate. The systemId argument is the
406 system identifier as specified in the entity declaration; it will
407 not be NULL.
408
409 The base argument is the system identifier that should be used as
410 the base for resolving systemId if systemId was relative; this is
411 set by XML_SetBase; it may be NULL.
412
413 The publicId argument is the public identifier as specified in the
414 entity declaration, or NULL if none was specified; the whitespace
415 in the public identifier will have been normalized as required by
416 the XML spec.
417
418 The context argument specifies the parsing context in the format
419 expected by the context argument to XML_ExternalEntityParserCreate;
420 context is valid only until the handler returns, so if the
421 referenced entity is to be parsed later, it must be copied.
422 context is NULL only when the entity is a parameter entity.
423
424 The handler should return XML_STATUS_ERROR if processing should not
425 continue because of a fatal error in the handling of the external
426 entity. In this case the calling parser will return an
427 XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
428
429 Note that unlike other handlers the first argument is the parser,
430 not userData.
431*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000432typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
433 const XML_Char *context,
434 const XML_Char *base,
435 const XML_Char *systemId,
436 const XML_Char *publicId);
437
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000438/* This is called in two situations:
439 1) An entity reference is encountered for which no declaration
440 has been read *and* this is not an error.
441 2) An internal entity reference is read, but not expanded, because
442 XML_SetDefaultHandler has been called.
443 Note: skipped parameter entities in declarations and skipped general
444 entities in attribute values cannot be reported, because
445 the event would be out of sync with the reporting of the
446 declarations or attribute values
447*/
448typedef void (*XML_SkippedEntityHandler)(void *userData,
449 const XML_Char *entityName,
450 int is_parameter_entity);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000451
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000452/* This structure is filled in by the XML_UnknownEncodingHandler to
453 provide information to the parser about encodings that are unknown
454 to the parser.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000455
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000456 The map[b] member gives information about byte sequences whose
457 first byte is b.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000458
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000459 If map[b] is c where c is >= 0, then b by itself encodes the
460 Unicode scalar value c.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000461
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000462 If map[b] is -1, then the byte sequence is malformed.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000463
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000464 If map[b] is -n, where n >= 2, then b is the first byte of an
465 n-byte sequence that encodes a single Unicode scalar value.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000466
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000467 The data member will be passed as the first argument to the convert
468 function.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000469
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000470 The convert function is used to convert multibyte sequences; s will
471 point to a n-byte sequence where map[(unsigned char)*s] == -n. The
472 convert function must return the Unicode scalar value represented
473 by this byte sequence or -1 if the byte sequence is malformed.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000474
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000475 The convert function may be NULL if the encoding is a single-byte
476 encoding, that is if map[b] >= -1 for all bytes b.
477
478 When the parser is finished with the encoding, then if release is
479 not NULL, it will call release passing it the data member; once
480 release has been called, the convert function will not be called
481 again.
482
483 Expat places certain restrictions on the encodings that are supported
484 using this mechanism.
485
486 1. Every ASCII character that can appear in a well-formed XML document,
487 other than the characters
488
489 $@\^`{}~
490
491 must be represented by a single byte, and that byte must be the
492 same byte that represents that character in ASCII.
493
494 2. No character may require more than 4 bytes to encode.
495
496 3. All characters encoded must have Unicode scalar values <=
497 0xFFFF, (i.e., characters that would be encoded by surrogates in
498 UTF-16 are not allowed). Note that this restriction doesn't
499 apply to the built-in support for UTF-8 and UTF-16.
500
501 4. No Unicode character may be encoded by more than one distinct
502 sequence of bytes.
503*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000504typedef struct {
505 int map[256];
506 void *data;
507 int (*convert)(void *data, const char *s);
508 void (*release)(void *data);
509} XML_Encoding;
510
511/* This is called for an encoding that is unknown to the parser.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000512
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000513 The encodingHandlerData argument is that which was passed as the
514 second argument to XML_SetUnknownEncodingHandler.
515
516 The name argument gives the name of the encoding as specified in
517 the encoding declaration.
518
519 If the callback can provide information about the encoding, it must
520 fill in the XML_Encoding structure, and return XML_STATUS_OK.
521 Otherwise it must return XML_STATUS_ERROR.
522
523 If info does not describe a suitable encoding, then the parser will
524 return an XML_UNKNOWN_ENCODING error.
525*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000526typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
527 const XML_Char *name,
528 XML_Encoding *info);
529
530XMLPARSEAPI(void)
531XML_SetElementHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000532 XML_StartElementHandler start,
533 XML_EndElementHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000534
535XMLPARSEAPI(void)
536XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
537
538XMLPARSEAPI(void)
539XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
540
541XMLPARSEAPI(void)
542XML_SetCharacterDataHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000543 XML_CharacterDataHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000544
545XMLPARSEAPI(void)
546XML_SetProcessingInstructionHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000547 XML_ProcessingInstructionHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000548XMLPARSEAPI(void)
549XML_SetCommentHandler(XML_Parser parser,
550 XML_CommentHandler handler);
551
552XMLPARSEAPI(void)
553XML_SetCdataSectionHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000554 XML_StartCdataSectionHandler start,
555 XML_EndCdataSectionHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000556
557XMLPARSEAPI(void)
558XML_SetStartCdataSectionHandler(XML_Parser parser,
559 XML_StartCdataSectionHandler start);
560
561XMLPARSEAPI(void)
562XML_SetEndCdataSectionHandler(XML_Parser parser,
563 XML_EndCdataSectionHandler end);
564
565/* This sets the default handler and also inhibits expansion of
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000566 internal entities. These entity references will be passed to the
567 default handler, or to the skipped entity handler, if one is set.
568*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000569XMLPARSEAPI(void)
570XML_SetDefaultHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000571 XML_DefaultHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000572
573/* This sets the default handler but does not inhibit expansion of
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000574 internal entities. The entity reference will not be passed to the
575 default handler.
576*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000577XMLPARSEAPI(void)
578XML_SetDefaultHandlerExpand(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000579 XML_DefaultHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000580
581XMLPARSEAPI(void)
582XML_SetDoctypeDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000583 XML_StartDoctypeDeclHandler start,
584 XML_EndDoctypeDeclHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000585
586XMLPARSEAPI(void)
587XML_SetStartDoctypeDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000588 XML_StartDoctypeDeclHandler start);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000589
590XMLPARSEAPI(void)
591XML_SetEndDoctypeDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000592 XML_EndDoctypeDeclHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000593
594XMLPARSEAPI(void)
595XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000596 XML_UnparsedEntityDeclHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000597
598XMLPARSEAPI(void)
599XML_SetNotationDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000600 XML_NotationDeclHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000601
602XMLPARSEAPI(void)
603XML_SetNamespaceDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000604 XML_StartNamespaceDeclHandler start,
605 XML_EndNamespaceDeclHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000606
607XMLPARSEAPI(void)
608XML_SetStartNamespaceDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000609 XML_StartNamespaceDeclHandler start);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000610
611XMLPARSEAPI(void)
612XML_SetEndNamespaceDeclHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000613 XML_EndNamespaceDeclHandler end);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000614
615XMLPARSEAPI(void)
616XML_SetNotStandaloneHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000617 XML_NotStandaloneHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000618
619XMLPARSEAPI(void)
620XML_SetExternalEntityRefHandler(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000621 XML_ExternalEntityRefHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000622
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000623/* If a non-NULL value for arg is specified here, then it will be
624 passed as the first argument to the external entity ref handler
625 instead of the parser object.
626*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000627XMLPARSEAPI(void)
628XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
629
630XMLPARSEAPI(void)
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000631XML_SetSkippedEntityHandler(XML_Parser parser,
632 XML_SkippedEntityHandler handler);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000633
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000634XMLPARSEAPI(void)
635XML_SetUnknownEncodingHandler(XML_Parser parser,
636 XML_UnknownEncodingHandler handler,
637 void *encodingHandlerData);
638
639/* This can be called within a handler for a start element, end
640 element, processing instruction or character data. It causes the
641 corresponding markup to be passed to the default handler.
642*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000643XMLPARSEAPI(void)
644XML_DefaultCurrent(XML_Parser parser);
645
646/* If do_nst is non-zero, and namespace processing is in effect, and
647 a name has a prefix (i.e. an explicit namespace qualifier) then
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000648 that name is returned as a triplet in a single string separated by
649 the separator character specified when the parser was created: URI
650 + sep + local_name + sep + prefix.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000651
652 If do_nst is zero, then namespace information is returned in the
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000653 default manner (URI + sep + local_name) whether or not the name
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000654 has a prefix.
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000655
656 Note: Calling XML_SetReturnNSTriplet after XML_Parse or
657 XML_ParseBuffer has no effect.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000658*/
659
660XMLPARSEAPI(void)
661XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
662
663/* This value is passed as the userData argument to callbacks. */
664XMLPARSEAPI(void)
665XML_SetUserData(XML_Parser parser, void *userData);
666
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000667/* Returns the last value set by XML_SetUserData or NULL. */
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000668#define XML_GetUserData(parser) (*(void **)(parser))
669
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000670/* This is equivalent to supplying an encoding argument to
671 XML_ParserCreate. On success XML_SetEncoding returns non-zero,
672 zero otherwise.
673 Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
674 has no effect and returns XML_STATUS_ERROR.
675*/
676XMLPARSEAPI(enum XML_Status)
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000677XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
678
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000679/* If this function is called, then the parser will be passed as the
680 first argument to callbacks instead of userData. The userData will
681 still be accessible using XML_GetUserData.
682*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000683XMLPARSEAPI(void)
684XML_UseParserAsHandlerArg(XML_Parser parser);
685
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000686/* If useDTD == XML_TRUE is passed to this function, then the parser
687 will assume that there is an external subset, even if none is
688 specified in the document. In such a case the parser will call the
689 externalEntityRefHandler with a value of NULL for the systemId
690 argument (the publicId and context arguments will be NULL as well).
691 Note: If this function is called, then this must be done before
692 the first call to XML_Parse or XML_ParseBuffer, since it will
693 have no effect after that. Returns
694 XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
695 Note: If the document does not have a DOCTYPE declaration at all,
696 then startDoctypeDeclHandler and endDoctypeDeclHandler will not
697 be called, despite an external subset being parsed.
698 Note: If XML_DTD is not defined when Expat is compiled, returns
699 XML_ERROR_FEATURE_REQUIRES_XML_DTD.
700*/
701XMLPARSEAPI(enum XML_Error)
702XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000703
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000704
705/* Sets the base to be used for resolving relative URIs in system
706 identifiers in declarations. Resolving relative identifiers is
707 left to the application: this value will be passed through as the
708 base argument to the XML_ExternalEntityRefHandler,
709 XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
710 argument will be copied. Returns XML_STATUS_ERROR if out of memory,
711 XML_STATUS_OK otherwise.
712*/
713XMLPARSEAPI(enum XML_Status)
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000714XML_SetBase(XML_Parser parser, const XML_Char *base);
715
716XMLPARSEAPI(const XML_Char *)
717XML_GetBase(XML_Parser parser);
718
719/* Returns the number of the attribute/value pairs passed in last call
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000720 to the XML_StartElementHandler that were specified in the start-tag
721 rather than defaulted. Each attribute/value pair counts as 2; thus
722 this correspondds to an index into the atts array passed to the
723 XML_StartElementHandler.
724*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000725XMLPARSEAPI(int)
726XML_GetSpecifiedAttributeCount(XML_Parser parser);
727
728/* Returns the index of the ID attribute passed in the last call to
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000729 XML_StartElementHandler, or -1 if there is no ID attribute. Each
730 attribute/value pair counts as 2; thus this correspondds to an
731 index into the atts array passed to the XML_StartElementHandler.
732*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000733XMLPARSEAPI(int)
734XML_GetIdAttributeIndex(XML_Parser parser);
735
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000736/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
737 detected. The last call to XML_Parse must have isFinal true; len
738 may be zero for this call (or any other).
739
Fred Drakedab8b0a2003-02-07 02:15:56 +0000740 Though the return values for these functions has always been
741 described as a Boolean value, the implementation, at least for the
742 1.95.x series, has always returned exactly one of the XML_Status
743 values.
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000744*/
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000745XMLPARSEAPI(enum XML_Status)
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000746XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
747
748XMLPARSEAPI(void *)
749XML_GetBuffer(XML_Parser parser, int len);
750
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000751XMLPARSEAPI(enum XML_Status)
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000752XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
753
754/* Creates an XML_Parser object that can parse an external general
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000755 entity; context is a '\0'-terminated string specifying the parse
756 context; encoding is a '\0'-terminated string giving the name of
757 the externally specified encoding, or NULL if there is no
758 externally specified encoding. The context string consists of a
759 sequence of tokens separated by formfeeds (\f); a token consisting
760 of a name specifies that the general entity of the name is open; a
761 token of the form prefix=uri specifies the namespace for a
762 particular prefix; a token of the form =uri specifies the default
763 namespace. This can be called at any point after the first call to
764 an ExternalEntityRefHandler so longer as the parser has not yet
765 been freed. The new parser is completely independent and may
766 safely be used in a separate thread. The handlers and userData are
767 initialized from the parser argument. Returns NULL if out of memory.
768 Otherwise returns a new XML_Parser object.
769*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000770XMLPARSEAPI(XML_Parser)
771XML_ExternalEntityParserCreate(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000772 const XML_Char *context,
773 const XML_Char *encoding);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000774
775enum XML_ParamEntityParsing {
776 XML_PARAM_ENTITY_PARSING_NEVER,
777 XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
778 XML_PARAM_ENTITY_PARSING_ALWAYS
779};
780
781/* Controls parsing of parameter entities (including the external DTD
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000782 subset). If parsing of parameter entities is enabled, then
783 references to external parameter entities (including the external
784 DTD subset) will be passed to the handler set with
785 XML_SetExternalEntityRefHandler. The context passed will be 0.
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000786
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000787 Unlike external general entities, external parameter entities can
788 only be parsed synchronously. If the external parameter entity is
789 to be parsed, it must be parsed during the call to the external
790 entity ref handler: the complete sequence of
791 XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
792 XML_ParserFree calls must be made during this call. After
793 XML_ExternalEntityParserCreate has been called to create the parser
794 for the external parameter entity (context must be 0 for this
795 call), it is illegal to make any calls on the old parser until
796 XML_ParserFree has been called on the newly created parser.
797 If the library has been compiled without support for parameter
798 entity parsing (ie without XML_DTD being defined), then
799 XML_SetParamEntityParsing will return 0 if parsing of parameter
800 entities is requested; otherwise it will return non-zero.
801 Note: If XML_SetParamEntityParsing is called after XML_Parse or
802 XML_ParseBuffer, then it has no effect and will always return 0.
803*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000804XMLPARSEAPI(int)
805XML_SetParamEntityParsing(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000806 enum XML_ParamEntityParsing parsing);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000807
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000808/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
809 XML_GetErrorCode returns information about the error.
810*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000811XMLPARSEAPI(enum XML_Error)
812XML_GetErrorCode(XML_Parser parser);
813
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000814/* These functions return information about the current parse
815 location. They may be called from any callback called to report
816 some parse event; in this case the location is the location of
817 the first of the sequence of characters that generated the event.
818
819 They may also be called after returning from a call to XML_Parse
820 or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then
821 the location is the location of the character at which the error
822 was detected; otherwise the location is the location of the last
823 parse event, as described above.
824*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000825XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
826XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
827XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
828
829/* Return the number of bytes in the current event.
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000830 Returns 0 if the event is in an internal entity.
831*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000832XMLPARSEAPI(int)
833XML_GetCurrentByteCount(XML_Parser parser);
834
835/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
836 the integer pointed to by offset to the offset within this buffer
837 of the current parse position, and sets the integer pointed to by size
838 to the size of this buffer (the number of input bytes). Otherwise
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000839 returns a NULL pointer. Also returns a NULL pointer if a parse isn't
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000840 active.
841
842 NOTE: The character pointer returned should not be used outside
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000843 the handler that makes the call.
844*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000845XMLPARSEAPI(const char *)
846XML_GetInputContext(XML_Parser parser,
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000847 int *offset,
848 int *size);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000849
850/* For backwards compatibility with previous versions. */
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000851#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000852#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000853#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
854
855/* Frees the content model passed to the element declaration handler */
856XMLPARSEAPI(void)
857XML_FreeContentModel(XML_Parser parser, XML_Content *model);
858
859/* Exposing the memory handling functions used in Expat */
860XMLPARSEAPI(void *)
861XML_MemMalloc(XML_Parser parser, size_t size);
862
863XMLPARSEAPI(void *)
864XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
865
866XMLPARSEAPI(void)
867XML_MemFree(XML_Parser parser, void *ptr);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000868
869/* Frees memory used by the parser. */
870XMLPARSEAPI(void)
871XML_ParserFree(XML_Parser parser);
872
873/* Returns a string describing the error. */
874XMLPARSEAPI(const XML_LChar *)
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000875XML_ErrorString(enum XML_Error code);
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000876
877/* Return a string containing the version number of this expat */
878XMLPARSEAPI(const XML_LChar *)
879XML_ExpatVersion(void);
880
881typedef struct {
882 int major;
883 int minor;
884 int micro;
885} XML_Expat_Version;
886
887/* Return an XML_Expat_Version structure containing numeric version
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000888 number information for this version of expat.
889*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000890XMLPARSEAPI(XML_Expat_Version)
891XML_ExpatVersionInfo(void);
892
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000893/* Added in Expat 1.95.5. */
894enum XML_FeatureEnum {
895 XML_FEATURE_END = 0,
896 XML_FEATURE_UNICODE,
897 XML_FEATURE_UNICODE_WCHAR_T,
898 XML_FEATURE_DTD,
899 XML_FEATURE_CONTEXT_BYTES,
900 XML_FEATURE_MIN_SIZE,
901 XML_FEATURE_SIZEOF_XML_CHAR,
902 XML_FEATURE_SIZEOF_XML_LCHAR
903 /* Additional features must be added to the end of this enum. */
904};
Martin v. Löwis8fef47b2002-02-13 07:47:16 +0000905
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000906typedef struct {
907 enum XML_FeatureEnum feature;
908 const XML_LChar *name;
909 long int value;
910} XML_Feature;
911
912XMLPARSEAPI(const XML_Feature *)
913XML_GetFeatureList(void);
914
915
916/* Expat follows the GNU/Linux convention of odd number minor version for
917 beta/development releases and even number minor version for stable
918 releases. Micro is bumped with each release, and set to 0 with each
919 change to major or minor version.
920*/
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000921#define XML_MAJOR_VERSION 1
922#define XML_MINOR_VERSION 95
Martin v. Löwisfc03a942003-01-25 22:41:29 +0000923#define XML_MICRO_VERSION 6
Martin v. Löwisb48d1982002-02-12 09:52:22 +0000924
925#ifdef __cplusplus
926}
927#endif
928
929#endif /* not XmlParse_INCLUDED */