xmlschemastypes.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * Summary: implementation of XML Schema Datatypes
  3. * Description: module providing the XML Schema Datatypes implementation
  4. * both definition and validity checking
  5. *
  6. * Copy: See Copyright for the status of this software.
  7. *
  8. * Author: Daniel Veillard
  9. */
  10. #ifndef __XML_SCHEMA_TYPES_H__
  11. #define __XML_SCHEMA_TYPES_H__
  12. #include <libxml/xmlversion.h>
  13. #ifdef LIBXML_SCHEMAS_ENABLED
  14. #include <libxml/schemasInternals.h>
  15. #include <libxml/xmlschemas.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef enum {
  20. XML_SCHEMA_WHITESPACE_UNKNOWN = 0,
  21. XML_SCHEMA_WHITESPACE_PRESERVE = 1,
  22. XML_SCHEMA_WHITESPACE_REPLACE = 2,
  23. XML_SCHEMA_WHITESPACE_COLLAPSE = 3
  24. }
  25. xmlSchemaWhitespaceValueType;
  26. XMLPUBFUN void XMLCALL
  27. xmlSchemaInitTypes (void);
  28. XMLPUBFUN void XMLCALL
  29. xmlSchemaCleanupTypes (void);
  30. XMLPUBFUN xmlSchemaTypePtr XMLCALL
  31. xmlSchemaGetPredefinedType (const xmlChar *name,
  32. const xmlChar *ns);
  33. XMLPUBFUN int XMLCALL
  34. xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
  35. const xmlChar *value,
  36. xmlSchemaValPtr *val);
  37. XMLPUBFUN int XMLCALL
  38. xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
  39. const xmlChar *value,
  40. xmlSchemaValPtr *val,
  41. xmlNodePtr node);
  42. XMLPUBFUN int XMLCALL
  43. xmlSchemaValidateFacet (xmlSchemaTypePtr base,
  44. xmlSchemaFacetPtr facet,
  45. const xmlChar *value,
  46. xmlSchemaValPtr val);
  47. XMLPUBFUN int XMLCALL
  48. xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
  49. xmlSchemaWhitespaceValueType fws,
  50. xmlSchemaValType valType,
  51. const xmlChar *value,
  52. xmlSchemaValPtr val,
  53. xmlSchemaWhitespaceValueType ws);
  54. XMLPUBFUN void XMLCALL
  55. xmlSchemaFreeValue (xmlSchemaValPtr val);
  56. XMLPUBFUN xmlSchemaFacetPtr XMLCALL
  57. xmlSchemaNewFacet (void);
  58. XMLPUBFUN int XMLCALL
  59. xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
  60. xmlSchemaTypePtr typeDecl,
  61. xmlSchemaParserCtxtPtr ctxt,
  62. const xmlChar *name);
  63. XMLPUBFUN void XMLCALL
  64. xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
  65. XMLPUBFUN int XMLCALL
  66. xmlSchemaCompareValues (xmlSchemaValPtr x,
  67. xmlSchemaValPtr y);
  68. XMLPUBFUN xmlSchemaTypePtr XMLCALL
  69. xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
  70. XMLPUBFUN int XMLCALL
  71. xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
  72. const xmlChar *value,
  73. unsigned long actualLen,
  74. unsigned long *expectedLen);
  75. XMLPUBFUN xmlSchemaTypePtr XMLCALL
  76. xmlSchemaGetBuiltInType (xmlSchemaValType type);
  77. XMLPUBFUN int XMLCALL
  78. xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
  79. int facetType);
  80. XMLPUBFUN xmlChar * XMLCALL
  81. xmlSchemaCollapseString (const xmlChar *value);
  82. XMLPUBFUN xmlChar * XMLCALL
  83. xmlSchemaWhiteSpaceReplace (const xmlChar *value);
  84. XMLPUBFUN unsigned long XMLCALL
  85. xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
  86. XMLPUBFUN int XMLCALL
  87. xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
  88. xmlSchemaFacetPtr facet,
  89. const xmlChar *value,
  90. xmlSchemaValPtr val,
  91. unsigned long *length);
  92. XMLPUBFUN int XMLCALL
  93. xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
  94. xmlSchemaValType valType,
  95. const xmlChar *value,
  96. xmlSchemaValPtr val,
  97. unsigned long *length,
  98. xmlSchemaWhitespaceValueType ws);
  99. XMLPUBFUN int XMLCALL
  100. xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
  101. const xmlChar *value,
  102. xmlSchemaValPtr *val,
  103. xmlNodePtr node);
  104. XMLPUBFUN int XMLCALL
  105. xmlSchemaGetCanonValue (xmlSchemaValPtr val,
  106. const xmlChar **retValue);
  107. XMLPUBFUN int XMLCALL
  108. xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
  109. const xmlChar **retValue,
  110. xmlSchemaWhitespaceValueType ws);
  111. XMLPUBFUN int XMLCALL
  112. xmlSchemaValueAppend (xmlSchemaValPtr prev,
  113. xmlSchemaValPtr cur);
  114. XMLPUBFUN xmlSchemaValPtr XMLCALL
  115. xmlSchemaValueGetNext (xmlSchemaValPtr cur);
  116. XMLPUBFUN const xmlChar * XMLCALL
  117. xmlSchemaValueGetAsString (xmlSchemaValPtr val);
  118. XMLPUBFUN int XMLCALL
  119. xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
  120. XMLPUBFUN xmlSchemaValPtr XMLCALL
  121. xmlSchemaNewStringValue (xmlSchemaValType type,
  122. const xmlChar *value);
  123. XMLPUBFUN xmlSchemaValPtr XMLCALL
  124. xmlSchemaNewNOTATIONValue (const xmlChar *name,
  125. const xmlChar *ns);
  126. XMLPUBFUN xmlSchemaValPtr XMLCALL
  127. xmlSchemaNewQNameValue (const xmlChar *namespaceName,
  128. const xmlChar *localName);
  129. XMLPUBFUN int XMLCALL
  130. xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
  131. xmlSchemaWhitespaceValueType xws,
  132. xmlSchemaValPtr y,
  133. xmlSchemaWhitespaceValueType yws);
  134. XMLPUBFUN xmlSchemaValPtr XMLCALL
  135. xmlSchemaCopyValue (xmlSchemaValPtr val);
  136. XMLPUBFUN xmlSchemaValType XMLCALL
  137. xmlSchemaGetValType (xmlSchemaValPtr val);
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif /* LIBXML_SCHEMAS_ENABLED */
  142. #endif /* __XML_SCHEMA_TYPES_H__ */