xmlrole.h 2.4 KB

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