Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd |
| 2 | See the file COPYING for copying permission. |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | #ifndef XmlRole_INCLUDED |
| 6 | #define XmlRole_INCLUDED 1 |
| 7 | |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 8 | #ifdef __VMS |
| 9 | /* 0 1 2 3 0 1 2 3 |
| 10 | 1234567890123456789012345678901 1234567890123456789012345678901 */ |
| 11 | #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt |
| 12 | #endif |
| 13 | |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 14 | #include "xmltok.h" |
| 15 | |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif |
| 19 | |
| 20 | enum { |
| 21 | XML_ROLE_ERROR = -1, |
| 22 | XML_ROLE_NONE = 0, |
| 23 | XML_ROLE_XML_DECL, |
| 24 | XML_ROLE_INSTANCE_START, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 25 | XML_ROLE_DOCTYPE_NONE, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 26 | XML_ROLE_DOCTYPE_NAME, |
| 27 | XML_ROLE_DOCTYPE_SYSTEM_ID, |
| 28 | XML_ROLE_DOCTYPE_PUBLIC_ID, |
| 29 | XML_ROLE_DOCTYPE_INTERNAL_SUBSET, |
| 30 | XML_ROLE_DOCTYPE_CLOSE, |
| 31 | XML_ROLE_GENERAL_ENTITY_NAME, |
| 32 | XML_ROLE_PARAM_ENTITY_NAME, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 33 | XML_ROLE_ENTITY_NONE, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 34 | XML_ROLE_ENTITY_VALUE, |
| 35 | XML_ROLE_ENTITY_SYSTEM_ID, |
| 36 | XML_ROLE_ENTITY_PUBLIC_ID, |
| 37 | XML_ROLE_ENTITY_COMPLETE, |
| 38 | XML_ROLE_ENTITY_NOTATION_NAME, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 39 | XML_ROLE_NOTATION_NONE, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 40 | XML_ROLE_NOTATION_NAME, |
| 41 | XML_ROLE_NOTATION_SYSTEM_ID, |
| 42 | XML_ROLE_NOTATION_NO_SYSTEM_ID, |
| 43 | XML_ROLE_NOTATION_PUBLIC_ID, |
| 44 | XML_ROLE_ATTRIBUTE_NAME, |
| 45 | XML_ROLE_ATTRIBUTE_TYPE_CDATA, |
| 46 | XML_ROLE_ATTRIBUTE_TYPE_ID, |
| 47 | XML_ROLE_ATTRIBUTE_TYPE_IDREF, |
| 48 | XML_ROLE_ATTRIBUTE_TYPE_IDREFS, |
| 49 | XML_ROLE_ATTRIBUTE_TYPE_ENTITY, |
| 50 | XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, |
| 51 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, |
| 52 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, |
| 53 | XML_ROLE_ATTRIBUTE_ENUM_VALUE, |
| 54 | XML_ROLE_ATTRIBUTE_NOTATION_VALUE, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 55 | XML_ROLE_ATTLIST_NONE, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 56 | XML_ROLE_ATTLIST_ELEMENT_NAME, |
| 57 | XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, |
| 58 | XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, |
| 59 | XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, |
| 60 | XML_ROLE_FIXED_ATTRIBUTE_VALUE, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 61 | XML_ROLE_ELEMENT_NONE, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 62 | XML_ROLE_ELEMENT_NAME, |
| 63 | XML_ROLE_CONTENT_ANY, |
| 64 | XML_ROLE_CONTENT_EMPTY, |
| 65 | XML_ROLE_CONTENT_PCDATA, |
| 66 | XML_ROLE_GROUP_OPEN, |
| 67 | XML_ROLE_GROUP_CLOSE, |
| 68 | XML_ROLE_GROUP_CLOSE_REP, |
| 69 | XML_ROLE_GROUP_CLOSE_OPT, |
| 70 | XML_ROLE_GROUP_CLOSE_PLUS, |
| 71 | XML_ROLE_GROUP_CHOICE, |
| 72 | XML_ROLE_GROUP_SEQUENCE, |
| 73 | XML_ROLE_CONTENT_ELEMENT, |
| 74 | XML_ROLE_CONTENT_ELEMENT_REP, |
| 75 | XML_ROLE_CONTENT_ELEMENT_OPT, |
| 76 | XML_ROLE_CONTENT_ELEMENT_PLUS, |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 77 | XML_ROLE_PI, |
| 78 | XML_ROLE_COMMENT, |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 79 | #ifdef XML_DTD |
| 80 | XML_ROLE_TEXT_DECL, |
| 81 | XML_ROLE_IGNORE_SECT, |
| 82 | XML_ROLE_INNER_PARAM_ENTITY_REF, |
| 83 | #endif /* XML_DTD */ |
| 84 | XML_ROLE_PARAM_ENTITY_REF |
| 85 | }; |
| 86 | |
| 87 | typedef struct prolog_state { |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 88 | int (PTRCALL *handler) (struct prolog_state *state, |
| 89 | int tok, |
| 90 | const char *ptr, |
| 91 | const char *end, |
| 92 | const ENCODING *enc); |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 93 | unsigned level; |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 94 | int role_none; |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 95 | #ifdef XML_DTD |
| 96 | unsigned includeLevel; |
| 97 | int documentEntity; |
Martin v. Löwis | fc03a94 | 2003-01-25 22:41:29 +0000 | [diff] [blame] | 98 | int inEntityValue; |
Martin v. Löwis | 1dbb1ca | 2002-02-11 23:13:04 +0000 | [diff] [blame] | 99 | #endif /* XML_DTD */ |
| 100 | } PROLOG_STATE; |
| 101 | |
| 102 | void XmlPrologStateInit(PROLOG_STATE *); |
| 103 | #ifdef XML_DTD |
| 104 | void XmlPrologStateInitExternalEntity(PROLOG_STATE *); |
| 105 | #endif /* XML_DTD */ |
| 106 | |
| 107 | #define XmlTokenRole(state, tok, ptr, end, enc) \ |
| 108 | (((state)->handler)(state, tok, ptr, end, enc)) |
| 109 | |
| 110 | #ifdef __cplusplus |
| 111 | } |
| 112 | #endif |
| 113 | |
| 114 | #endif /* not XmlRole_INCLUDED */ |