37#ifndef XmlTok_INCLUDED
38#define XmlTok_INCLUDED 1
45#define XML_TOK_TRAILING_RSQB \
51#define XML_TOK_NONE -4
52#define XML_TOK_TRAILING_CR \
55#define XML_TOK_PARTIAL_CHAR -2
56#define XML_TOK_PARTIAL -1
57#define XML_TOK_INVALID 0
62#define XML_TOK_START_TAG_WITH_ATTS 1
63#define XML_TOK_START_TAG_NO_ATTS 2
64#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3
65#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
66#define XML_TOK_END_TAG 5
67#define XML_TOK_DATA_CHARS 6
68#define XML_TOK_DATA_NEWLINE 7
69#define XML_TOK_CDATA_SECT_OPEN 8
70#define XML_TOK_ENTITY_REF 9
71#define XML_TOK_CHAR_REF 10
77#define XML_TOK_XML_DECL 12
78#define XML_TOK_COMMENT 13
82#define XML_TOK_PROLOG_S 15
83#define XML_TOK_DECL_OPEN 16
84#define XML_TOK_DECL_CLOSE 17
85#define XML_TOK_NAME 18
86#define XML_TOK_NMTOKEN 19
87#define XML_TOK_POUND_NAME 20
89#define XML_TOK_PERCENT 22
90#define XML_TOK_OPEN_PAREN 23
91#define XML_TOK_CLOSE_PAREN 24
92#define XML_TOK_OPEN_BRACKET 25
93#define XML_TOK_CLOSE_BRACKET 26
94#define XML_TOK_LITERAL 27
95#define XML_TOK_PARAM_ENTITY_REF 28
96#define XML_TOK_INSTANCE_START 29
99#define XML_TOK_NAME_QUESTION 30
100#define XML_TOK_NAME_ASTERISK 31
101#define XML_TOK_NAME_PLUS 32
102#define XML_TOK_COND_SECT_OPEN 33
103#define XML_TOK_COND_SECT_CLOSE 34
104#define XML_TOK_CLOSE_PAREN_QUESTION 35
105#define XML_TOK_CLOSE_PAREN_ASTERISK 36
106#define XML_TOK_CLOSE_PAREN_PLUS 37
107#define XML_TOK_COMMA 38
110#define XML_TOK_ATTRIBUTE_VALUE_S 39
113#define XML_TOK_CDATA_SECT_CLOSE 40
118#define XML_TOK_PREFIXED_NAME 41
121# define XML_TOK_IGNORE_SECT 42
125# define XML_N_STATES 4
127# define XML_N_STATES 3
130#define XML_PROLOG_STATE 0
131#define XML_CONTENT_STATE 1
132#define XML_CDATA_SECTION_STATE 2
134# define XML_IGNORE_SECTION_STATE 3
137#define XML_N_LITERAL_TYPES 2
138#define XML_ATTRIBUTE_VALUE_LITERAL 0
139#define XML_ENTITY_VALUE_LITERAL 1
142#define XML_UTF8_ENCODE_MAX 4
144#define XML_UTF16_ENCODE_MAX 2
154 const char *valuePtr;
155 const char *valueEnd;
223#define XmlTok(enc, state, ptr, end, nextTokPtr) \
224 (((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
226#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
227 XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
229#define XmlContentTok(enc, ptr, end, nextTokPtr) \
230 XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
232#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
233 XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
237# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
238 XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
245#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
246 (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
248#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
249 XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
251#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
252 XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
254#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
255 (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
257#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
259#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
261#define XmlGetAttributes(enc, ptr, attsMax, atts) \
262 (((enc)->getAtts)(enc, ptr, attsMax, atts))
264#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
266#define XmlPredefinedEntityName(enc, ptr, end) \
267 (((enc)->predefinedEntityName)(enc, ptr, end))
269#define XmlUpdatePosition(enc, ptr, end, pos) \
270 (((enc)->updatePosition)(enc, ptr, end, pos))
272#define XmlIsPublicId(enc, ptr, end, badPtr) \
273 (((enc)->isPublicId)(enc, ptr, end, badPtr))
275#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
276 (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
278#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
279 (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
287 const char *ptr,
const char *end,
const char **badPtr,
288 const char **versionPtr,
const char **versionEndPtr,
289 const char **encodingNamePtr,
290 const ENCODING **namedEncodingPtr,
int *standalonePtr);
305 const char *ptr,
const char *end,
const char **badPtr,
306 const char **versionPtr,
const char **versionEndPtr,
307 const char **encodingNamePtr,
308 const ENCODING **namedEncodingPtr,
int *standalonePtr);
const char const char const char const char POSITION const char const char const char ** badPtr
enum const char const char char const char * toLim
SCANNER literalScanners[XML_N_LITERAL_TYPES]
const char int ATTRIBUTE * atts
int(PTRCALL *nameMatchesAscii)(const ENCODING *
enum const char const char char ** toP
int(PTRFASTCALL *charRefNumber)(const ENCODING *enc
const char const char const char * int(PTRFASTCALL *nameLength)(const ENCODING *
const char const char * void(PTRCALL *updatePosition)(const ENCODING *
const char const char const char const char * end
const char const char const char const char *const char *PTRFASTCALL * skipS(const ENCODING *, const char *)
enum const char const char * fromLim
SCANNER scanners[XML_N_STATES]
int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr)
#define XML_N_LITERAL_TYPES
const ENCODING * XmlGetUtf8InternalEncoding(void)
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name)
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf)
int FASTCALL XmlUtf8Encode(int charNumber, char *buf)
ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, void *userData)
int(PTRCALL * SCANNER)(const ENCODING *, const char *, const char *, const char **)
ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData)
int XmlSizeOfUnknownEncoding(void)
const ENCODING * XmlGetUtf16InternalEncoding(void)
int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr)
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name)
const ENCODING * XmlGetUtf16InternalEncodingNS(void)
int(XMLCALL * CONVERTER)(void *userData, const char *p)
@ XML_CONVERT_OUTPUT_EXHAUSTED
@ XML_CONVERT_INPUT_INCOMPLETE
const ENCODING * XmlGetUtf8InternalEncodingNS(void)