10Sstevel@tonic-gate/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 20Sstevel@tonic-gate See the file COPYING for copying permission. 30Sstevel@tonic-gate*/ 40Sstevel@tonic-gate 50Sstevel@tonic-gate#ifndef XmlRole_INCLUDED 60Sstevel@tonic-gate#define XmlRole_INCLUDED 1 70Sstevel@tonic-gate 80Sstevel@tonic-gate#ifdef __VMS 90Sstevel@tonic-gate/* 0 1 2 3 0 1 2 3 100Sstevel@tonic-gate 1234567890123456789012345678901 1234567890123456789012345678901 */ 110Sstevel@tonic-gate#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt 120Sstevel@tonic-gate#endif 130Sstevel@tonic-gate 140Sstevel@tonic-gate#include "xmltok.h" 150Sstevel@tonic-gate 160Sstevel@tonic-gate#ifdef __cplusplus 170Sstevel@tonic-gateextern "C" { 180Sstevel@tonic-gate#endif 190Sstevel@tonic-gate 200Sstevel@tonic-gateenum { 210Sstevel@tonic-gate XML_ROLE_ERROR = -1, 220Sstevel@tonic-gate XML_ROLE_NONE = 0, 230Sstevel@tonic-gate XML_ROLE_XML_DECL, 240Sstevel@tonic-gate XML_ROLE_INSTANCE_START, 250Sstevel@tonic-gate XML_ROLE_DOCTYPE_NONE, 260Sstevel@tonic-gate XML_ROLE_DOCTYPE_NAME, 270Sstevel@tonic-gate XML_ROLE_DOCTYPE_SYSTEM_ID, 280Sstevel@tonic-gate XML_ROLE_DOCTYPE_PUBLIC_ID, 290Sstevel@tonic-gate XML_ROLE_DOCTYPE_INTERNAL_SUBSET, 300Sstevel@tonic-gate XML_ROLE_DOCTYPE_CLOSE, 310Sstevel@tonic-gate XML_ROLE_GENERAL_ENTITY_NAME, 320Sstevel@tonic-gate XML_ROLE_PARAM_ENTITY_NAME, 330Sstevel@tonic-gate XML_ROLE_ENTITY_NONE, 340Sstevel@tonic-gate XML_ROLE_ENTITY_VALUE, 350Sstevel@tonic-gate XML_ROLE_ENTITY_SYSTEM_ID, 360Sstevel@tonic-gate XML_ROLE_ENTITY_PUBLIC_ID, 370Sstevel@tonic-gate XML_ROLE_ENTITY_COMPLETE, 380Sstevel@tonic-gate XML_ROLE_ENTITY_NOTATION_NAME, 390Sstevel@tonic-gate XML_ROLE_NOTATION_NONE, 400Sstevel@tonic-gate XML_ROLE_NOTATION_NAME, 410Sstevel@tonic-gate XML_ROLE_NOTATION_SYSTEM_ID, 420Sstevel@tonic-gate XML_ROLE_NOTATION_NO_SYSTEM_ID, 430Sstevel@tonic-gate XML_ROLE_NOTATION_PUBLIC_ID, 440Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_NAME, 450Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_CDATA, 460Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_ID, 470Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_IDREF, 480Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_IDREFS, 490Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_ENTITY, 500Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, 510Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, 520Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, 530Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_ENUM_VALUE, 540Sstevel@tonic-gate XML_ROLE_ATTRIBUTE_NOTATION_VALUE, 550Sstevel@tonic-gate XML_ROLE_ATTLIST_NONE, 560Sstevel@tonic-gate XML_ROLE_ATTLIST_ELEMENT_NAME, 570Sstevel@tonic-gate XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, 580Sstevel@tonic-gate XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, 590Sstevel@tonic-gate XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, 600Sstevel@tonic-gate XML_ROLE_FIXED_ATTRIBUTE_VALUE, 610Sstevel@tonic-gate XML_ROLE_ELEMENT_NONE, 620Sstevel@tonic-gate XML_ROLE_ELEMENT_NAME, 630Sstevel@tonic-gate XML_ROLE_CONTENT_ANY, 640Sstevel@tonic-gate XML_ROLE_CONTENT_EMPTY, 650Sstevel@tonic-gate XML_ROLE_CONTENT_PCDATA, 660Sstevel@tonic-gate XML_ROLE_GROUP_OPEN, 670Sstevel@tonic-gate XML_ROLE_GROUP_CLOSE, 680Sstevel@tonic-gate XML_ROLE_GROUP_CLOSE_REP, 690Sstevel@tonic-gate XML_ROLE_GROUP_CLOSE_OPT, 700Sstevel@tonic-gate XML_ROLE_GROUP_CLOSE_PLUS, 710Sstevel@tonic-gate XML_ROLE_GROUP_CHOICE, 720Sstevel@tonic-gate XML_ROLE_GROUP_SEQUENCE, 730Sstevel@tonic-gate XML_ROLE_CONTENT_ELEMENT, 740Sstevel@tonic-gate XML_ROLE_CONTENT_ELEMENT_REP, 75 XML_ROLE_CONTENT_ELEMENT_OPT, 76 XML_ROLE_CONTENT_ELEMENT_PLUS, 77 XML_ROLE_PI, 78 XML_ROLE_COMMENT, 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 87typedef struct prolog_state { 88 int (PTRCALL *handler) (struct prolog_state *state, 89 int tok, 90 const char *ptr, 91 const char *end, 92 const ENCODING *enc); 93 unsigned level; 94 int role_none; 95#ifdef XML_DTD 96 unsigned includeLevel; 97 int documentEntity; 98 int inEntityValue; 99#endif /* XML_DTD */ 100} PROLOG_STATE; 101 102void XmlPrologStateInit(PROLOG_STATE *); 103#ifdef XML_DTD 104void 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 */ 115