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