revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / diskimage / include / libraries / expat.h
blob3d69ce7547d73622da0debe683e9f5bc4c22db63
1 #ifndef LIBRARIES_EXPAT_H
2 #define LIBRARIES_EXPAT_H
4 /*
5 ** $VER: expat.h 4.1 (5.5.2005)
6 ** Includes Release 4.1
7 **
8 ** Written by Alfonso [alfie] Ranieri <alforan@tin.it>.
9 **
10 ** Released under the terms of the
11 ** GNU Public Licence version 2.
14 #ifndef STRING_H
15 #include <string.h>
16 #endif
18 #if defined(__GNUC__) || defined(__VBCC__)
19 #pragma pack(2)
20 #endif
22 typedef void *XML_Parser;
23 typedef char XML_Char;
24 typedef char XML_LChar;
25 typedef unsigned char XML_Bool;
27 #define XML_TRUE ((XML_Bool) 1)
28 #define XML_FALSE ((XML_Bool) 0)
30 enum XML_Error
32 XML_ERROR_NONE,
33 XML_ERROR_NO_MEMORY,
34 XML_ERROR_SYNTAX,
35 XML_ERROR_NO_ELEMENTS,
36 XML_ERROR_INVALID_TOKEN,
37 XML_ERROR_UNCLOSED_TOKEN,
38 XML_ERROR_PARTIAL_CHAR,
39 XML_ERROR_TAG_MISMATCH,
40 XML_ERROR_DUPLICATE_ATTRIBUTE,
41 XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
42 XML_ERROR_PARAM_ENTITY_REF,
43 XML_ERROR_UNDEFINED_ENTITY,
44 XML_ERROR_RECURSIVE_ENTITY_REF,
45 XML_ERROR_ASYNC_ENTITY,
46 XML_ERROR_BAD_CHAR_REF,
47 XML_ERROR_BINARY_ENTITY_REF,
48 XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
49 XML_ERROR_MISPLACED_XML_PI,
50 XML_ERROR_UNKNOWN_ENCODING,
51 XML_ERROR_INCORRECT_ENCODING,
52 XML_ERROR_UNCLOSED_CDATA_SECTION,
53 XML_ERROR_EXTERNAL_ENTITY_HANDLING,
54 XML_ERROR_NOT_STANDALONE,
55 XML_ERROR_UNEXPECTED_STATE,
56 XML_ERROR_ENTITY_DECLARED_IN_PE,
57 XML_ERROR_FEATURE_REQUIRES_XML_DTD,
58 XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
59 XML_ERROR_UNBOUND_PREFIX,
60 XML_ERROR_UNDECLARING_PREFIX,
61 XML_ERROR_INCOMPLETE_PE,
62 XML_ERROR_XML_DECL,
63 XML_ERROR_TEXT_DECL,
64 XML_ERROR_PUBLICID,
65 XML_ERROR_SUSPENDED,
66 XML_ERROR_NOT_SUSPENDED,
67 XML_ERROR_ABORTED,
68 XML_ERROR_FINISHED,
69 XML_ERROR_SUSPEND_PE
72 enum XML_Content_Type
74 XML_CTYPE_EMPTY = 1,
75 XML_CTYPE_ANY,
76 XML_CTYPE_MIXED,
77 XML_CTYPE_NAME,
78 XML_CTYPE_CHOICE,
79 XML_CTYPE_SEQ
82 enum XML_Content_Quant
84 XML_CQUANT_NONE,
85 XML_CQUANT_OPT,
86 XML_CQUANT_REP,
87 XML_CQUANT_PLUS
90 typedef struct XML_cp XML_Content;
92 struct XML_cp
94 enum XML_Content_Type type;
95 enum XML_Content_Quant quant;
96 XML_Char *name;
97 unsigned int numchildren;
98 XML_Content *children;
102 enum XML_Status
104 XML_STATUS_ERROR = 0,
105 XML_STATUS_OK = 1
108 enum XML_ParamEntityParsing
110 XML_PARAM_ENTITY_PARSING_NEVER,
111 XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
112 XML_PARAM_ENTITY_PARSING_ALWAYS
115 typedef struct
117 int major;
118 int minor;
119 int micro;
120 } XML_Expat_Version;
122 enum XML_FeatureEnum
124 XML_FEATURE_END = 0,
125 XML_FEATURE_UNICODE,
126 XML_FEATURE_UNICODE_WCHAR_T,
127 XML_FEATURE_DTD,
128 XML_FEATURE_CONTEXT_BYTES,
129 XML_FEATURE_MIN_SIZE,
130 XML_FEATURE_SIZEOF_XML_CHAR,
131 XML_FEATURE_SIZEOF_XML_LCHAR
134 typedef struct
136 enum XML_FeatureEnum feature;
137 XML_LChar *name;
138 long int value;
139 } XML_Feature;
141 enum XML_Parsing
143 XML_INITIALIZED,
144 XML_PARSING,
145 XML_FINISHED,
146 XML_SUSPENDED
149 typedef struct
151 enum XML_Parsing parsing;
152 XML_Bool finalBuffer;
153 } XML_ParsingStatus;
156 typedef struct
158 void *(*malloc_fcn)(size_t size);
159 void *(*realloc_fcn)(void *ptr, size_t size);
160 void (*free_fcn)(void *ptr);
161 } XML_Memory_Handling_Suite;
163 typedef struct
165 int map[256];
166 void *data;
167 int (*convert)(void *data, const char *s);
168 void (*release)(void *data);
169 } XML_Encoding;
171 #define XML_MAJOR_VERSION 1
172 #define XML_MINOR_VERSION 95
173 #define XML_MICRO_VERSION 5
175 #define XML_GetUserData(parser) (*(void **)(parser))
177 /* Handlers */
179 typedef void (*XML_ElementDeclHandler) (void *userData,
180 const XML_Char *name,
181 XML_Content *model);
183 typedef void (*XML_AttlistDeclHandler) (void *userData,
184 const XML_Char *elname,
185 const XML_Char *attname,
186 const XML_Char *att_type,
187 const XML_Char *dflt,
188 int isrequired);
190 typedef void (*XML_XmlDeclHandler) (void *userData,
191 const XML_Char *version,
192 const XML_Char *encoding,
193 int standalone);
196 typedef void (*XML_StartElementHandler)(void *userData,
197 const XML_Char *name,
198 const XML_Char **atts);
200 typedef void (*XML_EndElementHandler)(void *userData,
201 const XML_Char *name);
203 typedef void (*XML_CharacterDataHandler)(void *userData,
204 const XML_Char *s,
205 int len);
207 typedef void (*XML_ProcessingInstructionHandler)(void *userData,
208 const XML_Char *target,
209 const XML_Char *data);
211 typedef void (*XML_CommentHandler)(void *userData,
212 const XML_Char *data);
214 typedef void (*XML_StartCdataSectionHandler)(void *userData);
216 typedef void (*XML_EndCdataSectionHandler)(void *userData);
218 typedef void (*XML_DefaultHandler)(void *userData,
219 const XML_Char *s,
220 int len);
222 typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
223 const XML_Char *doctypeName,
224 const XML_Char *sysid,
225 const XML_Char *pubid,
226 int has_internal_subset);
228 typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
230 typedef void (*XML_EntityDeclHandler) (void *userData,
231 const XML_Char *entityName,
232 int is_parameter_entity,
233 const XML_Char *value,
234 int value_length,
235 const XML_Char *base,
236 const XML_Char *systemId,
237 const XML_Char *publicId,
238 const XML_Char *notationName);
240 typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
241 const XML_Char *entityName,
242 const XML_Char *base,
243 const XML_Char *systemId,
244 const XML_Char *publicId,
245 const XML_Char *notationName);
247 typedef void (*XML_NotationDeclHandler)(void *userData,
248 const XML_Char *notationName,
249 const XML_Char *base,
250 const XML_Char *systemId,
251 const XML_Char *publicId);
253 typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
254 const XML_Char *prefix,
255 const XML_Char *uri);
257 typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
258 const XML_Char *prefix);
260 typedef int (*XML_NotStandaloneHandler)(void *userData);
262 typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
263 const XML_Char *context,
264 const XML_Char *base,
265 const XML_Char *systemId,
266 const XML_Char *publicId);
268 typedef void (*XML_SkippedEntityHandler)(void *userData,
269 const XML_Char *entityName,
270 int is_parameter_entity);
272 typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
273 const XML_Char *name,
274 XML_Encoding *info);
276 #if defined(__GNUC__) || defined(__VBCC__)
277 #pragma pack()
278 #endif
280 #endif /* LIBRARIES_EXPAT_H */