1998-04-05 11:11:29 -04:00
|
|
|
/*
|
|
|
|
The contents of this file are subject to the Mozilla Public License
|
|
|
|
Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
compliance with the License. You may obtain a copy of the License at
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS"
|
|
|
|
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
License for the specific language governing rights and limitations
|
|
|
|
under the License.
|
|
|
|
|
|
|
|
The Original Code is expat.
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is James Clark.
|
|
|
|
Portions created by James Clark are Copyright (C) 1998
|
|
|
|
James Clark. All Rights Reserved.
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
*/
|
|
|
|
|
1997-11-14 20:05:11 -05:00
|
|
|
#ifndef XmlRole_INCLUDED
|
|
|
|
#define XmlRole_INCLUDED 1
|
|
|
|
|
|
|
|
#include "xmltok.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
enum {
|
|
|
|
XML_ROLE_ERROR = -1,
|
|
|
|
XML_ROLE_NONE = 0,
|
1997-12-10 02:44:19 -05:00
|
|
|
XML_ROLE_XML_DECL,
|
|
|
|
XML_ROLE_INSTANCE_START,
|
1997-11-14 20:05:11 -05:00
|
|
|
XML_ROLE_DOCTYPE_NAME,
|
|
|
|
XML_ROLE_DOCTYPE_SYSTEM_ID,
|
|
|
|
XML_ROLE_DOCTYPE_PUBLIC_ID,
|
|
|
|
XML_ROLE_DOCTYPE_CLOSE,
|
|
|
|
XML_ROLE_GENERAL_ENTITY_NAME,
|
|
|
|
XML_ROLE_PARAM_ENTITY_NAME,
|
|
|
|
XML_ROLE_ENTITY_VALUE,
|
|
|
|
XML_ROLE_ENTITY_SYSTEM_ID,
|
|
|
|
XML_ROLE_ENTITY_PUBLIC_ID,
|
|
|
|
XML_ROLE_ENTITY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_CHOICE,
|
|
|
|
XML_ROLE_GROUP_SEQUENCE,
|
|
|
|
XML_ROLE_CONTENT_ELEMENT,
|
|
|
|
XML_ROLE_CONTENT_ELEMENT_REP,
|
|
|
|
XML_ROLE_CONTENT_ELEMENT_OPT,
|
1997-12-13 01:39:04 -05:00
|
|
|
XML_ROLE_CONTENT_ELEMENT_PLUS,
|
|
|
|
XML_ROLE_PARAM_ENTITY_REF
|
1997-11-14 20:05:11 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct prolog_state {
|
1997-12-10 02:44:19 -05:00
|
|
|
int (*handler)(struct prolog_state *state,
|
|
|
|
int tok,
|
|
|
|
const char *ptr,
|
|
|
|
const char *end,
|
|
|
|
const ENCODING *enc);
|
1997-11-14 20:05:11 -05:00
|
|
|
unsigned level;
|
|
|
|
} PROLOG_STATE;
|
|
|
|
|
|
|
|
void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *);
|
|
|
|
|
|
|
|
#define XmlTokenRole(state, tok, ptr, end, enc) \
|
|
|
|
(((state)->handler)(state, tok, ptr, end, enc))
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* not XmlRole_INCLUDED */
|