Apache Portable Runtime Utility Library
xml/expat/lib/xmlrole.h
00001 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
00002    See the file COPYING for copying permission.
00003 */
00004 
00005 #ifndef XmlRole_INCLUDED
00006 #define XmlRole_INCLUDED 1
00007 
00008 #ifdef __VMS
00009 /*      0        1         2         3      0        1         2         3
00010         1234567890123456789012345678901     1234567890123456789012345678901 */
00011 #define XmlPrologStateInitExternalEntity    XmlPrologStateInitExternalEnt
00012 #endif
00013 
00014 #include "xmltok.h"
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 enum {
00021   XML_ROLE_ERROR = -1,
00022   XML_ROLE_NONE = 0,
00023   XML_ROLE_XML_DECL,
00024   XML_ROLE_INSTANCE_START,
00025   XML_ROLE_DOCTYPE_NONE,
00026   XML_ROLE_DOCTYPE_NAME,
00027   XML_ROLE_DOCTYPE_SYSTEM_ID,
00028   XML_ROLE_DOCTYPE_PUBLIC_ID,
00029   XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
00030   XML_ROLE_DOCTYPE_CLOSE,
00031   XML_ROLE_GENERAL_ENTITY_NAME,
00032   XML_ROLE_PARAM_ENTITY_NAME,
00033   XML_ROLE_ENTITY_NONE,
00034   XML_ROLE_ENTITY_VALUE,
00035   XML_ROLE_ENTITY_SYSTEM_ID,
00036   XML_ROLE_ENTITY_PUBLIC_ID,
00037   XML_ROLE_ENTITY_COMPLETE,
00038   XML_ROLE_ENTITY_NOTATION_NAME,
00039   XML_ROLE_NOTATION_NONE,
00040   XML_ROLE_NOTATION_NAME,
00041   XML_ROLE_NOTATION_SYSTEM_ID,
00042   XML_ROLE_NOTATION_NO_SYSTEM_ID,
00043   XML_ROLE_NOTATION_PUBLIC_ID,
00044   XML_ROLE_ATTRIBUTE_NAME,
00045   XML_ROLE_ATTRIBUTE_TYPE_CDATA,
00046   XML_ROLE_ATTRIBUTE_TYPE_ID,
00047   XML_ROLE_ATTRIBUTE_TYPE_IDREF,
00048   XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
00049   XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
00050   XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
00051   XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
00052   XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
00053   XML_ROLE_ATTRIBUTE_ENUM_VALUE,
00054   XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
00055   XML_ROLE_ATTLIST_NONE,
00056   XML_ROLE_ATTLIST_ELEMENT_NAME,
00057   XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
00058   XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
00059   XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
00060   XML_ROLE_FIXED_ATTRIBUTE_VALUE,
00061   XML_ROLE_ELEMENT_NONE,
00062   XML_ROLE_ELEMENT_NAME,
00063   XML_ROLE_CONTENT_ANY,
00064   XML_ROLE_CONTENT_EMPTY,
00065   XML_ROLE_CONTENT_PCDATA,
00066   XML_ROLE_GROUP_OPEN,
00067   XML_ROLE_GROUP_CLOSE,
00068   XML_ROLE_GROUP_CLOSE_REP,
00069   XML_ROLE_GROUP_CLOSE_OPT,
00070   XML_ROLE_GROUP_CLOSE_PLUS,
00071   XML_ROLE_GROUP_CHOICE,
00072   XML_ROLE_GROUP_SEQUENCE,
00073   XML_ROLE_CONTENT_ELEMENT,
00074   XML_ROLE_CONTENT_ELEMENT_REP,
00075   XML_ROLE_CONTENT_ELEMENT_OPT,
00076   XML_ROLE_CONTENT_ELEMENT_PLUS,
00077   XML_ROLE_PI,
00078   XML_ROLE_COMMENT,
00079 #ifdef XML_DTD
00080   XML_ROLE_TEXT_DECL,
00081   XML_ROLE_IGNORE_SECT,
00082   XML_ROLE_INNER_PARAM_ENTITY_REF,
00083 #endif /* XML_DTD */
00084   XML_ROLE_PARAM_ENTITY_REF
00085 };
00086 
00087 typedef struct prolog_state {
00088   int (PTRCALL *handler) (struct prolog_state *state,
00089                           int tok,
00090                           const char *ptr,
00091                           const char *end,
00092                           const ENCODING *enc);
00093   unsigned level;
00094   int role_none;
00095 #ifdef XML_DTD
00096   unsigned includeLevel;
00097   int documentEntity;
00098   int inEntityValue;
00099 #endif /* XML_DTD */
00100 } PROLOG_STATE;
00101 
00102 void XmlPrologStateInit(PROLOG_STATE *);
00103 #ifdef XML_DTD
00104 void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
00105 #endif /* XML_DTD */
00106 
00107 #define XmlTokenRole(state, tok, ptr, end, enc) \
00108  (((state)->handler)(state, tok, ptr, end, enc))
00109 
00110 #ifdef __cplusplus
00111 }
00112 #endif
00113 
00114 #endif /* not XmlRole_INCLUDED */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines