5 #ifndef XmlParse_INCLUDED
6 #define XmlParse_INCLUDED 1
11 #define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler
12 #define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler
13 #define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler
14 #define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg
19 #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
20 #define XML_USE_MSC_EXTENSIONS 1
46 #if defined(XML_USE_MSC_EXTENSIONS)
47 #define XMLCALL __cdecl
48 #elif defined(__GNUC__) && defined(__i386)
49 #define XMLCALL __attribute__((cdecl))
66 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
67 #ifndef XML_BUILDING_EXPAT
70 #ifdef XML_USE_MSC_EXTENSIONS
71 #define XMLIMPORT __declspec(dllimport)
83 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
89 #ifdef XML_UNICODE_WCHAR_T
93 struct XML_ParserStruct;
94 typedef struct XML_ParserStruct *XML_Parser;
97 #ifdef XML_UNICODE_WCHAR_T
98 typedef wchar_t XML_Char;
99 typedef wchar_t XML_LChar;
101 typedef unsigned short XML_Char;
102 typedef char XML_LChar;
105 typedef char XML_Char;
106 typedef char XML_LChar;
110 typedef unsigned char XML_Bool;
111 #define XML_TRUE ((XML_Bool) 1)
112 #define XML_FALSE ((XML_Bool) 0)
128 XML_STATUS_ERROR = 0,
129 #define XML_STATUS_ERROR XML_STATUS_ERROR
131 #define XML_STATUS_OK XML_STATUS_OK
138 XML_ERROR_NO_ELEMENTS,
139 XML_ERROR_INVALID_TOKEN,
140 XML_ERROR_UNCLOSED_TOKEN,
141 XML_ERROR_PARTIAL_CHAR,
142 XML_ERROR_TAG_MISMATCH,
143 XML_ERROR_DUPLICATE_ATTRIBUTE,
144 XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
145 XML_ERROR_PARAM_ENTITY_REF,
146 XML_ERROR_UNDEFINED_ENTITY,
147 XML_ERROR_RECURSIVE_ENTITY_REF,
148 XML_ERROR_ASYNC_ENTITY,
149 XML_ERROR_BAD_CHAR_REF,
150 XML_ERROR_BINARY_ENTITY_REF,
151 XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
152 XML_ERROR_MISPLACED_XML_PI,
153 XML_ERROR_UNKNOWN_ENCODING,
154 XML_ERROR_INCORRECT_ENCODING,
155 XML_ERROR_UNCLOSED_CDATA_SECTION,
156 XML_ERROR_EXTERNAL_ENTITY_HANDLING,
157 XML_ERROR_NOT_STANDALONE,
158 XML_ERROR_UNEXPECTED_STATE,
159 XML_ERROR_ENTITY_DECLARED_IN_PE,
160 XML_ERROR_FEATURE_REQUIRES_XML_DTD,
161 XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
162 XML_ERROR_UNBOUND_PREFIX
165 enum XML_Content_Type {
174 enum XML_Content_Quant {
202 enum XML_Content_Type type;
203 enum XML_Content_Quant quant;
205 unsigned int numchildren;
214 typedef void (XMLCALL *XML_ElementDeclHandler) (
void *userData,
215 const XML_Char *name,
219 XML_SetElementDeclHandler(XML_Parser parser,
220 XML_ElementDeclHandler eldecl);
230 typedef
void (XMLCALL *XML_AttlistDeclHandler) (
232 const XML_Char *elname,
233 const XML_Char *attname,
234 const XML_Char *att_type,
235 const XML_Char *dflt,
239 XML_SetAttlistDeclHandler(XML_Parser parser,
240 XML_AttlistDeclHandler attdecl);
250 typedef
void (XMLCALL *XML_XmlDeclHandler) (
void *userData,
251 const XML_Char *version,
256 XML_SetXmlDeclHandler(XML_Parser parser,
257 XML_XmlDeclHandler xmldecl);
261 void *(XMLCALL *malloc_fcn)(
size_t size);
262 void *(XMLCALL *realloc_fcn)(
void *ptr,
size_t size);
263 void (XMLCALL *free_fcn)(
void *ptr);
269 XMLPARSEAPI(XML_Parser)
270 XML_ParserCreate(const XML_Char *
encoding);
283 XMLPARSEAPI(XML_Parser)
284 XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
296 XMLPARSEAPI(XML_Parser)
297 XML_ParserCreate_MM(const XML_Char *encoding,
299 const XML_Char *namespaceSeparator);
310 XMLPARSEAPI(XML_Bool)
311 XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
316 typedef
void (XMLCALL *XML_StartElementHandler) (
void *userData,
317 const XML_Char *name,
318 const XML_Char **atts);
320 typedef
void (XMLCALL *XML_EndElementHandler) (
void *userData,
321 const XML_Char *name);
325 typedef
void (XMLCALL *XML_CharacterDataHandler) (
void *userData,
330 typedef
void (XMLCALL *XML_ProcessingInstructionHandler) (
332 const XML_Char *target,
333 const XML_Char *data);
336 typedef
void (XMLCALL *XML_CommentHandler) (
void *userData,
337 const XML_Char *data);
339 typedef
void (XMLCALL *XML_StartCdataSectionHandler) (
void *userData);
340 typedef
void (XMLCALL *XML_EndCdataSectionHandler) (
void *userData);
355 typedef
void (XMLCALL *XML_DefaultHandler) (
void *userData,
362 typedef
void (XMLCALL *XML_StartDoctypeDeclHandler) (
364 const XML_Char *doctypeName,
365 const XML_Char *sysid,
366 const XML_Char *pubid,
367 int has_internal_subset);
373 typedef
void (XMLCALL *XML_EndDoctypeDeclHandler)(
void *userData);
393 typedef
void (XMLCALL *XML_EntityDeclHandler) (
395 const XML_Char *entityName,
396 int is_parameter_entity,
397 const XML_Char *value,
399 const XML_Char *base,
400 const XML_Char *systemId,
401 const XML_Char *publicId,
402 const XML_Char *notationName);
405 XML_SetEntityDeclHandler(XML_Parser parser,
406 XML_EntityDeclHandler handler);
417 typedef
void (XMLCALL *XML_UnparsedEntityDeclHandler) (
419 const XML_Char *entityName,
420 const XML_Char *base,
421 const XML_Char *systemId,
422 const XML_Char *publicId,
423 const XML_Char *notationName);
429 typedef
void (XMLCALL *XML_NotationDeclHandler) (
431 const XML_Char *notationName,
432 const XML_Char *base,
433 const XML_Char *systemId,
434 const XML_Char *publicId);
442 typedef
void (XMLCALL *XML_StartNamespaceDeclHandler) (
444 const XML_Char *prefix,
445 const XML_Char *uri);
447 typedef
void (XMLCALL *XML_EndNamespaceDeclHandler) (
449 const XML_Char *prefix);
460 typedef
int (XMLCALL *XML_NotStandaloneHandler) (
void *userData);
496 typedef
int (XMLCALL *XML_ExternalEntityRefHandler) (
498 const XML_Char *context,
499 const XML_Char *base,
500 const XML_Char *systemId,
501 const XML_Char *publicId);
513 typedef
void (XMLCALL *XML_SkippedEntityHandler) (
515 const XML_Char *entityName,
516 int is_parameter_entity);
573 int (XMLCALL *convert)(
void *data,
const char *s);
574 void (XMLCALL *release)(
void *data);
592 typedef int (XMLCALL *XML_UnknownEncodingHandler) (
593 void *encodingHandlerData,
594 const XML_Char *name,
598 XML_SetElementHandler(XML_Parser parser,
599 XML_StartElementHandler start,
600 XML_EndElementHandler end);
603 XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
606 XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
609 XML_SetCharacterDataHandler(XML_Parser parser,
610 XML_CharacterDataHandler handler);
613 XML_SetProcessingInstructionHandler(XML_Parser parser,
614 XML_ProcessingInstructionHandler handler);
616 XML_SetCommentHandler(XML_Parser parser,
617 XML_CommentHandler handler);
620 XML_SetCdataSectionHandler(XML_Parser parser,
621 XML_StartCdataSectionHandler start,
622 XML_EndCdataSectionHandler end);
625 XML_SetStartCdataSectionHandler(XML_Parser parser,
626 XML_StartCdataSectionHandler start);
629 XML_SetEndCdataSectionHandler(XML_Parser parser,
630 XML_EndCdataSectionHandler end);
637 XML_SetDefaultHandler(XML_Parser parser,
638 XML_DefaultHandler handler);
645 XML_SetDefaultHandlerExpand(XML_Parser parser,
646 XML_DefaultHandler handler);
649 XML_SetDoctypeDeclHandler(XML_Parser parser,
650 XML_StartDoctypeDeclHandler start,
651 XML_EndDoctypeDeclHandler end);
654 XML_SetStartDoctypeDeclHandler(XML_Parser parser,
655 XML_StartDoctypeDeclHandler start);
658 XML_SetEndDoctypeDeclHandler(XML_Parser parser,
659 XML_EndDoctypeDeclHandler end);
662 XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
663 XML_UnparsedEntityDeclHandler handler);
666 XML_SetNotationDeclHandler(XML_Parser parser,
667 XML_NotationDeclHandler handler);
670 XML_SetNamespaceDeclHandler(XML_Parser parser,
671 XML_StartNamespaceDeclHandler start,
672 XML_EndNamespaceDeclHandler end);
675 XML_SetStartNamespaceDeclHandler(XML_Parser parser,
676 XML_StartNamespaceDeclHandler start);
679 XML_SetEndNamespaceDeclHandler(XML_Parser parser,
680 XML_EndNamespaceDeclHandler end);
683 XML_SetNotStandaloneHandler(XML_Parser parser,
684 XML_NotStandaloneHandler handler);
687 XML_SetExternalEntityRefHandler(XML_Parser parser,
688 XML_ExternalEntityRefHandler handler);
695 XML_SetExternalEntityRefHandlerArg(XML_Parser,
void *arg);
698 XML_SetSkippedEntityHandler(XML_Parser parser,
699 XML_SkippedEntityHandler handler);
702 XML_SetUnknownEncodingHandler(XML_Parser parser,
703 XML_UnknownEncodingHandler handler,
704 void *encodingHandlerData);
711 XML_DefaultCurrent(XML_Parser parser);
728 XML_SetReturnNSTriplet(XML_Parser parser,
int do_nst);
732 XML_SetUserData(XML_Parser parser,
void *userData);
735 #define XML_GetUserData(parser) (*(void **)(parser))
743 XMLPARSEAPI(
enum XML_Status)
744 XML_SetEncoding(XML_Parser parser, const XML_Char *
encoding);
751 XML_UseParserAsHandlerArg(XML_Parser parser);
768 XMLPARSEAPI(enum XML_Error)
769 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
780 XMLPARSEAPI(enum XML_Status)
781 XML_SetBase(XML_Parser parser, const XML_Char *base);
783 XMLPARSEAPI(const XML_Char *)
784 XML_GetBase(XML_Parser parser);
793 XML_GetSpecifiedAttributeCount(XML_Parser parser);
801 XML_GetIdAttributeIndex(XML_Parser parser);
812 XMLPARSEAPI(enum XML_Status)
813 XML_Parse(XML_Parser parser, const
char *s,
int len,
int isFinal);
816 XML_GetBuffer(XML_Parser parser,
int len);
818 XMLPARSEAPI(enum XML_Status)
819 XML_ParseBuffer(XML_Parser parser,
int len,
int isFinal);
837 XMLPARSEAPI(XML_Parser)
838 XML_ExternalEntityParserCreate(XML_Parser parser,
839 const XML_Char *context,
840 const XML_Char *encoding);
842 enum XML_ParamEntityParsing {
843 XML_PARAM_ENTITY_PARSING_NEVER,
844 XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
845 XML_PARAM_ENTITY_PARSING_ALWAYS
872 XML_SetParamEntityParsing(XML_Parser parser,
873 enum XML_ParamEntityParsing parsing);
878 XMLPARSEAPI(enum XML_Error)
879 XML_GetErrorCode(XML_Parser parser);
897 XMLPARSEAPI(
int) XML_GetCurrentLineNumber(XML_Parser parser);
898 XMLPARSEAPI(
int) XML_GetCurrentColumnNumber(XML_Parser parser);
899 XMLPARSEAPI(
long) XML_GetCurrentByteIndex(XML_Parser parser);
905 XML_GetCurrentByteCount(XML_Parser parser);
917 XMLPARSEAPI(const
char *)
918 XML_GetInputContext(XML_Parser parser,
923 #define XML_GetErrorLineNumber XML_GetCurrentLineNumber
924 #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
925 #define XML_GetErrorByteIndex XML_GetCurrentByteIndex
929 XML_FreeContentModel(XML_Parser parser,
XML_Content *model);
933 XML_MemMalloc(XML_Parser parser,
size_t size);
936 XML_MemRealloc(XML_Parser parser,
void *ptr,
size_t size);
939 XML_MemFree(XML_Parser parser,
void *ptr);
943 XML_ParserFree(XML_Parser parser);
946 XMLPARSEAPI(const XML_LChar *)
947 XML_ErrorString(enum XML_Error code);
950 XMLPARSEAPI(const XML_LChar *)
951 XML_ExpatVersion(
void);
963 XML_ExpatVersionInfo(
void);
966 enum XML_FeatureEnum {
969 XML_FEATURE_UNICODE_WCHAR_T,
971 XML_FEATURE_CONTEXT_BYTES,
972 XML_FEATURE_MIN_SIZE,
973 XML_FEATURE_SIZEOF_XML_CHAR,
974 XML_FEATURE_SIZEOF_XML_LCHAR
979 enum XML_FeatureEnum feature;
980 const XML_LChar *name;
985 XML_GetFeatureList(
void);
993 #define XML_MAJOR_VERSION 1
994 #define XML_MINOR_VERSION 95
995 #define XML_MICRO_VERSION 7