2
0

xmlrole.h 2.4 KB

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