00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef XmlRole_INCLUDED
00032 #define XmlRole_INCLUDED 1
00033
00034 #include "xmltok.h"
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040 enum {
00041 XML_ROLE_ERROR = -1,
00042 XML_ROLE_NONE = 0,
00043 XML_ROLE_XML_DECL,
00044 XML_ROLE_INSTANCE_START,
00045 XML_ROLE_DOCTYPE_NAME,
00046 XML_ROLE_DOCTYPE_SYSTEM_ID,
00047 XML_ROLE_DOCTYPE_PUBLIC_ID,
00048 XML_ROLE_DOCTYPE_CLOSE,
00049 XML_ROLE_GENERAL_ENTITY_NAME,
00050 XML_ROLE_PARAM_ENTITY_NAME,
00051 XML_ROLE_ENTITY_VALUE,
00052 XML_ROLE_ENTITY_SYSTEM_ID,
00053 XML_ROLE_ENTITY_PUBLIC_ID,
00054 XML_ROLE_ENTITY_NOTATION_NAME,
00055 XML_ROLE_NOTATION_NAME,
00056 XML_ROLE_NOTATION_SYSTEM_ID,
00057 XML_ROLE_NOTATION_NO_SYSTEM_ID,
00058 XML_ROLE_NOTATION_PUBLIC_ID,
00059 XML_ROLE_ATTRIBUTE_NAME,
00060 XML_ROLE_ATTRIBUTE_TYPE_CDATA,
00061 XML_ROLE_ATTRIBUTE_TYPE_ID,
00062 XML_ROLE_ATTRIBUTE_TYPE_IDREF,
00063 XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
00064 XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
00065 XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
00066 XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
00067 XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
00068 XML_ROLE_ATTRIBUTE_ENUM_VALUE,
00069 XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
00070 XML_ROLE_ATTLIST_ELEMENT_NAME,
00071 XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
00072 XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
00073 XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
00074 XML_ROLE_FIXED_ATTRIBUTE_VALUE,
00075 XML_ROLE_ELEMENT_NAME,
00076 XML_ROLE_CONTENT_ANY,
00077 XML_ROLE_CONTENT_EMPTY,
00078 XML_ROLE_CONTENT_PCDATA,
00079 XML_ROLE_GROUP_OPEN,
00080 XML_ROLE_GROUP_CLOSE,
00081 XML_ROLE_GROUP_CLOSE_REP,
00082 XML_ROLE_GROUP_CLOSE_OPT,
00083 XML_ROLE_GROUP_CLOSE_PLUS,
00084 XML_ROLE_GROUP_CHOICE,
00085 XML_ROLE_GROUP_SEQUENCE,
00086 XML_ROLE_CONTENT_ELEMENT,
00087 XML_ROLE_CONTENT_ELEMENT_REP,
00088 XML_ROLE_CONTENT_ELEMENT_OPT,
00089 XML_ROLE_CONTENT_ELEMENT_PLUS,
00090 XML_ROLE_PARAM_ENTITY_REF
00091 };
00092
00093 typedef struct prolog_state {
00094 int (*handler)(struct prolog_state *state,
00095 int tok,
00096 const char *ptr,
00097 const char *end,
00098 const ENCODING *enc);
00099 unsigned level;
00100 } PROLOG_STATE;
00101
00102 void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *);
00103
00104 #define XmlTokenRole(state, tok, ptr, end, enc) \
00105 (((state)->handler)(state, tok, ptr, end, enc))
00106
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110
00111 #endif