Go to the source code of this file.
Classes | |
| struct | position |
| struct | ATTRIBUTE |
| struct | encoding |
| struct | INIT_ENCODING |
Defines | |
| #define | XmlTok_INCLUDED 1 |
| #define | XML_TOK_TRAILING_RSQB -5 |
| #define | XML_TOK_NONE -4 |
| #define | XML_TOK_TRAILING_CR -3 |
| #define | XML_TOK_PARTIAL_CHAR -2 |
| #define | XML_TOK_PARTIAL -1 |
| #define | XML_TOK_INVALID 0 |
| #define | XML_TOK_START_TAG_WITH_ATTS 1 |
| #define | XML_TOK_START_TAG_NO_ATTS 2 |
| #define | XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 |
| #define | XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 |
| #define | XML_TOK_END_TAG 5 |
| #define | XML_TOK_DATA_CHARS 6 |
| #define | XML_TOK_DATA_NEWLINE 7 |
| #define | XML_TOK_CDATA_SECT_OPEN 8 |
| #define | XML_TOK_ENTITY_REF 9 |
| #define | XML_TOK_CHAR_REF 10 |
| #define | XML_TOK_PI 11 |
| #define | XML_TOK_XML_DECL 12 |
| #define | XML_TOK_COMMENT 13 |
| #define | XML_TOK_BOM 14 |
| #define | XML_TOK_PROLOG_S 15 |
| #define | XML_TOK_DECL_OPEN 16 |
| #define | XML_TOK_DECL_CLOSE 17 |
| #define | XML_TOK_NAME 18 |
| #define | XML_TOK_NMTOKEN 19 |
| #define | XML_TOK_POUND_NAME 20 |
| #define | XML_TOK_OR 21 |
| #define | XML_TOK_PERCENT 22 |
| #define | XML_TOK_OPEN_PAREN 23 |
| #define | XML_TOK_CLOSE_PAREN 24 |
| #define | XML_TOK_OPEN_BRACKET 25 |
| #define | XML_TOK_CLOSE_BRACKET 26 |
| #define | XML_TOK_LITERAL 27 |
| #define | XML_TOK_PARAM_ENTITY_REF 28 |
| #define | XML_TOK_INSTANCE_START 29 |
| #define | XML_TOK_NAME_QUESTION 30 |
| #define | XML_TOK_NAME_ASTERISK 31 |
| #define | XML_TOK_NAME_PLUS 32 |
| #define | XML_TOK_COND_SECT_OPEN 33 |
| #define | XML_TOK_COND_SECT_CLOSE 34 |
| #define | XML_TOK_CLOSE_PAREN_QUESTION 35 |
| #define | XML_TOK_CLOSE_PAREN_ASTERISK 36 |
| #define | XML_TOK_CLOSE_PAREN_PLUS 37 |
| #define | XML_TOK_COMMA 38 |
| #define | XML_TOK_ATTRIBUTE_VALUE_S 39 |
| #define | XML_TOK_CDATA_SECT_CLOSE 40 |
| #define | XML_TOK_PREFIXED_NAME 41 |
| #define | XML_N_STATES 3 |
| #define | XML_PROLOG_STATE 0 |
| #define | XML_CONTENT_STATE 1 |
| #define | XML_CDATA_SECTION_STATE 2 |
| #define | XML_N_LITERAL_TYPES 2 |
| #define | XML_ATTRIBUTE_VALUE_LITERAL 0 |
| #define | XML_ENTITY_VALUE_LITERAL 1 |
| #define | XML_UTF8_ENCODE_MAX 4 |
| #define | XML_UTF16_ENCODE_MAX 2 |
| #define | XmlTok(enc, state, ptr, end, nextTokPtr) (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) |
| #define | XmlPrologTok(enc, ptr, end, nextTokPtr) XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) |
| #define | XmlContentTok(enc, ptr, end, nextTokPtr) XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) |
| #define | XmlCdataSectionTok(enc, ptr, end, nextTokPtr) XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) |
| #define | XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) |
| #define | XmlAttributeValueTok(enc, ptr, end, nextTokPtr) XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) |
| #define | XmlEntityValueTok(enc, ptr, end, nextTokPtr) XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) |
| #define | XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) |
| #define | XmlNameMatchesAscii(enc, ptr1, end1, ptr2) (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) |
| #define | XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr)) |
| #define | XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr)) |
| #define | XmlGetAttributes(enc, ptr, attsMax, atts) (((enc)->getAtts)(enc, ptr, attsMax, atts)) |
| #define | XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr)) |
| #define | XmlPredefinedEntityName(enc, ptr, end) (((enc)->predefinedEntityName)(enc, ptr, end)) |
| #define | XmlUpdatePosition(enc, ptr, end, pos) (((enc)->updatePosition)(enc, ptr, end, pos)) |
| #define | XmlIsPublicId(enc, ptr, end, badPtr) (((enc)->isPublicId)(enc, ptr, end, badPtr)) |
| #define | XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) |
| #define | XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) |
Typedefs | |
| typedef position | POSITION |
| typedef encoding | ENCODING |
| typedef int(PTRCALL * | SCANNER )(const ENCODING *, const char *, const char *, const char **) |
| typedef const char * | p |
Functions | |
| 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) |
| int | XmlInitEncoding (INIT_ENCODING *, const ENCODING **, const char *name) |
| const ENCODING * | XmlGetUtf8InternalEncoding (void) |
| const ENCODING * | XmlGetUtf16InternalEncoding (void) |
| int FASTCALL | XmlUtf8Encode (int charNumber, char *buf) |
| int FASTCALL | XmlUtf16Encode (int charNumber, unsigned short *buf) |
| int | XmlSizeOfUnknownEncoding (void) |
| typedef | int (XMLCALL *CONVERTER)(void *userData |
| ENCODING * | XmlInitUnknownEncoding (void *mem, int *table, CONVERTER convert, void *userData) |
| 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 | XmlInitEncodingNS (INIT_ENCODING *, const ENCODING **, const char *name) |
| const ENCODING * | XmlGetUtf8InternalEncodingNS (void) |
| const ENCODING * | XmlGetUtf16InternalEncodingNS (void) |
| ENCODING * | XmlInitUnknownEncodingNS (void *mem, int *table, CONVERTER convert, void *userData) |
|
|
|
|
|
|
|
|
Definition at line 97 of file xmltok.h. Referenced by XmlInitUnknownEncoding(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 76 of file xmltok.h. Referenced by appendAttributeValue(). |
|
|
Definition at line 45 of file xmltok.h. Referenced by doProlog(), externalEntityInitProcessor2(), prolog0(), prolog1(), and XmlInitUnknownEncoding(). |
|
|
Definition at line 79 of file xmltok.h. Referenced by doCdataSection(). |
|
|
Definition at line 35 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 37 of file xmltok.h. Referenced by appendAttributeValue(), doContent(), and storeEntityValue(). |
|
|
Definition at line 59 of file xmltok.h. Referenced by internalSubset(). |
|
|
Definition at line 57 of file xmltok.h. Referenced by attlist4(), attlist7(), element3(), and element7(). |
|
|
Definition at line 71 of file xmltok.h. Referenced by element3(), element5(), and element7(). |
|
|
Definition at line 72 of file xmltok.h. Referenced by element7(). |
|
|
Definition at line 70 of file xmltok.h. Referenced by element7(). |
|
|
Definition at line 73 of file xmltok.h. Referenced by element7(). |
|
|
Definition at line 44 of file xmltok.h. Referenced by doContent(), epilogProcessor(), internalSubset(), prolog0(), prolog1(), and prolog2(). |
|
|
|
|
|
|
|
|
Definition at line 33 of file xmltok.h. Referenced by appendAttributeValue(), doCdataSection(), doContent(), and storeEntityValue(). |
|
|
Definition at line 34 of file xmltok.h. Referenced by appendAttributeValue(), doCdataSection(), doContent(), and storeEntityValue(). |
|
|
Definition at line 50 of file xmltok.h. Referenced by attlist1(), declClose(), doctype1(), doctype4(), doctype5(), entity10(), entity5(), and notation4(). |
|
|
Definition at line 49 of file xmltok.h. Referenced by internalSubset(), prolog0(), and prolog1(). |
|
|
Definition at line 31 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 30 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 32 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 36 of file xmltok.h. Referenced by appendAttributeValue(), doContent(), and storeEntityValue(). |
|
|
|
|
|
Definition at line 23 of file xmltok.h. Referenced by appendAttributeValue(), doCdataSection(), doContent(), doProlog(), epilogProcessor(), and storeEntityValue(). |
|
|
Definition at line 60 of file xmltok.h. Referenced by attlist8(), attlist9(), doctype2(), doctype3(), entity2(), entity3(), entity4(), entity7(), entity8(), entity9(), notation2(), notation3(), and notation4(). |
|
|
Definition at line 51 of file xmltok.h. Referenced by attlist0(), attlist1(), attlist2(), attlist3(), attlist6(), doctype0(), doctype1(), element0(), element1(), element2(), element4(), element6(), entity0(), entity1(), entity2(), entity5(), entity6(), entity7(), notation0(), and notation1(). |
|
|
Definition at line 66 of file xmltok.h. Referenced by element2(), and element6(). |
|
|
Definition at line 67 of file xmltok.h. Referenced by element2(), and element6(). |
|
|
Definition at line 65 of file xmltok.h. Referenced by element2(), and element6(). |
|
|
Definition at line 52 of file xmltok.h. Referenced by attlist3(). |
|
|
Definition at line 18 of file xmltok.h. Referenced by appendAttributeValue(), doCdataSection(), doContent(), doProlog(), epilogProcessor(), internalSubset(), storeEntityValue(), and XmlInitUnknownEncoding(). |
|
|
Definition at line 58 of file xmltok.h. Referenced by doctype1(), and doctype4(). |
|
|
Definition at line 56 of file xmltok.h. Referenced by attlist2(), attlist5(), element1(), element2(), and element6(). |
|
|
Definition at line 54 of file xmltok.h. Referenced by attlist4(), attlist7(), element3(), element5(), and element7(). |
|
|
Definition at line 61 of file xmltok.h. Referenced by common(), doProlog(), internalSubset(), and storeEntityValue(). |
|
|
Definition at line 22 of file xmltok.h. Referenced by appendAttributeValue(), doCdataSection(), doContent(), doProlog(), epilogProcessor(), externalEntityInitProcessor2(), externalEntityInitProcessor3(), storeEntityValue(), and XmlInitUnknownEncoding(). |
|
|
Definition at line 21 of file xmltok.h. Referenced by doCdataSection(), doContent(), doProlog(), epilogProcessor(), externalEntityInitProcessor2(), and externalEntityInitProcessor3(). |
|
|
Definition at line 55 of file xmltok.h. Referenced by entity0(). |
|
|
Definition at line 42 of file xmltok.h. Referenced by doContent(), epilogProcessor(), internalSubset(), prolog0(), prolog1(), and prolog2(). |
|
|
Definition at line 53 of file xmltok.h. Referenced by attlist8(), and element2(). |
|
|
Definition at line 84 of file xmltok.h. Referenced by attlist0(), attlist1(), attlist3(), doctype0(), element0(), element2(), element4(), and element6(). |
|
|
Definition at line 48 of file xmltok.h. Referenced by attlist0(), attlist1(), attlist2(), attlist3(), attlist4(), attlist5(), attlist6(), attlist7(), attlist8(), attlist9(), declClose(), doctype0(), doctype1(), doctype2(), doctype3(), doctype4(), doctype5(), element0(), element1(), element2(), element3(), element4(), element5(), element6(), element7(), entity0(), entity1(), entity10(), entity2(), entity3(), entity4(), entity5(), entity6(), entity7(), entity8(), entity9(), epilogProcessor(), internalSubset(), notation0(), notation1(), notation2(), notation3(), notation4(), prolog0(), prolog1(), and prolog2(). |
|
|
Definition at line 29 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 28 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 19 of file xmltok.h. Referenced by appendAttributeValue(), doContent(), and storeEntityValue(). |
|
|
Definition at line 13 of file xmltok.h. Referenced by doContent(). |
|
|
Definition at line 43 of file xmltok.h. Referenced by doContent(), doProlog(), externalEntityInitProcessor3(), and prolog0(). |
|
|
|
|
|
|
|
|
Definition at line 223 of file xmltok.h. Referenced by appendAttributeValue(). |
|
|
Definition at line 207 of file xmltok.h. Referenced by doCdataSection(). |
|
|
Definition at line 243 of file xmltok.h. Referenced by appendAttributeValue(), doContent(), and storeEntityValue(). |
|
|
Definition at line 204 of file xmltok.h. Referenced by doContent(), externalEntityInitProcessor2(), and externalEntityInitProcessor3(). |
|
|
Definition at line 226 of file xmltok.h. Referenced by storeEntityValue(). |
|
|
Definition at line 240 of file xmltok.h. Referenced by storeAtts(). |
|
|
Definition at line 252 of file xmltok.h. Referenced by doProlog(). |
|
|
|
|
|
Definition at line 234 of file xmltok.h. Referenced by doContent(), processXmlDecl(), reportProcessingInstruction(), and storeAtts(). |
|
|
Definition at line 231 of file xmltok.h. Referenced by attlist2(), attlist8(), doctype1(), element1(), element2(), entity2(), entity5(), entity7(), internalSubset(), notation1(), prolog0(), and prolog1(). |
|
|
Definition at line 246 of file xmltok.h. Referenced by appendAttributeValue(), doContent(), and doProlog(). |
|
|
Definition at line 201 of file xmltok.h. Referenced by doProlog(), epilogProcessor(), internalEntityProcessor(), processInternalEntity(), and prologProcessor(). |
|
|
|
|
|
Definition at line 237 of file xmltok.h. Referenced by reportProcessingInstruction(). |
|
|
Definition at line 198 of file xmltok.h. Referenced by XmlInitUnknownEncoding(). |
|
|
|
|
|
Definition at line 249 of file xmltok.h. Referenced by XML_GetCurrentColumnNumber(), XML_GetCurrentLineNumber(), XML_Parse(), XML_ParseBuffer(), and XML_ResumeParser(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by storeAtts(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
Definition at line 1485 of file xmltok.c. References INIT_ENCODING::encPtr, INIT_ENC_INDEX, ISO_8859_1_ENC, UTF_16_ENC, UTF_16BE_ENC, UTF_16LE_ENC, UTF_8_ENC, XML_CONTENT_STATE, XML_TOK_BOM, XML_TOK_NONE, XML_TOK_PARTIAL, and XmlTok. Referenced by handleUnknownEncoding(). 01493 { 01494 const ENCODING **encPtr; 01495 01496 if (ptr == end) 01497 return XML_TOK_NONE; 01498 encPtr = enc->encPtr; 01499 if (ptr + 1 == end) { 01500 /* only a single byte available for auto-detection */ 01501 #ifndef XML_DTD /* FIXME */ 01502 /* a well-formed document entity must have more than one byte */ 01503 if (state != XML_CONTENT_STATE) 01504 return XML_TOK_PARTIAL; 01505 #endif 01506 /* so we're parsing an external text entity... */ 01507 /* if UTF-16 was externally specified, then we need at least 2 bytes */ 01508 switch (INIT_ENC_INDEX(enc)) { 01509 case UTF_16_ENC: 01510 case UTF_16LE_ENC: 01511 case UTF_16BE_ENC: 01512 return XML_TOK_PARTIAL; 01513 } 01514 switch ((unsigned char)*ptr) { 01515 case 0xFE: 01516 case 0xFF: 01517 case 0xEF: /* possibly first byte of UTF-8 BOM */ 01518 if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC 01519 && state == XML_CONTENT_STATE) 01520 break; 01521 /* fall through */ 01522 case 0x00: 01523 case 0x3C: 01524 return XML_TOK_PARTIAL; 01525 } 01526 } 01527 else { 01528 switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { 01529 case 0xFEFF: 01530 if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC 01531 && state == XML_CONTENT_STATE) 01532 break; 01533 *nextTokPtr = ptr + 2; 01534 *encPtr = encodingTable[UTF_16BE_ENC]; 01535 return XML_TOK_BOM; 01536 /* 00 3C is handled in the default case */ 01537 case 0x3C00: 01538 if (( |