1 /*
2 The contents of this file are subject to the Mozilla Public License
3 Version 1.0 (the "License"); you may not use this file except in
4 compliance with the License. You may obtain a copy of the License at
5 http://www.mozilla.org/MPL/
6 
7 Software distributed under the License is distributed on an "AS IS"
8 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9 License for the specific language governing rights and limitations
10 under the License.
11 
12 The Original Code is expat.
13 
14 The Initial Developer of the Original Code is James Clark.
15 Portions created by James Clark are Copyright (C) 1998
16 James Clark. All Rights Reserved.
17 
18 Contributor(s):
19 $Id: xmlrole.h,v 1.1.1.1 2001/06/24 18:29:55 torcs Exp $
20 */
21 
22 #ifndef XmlRole_INCLUDED
23 #define XmlRole_INCLUDED 1
24 
25 #include "xmltok.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 enum {
32   XML_ROLE_ERROR = -1,
33   XML_ROLE_NONE = 0,
34   XML_ROLE_XML_DECL,
35   XML_ROLE_INSTANCE_START,
36   XML_ROLE_DOCTYPE_NAME,
37   XML_ROLE_DOCTYPE_SYSTEM_ID,
38   XML_ROLE_DOCTYPE_PUBLIC_ID,
39   XML_ROLE_DOCTYPE_CLOSE,
40   XML_ROLE_GENERAL_ENTITY_NAME,
41   XML_ROLE_PARAM_ENTITY_NAME,
42   XML_ROLE_ENTITY_VALUE,
43   XML_ROLE_ENTITY_SYSTEM_ID,
44   XML_ROLE_ENTITY_PUBLIC_ID,
45   XML_ROLE_ENTITY_NOTATION_NAME,
46   XML_ROLE_NOTATION_NAME,
47   XML_ROLE_NOTATION_SYSTEM_ID,
48   XML_ROLE_NOTATION_NO_SYSTEM_ID,
49   XML_ROLE_NOTATION_PUBLIC_ID,
50   XML_ROLE_ATTRIBUTE_NAME,
51   XML_ROLE_ATTRIBUTE_TYPE_CDATA,
52   XML_ROLE_ATTRIBUTE_TYPE_ID,
53   XML_ROLE_ATTRIBUTE_TYPE_IDREF,
54   XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
55   XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
56   XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
57   XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
58   XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
59   XML_ROLE_ATTRIBUTE_ENUM_VALUE,
60   XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
61   XML_ROLE_ATTLIST_ELEMENT_NAME,
62   XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
63   XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
64   XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
65   XML_ROLE_FIXED_ATTRIBUTE_VALUE,
66   XML_ROLE_ELEMENT_NAME,
67   XML_ROLE_CONTENT_ANY,
68   XML_ROLE_CONTENT_EMPTY,
69   XML_ROLE_CONTENT_PCDATA,
70   XML_ROLE_GROUP_OPEN,
71   XML_ROLE_GROUP_CLOSE,
72   XML_ROLE_GROUP_CLOSE_REP,
73   XML_ROLE_GROUP_CLOSE_OPT,
74   XML_ROLE_GROUP_CLOSE_PLUS,
75   XML_ROLE_GROUP_CHOICE,
76   XML_ROLE_GROUP_SEQUENCE,
77   XML_ROLE_CONTENT_ELEMENT,
78   XML_ROLE_CONTENT_ELEMENT_REP,
79   XML_ROLE_CONTENT_ELEMENT_OPT,
80   XML_ROLE_CONTENT_ELEMENT_PLUS,
81   XML_ROLE_PARAM_ENTITY_REF
82 };
83 
84 typedef struct prolog_state {
85   int (*handler)(struct prolog_state *state,
86 	         int tok,
87 		 const char *ptr,
88 		 const char *end,
89 		 const ENCODING *enc);
90   unsigned level;
91 } PROLOG_STATE;
92 
93 void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *);
94 
95 #define XmlTokenRole(state, tok, ptr, end, enc) \
96  (((state)->handler)(state, tok, ptr, end, enc))
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* not XmlRole_INCLUDED */
103