xmlrole.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
  2. See the file COPYING for copying permission.
  3. */
  4. #ifndef XmlRole_INCLUDED
  5. #define XmlRole_INCLUDED 1
  6. #ifdef __VMS
  7. /* 0 1 2 3 0 1 2 3
  8. 1234567890123456789012345678901 1234567890123456789012345678901 */
  9. #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
  10. #endif
  11. #include "xmltok.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. enum {
  16. XML_ROLE_ERROR = -1,
  17. XML_ROLE_NONE = 0,
  18. XML_ROLE_XML_DECL,
  19. XML_ROLE_INSTANCE_START,
  20. XML_ROLE_DOCTYPE_NONE,
  21. XML_ROLE_DOCTYPE_NAME,
  22. XML_ROLE_DOCTYPE_SYSTEM_ID,
  23. XML_ROLE_DOCTYPE_PUBLIC_ID,
  24. XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
  25. XML_ROLE_DOCTYPE_CLOSE,
  26. XML_ROLE_GENERAL_ENTITY_NAME,
  27. XML_ROLE_PARAM_ENTITY_NAME,
  28. XML_ROLE_ENTITY_NONE,
  29. XML_ROLE_ENTITY_VALUE,
  30. XML_ROLE_ENTITY_SYSTEM_ID,
  31. XML_ROLE_ENTITY_PUBLIC_ID,
  32. XML_ROLE_ENTITY_COMPLETE,
  33. XML_ROLE_ENTITY_NOTATION_NAME,
  34. XML_ROLE_NOTATION_NONE,
  35. XML_ROLE_NOTATION_NAME,
  36. XML_ROLE_NOTATION_SYSTEM_ID,
  37. XML_ROLE_NOTATION_NO_SYSTEM_ID,
  38. XML_ROLE_NOTATION_PUBLIC_ID,
  39. XML_ROLE_ATTRIBUTE_NAME,
  40. XML_ROLE_ATTRIBUTE_TYPE_CDATA,
  41. XML_ROLE_ATTRIBUTE_TYPE_ID,
  42. XML_ROLE_ATTRIBUTE_TYPE_IDREF,
  43. XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
  44. XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
  45. XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
  46. XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
  47. XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
  48. XML_ROLE_ATTRIBUTE_ENUM_VALUE,
  49. XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
  50. XML_ROLE_ATTLIST_NONE,
  51. XML_ROLE_ATTLIST_ELEMENT_NAME,
  52. XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
  53. XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
  54. XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
  55. XML_ROLE_FIXED_ATTRIBUTE_VALUE,
  56. XML_ROLE_ELEMENT_NONE,
  57. XML_ROLE_ELEMENT_NAME,
  58. XML_ROLE_CONTENT_ANY,
  59. XML_ROLE_CONTENT_EMPTY,
  60. XML_ROLE_CONTENT_PCDATA,
  61. XML_ROLE_GROUP_OPEN,
  62. XML_ROLE_GROUP_CLOSE,
  63. XML_ROLE_GROUP_CLOSE_REP,
  64. XML_ROLE_GROUP_CLOSE_OPT,
  65. XML_ROLE_GROUP_CLOSE_PLUS,
  66. XML_ROLE_GROUP_CHOICE,
  67. XML_ROLE_GROUP_SEQUENCE,
  68. XML_ROLE_CONTENT_ELEMENT,
  69. XML_ROLE_CONTENT_ELEMENT_REP,
  70. XML_ROLE_CONTENT_ELEMENT_OPT,
  71. XML_ROLE_CONTENT_ELEMENT_PLUS,
  72. XML_ROLE_PI,
  73. XML_ROLE_COMMENT,
  74. #ifdef XML_DTD
  75. XML_ROLE_TEXT_DECL,
  76. XML_ROLE_IGNORE_SECT,
  77. XML_ROLE_INNER_PARAM_ENTITY_REF,
  78. #endif /* XML_DTD */
  79. XML_ROLE_PARAM_ENTITY_REF
  80. };
  81. typedef struct prolog_state {
  82. int (PTRCALL *handler) (struct prolog_state *state,
  83. int tok,
  84. const char *ptr,
  85. const char *end,
  86. const ENCODING *enc);
  87. unsigned level;
  88. int role_none;
  89. #ifdef XML_DTD
  90. unsigned includeLevel;
  91. int documentEntity;
  92. int inEntityValue;
  93. #endif /* XML_DTD */
  94. } PROLOG_STATE;
  95. void XmlPrologStateInit(PROLOG_STATE *);
  96. #ifdef XML_DTD
  97. void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
  98. #endif /* XML_DTD */
  99. #define XmlTokenRole(state, tok, ptr, end, enc) \
  100. (((state)->handler)(state, tok, ptr, end, enc))
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* not XmlRole_INCLUDED */