applied-ai-018 commited on
Commit
7c140d4
·
verified ·
1 Parent(s): fb271d1

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. ckpts/universal/global_step80/zero/13.mlp.dense_h_to_4h.weight/exp_avg_sq.pt +3 -0
  2. venv/lib/python3.10/site-packages/lxml/includes/__init__.pxd +0 -0
  3. venv/lib/python3.10/site-packages/lxml/includes/__init__.py +0 -0
  4. venv/lib/python3.10/site-packages/lxml/includes/c14n.pxd +25 -0
  5. venv/lib/python3.10/site-packages/lxml/includes/config.pxd +3 -0
  6. venv/lib/python3.10/site-packages/lxml/includes/dtdvalid.pxd +18 -0
  7. venv/lib/python3.10/site-packages/lxml/includes/etree_defs.h +379 -0
  8. venv/lib/python3.10/site-packages/lxml/includes/etreepublic.pxd +237 -0
  9. venv/lib/python3.10/site-packages/lxml/includes/extlibs/__init__.py +0 -0
  10. venv/lib/python3.10/site-packages/lxml/includes/extlibs/__pycache__/__init__.cpython-310.pyc +0 -0
  11. venv/lib/python3.10/site-packages/lxml/includes/extlibs/libcharset.h +45 -0
  12. venv/lib/python3.10/site-packages/lxml/includes/extlibs/localcharset.h +137 -0
  13. venv/lib/python3.10/site-packages/lxml/includes/extlibs/zconf.h +543 -0
  14. venv/lib/python3.10/site-packages/lxml/includes/extlibs/zlib.h +1938 -0
  15. venv/lib/python3.10/site-packages/lxml/includes/libxml/SAX.h +202 -0
  16. venv/lib/python3.10/site-packages/lxml/includes/libxml/SAX2.h +171 -0
  17. venv/lib/python3.10/site-packages/lxml/includes/libxml/c14n.h +126 -0
  18. venv/lib/python3.10/site-packages/lxml/includes/libxml/encoding.h +235 -0
  19. venv/lib/python3.10/site-packages/lxml/includes/libxml/hash.h +232 -0
  20. venv/lib/python3.10/site-packages/lxml/includes/libxml/parser.h +1384 -0
  21. venv/lib/python3.10/site-packages/lxml/includes/libxml/schemasInternals.h +959 -0
  22. venv/lib/python3.10/site-packages/lxml/includes/libxml/threads.h +87 -0
  23. venv/lib/python3.10/site-packages/lxml/includes/libxml/valid.h +450 -0
  24. venv/lib/python3.10/site-packages/lxml/includes/libxml/xlink.h +189 -0
  25. venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlIO.h +421 -0
  26. venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlschemastypes.h +152 -0
  27. venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlwriter.h +488 -0
  28. venv/lib/python3.10/site-packages/lxml/includes/libxslt/__init__.py +0 -0
  29. venv/lib/python3.10/site-packages/lxml/includes/libxslt/__pycache__/__init__.cpython-310.pyc +0 -0
  30. venv/lib/python3.10/site-packages/lxml/includes/libxslt/attributes.h +39 -0
  31. venv/lib/python3.10/site-packages/lxml/includes/libxslt/documents.h +93 -0
  32. venv/lib/python3.10/site-packages/lxml/includes/libxslt/extensions.h +262 -0
  33. venv/lib/python3.10/site-packages/lxml/includes/libxslt/extra.h +72 -0
  34. venv/lib/python3.10/site-packages/lxml/includes/libxslt/functions.h +78 -0
  35. venv/lib/python3.10/site-packages/lxml/includes/libxslt/imports.h +75 -0
  36. venv/lib/python3.10/site-packages/lxml/includes/libxslt/keys.h +53 -0
  37. venv/lib/python3.10/site-packages/lxml/includes/libxslt/namespaces.h +68 -0
  38. venv/lib/python3.10/site-packages/lxml/includes/libxslt/numbersInternals.h +73 -0
  39. venv/lib/python3.10/site-packages/lxml/includes/libxslt/pattern.h +84 -0
  40. venv/lib/python3.10/site-packages/lxml/includes/libxslt/preproc.h +43 -0
  41. venv/lib/python3.10/site-packages/lxml/includes/libxslt/security.h +104 -0
  42. venv/lib/python3.10/site-packages/lxml/includes/libxslt/templates.h +77 -0
  43. venv/lib/python3.10/site-packages/lxml/includes/libxslt/transform.h +207 -0
  44. venv/lib/python3.10/site-packages/lxml/includes/libxslt/variables.h +118 -0
  45. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xslt.h +110 -0
  46. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltInternals.h +1992 -0
  47. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltconfig.h +179 -0
  48. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltexports.h +64 -0
  49. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltlocale.h +44 -0
  50. venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltutils.h +343 -0
ckpts/universal/global_step80/zero/13.mlp.dense_h_to_4h.weight/exp_avg_sq.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f929b6ed31a1cb3d67d51eef860beb354e7d7bebd4aa33a37d6b29ff9f74bd63
3
+ size 33555627
venv/lib/python3.10/site-packages/lxml/includes/__init__.pxd ADDED
File without changes
venv/lib/python3.10/site-packages/lxml/includes/__init__.py ADDED
File without changes
venv/lib/python3.10/site-packages/lxml/includes/c14n.pxd ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from lxml.includes.tree cimport xmlDoc, xmlOutputBuffer, xmlChar
2
+ from lxml.includes.xpath cimport xmlNodeSet
3
+
4
+ cdef extern from "libxml/c14n.h" nogil:
5
+ cdef int xmlC14NDocDumpMemory(xmlDoc* doc,
6
+ xmlNodeSet* nodes,
7
+ int exclusive,
8
+ xmlChar** inclusive_ns_prefixes,
9
+ int with_comments,
10
+ xmlChar** doc_txt_ptr)
11
+
12
+ cdef int xmlC14NDocSave(xmlDoc* doc,
13
+ xmlNodeSet* nodes,
14
+ int exclusive,
15
+ xmlChar** inclusive_ns_prefixes,
16
+ int with_comments,
17
+ char* filename,
18
+ int compression)
19
+
20
+ cdef int xmlC14NDocSaveTo(xmlDoc* doc,
21
+ xmlNodeSet* nodes,
22
+ int exclusive,
23
+ xmlChar** inclusive_ns_prefixes,
24
+ int with_comments,
25
+ xmlOutputBuffer* buffer)
venv/lib/python3.10/site-packages/lxml/includes/config.pxd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ cdef extern from "etree_defs.h":
2
+ cdef bint ENABLE_THREADING
3
+ cdef bint ENABLE_SCHEMATRON
venv/lib/python3.10/site-packages/lxml/includes/dtdvalid.pxd ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from lxml.includes cimport tree
2
+ from lxml.includes.tree cimport xmlDoc, xmlDtd
3
+
4
+ cdef extern from "libxml/valid.h" nogil:
5
+ ctypedef void (*xmlValidityErrorFunc)(void * ctx, const char * msg, ...) noexcept
6
+ ctypedef void (*xmlValidityWarningFunc)(void * ctx, const char * msg, ...) noexcept
7
+
8
+ ctypedef struct xmlValidCtxt:
9
+ void *userData
10
+ xmlValidityErrorFunc error
11
+ xmlValidityWarningFunc warning
12
+
13
+ cdef xmlValidCtxt* xmlNewValidCtxt()
14
+ cdef void xmlFreeValidCtxt(xmlValidCtxt* cur)
15
+
16
+ cdef int xmlValidateDtd(xmlValidCtxt* ctxt, xmlDoc* doc, xmlDtd* dtd)
17
+ cdef tree.xmlElement* xmlGetDtdElementDesc(
18
+ xmlDtd* dtd, tree.const_xmlChar* name)
venv/lib/python3.10/site-packages/lxml/includes/etree_defs.h ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef HAS_ETREE_DEFS_H
2
+ #define HAS_ETREE_DEFS_H
3
+
4
+ /* quick check for Python/libxml2/libxslt devel setup */
5
+ #include "Python.h"
6
+ #ifndef PY_VERSION_HEX
7
+ # error the development package of Python (header files etc.) is not installed correctly
8
+ #elif PY_VERSION_HEX < 0x03060000
9
+ # error this version of lxml requires Python 3.6 or later
10
+ #endif
11
+
12
+ #include "libxml/xmlversion.h"
13
+ #ifndef LIBXML_VERSION
14
+ # error the development package of libxml2 (header files etc.) is not installed correctly
15
+ #elif LIBXML_VERSION < 20700
16
+ # error minimum required version of libxml2 is 2.7.0
17
+ #endif
18
+
19
+ #include "libxslt/xsltconfig.h"
20
+ #ifndef LIBXSLT_VERSION
21
+ # error the development package of libxslt (header files etc.) is not installed correctly
22
+ #elif LIBXSLT_VERSION < 10123
23
+ # error minimum required version of libxslt is 1.1.23
24
+ #endif
25
+
26
+
27
+ /* v_arg functions */
28
+ #define va_int(ap) va_arg(ap, int)
29
+ #define va_charptr(ap) va_arg(ap, char *)
30
+
31
+ #ifdef PYPY_VERSION
32
+ # define IS_PYPY 1
33
+ #else
34
+ # define IS_PYPY 0
35
+ #endif
36
+
37
+ /* unused */
38
+ #define IS_PYTHON2 0
39
+ #define IS_PYTHON3 1
40
+ #undef LXML_UNICODE_STRINGS
41
+ #define LXML_UNICODE_STRINGS 1
42
+
43
+ #if !IS_PYPY
44
+ # define PyWeakref_LockObject(obj) (NULL)
45
+ #endif
46
+
47
+ /* Threading is not currently supported by PyPy */
48
+ #if IS_PYPY
49
+ # ifndef WITHOUT_THREADING
50
+ # define WITHOUT_THREADING
51
+ # endif
52
+ #endif
53
+
54
+ #if IS_PYPY
55
+ # ifndef PyUnicode_FromFormat
56
+ # define PyUnicode_FromFormat PyString_FromFormat
57
+ # endif
58
+ # if !defined(PyBytes_FromFormat)
59
+ # ifdef PyString_FromFormat
60
+ # define PyBytes_FromFormat PyString_FromFormat
61
+ # else
62
+ #include <stdarg.h>
63
+ static PyObject* PyBytes_FromFormat(const char* format, ...) {
64
+ PyObject *string;
65
+ va_list vargs;
66
+ #ifdef HAVE_STDARG_PROTOTYPES
67
+ va_start(vargs, format);
68
+ #else
69
+ va_start(vargs);
70
+ #endif
71
+ string = PyUnicode_FromFormatV(format, vargs);
72
+ va_end(vargs);
73
+ if (string && PyUnicode_Check(string)) {
74
+ PyObject *bstring = PyUnicode_AsUTF8String(string);
75
+ Py_DECREF(string);
76
+ string = bstring;
77
+ }
78
+ if (string && !PyBytes_CheckExact(string)) {
79
+ Py_DECREF(string);
80
+ string = NULL;
81
+ PyErr_SetString(PyExc_TypeError, "String formatting and encoding failed to return bytes object");
82
+ }
83
+ return string;
84
+ }
85
+ # endif
86
+ # endif
87
+ #endif
88
+
89
+ #if PY_VERSION_HEX >= 0x030B00A1
90
+ /* Python 3.12 doesn't have wstr Unicode strings any more. */
91
+ #undef PyUnicode_GET_DATA_SIZE
92
+ #define PyUnicode_GET_DATA_SIZE(ustr) (0)
93
+ #undef PyUnicode_AS_DATA
94
+ #define PyUnicode_AS_DATA(ustr) (NULL)
95
+ #undef PyUnicode_IS_READY
96
+ #define PyUnicode_IS_READY(ustr) (1)
97
+ #endif
98
+
99
+ #ifdef WITHOUT_THREADING
100
+ # undef PyEval_SaveThread
101
+ # define PyEval_SaveThread() (NULL)
102
+ # undef PyEval_RestoreThread
103
+ # define PyEval_RestoreThread(state) if (state); else {}
104
+ # undef PyGILState_Ensure
105
+ # define PyGILState_Ensure() (PyGILState_UNLOCKED)
106
+ # undef PyGILState_Release
107
+ # define PyGILState_Release(state) if (state); else {}
108
+ # undef Py_UNBLOCK_THREADS
109
+ # define Py_UNBLOCK_THREADS _save = NULL;
110
+ # undef Py_BLOCK_THREADS
111
+ # define Py_BLOCK_THREADS if (_save); else {}
112
+ #endif
113
+
114
+ #ifdef WITHOUT_THREADING
115
+ # define ENABLE_THREADING 0
116
+ #else
117
+ # define ENABLE_THREADING 1
118
+ #endif
119
+
120
+ #if LIBXML_VERSION < 20704
121
+ /* FIXME: hack to make new error reporting compile in old libxml2 versions */
122
+ # define xmlStructuredErrorContext NULL
123
+ # define xmlXIncludeProcessTreeFlagsData(n,o,d) xmlXIncludeProcessTreeFlags(n,o)
124
+ #endif
125
+
126
+ /* schematron was added in libxml2 2.6.21 */
127
+ #ifdef LIBXML_SCHEMATRON_ENABLED
128
+ # define ENABLE_SCHEMATRON 1
129
+ #else
130
+ # define ENABLE_SCHEMATRON 0
131
+ # define XML_SCHEMATRON_OUT_QUIET 0
132
+ # define XML_SCHEMATRON_OUT_XML 0
133
+ # define XML_SCHEMATRON_OUT_ERROR 0
134
+ typedef void xmlSchematron;
135
+ typedef void xmlSchematronParserCtxt;
136
+ typedef void xmlSchematronValidCtxt;
137
+ # define xmlSchematronNewDocParserCtxt(doc) NULL
138
+ # define xmlSchematronNewParserCtxt(file) NULL
139
+ # define xmlSchematronParse(ctxt) NULL
140
+ # define xmlSchematronFreeParserCtxt(ctxt)
141
+ # define xmlSchematronFree(schema)
142
+ # define xmlSchematronNewValidCtxt(schema, options) NULL
143
+ # define xmlSchematronValidateDoc(ctxt, doc) 0
144
+ # define xmlSchematronFreeValidCtxt(ctxt)
145
+ # define xmlSchematronSetValidStructuredErrors(ctxt, errorfunc, data)
146
+ #endif
147
+
148
+ #if LIBXML_VERSION < 20708
149
+ # define HTML_PARSE_NODEFDTD 4
150
+ #endif
151
+ #if LIBXML_VERSION < 20900
152
+ # define XML_PARSE_BIG_LINES 4194304
153
+ #endif
154
+
155
+ #include "libxml/tree.h"
156
+ #ifndef LIBXML2_NEW_BUFFER
157
+ typedef xmlBuffer xmlBuf;
158
+ # define xmlBufContent(buf) xmlBufferContent(buf)
159
+ # define xmlBufUse(buf) xmlBufferLength(buf)
160
+ #endif
161
+
162
+ /* libexslt 1.1.25+ support EXSLT functions in XPath */
163
+ #if LIBXSLT_VERSION < 10125
164
+ #define exsltDateXpathCtxtRegister(ctxt, prefix)
165
+ #define exsltSetsXpathCtxtRegister(ctxt, prefix)
166
+ #define exsltMathXpathCtxtRegister(ctxt, prefix)
167
+ #define exsltStrXpathCtxtRegister(ctxt, prefix)
168
+ #endif
169
+
170
+ #define LXML_GET_XSLT_ENCODING(result_var, style) XSLT_GET_IMPORT_PTR(result_var, style, encoding)
171
+
172
+ /* work around MSDEV 6.0 */
173
+ #if (_MSC_VER == 1200) && (WINVER < 0x0500)
174
+ long _ftol( double ); //defined by VC6 C libs
175
+ long _ftol2( double dblSource ) { return _ftol( dblSource ); }
176
+ #endif
177
+
178
+ #ifdef __GNUC__
179
+ /* Test for GCC > 2.95 */
180
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
181
+ #define unlikely_condition(x) __builtin_expect((x), 0)
182
+ #else /* __GNUC__ > 2 ... */
183
+ #define unlikely_condition(x) (x)
184
+ #endif /* __GNUC__ > 2 ... */
185
+ #else /* __GNUC__ */
186
+ #define unlikely_condition(x) (x)
187
+ #endif /* __GNUC__ */
188
+
189
+ #ifndef Py_TYPE
190
+ #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
191
+ #endif
192
+
193
+ #define PY_NEW(T) \
194
+ (((PyTypeObject*)(T))->tp_new( \
195
+ (PyTypeObject*)(T), __pyx_empty_tuple, NULL))
196
+
197
+ #define _fqtypename(o) ((Py_TYPE(o))->tp_name)
198
+
199
+ #define lxml_malloc(count, item_size) \
200
+ (unlikely_condition((size_t)(count) > (size_t) (PY_SSIZE_T_MAX / item_size)) ? NULL : \
201
+ (PyMem_Malloc((count) * item_size)))
202
+
203
+ #define lxml_realloc(mem, count, item_size) \
204
+ (unlikely_condition((size_t)(count) > (size_t) (PY_SSIZE_T_MAX / item_size)) ? NULL : \
205
+ (PyMem_Realloc(mem, (count) * item_size)))
206
+
207
+ #define lxml_free(mem) PyMem_Free(mem)
208
+
209
+ #define _isString(obj) (PyUnicode_Check(obj) || PyBytes_Check(obj))
210
+
211
+ #define _isElement(c_node) \
212
+ (((c_node)->type == XML_ELEMENT_NODE) || \
213
+ ((c_node)->type == XML_COMMENT_NODE) || \
214
+ ((c_node)->type == XML_ENTITY_REF_NODE) || \
215
+ ((c_node)->type == XML_PI_NODE))
216
+
217
+ #define _isElementOrXInclude(c_node) \
218
+ (_isElement(c_node) || \
219
+ ((c_node)->type == XML_XINCLUDE_START) || \
220
+ ((c_node)->type == XML_XINCLUDE_END))
221
+
222
+ #define _getNs(c_node) \
223
+ (((c_node)->ns == 0) ? 0 : ((c_node)->ns->href))
224
+
225
+
226
+ #include "string.h"
227
+ static void* lxml_unpack_xmldoc_capsule(PyObject* capsule, int* is_owned) {
228
+ xmlDoc *c_doc;
229
+ void *context;
230
+ *is_owned = 0;
231
+ if (unlikely_condition(!PyCapsule_IsValid(capsule, (const char*)"libxml2:xmlDoc"))) {
232
+ PyErr_SetString(
233
+ PyExc_TypeError,
234
+ "Not a valid capsule. The capsule argument must be a capsule object with name libxml2:xmlDoc");
235
+ return NULL;
236
+ }
237
+ c_doc = (xmlDoc*) PyCapsule_GetPointer(capsule, (const char*)"libxml2:xmlDoc");
238
+ if (unlikely_condition(!c_doc)) return NULL;
239
+
240
+ if (unlikely_condition(c_doc->type != XML_DOCUMENT_NODE && c_doc->type != XML_HTML_DOCUMENT_NODE)) {
241
+ PyErr_Format(
242
+ PyExc_ValueError,
243
+ "Illegal document provided: expected XML or HTML, found %d", (int)c_doc->type);
244
+ return NULL;
245
+ }
246
+
247
+ context = PyCapsule_GetContext(capsule);
248
+ if (unlikely_condition(!context && PyErr_Occurred())) return NULL;
249
+ if (context && strcmp((const char*) context, "destructor:xmlFreeDoc") == 0) {
250
+ /* take ownership by setting destructor to NULL */
251
+ if (PyCapsule_SetDestructor(capsule, NULL) == 0) {
252
+ /* ownership transferred => invalidate capsule by clearing its name */
253
+ if (unlikely_condition(PyCapsule_SetName(capsule, NULL))) {
254
+ /* this should never happen since everything above succeeded */
255
+ xmlFreeDoc(c_doc);
256
+ return NULL;
257
+ }
258
+ *is_owned = 1;
259
+ }
260
+ }
261
+ return c_doc;
262
+ }
263
+
264
+ /* Macro pair implementation of a depth first tree walker
265
+ *
266
+ * Calls the code block between the BEGIN and END macros for all elements
267
+ * below c_tree_top (exclusively), starting at c_node (inclusively iff
268
+ * 'inclusive' is 1). The _ELEMENT_ variants will only stop on nodes
269
+ * that match _isElement(), the normal variant will stop on every node
270
+ * except text nodes.
271
+ *
272
+ * To traverse the node and all of its children and siblings in Pyrex, call
273
+ * cdef xmlNode* some_node
274
+ * BEGIN_FOR_EACH_ELEMENT_FROM(some_node.parent, some_node, 1)
275
+ * # do something with some_node
276
+ * END_FOR_EACH_ELEMENT_FROM(some_node)
277
+ *
278
+ * To traverse only the children and siblings of a node, call
279
+ * cdef xmlNode* some_node
280
+ * BEGIN_FOR_EACH_ELEMENT_FROM(some_node.parent, some_node, 0)
281
+ * # do something with some_node
282
+ * END_FOR_EACH_ELEMENT_FROM(some_node)
283
+ *
284
+ * To traverse only the children, do:
285
+ * cdef xmlNode* some_node
286
+ * some_node = parent_node.children
287
+ * BEGIN_FOR_EACH_ELEMENT_FROM(parent_node, some_node, 1)
288
+ * # do something with some_node
289
+ * END_FOR_EACH_ELEMENT_FROM(some_node)
290
+ *
291
+ * NOTE: 'some_node' MUST be a plain 'xmlNode*' !
292
+ *
293
+ * NOTE: parent modification during the walk can divert the iterator, but
294
+ * should not segfault !
295
+ */
296
+
297
+ #define _LX__ELEMENT_MATCH(c_node, only_elements) \
298
+ ((only_elements) ? (_isElement(c_node)) : 1)
299
+
300
+ #define _LX__ADVANCE_TO_NEXT(c_node, only_elements) \
301
+ while ((c_node != 0) && (!_LX__ELEMENT_MATCH(c_node, only_elements))) \
302
+ c_node = c_node->next;
303
+
304
+ #define _LX__TRAVERSE_TO_NEXT(c_stop_node, c_node, only_elements) \
305
+ { \
306
+ /* walk through children first */ \
307
+ xmlNode* _lx__next = c_node->children; \
308
+ if (_lx__next != 0) { \
309
+ if (c_node->type == XML_ENTITY_REF_NODE || c_node->type == XML_DTD_NODE) { \
310
+ _lx__next = 0; \
311
+ } else { \
312
+ _LX__ADVANCE_TO_NEXT(_lx__next, only_elements) \
313
+ } \
314
+ } \
315
+ if ((_lx__next == 0) && (c_node != c_stop_node)) { \
316
+ /* try siblings */ \
317
+ _lx__next = c_node->next; \
318
+ _LX__ADVANCE_TO_NEXT(_lx__next, only_elements) \
319
+ /* back off through parents */ \
320
+ while (_lx__next == 0) { \
321
+ c_node = c_node->parent; \
322
+ if (c_node == 0) \
323
+ break; \
324
+ if (c_node == c_stop_node) \
325
+ break; \
326
+ if ((only_elements) && !_isElement(c_node)) \
327
+ break; \
328
+ /* we already traversed the parents -> siblings */ \
329
+ _lx__next = c_node->next; \
330
+ _LX__ADVANCE_TO_NEXT(_lx__next, only_elements) \
331
+ } \
332
+ } \
333
+ c_node = _lx__next; \
334
+ }
335
+
336
+ #define _LX__BEGIN_FOR_EACH_FROM(c_tree_top, c_node, inclusive, only_elements) \
337
+ { \
338
+ if (c_node != 0) { \
339
+ const xmlNode* _lx__tree_top = (c_tree_top); \
340
+ const int _lx__only_elements = (only_elements); \
341
+ /* make sure we start at an element */ \
342
+ if (!_LX__ELEMENT_MATCH(c_node, _lx__only_elements)) { \
343
+ /* we skip the node, so 'inclusive' is irrelevant */ \
344
+ if (c_node == _lx__tree_top) \
345
+ c_node = 0; /* nothing to traverse */ \
346
+ else { \
347
+ c_node = c_node->next; \
348
+ _LX__ADVANCE_TO_NEXT(c_node, _lx__only_elements) \
349
+ } \
350
+ } else if (! (inclusive)) { \
351
+ /* skip the first node */ \
352
+ _LX__TRAVERSE_TO_NEXT(_lx__tree_top, c_node, _lx__only_elements) \
353
+ } \
354
+ \
355
+ /* now run the user code on the elements we find */ \
356
+ while (c_node != 0) { \
357
+ /* here goes the code to be run for each element */
358
+
359
+ #define _LX__END_FOR_EACH_FROM(c_node) \
360
+ _LX__TRAVERSE_TO_NEXT(_lx__tree_top, c_node, _lx__only_elements) \
361
+ } \
362
+ } \
363
+ }
364
+
365
+
366
+ #define BEGIN_FOR_EACH_ELEMENT_FROM(c_tree_top, c_node, inclusive) \
367
+ _LX__BEGIN_FOR_EACH_FROM(c_tree_top, c_node, inclusive, 1)
368
+
369
+ #define END_FOR_EACH_ELEMENT_FROM(c_node) \
370
+ _LX__END_FOR_EACH_FROM(c_node)
371
+
372
+ #define BEGIN_FOR_EACH_FROM(c_tree_top, c_node, inclusive) \
373
+ _LX__BEGIN_FOR_EACH_FROM(c_tree_top, c_node, inclusive, 0)
374
+
375
+ #define END_FOR_EACH_FROM(c_node) \
376
+ _LX__END_FOR_EACH_FROM(c_node)
377
+
378
+
379
+ #endif /* HAS_ETREE_DEFS_H */
venv/lib/python3.10/site-packages/lxml/includes/etreepublic.pxd ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # public Cython/C interface to lxml.etree
2
+
3
+ from lxml.includes cimport tree
4
+ from lxml.includes.tree cimport const_xmlChar
5
+
6
+ cdef extern from "lxml-version.h":
7
+ cdef char* LXML_VERSION_STRING
8
+
9
+ cdef extern from "etree_defs.h":
10
+ # test if c_node is considered an Element (i.e. Element, Comment, etc.)
11
+ cdef bint _isElement(tree.xmlNode* c_node) noexcept nogil
12
+
13
+ # return the namespace URI of the node or NULL
14
+ cdef const_xmlChar* _getNs(tree.xmlNode* node) noexcept nogil
15
+
16
+ # pair of macros for tree traversal
17
+ cdef void BEGIN_FOR_EACH_ELEMENT_FROM(tree.xmlNode* tree_top,
18
+ tree.xmlNode* start_node,
19
+ int start_node_inclusive) noexcept nogil
20
+ cdef void END_FOR_EACH_ELEMENT_FROM(tree.xmlNode* start_node) noexcept nogil
21
+
22
+ cdef extern from "etree_api.h":
23
+
24
+ # first function to call!
25
+ cdef int import_lxml__etree() except -1
26
+
27
+ ##########################################################################
28
+ # public ElementTree API classes
29
+
30
+ cdef class lxml.etree._Document [ object LxmlDocument ]:
31
+ cdef tree.xmlDoc* _c_doc
32
+
33
+ cdef class lxml.etree._Element [ object LxmlElement ]:
34
+ cdef _Document _doc
35
+ cdef tree.xmlNode* _c_node
36
+
37
+ cdef class lxml.etree.ElementBase(_Element) [ object LxmlElementBase ]:
38
+ pass
39
+
40
+ cdef class lxml.etree._ElementTree [ object LxmlElementTree ]:
41
+ cdef _Document _doc
42
+ cdef _Element _context_node
43
+
44
+ cdef class lxml.etree.ElementClassLookup [ object LxmlElementClassLookup ]:
45
+ cdef object (*_lookup_function)(object, _Document, tree.xmlNode*)
46
+
47
+ cdef class lxml.etree.FallbackElementClassLookup(ElementClassLookup) \
48
+ [ object LxmlFallbackElementClassLookup ]:
49
+ cdef ElementClassLookup fallback
50
+ cdef object (*_fallback_function)(object, _Document, tree.xmlNode*)
51
+
52
+ ##########################################################################
53
+ # creating Element objects
54
+
55
+ # create an Element for a C-node in the Document
56
+ cdef _Element elementFactory(_Document doc, tree.xmlNode* c_node)
57
+
58
+ # create an ElementTree for an Element
59
+ cdef _ElementTree elementTreeFactory(_Element context_node)
60
+
61
+ # create an ElementTree subclass for an Element
62
+ cdef _ElementTree newElementTree(_Element context_node, object subclass)
63
+
64
+ # create an ElementTree from an external document
65
+ cdef _ElementTree adoptExternalDocument(tree.xmlDoc* c_doc, parser, bint is_owned)
66
+
67
+ # create a new Element for an existing or new document (doc = None)
68
+ # builds Python object after setting text, tail, namespaces and attributes
69
+ cdef _Element makeElement(tag, _Document doc, parser,
70
+ text, tail, attrib, nsmap)
71
+
72
+ # create a new SubElement for an existing parent
73
+ # builds Python object after setting text, tail, namespaces and attributes
74
+ cdef _Element makeSubElement(_Element parent, tag, text, tail,
75
+ attrib, nsmap)
76
+
77
+ # deep copy a node to include it in the Document
78
+ cdef _Element deepcopyNodeToDocument(_Document doc, tree.xmlNode* c_root)
79
+
80
+ # set the internal lookup function for Element/Comment/PI classes
81
+ # use setElementClassLookupFunction(NULL, None) to reset it
82
+ # note that the lookup function *must always* return an _Element subclass!
83
+ cdef void setElementClassLookupFunction(
84
+ object (*function)(object, _Document, tree.xmlNode*), object state)
85
+
86
+ # lookup function that always returns the default Element class
87
+ # note that the first argument is expected to be None!
88
+ cdef object lookupDefaultElementClass(_1, _Document _2,
89
+ tree.xmlNode* c_node)
90
+
91
+ # lookup function for namespace/tag specific Element classes
92
+ # note that the first argument is expected to be None!
93
+ cdef object lookupNamespaceElementClass(_1, _Document _2,
94
+ tree.xmlNode* c_node)
95
+
96
+ # call the fallback lookup function of a FallbackElementClassLookup
97
+ cdef object callLookupFallback(FallbackElementClassLookup lookup,
98
+ _Document doc, tree.xmlNode* c_node)
99
+
100
+ ##########################################################################
101
+ # XML attribute access
102
+
103
+ # return an attribute value for a C attribute on a C element node
104
+ cdef unicode attributeValue(tree.xmlNode* c_element,
105
+ tree.xmlAttr* c_attrib_node)
106
+
107
+ # return the value of the attribute with 'ns' and 'name' (or None)
108
+ cdef unicode attributeValueFromNsName(tree.xmlNode* c_element,
109
+ const_xmlChar* c_ns, const_xmlChar* c_name)
110
+
111
+ # return the value of attribute "{ns}name", or the default value
112
+ cdef object getAttributeValue(_Element element, key, default)
113
+
114
+ # return an iterator over attribute names (1), values (2) or items (3)
115
+ # attributes must not be removed during iteration!
116
+ cdef object iterattributes(_Element element, int keysvalues)
117
+
118
+ # return the list of all attribute names (1), values (2) or items (3)
119
+ cdef list collectAttributes(tree.xmlNode* c_element, int keysvalues)
120
+
121
+ # set an attribute value on an element
122
+ # on failure, sets an exception and returns -1
123
+ cdef int setAttributeValue(_Element element, key, value) except -1
124
+
125
+ # delete an attribute
126
+ # on failure, sets an exception and returns -1
127
+ cdef int delAttribute(_Element element, key) except -1
128
+
129
+ # delete an attribute based on name and namespace URI
130
+ # returns -1 if the attribute was not found (no exception)
131
+ cdef int delAttributeFromNsName(tree.xmlNode* c_element,
132
+ const_xmlChar* c_href, const_xmlChar* c_name) noexcept
133
+
134
+ ##########################################################################
135
+ # XML node helper functions
136
+
137
+ # check if the element has at least one child
138
+ cdef bint hasChild(tree.xmlNode* c_node) noexcept nogil
139
+
140
+ # find child element number 'index' (supports negative indexes)
141
+ cdef tree.xmlNode* findChild(tree.xmlNode* c_node,
142
+ Py_ssize_t index) noexcept nogil
143
+
144
+ # find child element number 'index' starting at first one
145
+ cdef tree.xmlNode* findChildForwards(tree.xmlNode* c_node,
146
+ Py_ssize_t index) nogil
147
+
148
+ # find child element number 'index' starting at last one
149
+ cdef tree.xmlNode* findChildBackwards(tree.xmlNode* c_node,
150
+ Py_ssize_t index) nogil
151
+
152
+ # return next/previous sibling element of the node
153
+ cdef tree.xmlNode* nextElement(tree.xmlNode* c_node) nogil
154
+ cdef tree.xmlNode* previousElement(tree.xmlNode* c_node) nogil
155
+
156
+ ##########################################################################
157
+ # iterators (DEPRECATED API, don't use in new code!)
158
+
159
+ cdef class lxml.etree._ElementTagMatcher [ object LxmlElementTagMatcher ]:
160
+ cdef char* _href
161
+ cdef char* _name
162
+
163
+ # store "{ns}tag" (or None) filter for this matcher or element iterator
164
+ # ** unless _href *and* _name are set up 'by hand', this function *must*
165
+ # ** be called when subclassing the iterator below!
166
+ cdef void initTagMatch(_ElementTagMatcher matcher, tag)
167
+
168
+ cdef class lxml.etree._ElementIterator(_ElementTagMatcher) [
169
+ object LxmlElementIterator ]:
170
+ cdef _Element _node
171
+ cdef tree.xmlNode* (*_next_element)(tree.xmlNode*)
172
+
173
+ # store the initial node of the iterator if it matches the required tag
174
+ # or its next matching sibling if not
175
+ cdef void iteratorStoreNext(_ElementIterator iterator, _Element node)
176
+
177
+ ##########################################################################
178
+ # other helper functions
179
+
180
+ # check if a C node matches a tag name and namespace
181
+ # (NULL allowed for each => always matches)
182
+ cdef int tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name)
183
+
184
+ # convert a UTF-8 char* to a Python unicode string
185
+ cdef unicode pyunicode(const_xmlChar* s)
186
+
187
+ # convert the string to UTF-8 using the normal lxml.etree semantics
188
+ cdef bytes utf8(object s)
189
+
190
+ # split a tag into a (URI, name) tuple, return None as URI for '{}tag'
191
+ cdef tuple getNsTag(object tag)
192
+
193
+ # split a tag into a (URI, name) tuple, return b'' as URI for '{}tag'
194
+ cdef tuple getNsTagWithEmptyNs(object tag)
195
+
196
+ # get the "{ns}tag" string for a C node
197
+ cdef unicode namespacedName(tree.xmlNode* c_node)
198
+
199
+ # get the "{ns}tag" string for a href/tagname pair (c_ns may be NULL)
200
+ cdef unicode namespacedNameFromNsName(const_xmlChar* c_ns, const_xmlChar* c_tag)
201
+
202
+ # check if the node has a text value (which may be '')
203
+ cdef bint hasText(tree.xmlNode* c_node) nogil
204
+
205
+ # check if the node has a tail value (which may be '')
206
+ cdef bint hasTail(tree.xmlNode* c_node) nogil
207
+
208
+ # get the text content of an element (or None)
209
+ cdef unicode textOf(tree.xmlNode* c_node)
210
+
211
+ # get the tail content of an element (or None)
212
+ cdef unicode tailOf(tree.xmlNode* c_node)
213
+
214
+ # set the text value of an element
215
+ cdef int setNodeText(tree.xmlNode* c_node, text) except -1
216
+
217
+ # set the tail text value of an element
218
+ cdef int setTailText(tree.xmlNode* c_node, text) except -1
219
+
220
+ # append an element to the children of a parent element
221
+ # deprecated: don't use, does not propagate exceptions!
222
+ # use appendChildToElement() instead
223
+ cdef void appendChild(_Element parent, _Element child)
224
+
225
+ # added in lxml 3.3 as a safe replacement for appendChild()
226
+ # return -1 for exception, 0 for ok
227
+ cdef int appendChildToElement(_Element parent, _Element child) except -1
228
+
229
+ # recursively lookup a namespace in element or ancestors, or create it
230
+ cdef tree.xmlNs* findOrBuildNodeNsPrefix(
231
+ _Document doc, tree.xmlNode* c_node, const_xmlChar* href, const_xmlChar* prefix)
232
+
233
+ # find the Document of an Element, ElementTree or Document (itself!)
234
+ cdef _Document documentOrRaise(object input)
235
+
236
+ # find the root Element of an Element (itself!), ElementTree or Document
237
+ cdef _Element rootNodeOrRaise(object input)
venv/lib/python3.10/site-packages/lxml/includes/extlibs/__init__.py ADDED
File without changes
venv/lib/python3.10/site-packages/lxml/includes/extlibs/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (189 Bytes). View file
 
venv/lib/python3.10/site-packages/lxml/includes/extlibs/libcharset.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright (C) 2003 Free Software Foundation, Inc.
2
+ This file is part of the GNU CHARSET Library.
3
+
4
+ The GNU CHARSET Library is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Lesser General Public License as
6
+ published by the Free Software Foundation; either version 2 of the
7
+ License, or (at your option) any later version.
8
+
9
+ The GNU CHARSET Library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public License
15
+ along with the GNU CHARSET Library; see the file COPYING.LIB. If not,
16
+ see <https://www.gnu.org/licenses/>. */
17
+
18
+ #ifndef _LIBCHARSET_H
19
+ #define _LIBCHARSET_H
20
+
21
+ #include <localcharset.h>
22
+
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+
29
+ /* Support for relocatable packages. */
30
+
31
+ /* Sets the original and the current installation prefix of the package.
32
+ Relocation simply replaces a pathname starting with the original prefix
33
+ by the corresponding pathname with the current prefix instead. Both
34
+ prefixes should be directory names without trailing slash (i.e. use ""
35
+ instead of "/"). */
36
+ extern void libcharset_set_relocation_prefix (const char *orig_prefix,
37
+ const char *curr_prefix);
38
+
39
+
40
+ #ifdef __cplusplus
41
+ }
42
+ #endif
43
+
44
+
45
+ #endif /* _LIBCHARSET_H */
venv/lib/python3.10/site-packages/lxml/includes/extlibs/localcharset.h ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Determine a canonical name for the current locale's character encoding.
2
+ Copyright (C) 2000-2003, 2009-2019 Free Software Foundation, Inc.
3
+ This file is part of the GNU CHARSET Library.
4
+
5
+ This program is free software; you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as published
7
+ by the Free Software Foundation; either version 2, or (at your option)
8
+ any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
17
+
18
+ #ifndef _LOCALCHARSET_H
19
+ #define _LOCALCHARSET_H
20
+
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+
27
+ /* Determine the current locale's character encoding, and canonicalize it
28
+ into one of the canonical names listed below.
29
+ The result must not be freed; it is statically allocated. The result
30
+ becomes invalid when setlocale() is used to change the global locale, or
31
+ when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
32
+ is changed; threads in multithreaded programs should not do this.
33
+ If the canonical name cannot be determined, the result is a non-canonical
34
+ name. */
35
+ extern const char * locale_charset (void);
36
+
37
+ /* About GNU canonical names for character encodings:
38
+
39
+ Every canonical name must be supported by GNU libiconv. Support by GNU libc
40
+ is also desirable.
41
+
42
+ The name is case insensitive. Usually an upper case MIME charset name is
43
+ preferred.
44
+
45
+ The current list of these GNU canonical names is:
46
+
47
+ name MIME? used by which systems
48
+ (darwin = Mac OS X, windows = native Windows)
49
+
50
+ ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin
51
+ ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
52
+ ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
53
+ ISO-8859-3 Y glibc solaris cygwin
54
+ ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin
55
+ ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
56
+ ISO-8859-6 Y glibc aix hpux solaris cygwin
57
+ ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
58
+ ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos
59
+ ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos
60
+ ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
61
+ ISO-8859-14 glibc cygwin
62
+ ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
63
+ KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin
64
+ KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
65
+ KOI8-T glibc
66
+ CP437 dos
67
+ CP775 dos
68
+ CP850 aix osf dos
69
+ CP852 dos
70
+ CP855 dos
71
+ CP856 aix
72
+ CP857 dos
73
+ CP861 dos
74
+ CP862 dos
75
+ CP864 dos
76
+ CP865 dos
77
+ CP866 freebsd netbsd openbsd darwin dos
78
+ CP869 dos
79
+ CP874 windows dos
80
+ CP922 aix
81
+ CP932 aix cygwin windows dos
82
+ CP943 aix zos
83
+ CP949 osf darwin windows dos
84
+ CP950 windows dos
85
+ CP1046 aix
86
+ CP1124 aix
87
+ CP1125 dos
88
+ CP1129 aix
89
+ CP1131 freebsd darwin
90
+ CP1250 windows
91
+ CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
92
+ CP1252 aix windows
93
+ CP1253 windows
94
+ CP1254 windows
95
+ CP1255 glibc windows
96
+ CP1256 windows
97
+ CP1257 windows
98
+ GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
99
+ EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
100
+ EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
101
+ EUC-TW glibc aix hpux irix osf solaris netbsd
102
+ BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
103
+ BIG5-HKSCS glibc hpux solaris netbsd darwin
104
+ GBK glibc aix osf solaris freebsd darwin cygwin windows dos
105
+ GB18030 glibc hpux solaris freebsd netbsd darwin
106
+ SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
107
+ JOHAB glibc solaris windows
108
+ TIS-620 glibc aix hpux osf solaris cygwin zos
109
+ VISCII Y glibc
110
+ TCVN5712-1 glibc
111
+ ARMSCII-8 glibc freebsd netbsd darwin
112
+ GEORGIAN-PS glibc cygwin
113
+ PT154 glibc netbsd cygwin
114
+ HP-ROMAN8 hpux
115
+ HP-ARABIC8 hpux
116
+ HP-GREEK8 hpux
117
+ HP-HEBREW8 hpux
118
+ HP-TURKISH8 hpux
119
+ HP-KANA8 hpux
120
+ DEC-KANJI osf
121
+ DEC-HANYU osf
122
+ UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos
123
+
124
+ Note: Names which are not marked as being a MIME name should not be used in
125
+ Internet protocols for information interchange (mail, news, etc.).
126
+
127
+ Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
128
+ must understand both names and treat them as equivalent.
129
+ */
130
+
131
+
132
+ #ifdef __cplusplus
133
+ }
134
+ #endif
135
+
136
+
137
+ #endif /* _LOCALCHARSET_H */
venv/lib/python3.10/site-packages/lxml/includes/extlibs/zconf.h ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* zconf.h -- configuration of the zlib compression library
2
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
3
+ * For conditions of distribution and use, see copyright notice in zlib.h
4
+ */
5
+
6
+ /* @(#) $Id$ */
7
+
8
+ #ifndef ZCONF_H
9
+ #define ZCONF_H
10
+
11
+ /*
12
+ * If you *really* need a unique prefix for all types and library functions,
13
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
15
+ * this permanently in zconf.h using "./configure --zprefix".
16
+ */
17
+ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
18
+ # define Z_PREFIX_SET
19
+
20
+ /* all linked symbols and init macros */
21
+ # define _dist_code z__dist_code
22
+ # define _length_code z__length_code
23
+ # define _tr_align z__tr_align
24
+ # define _tr_flush_bits z__tr_flush_bits
25
+ # define _tr_flush_block z__tr_flush_block
26
+ # define _tr_init z__tr_init
27
+ # define _tr_stored_block z__tr_stored_block
28
+ # define _tr_tally z__tr_tally
29
+ # define adler32 z_adler32
30
+ # define adler32_combine z_adler32_combine
31
+ # define adler32_combine64 z_adler32_combine64
32
+ # define adler32_z z_adler32_z
33
+ # ifndef Z_SOLO
34
+ # define compress z_compress
35
+ # define compress2 z_compress2
36
+ # define compressBound z_compressBound
37
+ # endif
38
+ # define crc32 z_crc32
39
+ # define crc32_combine z_crc32_combine
40
+ # define crc32_combine64 z_crc32_combine64
41
+ # define crc32_combine_gen z_crc32_combine_gen
42
+ # define crc32_combine_gen64 z_crc32_combine_gen64
43
+ # define crc32_combine_op z_crc32_combine_op
44
+ # define crc32_z z_crc32_z
45
+ # define deflate z_deflate
46
+ # define deflateBound z_deflateBound
47
+ # define deflateCopy z_deflateCopy
48
+ # define deflateEnd z_deflateEnd
49
+ # define deflateGetDictionary z_deflateGetDictionary
50
+ # define deflateInit z_deflateInit
51
+ # define deflateInit2 z_deflateInit2
52
+ # define deflateInit2_ z_deflateInit2_
53
+ # define deflateInit_ z_deflateInit_
54
+ # define deflateParams z_deflateParams
55
+ # define deflatePending z_deflatePending
56
+ # define deflatePrime z_deflatePrime
57
+ # define deflateReset z_deflateReset
58
+ # define deflateResetKeep z_deflateResetKeep
59
+ # define deflateSetDictionary z_deflateSetDictionary
60
+ # define deflateSetHeader z_deflateSetHeader
61
+ # define deflateTune z_deflateTune
62
+ # define deflate_copyright z_deflate_copyright
63
+ # define get_crc_table z_get_crc_table
64
+ # ifndef Z_SOLO
65
+ # define gz_error z_gz_error
66
+ # define gz_intmax z_gz_intmax
67
+ # define gz_strwinerror z_gz_strwinerror
68
+ # define gzbuffer z_gzbuffer
69
+ # define gzclearerr z_gzclearerr
70
+ # define gzclose z_gzclose
71
+ # define gzclose_r z_gzclose_r
72
+ # define gzclose_w z_gzclose_w
73
+ # define gzdirect z_gzdirect
74
+ # define gzdopen z_gzdopen
75
+ # define gzeof z_gzeof
76
+ # define gzerror z_gzerror
77
+ # define gzflush z_gzflush
78
+ # define gzfread z_gzfread
79
+ # define gzfwrite z_gzfwrite
80
+ # define gzgetc z_gzgetc
81
+ # define gzgetc_ z_gzgetc_
82
+ # define gzgets z_gzgets
83
+ # define gzoffset z_gzoffset
84
+ # define gzoffset64 z_gzoffset64
85
+ # define gzopen z_gzopen
86
+ # define gzopen64 z_gzopen64
87
+ # ifdef _WIN32
88
+ # define gzopen_w z_gzopen_w
89
+ # endif
90
+ # define gzprintf z_gzprintf
91
+ # define gzputc z_gzputc
92
+ # define gzputs z_gzputs
93
+ # define gzread z_gzread
94
+ # define gzrewind z_gzrewind
95
+ # define gzseek z_gzseek
96
+ # define gzseek64 z_gzseek64
97
+ # define gzsetparams z_gzsetparams
98
+ # define gztell z_gztell
99
+ # define gztell64 z_gztell64
100
+ # define gzungetc z_gzungetc
101
+ # define gzvprintf z_gzvprintf
102
+ # define gzwrite z_gzwrite
103
+ # endif
104
+ # define inflate z_inflate
105
+ # define inflateBack z_inflateBack
106
+ # define inflateBackEnd z_inflateBackEnd
107
+ # define inflateBackInit z_inflateBackInit
108
+ # define inflateBackInit_ z_inflateBackInit_
109
+ # define inflateCodesUsed z_inflateCodesUsed
110
+ # define inflateCopy z_inflateCopy
111
+ # define inflateEnd z_inflateEnd
112
+ # define inflateGetDictionary z_inflateGetDictionary
113
+ # define inflateGetHeader z_inflateGetHeader
114
+ # define inflateInit z_inflateInit
115
+ # define inflateInit2 z_inflateInit2
116
+ # define inflateInit2_ z_inflateInit2_
117
+ # define inflateInit_ z_inflateInit_
118
+ # define inflateMark z_inflateMark
119
+ # define inflatePrime z_inflatePrime
120
+ # define inflateReset z_inflateReset
121
+ # define inflateReset2 z_inflateReset2
122
+ # define inflateResetKeep z_inflateResetKeep
123
+ # define inflateSetDictionary z_inflateSetDictionary
124
+ # define inflateSync z_inflateSync
125
+ # define inflateSyncPoint z_inflateSyncPoint
126
+ # define inflateUndermine z_inflateUndermine
127
+ # define inflateValidate z_inflateValidate
128
+ # define inflate_copyright z_inflate_copyright
129
+ # define inflate_fast z_inflate_fast
130
+ # define inflate_table z_inflate_table
131
+ # ifndef Z_SOLO
132
+ # define uncompress z_uncompress
133
+ # define uncompress2 z_uncompress2
134
+ # endif
135
+ # define zError z_zError
136
+ # ifndef Z_SOLO
137
+ # define zcalloc z_zcalloc
138
+ # define zcfree z_zcfree
139
+ # endif
140
+ # define zlibCompileFlags z_zlibCompileFlags
141
+ # define zlibVersion z_zlibVersion
142
+
143
+ /* all zlib typedefs in zlib.h and zconf.h */
144
+ # define Byte z_Byte
145
+ # define Bytef z_Bytef
146
+ # define alloc_func z_alloc_func
147
+ # define charf z_charf
148
+ # define free_func z_free_func
149
+ # ifndef Z_SOLO
150
+ # define gzFile z_gzFile
151
+ # endif
152
+ # define gz_header z_gz_header
153
+ # define gz_headerp z_gz_headerp
154
+ # define in_func z_in_func
155
+ # define intf z_intf
156
+ # define out_func z_out_func
157
+ # define uInt z_uInt
158
+ # define uIntf z_uIntf
159
+ # define uLong z_uLong
160
+ # define uLongf z_uLongf
161
+ # define voidp z_voidp
162
+ # define voidpc z_voidpc
163
+ # define voidpf z_voidpf
164
+
165
+ /* all zlib structs in zlib.h and zconf.h */
166
+ # define gz_header_s z_gz_header_s
167
+ # define internal_state z_internal_state
168
+
169
+ #endif
170
+
171
+ #if defined(__MSDOS__) && !defined(MSDOS)
172
+ # define MSDOS
173
+ #endif
174
+ #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
175
+ # define OS2
176
+ #endif
177
+ #if defined(_WINDOWS) && !defined(WINDOWS)
178
+ # define WINDOWS
179
+ #endif
180
+ #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
181
+ # ifndef WIN32
182
+ # define WIN32
183
+ # endif
184
+ #endif
185
+ #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
186
+ # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
187
+ # ifndef SYS16BIT
188
+ # define SYS16BIT
189
+ # endif
190
+ # endif
191
+ #endif
192
+
193
+ /*
194
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
195
+ * than 64k bytes at a time (needed on systems with 16-bit int).
196
+ */
197
+ #ifdef SYS16BIT
198
+ # define MAXSEG_64K
199
+ #endif
200
+ #ifdef MSDOS
201
+ # define UNALIGNED_OK
202
+ #endif
203
+
204
+ #ifdef __STDC_VERSION__
205
+ # ifndef STDC
206
+ # define STDC
207
+ # endif
208
+ # if __STDC_VERSION__ >= 199901L
209
+ # ifndef STDC99
210
+ # define STDC99
211
+ # endif
212
+ # endif
213
+ #endif
214
+ #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
215
+ # define STDC
216
+ #endif
217
+ #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
218
+ # define STDC
219
+ #endif
220
+ #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
221
+ # define STDC
222
+ #endif
223
+ #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
224
+ # define STDC
225
+ #endif
226
+
227
+ #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
228
+ # define STDC
229
+ #endif
230
+
231
+ #ifndef STDC
232
+ # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
233
+ # define const /* note: need a more gentle solution here */
234
+ # endif
235
+ #endif
236
+
237
+ #if defined(ZLIB_CONST) && !defined(z_const)
238
+ # define z_const const
239
+ #else
240
+ # define z_const
241
+ #endif
242
+
243
+ #ifdef Z_SOLO
244
+ # ifdef _WIN64
245
+ typedef unsigned long long z_size_t;
246
+ # else
247
+ typedef unsigned long z_size_t;
248
+ # endif
249
+ #else
250
+ # define z_longlong long long
251
+ # if defined(NO_SIZE_T)
252
+ typedef unsigned NO_SIZE_T z_size_t;
253
+ # elif defined(STDC)
254
+ # include <stddef.h>
255
+ typedef size_t z_size_t;
256
+ # else
257
+ typedef unsigned long z_size_t;
258
+ # endif
259
+ # undef z_longlong
260
+ #endif
261
+
262
+ /* Maximum value for memLevel in deflateInit2 */
263
+ #ifndef MAX_MEM_LEVEL
264
+ # ifdef MAXSEG_64K
265
+ # define MAX_MEM_LEVEL 8
266
+ # else
267
+ # define MAX_MEM_LEVEL 9
268
+ # endif
269
+ #endif
270
+
271
+ /* Maximum value for windowBits in deflateInit2 and inflateInit2.
272
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
273
+ * created by gzip. (Files created by minigzip can still be extracted by
274
+ * gzip.)
275
+ */
276
+ #ifndef MAX_WBITS
277
+ # define MAX_WBITS 15 /* 32K LZ77 window */
278
+ #endif
279
+
280
+ /* The memory requirements for deflate are (in bytes):
281
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
282
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
283
+ plus a few kilobytes for small objects. For example, if you want to reduce
284
+ the default memory requirements from 256K to 128K, compile with
285
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
286
+ Of course this will generally degrade compression (there's no free lunch).
287
+
288
+ The memory requirements for inflate are (in bytes) 1 << windowBits
289
+ that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
290
+ for small objects.
291
+ */
292
+
293
+ /* Type declarations */
294
+
295
+ #ifndef OF /* function prototypes */
296
+ # ifdef STDC
297
+ # define OF(args) args
298
+ # else
299
+ # define OF(args) ()
300
+ # endif
301
+ #endif
302
+
303
+ /* The following definitions for FAR are needed only for MSDOS mixed
304
+ * model programming (small or medium model with some far allocations).
305
+ * This was tested only with MSC; for other MSDOS compilers you may have
306
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
307
+ * just define FAR to be empty.
308
+ */
309
+ #ifdef SYS16BIT
310
+ # if defined(M_I86SM) || defined(M_I86MM)
311
+ /* MSC small or medium model */
312
+ # define SMALL_MEDIUM
313
+ # ifdef _MSC_VER
314
+ # define FAR _far
315
+ # else
316
+ # define FAR far
317
+ # endif
318
+ # endif
319
+ # if (defined(__SMALL__) || defined(__MEDIUM__))
320
+ /* Turbo C small or medium model */
321
+ # define SMALL_MEDIUM
322
+ # ifdef __BORLANDC__
323
+ # define FAR _far
324
+ # else
325
+ # define FAR far
326
+ # endif
327
+ # endif
328
+ #endif
329
+
330
+ #if defined(WINDOWS) || defined(WIN32)
331
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
332
+ * This is not mandatory, but it offers a little performance increase.
333
+ */
334
+ # ifdef ZLIB_DLL
335
+ # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
336
+ # ifdef ZLIB_INTERNAL
337
+ # define ZEXTERN extern __declspec(dllexport)
338
+ # else
339
+ # define ZEXTERN extern __declspec(dllimport)
340
+ # endif
341
+ # endif
342
+ # endif /* ZLIB_DLL */
343
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
344
+ * define ZLIB_WINAPI.
345
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
346
+ */
347
+ # ifdef ZLIB_WINAPI
348
+ # ifdef FAR
349
+ # undef FAR
350
+ # endif
351
+ # ifndef WIN32_LEAN_AND_MEAN
352
+ # define WIN32_LEAN_AND_MEAN
353
+ # endif
354
+ # include <windows.h>
355
+ /* No need for _export, use ZLIB.DEF instead. */
356
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
357
+ # define ZEXPORT WINAPI
358
+ # ifdef WIN32
359
+ # define ZEXPORTVA WINAPIV
360
+ # else
361
+ # define ZEXPORTVA FAR CDECL
362
+ # endif
363
+ # endif
364
+ #endif
365
+
366
+ #if defined (__BEOS__)
367
+ # ifdef ZLIB_DLL
368
+ # ifdef ZLIB_INTERNAL
369
+ # define ZEXPORT __declspec(dllexport)
370
+ # define ZEXPORTVA __declspec(dllexport)
371
+ # else
372
+ # define ZEXPORT __declspec(dllimport)
373
+ # define ZEXPORTVA __declspec(dllimport)
374
+ # endif
375
+ # endif
376
+ #endif
377
+
378
+ #ifndef ZEXTERN
379
+ # define ZEXTERN extern
380
+ #endif
381
+ #ifndef ZEXPORT
382
+ # define ZEXPORT
383
+ #endif
384
+ #ifndef ZEXPORTVA
385
+ # define ZEXPORTVA
386
+ #endif
387
+
388
+ #ifndef FAR
389
+ # define FAR
390
+ #endif
391
+
392
+ #if !defined(__MACTYPES__)
393
+ typedef unsigned char Byte; /* 8 bits */
394
+ #endif
395
+ typedef unsigned int uInt; /* 16 bits or more */
396
+ typedef unsigned long uLong; /* 32 bits or more */
397
+
398
+ #ifdef SMALL_MEDIUM
399
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
400
+ # define Bytef Byte FAR
401
+ #else
402
+ typedef Byte FAR Bytef;
403
+ #endif
404
+ typedef char FAR charf;
405
+ typedef int FAR intf;
406
+ typedef uInt FAR uIntf;
407
+ typedef uLong FAR uLongf;
408
+
409
+ #ifdef STDC
410
+ typedef void const *voidpc;
411
+ typedef void FAR *voidpf;
412
+ typedef void *voidp;
413
+ #else
414
+ typedef Byte const *voidpc;
415
+ typedef Byte FAR *voidpf;
416
+ typedef Byte *voidp;
417
+ #endif
418
+
419
+ #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
420
+ # include <limits.h>
421
+ # if (UINT_MAX == 0xffffffffUL)
422
+ # define Z_U4 unsigned
423
+ # elif (ULONG_MAX == 0xffffffffUL)
424
+ # define Z_U4 unsigned long
425
+ # elif (USHRT_MAX == 0xffffffffUL)
426
+ # define Z_U4 unsigned short
427
+ # endif
428
+ #endif
429
+
430
+ #ifdef Z_U4
431
+ typedef Z_U4 z_crc_t;
432
+ #else
433
+ typedef unsigned long z_crc_t;
434
+ #endif
435
+
436
+ #if 1 /* was set to #if 1 by ./configure */
437
+ # define Z_HAVE_UNISTD_H
438
+ #endif
439
+
440
+ #if 1 /* was set to #if 1 by ./configure */
441
+ # define Z_HAVE_STDARG_H
442
+ #endif
443
+
444
+ #ifdef STDC
445
+ # ifndef Z_SOLO
446
+ # include <sys/types.h> /* for off_t */
447
+ # endif
448
+ #endif
449
+
450
+ #if defined(STDC) || defined(Z_HAVE_STDARG_H)
451
+ # ifndef Z_SOLO
452
+ # include <stdarg.h> /* for va_list */
453
+ # endif
454
+ #endif
455
+
456
+ #ifdef _WIN32
457
+ # ifndef Z_SOLO
458
+ # include <stddef.h> /* for wchar_t */
459
+ # endif
460
+ #endif
461
+
462
+ /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
463
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
464
+ * though the former does not conform to the LFS document), but considering
465
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
466
+ * equivalently requesting no 64-bit operations
467
+ */
468
+ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
469
+ # undef _LARGEFILE64_SOURCE
470
+ #endif
471
+
472
+ #ifndef Z_HAVE_UNISTD_H
473
+ # ifdef __WATCOMC__
474
+ # define Z_HAVE_UNISTD_H
475
+ # endif
476
+ #endif
477
+ #ifndef Z_HAVE_UNISTD_H
478
+ # if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
479
+ # define Z_HAVE_UNISTD_H
480
+ # endif
481
+ #endif
482
+ #ifndef Z_SOLO
483
+ # if defined(Z_HAVE_UNISTD_H)
484
+ # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
485
+ # ifdef VMS
486
+ # include <unixio.h> /* for off_t */
487
+ # endif
488
+ # ifndef z_off_t
489
+ # define z_off_t off_t
490
+ # endif
491
+ # endif
492
+ #endif
493
+
494
+ #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
495
+ # define Z_LFS64
496
+ #endif
497
+
498
+ #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
499
+ # define Z_LARGE64
500
+ #endif
501
+
502
+ #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
503
+ # define Z_WANT64
504
+ #endif
505
+
506
+ #if !defined(SEEK_SET) && !defined(Z_SOLO)
507
+ # define SEEK_SET 0 /* Seek from beginning of file. */
508
+ # define SEEK_CUR 1 /* Seek from current position. */
509
+ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
510
+ #endif
511
+
512
+ #ifndef z_off_t
513
+ # define z_off_t long
514
+ #endif
515
+
516
+ #if !defined(_WIN32) && defined(Z_LARGE64)
517
+ # define z_off64_t off64_t
518
+ #else
519
+ # if defined(_WIN32) && !defined(__GNUC__)
520
+ # define z_off64_t __int64
521
+ # else
522
+ # define z_off64_t z_off_t
523
+ # endif
524
+ #endif
525
+
526
+ /* MVS linker does not support external names larger than 8 bytes */
527
+ #if defined(__MVS__)
528
+ #pragma map(deflateInit_,"DEIN")
529
+ #pragma map(deflateInit2_,"DEIN2")
530
+ #pragma map(deflateEnd,"DEEND")
531
+ #pragma map(deflateBound,"DEBND")
532
+ #pragma map(inflateInit_,"ININ")
533
+ #pragma map(inflateInit2_,"ININ2")
534
+ #pragma map(inflateEnd,"INEND")
535
+ #pragma map(inflateSync,"INSY")
536
+ #pragma map(inflateSetDictionary,"INSEDI")
537
+ #pragma map(compressBound,"CMBND")
538
+ #pragma map(inflate_table,"INTABL")
539
+ #pragma map(inflate_fast,"INFA")
540
+ #pragma map(inflate_copyright,"INCOPY")
541
+ #endif
542
+
543
+ #endif /* ZCONF_H */
venv/lib/python3.10/site-packages/lxml/includes/extlibs/zlib.h ADDED
@@ -0,0 +1,1938 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* zlib.h -- interface of the 'zlib' general purpose compression library
2
+ version 1.3.1, January 22nd, 2024
3
+
4
+ Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
5
+
6
+ This software is provided 'as-is', without any express or implied
7
+ warranty. In no event will the authors be held liable for any damages
8
+ arising from the use of this software.
9
+
10
+ Permission is granted to anyone to use this software for any purpose,
11
+ including commercial applications, and to alter it and redistribute it
12
+ freely, subject to the following restrictions:
13
+
14
+ 1. The origin of this software must not be misrepresented; you must not
15
+ claim that you wrote the original software. If you use this software
16
+ in a product, an acknowledgment in the product documentation would be
17
+ appreciated but is not required.
18
+ 2. Altered source versions must be plainly marked as such, and must not be
19
+ misrepresented as being the original software.
20
+ 3. This notice may not be removed or altered from any source distribution.
21
+
22
+ Jean-loup Gailly Mark Adler
23
24
+
25
+
26
+ The data format used by the zlib library is described by RFCs (Request for
27
+ Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
28
+ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
29
+ */
30
+
31
+ #ifndef ZLIB_H
32
+ #define ZLIB_H
33
+
34
+ #include "zconf.h"
35
+
36
+ #ifdef __cplusplus
37
+ extern "C" {
38
+ #endif
39
+
40
+ #define ZLIB_VERSION "1.3.1"
41
+ #define ZLIB_VERNUM 0x1310
42
+ #define ZLIB_VER_MAJOR 1
43
+ #define ZLIB_VER_MINOR 3
44
+ #define ZLIB_VER_REVISION 1
45
+ #define ZLIB_VER_SUBREVISION 0
46
+
47
+ /*
48
+ The 'zlib' compression library provides in-memory compression and
49
+ decompression functions, including integrity checks of the uncompressed data.
50
+ This version of the library supports only one compression method (deflation)
51
+ but other algorithms will be added later and will have the same stream
52
+ interface.
53
+
54
+ Compression can be done in a single step if the buffers are large enough,
55
+ or can be done by repeated calls of the compression function. In the latter
56
+ case, the application must provide more input and/or consume the output
57
+ (providing more output space) before each call.
58
+
59
+ The compressed data format used by default by the in-memory functions is
60
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
61
+ around a deflate stream, which is itself documented in RFC 1951.
62
+
63
+ The library also supports reading and writing files in gzip (.gz) format
64
+ with an interface similar to that of stdio using the functions that start
65
+ with "gz". The gzip format is different from the zlib format. gzip is a
66
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
67
+
68
+ This library can optionally read and write gzip and raw deflate streams in
69
+ memory as well.
70
+
71
+ The zlib format was designed to be compact and fast for use in memory
72
+ and on communications channels. The gzip format was designed for single-
73
+ file compression on file systems, has a larger header than zlib to maintain
74
+ directory information, and uses a different, slower check method than zlib.
75
+
76
+ The library does not install any signal handler. The decoder checks
77
+ the consistency of the compressed data, so the library should never crash
78
+ even in the case of corrupted input.
79
+ */
80
+
81
+ typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
82
+ typedef void (*free_func)(voidpf opaque, voidpf address);
83
+
84
+ struct internal_state;
85
+
86
+ typedef struct z_stream_s {
87
+ z_const Bytef *next_in; /* next input byte */
88
+ uInt avail_in; /* number of bytes available at next_in */
89
+ uLong total_in; /* total number of input bytes read so far */
90
+
91
+ Bytef *next_out; /* next output byte will go here */
92
+ uInt avail_out; /* remaining free space at next_out */
93
+ uLong total_out; /* total number of bytes output so far */
94
+
95
+ z_const char *msg; /* last error message, NULL if no error */
96
+ struct internal_state FAR *state; /* not visible by applications */
97
+
98
+ alloc_func zalloc; /* used to allocate the internal state */
99
+ free_func zfree; /* used to free the internal state */
100
+ voidpf opaque; /* private data object passed to zalloc and zfree */
101
+
102
+ int data_type; /* best guess about the data type: binary or text
103
+ for deflate, or the decoding state for inflate */
104
+ uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
105
+ uLong reserved; /* reserved for future use */
106
+ } z_stream;
107
+
108
+ typedef z_stream FAR *z_streamp;
109
+
110
+ /*
111
+ gzip header information passed to and from zlib routines. See RFC 1952
112
+ for more details on the meanings of these fields.
113
+ */
114
+ typedef struct gz_header_s {
115
+ int text; /* true if compressed data believed to be text */
116
+ uLong time; /* modification time */
117
+ int xflags; /* extra flags (not used when writing a gzip file) */
118
+ int os; /* operating system */
119
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
120
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
121
+ uInt extra_max; /* space at extra (only when reading header) */
122
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
123
+ uInt name_max; /* space at name (only when reading header) */
124
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
125
+ uInt comm_max; /* space at comment (only when reading header) */
126
+ int hcrc; /* true if there was or will be a header crc */
127
+ int done; /* true when done reading gzip header (not used
128
+ when writing a gzip file) */
129
+ } gz_header;
130
+
131
+ typedef gz_header FAR *gz_headerp;
132
+
133
+ /*
134
+ The application must update next_in and avail_in when avail_in has dropped
135
+ to zero. It must update next_out and avail_out when avail_out has dropped
136
+ to zero. The application must initialize zalloc, zfree and opaque before
137
+ calling the init function. All other fields are set by the compression
138
+ library and must not be updated by the application.
139
+
140
+ The opaque value provided by the application will be passed as the first
141
+ parameter for calls of zalloc and zfree. This can be useful for custom
142
+ memory management. The compression library attaches no meaning to the
143
+ opaque value.
144
+
145
+ zalloc must return Z_NULL if there is not enough memory for the object.
146
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
147
+ thread safe. In that case, zlib is thread-safe. When zalloc and zfree are
148
+ Z_NULL on entry to the initialization function, they are set to internal
149
+ routines that use the standard library functions malloc() and free().
150
+
151
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
152
+ exactly 65536 bytes, but will not be required to allocate more than this if
153
+ the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
154
+ returned by zalloc for objects of exactly 65536 bytes *must* have their
155
+ offset normalized to zero. The default allocation function provided by this
156
+ library ensures this (see zutil.c). To reduce memory requirements and avoid
157
+ any allocation of 64K objects, at the expense of compression ratio, compile
158
+ the library with -DMAX_WBITS=14 (see zconf.h).
159
+
160
+ The fields total_in and total_out can be used for statistics or progress
161
+ reports. After compression, total_in holds the total size of the
162
+ uncompressed data and may be saved for use by the decompressor (particularly
163
+ if the decompressor wants to decompress everything in a single step).
164
+ */
165
+
166
+ /* constants */
167
+
168
+ #define Z_NO_FLUSH 0
169
+ #define Z_PARTIAL_FLUSH 1
170
+ #define Z_SYNC_FLUSH 2
171
+ #define Z_FULL_FLUSH 3
172
+ #define Z_FINISH 4
173
+ #define Z_BLOCK 5
174
+ #define Z_TREES 6
175
+ /* Allowed flush values; see deflate() and inflate() below for details */
176
+
177
+ #define Z_OK 0
178
+ #define Z_STREAM_END 1
179
+ #define Z_NEED_DICT 2
180
+ #define Z_ERRNO (-1)
181
+ #define Z_STREAM_ERROR (-2)
182
+ #define Z_DATA_ERROR (-3)
183
+ #define Z_MEM_ERROR (-4)
184
+ #define Z_BUF_ERROR (-5)
185
+ #define Z_VERSION_ERROR (-6)
186
+ /* Return codes for the compression/decompression functions. Negative values
187
+ * are errors, positive values are used for special but normal events.
188
+ */
189
+
190
+ #define Z_NO_COMPRESSION 0
191
+ #define Z_BEST_SPEED 1
192
+ #define Z_BEST_COMPRESSION 9
193
+ #define Z_DEFAULT_COMPRESSION (-1)
194
+ /* compression levels */
195
+
196
+ #define Z_FILTERED 1
197
+ #define Z_HUFFMAN_ONLY 2
198
+ #define Z_RLE 3
199
+ #define Z_FIXED 4
200
+ #define Z_DEFAULT_STRATEGY 0
201
+ /* compression strategy; see deflateInit2() below for details */
202
+
203
+ #define Z_BINARY 0
204
+ #define Z_TEXT 1
205
+ #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
206
+ #define Z_UNKNOWN 2
207
+ /* Possible values of the data_type field for deflate() */
208
+
209
+ #define Z_DEFLATED 8
210
+ /* The deflate compression method (the only one supported in this version) */
211
+
212
+ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
213
+
214
+ #define zlib_version zlibVersion()
215
+ /* for compatibility with versions < 1.0.2 */
216
+
217
+
218
+ /* basic functions */
219
+
220
+ ZEXTERN const char * ZEXPORT zlibVersion(void);
221
+ /* The application can compare zlibVersion and ZLIB_VERSION for consistency.
222
+ If the first character differs, the library code actually used is not
223
+ compatible with the zlib.h header file used by the application. This check
224
+ is automatically made by deflateInit and inflateInit.
225
+ */
226
+
227
+ /*
228
+ ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level);
229
+
230
+ Initializes the internal stream state for compression. The fields
231
+ zalloc, zfree and opaque must be initialized before by the caller. If
232
+ zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
233
+ allocation functions. total_in, total_out, adler, and msg are initialized.
234
+
235
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
236
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at all
237
+ (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
238
+ requests a default compromise between speed and compression (currently
239
+ equivalent to level 6).
240
+
241
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
242
+ memory, Z_STREAM_ERROR if level is not a valid compression level, or
243
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
244
+ with the version assumed by the caller (ZLIB_VERSION). msg is set to null
245
+ if there is no error message. deflateInit does not perform any compression:
246
+ this will be done by deflate().
247
+ */
248
+
249
+
250
+ ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush);
251
+ /*
252
+ deflate compresses as much data as possible, and stops when the input
253
+ buffer becomes empty or the output buffer becomes full. It may introduce
254
+ some output latency (reading input without producing any output) except when
255
+ forced to flush.
256
+
257
+ The detailed semantics are as follows. deflate performs one or both of the
258
+ following actions:
259
+
260
+ - Compress more input starting at next_in and update next_in and avail_in
261
+ accordingly. If not all input can be processed (because there is not
262
+ enough room in the output buffer), next_in and avail_in are updated and
263
+ processing will resume at this point for the next call of deflate().
264
+
265
+ - Generate more output starting at next_out and update next_out and avail_out
266
+ accordingly. This action is forced if the parameter flush is non zero.
267
+ Forcing flush frequently degrades the compression ratio, so this parameter
268
+ should be set only when necessary. Some output may be provided even if
269
+ flush is zero.
270
+
271
+ Before the call of deflate(), the application should ensure that at least
272
+ one of the actions is possible, by providing more input and/or consuming more
273
+ output, and updating avail_in or avail_out accordingly; avail_out should
274
+ never be zero before the call. The application can consume the compressed
275
+ output when it wants, for example when the output buffer is full (avail_out
276
+ == 0), or after each call of deflate(). If deflate returns Z_OK and with
277
+ zero avail_out, it must be called again after making room in the output
278
+ buffer because there might be more output pending. See deflatePending(),
279
+ which can be used if desired to determine whether or not there is more output
280
+ in that case.
281
+
282
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
283
+ decide how much data to accumulate before producing output, in order to
284
+ maximize compression.
285
+
286
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
287
+ flushed to the output buffer and the output is aligned on a byte boundary, so
288
+ that the decompressor can get all input data available so far. (In
289
+ particular avail_in is zero after the call if enough output space has been
290
+ provided before the call.) Flushing may degrade compression for some
291
+ compression algorithms and so it should be used only when necessary. This
292
+ completes the current deflate block and follows it with an empty stored block
293
+ that is three bits plus filler bits to the next byte, followed by four bytes
294
+ (00 00 ff ff).
295
+
296
+ If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
297
+ output buffer, but the output is not aligned to a byte boundary. All of the
298
+ input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
299
+ This completes the current deflate block and follows it with an empty fixed
300
+ codes block that is 10 bits long. This assures that enough bytes are output
301
+ in order for the decompressor to finish the block before the empty fixed
302
+ codes block.
303
+
304
+ If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
305
+ for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
306
+ seven bits of the current block are held to be written as the next byte after
307
+ the next deflate block is completed. In this case, the decompressor may not
308
+ be provided enough bits at this point in order to complete decompression of
309
+ the data provided so far to the compressor. It may need to wait for the next
310
+ block to be emitted. This is for advanced applications that need to control
311
+ the emission of deflate blocks.
312
+
313
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
314
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
315
+ restart from this point if previous compressed data has been damaged or if
316
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
317
+ compression.
318
+
319
+ If deflate returns with avail_out == 0, this function must be called again
320
+ with the same value of the flush parameter and more output space (updated
321
+ avail_out), until the flush is complete (deflate returns with non-zero
322
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
323
+ avail_out is greater than six when the flush marker begins, in order to avoid
324
+ repeated flush markers upon calling deflate() again when avail_out == 0.
325
+
326
+ If the parameter flush is set to Z_FINISH, pending input is processed,
327
+ pending output is flushed and deflate returns with Z_STREAM_END if there was
328
+ enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this
329
+ function must be called again with Z_FINISH and more output space (updated
330
+ avail_out) but no more input data, until it returns with Z_STREAM_END or an
331
+ error. After deflate has returned Z_STREAM_END, the only possible operations
332
+ on the stream are deflateReset or deflateEnd.
333
+
334
+ Z_FINISH can be used in the first deflate call after deflateInit if all the
335
+ compression is to be done in a single step. In order to complete in one
336
+ call, avail_out must be at least the value returned by deflateBound (see
337
+ below). Then deflate is guaranteed to return Z_STREAM_END. If not enough
338
+ output space is provided, deflate will not return Z_STREAM_END, and it must
339
+ be called again as described above.
340
+
341
+ deflate() sets strm->adler to the Adler-32 checksum of all input read
342
+ so far (that is, total_in bytes). If a gzip stream is being generated, then
343
+ strm->adler will be the CRC-32 checksum of the input read so far. (See
344
+ deflateInit2 below.)
345
+
346
+ deflate() may update strm->data_type if it can make a good guess about
347
+ the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is
348
+ considered binary. This field is only for information purposes and does not
349
+ affect the compression algorithm in any manner.
350
+
351
+ deflate() returns Z_OK if some progress has been made (more input
352
+ processed or more output produced), Z_STREAM_END if all input has been
353
+ consumed and all output has been produced (only when flush is set to
354
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
355
+ if next_in or next_out was Z_NULL or the state was inadvertently written over
356
+ by the application), or Z_BUF_ERROR if no progress is possible (for example
357
+ avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and
358
+ deflate() can be called again with more input and more output space to
359
+ continue compressing.
360
+ */
361
+
362
+
363
+ ZEXTERN int ZEXPORT deflateEnd(z_streamp strm);
364
+ /*
365
+ All dynamically allocated data structures for this stream are freed.
366
+ This function discards any unprocessed input and does not flush any pending
367
+ output.
368
+
369
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
370
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
371
+ prematurely (some input or output was discarded). In the error case, msg
372
+ may be set but then points to a static string (which must not be
373
+ deallocated).
374
+ */
375
+
376
+
377
+ /*
378
+ ZEXTERN int ZEXPORT inflateInit(z_streamp strm);
379
+
380
+ Initializes the internal stream state for decompression. The fields
381
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
382
+ the caller. In the current version of inflate, the provided input is not
383
+ read or consumed. The allocation of a sliding window will be deferred to
384
+ the first call of inflate (if the decompression does not complete on the
385
+ first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
386
+ them to use default allocation functions. total_in, total_out, adler, and
387
+ msg are initialized.
388
+
389
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
390
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
391
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
392
+ invalid, such as a null pointer to the structure. msg is set to null if
393
+ there is no error message. inflateInit does not perform any decompression.
394
+ Actual decompression will be done by inflate(). So next_in, and avail_in,
395
+ next_out, and avail_out are unused and unchanged. The current
396
+ implementation of inflateInit() does not process any header information --
397
+ that is deferred until inflate() is called.
398
+ */
399
+
400
+
401
+ ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush);
402
+ /*
403
+ inflate decompresses as much data as possible, and stops when the input
404
+ buffer becomes empty or the output buffer becomes full. It may introduce
405
+ some output latency (reading input without producing any output) except when
406
+ forced to flush.
407
+
408
+ The detailed semantics are as follows. inflate performs one or both of the
409
+ following actions:
410
+
411
+ - Decompress more input starting at next_in and update next_in and avail_in
412
+ accordingly. If not all input can be processed (because there is not
413
+ enough room in the output buffer), then next_in and avail_in are updated
414
+ accordingly, and processing will resume at this point for the next call of
415
+ inflate().
416
+
417
+ - Generate more output starting at next_out and update next_out and avail_out
418
+ accordingly. inflate() provides as much output as possible, until there is
419
+ no more input data or no more space in the output buffer (see below about
420
+ the flush parameter).
421
+
422
+ Before the call of inflate(), the application should ensure that at least
423
+ one of the actions is possible, by providing more input and/or consuming more
424
+ output, and updating the next_* and avail_* values accordingly. If the
425
+ caller of inflate() does not provide both available input and available
426
+ output space, it is possible that there will be no progress made. The
427
+ application can consume the uncompressed output when it wants, for example
428
+ when the output buffer is full (avail_out == 0), or after each call of
429
+ inflate(). If inflate returns Z_OK and with zero avail_out, it must be
430
+ called again after making room in the output buffer because there might be
431
+ more output pending.
432
+
433
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
434
+ Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
435
+ output as possible to the output buffer. Z_BLOCK requests that inflate()
436
+ stop if and when it gets to the next deflate block boundary. When decoding
437
+ the zlib or gzip format, this will cause inflate() to return immediately
438
+ after the header and before the first block. When doing a raw inflate,
439
+ inflate() will go ahead and process the first block, and will return when it
440
+ gets to the end of that block, or when it runs out of data.
441
+
442
+ The Z_BLOCK option assists in appending to or combining deflate streams.
443
+ To assist in this, on return inflate() always sets strm->data_type to the
444
+ number of unused bits in the last byte taken from strm->next_in, plus 64 if
445
+ inflate() is currently decoding the last block in the deflate stream, plus
446
+ 128 if inflate() returned immediately after decoding an end-of-block code or
447
+ decoding the complete header up to just before the first byte of the deflate
448
+ stream. The end-of-block will not be indicated until all of the uncompressed
449
+ data from that block has been written to strm->next_out. The number of
450
+ unused bits may in general be greater than seven, except when bit 7 of
451
+ data_type is set, in which case the number of unused bits will be less than
452
+ eight. data_type is set as noted here every time inflate() returns for all
453
+ flush options, and so can be used to determine the amount of currently
454
+ consumed input in bits.
455
+
456
+ The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
457
+ end of each deflate block header is reached, before any actual data in that
458
+ block is decoded. This allows the caller to determine the length of the
459
+ deflate block header for later use in random access within a deflate block.
460
+ 256 is added to the value of strm->data_type when inflate() returns
461
+ immediately after reaching the end of the deflate block header.
462
+
463
+ inflate() should normally be called until it returns Z_STREAM_END or an
464
+ error. However if all decompression is to be performed in a single step (a
465
+ single call of inflate), the parameter flush should be set to Z_FINISH. In
466
+ this case all pending input is processed and all pending output is flushed;
467
+ avail_out must be large enough to hold all of the uncompressed data for the
468
+ operation to complete. (The size of the uncompressed data may have been
469
+ saved by the compressor for this purpose.) The use of Z_FINISH is not
470
+ required to perform an inflation in one step. However it may be used to
471
+ inform inflate that a faster approach can be used for the single inflate()
472
+ call. Z_FINISH also informs inflate to not maintain a sliding window if the
473
+ stream completes, which reduces inflate's memory footprint. If the stream
474
+ does not complete, either because not all of the stream is provided or not
475
+ enough output space is provided, then a sliding window will be allocated and
476
+ inflate() can be called again to continue the operation as if Z_NO_FLUSH had
477
+ been used.
478
+
479
+ In this implementation, inflate() always flushes as much output as
480
+ possible to the output buffer, and always uses the faster approach on the
481
+ first call. So the effects of the flush parameter in this implementation are
482
+ on the return value of inflate() as noted below, when inflate() returns early
483
+ when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
484
+ memory for a sliding window when Z_FINISH is used.
485
+
486
+ If a preset dictionary is needed after this call (see inflateSetDictionary
487
+ below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
488
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
489
+ strm->adler to the Adler-32 checksum of all output produced so far (that is,
490
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
491
+ below. At the end of the stream, inflate() checks that its computed Adler-32
492
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
493
+ only if the checksum is correct.
494
+
495
+ inflate() can decompress and check either zlib-wrapped or gzip-wrapped
496
+ deflate data. The header type is detected automatically, if requested when
497
+ initializing with inflateInit2(). Any information contained in the gzip
498
+ header is not retained unless inflateGetHeader() is used. When processing
499
+ gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
500
+ produced so far. The CRC-32 is checked against the gzip trailer, as is the
501
+ uncompressed length, modulo 2^32.
502
+
503
+ inflate() returns Z_OK if some progress has been made (more input processed
504
+ or more output produced), Z_STREAM_END if the end of the compressed data has
505
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
506
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
507
+ corrupted (input stream not conforming to the zlib format or incorrect check
508
+ value, in which case strm->msg points to a string with a more specific
509
+ error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
510
+ next_in or next_out was Z_NULL, or the state was inadvertently written over
511
+ by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
512
+ if no progress was possible or if there was not enough room in the output
513
+ buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
514
+ inflate() can be called again with more input and more output space to
515
+ continue decompressing. If Z_DATA_ERROR is returned, the application may
516
+ then call inflateSync() to look for a good compression block if a partial
517
+ recovery of the data is to be attempted.
518
+ */
519
+
520
+
521
+ ZEXTERN int ZEXPORT inflateEnd(z_streamp strm);
522
+ /*
523
+ All dynamically allocated data structures for this stream are freed.
524
+ This function discards any unprocessed input and does not flush any pending
525
+ output.
526
+
527
+ inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
528
+ was inconsistent.
529
+ */
530
+
531
+
532
+ /* Advanced functions */
533
+
534
+ /*
535
+ The following functions are needed only in some special applications.
536
+ */
537
+
538
+ /*
539
+ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
540
+ int level,
541
+ int method,
542
+ int windowBits,
543
+ int memLevel,
544
+ int strategy);
545
+
546
+ This is another version of deflateInit with more compression options. The
547
+ fields zalloc, zfree and opaque must be initialized before by the caller.
548
+
549
+ The method parameter is the compression method. It must be Z_DEFLATED in
550
+ this version of the library.
551
+
552
+ The windowBits parameter is the base two logarithm of the window size
553
+ (the size of the history buffer). It should be in the range 8..15 for this
554
+ version of the library. Larger values of this parameter result in better
555
+ compression at the expense of memory usage. The default value is 15 if
556
+ deflateInit is used instead.
557
+
558
+ For the current implementation of deflate(), a windowBits value of 8 (a
559
+ window size of 256 bytes) is not supported. As a result, a request for 8
560
+ will result in 9 (a 512-byte window). In that case, providing 8 to
561
+ inflateInit2() will result in an error when the zlib header with 9 is
562
+ checked against the initialization of inflate(). The remedy is to not use 8
563
+ with deflateInit2() with this initialization, or at least in that case use 9
564
+ with inflateInit2().
565
+
566
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
567
+ determines the window size. deflate() will then generate raw deflate data
568
+ with no zlib header or trailer, and will not compute a check value.
569
+
570
+ windowBits can also be greater than 15 for optional gzip encoding. Add
571
+ 16 to windowBits to write a simple gzip header and trailer around the
572
+ compressed data instead of a zlib wrapper. The gzip header will have no
573
+ file name, no extra data, no comment, no modification time (set to zero), no
574
+ header crc, and the operating system will be set to the appropriate value,
575
+ if the operating system was determined at compile time. If a gzip stream is
576
+ being written, strm->adler is a CRC-32 instead of an Adler-32.
577
+
578
+ For raw deflate or gzip encoding, a request for a 256-byte window is
579
+ rejected as invalid, since only the zlib header provides a means of
580
+ transmitting the window size to the decompressor.
581
+
582
+ The memLevel parameter specifies how much memory should be allocated
583
+ for the internal compression state. memLevel=1 uses minimum memory but is
584
+ slow and reduces compression ratio; memLevel=9 uses maximum memory for
585
+ optimal speed. The default value is 8. See zconf.h for total memory usage
586
+ as a function of windowBits and memLevel.
587
+
588
+ The strategy parameter is used to tune the compression algorithm. Use the
589
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
590
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
591
+ string match), or Z_RLE to limit match distances to one (run-length
592
+ encoding). Filtered data consists mostly of small values with a somewhat
593
+ random distribution. In this case, the compression algorithm is tuned to
594
+ compress them better. The effect of Z_FILTERED is to force more Huffman
595
+ coding and less string matching; it is somewhat intermediate between
596
+ Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
597
+ fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
598
+ strategy parameter only affects the compression ratio but not the
599
+ correctness of the compressed output even if it is not set appropriately.
600
+ Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
601
+ decoder for special applications.
602
+
603
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
604
+ memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
605
+ method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
606
+ incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
607
+ set to null if there is no error message. deflateInit2 does not perform any
608
+ compression: this will be done by deflate().
609
+ */
610
+
611
+ ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm,
612
+ const Bytef *dictionary,
613
+ uInt dictLength);
614
+ /*
615
+ Initializes the compression dictionary from the given byte sequence
616
+ without producing any compressed output. When using the zlib format, this
617
+ function must be called immediately after deflateInit, deflateInit2 or
618
+ deflateReset, and before any call of deflate. When doing raw deflate, this
619
+ function must be called either before any call of deflate, or immediately
620
+ after the completion of a deflate block, i.e. after all input has been
621
+ consumed and all output has been delivered when using any of the flush
622
+ options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
623
+ compressor and decompressor must use exactly the same dictionary (see
624
+ inflateSetDictionary).
625
+
626
+ The dictionary should consist of strings (byte sequences) that are likely
627
+ to be encountered later in the data to be compressed, with the most commonly
628
+ used strings preferably put towards the end of the dictionary. Using a
629
+ dictionary is most useful when the data to be compressed is short and can be
630
+ predicted with good accuracy; the data can then be compressed better than
631
+ with the default empty dictionary.
632
+
633
+ Depending on the size of the compression data structures selected by
634
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
635
+ discarded, for example if the dictionary is larger than the window size
636
+ provided in deflateInit or deflateInit2. Thus the strings most likely to be
637
+ useful should be put at the end of the dictionary, not at the front. In
638
+ addition, the current implementation of deflate will use at most the window
639
+ size minus 262 bytes of the provided dictionary.
640
+
641
+ Upon return of this function, strm->adler is set to the Adler-32 value
642
+ of the dictionary; the decompressor may later use this value to determine
643
+ which dictionary has been used by the compressor. (The Adler-32 value
644
+ applies to the whole dictionary even if only a subset of the dictionary is
645
+ actually used by the compressor.) If a raw deflate was requested, then the
646
+ Adler-32 value is not computed and strm->adler is not set.
647
+
648
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
649
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
650
+ inconsistent (for example if deflate has already been called for this stream
651
+ or if not at a block boundary for raw deflate). deflateSetDictionary does
652
+ not perform any compression: this will be done by deflate().
653
+ */
654
+
655
+ ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm,
656
+ Bytef *dictionary,
657
+ uInt *dictLength);
658
+ /*
659
+ Returns the sliding dictionary being maintained by deflate. dictLength is
660
+ set to the number of bytes in the dictionary, and that many bytes are copied
661
+ to dictionary. dictionary must have enough space, where 32768 bytes is
662
+ always enough. If deflateGetDictionary() is called with dictionary equal to
663
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
664
+ Similarly, if dictLength is Z_NULL, then it is not set.
665
+
666
+ deflateGetDictionary() may return a length less than the window size, even
667
+ when more than the window size in input has been provided. It may return up
668
+ to 258 bytes less in that case, due to how zlib's implementation of deflate
669
+ manages the sliding window and lookahead for matches, where matches can be
670
+ up to 258 bytes long. If the application needs the last window-size bytes of
671
+ input, then that would need to be saved by the application outside of zlib.
672
+
673
+ deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
674
+ stream state is inconsistent.
675
+ */
676
+
677
+ ZEXTERN int ZEXPORT deflateCopy(z_streamp dest,
678
+ z_streamp source);
679
+ /*
680
+ Sets the destination stream as a complete copy of the source stream.
681
+
682
+ This function can be useful when several compression strategies will be
683
+ tried, for example when there are several ways of pre-processing the input
684
+ data with a filter. The streams that will be discarded should then be freed
685
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
686
+ compression state which can be quite large, so this strategy is slow and can
687
+ consume lots of memory.
688
+
689
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
690
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
691
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
692
+ destination.
693
+ */
694
+
695
+ ZEXTERN int ZEXPORT deflateReset(z_streamp strm);
696
+ /*
697
+ This function is equivalent to deflateEnd followed by deflateInit, but
698
+ does not free and reallocate the internal compression state. The stream
699
+ will leave the compression level and any other attributes that may have been
700
+ set unchanged. total_in, total_out, adler, and msg are initialized.
701
+
702
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
703
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
704
+ */
705
+
706
+ ZEXTERN int ZEXPORT deflateParams(z_streamp strm,
707
+ int level,
708
+ int strategy);
709
+ /*
710
+ Dynamically update the compression level and compression strategy. The
711
+ interpretation of level and strategy is as in deflateInit2(). This can be
712
+ used to switch between compression and straight copy of the input data, or
713
+ to switch to a different kind of input data requiring a different strategy.
714
+ If the compression approach (which is a function of the level) or the
715
+ strategy is changed, and if there have been any deflate() calls since the
716
+ state was initialized or reset, then the input available so far is
717
+ compressed with the old level and strategy using deflate(strm, Z_BLOCK).
718
+ There are three approaches for the compression levels 0, 1..3, and 4..9
719
+ respectively. The new level and strategy will take effect at the next call
720
+ of deflate().
721
+
722
+ If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
723
+ not have enough output space to complete, then the parameter change will not
724
+ take effect. In this case, deflateParams() can be called again with the
725
+ same parameters and more output space to try again.
726
+
727
+ In order to assure a change in the parameters on the first try, the
728
+ deflate stream should be flushed using deflate() with Z_BLOCK or other flush
729
+ request until strm.avail_out is not zero, before calling deflateParams().
730
+ Then no more input data should be provided before the deflateParams() call.
731
+ If this is done, the old level and strategy will be applied to the data
732
+ compressed before deflateParams(), and the new level and strategy will be
733
+ applied to the data compressed after deflateParams().
734
+
735
+ deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
736
+ state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
737
+ there was not enough output space to complete the compression of the
738
+ available input data before a change in the strategy or approach. Note that
739
+ in the case of a Z_BUF_ERROR, the parameters are not changed. A return
740
+ value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
741
+ retried with more output space.
742
+ */
743
+
744
+ ZEXTERN int ZEXPORT deflateTune(z_streamp strm,
745
+ int good_length,
746
+ int max_lazy,
747
+ int nice_length,
748
+ int max_chain);
749
+ /*
750
+ Fine tune deflate's internal compression parameters. This should only be
751
+ used by someone who understands the algorithm used by zlib's deflate for
752
+ searching for the best matching string, and even then only by the most
753
+ fanatic optimizer trying to squeeze out the last compressed bit for their
754
+ specific input data. Read the deflate.c source code for the meaning of the
755
+ max_lazy, good_length, nice_length, and max_chain parameters.
756
+
757
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
758
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
759
+ */
760
+
761
+ ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,
762
+ uLong sourceLen);
763
+ /*
764
+ deflateBound() returns an upper bound on the compressed size after
765
+ deflation of sourceLen bytes. It must be called after deflateInit() or
766
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
767
+ to allocate an output buffer for deflation in a single pass, and so would be
768
+ called before deflate(). If that first deflate() call is provided the
769
+ sourceLen input bytes, an output buffer allocated to the size returned by
770
+ deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
771
+ to return Z_STREAM_END. Note that it is possible for the compressed size to
772
+ be larger than the value returned by deflateBound() if flush options other
773
+ than Z_FINISH or Z_NO_FLUSH are used.
774
+ */
775
+
776
+ ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
777
+ unsigned *pending,
778
+ int *bits);
779
+ /*
780
+ deflatePending() returns the number of bytes and bits of output that have
781
+ been generated, but not yet provided in the available output. The bytes not
782
+ provided would be due to the available output space having being consumed.
783
+ The number of bits of output not provided are between 0 and 7, where they
784
+ await more bits to join them in order to fill out a full byte. If pending
785
+ or bits are Z_NULL, then those values are not set.
786
+
787
+ deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
788
+ stream state was inconsistent.
789
+ */
790
+
791
+ ZEXTERN int ZEXPORT deflatePrime(z_streamp strm,
792
+ int bits,
793
+ int value);
794
+ /*
795
+ deflatePrime() inserts bits in the deflate output stream. The intent
796
+ is that this function is used to start off the deflate output with the bits
797
+ leftover from a previous deflate stream when appending to it. As such, this
798
+ function can only be used for raw deflate, and must be used before the first
799
+ deflate() call after a deflateInit2() or deflateReset(). bits must be less
800
+ than or equal to 16, and that many of the least significant bits of value
801
+ will be inserted in the output.
802
+
803
+ deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
804
+ room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
805
+ source stream state was inconsistent.
806
+ */
807
+
808
+ ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm,
809
+ gz_headerp head);
810
+ /*
811
+ deflateSetHeader() provides gzip header information for when a gzip
812
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
813
+ after deflateInit2() or deflateReset() and before the first call of
814
+ deflate(). The text, time, os, extra field, name, and comment information
815
+ in the provided gz_header structure are written to the gzip header (xflag is
816
+ ignored -- the extra flags are set according to the compression level). The
817
+ caller must assure that, if not Z_NULL, name and comment are terminated with
818
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
819
+ available there. If hcrc is true, a gzip header crc is included. Note that
820
+ the current versions of the command-line version of gzip (up through version
821
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
822
+ gzip file" and give up.
823
+
824
+ If deflateSetHeader is not used, the default gzip header has text false,
825
+ the time set to zero, and os set to the current operating system, with no
826
+ extra, name, or comment fields. The gzip header is returned to the default
827
+ state by deflateReset().
828
+
829
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
830
+ stream state was inconsistent.
831
+ */
832
+
833
+ /*
834
+ ZEXTERN int ZEXPORT inflateInit2(z_streamp strm,
835
+ int windowBits);
836
+
837
+ This is another version of inflateInit with an extra parameter. The
838
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
839
+ before by the caller.
840
+
841
+ The windowBits parameter is the base two logarithm of the maximum window
842
+ size (the size of the history buffer). It should be in the range 8..15 for
843
+ this version of the library. The default value is 15 if inflateInit is used
844
+ instead. windowBits must be greater than or equal to the windowBits value
845
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
846
+ deflateInit2() was not used. If a compressed stream with a larger window
847
+ size is given as input, inflate() will return with the error code
848
+ Z_DATA_ERROR instead of trying to allocate a larger window.
849
+
850
+ windowBits can also be zero to request that inflate use the window size in
851
+ the zlib header of the compressed stream.
852
+
853
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
854
+ determines the window size. inflate() will then process raw deflate data,
855
+ not looking for a zlib or gzip header, not generating a check value, and not
856
+ looking for any check values for comparison at the end of the stream. This
857
+ is for use with other formats that use the deflate compressed data format
858
+ such as zip. Those formats provide their own check values. If a custom
859
+ format is developed using the raw deflate format for compressed data, it is
860
+ recommended that a check value such as an Adler-32 or a CRC-32 be applied to
861
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
862
+ most applications, the zlib format should be used as is. Note that comments
863
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
864
+
865
+ windowBits can also be greater than 15 for optional gzip decoding. Add
866
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
867
+ detection, or add 16 to decode only the gzip format (the zlib format will
868
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
869
+ CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
870
+ below), inflate() will *not* automatically decode concatenated gzip members.
871
+ inflate() will return Z_STREAM_END at the end of the gzip member. The state
872
+ would need to be reset to continue decoding a subsequent gzip member. This
873
+ *must* be done if there is more data after a gzip member, in order for the
874
+ decompression to be compliant with the gzip standard (RFC 1952).
875
+
876
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
877
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
878
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
879
+ invalid, such as a null pointer to the structure. msg is set to null if
880
+ there is no error message. inflateInit2 does not perform any decompression
881
+ apart from possibly reading the zlib header if present: actual decompression
882
+ will be done by inflate(). (So next_in and avail_in may be modified, but
883
+ next_out and avail_out are unused and unchanged.) The current implementation
884
+ of inflateInit2() does not process any header information -- that is
885
+ deferred until inflate() is called.
886
+ */
887
+
888
+ ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm,
889
+ const Bytef *dictionary,
890
+ uInt dictLength);
891
+ /*
892
+ Initializes the decompression dictionary from the given uncompressed byte
893
+ sequence. This function must be called immediately after a call of inflate,
894
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
895
+ can be determined from the Adler-32 value returned by that call of inflate.
896
+ The compressor and decompressor must use exactly the same dictionary (see
897
+ deflateSetDictionary). For raw inflate, this function can be called at any
898
+ time to set the dictionary. If the provided dictionary is smaller than the
899
+ window and there is already data in the window, then the provided dictionary
900
+ will amend what's there. The application must insure that the dictionary
901
+ that was used for compression is provided.
902
+
903
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
904
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
905
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
906
+ expected one (incorrect Adler-32 value). inflateSetDictionary does not
907
+ perform any decompression: this will be done by subsequent calls of
908
+ inflate().
909
+ */
910
+
911
+ ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm,
912
+ Bytef *dictionary,
913
+ uInt *dictLength);
914
+ /*
915
+ Returns the sliding dictionary being maintained by inflate. dictLength is
916
+ set to the number of bytes in the dictionary, and that many bytes are copied
917
+ to dictionary. dictionary must have enough space, where 32768 bytes is
918
+ always enough. If inflateGetDictionary() is called with dictionary equal to
919
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
920
+ Similarly, if dictLength is Z_NULL, then it is not set.
921
+
922
+ inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
923
+ stream state is inconsistent.
924
+ */
925
+
926
+ ZEXTERN int ZEXPORT inflateSync(z_streamp strm);
927
+ /*
928
+ Skips invalid compressed data until a possible full flush point (see above
929
+ for the description of deflate with Z_FULL_FLUSH) can be found, or until all
930
+ available input is skipped. No output is provided.
931
+
932
+ inflateSync searches for a 00 00 FF FF pattern in the compressed data.
933
+ All full flush points have this pattern, but not all occurrences of this
934
+ pattern are full flush points.
935
+
936
+ inflateSync returns Z_OK if a possible full flush point has been found,
937
+ Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
938
+ has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
939
+ In the success case, the application may save the current value of total_in
940
+ which indicates where valid compressed data was found. In the error case,
941
+ the application may repeatedly call inflateSync, providing more input each
942
+ time, until success or end of the input data.
943
+ */
944
+
945
+ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest,
946
+ z_streamp source);
947
+ /*
948
+ Sets the destination stream as a complete copy of the source stream.
949
+
950
+ This function can be useful when randomly accessing a large stream. The
951
+ first pass through the stream can periodically record the inflate state,
952
+ allowing restarting inflate at those points when randomly accessing the
953
+ stream.
954
+
955
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
956
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
957
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
958
+ destination.
959
+ */
960
+
961
+ ZEXTERN int ZEXPORT inflateReset(z_streamp strm);
962
+ /*
963
+ This function is equivalent to inflateEnd followed by inflateInit,
964
+ but does not free and reallocate the internal decompression state. The
965
+ stream will keep attributes that may have been set by inflateInit2.
966
+ total_in, total_out, adler, and msg are initialized.
967
+
968
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
969
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
970
+ */
971
+
972
+ ZEXTERN int ZEXPORT inflateReset2(z_streamp strm,
973
+ int windowBits);
974
+ /*
975
+ This function is the same as inflateReset, but it also permits changing
976
+ the wrap and window size requests. The windowBits parameter is interpreted
977
+ the same as it is for inflateInit2. If the window size is changed, then the
978
+ memory allocated for the window is freed, and the window will be reallocated
979
+ by inflate() if needed.
980
+
981
+ inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
982
+ stream state was inconsistent (such as zalloc or state being Z_NULL), or if
983
+ the windowBits parameter is invalid.
984
+ */
985
+
986
+ ZEXTERN int ZEXPORT inflatePrime(z_streamp strm,
987
+ int bits,
988
+ int value);
989
+ /*
990
+ This function inserts bits in the inflate input stream. The intent is
991
+ that this function is used to start inflating at a bit position in the
992
+ middle of a byte. The provided bits will be used before any bytes are used
993
+ from next_in. This function should only be used with raw inflate, and
994
+ should be used before the first inflate() call after inflateInit2() or
995
+ inflateReset(). bits must be less than or equal to 16, and that many of the
996
+ least significant bits of value will be inserted in the input.
997
+
998
+ If bits is negative, then the input stream bit buffer is emptied. Then
999
+ inflatePrime() can be called again to put bits in the buffer. This is used
1000
+ to clear out bits leftover after feeding inflate a block description prior
1001
+ to feeding inflate codes.
1002
+
1003
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
1004
+ stream state was inconsistent.
1005
+ */
1006
+
1007
+ ZEXTERN long ZEXPORT inflateMark(z_streamp strm);
1008
+ /*
1009
+ This function returns two values, one in the lower 16 bits of the return
1010
+ value, and the other in the remaining upper bits, obtained by shifting the
1011
+ return value down 16 bits. If the upper value is -1 and the lower value is
1012
+ zero, then inflate() is currently decoding information outside of a block.
1013
+ If the upper value is -1 and the lower value is non-zero, then inflate is in
1014
+ the middle of a stored block, with the lower value equaling the number of
1015
+ bytes from the input remaining to copy. If the upper value is not -1, then
1016
+ it is the number of bits back from the current bit position in the input of
1017
+ the code (literal or length/distance pair) currently being processed. In
1018
+ that case the lower value is the number of bytes already emitted for that
1019
+ code.
1020
+
1021
+ A code is being processed if inflate is waiting for more input to complete
1022
+ decoding of the code, or if it has completed decoding but is waiting for
1023
+ more output space to write the literal or match data.
1024
+
1025
+ inflateMark() is used to mark locations in the input data for random
1026
+ access, which may be at bit positions, and to note those cases where the
1027
+ output of a code may span boundaries of random access blocks. The current
1028
+ location in the input stream can be determined from avail_in and data_type
1029
+ as noted in the description for the Z_BLOCK flush parameter for inflate.
1030
+
1031
+ inflateMark returns the value noted above, or -65536 if the provided
1032
+ source stream state was inconsistent.
1033
+ */
1034
+
1035
+ ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm,
1036
+ gz_headerp head);
1037
+ /*
1038
+ inflateGetHeader() requests that gzip header information be stored in the
1039
+ provided gz_header structure. inflateGetHeader() may be called after
1040
+ inflateInit2() or inflateReset(), and before the first call of inflate().
1041
+ As inflate() processes the gzip stream, head->done is zero until the header
1042
+ is completed, at which time head->done is set to one. If a zlib stream is
1043
+ being decoded, then head->done is set to -1 to indicate that there will be
1044
+ no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
1045
+ used to force inflate() to return immediately after header processing is
1046
+ complete and before any actual data is decompressed.
1047
+
1048
+ The text, time, xflags, and os fields are filled in with the gzip header
1049
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
1050
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
1051
+ contains the maximum number of bytes to write to extra. Once done is true,
1052
+ extra_len contains the actual extra field length, and extra contains the
1053
+ extra field, or that field truncated if extra_max is less than extra_len.
1054
+ If name is not Z_NULL, then up to name_max characters are written there,
1055
+ terminated with a zero unless the length is greater than name_max. If
1056
+ comment is not Z_NULL, then up to comm_max characters are written there,
1057
+ terminated with a zero unless the length is greater than comm_max. When any
1058
+ of extra, name, or comment are not Z_NULL and the respective field is not
1059
+ present in the header, then that field is set to Z_NULL to signal its
1060
+ absence. This allows the use of deflateSetHeader() with the returned
1061
+ structure to duplicate the header. However if those fields are set to
1062
+ allocated memory, then the application will need to save those pointers
1063
+ elsewhere so that they can be eventually freed.
1064
+
1065
+ If inflateGetHeader is not used, then the header information is simply
1066
+ discarded. The header is always checked for validity, including the header
1067
+ CRC if present. inflateReset() will reset the process to discard the header
1068
+ information. The application would need to call inflateGetHeader() again to
1069
+ retrieve the header from the next gzip stream.
1070
+
1071
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
1072
+ stream state was inconsistent.
1073
+ */
1074
+
1075
+ /*
1076
+ ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits,
1077
+ unsigned char FAR *window);
1078
+
1079
+ Initialize the internal stream state for decompression using inflateBack()
1080
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
1081
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
1082
+ derived memory allocation routines are used. windowBits is the base two
1083
+ logarithm of the window size, in the range 8..15. window is a caller
1084
+ supplied buffer of that size. Except for special applications where it is
1085
+ assured that deflate was used with small window sizes, windowBits must be 15
1086
+ and a 32K byte window must be supplied to be able to decompress general
1087
+ deflate streams.
1088
+
1089
+ See inflateBack() for the usage of these routines.
1090
+
1091
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
1092
+ the parameters are invalid, Z_MEM_ERROR if the internal state could not be
1093
+ allocated, or Z_VERSION_ERROR if the version of the library does not match
1094
+ the version of the header file.
1095
+ */
1096
+
1097
+ typedef unsigned (*in_func)(void FAR *,
1098
+ z_const unsigned char FAR * FAR *);
1099
+ typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned);
1100
+
1101
+ ZEXTERN int ZEXPORT inflateBack(z_streamp strm,
1102
+ in_func in, void FAR *in_desc,
1103
+ out_func out, void FAR *out_desc);
1104
+ /*
1105
+ inflateBack() does a raw inflate with a single call using a call-back
1106
+ interface for input and output. This is potentially more efficient than
1107
+ inflate() for file i/o applications, in that it avoids copying between the
1108
+ output and the sliding window by simply making the window itself the output
1109
+ buffer. inflate() can be faster on modern CPUs when used with large
1110
+ buffers. inflateBack() trusts the application to not change the output
1111
+ buffer passed by the output function, at least until inflateBack() returns.
1112
+
1113
+ inflateBackInit() must be called first to allocate the internal state
1114
+ and to initialize the state with the user-provided window buffer.
1115
+ inflateBack() may then be used multiple times to inflate a complete, raw
1116
+ deflate stream with each call. inflateBackEnd() is then called to free the
1117
+ allocated state.
1118
+
1119
+ A raw deflate stream is one with no zlib or gzip header or trailer.
1120
+ This routine would normally be used in a utility that reads zip or gzip
1121
+ files and writes out uncompressed files. The utility would decode the
1122
+ header and process the trailer on its own, hence this routine expects only
1123
+ the raw deflate stream to decompress. This is different from the default
1124
+ behavior of inflate(), which expects a zlib header and trailer around the
1125
+ deflate stream.
1126
+
1127
+ inflateBack() uses two subroutines supplied by the caller that are then
1128
+ called by inflateBack() for input and output. inflateBack() calls those
1129
+ routines until it reads a complete deflate stream and writes out all of the
1130
+ uncompressed data, or until it encounters an error. The function's
1131
+ parameters and return types are defined above in the in_func and out_func
1132
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
1133
+ number of bytes of provided input, and a pointer to that input in buf. If
1134
+ there is no input available, in() must return zero -- buf is ignored in that
1135
+ case -- and inflateBack() will return a buffer error. inflateBack() will
1136
+ call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
1137
+ out() should return zero on success, or non-zero on failure. If out()
1138
+ returns non-zero, inflateBack() will return with an error. Neither in() nor
1139
+ out() are permitted to change the contents of the window provided to
1140
+ inflateBackInit(), which is also the buffer that out() uses to write from.
1141
+ The length written by out() will be at most the window size. Any non-zero
1142
+ amount of input may be provided by in().
1143
+
1144
+ For convenience, inflateBack() can be provided input on the first call by
1145
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
1146
+ in() will be called. Therefore strm->next_in must be initialized before
1147
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
1148
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
1149
+ must also be initialized, and then if strm->avail_in is not zero, input will
1150
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
1151
+
1152
+ The in_desc and out_desc parameters of inflateBack() is passed as the
1153
+ first parameter of in() and out() respectively when they are called. These
1154
+ descriptors can be optionally used to pass any information that the caller-
1155
+ supplied in() and out() functions need to do their job.
1156
+
1157
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
1158
+ pass back any unused input that was provided by the last in() call. The
1159
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
1160
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format error
1161
+ in the deflate stream (in which case strm->msg is set to indicate the nature
1162
+ of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
1163
+ In the case of Z_BUF_ERROR, an input or output error can be distinguished
1164
+ using strm->next_in which will be Z_NULL only if in() returned an error. If
1165
+ strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
1166
+ non-zero. (in() will always be called before out(), so strm->next_in is
1167
+ assured to be defined if out() returns non-zero.) Note that inflateBack()
1168
+ cannot return Z_OK.
1169
+ */
1170
+
1171
+ ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm);
1172
+ /*
1173
+ All memory allocated by inflateBackInit() is freed.
1174
+
1175
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
1176
+ state was inconsistent.
1177
+ */
1178
+
1179
+ ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
1180
+ /* Return flags indicating compile-time options.
1181
+
1182
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
1183
+ 1.0: size of uInt
1184
+ 3.2: size of uLong
1185
+ 5.4: size of voidpf (pointer)
1186
+ 7.6: size of z_off_t
1187
+
1188
+ Compiler, assembler, and debug options:
1189
+ 8: ZLIB_DEBUG
1190
+ 9: ASMV or ASMINF -- use ASM code
1191
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
1192
+ 11: 0 (reserved)
1193
+
1194
+ One-time table building (smaller code, but not thread-safe if true):
1195
+ 12: BUILDFIXED -- build static block decoding tables when needed
1196
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
1197
+ 14,15: 0 (reserved)
1198
+
1199
+ Library content (indicates missing functionality):
1200
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
1201
+ deflate code when not needed)
1202
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
1203
+ and decode gzip streams (to avoid linking crc code)
1204
+ 18-19: 0 (reserved)
1205
+
1206
+ Operation variations (changes in library functionality):
1207
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
1208
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
1209
+ 22,23: 0 (reserved)
1210
+
1211
+ The sprintf variant used by gzprintf (zero is best):
1212
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
1213
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
1214
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
1215
+
1216
+ Remainder:
1217
+ 27-31: 0 (reserved)
1218
+ */
1219
+
1220
+ #ifndef Z_SOLO
1221
+
1222
+ /* utility functions */
1223
+
1224
+ /*
1225
+ The following utility functions are implemented on top of the basic
1226
+ stream-oriented functions. To simplify the interface, some default options
1227
+ are assumed (compression level and memory usage, standard memory allocation
1228
+ functions). The source code of these utility functions can be modified if
1229
+ you need special options.
1230
+ */
1231
+
1232
+ ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen,
1233
+ const Bytef *source, uLong sourceLen);
1234
+ /*
1235
+ Compresses the source buffer into the destination buffer. sourceLen is
1236
+ the byte length of the source buffer. Upon entry, destLen is the total size
1237
+ of the destination buffer, which must be at least the value returned by
1238
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
1239
+ compressed data. compress() is equivalent to compress2() with a level
1240
+ parameter of Z_DEFAULT_COMPRESSION.
1241
+
1242
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
1243
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
1244
+ buffer.
1245
+ */
1246
+
1247
+ ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen,
1248
+ const Bytef *source, uLong sourceLen,
1249
+ int level);
1250
+ /*
1251
+ Compresses the source buffer into the destination buffer. The level
1252
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
1253
+ length of the source buffer. Upon entry, destLen is the total size of the
1254
+ destination buffer, which must be at least the value returned by
1255
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
1256
+ compressed data.
1257
+
1258
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
1259
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
1260
+ Z_STREAM_ERROR if the level parameter is invalid.
1261
+ */
1262
+
1263
+ ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);
1264
+ /*
1265
+ compressBound() returns an upper bound on the compressed size after
1266
+ compress() or compress2() on sourceLen bytes. It would be used before a
1267
+ compress() or compress2() call to allocate the destination buffer.
1268
+ */
1269
+
1270
+ ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
1271
+ const Bytef *source, uLong sourceLen);
1272
+ /*
1273
+ Decompresses the source buffer into the destination buffer. sourceLen is
1274
+ the byte length of the source buffer. Upon entry, destLen is the total size
1275
+ of the destination buffer, which must be large enough to hold the entire
1276
+ uncompressed data. (The size of the uncompressed data must have been saved
1277
+ previously by the compressor and transmitted to the decompressor by some
1278
+ mechanism outside the scope of this compression library.) Upon exit, destLen
1279
+ is the actual size of the uncompressed data.
1280
+
1281
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
1282
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
1283
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
1284
+ the case where there is not enough room, uncompress() will fill the output
1285
+ buffer with the uncompressed data up to that point.
1286
+ */
1287
+
1288
+ ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen,
1289
+ const Bytef *source, uLong *sourceLen);
1290
+ /*
1291
+ Same as uncompress, except that sourceLen is a pointer, where the
1292
+ length of the source is *sourceLen. On return, *sourceLen is the number of
1293
+ source bytes consumed.
1294
+ */
1295
+
1296
+ /* gzip file access functions */
1297
+
1298
+ /*
1299
+ This library supports reading and writing files in gzip (.gz) format with
1300
+ an interface similar to that of stdio, using the functions that start with
1301
+ "gz". The gzip format is different from the zlib format. gzip is a gzip
1302
+ wrapper, documented in RFC 1952, wrapped around a deflate stream.
1303
+ */
1304
+
1305
+ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
1306
+
1307
+ /*
1308
+ ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);
1309
+
1310
+ Open the gzip (.gz) file at path for reading and decompressing, or
1311
+ compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
1312
+ but can also include a compression level ("wb9") or a strategy: 'f' for
1313
+ filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
1314
+ 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
1315
+ as in "wb9F". (See the description of deflateInit2 for more information
1316
+ about the strategy parameter.) 'T' will request transparent writing or
1317
+ appending with no compression and not using the gzip format.
1318
+
1319
+ "a" can be used instead of "w" to request that the gzip stream that will
1320
+ be written be appended to the file. "+" will result in an error, since
1321
+ reading and writing to the same gzip file is not supported. The addition of
1322
+ "x" when writing will create the file exclusively, which fails if the file
1323
+ already exists. On systems that support it, the addition of "e" when
1324
+ reading or writing will set the flag to close the file on an execve() call.
1325
+
1326
+ These functions, as well as gzip, will read and decode a sequence of gzip
1327
+ streams in a file. The append function of gzopen() can be used to create
1328
+ such a file. (Also see gzflush() for another way to do this.) When
1329
+ appending, gzopen does not test whether the file begins with a gzip stream,
1330
+ nor does it look for the end of the gzip streams to begin appending. gzopen
1331
+ will simply append a gzip stream to the existing file.
1332
+
1333
+ gzopen can be used to read a file which is not in gzip format; in this
1334
+ case gzread will directly read from the file without decompression. When
1335
+ reading, this will be detected automatically by looking for the magic two-
1336
+ byte gzip header.
1337
+
1338
+ gzopen returns NULL if the file could not be opened, if there was
1339
+ insufficient memory to allocate the gzFile state, or if an invalid mode was
1340
+ specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
1341
+ errno can be checked to determine if the reason gzopen failed was that the
1342
+ file could not be opened.
1343
+ */
1344
+
1345
+ ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
1346
+ /*
1347
+ Associate a gzFile with the file descriptor fd. File descriptors are
1348
+ obtained from calls like open, dup, creat, pipe or fileno (if the file has
1349
+ been previously opened with fopen). The mode parameter is as in gzopen.
1350
+
1351
+ The next call of gzclose on the returned gzFile will also close the file
1352
+ descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
1353
+ fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
1354
+ mode);. The duplicated descriptor should be saved to avoid a leak, since
1355
+ gzdopen does not close fd if it fails. If you are using fileno() to get the
1356
+ file descriptor from a FILE *, then you will have to use dup() to avoid
1357
+ double-close()ing the file descriptor. Both gzclose() and fclose() will
1358
+ close the associated file descriptor, so they need to have different file
1359
+ descriptors.
1360
+
1361
+ gzdopen returns NULL if there was insufficient memory to allocate the
1362
+ gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
1363
+ provided, or '+' was provided), or if fd is -1. The file descriptor is not
1364
+ used until the next gz* read, write, seek, or close operation, so gzdopen
1365
+ will not detect if fd is invalid (unless fd is -1).
1366
+ */
1367
+
1368
+ ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size);
1369
+ /*
1370
+ Set the internal buffer size used by this library's functions for file to
1371
+ size. The default buffer size is 8192 bytes. This function must be called
1372
+ after gzopen() or gzdopen(), and before any other calls that read or write
1373
+ the file. The buffer memory allocation is always deferred to the first read
1374
+ or write. Three times that size in buffer space is allocated. A larger
1375
+ buffer size of, for example, 64K or 128K bytes will noticeably increase the
1376
+ speed of decompression (reading).
1377
+
1378
+ The new buffer size also affects the maximum length for gzprintf().
1379
+
1380
+ gzbuffer() returns 0 on success, or -1 on failure, such as being called
1381
+ too late.
1382
+ */
1383
+
1384
+ ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy);
1385
+ /*
1386
+ Dynamically update the compression level and strategy for file. See the
1387
+ description of deflateInit2 for the meaning of these parameters. Previously
1388
+ provided data is flushed before applying the parameter changes.
1389
+
1390
+ gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
1391
+ opened for writing, Z_ERRNO if there is an error writing the flushed data,
1392
+ or Z_MEM_ERROR if there is a memory allocation error.
1393
+ */
1394
+
1395
+ ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);
1396
+ /*
1397
+ Read and decompress up to len uncompressed bytes from file into buf. If
1398
+ the input file is not in gzip format, gzread copies the given number of
1399
+ bytes into the buffer directly from the file.
1400
+
1401
+ After reaching the end of a gzip stream in the input, gzread will continue
1402
+ to read, looking for another gzip stream. Any number of gzip streams may be
1403
+ concatenated in the input file, and will all be decompressed by gzread().
1404
+ If something other than a gzip stream is encountered after a gzip stream,
1405
+ that remaining trailing garbage is ignored (and no error is returned).
1406
+
1407
+ gzread can be used to read a gzip file that is being concurrently written.
1408
+ Upon reaching the end of the input, gzread will return with the available
1409
+ data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
1410
+ gzclearerr can be used to clear the end of file indicator in order to permit
1411
+ gzread to be tried again. Z_OK indicates that a gzip stream was completed
1412
+ on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
1413
+ middle of a gzip stream. Note that gzread does not return -1 in the event
1414
+ of an incomplete gzip stream. This error is deferred until gzclose(), which
1415
+ will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
1416
+ stream. Alternatively, gzerror can be used before gzclose to detect this
1417
+ case.
1418
+
1419
+ gzread returns the number of uncompressed bytes actually read, less than
1420
+ len for end of file, or -1 for error. If len is too large to fit in an int,
1421
+ then nothing is read, -1 is returned, and the error state is set to
1422
+ Z_STREAM_ERROR.
1423
+ */
1424
+
1425
+ ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
1426
+ gzFile file);
1427
+ /*
1428
+ Read and decompress up to nitems items of size size from file into buf,
1429
+ otherwise operating as gzread() does. This duplicates the interface of
1430
+ stdio's fread(), with size_t request and return types. If the library
1431
+ defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
1432
+ is an unsigned integer type that can contain a pointer.
1433
+
1434
+ gzfread() returns the number of full items read of size size, or zero if
1435
+ the end of the file was reached and a full item could not be read, or if
1436
+ there was an error. gzerror() must be consulted if zero is returned in
1437
+ order to determine if there was an error. If the multiplication of size and
1438
+ nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
1439
+ is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
1440
+
1441
+ In the event that the end of file is reached and only a partial item is
1442
+ available at the end, i.e. the remaining uncompressed data length is not a
1443
+ multiple of size, then the final partial item is nevertheless read into buf
1444
+ and the end-of-file flag is set. The length of the partial item read is not
1445
+ provided, but could be inferred from the result of gztell(). This behavior
1446
+ is the same as the behavior of fread() implementations in common libraries,
1447
+ but it prevents the direct use of gzfread() to read a concurrently written
1448
+ file, resetting and retrying on end-of-file, when size is not 1.
1449
+ */
1450
+
1451
+ ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);
1452
+ /*
1453
+ Compress and write the len uncompressed bytes at buf to file. gzwrite
1454
+ returns the number of uncompressed bytes written or 0 in case of error.
1455
+ */
1456
+
1457
+ ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
1458
+ z_size_t nitems, gzFile file);
1459
+ /*
1460
+ Compress and write nitems items of size size from buf to file, duplicating
1461
+ the interface of stdio's fwrite(), with size_t request and return types. If
1462
+ the library defines size_t, then z_size_t is identical to size_t. If not,
1463
+ then z_size_t is an unsigned integer type that can contain a pointer.
1464
+
1465
+ gzfwrite() returns the number of full items written of size size, or zero
1466
+ if there was an error. If the multiplication of size and nitems overflows,
1467
+ i.e. the product does not fit in a z_size_t, then nothing is written, zero
1468
+ is returned, and the error state is set to Z_STREAM_ERROR.
1469
+ */
1470
+
1471
+ ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
1472
+ /*
1473
+ Convert, format, compress, and write the arguments (...) to file under
1474
+ control of the string format, as in fprintf. gzprintf returns the number of
1475
+ uncompressed bytes actually written, or a negative zlib error code in case
1476
+ of error. The number of uncompressed bytes written is limited to 8191, or
1477
+ one less than the buffer size given to gzbuffer(). The caller should assure
1478
+ that this limit is not exceeded. If it is exceeded, then gzprintf() will
1479
+ return an error (0) with nothing written. In this case, there may also be a
1480
+ buffer overflow with unpredictable consequences, which is possible only if
1481
+ zlib was compiled with the insecure functions sprintf() or vsprintf(),
1482
+ because the secure snprintf() or vsnprintf() functions were not available.
1483
+ This can be determined using zlibCompileFlags().
1484
+ */
1485
+
1486
+ ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);
1487
+ /*
1488
+ Compress and write the given null-terminated string s to file, excluding
1489
+ the terminating null character.
1490
+
1491
+ gzputs returns the number of characters written, or -1 in case of error.
1492
+ */
1493
+
1494
+ ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
1495
+ /*
1496
+ Read and decompress bytes from file into buf, until len-1 characters are
1497
+ read, or until a newline character is read and transferred to buf, or an
1498
+ end-of-file condition is encountered. If any characters are read or if len
1499
+ is one, the string is terminated with a null character. If no characters
1500
+ are read due to an end-of-file or len is less than one, then the buffer is
1501
+ left untouched.
1502
+
1503
+ gzgets returns buf which is a null-terminated string, or it returns NULL
1504
+ for end-of-file or in case of error. If there was an error, the contents at
1505
+ buf are indeterminate.
1506
+ */
1507
+
1508
+ ZEXTERN int ZEXPORT gzputc(gzFile file, int c);
1509
+ /*
1510
+ Compress and write c, converted to an unsigned char, into file. gzputc
1511
+ returns the value that was written, or -1 in case of error.
1512
+ */
1513
+
1514
+ ZEXTERN int ZEXPORT gzgetc(gzFile file);
1515
+ /*
1516
+ Read and decompress one byte from file. gzgetc returns this byte or -1
1517
+ in case of end of file or error. This is implemented as a macro for speed.
1518
+ As such, it does not do all of the checking the other functions do. I.e.
1519
+ it does not check to see if file is NULL, nor whether the structure file
1520
+ points to has been clobbered or not.
1521
+ */
1522
+
1523
+ ZEXTERN int ZEXPORT gzungetc(int c, gzFile file);
1524
+ /*
1525
+ Push c back onto the stream for file to be read as the first character on
1526
+ the next read. At least one character of push-back is always allowed.
1527
+ gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
1528
+ fail if c is -1, and may fail if a character has been pushed but not read
1529
+ yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
1530
+ output buffer size of pushed characters is allowed. (See gzbuffer above.)
1531
+ The pushed character will be discarded if the stream is repositioned with
1532
+ gzseek() or gzrewind().
1533
+ */
1534
+
1535
+ ZEXTERN int ZEXPORT gzflush(gzFile file, int flush);
1536
+ /*
1537
+ Flush all pending output to file. The parameter flush is as in the
1538
+ deflate() function. The return value is the zlib error number (see function
1539
+ gzerror below). gzflush is only permitted when writing.
1540
+
1541
+ If the flush parameter is Z_FINISH, the remaining data is written and the
1542
+ gzip stream is completed in the output. If gzwrite() is called again, a new
1543
+ gzip stream will be started in the output. gzread() is able to read such
1544
+ concatenated gzip streams.
1545
+
1546
+ gzflush should be called only when strictly necessary because it will
1547
+ degrade compression if called too often.
1548
+ */
1549
+
1550
+ /*
1551
+ ZEXTERN z_off_t ZEXPORT gzseek(gzFile file,
1552
+ z_off_t offset, int whence);
1553
+
1554
+ Set the starting position to offset relative to whence for the next gzread
1555
+ or gzwrite on file. The offset represents a number of bytes in the
1556
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
1557
+ the value SEEK_END is not supported.
1558
+
1559
+ If the file is opened for reading, this function is emulated but can be
1560
+ extremely slow. If the file is opened for writing, only forward seeks are
1561
+ supported; gzseek then compresses a sequence of zeroes up to the new
1562
+ starting position.
1563
+
1564
+ gzseek returns the resulting offset location as measured in bytes from
1565
+ the beginning of the uncompressed stream, or -1 in case of error, in
1566
+ particular if the file is opened for writing and the new starting position
1567
+ would be before the current position.
1568
+ */
1569
+
1570
+ ZEXTERN int ZEXPORT gzrewind(gzFile file);
1571
+ /*
1572
+ Rewind file. This function is supported only for reading.
1573
+
1574
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
1575
+ */
1576
+
1577
+ /*
1578
+ ZEXTERN z_off_t ZEXPORT gztell(gzFile file);
1579
+
1580
+ Return the starting position for the next gzread or gzwrite on file.
1581
+ This position represents a number of bytes in the uncompressed data stream,
1582
+ and is zero when starting, even if appending or reading a gzip stream from
1583
+ the middle of a file using gzdopen().
1584
+
1585
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
1586
+ */
1587
+
1588
+ /*
1589
+ ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file);
1590
+
1591
+ Return the current compressed (actual) read or write offset of file. This
1592
+ offset includes the count of bytes that precede the gzip stream, for example
1593
+ when appending or when using gzdopen() for reading. When reading, the
1594
+ offset does not include as yet unused buffered input. This information can
1595
+ be used for a progress indicator. On error, gzoffset() returns -1.
1596
+ */
1597
+
1598
+ ZEXTERN int ZEXPORT gzeof(gzFile file);
1599
+ /*
1600
+ Return true (1) if the end-of-file indicator for file has been set while
1601
+ reading, false (0) otherwise. Note that the end-of-file indicator is set
1602
+ only if the read tried to go past the end of the input, but came up short.
1603
+ Therefore, just like feof(), gzeof() may return false even if there is no
1604
+ more data to read, in the event that the last read request was for the exact
1605
+ number of bytes remaining in the input file. This will happen if the input
1606
+ file size is an exact multiple of the buffer size.
1607
+
1608
+ If gzeof() returns true, then the read functions will return no more data,
1609
+ unless the end-of-file indicator is reset by gzclearerr() and the input file
1610
+ has grown since the previous end of file was detected.
1611
+ */
1612
+
1613
+ ZEXTERN int ZEXPORT gzdirect(gzFile file);
1614
+ /*
1615
+ Return true (1) if file is being copied directly while reading, or false
1616
+ (0) if file is a gzip stream being decompressed.
1617
+
1618
+ If the input file is empty, gzdirect() will return true, since the input
1619
+ does not contain a gzip stream.
1620
+
1621
+ If gzdirect() is used immediately after gzopen() or gzdopen() it will
1622
+ cause buffers to be allocated to allow reading the file to determine if it
1623
+ is a gzip file. Therefore if gzbuffer() is used, it should be called before
1624
+ gzdirect().
1625
+
1626
+ When writing, gzdirect() returns true (1) if transparent writing was
1627
+ requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
1628
+ gzdirect() is not needed when writing. Transparent writing must be
1629
+ explicitly requested, so the application already knows the answer. When
1630
+ linking statically, using gzdirect() will include all of the zlib code for
1631
+ gzip file reading and decompression, which may not be desired.)
1632
+ */
1633
+
1634
+ ZEXTERN int ZEXPORT gzclose(gzFile file);
1635
+ /*
1636
+ Flush all pending output for file, if necessary, close file and
1637
+ deallocate the (de)compression state. Note that once file is closed, you
1638
+ cannot call gzerror with file, since its structures have been deallocated.
1639
+ gzclose must not be called more than once on the same file, just as free
1640
+ must not be called more than once on the same allocation.
1641
+
1642
+ gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
1643
+ file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
1644
+ last read ended in the middle of a gzip stream, or Z_OK on success.
1645
+ */
1646
+
1647
+ ZEXTERN int ZEXPORT gzclose_r(gzFile file);
1648
+ ZEXTERN int ZEXPORT gzclose_w(gzFile file);
1649
+ /*
1650
+ Same as gzclose(), but gzclose_r() is only for use when reading, and
1651
+ gzclose_w() is only for use when writing or appending. The advantage to
1652
+ using these instead of gzclose() is that they avoid linking in zlib
1653
+ compression or decompression code that is not used when only reading or only
1654
+ writing respectively. If gzclose() is used, then both compression and
1655
+ decompression code will be included the application when linking to a static
1656
+ zlib library.
1657
+ */
1658
+
1659
+ ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
1660
+ /*
1661
+ Return the error message for the last error which occurred on file.
1662
+ errnum is set to zlib error number. If an error occurred in the file system
1663
+ and not in the compression library, errnum is set to Z_ERRNO and the
1664
+ application may consult errno to get the exact error code.
1665
+
1666
+ The application must not modify the returned string. Future calls to
1667
+ this function may invalidate the previously returned string. If file is
1668
+ closed, then the string previously returned by gzerror will no longer be
1669
+ available.
1670
+
1671
+ gzerror() should be used to distinguish errors from end-of-file for those
1672
+ functions above that do not distinguish those cases in their return values.
1673
+ */
1674
+
1675
+ ZEXTERN void ZEXPORT gzclearerr(gzFile file);
1676
+ /*
1677
+ Clear the error and end-of-file flags for file. This is analogous to the
1678
+ clearerr() function in stdio. This is useful for continuing to read a gzip
1679
+ file that is being written concurrently.
1680
+ */
1681
+
1682
+ #endif /* !Z_SOLO */
1683
+
1684
+ /* checksum functions */
1685
+
1686
+ /*
1687
+ These functions are not related to compression but are exported
1688
+ anyway because they might be useful in applications using the compression
1689
+ library.
1690
+ */
1691
+
1692
+ ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
1693
+ /*
1694
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
1695
+ return the updated checksum. An Adler-32 value is in the range of a 32-bit
1696
+ unsigned integer. If buf is Z_NULL, this function returns the required
1697
+ initial value for the checksum.
1698
+
1699
+ An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
1700
+ much faster.
1701
+
1702
+ Usage example:
1703
+
1704
+ uLong adler = adler32(0L, Z_NULL, 0);
1705
+
1706
+ while (read_buffer(buffer, length) != EOF) {
1707
+ adler = adler32(adler, buffer, length);
1708
+ }
1709
+ if (adler != original_adler) error();
1710
+ */
1711
+
1712
+ ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
1713
+ z_size_t len);
1714
+ /*
1715
+ Same as adler32(), but with a size_t length.
1716
+ */
1717
+
1718
+ /*
1719
+ ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2,
1720
+ z_off_t len2);
1721
+
1722
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
1723
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
1724
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
1725
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
1726
+ that the z_off_t type (like off_t) is a signed integer. If len2 is
1727
+ negative, the result has no meaning or utility.
1728
+ */
1729
+
1730
+ ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
1731
+ /*
1732
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
1733
+ updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
1734
+ If buf is Z_NULL, this function returns the required initial value for the
1735
+ crc. Pre- and post-conditioning (one's complement) is performed within this
1736
+ function so it shouldn't be done by the application.
1737
+
1738
+ Usage example:
1739
+
1740
+ uLong crc = crc32(0L, Z_NULL, 0);
1741
+
1742
+ while (read_buffer(buffer, length) != EOF) {
1743
+ crc = crc32(crc, buffer, length);
1744
+ }
1745
+ if (crc != original_crc) error();
1746
+ */
1747
+
1748
+ ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
1749
+ z_size_t len);
1750
+ /*
1751
+ Same as crc32(), but with a size_t length.
1752
+ */
1753
+
1754
+ /*
1755
+ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
1756
+
1757
+ Combine two CRC-32 check values into one. For two sequences of bytes,
1758
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
1759
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
1760
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
1761
+ len2. len2 must be non-negative.
1762
+ */
1763
+
1764
+ /*
1765
+ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
1766
+
1767
+ Return the operator corresponding to length len2, to be used with
1768
+ crc32_combine_op(). len2 must be non-negative.
1769
+ */
1770
+
1771
+ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
1772
+ /*
1773
+ Give the same result as crc32_combine(), using op in place of len2. op is
1774
+ is generated from len2 by crc32_combine_gen(). This will be faster than
1775
+ crc32_combine() if the generated op is used more than once.
1776
+ */
1777
+
1778
+
1779
+ /* various hacks, don't look :) */
1780
+
1781
+ /* deflateInit and inflateInit are macros to allow checking the zlib version
1782
+ * and the compiler's view of z_stream:
1783
+ */
1784
+ ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level,
1785
+ const char *version, int stream_size);
1786
+ ZEXTERN int ZEXPORT inflateInit_(z_streamp strm,
1787
+ const char *version, int stream_size);
1788
+ ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
1789
+ int windowBits, int memLevel,
1790
+ int strategy, const char *version,
1791
+ int stream_size);
1792
+ ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
1793
+ const char *version, int stream_size);
1794
+ ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
1795
+ unsigned char FAR *window,
1796
+ const char *version,
1797
+ int stream_size);
1798
+ #ifdef Z_PREFIX_SET
1799
+ # define z_deflateInit(strm, level) \
1800
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
1801
+ # define z_inflateInit(strm) \
1802
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
1803
+ # define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
1804
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
1805
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
1806
+ # define z_inflateInit2(strm, windowBits) \
1807
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
1808
+ (int)sizeof(z_stream))
1809
+ # define z_inflateBackInit(strm, windowBits, window) \
1810
+ inflateBackInit_((strm), (windowBits), (window), \
1811
+ ZLIB_VERSION, (int)sizeof(z_stream))
1812
+ #else
1813
+ # define deflateInit(strm, level) \
1814
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
1815
+ # define inflateInit(strm) \
1816
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
1817
+ # define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
1818
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
1819
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
1820
+ # define inflateInit2(strm, windowBits) \
1821
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
1822
+ (int)sizeof(z_stream))
1823
+ # define inflateBackInit(strm, windowBits, window) \
1824
+ inflateBackInit_((strm), (windowBits), (window), \
1825
+ ZLIB_VERSION, (int)sizeof(z_stream))
1826
+ #endif
1827
+
1828
+ #ifndef Z_SOLO
1829
+
1830
+ /* gzgetc() macro and its supporting function and exposed data structure. Note
1831
+ * that the real internal state is much larger than the exposed structure.
1832
+ * This abbreviated structure exposes just enough for the gzgetc() macro. The
1833
+ * user should not mess with these exposed elements, since their names or
1834
+ * behavior could change in the future, perhaps even capriciously. They can
1835
+ * only be used by the gzgetc() macro. You have been warned.
1836
+ */
1837
+ struct gzFile_s {
1838
+ unsigned have;
1839
+ unsigned char *next;
1840
+ z_off64_t pos;
1841
+ };
1842
+ ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */
1843
+ #ifdef Z_PREFIX_SET
1844
+ # undef z_gzgetc
1845
+ # define z_gzgetc(g) \
1846
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
1847
+ #else
1848
+ # define gzgetc(g) \
1849
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
1850
+ #endif
1851
+
1852
+ /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
1853
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
1854
+ * both are true, the application gets the *64 functions, and the regular
1855
+ * functions are changed to 64 bits) -- in case these are set on systems
1856
+ * without large file support, _LFS64_LARGEFILE must also be true
1857
+ */
1858
+ #ifdef Z_LARGE64
1859
+ ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
1860
+ ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
1861
+ ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
1862
+ ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
1863
+ ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
1864
+ ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
1865
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
1866
+ #endif
1867
+
1868
+ #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
1869
+ # ifdef Z_PREFIX_SET
1870
+ # define z_gzopen z_gzopen64
1871
+ # define z_gzseek z_gzseek64
1872
+ # define z_gztell z_gztell64
1873
+ # define z_gzoffset z_gzoffset64
1874
+ # define z_adler32_combine z_adler32_combine64
1875
+ # define z_crc32_combine z_crc32_combine64
1876
+ # define z_crc32_combine_gen z_crc32_combine_gen64
1877
+ # else
1878
+ # define gzopen gzopen64
1879
+ # define gzseek gzseek64
1880
+ # define gztell gztell64
1881
+ # define gzoffset gzoffset64
1882
+ # define adler32_combine adler32_combine64
1883
+ # define crc32_combine crc32_combine64
1884
+ # define crc32_combine_gen crc32_combine_gen64
1885
+ # endif
1886
+ # ifndef Z_LARGE64
1887
+ ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
1888
+ ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int);
1889
+ ZEXTERN z_off_t ZEXPORT gztell64(gzFile);
1890
+ ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile);
1891
+ ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
1892
+ ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
1893
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
1894
+ # endif
1895
+ #else
1896
+ ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);
1897
+ ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int);
1898
+ ZEXTERN z_off_t ZEXPORT gztell(gzFile);
1899
+ ZEXTERN z_off_t ZEXPORT gzoffset(gzFile);
1900
+ ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
1901
+ ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
1902
+ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
1903
+ #endif
1904
+
1905
+ #else /* Z_SOLO */
1906
+
1907
+ ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
1908
+ ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
1909
+ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
1910
+
1911
+ #endif /* !Z_SOLO */
1912
+
1913
+ /* undocumented functions */
1914
+ ZEXTERN const char * ZEXPORT zError(int);
1915
+ ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp);
1916
+ ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
1917
+ ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int);
1918
+ ZEXTERN int ZEXPORT inflateValidate(z_streamp, int);
1919
+ ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp);
1920
+ ZEXTERN int ZEXPORT inflateResetKeep(z_streamp);
1921
+ ZEXTERN int ZEXPORT deflateResetKeep(z_streamp);
1922
+ #if defined(_WIN32) && !defined(Z_SOLO)
1923
+ ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path,
1924
+ const char *mode);
1925
+ #endif
1926
+ #if defined(STDC) || defined(Z_HAVE_STDARG_H)
1927
+ # ifndef Z_SOLO
1928
+ ZEXTERN int ZEXPORTVA gzvprintf(gzFile file,
1929
+ const char *format,
1930
+ va_list va);
1931
+ # endif
1932
+ #endif
1933
+
1934
+ #ifdef __cplusplus
1935
+ }
1936
+ #endif
1937
+
1938
+ #endif /* ZLIB_H */
venv/lib/python3.10/site-packages/lxml/includes/libxml/SAX.h ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Old SAX version 1 handler, deprecated
3
+ * Description: DEPRECATED set of SAX version 1 interfaces used to
4
+ * build the DOM tree.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+
12
+ #ifndef __XML_SAX_H__
13
+ #define __XML_SAX_H__
14
+
15
+ #include <libxml/xmlversion.h>
16
+ #include <libxml/parser.h>
17
+
18
+ #ifdef LIBXML_LEGACY_ENABLED
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+ XML_DEPRECATED
24
+ XMLPUBFUN const xmlChar *
25
+ getPublicId (void *ctx);
26
+ XML_DEPRECATED
27
+ XMLPUBFUN const xmlChar *
28
+ getSystemId (void *ctx);
29
+ XML_DEPRECATED
30
+ XMLPUBFUN void
31
+ setDocumentLocator (void *ctx,
32
+ xmlSAXLocatorPtr loc);
33
+
34
+ XML_DEPRECATED
35
+ XMLPUBFUN int
36
+ getLineNumber (void *ctx);
37
+ XML_DEPRECATED
38
+ XMLPUBFUN int
39
+ getColumnNumber (void *ctx);
40
+
41
+ XML_DEPRECATED
42
+ XMLPUBFUN int
43
+ isStandalone (void *ctx);
44
+ XML_DEPRECATED
45
+ XMLPUBFUN int
46
+ hasInternalSubset (void *ctx);
47
+ XML_DEPRECATED
48
+ XMLPUBFUN int
49
+ hasExternalSubset (void *ctx);
50
+
51
+ XML_DEPRECATED
52
+ XMLPUBFUN void
53
+ internalSubset (void *ctx,
54
+ const xmlChar *name,
55
+ const xmlChar *ExternalID,
56
+ const xmlChar *SystemID);
57
+ XML_DEPRECATED
58
+ XMLPUBFUN void
59
+ externalSubset (void *ctx,
60
+ const xmlChar *name,
61
+ const xmlChar *ExternalID,
62
+ const xmlChar *SystemID);
63
+ XML_DEPRECATED
64
+ XMLPUBFUN xmlEntityPtr
65
+ getEntity (void *ctx,
66
+ const xmlChar *name);
67
+ XML_DEPRECATED
68
+ XMLPUBFUN xmlEntityPtr
69
+ getParameterEntity (void *ctx,
70
+ const xmlChar *name);
71
+ XML_DEPRECATED
72
+ XMLPUBFUN xmlParserInputPtr
73
+ resolveEntity (void *ctx,
74
+ const xmlChar *publicId,
75
+ const xmlChar *systemId);
76
+
77
+ XML_DEPRECATED
78
+ XMLPUBFUN void
79
+ entityDecl (void *ctx,
80
+ const xmlChar *name,
81
+ int type,
82
+ const xmlChar *publicId,
83
+ const xmlChar *systemId,
84
+ xmlChar *content);
85
+ XML_DEPRECATED
86
+ XMLPUBFUN void
87
+ attributeDecl (void *ctx,
88
+ const xmlChar *elem,
89
+ const xmlChar *fullname,
90
+ int type,
91
+ int def,
92
+ const xmlChar *defaultValue,
93
+ xmlEnumerationPtr tree);
94
+ XML_DEPRECATED
95
+ XMLPUBFUN void
96
+ elementDecl (void *ctx,
97
+ const xmlChar *name,
98
+ int type,
99
+ xmlElementContentPtr content);
100
+ XML_DEPRECATED
101
+ XMLPUBFUN void
102
+ notationDecl (void *ctx,
103
+ const xmlChar *name,
104
+ const xmlChar *publicId,
105
+ const xmlChar *systemId);
106
+ XML_DEPRECATED
107
+ XMLPUBFUN void
108
+ unparsedEntityDecl (void *ctx,
109
+ const xmlChar *name,
110
+ const xmlChar *publicId,
111
+ const xmlChar *systemId,
112
+ const xmlChar *notationName);
113
+
114
+ XML_DEPRECATED
115
+ XMLPUBFUN void
116
+ startDocument (void *ctx);
117
+ XML_DEPRECATED
118
+ XMLPUBFUN void
119
+ endDocument (void *ctx);
120
+ XML_DEPRECATED
121
+ XMLPUBFUN void
122
+ attribute (void *ctx,
123
+ const xmlChar *fullname,
124
+ const xmlChar *value);
125
+ XML_DEPRECATED
126
+ XMLPUBFUN void
127
+ startElement (void *ctx,
128
+ const xmlChar *fullname,
129
+ const xmlChar **atts);
130
+ XML_DEPRECATED
131
+ XMLPUBFUN void
132
+ endElement (void *ctx,
133
+ const xmlChar *name);
134
+ XML_DEPRECATED
135
+ XMLPUBFUN void
136
+ reference (void *ctx,
137
+ const xmlChar *name);
138
+ XML_DEPRECATED
139
+ XMLPUBFUN void
140
+ characters (void *ctx,
141
+ const xmlChar *ch,
142
+ int len);
143
+ XML_DEPRECATED
144
+ XMLPUBFUN void
145
+ ignorableWhitespace (void *ctx,
146
+ const xmlChar *ch,
147
+ int len);
148
+ XML_DEPRECATED
149
+ XMLPUBFUN void
150
+ processingInstruction (void *ctx,
151
+ const xmlChar *target,
152
+ const xmlChar *data);
153
+ XML_DEPRECATED
154
+ XMLPUBFUN void
155
+ globalNamespace (void *ctx,
156
+ const xmlChar *href,
157
+ const xmlChar *prefix);
158
+ XML_DEPRECATED
159
+ XMLPUBFUN void
160
+ setNamespace (void *ctx,
161
+ const xmlChar *name);
162
+ XML_DEPRECATED
163
+ XMLPUBFUN xmlNsPtr
164
+ getNamespace (void *ctx);
165
+ XML_DEPRECATED
166
+ XMLPUBFUN int
167
+ checkNamespace (void *ctx,
168
+ xmlChar *nameSpace);
169
+ XML_DEPRECATED
170
+ XMLPUBFUN void
171
+ namespaceDecl (void *ctx,
172
+ const xmlChar *href,
173
+ const xmlChar *prefix);
174
+ XML_DEPRECATED
175
+ XMLPUBFUN void
176
+ comment (void *ctx,
177
+ const xmlChar *value);
178
+ XML_DEPRECATED
179
+ XMLPUBFUN void
180
+ cdataBlock (void *ctx,
181
+ const xmlChar *value,
182
+ int len);
183
+
184
+ #ifdef LIBXML_SAX1_ENABLED
185
+ XML_DEPRECATED
186
+ XMLPUBFUN void
187
+ initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
188
+ int warning);
189
+ #ifdef LIBXML_HTML_ENABLED
190
+ XML_DEPRECATED
191
+ XMLPUBFUN void
192
+ inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
193
+ #endif
194
+ #endif /* LIBXML_SAX1_ENABLED */
195
+
196
+ #ifdef __cplusplus
197
+ }
198
+ #endif
199
+
200
+ #endif /* LIBXML_LEGACY_ENABLED */
201
+
202
+ #endif /* __XML_SAX_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/SAX2.h ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: SAX2 parser interface used to build the DOM tree
3
+ * Description: those are the default SAX2 interfaces used by
4
+ * the library when building DOM tree.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+
12
+ #ifndef __XML_SAX2_H__
13
+ #define __XML_SAX2_H__
14
+
15
+ #include <libxml/xmlversion.h>
16
+ #include <libxml/parser.h>
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+ XMLPUBFUN const xmlChar *
22
+ xmlSAX2GetPublicId (void *ctx);
23
+ XMLPUBFUN const xmlChar *
24
+ xmlSAX2GetSystemId (void *ctx);
25
+ XMLPUBFUN void
26
+ xmlSAX2SetDocumentLocator (void *ctx,
27
+ xmlSAXLocatorPtr loc);
28
+
29
+ XMLPUBFUN int
30
+ xmlSAX2GetLineNumber (void *ctx);
31
+ XMLPUBFUN int
32
+ xmlSAX2GetColumnNumber (void *ctx);
33
+
34
+ XMLPUBFUN int
35
+ xmlSAX2IsStandalone (void *ctx);
36
+ XMLPUBFUN int
37
+ xmlSAX2HasInternalSubset (void *ctx);
38
+ XMLPUBFUN int
39
+ xmlSAX2HasExternalSubset (void *ctx);
40
+
41
+ XMLPUBFUN void
42
+ xmlSAX2InternalSubset (void *ctx,
43
+ const xmlChar *name,
44
+ const xmlChar *ExternalID,
45
+ const xmlChar *SystemID);
46
+ XMLPUBFUN void
47
+ xmlSAX2ExternalSubset (void *ctx,
48
+ const xmlChar *name,
49
+ const xmlChar *ExternalID,
50
+ const xmlChar *SystemID);
51
+ XMLPUBFUN xmlEntityPtr
52
+ xmlSAX2GetEntity (void *ctx,
53
+ const xmlChar *name);
54
+ XMLPUBFUN xmlEntityPtr
55
+ xmlSAX2GetParameterEntity (void *ctx,
56
+ const xmlChar *name);
57
+ XMLPUBFUN xmlParserInputPtr
58
+ xmlSAX2ResolveEntity (void *ctx,
59
+ const xmlChar *publicId,
60
+ const xmlChar *systemId);
61
+
62
+ XMLPUBFUN void
63
+ xmlSAX2EntityDecl (void *ctx,
64
+ const xmlChar *name,
65
+ int type,
66
+ const xmlChar *publicId,
67
+ const xmlChar *systemId,
68
+ xmlChar *content);
69
+ XMLPUBFUN void
70
+ xmlSAX2AttributeDecl (void *ctx,
71
+ const xmlChar *elem,
72
+ const xmlChar *fullname,
73
+ int type,
74
+ int def,
75
+ const xmlChar *defaultValue,
76
+ xmlEnumerationPtr tree);
77
+ XMLPUBFUN void
78
+ xmlSAX2ElementDecl (void *ctx,
79
+ const xmlChar *name,
80
+ int type,
81
+ xmlElementContentPtr content);
82
+ XMLPUBFUN void
83
+ xmlSAX2NotationDecl (void *ctx,
84
+ const xmlChar *name,
85
+ const xmlChar *publicId,
86
+ const xmlChar *systemId);
87
+ XMLPUBFUN void
88
+ xmlSAX2UnparsedEntityDecl (void *ctx,
89
+ const xmlChar *name,
90
+ const xmlChar *publicId,
91
+ const xmlChar *systemId,
92
+ const xmlChar *notationName);
93
+
94
+ XMLPUBFUN void
95
+ xmlSAX2StartDocument (void *ctx);
96
+ XMLPUBFUN void
97
+ xmlSAX2EndDocument (void *ctx);
98
+ #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
99
+ defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
100
+ XMLPUBFUN void
101
+ xmlSAX2StartElement (void *ctx,
102
+ const xmlChar *fullname,
103
+ const xmlChar **atts);
104
+ XMLPUBFUN void
105
+ xmlSAX2EndElement (void *ctx,
106
+ const xmlChar *name);
107
+ #endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
108
+ XMLPUBFUN void
109
+ xmlSAX2StartElementNs (void *ctx,
110
+ const xmlChar *localname,
111
+ const xmlChar *prefix,
112
+ const xmlChar *URI,
113
+ int nb_namespaces,
114
+ const xmlChar **namespaces,
115
+ int nb_attributes,
116
+ int nb_defaulted,
117
+ const xmlChar **attributes);
118
+ XMLPUBFUN void
119
+ xmlSAX2EndElementNs (void *ctx,
120
+ const xmlChar *localname,
121
+ const xmlChar *prefix,
122
+ const xmlChar *URI);
123
+ XMLPUBFUN void
124
+ xmlSAX2Reference (void *ctx,
125
+ const xmlChar *name);
126
+ XMLPUBFUN void
127
+ xmlSAX2Characters (void *ctx,
128
+ const xmlChar *ch,
129
+ int len);
130
+ XMLPUBFUN void
131
+ xmlSAX2IgnorableWhitespace (void *ctx,
132
+ const xmlChar *ch,
133
+ int len);
134
+ XMLPUBFUN void
135
+ xmlSAX2ProcessingInstruction (void *ctx,
136
+ const xmlChar *target,
137
+ const xmlChar *data);
138
+ XMLPUBFUN void
139
+ xmlSAX2Comment (void *ctx,
140
+ const xmlChar *value);
141
+ XMLPUBFUN void
142
+ xmlSAX2CDataBlock (void *ctx,
143
+ const xmlChar *value,
144
+ int len);
145
+
146
+ #ifdef LIBXML_SAX1_ENABLED
147
+ XML_DEPRECATED
148
+ XMLPUBFUN int
149
+ xmlSAXDefaultVersion (int version);
150
+ #endif /* LIBXML_SAX1_ENABLED */
151
+
152
+ XMLPUBFUN int
153
+ xmlSAXVersion (xmlSAXHandler *hdlr,
154
+ int version);
155
+ XMLPUBFUN void
156
+ xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
157
+ int warning);
158
+ #ifdef LIBXML_HTML_ENABLED
159
+ XMLPUBFUN void
160
+ xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
161
+ XML_DEPRECATED
162
+ XMLPUBFUN void
163
+ htmlDefaultSAXHandlerInit (void);
164
+ #endif
165
+ XML_DEPRECATED
166
+ XMLPUBFUN void
167
+ xmlDefaultSAXHandlerInit (void);
168
+ #ifdef __cplusplus
169
+ }
170
+ #endif
171
+ #endif /* __XML_SAX2_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/c14n.h ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Provide Canonical XML and Exclusive XML Canonicalization
3
+ * Description: the c14n modules provides a
4
+ *
5
+ * "Canonical XML" implementation
6
+ * http://www.w3.org/TR/xml-c14n
7
+ *
8
+ * and an
9
+ *
10
+ * "Exclusive XML Canonicalization" implementation
11
+ * http://www.w3.org/TR/xml-exc-c14n
12
+
13
+ * Copy: See Copyright for the status of this software.
14
+ *
15
+ * Author: Aleksey Sanin <[email protected]>
16
+ */
17
+ #ifndef __XML_C14N_H__
18
+ #define __XML_C14N_H__
19
+
20
+ #include <libxml/xmlversion.h>
21
+
22
+ #ifdef LIBXML_C14N_ENABLED
23
+
24
+ #include <libxml/tree.h>
25
+ #include <libxml/xpath.h>
26
+
27
+ #ifdef __cplusplus
28
+ extern "C" {
29
+ #endif /* __cplusplus */
30
+
31
+ /*
32
+ * XML Canonicalization
33
+ * http://www.w3.org/TR/xml-c14n
34
+ *
35
+ * Exclusive XML Canonicalization
36
+ * http://www.w3.org/TR/xml-exc-c14n
37
+ *
38
+ * Canonical form of an XML document could be created if and only if
39
+ * a) default attributes (if any) are added to all nodes
40
+ * b) all character and parsed entity references are resolved
41
+ * In order to achieve this in libxml2 the document MUST be loaded with
42
+ * following global settings:
43
+ *
44
+ * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
45
+ * xmlSubstituteEntitiesDefault(1);
46
+ *
47
+ * or corresponding parser context setting:
48
+ * xmlParserCtxtPtr ctxt;
49
+ *
50
+ * ...
51
+ * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
52
+ * ctxt->replaceEntities = 1;
53
+ * ...
54
+ */
55
+
56
+ /*
57
+ * xmlC14NMode:
58
+ *
59
+ * Predefined values for C14N modes
60
+ *
61
+ */
62
+ typedef enum {
63
+ XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */
64
+ XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
65
+ XML_C14N_1_1 = 2 /* C14N 1.1 spec */
66
+ } xmlC14NMode;
67
+
68
+ XMLPUBFUN int
69
+ xmlC14NDocSaveTo (xmlDocPtr doc,
70
+ xmlNodeSetPtr nodes,
71
+ int mode, /* a xmlC14NMode */
72
+ xmlChar **inclusive_ns_prefixes,
73
+ int with_comments,
74
+ xmlOutputBufferPtr buf);
75
+
76
+ XMLPUBFUN int
77
+ xmlC14NDocDumpMemory (xmlDocPtr doc,
78
+ xmlNodeSetPtr nodes,
79
+ int mode, /* a xmlC14NMode */
80
+ xmlChar **inclusive_ns_prefixes,
81
+ int with_comments,
82
+ xmlChar **doc_txt_ptr);
83
+
84
+ XMLPUBFUN int
85
+ xmlC14NDocSave (xmlDocPtr doc,
86
+ xmlNodeSetPtr nodes,
87
+ int mode, /* a xmlC14NMode */
88
+ xmlChar **inclusive_ns_prefixes,
89
+ int with_comments,
90
+ const char* filename,
91
+ int compression);
92
+
93
+
94
+ /**
95
+ * This is the core C14N function
96
+ */
97
+ /**
98
+ * xmlC14NIsVisibleCallback:
99
+ * @user_data: user data
100
+ * @node: the current node
101
+ * @parent: the parent node
102
+ *
103
+ * Signature for a C14N callback on visible nodes
104
+ *
105
+ * Returns 1 if the node should be included
106
+ */
107
+ typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
108
+ xmlNodePtr node,
109
+ xmlNodePtr parent);
110
+
111
+ XMLPUBFUN int
112
+ xmlC14NExecute (xmlDocPtr doc,
113
+ xmlC14NIsVisibleCallback is_visible_callback,
114
+ void* user_data,
115
+ int mode, /* a xmlC14NMode */
116
+ xmlChar **inclusive_ns_prefixes,
117
+ int with_comments,
118
+ xmlOutputBufferPtr buf);
119
+
120
+ #ifdef __cplusplus
121
+ }
122
+ #endif /* __cplusplus */
123
+
124
+ #endif /* LIBXML_C14N_ENABLED */
125
+ #endif /* __XML_C14N_H__ */
126
+
venv/lib/python3.10/site-packages/lxml/includes/libxml/encoding.h ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the encoding conversion functions
3
+ * Description: interface for the encoding conversion functions needed for
4
+ * XML basic encoding and iconv() support.
5
+ *
6
+ * Related specs are
7
+ * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
8
+ * [ISO-10646] UTF-8 and UTF-16 in Annexes
9
+ * [ISO-8859-1] ISO Latin-1 characters codes.
10
+ * [UNICODE] The Unicode Consortium, "The Unicode Standard --
11
+ * Worldwide Character Encoding -- Version 1.0", Addison-
12
+ * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
13
+ * described in Unicode Technical Report #4.
14
+ * [US-ASCII] Coded Character Set--7-bit American Standard Code for
15
+ * Information Interchange, ANSI X3.4-1986.
16
+ *
17
+ * Copy: See Copyright for the status of this software.
18
+ *
19
+ * Author: Daniel Veillard
20
+ */
21
+
22
+ #ifndef __XML_CHAR_ENCODING_H__
23
+ #define __XML_CHAR_ENCODING_H__
24
+
25
+ #include <libxml/xmlversion.h>
26
+
27
+ #ifdef LIBXML_ICONV_ENABLED
28
+ #include <iconv.h>
29
+ #endif
30
+
31
+ #ifdef __cplusplus
32
+ extern "C" {
33
+ #endif
34
+
35
+ typedef enum {
36
+ XML_ENC_ERR_SUCCESS = 0,
37
+ XML_ENC_ERR_SPACE = -1,
38
+ XML_ENC_ERR_INPUT = -2,
39
+ XML_ENC_ERR_PARTIAL = -3,
40
+ XML_ENC_ERR_INTERNAL = -4,
41
+ XML_ENC_ERR_MEMORY = -5
42
+ } xmlCharEncError;
43
+
44
+ /*
45
+ * xmlCharEncoding:
46
+ *
47
+ * Predefined values for some standard encodings.
48
+ * Libxml does not do beforehand translation on UTF8 and ISOLatinX.
49
+ * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
50
+ *
51
+ * Anything else would have to be translated to UTF8 before being
52
+ * given to the parser itself. The BOM for UTF16 and the encoding
53
+ * declaration are looked at and a converter is looked for at that
54
+ * point. If not found the parser stops here as asked by the XML REC. A
55
+ * converter can be registered by the user using xmlRegisterCharEncodingHandler
56
+ * but the current form doesn't allow stateful transcoding (a serious
57
+ * problem agreed !). If iconv has been found it will be used
58
+ * automatically and allow stateful transcoding, the simplest is then
59
+ * to be sure to enable iconv and to provide iconv libs for the encoding
60
+ * support needed.
61
+ *
62
+ * Note that the generic "UTF-16" is not a predefined value. Instead, only
63
+ * the specific UTF-16LE and UTF-16BE are present.
64
+ */
65
+ typedef enum {
66
+ XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
67
+ XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
68
+ XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
69
+ XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
70
+ XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
71
+ XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
72
+ XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
73
+ XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
74
+ XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
75
+ XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
76
+ XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
77
+ XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
78
+ XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
79
+ XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
80
+ XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
81
+ XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
82
+ XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
83
+ XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
84
+ XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
85
+ XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
86
+ XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
87
+ XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
88
+ XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
89
+ XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
90
+ } xmlCharEncoding;
91
+
92
+ /**
93
+ * xmlCharEncodingInputFunc:
94
+ * @out: a pointer to an array of bytes to store the UTF-8 result
95
+ * @outlen: the length of @out
96
+ * @in: a pointer to an array of chars in the original encoding
97
+ * @inlen: the length of @in
98
+ *
99
+ * Take a block of chars in the original encoding and try to convert
100
+ * it to an UTF-8 block of chars out.
101
+ *
102
+ * Returns the number of bytes written, -1 if lack of space, or -2
103
+ * if the transcoding failed.
104
+ * The value of @inlen after return is the number of octets consumed
105
+ * if the return value is positive, else unpredictiable.
106
+ * The value of @outlen after return is the number of octets consumed.
107
+ */
108
+ typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
109
+ const unsigned char *in, int *inlen);
110
+
111
+
112
+ /**
113
+ * xmlCharEncodingOutputFunc:
114
+ * @out: a pointer to an array of bytes to store the result
115
+ * @outlen: the length of @out
116
+ * @in: a pointer to an array of UTF-8 chars
117
+ * @inlen: the length of @in
118
+ *
119
+ * Take a block of UTF-8 chars in and try to convert it to another
120
+ * encoding.
121
+ * Note: a first call designed to produce heading info is called with
122
+ * in = NULL. If stateful this should also initialize the encoder state.
123
+ *
124
+ * Returns the number of bytes written, -1 if lack of space, or -2
125
+ * if the transcoding failed.
126
+ * The value of @inlen after return is the number of octets consumed
127
+ * if the return value is positive, else unpredictiable.
128
+ * The value of @outlen after return is the number of octets produced.
129
+ */
130
+ typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
131
+ const unsigned char *in, int *inlen);
132
+
133
+
134
+ /*
135
+ * Block defining the handlers for non UTF-8 encodings.
136
+ * If iconv is supported, there are two extra fields.
137
+ */
138
+ typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
139
+ typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
140
+ struct _xmlCharEncodingHandler {
141
+ char *name;
142
+ xmlCharEncodingInputFunc input;
143
+ xmlCharEncodingOutputFunc output;
144
+ #ifdef LIBXML_ICONV_ENABLED
145
+ iconv_t iconv_in;
146
+ iconv_t iconv_out;
147
+ #endif /* LIBXML_ICONV_ENABLED */
148
+ #ifdef LIBXML_ICU_ENABLED
149
+ struct _uconv_t *uconv_in;
150
+ struct _uconv_t *uconv_out;
151
+ #endif /* LIBXML_ICU_ENABLED */
152
+ };
153
+
154
+ /*
155
+ * Interfaces for encoding handlers.
156
+ */
157
+ XML_DEPRECATED
158
+ XMLPUBFUN void
159
+ xmlInitCharEncodingHandlers (void);
160
+ XML_DEPRECATED
161
+ XMLPUBFUN void
162
+ xmlCleanupCharEncodingHandlers (void);
163
+ XMLPUBFUN void
164
+ xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
165
+ XMLPUBFUN xmlCharEncodingHandlerPtr
166
+ xmlGetCharEncodingHandler (xmlCharEncoding enc);
167
+ XMLPUBFUN xmlCharEncodingHandlerPtr
168
+ xmlFindCharEncodingHandler (const char *name);
169
+ XMLPUBFUN xmlCharEncodingHandlerPtr
170
+ xmlNewCharEncodingHandler (const char *name,
171
+ xmlCharEncodingInputFunc input,
172
+ xmlCharEncodingOutputFunc output);
173
+
174
+ /*
175
+ * Interfaces for encoding names and aliases.
176
+ */
177
+ XMLPUBFUN int
178
+ xmlAddEncodingAlias (const char *name,
179
+ const char *alias);
180
+ XMLPUBFUN int
181
+ xmlDelEncodingAlias (const char *alias);
182
+ XMLPUBFUN const char *
183
+ xmlGetEncodingAlias (const char *alias);
184
+ XMLPUBFUN void
185
+ xmlCleanupEncodingAliases (void);
186
+ XMLPUBFUN xmlCharEncoding
187
+ xmlParseCharEncoding (const char *name);
188
+ XMLPUBFUN const char *
189
+ xmlGetCharEncodingName (xmlCharEncoding enc);
190
+
191
+ /*
192
+ * Interfaces directly used by the parsers.
193
+ */
194
+ XMLPUBFUN xmlCharEncoding
195
+ xmlDetectCharEncoding (const unsigned char *in,
196
+ int len);
197
+
198
+ struct _xmlBuffer;
199
+ XMLPUBFUN int
200
+ xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
201
+ struct _xmlBuffer *out,
202
+ struct _xmlBuffer *in);
203
+
204
+ XMLPUBFUN int
205
+ xmlCharEncInFunc (xmlCharEncodingHandler *handler,
206
+ struct _xmlBuffer *out,
207
+ struct _xmlBuffer *in);
208
+ XML_DEPRECATED
209
+ XMLPUBFUN int
210
+ xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
211
+ struct _xmlBuffer *out,
212
+ struct _xmlBuffer *in);
213
+ XMLPUBFUN int
214
+ xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
215
+
216
+ /*
217
+ * Export a few useful functions
218
+ */
219
+ #ifdef LIBXML_OUTPUT_ENABLED
220
+ XMLPUBFUN int
221
+ UTF8Toisolat1 (unsigned char *out,
222
+ int *outlen,
223
+ const unsigned char *in,
224
+ int *inlen);
225
+ #endif /* LIBXML_OUTPUT_ENABLED */
226
+ XMLPUBFUN int
227
+ isolat1ToUTF8 (unsigned char *out,
228
+ int *outlen,
229
+ const unsigned char *in,
230
+ int *inlen);
231
+ #ifdef __cplusplus
232
+ }
233
+ #endif
234
+
235
+ #endif /* __XML_CHAR_ENCODING_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/hash.h ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Chained hash tables
3
+ * Description: This module implements the hash table support used in
4
+ * various places in the library.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Bjorn Reese <[email protected]>
9
+ */
10
+
11
+ #ifndef __XML_HASH_H__
12
+ #define __XML_HASH_H__
13
+
14
+ #include <libxml/xmlversion.h>
15
+ #include <libxml/dict.h>
16
+ #include <libxml/xmlstring.h>
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /*
23
+ * The hash table.
24
+ */
25
+ typedef struct _xmlHashTable xmlHashTable;
26
+ typedef xmlHashTable *xmlHashTablePtr;
27
+
28
+ /*
29
+ * Recent version of gcc produce a warning when a function pointer is assigned
30
+ * to an object pointer, or vice versa. The following macro is a dirty hack
31
+ * to allow suppression of the warning. If your architecture has function
32
+ * pointers which are a different size than a void pointer, there may be some
33
+ * serious trouble within the library.
34
+ */
35
+ /**
36
+ * XML_CAST_FPTR:
37
+ * @fptr: pointer to a function
38
+ *
39
+ * Macro to do a casting from an object pointer to a
40
+ * function pointer without encountering a warning from
41
+ * gcc
42
+ *
43
+ * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
44
+ * This macro violated ISO C aliasing rules (gcc4 on s390 broke)
45
+ * so it is disabled now
46
+ */
47
+
48
+ #define XML_CAST_FPTR(fptr) fptr
49
+
50
+ /*
51
+ * function types:
52
+ */
53
+ /**
54
+ * xmlHashDeallocator:
55
+ * @payload: the data in the hash
56
+ * @name: the name associated
57
+ *
58
+ * Callback to free data from a hash.
59
+ */
60
+ typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name);
61
+ /**
62
+ * xmlHashCopier:
63
+ * @payload: the data in the hash
64
+ * @name: the name associated
65
+ *
66
+ * Callback to copy data from a hash.
67
+ *
68
+ * Returns a copy of the data or NULL in case of error.
69
+ */
70
+ typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
71
+ /**
72
+ * xmlHashScanner:
73
+ * @payload: the data in the hash
74
+ * @data: extra scanner data
75
+ * @name: the name associated
76
+ *
77
+ * Callback when scanning data in a hash with the simple scanner.
78
+ */
79
+ typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
80
+ /**
81
+ * xmlHashScannerFull:
82
+ * @payload: the data in the hash
83
+ * @data: extra scanner data
84
+ * @name: the name associated
85
+ * @name2: the second name associated
86
+ * @name3: the third name associated
87
+ *
88
+ * Callback when scanning data in a hash with the full scanner.
89
+ */
90
+ typedef void (*xmlHashScannerFull)(void *payload, void *data,
91
+ const xmlChar *name, const xmlChar *name2,
92
+ const xmlChar *name3);
93
+
94
+ /*
95
+ * Constructor and destructor.
96
+ */
97
+ XMLPUBFUN xmlHashTablePtr
98
+ xmlHashCreate (int size);
99
+ XMLPUBFUN xmlHashTablePtr
100
+ xmlHashCreateDict (int size,
101
+ xmlDictPtr dict);
102
+ XMLPUBFUN void
103
+ xmlHashFree (xmlHashTablePtr hash,
104
+ xmlHashDeallocator dealloc);
105
+ XMLPUBFUN void
106
+ xmlHashDefaultDeallocator(void *entry,
107
+ const xmlChar *name);
108
+
109
+ /*
110
+ * Add a new entry to the hash table.
111
+ */
112
+ XMLPUBFUN int
113
+ xmlHashAddEntry (xmlHashTablePtr hash,
114
+ const xmlChar *name,
115
+ void *userdata);
116
+ XMLPUBFUN int
117
+ xmlHashUpdateEntry (xmlHashTablePtr hash,
118
+ const xmlChar *name,
119
+ void *userdata,
120
+ xmlHashDeallocator dealloc);
121
+ XMLPUBFUN int
122
+ xmlHashAddEntry2 (xmlHashTablePtr hash,
123
+ const xmlChar *name,
124
+ const xmlChar *name2,
125
+ void *userdata);
126
+ XMLPUBFUN int
127
+ xmlHashUpdateEntry2 (xmlHashTablePtr hash,
128
+ const xmlChar *name,
129
+ const xmlChar *name2,
130
+ void *userdata,
131
+ xmlHashDeallocator dealloc);
132
+ XMLPUBFUN int
133
+ xmlHashAddEntry3 (xmlHashTablePtr hash,
134
+ const xmlChar *name,
135
+ const xmlChar *name2,
136
+ const xmlChar *name3,
137
+ void *userdata);
138
+ XMLPUBFUN int
139
+ xmlHashUpdateEntry3 (xmlHashTablePtr hash,
140
+ const xmlChar *name,
141
+ const xmlChar *name2,
142
+ const xmlChar *name3,
143
+ void *userdata,
144
+ xmlHashDeallocator dealloc);
145
+
146
+ /*
147
+ * Remove an entry from the hash table.
148
+ */
149
+ XMLPUBFUN int
150
+ xmlHashRemoveEntry (xmlHashTablePtr hash,
151
+ const xmlChar *name,
152
+ xmlHashDeallocator dealloc);
153
+ XMLPUBFUN int
154
+ xmlHashRemoveEntry2 (xmlHashTablePtr hash,
155
+ const xmlChar *name,
156
+ const xmlChar *name2,
157
+ xmlHashDeallocator dealloc);
158
+ XMLPUBFUN int
159
+ xmlHashRemoveEntry3 (xmlHashTablePtr hash,
160
+ const xmlChar *name,
161
+ const xmlChar *name2,
162
+ const xmlChar *name3,
163
+ xmlHashDeallocator dealloc);
164
+
165
+ /*
166
+ * Retrieve the payload.
167
+ */
168
+ XMLPUBFUN void *
169
+ xmlHashLookup (xmlHashTablePtr hash,
170
+ const xmlChar *name);
171
+ XMLPUBFUN void *
172
+ xmlHashLookup2 (xmlHashTablePtr hash,
173
+ const xmlChar *name,
174
+ const xmlChar *name2);
175
+ XMLPUBFUN void *
176
+ xmlHashLookup3 (xmlHashTablePtr hash,
177
+ const xmlChar *name,
178
+ const xmlChar *name2,
179
+ const xmlChar *name3);
180
+ XMLPUBFUN void *
181
+ xmlHashQLookup (xmlHashTablePtr hash,
182
+ const xmlChar *prefix,
183
+ const xmlChar *name);
184
+ XMLPUBFUN void *
185
+ xmlHashQLookup2 (xmlHashTablePtr hash,
186
+ const xmlChar *prefix,
187
+ const xmlChar *name,
188
+ const xmlChar *prefix2,
189
+ const xmlChar *name2);
190
+ XMLPUBFUN void *
191
+ xmlHashQLookup3 (xmlHashTablePtr hash,
192
+ const xmlChar *prefix,
193
+ const xmlChar *name,
194
+ const xmlChar *prefix2,
195
+ const xmlChar *name2,
196
+ const xmlChar *prefix3,
197
+ const xmlChar *name3);
198
+
199
+ /*
200
+ * Helpers.
201
+ */
202
+ XMLPUBFUN xmlHashTablePtr
203
+ xmlHashCopy (xmlHashTablePtr hash,
204
+ xmlHashCopier copy);
205
+ XMLPUBFUN int
206
+ xmlHashSize (xmlHashTablePtr hash);
207
+ XMLPUBFUN void
208
+ xmlHashScan (xmlHashTablePtr hash,
209
+ xmlHashScanner scan,
210
+ void *data);
211
+ XMLPUBFUN void
212
+ xmlHashScan3 (xmlHashTablePtr hash,
213
+ const xmlChar *name,
214
+ const xmlChar *name2,
215
+ const xmlChar *name3,
216
+ xmlHashScanner scan,
217
+ void *data);
218
+ XMLPUBFUN void
219
+ xmlHashScanFull (xmlHashTablePtr hash,
220
+ xmlHashScannerFull scan,
221
+ void *data);
222
+ XMLPUBFUN void
223
+ xmlHashScanFull3 (xmlHashTablePtr hash,
224
+ const xmlChar *name,
225
+ const xmlChar *name2,
226
+ const xmlChar *name3,
227
+ xmlHashScannerFull scan,
228
+ void *data);
229
+ #ifdef __cplusplus
230
+ }
231
+ #endif
232
+ #endif /* ! __XML_HASH_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/parser.h ADDED
@@ -0,0 +1,1384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: the core parser module
3
+ * Description: Interfaces, constants and types related to the XML parser
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_PARSER_H__
11
+ #define __XML_PARSER_H__
12
+
13
+ #include <libxml/xmlversion.h>
14
+ #define XML_TREE_INTERNALS
15
+ #include <libxml/tree.h>
16
+ #undef XML_TREE_INTERNALS
17
+ #include <libxml/dict.h>
18
+ #include <libxml/hash.h>
19
+ #include <libxml/valid.h>
20
+ #include <libxml/entities.h>
21
+ #include <libxml/xmlerror.h>
22
+ #include <libxml/xmlstring.h>
23
+ #include <libxml/xmlmemory.h>
24
+ #include <libxml/encoding.h>
25
+ #include <libxml/xmlIO.h>
26
+ /* for compatibility */
27
+ #include <libxml/SAX2.h>
28
+ #include <libxml/threads.h>
29
+
30
+ #ifdef __cplusplus
31
+ extern "C" {
32
+ #endif
33
+
34
+ /**
35
+ * XML_DEFAULT_VERSION:
36
+ *
37
+ * The default version of XML used: 1.0
38
+ */
39
+ #define XML_DEFAULT_VERSION "1.0"
40
+
41
+ /**
42
+ * xmlParserInput:
43
+ *
44
+ * An xmlParserInput is an input flow for the XML processor.
45
+ * Each entity parsed is associated an xmlParserInput (except the
46
+ * few predefined ones). This is the case both for internal entities
47
+ * - in which case the flow is already completely in memory - or
48
+ * external entities - in which case we use the buf structure for
49
+ * progressive reading and I18N conversions to the internal UTF-8 format.
50
+ */
51
+
52
+ /**
53
+ * xmlParserInputDeallocate:
54
+ * @str: the string to deallocate
55
+ *
56
+ * Callback for freeing some parser input allocations.
57
+ */
58
+ typedef void (* xmlParserInputDeallocate)(xmlChar *str);
59
+
60
+ struct _xmlParserInput {
61
+ /* Input buffer */
62
+ xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
63
+
64
+ const char *filename; /* The file analyzed, if any */
65
+ const char *directory; /* the directory/base of the file */
66
+ const xmlChar *base; /* Base of the array to parse */
67
+ const xmlChar *cur; /* Current char being parsed */
68
+ const xmlChar *end; /* end of the array to parse */
69
+ int length; /* length if known */
70
+ int line; /* Current line */
71
+ int col; /* Current column */
72
+ unsigned long consumed; /* How many xmlChars already consumed */
73
+ xmlParserInputDeallocate free; /* function to deallocate the base */
74
+ const xmlChar *encoding; /* unused */
75
+ const xmlChar *version; /* the version string for entity */
76
+ int flags; /* Flags */
77
+ int id; /* an unique identifier for the entity */
78
+ unsigned long parentConsumed; /* consumed bytes from parents */
79
+ xmlEntityPtr entity; /* entity, if any */
80
+ };
81
+
82
+ /**
83
+ * xmlParserNodeInfo:
84
+ *
85
+ * The parser can be asked to collect Node information, i.e. at what
86
+ * place in the file they were detected.
87
+ * NOTE: This is off by default and not very well tested.
88
+ */
89
+ typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
90
+ typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
91
+
92
+ struct _xmlParserNodeInfo {
93
+ const struct _xmlNode* node;
94
+ /* Position & line # that text that created the node begins & ends on */
95
+ unsigned long begin_pos;
96
+ unsigned long begin_line;
97
+ unsigned long end_pos;
98
+ unsigned long end_line;
99
+ };
100
+
101
+ typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
102
+ typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
103
+ struct _xmlParserNodeInfoSeq {
104
+ unsigned long maximum;
105
+ unsigned long length;
106
+ xmlParserNodeInfo* buffer;
107
+ };
108
+
109
+ /**
110
+ * xmlParserInputState:
111
+ *
112
+ * The parser is now working also as a state based parser.
113
+ * The recursive one use the state info for entities processing.
114
+ */
115
+ typedef enum {
116
+ XML_PARSER_EOF = -1, /* nothing is to be parsed */
117
+ XML_PARSER_START = 0, /* nothing has been parsed */
118
+ XML_PARSER_MISC, /* Misc* before int subset */
119
+ XML_PARSER_PI, /* Within a processing instruction */
120
+ XML_PARSER_DTD, /* within some DTD content */
121
+ XML_PARSER_PROLOG, /* Misc* after internal subset */
122
+ XML_PARSER_COMMENT, /* within a comment */
123
+ XML_PARSER_START_TAG, /* within a start tag */
124
+ XML_PARSER_CONTENT, /* within the content */
125
+ XML_PARSER_CDATA_SECTION, /* within a CDATA section */
126
+ XML_PARSER_END_TAG, /* within a closing tag */
127
+ XML_PARSER_ENTITY_DECL, /* within an entity declaration */
128
+ XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
129
+ XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
130
+ XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
131
+ XML_PARSER_EPILOG, /* the Misc* after the last end tag */
132
+ XML_PARSER_IGNORE, /* within an IGNORED section */
133
+ XML_PARSER_PUBLIC_LITERAL, /* within a PUBLIC value */
134
+ XML_PARSER_XML_DECL /* before XML decl (but after BOM) */
135
+ } xmlParserInputState;
136
+
137
+ /**
138
+ * XML_DETECT_IDS:
139
+ *
140
+ * Bit in the loadsubset context field to tell to do ID/REFs lookups.
141
+ * Use it to initialize xmlLoadExtDtdDefaultValue.
142
+ */
143
+ #define XML_DETECT_IDS 2
144
+
145
+ /**
146
+ * XML_COMPLETE_ATTRS:
147
+ *
148
+ * Bit in the loadsubset context field to tell to do complete the
149
+ * elements attributes lists with the ones defaulted from the DTDs.
150
+ * Use it to initialize xmlLoadExtDtdDefaultValue.
151
+ */
152
+ #define XML_COMPLETE_ATTRS 4
153
+
154
+ /**
155
+ * XML_SKIP_IDS:
156
+ *
157
+ * Bit in the loadsubset context field to tell to not do ID/REFs registration.
158
+ * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
159
+ */
160
+ #define XML_SKIP_IDS 8
161
+
162
+ /**
163
+ * xmlParserMode:
164
+ *
165
+ * A parser can operate in various modes
166
+ */
167
+ typedef enum {
168
+ XML_PARSE_UNKNOWN = 0,
169
+ XML_PARSE_DOM = 1,
170
+ XML_PARSE_SAX = 2,
171
+ XML_PARSE_PUSH_DOM = 3,
172
+ XML_PARSE_PUSH_SAX = 4,
173
+ XML_PARSE_READER = 5
174
+ } xmlParserMode;
175
+
176
+ typedef struct _xmlStartTag xmlStartTag;
177
+ typedef struct _xmlParserNsData xmlParserNsData;
178
+ typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
179
+
180
+ /**
181
+ * xmlParserCtxt:
182
+ *
183
+ * The parser context.
184
+ * NOTE This doesn't completely define the parser state, the (current ?)
185
+ * design of the parser uses recursive function calls since this allow
186
+ * and easy mapping from the production rules of the specification
187
+ * to the actual code. The drawback is that the actual function call
188
+ * also reflect the parser state. However most of the parsing routines
189
+ * takes as the only argument the parser context pointer, so migrating
190
+ * to a state based parser for progressive parsing shouldn't be too hard.
191
+ */
192
+ struct _xmlParserCtxt {
193
+ struct _xmlSAXHandler *sax; /* The SAX handler */
194
+ void *userData; /* For SAX interface only, used by DOM build */
195
+ xmlDocPtr myDoc; /* the document being built */
196
+ int wellFormed; /* is the document well formed */
197
+ int replaceEntities; /* shall we replace entities ? */
198
+ const xmlChar *version; /* the XML version string */
199
+ const xmlChar *encoding; /* the declared encoding, if any */
200
+ int standalone; /* standalone document */
201
+ int html; /* an HTML(1) document
202
+ * 3 is HTML after <head>
203
+ * 10 is HTML after <body>
204
+ */
205
+
206
+ /* Input stream stack */
207
+ xmlParserInputPtr input; /* Current input stream */
208
+ int inputNr; /* Number of current input streams */
209
+ int inputMax; /* Max number of input streams */
210
+ xmlParserInputPtr *inputTab; /* stack of inputs */
211
+
212
+ /* Node analysis stack only used for DOM building */
213
+ xmlNodePtr node; /* Current parsed Node */
214
+ int nodeNr; /* Depth of the parsing stack */
215
+ int nodeMax; /* Max depth of the parsing stack */
216
+ xmlNodePtr *nodeTab; /* array of nodes */
217
+
218
+ int record_info; /* Whether node info should be kept */
219
+ xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
220
+
221
+ int errNo; /* error code */
222
+
223
+ int hasExternalSubset; /* reference and external subset */
224
+ int hasPErefs; /* the internal subset has PE refs */
225
+ int external; /* are we parsing an external entity */
226
+
227
+ int valid; /* is the document valid */
228
+ int validate; /* shall we try to validate ? */
229
+ xmlValidCtxt vctxt; /* The validity context */
230
+
231
+ xmlParserInputState instate; /* current type of input */
232
+ int token; /* next char look-ahead */
233
+
234
+ char *directory; /* the data directory */
235
+
236
+ /* Node name stack */
237
+ const xmlChar *name; /* Current parsed Node */
238
+ int nameNr; /* Depth of the parsing stack */
239
+ int nameMax; /* Max depth of the parsing stack */
240
+ const xmlChar * *nameTab; /* array of nodes */
241
+
242
+ long nbChars; /* unused */
243
+ long checkIndex; /* used by progressive parsing lookup */
244
+ int keepBlanks; /* ugly but ... */
245
+ int disableSAX; /* SAX callbacks are disabled */
246
+ int inSubset; /* Parsing is in int 1/ext 2 subset */
247
+ const xmlChar * intSubName; /* name of subset */
248
+ xmlChar * extSubURI; /* URI of external subset */
249
+ xmlChar * extSubSystem; /* SYSTEM ID of external subset */
250
+
251
+ /* xml:space values */
252
+ int * space; /* Should the parser preserve spaces */
253
+ int spaceNr; /* Depth of the parsing stack */
254
+ int spaceMax; /* Max depth of the parsing stack */
255
+ int * spaceTab; /* array of space infos */
256
+
257
+ int depth; /* to prevent entity substitution loops */
258
+ xmlParserInputPtr entity; /* used to check entities boundaries */
259
+ int charset; /* unused */
260
+ int nodelen; /* Those two fields are there to */
261
+ int nodemem; /* Speed up large node parsing */
262
+ int pedantic; /* signal pedantic warnings */
263
+ void *_private; /* For user data, libxml won't touch it */
264
+
265
+ int loadsubset; /* should the external subset be loaded */
266
+ int linenumbers; /* set line number in element content */
267
+ void *catalogs; /* document's own catalog */
268
+ int recovery; /* run in recovery mode */
269
+ int progressive; /* is this a progressive parsing */
270
+ xmlDictPtr dict; /* dictionary for the parser */
271
+ const xmlChar * *atts; /* array for the attributes callbacks */
272
+ int maxatts; /* the size of the array */
273
+ int docdict; /* use strings from dict to build tree */
274
+
275
+ /*
276
+ * pre-interned strings
277
+ */
278
+ const xmlChar *str_xml;
279
+ const xmlChar *str_xmlns;
280
+ const xmlChar *str_xml_ns;
281
+
282
+ /*
283
+ * Everything below is used only by the new SAX mode
284
+ */
285
+ int sax2; /* operating in the new SAX mode */
286
+ int nsNr; /* the number of inherited namespaces */
287
+ int nsMax; /* the size of the arrays */
288
+ const xmlChar * *nsTab; /* the array of prefix/namespace name */
289
+ unsigned *attallocs; /* which attribute were allocated */
290
+ xmlStartTag *pushTab; /* array of data for push */
291
+ xmlHashTablePtr attsDefault; /* defaulted attributes if any */
292
+ xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
293
+ int nsWellFormed; /* is the document XML Namespace okay */
294
+ int options; /* Extra options */
295
+
296
+ /*
297
+ * Those fields are needed only for streaming parsing so far
298
+ */
299
+ int dictNames; /* Use dictionary names for the tree */
300
+ int freeElemsNr; /* number of freed element nodes */
301
+ xmlNodePtr freeElems; /* List of freed element nodes */
302
+ int freeAttrsNr; /* number of freed attributes nodes */
303
+ xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
304
+
305
+ /*
306
+ * the complete error information for the last error.
307
+ */
308
+ xmlError lastError;
309
+ xmlParserMode parseMode; /* the parser mode */
310
+ unsigned long nbentities; /* unused */
311
+ unsigned long sizeentities; /* size of parsed entities */
312
+
313
+ /* for use by HTML non-recursive parser */
314
+ xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */
315
+ int nodeInfoNr; /* Depth of the parsing stack */
316
+ int nodeInfoMax; /* Max depth of the parsing stack */
317
+ xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
318
+
319
+ int input_id; /* we need to label inputs */
320
+ unsigned long sizeentcopy; /* volume of entity copy */
321
+
322
+ int endCheckState; /* quote state for push parser */
323
+ unsigned short nbErrors; /* number of errors */
324
+ unsigned short nbWarnings; /* number of warnings */
325
+ unsigned maxAmpl; /* maximum amplification factor */
326
+
327
+ xmlParserNsData *nsdb; /* namespace database */
328
+ unsigned attrHashMax; /* allocated size */
329
+ xmlAttrHashBucket *attrHash; /* atttribute hash table */
330
+ };
331
+
332
+ /**
333
+ * xmlSAXLocator:
334
+ *
335
+ * A SAX Locator.
336
+ */
337
+ struct _xmlSAXLocator {
338
+ const xmlChar *(*getPublicId)(void *ctx);
339
+ const xmlChar *(*getSystemId)(void *ctx);
340
+ int (*getLineNumber)(void *ctx);
341
+ int (*getColumnNumber)(void *ctx);
342
+ };
343
+
344
+ /**
345
+ * xmlSAXHandler:
346
+ *
347
+ * A SAX handler is bunch of callbacks called by the parser when processing
348
+ * of the input generate data or structure information.
349
+ */
350
+
351
+ /**
352
+ * resolveEntitySAXFunc:
353
+ * @ctx: the user data (XML parser context)
354
+ * @publicId: The public ID of the entity
355
+ * @systemId: The system ID of the entity
356
+ *
357
+ * Callback:
358
+ * The entity loader, to control the loading of external entities,
359
+ * the application can either:
360
+ * - override this resolveEntity() callback in the SAX block
361
+ * - or better use the xmlSetExternalEntityLoader() function to
362
+ * set up it's own entity resolution routine
363
+ *
364
+ * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
365
+ */
366
+ typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
367
+ const xmlChar *publicId,
368
+ const xmlChar *systemId);
369
+ /**
370
+ * internalSubsetSAXFunc:
371
+ * @ctx: the user data (XML parser context)
372
+ * @name: the root element name
373
+ * @ExternalID: the external ID
374
+ * @SystemID: the SYSTEM ID (e.g. filename or URL)
375
+ *
376
+ * Callback on internal subset declaration.
377
+ */
378
+ typedef void (*internalSubsetSAXFunc) (void *ctx,
379
+ const xmlChar *name,
380
+ const xmlChar *ExternalID,
381
+ const xmlChar *SystemID);
382
+ /**
383
+ * externalSubsetSAXFunc:
384
+ * @ctx: the user data (XML parser context)
385
+ * @name: the root element name
386
+ * @ExternalID: the external ID
387
+ * @SystemID: the SYSTEM ID (e.g. filename or URL)
388
+ *
389
+ * Callback on external subset declaration.
390
+ */
391
+ typedef void (*externalSubsetSAXFunc) (void *ctx,
392
+ const xmlChar *name,
393
+ const xmlChar *ExternalID,
394
+ const xmlChar *SystemID);
395
+ /**
396
+ * getEntitySAXFunc:
397
+ * @ctx: the user data (XML parser context)
398
+ * @name: The entity name
399
+ *
400
+ * Get an entity by name.
401
+ *
402
+ * Returns the xmlEntityPtr if found.
403
+ */
404
+ typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
405
+ const xmlChar *name);
406
+ /**
407
+ * getParameterEntitySAXFunc:
408
+ * @ctx: the user data (XML parser context)
409
+ * @name: The entity name
410
+ *
411
+ * Get a parameter entity by name.
412
+ *
413
+ * Returns the xmlEntityPtr if found.
414
+ */
415
+ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
416
+ const xmlChar *name);
417
+ /**
418
+ * entityDeclSAXFunc:
419
+ * @ctx: the user data (XML parser context)
420
+ * @name: the entity name
421
+ * @type: the entity type
422
+ * @publicId: The public ID of the entity
423
+ * @systemId: The system ID of the entity
424
+ * @content: the entity value (without processing).
425
+ *
426
+ * An entity definition has been parsed.
427
+ */
428
+ typedef void (*entityDeclSAXFunc) (void *ctx,
429
+ const xmlChar *name,
430
+ int type,
431
+ const xmlChar *publicId,
432
+ const xmlChar *systemId,
433
+ xmlChar *content);
434
+ /**
435
+ * notationDeclSAXFunc:
436
+ * @ctx: the user data (XML parser context)
437
+ * @name: The name of the notation
438
+ * @publicId: The public ID of the entity
439
+ * @systemId: The system ID of the entity
440
+ *
441
+ * What to do when a notation declaration has been parsed.
442
+ */
443
+ typedef void (*notationDeclSAXFunc)(void *ctx,
444
+ const xmlChar *name,
445
+ const xmlChar *publicId,
446
+ const xmlChar *systemId);
447
+ /**
448
+ * attributeDeclSAXFunc:
449
+ * @ctx: the user data (XML parser context)
450
+ * @elem: the name of the element
451
+ * @fullname: the attribute name
452
+ * @type: the attribute type
453
+ * @def: the type of default value
454
+ * @defaultValue: the attribute default value
455
+ * @tree: the tree of enumerated value set
456
+ *
457
+ * An attribute definition has been parsed.
458
+ */
459
+ typedef void (*attributeDeclSAXFunc)(void *ctx,
460
+ const xmlChar *elem,
461
+ const xmlChar *fullname,
462
+ int type,
463
+ int def,
464
+ const xmlChar *defaultValue,
465
+ xmlEnumerationPtr tree);
466
+ /**
467
+ * elementDeclSAXFunc:
468
+ * @ctx: the user data (XML parser context)
469
+ * @name: the element name
470
+ * @type: the element type
471
+ * @content: the element value tree
472
+ *
473
+ * An element definition has been parsed.
474
+ */
475
+ typedef void (*elementDeclSAXFunc)(void *ctx,
476
+ const xmlChar *name,
477
+ int type,
478
+ xmlElementContentPtr content);
479
+ /**
480
+ * unparsedEntityDeclSAXFunc:
481
+ * @ctx: the user data (XML parser context)
482
+ * @name: The name of the entity
483
+ * @publicId: The public ID of the entity
484
+ * @systemId: The system ID of the entity
485
+ * @notationName: the name of the notation
486
+ *
487
+ * What to do when an unparsed entity declaration is parsed.
488
+ */
489
+ typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
490
+ const xmlChar *name,
491
+ const xmlChar *publicId,
492
+ const xmlChar *systemId,
493
+ const xmlChar *notationName);
494
+ /**
495
+ * setDocumentLocatorSAXFunc:
496
+ * @ctx: the user data (XML parser context)
497
+ * @loc: A SAX Locator
498
+ *
499
+ * Receive the document locator at startup, actually xmlDefaultSAXLocator.
500
+ * Everything is available on the context, so this is useless in our case.
501
+ */
502
+ typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
503
+ xmlSAXLocatorPtr loc);
504
+ /**
505
+ * startDocumentSAXFunc:
506
+ * @ctx: the user data (XML parser context)
507
+ *
508
+ * Called when the document start being processed.
509
+ */
510
+ typedef void (*startDocumentSAXFunc) (void *ctx);
511
+ /**
512
+ * endDocumentSAXFunc:
513
+ * @ctx: the user data (XML parser context)
514
+ *
515
+ * Called when the document end has been detected.
516
+ */
517
+ typedef void (*endDocumentSAXFunc) (void *ctx);
518
+ /**
519
+ * startElementSAXFunc:
520
+ * @ctx: the user data (XML parser context)
521
+ * @name: The element name, including namespace prefix
522
+ * @atts: An array of name/value attributes pairs, NULL terminated
523
+ *
524
+ * Called when an opening tag has been processed.
525
+ */
526
+ typedef void (*startElementSAXFunc) (void *ctx,
527
+ const xmlChar *name,
528
+ const xmlChar **atts);
529
+ /**
530
+ * endElementSAXFunc:
531
+ * @ctx: the user data (XML parser context)
532
+ * @name: The element name
533
+ *
534
+ * Called when the end of an element has been detected.
535
+ */
536
+ typedef void (*endElementSAXFunc) (void *ctx,
537
+ const xmlChar *name);
538
+ /**
539
+ * attributeSAXFunc:
540
+ * @ctx: the user data (XML parser context)
541
+ * @name: The attribute name, including namespace prefix
542
+ * @value: The attribute value
543
+ *
544
+ * Handle an attribute that has been read by the parser.
545
+ * The default handling is to convert the attribute into an
546
+ * DOM subtree and past it in a new xmlAttr element added to
547
+ * the element.
548
+ */
549
+ typedef void (*attributeSAXFunc) (void *ctx,
550
+ const xmlChar *name,
551
+ const xmlChar *value);
552
+ /**
553
+ * referenceSAXFunc:
554
+ * @ctx: the user data (XML parser context)
555
+ * @name: The entity name
556
+ *
557
+ * Called when an entity reference is detected.
558
+ */
559
+ typedef void (*referenceSAXFunc) (void *ctx,
560
+ const xmlChar *name);
561
+ /**
562
+ * charactersSAXFunc:
563
+ * @ctx: the user data (XML parser context)
564
+ * @ch: a xmlChar string
565
+ * @len: the number of xmlChar
566
+ *
567
+ * Receiving some chars from the parser.
568
+ */
569
+ typedef void (*charactersSAXFunc) (void *ctx,
570
+ const xmlChar *ch,
571
+ int len);
572
+ /**
573
+ * ignorableWhitespaceSAXFunc:
574
+ * @ctx: the user data (XML parser context)
575
+ * @ch: a xmlChar string
576
+ * @len: the number of xmlChar
577
+ *
578
+ * Receiving some ignorable whitespaces from the parser.
579
+ * UNUSED: by default the DOM building will use characters.
580
+ */
581
+ typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
582
+ const xmlChar *ch,
583
+ int len);
584
+ /**
585
+ * processingInstructionSAXFunc:
586
+ * @ctx: the user data (XML parser context)
587
+ * @target: the target name
588
+ * @data: the PI data's
589
+ *
590
+ * A processing instruction has been parsed.
591
+ */
592
+ typedef void (*processingInstructionSAXFunc) (void *ctx,
593
+ const xmlChar *target,
594
+ const xmlChar *data);
595
+ /**
596
+ * commentSAXFunc:
597
+ * @ctx: the user data (XML parser context)
598
+ * @value: the comment content
599
+ *
600
+ * A comment has been parsed.
601
+ */
602
+ typedef void (*commentSAXFunc) (void *ctx,
603
+ const xmlChar *value);
604
+ /**
605
+ * cdataBlockSAXFunc:
606
+ * @ctx: the user data (XML parser context)
607
+ * @value: The pcdata content
608
+ * @len: the block length
609
+ *
610
+ * Called when a pcdata block has been parsed.
611
+ */
612
+ typedef void (*cdataBlockSAXFunc) (
613
+ void *ctx,
614
+ const xmlChar *value,
615
+ int len);
616
+ /**
617
+ * warningSAXFunc:
618
+ * @ctx: an XML parser context
619
+ * @msg: the message to display/transmit
620
+ * @...: extra parameters for the message display
621
+ *
622
+ * Display and format a warning messages, callback.
623
+ */
624
+ typedef void (*warningSAXFunc) (void *ctx,
625
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
626
+ /**
627
+ * errorSAXFunc:
628
+ * @ctx: an XML parser context
629
+ * @msg: the message to display/transmit
630
+ * @...: extra parameters for the message display
631
+ *
632
+ * Display and format an error messages, callback.
633
+ */
634
+ typedef void (*errorSAXFunc) (void *ctx,
635
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
636
+ /**
637
+ * fatalErrorSAXFunc:
638
+ * @ctx: an XML parser context
639
+ * @msg: the message to display/transmit
640
+ * @...: extra parameters for the message display
641
+ *
642
+ * Display and format fatal error messages, callback.
643
+ * Note: so far fatalError() SAX callbacks are not used, error()
644
+ * get all the callbacks for errors.
645
+ */
646
+ typedef void (*fatalErrorSAXFunc) (void *ctx,
647
+ const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
648
+ /**
649
+ * isStandaloneSAXFunc:
650
+ * @ctx: the user data (XML parser context)
651
+ *
652
+ * Is this document tagged standalone?
653
+ *
654
+ * Returns 1 if true
655
+ */
656
+ typedef int (*isStandaloneSAXFunc) (void *ctx);
657
+ /**
658
+ * hasInternalSubsetSAXFunc:
659
+ * @ctx: the user data (XML parser context)
660
+ *
661
+ * Does this document has an internal subset.
662
+ *
663
+ * Returns 1 if true
664
+ */
665
+ typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
666
+
667
+ /**
668
+ * hasExternalSubsetSAXFunc:
669
+ * @ctx: the user data (XML parser context)
670
+ *
671
+ * Does this document has an external subset?
672
+ *
673
+ * Returns 1 if true
674
+ */
675
+ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
676
+
677
+ /************************************************************************
678
+ * *
679
+ * The SAX version 2 API extensions *
680
+ * *
681
+ ************************************************************************/
682
+ /**
683
+ * XML_SAX2_MAGIC:
684
+ *
685
+ * Special constant found in SAX2 blocks initialized fields
686
+ */
687
+ #define XML_SAX2_MAGIC 0xDEEDBEAF
688
+
689
+ /**
690
+ * startElementNsSAX2Func:
691
+ * @ctx: the user data (XML parser context)
692
+ * @localname: the local name of the element
693
+ * @prefix: the element namespace prefix if available
694
+ * @URI: the element namespace name if available
695
+ * @nb_namespaces: number of namespace definitions on that node
696
+ * @namespaces: pointer to the array of prefix/URI pairs namespace definitions
697
+ * @nb_attributes: the number of attributes on that node
698
+ * @nb_defaulted: the number of defaulted attributes. The defaulted
699
+ * ones are at the end of the array
700
+ * @attributes: pointer to the array of (localname/prefix/URI/value/end)
701
+ * attribute values.
702
+ *
703
+ * SAX2 callback when an element start has been detected by the parser.
704
+ * It provides the namespace information for the element, as well as
705
+ * the new namespace declarations on the element.
706
+ */
707
+
708
+ typedef void (*startElementNsSAX2Func) (void *ctx,
709
+ const xmlChar *localname,
710
+ const xmlChar *prefix,
711
+ const xmlChar *URI,
712
+ int nb_namespaces,
713
+ const xmlChar **namespaces,
714
+ int nb_attributes,
715
+ int nb_defaulted,
716
+ const xmlChar **attributes);
717
+
718
+ /**
719
+ * endElementNsSAX2Func:
720
+ * @ctx: the user data (XML parser context)
721
+ * @localname: the local name of the element
722
+ * @prefix: the element namespace prefix if available
723
+ * @URI: the element namespace name if available
724
+ *
725
+ * SAX2 callback when an element end has been detected by the parser.
726
+ * It provides the namespace information for the element.
727
+ */
728
+
729
+ typedef void (*endElementNsSAX2Func) (void *ctx,
730
+ const xmlChar *localname,
731
+ const xmlChar *prefix,
732
+ const xmlChar *URI);
733
+
734
+
735
+ struct _xmlSAXHandler {
736
+ internalSubsetSAXFunc internalSubset;
737
+ isStandaloneSAXFunc isStandalone;
738
+ hasInternalSubsetSAXFunc hasInternalSubset;
739
+ hasExternalSubsetSAXFunc hasExternalSubset;
740
+ resolveEntitySAXFunc resolveEntity;
741
+ getEntitySAXFunc getEntity;
742
+ entityDeclSAXFunc entityDecl;
743
+ notationDeclSAXFunc notationDecl;
744
+ attributeDeclSAXFunc attributeDecl;
745
+ elementDeclSAXFunc elementDecl;
746
+ unparsedEntityDeclSAXFunc unparsedEntityDecl;
747
+ setDocumentLocatorSAXFunc setDocumentLocator;
748
+ startDocumentSAXFunc startDocument;
749
+ endDocumentSAXFunc endDocument;
750
+ /*
751
+ * `startElement` and `endElement` are only used by the legacy SAX1
752
+ * interface and should not be used in new software. If you really
753
+ * have to enable SAX1, the preferred way is set the `initialized`
754
+ * member to 1 instead of XML_SAX2_MAGIC.
755
+ *
756
+ * For backward compatibility, it's also possible to set the
757
+ * `startElementNs` and `endElementNs` handlers to NULL.
758
+ *
759
+ * You can also set the XML_PARSE_SAX1 parser option, but versions
760
+ * older than 2.12.0 will probably crash if this option is provided
761
+ * together with custom SAX callbacks.
762
+ */
763
+ startElementSAXFunc startElement;
764
+ endElementSAXFunc endElement;
765
+ referenceSAXFunc reference;
766
+ charactersSAXFunc characters;
767
+ ignorableWhitespaceSAXFunc ignorableWhitespace;
768
+ processingInstructionSAXFunc processingInstruction;
769
+ commentSAXFunc comment;
770
+ warningSAXFunc warning;
771
+ errorSAXFunc error;
772
+ fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
773
+ getParameterEntitySAXFunc getParameterEntity;
774
+ cdataBlockSAXFunc cdataBlock;
775
+ externalSubsetSAXFunc externalSubset;
776
+ /*
777
+ * `initialized` should always be set to XML_SAX2_MAGIC to enable the
778
+ * modern SAX2 interface.
779
+ */
780
+ unsigned int initialized;
781
+ /*
782
+ * The following members are only used by the SAX2 interface.
783
+ */
784
+ void *_private;
785
+ startElementNsSAX2Func startElementNs;
786
+ endElementNsSAX2Func endElementNs;
787
+ xmlStructuredErrorFunc serror;
788
+ };
789
+
790
+ /*
791
+ * SAX Version 1
792
+ */
793
+ typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
794
+ typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
795
+ struct _xmlSAXHandlerV1 {
796
+ internalSubsetSAXFunc internalSubset;
797
+ isStandaloneSAXFunc isStandalone;
798
+ hasInternalSubsetSAXFunc hasInternalSubset;
799
+ hasExternalSubsetSAXFunc hasExternalSubset;
800
+ resolveEntitySAXFunc resolveEntity;
801
+ getEntitySAXFunc getEntity;
802
+ entityDeclSAXFunc entityDecl;
803
+ notationDeclSAXFunc notationDecl;
804
+ attributeDeclSAXFunc attributeDecl;
805
+ elementDeclSAXFunc elementDecl;
806
+ unparsedEntityDeclSAXFunc unparsedEntityDecl;
807
+ setDocumentLocatorSAXFunc setDocumentLocator;
808
+ startDocumentSAXFunc startDocument;
809
+ endDocumentSAXFunc endDocument;
810
+ startElementSAXFunc startElement;
811
+ endElementSAXFunc endElement;
812
+ referenceSAXFunc reference;
813
+ charactersSAXFunc characters;
814
+ ignorableWhitespaceSAXFunc ignorableWhitespace;
815
+ processingInstructionSAXFunc processingInstruction;
816
+ commentSAXFunc comment;
817
+ warningSAXFunc warning;
818
+ errorSAXFunc error;
819
+ fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
820
+ getParameterEntitySAXFunc getParameterEntity;
821
+ cdataBlockSAXFunc cdataBlock;
822
+ externalSubsetSAXFunc externalSubset;
823
+ unsigned int initialized;
824
+ };
825
+
826
+
827
+ /**
828
+ * xmlExternalEntityLoader:
829
+ * @URL: The System ID of the resource requested
830
+ * @ID: The Public ID of the resource requested
831
+ * @context: the XML parser context
832
+ *
833
+ * External entity loaders types.
834
+ *
835
+ * Returns the entity input parser.
836
+ */
837
+ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
838
+ const char *ID,
839
+ xmlParserCtxtPtr context);
840
+
841
+ /*
842
+ * Variables
843
+ */
844
+
845
+ XMLPUBVAR const char *const xmlParserVersion;
846
+ #ifdef LIBXML_THREAD_ENABLED
847
+ /* backward compatibility */
848
+ XMLPUBFUN const char *const *__xmlParserVersion(void);
849
+ #endif
850
+
851
+ /** DOC_DISABLE */
852
+ #define XML_GLOBALS_PARSER_CORE \
853
+ XML_OP(oldXMLWDcompatibility, int, XML_DEPRECATED) \
854
+ XML_OP(xmlDefaultSAXLocator, xmlSAXLocator, XML_DEPRECATED) \
855
+ XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
856
+ XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
857
+ XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
858
+ XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
859
+ XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
860
+ XML_OP(xmlParserDebugEntities, int, XML_DEPRECATED) \
861
+ XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
862
+ XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED)
863
+
864
+ #ifdef LIBXML_OUTPUT_ENABLED
865
+ #define XML_GLOBALS_PARSER_OUTPUT \
866
+ XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \
867
+ XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \
868
+ XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR)
869
+ #else
870
+ #define XML_GLOBALS_PARSER_OUTPUT
871
+ #endif
872
+
873
+ #ifdef LIBXML_SAX1_ENABLED
874
+ #define XML_GLOBALS_PARSER_SAX1 \
875
+ XML_OP(xmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED)
876
+ #else
877
+ #define XML_GLOBALS_PARSER_SAX1
878
+ #endif
879
+
880
+ #define XML_GLOBALS_PARSER \
881
+ XML_GLOBALS_PARSER_CORE \
882
+ XML_GLOBALS_PARSER_OUTPUT \
883
+ XML_GLOBALS_PARSER_SAX1
884
+
885
+ #define XML_OP XML_DECLARE_GLOBAL
886
+ XML_GLOBALS_PARSER
887
+ #undef XML_OP
888
+
889
+ #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
890
+ #define oldXMLWDcompatibility XML_GLOBAL_MACRO(oldXMLWDcompatibility)
891
+ #define xmlDefaultSAXHandler XML_GLOBAL_MACRO(xmlDefaultSAXHandler)
892
+ #define xmlDefaultSAXLocator XML_GLOBAL_MACRO(xmlDefaultSAXLocator)
893
+ #define xmlDoValidityCheckingDefaultValue \
894
+ XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
895
+ #define xmlGetWarningsDefaultValue \
896
+ XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
897
+ #define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
898
+ #define xmlLineNumbersDefaultValue \
899
+ XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
900
+ #define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
901
+ #define xmlParserDebugEntities XML_GLOBAL_MACRO(xmlParserDebugEntities)
902
+ #define xmlPedanticParserDefaultValue \
903
+ XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
904
+ #define xmlSubstituteEntitiesDefaultValue \
905
+ XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
906
+ #ifdef LIBXML_OUTPUT_ENABLED
907
+ #define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
908
+ #define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
909
+ #define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
910
+ #endif
911
+ #endif
912
+ /** DOC_ENABLE */
913
+
914
+ /*
915
+ * Init/Cleanup
916
+ */
917
+ XMLPUBFUN void
918
+ xmlInitParser (void);
919
+ XMLPUBFUN void
920
+ xmlCleanupParser (void);
921
+ XML_DEPRECATED
922
+ XMLPUBFUN void
923
+ xmlInitGlobals (void);
924
+ XML_DEPRECATED
925
+ XMLPUBFUN void
926
+ xmlCleanupGlobals (void);
927
+
928
+ /*
929
+ * Input functions
930
+ */
931
+ XML_DEPRECATED
932
+ XMLPUBFUN int
933
+ xmlParserInputRead (xmlParserInputPtr in,
934
+ int len);
935
+ XML_DEPRECATED
936
+ XMLPUBFUN int
937
+ xmlParserInputGrow (xmlParserInputPtr in,
938
+ int len);
939
+
940
+ /*
941
+ * Basic parsing Interfaces
942
+ */
943
+ #ifdef LIBXML_SAX1_ENABLED
944
+ XMLPUBFUN xmlDocPtr
945
+ xmlParseDoc (const xmlChar *cur);
946
+ XMLPUBFUN xmlDocPtr
947
+ xmlParseFile (const char *filename);
948
+ XMLPUBFUN xmlDocPtr
949
+ xmlParseMemory (const char *buffer,
950
+ int size);
951
+ #endif /* LIBXML_SAX1_ENABLED */
952
+ XML_DEPRECATED XMLPUBFUN int
953
+ xmlSubstituteEntitiesDefault(int val);
954
+ XML_DEPRECATED XMLPUBFUN int
955
+ xmlThrDefSubstituteEntitiesDefaultValue(int v);
956
+ XML_DEPRECATED XMLPUBFUN int
957
+ xmlKeepBlanksDefault (int val);
958
+ XML_DEPRECATED XMLPUBFUN int
959
+ xmlThrDefKeepBlanksDefaultValue(int v);
960
+ XMLPUBFUN void
961
+ xmlStopParser (xmlParserCtxtPtr ctxt);
962
+ XML_DEPRECATED XMLPUBFUN int
963
+ xmlPedanticParserDefault(int val);
964
+ XML_DEPRECATED XMLPUBFUN int
965
+ xmlThrDefPedanticParserDefaultValue(int v);
966
+ XML_DEPRECATED XMLPUBFUN int
967
+ xmlLineNumbersDefault (int val);
968
+ XML_DEPRECATED XMLPUBFUN int
969
+ xmlThrDefLineNumbersDefaultValue(int v);
970
+ XML_DEPRECATED XMLPUBFUN int
971
+ xmlThrDefDoValidityCheckingDefaultValue(int v);
972
+ XML_DEPRECATED XMLPUBFUN int
973
+ xmlThrDefGetWarningsDefaultValue(int v);
974
+ XML_DEPRECATED XMLPUBFUN int
975
+ xmlThrDefLoadExtDtdDefaultValue(int v);
976
+ XML_DEPRECATED XMLPUBFUN int
977
+ xmlThrDefParserDebugEntities(int v);
978
+
979
+ #ifdef LIBXML_SAX1_ENABLED
980
+ /*
981
+ * Recovery mode
982
+ */
983
+ XML_DEPRECATED
984
+ XMLPUBFUN xmlDocPtr
985
+ xmlRecoverDoc (const xmlChar *cur);
986
+ XML_DEPRECATED
987
+ XMLPUBFUN xmlDocPtr
988
+ xmlRecoverMemory (const char *buffer,
989
+ int size);
990
+ XML_DEPRECATED
991
+ XMLPUBFUN xmlDocPtr
992
+ xmlRecoverFile (const char *filename);
993
+ #endif /* LIBXML_SAX1_ENABLED */
994
+
995
+ /*
996
+ * Less common routines and SAX interfaces
997
+ */
998
+ XMLPUBFUN int
999
+ xmlParseDocument (xmlParserCtxtPtr ctxt);
1000
+ XMLPUBFUN int
1001
+ xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
1002
+ #ifdef LIBXML_SAX1_ENABLED
1003
+ XML_DEPRECATED
1004
+ XMLPUBFUN int
1005
+ xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
1006
+ void *user_data,
1007
+ const char *filename);
1008
+ XML_DEPRECATED
1009
+ XMLPUBFUN int
1010
+ xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
1011
+ void *user_data,
1012
+ const char *buffer,
1013
+ int size);
1014
+ XML_DEPRECATED
1015
+ XMLPUBFUN xmlDocPtr
1016
+ xmlSAXParseDoc (xmlSAXHandlerPtr sax,
1017
+ const xmlChar *cur,
1018
+ int recovery);
1019
+ XML_DEPRECATED
1020
+ XMLPUBFUN xmlDocPtr
1021
+ xmlSAXParseMemory (xmlSAXHandlerPtr sax,
1022
+ const char *buffer,
1023
+ int size,
1024
+ int recovery);
1025
+ XML_DEPRECATED
1026
+ XMLPUBFUN xmlDocPtr
1027
+ xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
1028
+ const char *buffer,
1029
+ int size,
1030
+ int recovery,
1031
+ void *data);
1032
+ XML_DEPRECATED
1033
+ XMLPUBFUN xmlDocPtr
1034
+ xmlSAXParseFile (xmlSAXHandlerPtr sax,
1035
+ const char *filename,
1036
+ int recovery);
1037
+ XML_DEPRECATED
1038
+ XMLPUBFUN xmlDocPtr
1039
+ xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
1040
+ const char *filename,
1041
+ int recovery,
1042
+ void *data);
1043
+ XML_DEPRECATED
1044
+ XMLPUBFUN xmlDocPtr
1045
+ xmlSAXParseEntity (xmlSAXHandlerPtr sax,
1046
+ const char *filename);
1047
+ XML_DEPRECATED
1048
+ XMLPUBFUN xmlDocPtr
1049
+ xmlParseEntity (const char *filename);
1050
+ #endif /* LIBXML_SAX1_ENABLED */
1051
+
1052
+ #ifdef LIBXML_VALID_ENABLED
1053
+ XML_DEPRECATED
1054
+ XMLPUBFUN xmlDtdPtr
1055
+ xmlSAXParseDTD (xmlSAXHandlerPtr sax,
1056
+ const xmlChar *ExternalID,
1057
+ const xmlChar *SystemID);
1058
+ XMLPUBFUN xmlDtdPtr
1059
+ xmlParseDTD (const xmlChar *ExternalID,
1060
+ const xmlChar *SystemID);
1061
+ XMLPUBFUN xmlDtdPtr
1062
+ xmlIOParseDTD (xmlSAXHandlerPtr sax,
1063
+ xmlParserInputBufferPtr input,
1064
+ xmlCharEncoding enc);
1065
+ #endif /* LIBXML_VALID_ENABLE */
1066
+ #ifdef LIBXML_SAX1_ENABLED
1067
+ XMLPUBFUN int
1068
+ xmlParseBalancedChunkMemory(xmlDocPtr doc,
1069
+ xmlSAXHandlerPtr sax,
1070
+ void *user_data,
1071
+ int depth,
1072
+ const xmlChar *string,
1073
+ xmlNodePtr *lst);
1074
+ #endif /* LIBXML_SAX1_ENABLED */
1075
+ XMLPUBFUN xmlParserErrors
1076
+ xmlParseInNodeContext (xmlNodePtr node,
1077
+ const char *data,
1078
+ int datalen,
1079
+ int options,
1080
+ xmlNodePtr *lst);
1081
+ #ifdef LIBXML_SAX1_ENABLED
1082
+ XMLPUBFUN int
1083
+ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
1084
+ xmlSAXHandlerPtr sax,
1085
+ void *user_data,
1086
+ int depth,
1087
+ const xmlChar *string,
1088
+ xmlNodePtr *lst,
1089
+ int recover);
1090
+ XML_DEPRECATED
1091
+ XMLPUBFUN int
1092
+ xmlParseExternalEntity (xmlDocPtr doc,
1093
+ xmlSAXHandlerPtr sax,
1094
+ void *user_data,
1095
+ int depth,
1096
+ const xmlChar *URL,
1097
+ const xmlChar *ID,
1098
+ xmlNodePtr *lst);
1099
+ #endif /* LIBXML_SAX1_ENABLED */
1100
+ XMLPUBFUN int
1101
+ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
1102
+ const xmlChar *URL,
1103
+ const xmlChar *ID,
1104
+ xmlNodePtr *lst);
1105
+
1106
+ /*
1107
+ * Parser contexts handling.
1108
+ */
1109
+ XMLPUBFUN xmlParserCtxtPtr
1110
+ xmlNewParserCtxt (void);
1111
+ XMLPUBFUN xmlParserCtxtPtr
1112
+ xmlNewSAXParserCtxt (const xmlSAXHandler *sax,
1113
+ void *userData);
1114
+ XMLPUBFUN int
1115
+ xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
1116
+ XMLPUBFUN void
1117
+ xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
1118
+ XMLPUBFUN void
1119
+ xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
1120
+ #ifdef LIBXML_SAX1_ENABLED
1121
+ XML_DEPRECATED
1122
+ XMLPUBFUN void
1123
+ xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
1124
+ const xmlChar* buffer,
1125
+ const char *filename);
1126
+ #endif /* LIBXML_SAX1_ENABLED */
1127
+ XMLPUBFUN xmlParserCtxtPtr
1128
+ xmlCreateDocParserCtxt (const xmlChar *cur);
1129
+
1130
+ #ifdef LIBXML_LEGACY_ENABLED
1131
+ /*
1132
+ * Reading/setting optional parsing features.
1133
+ */
1134
+ XML_DEPRECATED
1135
+ XMLPUBFUN int
1136
+ xmlGetFeaturesList (int *len,
1137
+ const char **result);
1138
+ XML_DEPRECATED
1139
+ XMLPUBFUN int
1140
+ xmlGetFeature (xmlParserCtxtPtr ctxt,
1141
+ const char *name,
1142
+ void *result);
1143
+ XML_DEPRECATED
1144
+ XMLPUBFUN int
1145
+ xmlSetFeature (xmlParserCtxtPtr ctxt,
1146
+ const char *name,
1147
+ void *value);
1148
+ #endif /* LIBXML_LEGACY_ENABLED */
1149
+
1150
+ #ifdef LIBXML_PUSH_ENABLED
1151
+ /*
1152
+ * Interfaces for the Push mode.
1153
+ */
1154
+ XMLPUBFUN xmlParserCtxtPtr
1155
+ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
1156
+ void *user_data,
1157
+ const char *chunk,
1158
+ int size,
1159
+ const char *filename);
1160
+ XMLPUBFUN int
1161
+ xmlParseChunk (xmlParserCtxtPtr ctxt,
1162
+ const char *chunk,
1163
+ int size,
1164
+ int terminate);
1165
+ #endif /* LIBXML_PUSH_ENABLED */
1166
+
1167
+ /*
1168
+ * Special I/O mode.
1169
+ */
1170
+
1171
+ XMLPUBFUN xmlParserCtxtPtr
1172
+ xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
1173
+ void *user_data,
1174
+ xmlInputReadCallback ioread,
1175
+ xmlInputCloseCallback ioclose,
1176
+ void *ioctx,
1177
+ xmlCharEncoding enc);
1178
+
1179
+ XMLPUBFUN xmlParserInputPtr
1180
+ xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
1181
+ xmlParserInputBufferPtr input,
1182
+ xmlCharEncoding enc);
1183
+
1184
+ /*
1185
+ * Node infos.
1186
+ */
1187
+ XMLPUBFUN const xmlParserNodeInfo*
1188
+ xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
1189
+ const xmlNodePtr node);
1190
+ XMLPUBFUN void
1191
+ xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1192
+ XMLPUBFUN void
1193
+ xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1194
+ XMLPUBFUN unsigned long
1195
+ xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
1196
+ const xmlNodePtr node);
1197
+ XMLPUBFUN void
1198
+ xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
1199
+ const xmlParserNodeInfoPtr info);
1200
+
1201
+ /*
1202
+ * External entities handling actually implemented in xmlIO.
1203
+ */
1204
+
1205
+ XMLPUBFUN void
1206
+ xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
1207
+ XMLPUBFUN xmlExternalEntityLoader
1208
+ xmlGetExternalEntityLoader(void);
1209
+ XMLPUBFUN xmlParserInputPtr
1210
+ xmlLoadExternalEntity (const char *URL,
1211
+ const char *ID,
1212
+ xmlParserCtxtPtr ctxt);
1213
+
1214
+ /*
1215
+ * Index lookup, actually implemented in the encoding module
1216
+ */
1217
+ XMLPUBFUN long
1218
+ xmlByteConsumed (xmlParserCtxtPtr ctxt);
1219
+
1220
+ /*
1221
+ * New set of simpler/more flexible APIs
1222
+ */
1223
+ /**
1224
+ * xmlParserOption:
1225
+ *
1226
+ * This is the set of XML parser options that can be passed down
1227
+ * to the xmlReadDoc() and similar calls.
1228
+ */
1229
+ typedef enum {
1230
+ XML_PARSE_RECOVER = 1<<0, /* recover on errors */
1231
+ XML_PARSE_NOENT = 1<<1, /* substitute entities */
1232
+ XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */
1233
+ XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */
1234
+ XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */
1235
+ XML_PARSE_NOERROR = 1<<5, /* suppress error reports */
1236
+ XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
1237
+ XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
1238
+ XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
1239
+ XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
1240
+ XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */
1241
+ XML_PARSE_NONET = 1<<11,/* Forbid network access */
1242
+ XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */
1243
+ XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
1244
+ XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */
1245
+ XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
1246
+ XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of
1247
+ the tree allowed afterwards (will possibly
1248
+ crash if you try to modify the tree) */
1249
+ XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */
1250
+ XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
1251
+ XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
1252
+ XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
1253
+ XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
1254
+ XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */
1255
+ } xmlParserOption;
1256
+
1257
+ XMLPUBFUN void
1258
+ xmlCtxtReset (xmlParserCtxtPtr ctxt);
1259
+ XMLPUBFUN int
1260
+ xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
1261
+ const char *chunk,
1262
+ int size,
1263
+ const char *filename,
1264
+ const char *encoding);
1265
+ XMLPUBFUN int
1266
+ xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
1267
+ int options);
1268
+ XMLPUBFUN void
1269
+ xmlCtxtSetMaxAmplification(xmlParserCtxtPtr ctxt,
1270
+ unsigned maxAmpl);
1271
+ XMLPUBFUN xmlDocPtr
1272
+ xmlReadDoc (const xmlChar *cur,
1273
+ const char *URL,
1274
+ const char *encoding,
1275
+ int options);
1276
+ XMLPUBFUN xmlDocPtr
1277
+ xmlReadFile (const char *URL,
1278
+ const char *encoding,
1279
+ int options);
1280
+ XMLPUBFUN xmlDocPtr
1281
+ xmlReadMemory (const char *buffer,
1282
+ int size,
1283
+ const char *URL,
1284
+ const char *encoding,
1285
+ int options);
1286
+ XMLPUBFUN xmlDocPtr
1287
+ xmlReadFd (int fd,
1288
+ const char *URL,
1289
+ const char *encoding,
1290
+ int options);
1291
+ XMLPUBFUN xmlDocPtr
1292
+ xmlReadIO (xmlInputReadCallback ioread,
1293
+ xmlInputCloseCallback ioclose,
1294
+ void *ioctx,
1295
+ const char *URL,
1296
+ const char *encoding,
1297
+ int options);
1298
+ XMLPUBFUN xmlDocPtr
1299
+ xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
1300
+ const xmlChar *cur,
1301
+ const char *URL,
1302
+ const char *encoding,
1303
+ int options);
1304
+ XMLPUBFUN xmlDocPtr
1305
+ xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
1306
+ const char *filename,
1307
+ const char *encoding,
1308
+ int options);
1309
+ XMLPUBFUN xmlDocPtr
1310
+ xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
1311
+ const char *buffer,
1312
+ int size,
1313
+ const char *URL,
1314
+ const char *encoding,
1315
+ int options);
1316
+ XMLPUBFUN xmlDocPtr
1317
+ xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
1318
+ int fd,
1319
+ const char *URL,
1320
+ const char *encoding,
1321
+ int options);
1322
+ XMLPUBFUN xmlDocPtr
1323
+ xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
1324
+ xmlInputReadCallback ioread,
1325
+ xmlInputCloseCallback ioclose,
1326
+ void *ioctx,
1327
+ const char *URL,
1328
+ const char *encoding,
1329
+ int options);
1330
+
1331
+ /*
1332
+ * Library wide options
1333
+ */
1334
+ /**
1335
+ * xmlFeature:
1336
+ *
1337
+ * Used to examine the existence of features that can be enabled
1338
+ * or disabled at compile-time.
1339
+ * They used to be called XML_FEATURE_xxx but this clashed with Expat
1340
+ */
1341
+ typedef enum {
1342
+ XML_WITH_THREAD = 1,
1343
+ XML_WITH_TREE = 2,
1344
+ XML_WITH_OUTPUT = 3,
1345
+ XML_WITH_PUSH = 4,
1346
+ XML_WITH_READER = 5,
1347
+ XML_WITH_PATTERN = 6,
1348
+ XML_WITH_WRITER = 7,
1349
+ XML_WITH_SAX1 = 8,
1350
+ XML_WITH_FTP = 9,
1351
+ XML_WITH_HTTP = 10,
1352
+ XML_WITH_VALID = 11,
1353
+ XML_WITH_HTML = 12,
1354
+ XML_WITH_LEGACY = 13,
1355
+ XML_WITH_C14N = 14,
1356
+ XML_WITH_CATALOG = 15,
1357
+ XML_WITH_XPATH = 16,
1358
+ XML_WITH_XPTR = 17,
1359
+ XML_WITH_XINCLUDE = 18,
1360
+ XML_WITH_ICONV = 19,
1361
+ XML_WITH_ISO8859X = 20,
1362
+ XML_WITH_UNICODE = 21,
1363
+ XML_WITH_REGEXP = 22,
1364
+ XML_WITH_AUTOMATA = 23,
1365
+ XML_WITH_EXPR = 24,
1366
+ XML_WITH_SCHEMAS = 25,
1367
+ XML_WITH_SCHEMATRON = 26,
1368
+ XML_WITH_MODULES = 27,
1369
+ XML_WITH_DEBUG = 28,
1370
+ XML_WITH_DEBUG_MEM = 29,
1371
+ XML_WITH_DEBUG_RUN = 30,
1372
+ XML_WITH_ZLIB = 31,
1373
+ XML_WITH_ICU = 32,
1374
+ XML_WITH_LZMA = 33,
1375
+ XML_WITH_NONE = 99999 /* just to be sure of allocation size */
1376
+ } xmlFeature;
1377
+
1378
+ XMLPUBFUN int
1379
+ xmlHasFeature (xmlFeature feature);
1380
+
1381
+ #ifdef __cplusplus
1382
+ }
1383
+ #endif
1384
+ #endif /* __XML_PARSER_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/schemasInternals.h ADDED
@@ -0,0 +1,959 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: internal interfaces for XML Schemas
3
+ * Description: internal interfaces for the XML Schemas handling
4
+ * and schema validity checking
5
+ * The Schemas development is a Work In Progress.
6
+ * Some of those interfaces are not guaranteed to be API or ABI stable !
7
+ *
8
+ * Copy: See Copyright for the status of this software.
9
+ *
10
+ * Author: Daniel Veillard
11
+ */
12
+
13
+
14
+ #ifndef __XML_SCHEMA_INTERNALS_H__
15
+ #define __XML_SCHEMA_INTERNALS_H__
16
+
17
+ #include <libxml/xmlversion.h>
18
+
19
+ #ifdef LIBXML_SCHEMAS_ENABLED
20
+
21
+ #include <libxml/xmlregexp.h>
22
+ #include <libxml/hash.h>
23
+ #include <libxml/dict.h>
24
+ #include <libxml/tree.h>
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+ typedef enum {
31
+ XML_SCHEMAS_UNKNOWN = 0,
32
+ XML_SCHEMAS_STRING = 1,
33
+ XML_SCHEMAS_NORMSTRING = 2,
34
+ XML_SCHEMAS_DECIMAL = 3,
35
+ XML_SCHEMAS_TIME = 4,
36
+ XML_SCHEMAS_GDAY = 5,
37
+ XML_SCHEMAS_GMONTH = 6,
38
+ XML_SCHEMAS_GMONTHDAY = 7,
39
+ XML_SCHEMAS_GYEAR = 8,
40
+ XML_SCHEMAS_GYEARMONTH = 9,
41
+ XML_SCHEMAS_DATE = 10,
42
+ XML_SCHEMAS_DATETIME = 11,
43
+ XML_SCHEMAS_DURATION = 12,
44
+ XML_SCHEMAS_FLOAT = 13,
45
+ XML_SCHEMAS_DOUBLE = 14,
46
+ XML_SCHEMAS_BOOLEAN = 15,
47
+ XML_SCHEMAS_TOKEN = 16,
48
+ XML_SCHEMAS_LANGUAGE = 17,
49
+ XML_SCHEMAS_NMTOKEN = 18,
50
+ XML_SCHEMAS_NMTOKENS = 19,
51
+ XML_SCHEMAS_NAME = 20,
52
+ XML_SCHEMAS_QNAME = 21,
53
+ XML_SCHEMAS_NCNAME = 22,
54
+ XML_SCHEMAS_ID = 23,
55
+ XML_SCHEMAS_IDREF = 24,
56
+ XML_SCHEMAS_IDREFS = 25,
57
+ XML_SCHEMAS_ENTITY = 26,
58
+ XML_SCHEMAS_ENTITIES = 27,
59
+ XML_SCHEMAS_NOTATION = 28,
60
+ XML_SCHEMAS_ANYURI = 29,
61
+ XML_SCHEMAS_INTEGER = 30,
62
+ XML_SCHEMAS_NPINTEGER = 31,
63
+ XML_SCHEMAS_NINTEGER = 32,
64
+ XML_SCHEMAS_NNINTEGER = 33,
65
+ XML_SCHEMAS_PINTEGER = 34,
66
+ XML_SCHEMAS_INT = 35,
67
+ XML_SCHEMAS_UINT = 36,
68
+ XML_SCHEMAS_LONG = 37,
69
+ XML_SCHEMAS_ULONG = 38,
70
+ XML_SCHEMAS_SHORT = 39,
71
+ XML_SCHEMAS_USHORT = 40,
72
+ XML_SCHEMAS_BYTE = 41,
73
+ XML_SCHEMAS_UBYTE = 42,
74
+ XML_SCHEMAS_HEXBINARY = 43,
75
+ XML_SCHEMAS_BASE64BINARY = 44,
76
+ XML_SCHEMAS_ANYTYPE = 45,
77
+ XML_SCHEMAS_ANYSIMPLETYPE = 46
78
+ } xmlSchemaValType;
79
+
80
+ /*
81
+ * XML Schemas defines multiple type of types.
82
+ */
83
+ typedef enum {
84
+ XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
85
+ XML_SCHEMA_TYPE_ANY,
86
+ XML_SCHEMA_TYPE_FACET,
87
+ XML_SCHEMA_TYPE_SIMPLE,
88
+ XML_SCHEMA_TYPE_COMPLEX,
89
+ XML_SCHEMA_TYPE_SEQUENCE = 6,
90
+ XML_SCHEMA_TYPE_CHOICE,
91
+ XML_SCHEMA_TYPE_ALL,
92
+ XML_SCHEMA_TYPE_SIMPLE_CONTENT,
93
+ XML_SCHEMA_TYPE_COMPLEX_CONTENT,
94
+ XML_SCHEMA_TYPE_UR,
95
+ XML_SCHEMA_TYPE_RESTRICTION,
96
+ XML_SCHEMA_TYPE_EXTENSION,
97
+ XML_SCHEMA_TYPE_ELEMENT,
98
+ XML_SCHEMA_TYPE_ATTRIBUTE,
99
+ XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
100
+ XML_SCHEMA_TYPE_GROUP,
101
+ XML_SCHEMA_TYPE_NOTATION,
102
+ XML_SCHEMA_TYPE_LIST,
103
+ XML_SCHEMA_TYPE_UNION,
104
+ XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
105
+ XML_SCHEMA_TYPE_IDC_UNIQUE,
106
+ XML_SCHEMA_TYPE_IDC_KEY,
107
+ XML_SCHEMA_TYPE_IDC_KEYREF,
108
+ XML_SCHEMA_TYPE_PARTICLE = 25,
109
+ XML_SCHEMA_TYPE_ATTRIBUTE_USE,
110
+ XML_SCHEMA_FACET_MININCLUSIVE = 1000,
111
+ XML_SCHEMA_FACET_MINEXCLUSIVE,
112
+ XML_SCHEMA_FACET_MAXINCLUSIVE,
113
+ XML_SCHEMA_FACET_MAXEXCLUSIVE,
114
+ XML_SCHEMA_FACET_TOTALDIGITS,
115
+ XML_SCHEMA_FACET_FRACTIONDIGITS,
116
+ XML_SCHEMA_FACET_PATTERN,
117
+ XML_SCHEMA_FACET_ENUMERATION,
118
+ XML_SCHEMA_FACET_WHITESPACE,
119
+ XML_SCHEMA_FACET_LENGTH,
120
+ XML_SCHEMA_FACET_MAXLENGTH,
121
+ XML_SCHEMA_FACET_MINLENGTH,
122
+ XML_SCHEMA_EXTRA_QNAMEREF = 2000,
123
+ XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
124
+ } xmlSchemaTypeType;
125
+
126
+ typedef enum {
127
+ XML_SCHEMA_CONTENT_UNKNOWN = 0,
128
+ XML_SCHEMA_CONTENT_EMPTY = 1,
129
+ XML_SCHEMA_CONTENT_ELEMENTS,
130
+ XML_SCHEMA_CONTENT_MIXED,
131
+ XML_SCHEMA_CONTENT_SIMPLE,
132
+ XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */
133
+ XML_SCHEMA_CONTENT_BASIC,
134
+ XML_SCHEMA_CONTENT_ANY
135
+ } xmlSchemaContentType;
136
+
137
+ typedef struct _xmlSchemaVal xmlSchemaVal;
138
+ typedef xmlSchemaVal *xmlSchemaValPtr;
139
+
140
+ typedef struct _xmlSchemaType xmlSchemaType;
141
+ typedef xmlSchemaType *xmlSchemaTypePtr;
142
+
143
+ typedef struct _xmlSchemaFacet xmlSchemaFacet;
144
+ typedef xmlSchemaFacet *xmlSchemaFacetPtr;
145
+
146
+ /**
147
+ * Annotation
148
+ */
149
+ typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
150
+ typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
151
+ struct _xmlSchemaAnnot {
152
+ struct _xmlSchemaAnnot *next;
153
+ xmlNodePtr content; /* the annotation */
154
+ };
155
+
156
+ /**
157
+ * XML_SCHEMAS_ANYATTR_SKIP:
158
+ *
159
+ * Skip unknown attribute from validation
160
+ * Obsolete, not used anymore.
161
+ */
162
+ #define XML_SCHEMAS_ANYATTR_SKIP 1
163
+ /**
164
+ * XML_SCHEMAS_ANYATTR_LAX:
165
+ *
166
+ * Ignore validation non definition on attributes
167
+ * Obsolete, not used anymore.
168
+ */
169
+ #define XML_SCHEMAS_ANYATTR_LAX 2
170
+ /**
171
+ * XML_SCHEMAS_ANYATTR_STRICT:
172
+ *
173
+ * Apply strict validation rules on attributes
174
+ * Obsolete, not used anymore.
175
+ */
176
+ #define XML_SCHEMAS_ANYATTR_STRICT 3
177
+ /**
178
+ * XML_SCHEMAS_ANY_SKIP:
179
+ *
180
+ * Skip unknown attribute from validation
181
+ */
182
+ #define XML_SCHEMAS_ANY_SKIP 1
183
+ /**
184
+ * XML_SCHEMAS_ANY_LAX:
185
+ *
186
+ * Used by wildcards.
187
+ * Validate if type found, don't worry if not found
188
+ */
189
+ #define XML_SCHEMAS_ANY_LAX 2
190
+ /**
191
+ * XML_SCHEMAS_ANY_STRICT:
192
+ *
193
+ * Used by wildcards.
194
+ * Apply strict validation rules
195
+ */
196
+ #define XML_SCHEMAS_ANY_STRICT 3
197
+ /**
198
+ * XML_SCHEMAS_ATTR_USE_PROHIBITED:
199
+ *
200
+ * Used by wildcards.
201
+ * The attribute is prohibited.
202
+ */
203
+ #define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
204
+ /**
205
+ * XML_SCHEMAS_ATTR_USE_REQUIRED:
206
+ *
207
+ * The attribute is required.
208
+ */
209
+ #define XML_SCHEMAS_ATTR_USE_REQUIRED 1
210
+ /**
211
+ * XML_SCHEMAS_ATTR_USE_OPTIONAL:
212
+ *
213
+ * The attribute is optional.
214
+ */
215
+ #define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
216
+ /**
217
+ * XML_SCHEMAS_ATTR_GLOBAL:
218
+ *
219
+ * allow elements in no namespace
220
+ */
221
+ #define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
222
+ /**
223
+ * XML_SCHEMAS_ATTR_NSDEFAULT:
224
+ *
225
+ * allow elements in no namespace
226
+ */
227
+ #define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
228
+ /**
229
+ * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
230
+ *
231
+ * this is set when the "type" and "ref" references
232
+ * have been resolved.
233
+ */
234
+ #define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
235
+ /**
236
+ * XML_SCHEMAS_ATTR_FIXED:
237
+ *
238
+ * the attribute has a fixed value
239
+ */
240
+ #define XML_SCHEMAS_ATTR_FIXED 1 << 9
241
+
242
+ /**
243
+ * xmlSchemaAttribute:
244
+ * An attribute definition.
245
+ */
246
+
247
+ typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
248
+ typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
249
+ struct _xmlSchemaAttribute {
250
+ xmlSchemaTypeType type;
251
+ struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */
252
+ const xmlChar *name; /* the name of the declaration */
253
+ const xmlChar *id; /* Deprecated; not used */
254
+ const xmlChar *ref; /* Deprecated; not used */
255
+ const xmlChar *refNs; /* Deprecated; not used */
256
+ const xmlChar *typeName; /* the local name of the type definition */
257
+ const xmlChar *typeNs; /* the ns URI of the type definition */
258
+ xmlSchemaAnnotPtr annot;
259
+
260
+ xmlSchemaTypePtr base; /* Deprecated; not used */
261
+ int occurs; /* Deprecated; not used */
262
+ const xmlChar *defValue; /* The initial value of the value constraint */
263
+ xmlSchemaTypePtr subtypes; /* the type definition */
264
+ xmlNodePtr node;
265
+ const xmlChar *targetNamespace;
266
+ int flags;
267
+ const xmlChar *refPrefix; /* Deprecated; not used */
268
+ xmlSchemaValPtr defVal; /* The compiled value constraint */
269
+ xmlSchemaAttributePtr refDecl; /* Deprecated; not used */
270
+ };
271
+
272
+ /**
273
+ * xmlSchemaAttributeLink:
274
+ * Used to build a list of attribute uses on complexType definitions.
275
+ * WARNING: Deprecated; not used.
276
+ */
277
+ typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
278
+ typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
279
+ struct _xmlSchemaAttributeLink {
280
+ struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
281
+ struct _xmlSchemaAttribute *attr;/* the linked attribute */
282
+ };
283
+
284
+ /**
285
+ * XML_SCHEMAS_WILDCARD_COMPLETE:
286
+ *
287
+ * If the wildcard is complete.
288
+ */
289
+ #define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
290
+
291
+ /**
292
+ * xmlSchemaCharValueLink:
293
+ * Used to build a list of namespaces on wildcards.
294
+ */
295
+ typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
296
+ typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
297
+ struct _xmlSchemaWildcardNs {
298
+ struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
299
+ const xmlChar *value;/* the value */
300
+ };
301
+
302
+ /**
303
+ * xmlSchemaWildcard.
304
+ * A wildcard.
305
+ */
306
+ typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
307
+ typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
308
+ struct _xmlSchemaWildcard {
309
+ xmlSchemaTypeType type; /* The kind of type */
310
+ const xmlChar *id; /* Deprecated; not used */
311
+ xmlSchemaAnnotPtr annot;
312
+ xmlNodePtr node;
313
+ int minOccurs; /* Deprecated; not used */
314
+ int maxOccurs; /* Deprecated; not used */
315
+ int processContents;
316
+ int any; /* Indicates if the ns constraint is of ##any */
317
+ xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
318
+ xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
319
+ int flags;
320
+ };
321
+
322
+ /**
323
+ * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
324
+ *
325
+ * The attribute wildcard has been built.
326
+ */
327
+ #define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
328
+ /**
329
+ * XML_SCHEMAS_ATTRGROUP_GLOBAL:
330
+ *
331
+ * The attribute group has been defined.
332
+ */
333
+ #define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
334
+ /**
335
+ * XML_SCHEMAS_ATTRGROUP_MARKED:
336
+ *
337
+ * Marks the attr group as marked; used for circular checks.
338
+ */
339
+ #define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
340
+
341
+ /**
342
+ * XML_SCHEMAS_ATTRGROUP_REDEFINED:
343
+ *
344
+ * The attr group was redefined.
345
+ */
346
+ #define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
347
+ /**
348
+ * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
349
+ *
350
+ * Whether this attr. group contains attr. group references.
351
+ */
352
+ #define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
353
+
354
+ /**
355
+ * An attribute group definition.
356
+ *
357
+ * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
358
+ * must be kept similar
359
+ */
360
+ typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
361
+ typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
362
+ struct _xmlSchemaAttributeGroup {
363
+ xmlSchemaTypeType type; /* The kind of type */
364
+ struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
365
+ const xmlChar *name;
366
+ const xmlChar *id;
367
+ const xmlChar *ref; /* Deprecated; not used */
368
+ const xmlChar *refNs; /* Deprecated; not used */
369
+ xmlSchemaAnnotPtr annot;
370
+
371
+ xmlSchemaAttributePtr attributes; /* Deprecated; not used */
372
+ xmlNodePtr node;
373
+ int flags;
374
+ xmlSchemaWildcardPtr attributeWildcard;
375
+ const xmlChar *refPrefix; /* Deprecated; not used */
376
+ xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */
377
+ const xmlChar *targetNamespace;
378
+ void *attrUses;
379
+ };
380
+
381
+ /**
382
+ * xmlSchemaTypeLink:
383
+ * Used to build a list of types (e.g. member types of
384
+ * simpleType with variety "union").
385
+ */
386
+ typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
387
+ typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
388
+ struct _xmlSchemaTypeLink {
389
+ struct _xmlSchemaTypeLink *next;/* the next type link ... */
390
+ xmlSchemaTypePtr type;/* the linked type */
391
+ };
392
+
393
+ /**
394
+ * xmlSchemaFacetLink:
395
+ * Used to build a list of facets.
396
+ */
397
+ typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
398
+ typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
399
+ struct _xmlSchemaFacetLink {
400
+ struct _xmlSchemaFacetLink *next;/* the next facet link ... */
401
+ xmlSchemaFacetPtr facet;/* the linked facet */
402
+ };
403
+
404
+ /**
405
+ * XML_SCHEMAS_TYPE_MIXED:
406
+ *
407
+ * the element content type is mixed
408
+ */
409
+ #define XML_SCHEMAS_TYPE_MIXED 1 << 0
410
+ /**
411
+ * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
412
+ *
413
+ * the simple or complex type has a derivation method of "extension".
414
+ */
415
+ #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1
416
+ /**
417
+ * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
418
+ *
419
+ * the simple or complex type has a derivation method of "restriction".
420
+ */
421
+ #define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2
422
+ /**
423
+ * XML_SCHEMAS_TYPE_GLOBAL:
424
+ *
425
+ * the type is global
426
+ */
427
+ #define XML_SCHEMAS_TYPE_GLOBAL 1 << 3
428
+ /**
429
+ * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
430
+ *
431
+ * the complexType owns an attribute wildcard, i.e.
432
+ * it can be freed by the complexType
433
+ */
434
+ #define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */
435
+ /**
436
+ * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
437
+ *
438
+ * the simpleType has a variety of "absent".
439
+ * TODO: Actually not necessary :-/, since if
440
+ * none of the variety flags occur then it's
441
+ * automatically absent.
442
+ */
443
+ #define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5
444
+ /**
445
+ * XML_SCHEMAS_TYPE_VARIETY_LIST:
446
+ *
447
+ * the simpleType has a variety of "list".
448
+ */
449
+ #define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6
450
+ /**
451
+ * XML_SCHEMAS_TYPE_VARIETY_UNION:
452
+ *
453
+ * the simpleType has a variety of "union".
454
+ */
455
+ #define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7
456
+ /**
457
+ * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
458
+ *
459
+ * the simpleType has a variety of "union".
460
+ */
461
+ #define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8
462
+ /**
463
+ * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
464
+ *
465
+ * the complexType has a final of "extension".
466
+ */
467
+ #define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9
468
+ /**
469
+ * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
470
+ *
471
+ * the simpleType/complexType has a final of "restriction".
472
+ */
473
+ #define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10
474
+ /**
475
+ * XML_SCHEMAS_TYPE_FINAL_LIST:
476
+ *
477
+ * the simpleType has a final of "list".
478
+ */
479
+ #define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11
480
+ /**
481
+ * XML_SCHEMAS_TYPE_FINAL_UNION:
482
+ *
483
+ * the simpleType has a final of "union".
484
+ */
485
+ #define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
486
+ /**
487
+ * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
488
+ *
489
+ * the simpleType has a final of "default".
490
+ */
491
+ #define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
492
+ /**
493
+ * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
494
+ *
495
+ * Marks the item as a builtin primitive.
496
+ */
497
+ #define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
498
+ /**
499
+ * XML_SCHEMAS_TYPE_MARKED:
500
+ *
501
+ * Marks the item as marked; used for circular checks.
502
+ */
503
+ #define XML_SCHEMAS_TYPE_MARKED 1 << 16
504
+ /**
505
+ * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
506
+ *
507
+ * the complexType did not specify 'block' so use the default of the
508
+ * <schema> item.
509
+ */
510
+ #define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17
511
+ /**
512
+ * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
513
+ *
514
+ * the complexType has a 'block' of "extension".
515
+ */
516
+ #define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18
517
+ /**
518
+ * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
519
+ *
520
+ * the complexType has a 'block' of "restriction".
521
+ */
522
+ #define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19
523
+ /**
524
+ * XML_SCHEMAS_TYPE_ABSTRACT:
525
+ *
526
+ * the simple/complexType is abstract.
527
+ */
528
+ #define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20
529
+ /**
530
+ * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
531
+ *
532
+ * indicates if the facets need a computed value
533
+ */
534
+ #define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21
535
+ /**
536
+ * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
537
+ *
538
+ * indicates that the type was typefixed
539
+ */
540
+ #define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22
541
+ /**
542
+ * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
543
+ *
544
+ * indicates that the type is invalid
545
+ */
546
+ #define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23
547
+ /**
548
+ * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
549
+ *
550
+ * a whitespace-facet value of "preserve"
551
+ */
552
+ #define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24
553
+ /**
554
+ * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
555
+ *
556
+ * a whitespace-facet value of "replace"
557
+ */
558
+ #define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25
559
+ /**
560
+ * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
561
+ *
562
+ * a whitespace-facet value of "collapse"
563
+ */
564
+ #define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26
565
+ /**
566
+ * XML_SCHEMAS_TYPE_HAS_FACETS:
567
+ *
568
+ * has facets
569
+ */
570
+ #define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27
571
+ /**
572
+ * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
573
+ *
574
+ * indicates if the facets (pattern) need a normalized value
575
+ */
576
+ #define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28
577
+
578
+ /**
579
+ * XML_SCHEMAS_TYPE_FIXUP_1:
580
+ *
581
+ * First stage of fixup was done.
582
+ */
583
+ #define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29
584
+
585
+ /**
586
+ * XML_SCHEMAS_TYPE_REDEFINED:
587
+ *
588
+ * The type was redefined.
589
+ */
590
+ #define XML_SCHEMAS_TYPE_REDEFINED 1 << 30
591
+ /**
592
+ * XML_SCHEMAS_TYPE_REDEFINING:
593
+ *
594
+ * The type redefines an other type.
595
+ */
596
+ /* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */
597
+
598
+ /**
599
+ * _xmlSchemaType:
600
+ *
601
+ * Schemas type definition.
602
+ */
603
+ struct _xmlSchemaType {
604
+ xmlSchemaTypeType type; /* The kind of type */
605
+ struct _xmlSchemaType *next; /* the next type if in a sequence ... */
606
+ const xmlChar *name;
607
+ const xmlChar *id ; /* Deprecated; not used */
608
+ const xmlChar *ref; /* Deprecated; not used */
609
+ const xmlChar *refNs; /* Deprecated; not used */
610
+ xmlSchemaAnnotPtr annot;
611
+ xmlSchemaTypePtr subtypes;
612
+ xmlSchemaAttributePtr attributes; /* Deprecated; not used */
613
+ xmlNodePtr node;
614
+ int minOccurs; /* Deprecated; not used */
615
+ int maxOccurs; /* Deprecated; not used */
616
+
617
+ int flags;
618
+ xmlSchemaContentType contentType;
619
+ const xmlChar *base; /* Base type's local name */
620
+ const xmlChar *baseNs; /* Base type's target namespace */
621
+ xmlSchemaTypePtr baseType; /* The base type component */
622
+ xmlSchemaFacetPtr facets; /* Local facets */
623
+ struct _xmlSchemaType *redef; /* Deprecated; not used */
624
+ int recurse; /* Obsolete */
625
+ xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */
626
+ xmlSchemaWildcardPtr attributeWildcard;
627
+ int builtInType; /* Type of built-in types. */
628
+ xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */
629
+ xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */
630
+ const xmlChar *refPrefix; /* Deprecated; not used */
631
+ xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.
632
+ Could we use @subtypes for this? */
633
+ xmlRegexpPtr contModel; /* Holds the automaton of the content model */
634
+ const xmlChar *targetNamespace;
635
+ void *attrUses;
636
+ };
637
+
638
+ /*
639
+ * xmlSchemaElement:
640
+ * An element definition.
641
+ *
642
+ * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
643
+ * structures must be kept similar
644
+ */
645
+ /**
646
+ * XML_SCHEMAS_ELEM_NILLABLE:
647
+ *
648
+ * the element is nillable
649
+ */
650
+ #define XML_SCHEMAS_ELEM_NILLABLE 1 << 0
651
+ /**
652
+ * XML_SCHEMAS_ELEM_GLOBAL:
653
+ *
654
+ * the element is global
655
+ */
656
+ #define XML_SCHEMAS_ELEM_GLOBAL 1 << 1
657
+ /**
658
+ * XML_SCHEMAS_ELEM_DEFAULT:
659
+ *
660
+ * the element has a default value
661
+ */
662
+ #define XML_SCHEMAS_ELEM_DEFAULT 1 << 2
663
+ /**
664
+ * XML_SCHEMAS_ELEM_FIXED:
665
+ *
666
+ * the element has a fixed value
667
+ */
668
+ #define XML_SCHEMAS_ELEM_FIXED 1 << 3
669
+ /**
670
+ * XML_SCHEMAS_ELEM_ABSTRACT:
671
+ *
672
+ * the element is abstract
673
+ */
674
+ #define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4
675
+ /**
676
+ * XML_SCHEMAS_ELEM_TOPLEVEL:
677
+ *
678
+ * the element is top level
679
+ * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
680
+ */
681
+ #define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5
682
+ /**
683
+ * XML_SCHEMAS_ELEM_REF:
684
+ *
685
+ * the element is a reference to a type
686
+ */
687
+ #define XML_SCHEMAS_ELEM_REF 1 << 6
688
+ /**
689
+ * XML_SCHEMAS_ELEM_NSDEFAULT:
690
+ *
691
+ * allow elements in no namespace
692
+ * Obsolete, not used anymore.
693
+ */
694
+ #define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
695
+ /**
696
+ * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
697
+ *
698
+ * this is set when "type", "ref", "substitutionGroup"
699
+ * references have been resolved.
700
+ */
701
+ #define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
702
+ /**
703
+ * XML_SCHEMAS_ELEM_CIRCULAR:
704
+ *
705
+ * a helper flag for the search of circular references.
706
+ */
707
+ #define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
708
+ /**
709
+ * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
710
+ *
711
+ * the "block" attribute is absent
712
+ */
713
+ #define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
714
+ /**
715
+ * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
716
+ *
717
+ * disallowed substitutions are absent
718
+ */
719
+ #define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
720
+ /**
721
+ * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
722
+ *
723
+ * disallowed substitutions: "restriction"
724
+ */
725
+ #define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
726
+ /**
727
+ * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
728
+ *
729
+ * disallowed substitutions: "substitution"
730
+ */
731
+ #define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
732
+ /**
733
+ * XML_SCHEMAS_ELEM_FINAL_ABSENT:
734
+ *
735
+ * substitution group exclusions are absent
736
+ */
737
+ #define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
738
+ /**
739
+ * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
740
+ *
741
+ * substitution group exclusions: "extension"
742
+ */
743
+ #define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
744
+ /**
745
+ * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
746
+ *
747
+ * substitution group exclusions: "restriction"
748
+ */
749
+ #define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
750
+ /**
751
+ * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
752
+ *
753
+ * the declaration is a substitution group head
754
+ */
755
+ #define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17
756
+ /**
757
+ * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
758
+ *
759
+ * this is set when the elem decl has been checked against
760
+ * all constraints
761
+ */
762
+ #define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18
763
+
764
+ typedef struct _xmlSchemaElement xmlSchemaElement;
765
+ typedef xmlSchemaElement *xmlSchemaElementPtr;
766
+ struct _xmlSchemaElement {
767
+ xmlSchemaTypeType type; /* The kind of type */
768
+ struct _xmlSchemaType *next; /* Not used? */
769
+ const xmlChar *name;
770
+ const xmlChar *id; /* Deprecated; not used */
771
+ const xmlChar *ref; /* Deprecated; not used */
772
+ const xmlChar *refNs; /* Deprecated; not used */
773
+ xmlSchemaAnnotPtr annot;
774
+ xmlSchemaTypePtr subtypes; /* the type definition */
775
+ xmlSchemaAttributePtr attributes;
776
+ xmlNodePtr node;
777
+ int minOccurs; /* Deprecated; not used */
778
+ int maxOccurs; /* Deprecated; not used */
779
+
780
+ int flags;
781
+ const xmlChar *targetNamespace;
782
+ const xmlChar *namedType;
783
+ const xmlChar *namedTypeNs;
784
+ const xmlChar *substGroup;
785
+ const xmlChar *substGroupNs;
786
+ const xmlChar *scope;
787
+ const xmlChar *value; /* The original value of the value constraint. */
788
+ struct _xmlSchemaElement *refDecl; /* This will now be used for the
789
+ substitution group affiliation */
790
+ xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */
791
+ xmlSchemaContentType contentType;
792
+ const xmlChar *refPrefix; /* Deprecated; not used */
793
+ xmlSchemaValPtr defVal; /* The compiled value constraint. */
794
+ void *idcs; /* The identity-constraint defs */
795
+ };
796
+
797
+ /*
798
+ * XML_SCHEMAS_FACET_UNKNOWN:
799
+ *
800
+ * unknown facet handling
801
+ */
802
+ #define XML_SCHEMAS_FACET_UNKNOWN 0
803
+ /*
804
+ * XML_SCHEMAS_FACET_PRESERVE:
805
+ *
806
+ * preserve the type of the facet
807
+ */
808
+ #define XML_SCHEMAS_FACET_PRESERVE 1
809
+ /*
810
+ * XML_SCHEMAS_FACET_REPLACE:
811
+ *
812
+ * replace the type of the facet
813
+ */
814
+ #define XML_SCHEMAS_FACET_REPLACE 2
815
+ /*
816
+ * XML_SCHEMAS_FACET_COLLAPSE:
817
+ *
818
+ * collapse the types of the facet
819
+ */
820
+ #define XML_SCHEMAS_FACET_COLLAPSE 3
821
+ /**
822
+ * A facet definition.
823
+ */
824
+ struct _xmlSchemaFacet {
825
+ xmlSchemaTypeType type; /* The kind of type */
826
+ struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
827
+ const xmlChar *value; /* The original value */
828
+ const xmlChar *id; /* Obsolete */
829
+ xmlSchemaAnnotPtr annot;
830
+ xmlNodePtr node;
831
+ int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */
832
+ int whitespace;
833
+ xmlSchemaValPtr val; /* The compiled value */
834
+ xmlRegexpPtr regexp; /* The regex for patterns */
835
+ };
836
+
837
+ /**
838
+ * A notation definition.
839
+ */
840
+ typedef struct _xmlSchemaNotation xmlSchemaNotation;
841
+ typedef xmlSchemaNotation *xmlSchemaNotationPtr;
842
+ struct _xmlSchemaNotation {
843
+ xmlSchemaTypeType type; /* The kind of type */
844
+ const xmlChar *name;
845
+ xmlSchemaAnnotPtr annot;
846
+ const xmlChar *identifier;
847
+ const xmlChar *targetNamespace;
848
+ };
849
+
850
+ /*
851
+ * TODO: Actually all those flags used for the schema should sit
852
+ * on the schema parser context, since they are used only
853
+ * during parsing an XML schema document, and not available
854
+ * on the component level as per spec.
855
+ */
856
+ /**
857
+ * XML_SCHEMAS_QUALIF_ELEM:
858
+ *
859
+ * Reflects elementFormDefault == qualified in
860
+ * an XML schema document.
861
+ */
862
+ #define XML_SCHEMAS_QUALIF_ELEM 1 << 0
863
+ /**
864
+ * XML_SCHEMAS_QUALIF_ATTR:
865
+ *
866
+ * Reflects attributeFormDefault == qualified in
867
+ * an XML schema document.
868
+ */
869
+ #define XML_SCHEMAS_QUALIF_ATTR 1 << 1
870
+ /**
871
+ * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
872
+ *
873
+ * the schema has "extension" in the set of finalDefault.
874
+ */
875
+ #define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2
876
+ /**
877
+ * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
878
+ *
879
+ * the schema has "restriction" in the set of finalDefault.
880
+ */
881
+ #define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3
882
+ /**
883
+ * XML_SCHEMAS_FINAL_DEFAULT_LIST:
884
+ *
885
+ * the schema has "list" in the set of finalDefault.
886
+ */
887
+ #define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4
888
+ /**
889
+ * XML_SCHEMAS_FINAL_DEFAULT_UNION:
890
+ *
891
+ * the schema has "union" in the set of finalDefault.
892
+ */
893
+ #define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5
894
+ /**
895
+ * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
896
+ *
897
+ * the schema has "extension" in the set of blockDefault.
898
+ */
899
+ #define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6
900
+ /**
901
+ * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
902
+ *
903
+ * the schema has "restriction" in the set of blockDefault.
904
+ */
905
+ #define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7
906
+ /**
907
+ * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
908
+ *
909
+ * the schema has "substitution" in the set of blockDefault.
910
+ */
911
+ #define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8
912
+ /**
913
+ * XML_SCHEMAS_INCLUDING_CONVERT_NS:
914
+ *
915
+ * the schema is currently including an other schema with
916
+ * no target namespace.
917
+ */
918
+ #define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9
919
+ /**
920
+ * _xmlSchema:
921
+ *
922
+ * A Schemas definition
923
+ */
924
+ struct _xmlSchema {
925
+ const xmlChar *name; /* schema name */
926
+ const xmlChar *targetNamespace; /* the target namespace */
927
+ const xmlChar *version;
928
+ const xmlChar *id; /* Obsolete */
929
+ xmlDocPtr doc;
930
+ xmlSchemaAnnotPtr annot;
931
+ int flags;
932
+
933
+ xmlHashTablePtr typeDecl;
934
+ xmlHashTablePtr attrDecl;
935
+ xmlHashTablePtr attrgrpDecl;
936
+ xmlHashTablePtr elemDecl;
937
+ xmlHashTablePtr notaDecl;
938
+
939
+ xmlHashTablePtr schemasImports;
940
+
941
+ void *_private; /* unused by the library for users or bindings */
942
+ xmlHashTablePtr groupDecl;
943
+ xmlDictPtr dict;
944
+ void *includes; /* the includes, this is opaque for now */
945
+ int preserve; /* whether to free the document */
946
+ int counter; /* used to give anonymous components unique names */
947
+ xmlHashTablePtr idcDef; /* All identity-constraint defs. */
948
+ void *volatiles; /* Obsolete */
949
+ };
950
+
951
+ XMLPUBFUN void xmlSchemaFreeType (xmlSchemaTypePtr type);
952
+ XMLPUBFUN void xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
953
+
954
+ #ifdef __cplusplus
955
+ }
956
+ #endif
957
+
958
+ #endif /* LIBXML_SCHEMAS_ENABLED */
959
+ #endif /* __XML_SCHEMA_INTERNALS_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/threads.h ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Summary: interfaces for thread handling
3
+ * Description: set of generic threading related routines
4
+ * should work with pthreads, Windows native or TLS threads
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_THREADS_H__
12
+ #define __XML_THREADS_H__
13
+
14
+ #include <libxml/xmlversion.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ /*
21
+ * xmlMutex are a simple mutual exception locks.
22
+ */
23
+ typedef struct _xmlMutex xmlMutex;
24
+ typedef xmlMutex *xmlMutexPtr;
25
+
26
+ /*
27
+ * xmlRMutex are reentrant mutual exception locks.
28
+ */
29
+ typedef struct _xmlRMutex xmlRMutex;
30
+ typedef xmlRMutex *xmlRMutexPtr;
31
+
32
+ XMLPUBFUN int
33
+ xmlCheckThreadLocalStorage(void);
34
+
35
+ XMLPUBFUN xmlMutexPtr
36
+ xmlNewMutex (void);
37
+ XMLPUBFUN void
38
+ xmlMutexLock (xmlMutexPtr tok);
39
+ XMLPUBFUN void
40
+ xmlMutexUnlock (xmlMutexPtr tok);
41
+ XMLPUBFUN void
42
+ xmlFreeMutex (xmlMutexPtr tok);
43
+
44
+ XMLPUBFUN xmlRMutexPtr
45
+ xmlNewRMutex (void);
46
+ XMLPUBFUN void
47
+ xmlRMutexLock (xmlRMutexPtr tok);
48
+ XMLPUBFUN void
49
+ xmlRMutexUnlock (xmlRMutexPtr tok);
50
+ XMLPUBFUN void
51
+ xmlFreeRMutex (xmlRMutexPtr tok);
52
+
53
+ /*
54
+ * Library wide APIs.
55
+ */
56
+ XML_DEPRECATED
57
+ XMLPUBFUN void
58
+ xmlInitThreads (void);
59
+ XMLPUBFUN void
60
+ xmlLockLibrary (void);
61
+ XMLPUBFUN void
62
+ xmlUnlockLibrary(void);
63
+ XML_DEPRECATED
64
+ XMLPUBFUN int
65
+ xmlGetThreadId (void);
66
+ XML_DEPRECATED
67
+ XMLPUBFUN int
68
+ xmlIsMainThread (void);
69
+ XML_DEPRECATED
70
+ XMLPUBFUN void
71
+ xmlCleanupThreads(void);
72
+
73
+ /** DOC_DISABLE */
74
+ #if defined(LIBXML_THREAD_ENABLED) && defined(_WIN32) && \
75
+ defined(LIBXML_STATIC_FOR_DLL)
76
+ int
77
+ xmlDllMain(void *hinstDLL, unsigned long fdwReason,
78
+ void *lpvReserved);
79
+ #endif
80
+ /** DOC_ENABLE */
81
+
82
+ #ifdef __cplusplus
83
+ }
84
+ #endif
85
+
86
+
87
+ #endif /* __XML_THREADS_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/valid.h ADDED
@@ -0,0 +1,450 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: The DTD validation
3
+ * Description: API for the DTD handling and the validity checking
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+
11
+ #ifndef __XML_VALID_H__
12
+ #define __XML_VALID_H__
13
+
14
+ #include <libxml/xmlversion.h>
15
+ #include <libxml/xmlerror.h>
16
+ #define XML_TREE_INTERNALS
17
+ #include <libxml/tree.h>
18
+ #undef XML_TREE_INTERNALS
19
+ #include <libxml/list.h>
20
+ #include <libxml/xmlautomata.h>
21
+ #include <libxml/xmlregexp.h>
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ /*
28
+ * Validation state added for non-determinist content model.
29
+ */
30
+ typedef struct _xmlValidState xmlValidState;
31
+ typedef xmlValidState *xmlValidStatePtr;
32
+
33
+ /**
34
+ * xmlValidityErrorFunc:
35
+ * @ctx: usually an xmlValidCtxtPtr to a validity error context,
36
+ * but comes from ctxt->userData (which normally contains such
37
+ * a pointer); ctxt->userData can be changed by the user.
38
+ * @msg: the string to format *printf like vararg
39
+ * @...: remaining arguments to the format
40
+ *
41
+ * Callback called when a validity error is found. This is a message
42
+ * oriented function similar to an *printf function.
43
+ */
44
+ typedef void (*xmlValidityErrorFunc) (void *ctx,
45
+ const char *msg,
46
+ ...) LIBXML_ATTR_FORMAT(2,3);
47
+
48
+ /**
49
+ * xmlValidityWarningFunc:
50
+ * @ctx: usually an xmlValidCtxtPtr to a validity error context,
51
+ * but comes from ctxt->userData (which normally contains such
52
+ * a pointer); ctxt->userData can be changed by the user.
53
+ * @msg: the string to format *printf like vararg
54
+ * @...: remaining arguments to the format
55
+ *
56
+ * Callback called when a validity warning is found. This is a message
57
+ * oriented function similar to an *printf function.
58
+ */
59
+ typedef void (*xmlValidityWarningFunc) (void *ctx,
60
+ const char *msg,
61
+ ...) LIBXML_ATTR_FORMAT(2,3);
62
+
63
+ /*
64
+ * xmlValidCtxt:
65
+ * An xmlValidCtxt is used for error reporting when validating.
66
+ */
67
+ typedef struct _xmlValidCtxt xmlValidCtxt;
68
+ typedef xmlValidCtxt *xmlValidCtxtPtr;
69
+ struct _xmlValidCtxt {
70
+ void *userData; /* user specific data block */
71
+ xmlValidityErrorFunc error; /* the callback in case of errors */
72
+ xmlValidityWarningFunc warning; /* the callback in case of warning */
73
+
74
+ /* Node analysis stack used when validating within entities */
75
+ xmlNodePtr node; /* Current parsed Node */
76
+ int nodeNr; /* Depth of the parsing stack */
77
+ int nodeMax; /* Max depth of the parsing stack */
78
+ xmlNodePtr *nodeTab; /* array of nodes */
79
+
80
+ unsigned int flags; /* internal flags */
81
+ xmlDocPtr doc; /* the document */
82
+ int valid; /* temporary validity check result */
83
+
84
+ /* state state used for non-determinist content validation */
85
+ xmlValidState *vstate; /* current state */
86
+ int vstateNr; /* Depth of the validation stack */
87
+ int vstateMax; /* Max depth of the validation stack */
88
+ xmlValidState *vstateTab; /* array of validation states */
89
+
90
+ #ifdef LIBXML_REGEXP_ENABLED
91
+ xmlAutomataPtr am; /* the automata */
92
+ xmlAutomataStatePtr state; /* used to build the automata */
93
+ #else
94
+ void *am;
95
+ void *state;
96
+ #endif
97
+ };
98
+
99
+ /*
100
+ * ALL notation declarations are stored in a table.
101
+ * There is one table per DTD.
102
+ */
103
+
104
+ typedef struct _xmlHashTable xmlNotationTable;
105
+ typedef xmlNotationTable *xmlNotationTablePtr;
106
+
107
+ /*
108
+ * ALL element declarations are stored in a table.
109
+ * There is one table per DTD.
110
+ */
111
+
112
+ typedef struct _xmlHashTable xmlElementTable;
113
+ typedef xmlElementTable *xmlElementTablePtr;
114
+
115
+ /*
116
+ * ALL attribute declarations are stored in a table.
117
+ * There is one table per DTD.
118
+ */
119
+
120
+ typedef struct _xmlHashTable xmlAttributeTable;
121
+ typedef xmlAttributeTable *xmlAttributeTablePtr;
122
+
123
+ /*
124
+ * ALL IDs attributes are stored in a table.
125
+ * There is one table per document.
126
+ */
127
+
128
+ typedef struct _xmlHashTable xmlIDTable;
129
+ typedef xmlIDTable *xmlIDTablePtr;
130
+
131
+ /*
132
+ * ALL Refs attributes are stored in a table.
133
+ * There is one table per document.
134
+ */
135
+
136
+ typedef struct _xmlHashTable xmlRefTable;
137
+ typedef xmlRefTable *xmlRefTablePtr;
138
+
139
+ /* Notation */
140
+ XMLPUBFUN xmlNotationPtr
141
+ xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
142
+ xmlDtdPtr dtd,
143
+ const xmlChar *name,
144
+ const xmlChar *PublicID,
145
+ const xmlChar *SystemID);
146
+ #ifdef LIBXML_TREE_ENABLED
147
+ XMLPUBFUN xmlNotationTablePtr
148
+ xmlCopyNotationTable (xmlNotationTablePtr table);
149
+ #endif /* LIBXML_TREE_ENABLED */
150
+ XMLPUBFUN void
151
+ xmlFreeNotationTable (xmlNotationTablePtr table);
152
+ #ifdef LIBXML_OUTPUT_ENABLED
153
+ XMLPUBFUN void
154
+ xmlDumpNotationDecl (xmlBufferPtr buf,
155
+ xmlNotationPtr nota);
156
+ XMLPUBFUN void
157
+ xmlDumpNotationTable (xmlBufferPtr buf,
158
+ xmlNotationTablePtr table);
159
+ #endif /* LIBXML_OUTPUT_ENABLED */
160
+
161
+ /* Element Content */
162
+ /* the non Doc version are being deprecated */
163
+ XMLPUBFUN xmlElementContentPtr
164
+ xmlNewElementContent (const xmlChar *name,
165
+ xmlElementContentType type);
166
+ XMLPUBFUN xmlElementContentPtr
167
+ xmlCopyElementContent (xmlElementContentPtr content);
168
+ XMLPUBFUN void
169
+ xmlFreeElementContent (xmlElementContentPtr cur);
170
+ /* the new versions with doc argument */
171
+ XMLPUBFUN xmlElementContentPtr
172
+ xmlNewDocElementContent (xmlDocPtr doc,
173
+ const xmlChar *name,
174
+ xmlElementContentType type);
175
+ XMLPUBFUN xmlElementContentPtr
176
+ xmlCopyDocElementContent(xmlDocPtr doc,
177
+ xmlElementContentPtr content);
178
+ XMLPUBFUN void
179
+ xmlFreeDocElementContent(xmlDocPtr doc,
180
+ xmlElementContentPtr cur);
181
+ XMLPUBFUN void
182
+ xmlSnprintfElementContent(char *buf,
183
+ int size,
184
+ xmlElementContentPtr content,
185
+ int englob);
186
+ #ifdef LIBXML_OUTPUT_ENABLED
187
+ /* DEPRECATED */
188
+ XMLPUBFUN void
189
+ xmlSprintfElementContent(char *buf,
190
+ xmlElementContentPtr content,
191
+ int englob);
192
+ #endif /* LIBXML_OUTPUT_ENABLED */
193
+ /* DEPRECATED */
194
+
195
+ /* Element */
196
+ XMLPUBFUN xmlElementPtr
197
+ xmlAddElementDecl (xmlValidCtxtPtr ctxt,
198
+ xmlDtdPtr dtd,
199
+ const xmlChar *name,
200
+ xmlElementTypeVal type,
201
+ xmlElementContentPtr content);
202
+ #ifdef LIBXML_TREE_ENABLED
203
+ XMLPUBFUN xmlElementTablePtr
204
+ xmlCopyElementTable (xmlElementTablePtr table);
205
+ #endif /* LIBXML_TREE_ENABLED */
206
+ XMLPUBFUN void
207
+ xmlFreeElementTable (xmlElementTablePtr table);
208
+ #ifdef LIBXML_OUTPUT_ENABLED
209
+ XMLPUBFUN void
210
+ xmlDumpElementTable (xmlBufferPtr buf,
211
+ xmlElementTablePtr table);
212
+ XMLPUBFUN void
213
+ xmlDumpElementDecl (xmlBufferPtr buf,
214
+ xmlElementPtr elem);
215
+ #endif /* LIBXML_OUTPUT_ENABLED */
216
+
217
+ /* Enumeration */
218
+ XMLPUBFUN xmlEnumerationPtr
219
+ xmlCreateEnumeration (const xmlChar *name);
220
+ XMLPUBFUN void
221
+ xmlFreeEnumeration (xmlEnumerationPtr cur);
222
+ #ifdef LIBXML_TREE_ENABLED
223
+ XMLPUBFUN xmlEnumerationPtr
224
+ xmlCopyEnumeration (xmlEnumerationPtr cur);
225
+ #endif /* LIBXML_TREE_ENABLED */
226
+
227
+ /* Attribute */
228
+ XMLPUBFUN xmlAttributePtr
229
+ xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
230
+ xmlDtdPtr dtd,
231
+ const xmlChar *elem,
232
+ const xmlChar *name,
233
+ const xmlChar *ns,
234
+ xmlAttributeType type,
235
+ xmlAttributeDefault def,
236
+ const xmlChar *defaultValue,
237
+ xmlEnumerationPtr tree);
238
+ #ifdef LIBXML_TREE_ENABLED
239
+ XMLPUBFUN xmlAttributeTablePtr
240
+ xmlCopyAttributeTable (xmlAttributeTablePtr table);
241
+ #endif /* LIBXML_TREE_ENABLED */
242
+ XMLPUBFUN void
243
+ xmlFreeAttributeTable (xmlAttributeTablePtr table);
244
+ #ifdef LIBXML_OUTPUT_ENABLED
245
+ XMLPUBFUN void
246
+ xmlDumpAttributeTable (xmlBufferPtr buf,
247
+ xmlAttributeTablePtr table);
248
+ XMLPUBFUN void
249
+ xmlDumpAttributeDecl (xmlBufferPtr buf,
250
+ xmlAttributePtr attr);
251
+ #endif /* LIBXML_OUTPUT_ENABLED */
252
+
253
+ /* IDs */
254
+ XMLPUBFUN xmlIDPtr
255
+ xmlAddID (xmlValidCtxtPtr ctxt,
256
+ xmlDocPtr doc,
257
+ const xmlChar *value,
258
+ xmlAttrPtr attr);
259
+ XMLPUBFUN void
260
+ xmlFreeIDTable (xmlIDTablePtr table);
261
+ XMLPUBFUN xmlAttrPtr
262
+ xmlGetID (xmlDocPtr doc,
263
+ const xmlChar *ID);
264
+ XMLPUBFUN int
265
+ xmlIsID (xmlDocPtr doc,
266
+ xmlNodePtr elem,
267
+ xmlAttrPtr attr);
268
+ XMLPUBFUN int
269
+ xmlRemoveID (xmlDocPtr doc,
270
+ xmlAttrPtr attr);
271
+
272
+ /* IDREFs */
273
+ XML_DEPRECATED
274
+ XMLPUBFUN xmlRefPtr
275
+ xmlAddRef (xmlValidCtxtPtr ctxt,
276
+ xmlDocPtr doc,
277
+ const xmlChar *value,
278
+ xmlAttrPtr attr);
279
+ XML_DEPRECATED
280
+ XMLPUBFUN void
281
+ xmlFreeRefTable (xmlRefTablePtr table);
282
+ XML_DEPRECATED
283
+ XMLPUBFUN int
284
+ xmlIsRef (xmlDocPtr doc,
285
+ xmlNodePtr elem,
286
+ xmlAttrPtr attr);
287
+ XML_DEPRECATED
288
+ XMLPUBFUN int
289
+ xmlRemoveRef (xmlDocPtr doc,
290
+ xmlAttrPtr attr);
291
+ XML_DEPRECATED
292
+ XMLPUBFUN xmlListPtr
293
+ xmlGetRefs (xmlDocPtr doc,
294
+ const xmlChar *ID);
295
+
296
+ /**
297
+ * The public function calls related to validity checking.
298
+ */
299
+ #ifdef LIBXML_VALID_ENABLED
300
+ /* Allocate/Release Validation Contexts */
301
+ XMLPUBFUN xmlValidCtxtPtr
302
+ xmlNewValidCtxt(void);
303
+ XMLPUBFUN void
304
+ xmlFreeValidCtxt(xmlValidCtxtPtr);
305
+
306
+ XMLPUBFUN int
307
+ xmlValidateRoot (xmlValidCtxtPtr ctxt,
308
+ xmlDocPtr doc);
309
+ XMLPUBFUN int
310
+ xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
311
+ xmlDocPtr doc,
312
+ xmlElementPtr elem);
313
+ XMLPUBFUN xmlChar *
314
+ xmlValidNormalizeAttributeValue(xmlDocPtr doc,
315
+ xmlNodePtr elem,
316
+ const xmlChar *name,
317
+ const xmlChar *value);
318
+ XMLPUBFUN xmlChar *
319
+ xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
320
+ xmlDocPtr doc,
321
+ xmlNodePtr elem,
322
+ const xmlChar *name,
323
+ const xmlChar *value);
324
+ XMLPUBFUN int
325
+ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
326
+ xmlDocPtr doc,
327
+ xmlAttributePtr attr);
328
+ XMLPUBFUN int
329
+ xmlValidateAttributeValue(xmlAttributeType type,
330
+ const xmlChar *value);
331
+ XMLPUBFUN int
332
+ xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
333
+ xmlDocPtr doc,
334
+ xmlNotationPtr nota);
335
+ XMLPUBFUN int
336
+ xmlValidateDtd (xmlValidCtxtPtr ctxt,
337
+ xmlDocPtr doc,
338
+ xmlDtdPtr dtd);
339
+ XMLPUBFUN int
340
+ xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
341
+ xmlDocPtr doc);
342
+ XMLPUBFUN int
343
+ xmlValidateDocument (xmlValidCtxtPtr ctxt,
344
+ xmlDocPtr doc);
345
+ XMLPUBFUN int
346
+ xmlValidateElement (xmlValidCtxtPtr ctxt,
347
+ xmlDocPtr doc,
348
+ xmlNodePtr elem);
349
+ XMLPUBFUN int
350
+ xmlValidateOneElement (xmlValidCtxtPtr ctxt,
351
+ xmlDocPtr doc,
352
+ xmlNodePtr elem);
353
+ XMLPUBFUN int
354
+ xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
355
+ xmlDocPtr doc,
356
+ xmlNodePtr elem,
357
+ xmlAttrPtr attr,
358
+ const xmlChar *value);
359
+ XMLPUBFUN int
360
+ xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
361
+ xmlDocPtr doc,
362
+ xmlNodePtr elem,
363
+ const xmlChar *prefix,
364
+ xmlNsPtr ns,
365
+ const xmlChar *value);
366
+ XMLPUBFUN int
367
+ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
368
+ xmlDocPtr doc);
369
+ #endif /* LIBXML_VALID_ENABLED */
370
+
371
+ #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
372
+ XMLPUBFUN int
373
+ xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
374
+ xmlDocPtr doc,
375
+ const xmlChar *notationName);
376
+ #endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
377
+
378
+ XMLPUBFUN int
379
+ xmlIsMixedElement (xmlDocPtr doc,
380
+ const xmlChar *name);
381
+ XMLPUBFUN xmlAttributePtr
382
+ xmlGetDtdAttrDesc (xmlDtdPtr dtd,
383
+ const xmlChar *elem,
384
+ const xmlChar *name);
385
+ XMLPUBFUN xmlAttributePtr
386
+ xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
387
+ const xmlChar *elem,
388
+ const xmlChar *name,
389
+ const xmlChar *prefix);
390
+ XMLPUBFUN xmlNotationPtr
391
+ xmlGetDtdNotationDesc (xmlDtdPtr dtd,
392
+ const xmlChar *name);
393
+ XMLPUBFUN xmlElementPtr
394
+ xmlGetDtdQElementDesc (xmlDtdPtr dtd,
395
+ const xmlChar *name,
396
+ const xmlChar *prefix);
397
+ XMLPUBFUN xmlElementPtr
398
+ xmlGetDtdElementDesc (xmlDtdPtr dtd,
399
+ const xmlChar *name);
400
+
401
+ #ifdef LIBXML_VALID_ENABLED
402
+
403
+ XMLPUBFUN int
404
+ xmlValidGetPotentialChildren(xmlElementContent *ctree,
405
+ const xmlChar **names,
406
+ int *len,
407
+ int max);
408
+
409
+ XMLPUBFUN int
410
+ xmlValidGetValidElements(xmlNode *prev,
411
+ xmlNode *next,
412
+ const xmlChar **names,
413
+ int max);
414
+ XMLPUBFUN int
415
+ xmlValidateNameValue (const xmlChar *value);
416
+ XMLPUBFUN int
417
+ xmlValidateNamesValue (const xmlChar *value);
418
+ XMLPUBFUN int
419
+ xmlValidateNmtokenValue (const xmlChar *value);
420
+ XMLPUBFUN int
421
+ xmlValidateNmtokensValue(const xmlChar *value);
422
+
423
+ #ifdef LIBXML_REGEXP_ENABLED
424
+ /*
425
+ * Validation based on the regexp support
426
+ */
427
+ XMLPUBFUN int
428
+ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
429
+ xmlElementPtr elem);
430
+
431
+ XMLPUBFUN int
432
+ xmlValidatePushElement (xmlValidCtxtPtr ctxt,
433
+ xmlDocPtr doc,
434
+ xmlNodePtr elem,
435
+ const xmlChar *qname);
436
+ XMLPUBFUN int
437
+ xmlValidatePushCData (xmlValidCtxtPtr ctxt,
438
+ const xmlChar *data,
439
+ int len);
440
+ XMLPUBFUN int
441
+ xmlValidatePopElement (xmlValidCtxtPtr ctxt,
442
+ xmlDocPtr doc,
443
+ xmlNodePtr elem,
444
+ const xmlChar *qname);
445
+ #endif /* LIBXML_REGEXP_ENABLED */
446
+ #endif /* LIBXML_VALID_ENABLED */
447
+ #ifdef __cplusplus
448
+ }
449
+ #endif
450
+ #endif /* __XML_VALID_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/xlink.h ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: unfinished XLink detection module
3
+ * Description: unfinished XLink detection module
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XLINK_H__
11
+ #define __XML_XLINK_H__
12
+
13
+ #include <libxml/xmlversion.h>
14
+ #include <libxml/tree.h>
15
+
16
+ #ifdef LIBXML_XPTR_ENABLED
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * Various defines for the various Link properties.
24
+ *
25
+ * NOTE: the link detection layer will try to resolve QName expansion
26
+ * of namespaces. If "foo" is the prefix for "http://foo.com/"
27
+ * then the link detection layer will expand role="foo:myrole"
28
+ * to "http://foo.com/:myrole".
29
+ * NOTE: the link detection layer will expand URI-References found on
30
+ * href attributes by using the base mechanism if found.
31
+ */
32
+ typedef xmlChar *xlinkHRef;
33
+ typedef xmlChar *xlinkRole;
34
+ typedef xmlChar *xlinkTitle;
35
+
36
+ typedef enum {
37
+ XLINK_TYPE_NONE = 0,
38
+ XLINK_TYPE_SIMPLE,
39
+ XLINK_TYPE_EXTENDED,
40
+ XLINK_TYPE_EXTENDED_SET
41
+ } xlinkType;
42
+
43
+ typedef enum {
44
+ XLINK_SHOW_NONE = 0,
45
+ XLINK_SHOW_NEW,
46
+ XLINK_SHOW_EMBED,
47
+ XLINK_SHOW_REPLACE
48
+ } xlinkShow;
49
+
50
+ typedef enum {
51
+ XLINK_ACTUATE_NONE = 0,
52
+ XLINK_ACTUATE_AUTO,
53
+ XLINK_ACTUATE_ONREQUEST
54
+ } xlinkActuate;
55
+
56
+ /**
57
+ * xlinkNodeDetectFunc:
58
+ * @ctx: user data pointer
59
+ * @node: the node to check
60
+ *
61
+ * This is the prototype for the link detection routine.
62
+ * It calls the default link detection callbacks upon link detection.
63
+ */
64
+ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
65
+
66
+ /*
67
+ * The link detection module interact with the upper layers using
68
+ * a set of callback registered at parsing time.
69
+ */
70
+
71
+ /**
72
+ * xlinkSimpleLinkFunk:
73
+ * @ctx: user data pointer
74
+ * @node: the node carrying the link
75
+ * @href: the target of the link
76
+ * @role: the role string
77
+ * @title: the link title
78
+ *
79
+ * This is the prototype for a simple link detection callback.
80
+ */
81
+ typedef void
82
+ (*xlinkSimpleLinkFunk) (void *ctx,
83
+ xmlNodePtr node,
84
+ const xlinkHRef href,
85
+ const xlinkRole role,
86
+ const xlinkTitle title);
87
+
88
+ /**
89
+ * xlinkExtendedLinkFunk:
90
+ * @ctx: user data pointer
91
+ * @node: the node carrying the link
92
+ * @nbLocators: the number of locators detected on the link
93
+ * @hrefs: pointer to the array of locator hrefs
94
+ * @roles: pointer to the array of locator roles
95
+ * @nbArcs: the number of arcs detected on the link
96
+ * @from: pointer to the array of source roles found on the arcs
97
+ * @to: pointer to the array of target roles found on the arcs
98
+ * @show: array of values for the show attributes found on the arcs
99
+ * @actuate: array of values for the actuate attributes found on the arcs
100
+ * @nbTitles: the number of titles detected on the link
101
+ * @title: array of titles detected on the link
102
+ * @langs: array of xml:lang values for the titles
103
+ *
104
+ * This is the prototype for a extended link detection callback.
105
+ */
106
+ typedef void
107
+ (*xlinkExtendedLinkFunk)(void *ctx,
108
+ xmlNodePtr node,
109
+ int nbLocators,
110
+ const xlinkHRef *hrefs,
111
+ const xlinkRole *roles,
112
+ int nbArcs,
113
+ const xlinkRole *from,
114
+ const xlinkRole *to,
115
+ xlinkShow *show,
116
+ xlinkActuate *actuate,
117
+ int nbTitles,
118
+ const xlinkTitle *titles,
119
+ const xmlChar **langs);
120
+
121
+ /**
122
+ * xlinkExtendedLinkSetFunk:
123
+ * @ctx: user data pointer
124
+ * @node: the node carrying the link
125
+ * @nbLocators: the number of locators detected on the link
126
+ * @hrefs: pointer to the array of locator hrefs
127
+ * @roles: pointer to the array of locator roles
128
+ * @nbTitles: the number of titles detected on the link
129
+ * @title: array of titles detected on the link
130
+ * @langs: array of xml:lang values for the titles
131
+ *
132
+ * This is the prototype for a extended link set detection callback.
133
+ */
134
+ typedef void
135
+ (*xlinkExtendedLinkSetFunk) (void *ctx,
136
+ xmlNodePtr node,
137
+ int nbLocators,
138
+ const xlinkHRef *hrefs,
139
+ const xlinkRole *roles,
140
+ int nbTitles,
141
+ const xlinkTitle *titles,
142
+ const xmlChar **langs);
143
+
144
+ /**
145
+ * This is the structure containing a set of Links detection callbacks.
146
+ *
147
+ * There is no default xlink callbacks, if one want to get link
148
+ * recognition activated, those call backs must be provided before parsing.
149
+ */
150
+ typedef struct _xlinkHandler xlinkHandler;
151
+ typedef xlinkHandler *xlinkHandlerPtr;
152
+ struct _xlinkHandler {
153
+ xlinkSimpleLinkFunk simple;
154
+ xlinkExtendedLinkFunk extended;
155
+ xlinkExtendedLinkSetFunk set;
156
+ };
157
+
158
+ /*
159
+ * The default detection routine, can be overridden, they call the default
160
+ * detection callbacks.
161
+ */
162
+
163
+ XMLPUBFUN xlinkNodeDetectFunc
164
+ xlinkGetDefaultDetect (void);
165
+ XMLPUBFUN void
166
+ xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
167
+
168
+ /*
169
+ * Routines to set/get the default handlers.
170
+ */
171
+ XMLPUBFUN xlinkHandlerPtr
172
+ xlinkGetDefaultHandler (void);
173
+ XMLPUBFUN void
174
+ xlinkSetDefaultHandler (xlinkHandlerPtr handler);
175
+
176
+ /*
177
+ * Link detection module itself.
178
+ */
179
+ XMLPUBFUN xlinkType
180
+ xlinkIsLink (xmlDocPtr doc,
181
+ xmlNodePtr node);
182
+
183
+ #ifdef __cplusplus
184
+ }
185
+ #endif
186
+
187
+ #endif /* LIBXML_XPTR_ENABLED */
188
+
189
+ #endif /* __XML_XLINK_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlIO.h ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the I/O interfaces used by the parser
3
+ * Description: interface for the I/O interfaces used by the parser
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_IO_H__
11
+ #define __XML_IO_H__
12
+
13
+ #include <stdio.h>
14
+ #include <libxml/xmlversion.h>
15
+ #include <libxml/encoding.h>
16
+ #define XML_TREE_INTERNALS
17
+ #include <libxml/tree.h>
18
+ #undef XML_TREE_INTERNALS
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /*
25
+ * Those are the functions and datatypes for the parser input
26
+ * I/O structures.
27
+ */
28
+
29
+ /**
30
+ * xmlInputMatchCallback:
31
+ * @filename: the filename or URI
32
+ *
33
+ * Callback used in the I/O Input API to detect if the current handler
34
+ * can provide input functionality for this resource.
35
+ *
36
+ * Returns 1 if yes and 0 if another Input module should be used
37
+ */
38
+ typedef int (*xmlInputMatchCallback) (char const *filename);
39
+ /**
40
+ * xmlInputOpenCallback:
41
+ * @filename: the filename or URI
42
+ *
43
+ * Callback used in the I/O Input API to open the resource
44
+ *
45
+ * Returns an Input context or NULL in case or error
46
+ */
47
+ typedef void * (*xmlInputOpenCallback) (char const *filename);
48
+ /**
49
+ * xmlInputReadCallback:
50
+ * @context: an Input context
51
+ * @buffer: the buffer to store data read
52
+ * @len: the length of the buffer in bytes
53
+ *
54
+ * Callback used in the I/O Input API to read the resource
55
+ *
56
+ * Returns the number of bytes read or -1 in case of error
57
+ */
58
+ typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
59
+ /**
60
+ * xmlInputCloseCallback:
61
+ * @context: an Input context
62
+ *
63
+ * Callback used in the I/O Input API to close the resource
64
+ *
65
+ * Returns 0 or -1 in case of error
66
+ */
67
+ typedef int (*xmlInputCloseCallback) (void * context);
68
+
69
+ #ifdef LIBXML_OUTPUT_ENABLED
70
+ /*
71
+ * Those are the functions and datatypes for the library output
72
+ * I/O structures.
73
+ */
74
+
75
+ /**
76
+ * xmlOutputMatchCallback:
77
+ * @filename: the filename or URI
78
+ *
79
+ * Callback used in the I/O Output API to detect if the current handler
80
+ * can provide output functionality for this resource.
81
+ *
82
+ * Returns 1 if yes and 0 if another Output module should be used
83
+ */
84
+ typedef int (*xmlOutputMatchCallback) (char const *filename);
85
+ /**
86
+ * xmlOutputOpenCallback:
87
+ * @filename: the filename or URI
88
+ *
89
+ * Callback used in the I/O Output API to open the resource
90
+ *
91
+ * Returns an Output context or NULL in case or error
92
+ */
93
+ typedef void * (*xmlOutputOpenCallback) (char const *filename);
94
+ /**
95
+ * xmlOutputWriteCallback:
96
+ * @context: an Output context
97
+ * @buffer: the buffer of data to write
98
+ * @len: the length of the buffer in bytes
99
+ *
100
+ * Callback used in the I/O Output API to write to the resource
101
+ *
102
+ * Returns the number of bytes written or -1 in case of error
103
+ */
104
+ typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
105
+ int len);
106
+ /**
107
+ * xmlOutputCloseCallback:
108
+ * @context: an Output context
109
+ *
110
+ * Callback used in the I/O Output API to close the resource
111
+ *
112
+ * Returns 0 or -1 in case of error
113
+ */
114
+ typedef int (*xmlOutputCloseCallback) (void * context);
115
+ #endif /* LIBXML_OUTPUT_ENABLED */
116
+
117
+ /**
118
+ * xmlParserInputBufferCreateFilenameFunc:
119
+ * @URI: the URI to read from
120
+ * @enc: the requested source encoding
121
+ *
122
+ * Signature for the function doing the lookup for a suitable input method
123
+ * corresponding to an URI.
124
+ *
125
+ * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
126
+ * method was found.
127
+ */
128
+ typedef xmlParserInputBufferPtr
129
+ (*xmlParserInputBufferCreateFilenameFunc)(const char *URI, xmlCharEncoding enc);
130
+
131
+ /**
132
+ * xmlOutputBufferCreateFilenameFunc:
133
+ * @URI: the URI to write to
134
+ * @enc: the requested target encoding
135
+ *
136
+ * Signature for the function doing the lookup for a suitable output method
137
+ * corresponding to an URI.
138
+ *
139
+ * Returns the new xmlOutputBufferPtr in case of success or NULL if no
140
+ * method was found.
141
+ */
142
+ typedef xmlOutputBufferPtr
143
+ (*xmlOutputBufferCreateFilenameFunc)(const char *URI,
144
+ xmlCharEncodingHandlerPtr encoder, int compression);
145
+
146
+ struct _xmlParserInputBuffer {
147
+ void* context;
148
+ xmlInputReadCallback readcallback;
149
+ xmlInputCloseCallback closecallback;
150
+
151
+ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
152
+
153
+ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
154
+ xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
155
+ int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
156
+ int error;
157
+ unsigned long rawconsumed;/* amount consumed from raw */
158
+ };
159
+
160
+
161
+ #ifdef LIBXML_OUTPUT_ENABLED
162
+ struct _xmlOutputBuffer {
163
+ void* context;
164
+ xmlOutputWriteCallback writecallback;
165
+ xmlOutputCloseCallback closecallback;
166
+
167
+ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
168
+
169
+ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
170
+ xmlBufPtr conv; /* if encoder != NULL buffer for output */
171
+ int written; /* total number of byte written */
172
+ int error;
173
+ };
174
+ #endif /* LIBXML_OUTPUT_ENABLED */
175
+
176
+ /** DOC_DISABLE */
177
+ #define XML_GLOBALS_IO \
178
+ XML_OP(xmlParserInputBufferCreateFilenameValue, \
179
+ xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
180
+ XML_OP(xmlOutputBufferCreateFilenameValue, \
181
+ xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
182
+
183
+ #define XML_OP XML_DECLARE_GLOBAL
184
+ XML_GLOBALS_IO
185
+ #undef XML_OP
186
+
187
+ #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
188
+ #define xmlParserInputBufferCreateFilenameValue \
189
+ XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
190
+ #define xmlOutputBufferCreateFilenameValue \
191
+ XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
192
+ #endif
193
+ /** DOC_ENABLE */
194
+
195
+ /*
196
+ * Interfaces for input
197
+ */
198
+ XMLPUBFUN void
199
+ xmlCleanupInputCallbacks (void);
200
+
201
+ XMLPUBFUN int
202
+ xmlPopInputCallbacks (void);
203
+
204
+ XMLPUBFUN void
205
+ xmlRegisterDefaultInputCallbacks (void);
206
+ XMLPUBFUN xmlParserInputBufferPtr
207
+ xmlAllocParserInputBuffer (xmlCharEncoding enc);
208
+
209
+ XMLPUBFUN xmlParserInputBufferPtr
210
+ xmlParserInputBufferCreateFilename (const char *URI,
211
+ xmlCharEncoding enc);
212
+ XMLPUBFUN xmlParserInputBufferPtr
213
+ xmlParserInputBufferCreateFile (FILE *file,
214
+ xmlCharEncoding enc);
215
+ XMLPUBFUN xmlParserInputBufferPtr
216
+ xmlParserInputBufferCreateFd (int fd,
217
+ xmlCharEncoding enc);
218
+ XMLPUBFUN xmlParserInputBufferPtr
219
+ xmlParserInputBufferCreateMem (const char *mem, int size,
220
+ xmlCharEncoding enc);
221
+ XMLPUBFUN xmlParserInputBufferPtr
222
+ xmlParserInputBufferCreateStatic (const char *mem, int size,
223
+ xmlCharEncoding enc);
224
+ XMLPUBFUN xmlParserInputBufferPtr
225
+ xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
226
+ xmlInputCloseCallback ioclose,
227
+ void *ioctx,
228
+ xmlCharEncoding enc);
229
+ XMLPUBFUN int
230
+ xmlParserInputBufferRead (xmlParserInputBufferPtr in,
231
+ int len);
232
+ XMLPUBFUN int
233
+ xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
234
+ int len);
235
+ XMLPUBFUN int
236
+ xmlParserInputBufferPush (xmlParserInputBufferPtr in,
237
+ int len,
238
+ const char *buf);
239
+ XMLPUBFUN void
240
+ xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
241
+ XMLPUBFUN char *
242
+ xmlParserGetDirectory (const char *filename);
243
+
244
+ XMLPUBFUN int
245
+ xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
246
+ xmlInputOpenCallback openFunc,
247
+ xmlInputReadCallback readFunc,
248
+ xmlInputCloseCallback closeFunc);
249
+
250
+ xmlParserInputBufferPtr
251
+ __xmlParserInputBufferCreateFilename(const char *URI,
252
+ xmlCharEncoding enc);
253
+
254
+ #ifdef LIBXML_OUTPUT_ENABLED
255
+ /*
256
+ * Interfaces for output
257
+ */
258
+ XMLPUBFUN void
259
+ xmlCleanupOutputCallbacks (void);
260
+ XMLPUBFUN int
261
+ xmlPopOutputCallbacks (void);
262
+ XMLPUBFUN void
263
+ xmlRegisterDefaultOutputCallbacks(void);
264
+ XMLPUBFUN xmlOutputBufferPtr
265
+ xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
266
+
267
+ XMLPUBFUN xmlOutputBufferPtr
268
+ xmlOutputBufferCreateFilename (const char *URI,
269
+ xmlCharEncodingHandlerPtr encoder,
270
+ int compression);
271
+
272
+ XMLPUBFUN xmlOutputBufferPtr
273
+ xmlOutputBufferCreateFile (FILE *file,
274
+ xmlCharEncodingHandlerPtr encoder);
275
+
276
+ XMLPUBFUN xmlOutputBufferPtr
277
+ xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
278
+ xmlCharEncodingHandlerPtr encoder);
279
+
280
+ XMLPUBFUN xmlOutputBufferPtr
281
+ xmlOutputBufferCreateFd (int fd,
282
+ xmlCharEncodingHandlerPtr encoder);
283
+
284
+ XMLPUBFUN xmlOutputBufferPtr
285
+ xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
286
+ xmlOutputCloseCallback ioclose,
287
+ void *ioctx,
288
+ xmlCharEncodingHandlerPtr encoder);
289
+
290
+ /* Couple of APIs to get the output without digging into the buffers */
291
+ XMLPUBFUN const xmlChar *
292
+ xmlOutputBufferGetContent (xmlOutputBufferPtr out);
293
+ XMLPUBFUN size_t
294
+ xmlOutputBufferGetSize (xmlOutputBufferPtr out);
295
+
296
+ XMLPUBFUN int
297
+ xmlOutputBufferWrite (xmlOutputBufferPtr out,
298
+ int len,
299
+ const char *buf);
300
+ XMLPUBFUN int
301
+ xmlOutputBufferWriteString (xmlOutputBufferPtr out,
302
+ const char *str);
303
+ XMLPUBFUN int
304
+ xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
305
+ const xmlChar *str,
306
+ xmlCharEncodingOutputFunc escaping);
307
+
308
+ XMLPUBFUN int
309
+ xmlOutputBufferFlush (xmlOutputBufferPtr out);
310
+ XMLPUBFUN int
311
+ xmlOutputBufferClose (xmlOutputBufferPtr out);
312
+
313
+ XMLPUBFUN int
314
+ xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
315
+ xmlOutputOpenCallback openFunc,
316
+ xmlOutputWriteCallback writeFunc,
317
+ xmlOutputCloseCallback closeFunc);
318
+
319
+ xmlOutputBufferPtr
320
+ __xmlOutputBufferCreateFilename(const char *URI,
321
+ xmlCharEncodingHandlerPtr encoder,
322
+ int compression);
323
+
324
+ #ifdef LIBXML_HTTP_ENABLED
325
+ /* This function only exists if HTTP support built into the library */
326
+ XMLPUBFUN void
327
+ xmlRegisterHTTPPostCallbacks (void );
328
+ #endif /* LIBXML_HTTP_ENABLED */
329
+
330
+ #endif /* LIBXML_OUTPUT_ENABLED */
331
+
332
+ XMLPUBFUN xmlParserInputPtr
333
+ xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
334
+ xmlParserInputPtr ret);
335
+
336
+ /*
337
+ * A predefined entity loader disabling network accesses
338
+ */
339
+ XMLPUBFUN xmlParserInputPtr
340
+ xmlNoNetExternalEntityLoader (const char *URL,
341
+ const char *ID,
342
+ xmlParserCtxtPtr ctxt);
343
+
344
+ /*
345
+ * xmlNormalizeWindowsPath is obsolete, don't use it.
346
+ * Check xmlCanonicPath in uri.h for a better alternative.
347
+ */
348
+ XMLPUBFUN xmlChar *
349
+ xmlNormalizeWindowsPath (const xmlChar *path);
350
+
351
+ XMLPUBFUN int
352
+ xmlCheckFilename (const char *path);
353
+ /**
354
+ * Default 'file://' protocol callbacks
355
+ */
356
+ XMLPUBFUN int
357
+ xmlFileMatch (const char *filename);
358
+ XMLPUBFUN void *
359
+ xmlFileOpen (const char *filename);
360
+ XMLPUBFUN int
361
+ xmlFileRead (void * context,
362
+ char * buffer,
363
+ int len);
364
+ XMLPUBFUN int
365
+ xmlFileClose (void * context);
366
+
367
+ /**
368
+ * Default 'http://' protocol callbacks
369
+ */
370
+ #ifdef LIBXML_HTTP_ENABLED
371
+ XMLPUBFUN int
372
+ xmlIOHTTPMatch (const char *filename);
373
+ XMLPUBFUN void *
374
+ xmlIOHTTPOpen (const char *filename);
375
+ #ifdef LIBXML_OUTPUT_ENABLED
376
+ XMLPUBFUN void *
377
+ xmlIOHTTPOpenW (const char * post_uri,
378
+ int compression );
379
+ #endif /* LIBXML_OUTPUT_ENABLED */
380
+ XMLPUBFUN int
381
+ xmlIOHTTPRead (void * context,
382
+ char * buffer,
383
+ int len);
384
+ XMLPUBFUN int
385
+ xmlIOHTTPClose (void * context);
386
+ #endif /* LIBXML_HTTP_ENABLED */
387
+
388
+ /**
389
+ * Default 'ftp://' protocol callbacks
390
+ */
391
+ #if defined(LIBXML_FTP_ENABLED)
392
+ XMLPUBFUN int
393
+ xmlIOFTPMatch (const char *filename);
394
+ XMLPUBFUN void *
395
+ xmlIOFTPOpen (const char *filename);
396
+ XMLPUBFUN int
397
+ xmlIOFTPRead (void * context,
398
+ char * buffer,
399
+ int len);
400
+ XMLPUBFUN int
401
+ xmlIOFTPClose (void * context);
402
+ #endif /* defined(LIBXML_FTP_ENABLED) */
403
+
404
+ XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
405
+ xmlParserInputBufferCreateFilenameDefault(
406
+ xmlParserInputBufferCreateFilenameFunc func);
407
+ XMLPUBFUN xmlOutputBufferCreateFilenameFunc
408
+ xmlOutputBufferCreateFilenameDefault(
409
+ xmlOutputBufferCreateFilenameFunc func);
410
+ XMLPUBFUN xmlOutputBufferCreateFilenameFunc
411
+ xmlThrDefOutputBufferCreateFilenameDefault(
412
+ xmlOutputBufferCreateFilenameFunc func);
413
+ XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
414
+ xmlThrDefParserInputBufferCreateFilenameDefault(
415
+ xmlParserInputBufferCreateFilenameFunc func);
416
+
417
+ #ifdef __cplusplus
418
+ }
419
+ #endif
420
+
421
+ #endif /* __XML_IO_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlschemastypes.h ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 int
34
+ xmlSchemaInitTypes (void);
35
+ XML_DEPRECATED
36
+ XMLPUBFUN void
37
+ xmlSchemaCleanupTypes (void);
38
+ XMLPUBFUN xmlSchemaTypePtr
39
+ xmlSchemaGetPredefinedType (const xmlChar *name,
40
+ const xmlChar *ns);
41
+ XMLPUBFUN int
42
+ xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
43
+ const xmlChar *value,
44
+ xmlSchemaValPtr *val);
45
+ XMLPUBFUN int
46
+ xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
47
+ const xmlChar *value,
48
+ xmlSchemaValPtr *val,
49
+ xmlNodePtr node);
50
+ XMLPUBFUN int
51
+ xmlSchemaValidateFacet (xmlSchemaTypePtr base,
52
+ xmlSchemaFacetPtr facet,
53
+ const xmlChar *value,
54
+ xmlSchemaValPtr val);
55
+ XMLPUBFUN int
56
+ xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
57
+ xmlSchemaWhitespaceValueType fws,
58
+ xmlSchemaValType valType,
59
+ const xmlChar *value,
60
+ xmlSchemaValPtr val,
61
+ xmlSchemaWhitespaceValueType ws);
62
+ XMLPUBFUN void
63
+ xmlSchemaFreeValue (xmlSchemaValPtr val);
64
+ XMLPUBFUN xmlSchemaFacetPtr
65
+ xmlSchemaNewFacet (void);
66
+ XMLPUBFUN int
67
+ xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
68
+ xmlSchemaTypePtr typeDecl,
69
+ xmlSchemaParserCtxtPtr ctxt,
70
+ const xmlChar *name);
71
+ XMLPUBFUN void
72
+ xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
73
+ XMLPUBFUN int
74
+ xmlSchemaCompareValues (xmlSchemaValPtr x,
75
+ xmlSchemaValPtr y);
76
+ XMLPUBFUN xmlSchemaTypePtr
77
+ xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
78
+ XMLPUBFUN int
79
+ xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
80
+ const xmlChar *value,
81
+ unsigned long actualLen,
82
+ unsigned long *expectedLen);
83
+ XMLPUBFUN xmlSchemaTypePtr
84
+ xmlSchemaGetBuiltInType (xmlSchemaValType type);
85
+ XMLPUBFUN int
86
+ xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
87
+ int facetType);
88
+ XMLPUBFUN xmlChar *
89
+ xmlSchemaCollapseString (const xmlChar *value);
90
+ XMLPUBFUN xmlChar *
91
+ xmlSchemaWhiteSpaceReplace (const xmlChar *value);
92
+ XMLPUBFUN unsigned long
93
+ xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
94
+ XMLPUBFUN int
95
+ xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
96
+ xmlSchemaFacetPtr facet,
97
+ const xmlChar *value,
98
+ xmlSchemaValPtr val,
99
+ unsigned long *length);
100
+ XMLPUBFUN int
101
+ xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
102
+ xmlSchemaValType valType,
103
+ const xmlChar *value,
104
+ xmlSchemaValPtr val,
105
+ unsigned long *length,
106
+ xmlSchemaWhitespaceValueType ws);
107
+ XMLPUBFUN int
108
+ xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
109
+ const xmlChar *value,
110
+ xmlSchemaValPtr *val,
111
+ xmlNodePtr node);
112
+ XMLPUBFUN int
113
+ xmlSchemaGetCanonValue (xmlSchemaValPtr val,
114
+ const xmlChar **retValue);
115
+ XMLPUBFUN int
116
+ xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
117
+ const xmlChar **retValue,
118
+ xmlSchemaWhitespaceValueType ws);
119
+ XMLPUBFUN int
120
+ xmlSchemaValueAppend (xmlSchemaValPtr prev,
121
+ xmlSchemaValPtr cur);
122
+ XMLPUBFUN xmlSchemaValPtr
123
+ xmlSchemaValueGetNext (xmlSchemaValPtr cur);
124
+ XMLPUBFUN const xmlChar *
125
+ xmlSchemaValueGetAsString (xmlSchemaValPtr val);
126
+ XMLPUBFUN int
127
+ xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
128
+ XMLPUBFUN xmlSchemaValPtr
129
+ xmlSchemaNewStringValue (xmlSchemaValType type,
130
+ const xmlChar *value);
131
+ XMLPUBFUN xmlSchemaValPtr
132
+ xmlSchemaNewNOTATIONValue (const xmlChar *name,
133
+ const xmlChar *ns);
134
+ XMLPUBFUN xmlSchemaValPtr
135
+ xmlSchemaNewQNameValue (const xmlChar *namespaceName,
136
+ const xmlChar *localName);
137
+ XMLPUBFUN int
138
+ xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
139
+ xmlSchemaWhitespaceValueType xws,
140
+ xmlSchemaValPtr y,
141
+ xmlSchemaWhitespaceValueType yws);
142
+ XMLPUBFUN xmlSchemaValPtr
143
+ xmlSchemaCopyValue (xmlSchemaValPtr val);
144
+ XMLPUBFUN xmlSchemaValType
145
+ xmlSchemaGetValType (xmlSchemaValPtr val);
146
+
147
+ #ifdef __cplusplus
148
+ }
149
+ #endif
150
+
151
+ #endif /* LIBXML_SCHEMAS_ENABLED */
152
+ #endif /* __XML_SCHEMA_TYPES_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxml/xmlwriter.h ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: text writing API for XML
3
+ * Description: text writing API for XML
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Alfred Mickautsch <[email protected]>
8
+ */
9
+
10
+ #ifndef __XML_XMLWRITER_H__
11
+ #define __XML_XMLWRITER_H__
12
+
13
+ #include <libxml/xmlversion.h>
14
+
15
+ #ifdef LIBXML_WRITER_ENABLED
16
+
17
+ #include <stdarg.h>
18
+ #include <libxml/xmlIO.h>
19
+ #include <libxml/list.h>
20
+ #include <libxml/xmlstring.h>
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ typedef struct _xmlTextWriter xmlTextWriter;
27
+ typedef xmlTextWriter *xmlTextWriterPtr;
28
+
29
+ /*
30
+ * Constructors & Destructor
31
+ */
32
+ XMLPUBFUN xmlTextWriterPtr
33
+ xmlNewTextWriter(xmlOutputBufferPtr out);
34
+ XMLPUBFUN xmlTextWriterPtr
35
+ xmlNewTextWriterFilename(const char *uri, int compression);
36
+ XMLPUBFUN xmlTextWriterPtr
37
+ xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
38
+ XMLPUBFUN xmlTextWriterPtr
39
+ xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
40
+ XMLPUBFUN xmlTextWriterPtr
41
+ xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
42
+ XMLPUBFUN xmlTextWriterPtr
43
+ xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
44
+ int compression);
45
+ XMLPUBFUN void xmlFreeTextWriter(xmlTextWriterPtr writer);
46
+
47
+ /*
48
+ * Functions
49
+ */
50
+
51
+
52
+ /*
53
+ * Document
54
+ */
55
+ XMLPUBFUN int
56
+ xmlTextWriterStartDocument(xmlTextWriterPtr writer,
57
+ const char *version,
58
+ const char *encoding,
59
+ const char *standalone);
60
+ XMLPUBFUN int xmlTextWriterEndDocument(xmlTextWriterPtr
61
+ writer);
62
+
63
+ /*
64
+ * Comments
65
+ */
66
+ XMLPUBFUN int xmlTextWriterStartComment(xmlTextWriterPtr
67
+ writer);
68
+ XMLPUBFUN int xmlTextWriterEndComment(xmlTextWriterPtr writer);
69
+ XMLPUBFUN int
70
+ xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
71
+ const char *format, ...)
72
+ LIBXML_ATTR_FORMAT(2,3);
73
+ XMLPUBFUN int
74
+ xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
75
+ const char *format,
76
+ va_list argptr)
77
+ LIBXML_ATTR_FORMAT(2,0);
78
+ XMLPUBFUN int xmlTextWriterWriteComment(xmlTextWriterPtr
79
+ writer,
80
+ const xmlChar *
81
+ content);
82
+
83
+ /*
84
+ * Elements
85
+ */
86
+ XMLPUBFUN int
87
+ xmlTextWriterStartElement(xmlTextWriterPtr writer,
88
+ const xmlChar * name);
89
+ XMLPUBFUN int xmlTextWriterStartElementNS(xmlTextWriterPtr
90
+ writer,
91
+ const xmlChar *
92
+ prefix,
93
+ const xmlChar * name,
94
+ const xmlChar *
95
+ namespaceURI);
96
+ XMLPUBFUN int xmlTextWriterEndElement(xmlTextWriterPtr writer);
97
+ XMLPUBFUN int xmlTextWriterFullEndElement(xmlTextWriterPtr
98
+ writer);
99
+
100
+ /*
101
+ * Elements conveniency functions
102
+ */
103
+ XMLPUBFUN int
104
+ xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
105
+ const xmlChar * name,
106
+ const char *format, ...)
107
+ LIBXML_ATTR_FORMAT(3,4);
108
+ XMLPUBFUN int
109
+ xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
110
+ const xmlChar * name,
111
+ const char *format,
112
+ va_list argptr)
113
+ LIBXML_ATTR_FORMAT(3,0);
114
+ XMLPUBFUN int xmlTextWriterWriteElement(xmlTextWriterPtr
115
+ writer,
116
+ const xmlChar * name,
117
+ const xmlChar *
118
+ content);
119
+ XMLPUBFUN int
120
+ xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
121
+ const xmlChar * prefix,
122
+ const xmlChar * name,
123
+ const xmlChar * namespaceURI,
124
+ const char *format, ...)
125
+ LIBXML_ATTR_FORMAT(5,6);
126
+ XMLPUBFUN int
127
+ xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
128
+ const xmlChar * prefix,
129
+ const xmlChar * name,
130
+ const xmlChar * namespaceURI,
131
+ const char *format,
132
+ va_list argptr)
133
+ LIBXML_ATTR_FORMAT(5,0);
134
+ XMLPUBFUN int xmlTextWriterWriteElementNS(xmlTextWriterPtr
135
+ writer,
136
+ const xmlChar *
137
+ prefix,
138
+ const xmlChar * name,
139
+ const xmlChar *
140
+ namespaceURI,
141
+ const xmlChar *
142
+ content);
143
+
144
+ /*
145
+ * Text
146
+ */
147
+ XMLPUBFUN int
148
+ xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
149
+ const char *format, ...)
150
+ LIBXML_ATTR_FORMAT(2,3);
151
+ XMLPUBFUN int
152
+ xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
153
+ const char *format, va_list argptr)
154
+ LIBXML_ATTR_FORMAT(2,0);
155
+ XMLPUBFUN int
156
+ xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
157
+ const xmlChar * content, int len);
158
+ XMLPUBFUN int
159
+ xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
160
+ const xmlChar * content);
161
+ XMLPUBFUN int xmlTextWriterWriteFormatString(xmlTextWriterPtr
162
+ writer,
163
+ const char
164
+ *format, ...)
165
+ LIBXML_ATTR_FORMAT(2,3);
166
+ XMLPUBFUN int xmlTextWriterWriteVFormatString(xmlTextWriterPtr
167
+ writer,
168
+ const char
169
+ *format,
170
+ va_list argptr)
171
+ LIBXML_ATTR_FORMAT(2,0);
172
+ XMLPUBFUN int xmlTextWriterWriteString(xmlTextWriterPtr writer,
173
+ const xmlChar *
174
+ content);
175
+ XMLPUBFUN int xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
176
+ const char *data,
177
+ int start, int len);
178
+ XMLPUBFUN int xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
179
+ const char *data,
180
+ int start, int len);
181
+
182
+ /*
183
+ * Attributes
184
+ */
185
+ XMLPUBFUN int
186
+ xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
187
+ const xmlChar * name);
188
+ XMLPUBFUN int xmlTextWriterStartAttributeNS(xmlTextWriterPtr
189
+ writer,
190
+ const xmlChar *
191
+ prefix,
192
+ const xmlChar *
193
+ name,
194
+ const xmlChar *
195
+ namespaceURI);
196
+ XMLPUBFUN int xmlTextWriterEndAttribute(xmlTextWriterPtr
197
+ writer);
198
+
199
+ /*
200
+ * Attributes conveniency functions
201
+ */
202
+ XMLPUBFUN int
203
+ xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
204
+ const xmlChar * name,
205
+ const char *format, ...)
206
+ LIBXML_ATTR_FORMAT(3,4);
207
+ XMLPUBFUN int
208
+ xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
209
+ const xmlChar * name,
210
+ const char *format,
211
+ va_list argptr)
212
+ LIBXML_ATTR_FORMAT(3,0);
213
+ XMLPUBFUN int xmlTextWriterWriteAttribute(xmlTextWriterPtr
214
+ writer,
215
+ const xmlChar * name,
216
+ const xmlChar *
217
+ content);
218
+ XMLPUBFUN int
219
+ xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
220
+ const xmlChar * prefix,
221
+ const xmlChar * name,
222
+ const xmlChar * namespaceURI,
223
+ const char *format, ...)
224
+ LIBXML_ATTR_FORMAT(5,6);
225
+ XMLPUBFUN int
226
+ xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
227
+ const xmlChar * prefix,
228
+ const xmlChar * name,
229
+ const xmlChar * namespaceURI,
230
+ const char *format,
231
+ va_list argptr)
232
+ LIBXML_ATTR_FORMAT(5,0);
233
+ XMLPUBFUN int xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
234
+ writer,
235
+ const xmlChar *
236
+ prefix,
237
+ const xmlChar *
238
+ name,
239
+ const xmlChar *
240
+ namespaceURI,
241
+ const xmlChar *
242
+ content);
243
+
244
+ /*
245
+ * PI's
246
+ */
247
+ XMLPUBFUN int
248
+ xmlTextWriterStartPI(xmlTextWriterPtr writer,
249
+ const xmlChar * target);
250
+ XMLPUBFUN int xmlTextWriterEndPI(xmlTextWriterPtr writer);
251
+
252
+ /*
253
+ * PI conveniency functions
254
+ */
255
+ XMLPUBFUN int
256
+ xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
257
+ const xmlChar * target,
258
+ const char *format, ...)
259
+ LIBXML_ATTR_FORMAT(3,4);
260
+ XMLPUBFUN int
261
+ xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
262
+ const xmlChar * target,
263
+ const char *format, va_list argptr)
264
+ LIBXML_ATTR_FORMAT(3,0);
265
+ XMLPUBFUN int
266
+ xmlTextWriterWritePI(xmlTextWriterPtr writer,
267
+ const xmlChar * target,
268
+ const xmlChar * content);
269
+
270
+ /**
271
+ * xmlTextWriterWriteProcessingInstruction:
272
+ *
273
+ * This macro maps to xmlTextWriterWritePI
274
+ */
275
+ #define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI
276
+
277
+ /*
278
+ * CDATA
279
+ */
280
+ XMLPUBFUN int xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
281
+ XMLPUBFUN int xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
282
+
283
+ /*
284
+ * CDATA conveniency functions
285
+ */
286
+ XMLPUBFUN int
287
+ xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
288
+ const char *format, ...)
289
+ LIBXML_ATTR_FORMAT(2,3);
290
+ XMLPUBFUN int
291
+ xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
292
+ const char *format, va_list argptr)
293
+ LIBXML_ATTR_FORMAT(2,0);
294
+ XMLPUBFUN int
295
+ xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
296
+ const xmlChar * content);
297
+
298
+ /*
299
+ * DTD
300
+ */
301
+ XMLPUBFUN int
302
+ xmlTextWriterStartDTD(xmlTextWriterPtr writer,
303
+ const xmlChar * name,
304
+ const xmlChar * pubid,
305
+ const xmlChar * sysid);
306
+ XMLPUBFUN int xmlTextWriterEndDTD(xmlTextWriterPtr writer);
307
+
308
+ /*
309
+ * DTD conveniency functions
310
+ */
311
+ XMLPUBFUN int
312
+ xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
313
+ const xmlChar * name,
314
+ const xmlChar * pubid,
315
+ const xmlChar * sysid,
316
+ const char *format, ...)
317
+ LIBXML_ATTR_FORMAT(5,6);
318
+ XMLPUBFUN int
319
+ xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
320
+ const xmlChar * name,
321
+ const xmlChar * pubid,
322
+ const xmlChar * sysid,
323
+ const char *format, va_list argptr)
324
+ LIBXML_ATTR_FORMAT(5,0);
325
+ XMLPUBFUN int
326
+ xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
327
+ const xmlChar * name,
328
+ const xmlChar * pubid,
329
+ const xmlChar * sysid,
330
+ const xmlChar * subset);
331
+
332
+ /**
333
+ * xmlTextWriterWriteDocType:
334
+ *
335
+ * this macro maps to xmlTextWriterWriteDTD
336
+ */
337
+ #define xmlTextWriterWriteDocType xmlTextWriterWriteDTD
338
+
339
+ /*
340
+ * DTD element definition
341
+ */
342
+ XMLPUBFUN int
343
+ xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
344
+ const xmlChar * name);
345
+ XMLPUBFUN int xmlTextWriterEndDTDElement(xmlTextWriterPtr
346
+ writer);
347
+
348
+ /*
349
+ * DTD element definition conveniency functions
350
+ */
351
+ XMLPUBFUN int
352
+ xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
353
+ const xmlChar * name,
354
+ const char *format, ...)
355
+ LIBXML_ATTR_FORMAT(3,4);
356
+ XMLPUBFUN int
357
+ xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
358
+ const xmlChar * name,
359
+ const char *format,
360
+ va_list argptr)
361
+ LIBXML_ATTR_FORMAT(3,0);
362
+ XMLPUBFUN int xmlTextWriterWriteDTDElement(xmlTextWriterPtr
363
+ writer,
364
+ const xmlChar *
365
+ name,
366
+ const xmlChar *
367
+ content);
368
+
369
+ /*
370
+ * DTD attribute list definition
371
+ */
372
+ XMLPUBFUN int
373
+ xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
374
+ const xmlChar * name);
375
+ XMLPUBFUN int xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
376
+ writer);
377
+
378
+ /*
379
+ * DTD attribute list definition conveniency functions
380
+ */
381
+ XMLPUBFUN int
382
+ xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
383
+ const xmlChar * name,
384
+ const char *format, ...)
385
+ LIBXML_ATTR_FORMAT(3,4);
386
+ XMLPUBFUN int
387
+ xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
388
+ const xmlChar * name,
389
+ const char *format,
390
+ va_list argptr)
391
+ LIBXML_ATTR_FORMAT(3,0);
392
+ XMLPUBFUN int xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
393
+ writer,
394
+ const xmlChar *
395
+ name,
396
+ const xmlChar *
397
+ content);
398
+
399
+ /*
400
+ * DTD entity definition
401
+ */
402
+ XMLPUBFUN int
403
+ xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
404
+ int pe, const xmlChar * name);
405
+ XMLPUBFUN int xmlTextWriterEndDTDEntity(xmlTextWriterPtr
406
+ writer);
407
+
408
+ /*
409
+ * DTD entity definition conveniency functions
410
+ */
411
+ XMLPUBFUN int
412
+ xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
413
+ int pe,
414
+ const xmlChar * name,
415
+ const char *format, ...)
416
+ LIBXML_ATTR_FORMAT(4,5);
417
+ XMLPUBFUN int
418
+ xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
419
+ int pe,
420
+ const xmlChar * name,
421
+ const char *format,
422
+ va_list argptr)
423
+ LIBXML_ATTR_FORMAT(4,0);
424
+ XMLPUBFUN int
425
+ xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
426
+ int pe,
427
+ const xmlChar * name,
428
+ const xmlChar * content);
429
+ XMLPUBFUN int
430
+ xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
431
+ int pe,
432
+ const xmlChar * name,
433
+ const xmlChar * pubid,
434
+ const xmlChar * sysid,
435
+ const xmlChar * ndataid);
436
+ XMLPUBFUN int
437
+ xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
438
+ writer,
439
+ const xmlChar * pubid,
440
+ const xmlChar * sysid,
441
+ const xmlChar *
442
+ ndataid);
443
+ XMLPUBFUN int xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
444
+ writer, int pe,
445
+ const xmlChar * name,
446
+ const xmlChar *
447
+ pubid,
448
+ const xmlChar *
449
+ sysid,
450
+ const xmlChar *
451
+ ndataid,
452
+ const xmlChar *
453
+ content);
454
+
455
+ /*
456
+ * DTD notation definition
457
+ */
458
+ XMLPUBFUN int
459
+ xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
460
+ const xmlChar * name,
461
+ const xmlChar * pubid,
462
+ const xmlChar * sysid);
463
+
464
+ /*
465
+ * Indentation
466
+ */
467
+ XMLPUBFUN int
468
+ xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
469
+ XMLPUBFUN int
470
+ xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
471
+ const xmlChar * str);
472
+
473
+ XMLPUBFUN int
474
+ xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
475
+
476
+
477
+ /*
478
+ * misc
479
+ */
480
+ XMLPUBFUN int xmlTextWriterFlush(xmlTextWriterPtr writer);
481
+
482
+ #ifdef __cplusplus
483
+ }
484
+ #endif
485
+
486
+ #endif /* LIBXML_WRITER_ENABLED */
487
+
488
+ #endif /* __XML_XMLWRITER_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxslt/__init__.py ADDED
File without changes
venv/lib/python3.10/site-packages/lxml/includes/libxslt/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (189 Bytes). View file
 
venv/lib/python3.10/site-packages/lxml/includes/libxslt/attributes.h ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the XSLT attribute handling
3
+ * Description: this module handles the specificities of attribute
4
+ * and attribute groups processing.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_ATTRIBUTES_H__
12
+ #define __XML_XSLT_ATTRIBUTES_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ XSLTPUBFUN void XSLTCALL
23
+ xsltParseStylesheetAttributeSet (xsltStylesheetPtr style,
24
+ xmlNodePtr cur);
25
+ XSLTPUBFUN void XSLTCALL
26
+ xsltFreeAttributeSetsHashes (xsltStylesheetPtr style);
27
+ XSLTPUBFUN void XSLTCALL
28
+ xsltApplyAttributeSet (xsltTransformContextPtr ctxt,
29
+ xmlNodePtr node,
30
+ xmlNodePtr inst,
31
+ const xmlChar *attributes);
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style);
34
+ #ifdef __cplusplus
35
+ }
36
+ #endif
37
+
38
+ #endif /* __XML_XSLT_ATTRIBUTES_H__ */
39
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/documents.h ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the document handling
3
+ * Description: implements document loading and cache (multiple
4
+ * document() reference for the same resources must
5
+ * be equal.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_DOCUMENTS_H__
13
+ #define __XML_XSLT_DOCUMENTS_H__
14
+
15
+ #include <libxml/tree.h>
16
+ #include "xsltexports.h"
17
+ #include "xsltInternals.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ XSLTPUBFUN xsltDocumentPtr XSLTCALL
24
+ xsltNewDocument (xsltTransformContextPtr ctxt,
25
+ xmlDocPtr doc);
26
+ XSLTPUBFUN xsltDocumentPtr XSLTCALL
27
+ xsltLoadDocument (xsltTransformContextPtr ctxt,
28
+ const xmlChar *URI);
29
+ XSLTPUBFUN xsltDocumentPtr XSLTCALL
30
+ xsltFindDocument (xsltTransformContextPtr ctxt,
31
+ xmlDocPtr doc);
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltFreeDocuments (xsltTransformContextPtr ctxt);
34
+
35
+ XSLTPUBFUN xsltDocumentPtr XSLTCALL
36
+ xsltLoadStyleDocument (xsltStylesheetPtr style,
37
+ const xmlChar *URI);
38
+ XSLTPUBFUN xsltDocumentPtr XSLTCALL
39
+ xsltNewStyleDocument (xsltStylesheetPtr style,
40
+ xmlDocPtr doc);
41
+ XSLTPUBFUN void XSLTCALL
42
+ xsltFreeStyleDocuments (xsltStylesheetPtr style);
43
+
44
+ /*
45
+ * Hooks for document loading
46
+ */
47
+
48
+ /**
49
+ * xsltLoadType:
50
+ *
51
+ * Enum defining the kind of loader requirement.
52
+ */
53
+ typedef enum {
54
+ XSLT_LOAD_START = 0, /* loading for a top stylesheet */
55
+ XSLT_LOAD_STYLESHEET = 1, /* loading for a stylesheet include/import */
56
+ XSLT_LOAD_DOCUMENT = 2 /* loading document at transformation time */
57
+ } xsltLoadType;
58
+
59
+ /**
60
+ * xsltDocLoaderFunc:
61
+ * @URI: the URI of the document to load
62
+ * @dict: the dictionary to use when parsing that document
63
+ * @options: parsing options, a set of xmlParserOption
64
+ * @ctxt: the context, either a stylesheet or a transformation context
65
+ * @type: the xsltLoadType indicating the kind of loading required
66
+ *
67
+ * An xsltDocLoaderFunc is a signature for a function which can be
68
+ * registered to load document not provided by the compilation or
69
+ * transformation API themselve, for example when an xsl:import,
70
+ * xsl:include is found at compilation time or when a document()
71
+ * call is made at runtime.
72
+ *
73
+ * Returns the pointer to the document (which will be modified and
74
+ * freed by the engine later), or NULL in case of error.
75
+ */
76
+ typedef xmlDocPtr (*xsltDocLoaderFunc) (const xmlChar *URI,
77
+ xmlDictPtr dict,
78
+ int options,
79
+ void *ctxt,
80
+ xsltLoadType type);
81
+
82
+ XSLTPUBFUN void XSLTCALL
83
+ xsltSetLoaderFunc (xsltDocLoaderFunc f);
84
+
85
+ /* the loader may be needed by extension libraries so it is exported */
86
+ XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader;
87
+
88
+ #ifdef __cplusplus
89
+ }
90
+ #endif
91
+
92
+ #endif /* __XML_XSLT_DOCUMENTS_H__ */
93
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/extensions.h ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the extension support
3
+ * Description: This provide the API needed for simple and module
4
+ * extension support.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_EXTENSION_H__
12
+ #define __XML_XSLT_EXTENSION_H__
13
+
14
+ #include <libxml/xpath.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * Extension Modules API.
24
+ */
25
+
26
+ /**
27
+ * xsltInitGlobals:
28
+ *
29
+ * Initialize the global variables for extensions
30
+ *
31
+ */
32
+
33
+ XSLTPUBFUN void XSLTCALL
34
+ xsltInitGlobals (void);
35
+
36
+ /**
37
+ * xsltStyleExtInitFunction:
38
+ * @ctxt: an XSLT stylesheet
39
+ * @URI: the namespace URI for the extension
40
+ *
41
+ * A function called at initialization time of an XSLT extension module.
42
+ *
43
+ * Returns a pointer to the module specific data for this transformation.
44
+ */
45
+ typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style,
46
+ const xmlChar *URI);
47
+
48
+ /**
49
+ * xsltStyleExtShutdownFunction:
50
+ * @ctxt: an XSLT stylesheet
51
+ * @URI: the namespace URI for the extension
52
+ * @data: the data associated to this module
53
+ *
54
+ * A function called at shutdown time of an XSLT extension module.
55
+ */
56
+ typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style,
57
+ const xmlChar *URI,
58
+ void *data);
59
+
60
+ /**
61
+ * xsltExtInitFunction:
62
+ * @ctxt: an XSLT transformation context
63
+ * @URI: the namespace URI for the extension
64
+ *
65
+ * A function called at initialization time of an XSLT extension module.
66
+ *
67
+ * Returns a pointer to the module specific data for this transformation.
68
+ */
69
+ typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt,
70
+ const xmlChar *URI);
71
+
72
+ /**
73
+ * xsltExtShutdownFunction:
74
+ * @ctxt: an XSLT transformation context
75
+ * @URI: the namespace URI for the extension
76
+ * @data: the data associated to this module
77
+ *
78
+ * A function called at shutdown time of an XSLT extension module.
79
+ */
80
+ typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
81
+ const xmlChar *URI,
82
+ void *data);
83
+
84
+ XSLTPUBFUN int XSLTCALL
85
+ xsltRegisterExtModule (const xmlChar *URI,
86
+ xsltExtInitFunction initFunc,
87
+ xsltExtShutdownFunction shutdownFunc);
88
+ XSLTPUBFUN int XSLTCALL
89
+ xsltRegisterExtModuleFull
90
+ (const xmlChar * URI,
91
+ xsltExtInitFunction initFunc,
92
+ xsltExtShutdownFunction shutdownFunc,
93
+ xsltStyleExtInitFunction styleInitFunc,
94
+ xsltStyleExtShutdownFunction styleShutdownFunc);
95
+
96
+ XSLTPUBFUN int XSLTCALL
97
+ xsltUnregisterExtModule (const xmlChar * URI);
98
+
99
+ XSLTPUBFUN void * XSLTCALL
100
+ xsltGetExtData (xsltTransformContextPtr ctxt,
101
+ const xmlChar *URI);
102
+
103
+ XSLTPUBFUN void * XSLTCALL
104
+ xsltStyleGetExtData (xsltStylesheetPtr style,
105
+ const xmlChar *URI);
106
+ #ifdef XSLT_REFACTORED
107
+ XSLTPUBFUN void * XSLTCALL
108
+ xsltStyleStylesheetLevelGetExtData(
109
+ xsltStylesheetPtr style,
110
+ const xmlChar * URI);
111
+ #endif
112
+ XSLTPUBFUN void XSLTCALL
113
+ xsltShutdownCtxtExts (xsltTransformContextPtr ctxt);
114
+
115
+ XSLTPUBFUN void XSLTCALL
116
+ xsltShutdownExts (xsltStylesheetPtr style);
117
+
118
+ XSLTPUBFUN xsltTransformContextPtr XSLTCALL
119
+ xsltXPathGetTransformContext
120
+ (xmlXPathParserContextPtr ctxt);
121
+
122
+ /*
123
+ * extension functions
124
+ */
125
+ XSLTPUBFUN int XSLTCALL
126
+ xsltRegisterExtModuleFunction
127
+ (const xmlChar *name,
128
+ const xmlChar *URI,
129
+ xmlXPathFunction function);
130
+ XSLTPUBFUN xmlXPathFunction XSLTCALL
131
+ xsltExtModuleFunctionLookup (const xmlChar *name,
132
+ const xmlChar *URI);
133
+ XSLTPUBFUN int XSLTCALL
134
+ xsltUnregisterExtModuleFunction
135
+ (const xmlChar *name,
136
+ const xmlChar *URI);
137
+
138
+ /*
139
+ * extension elements
140
+ */
141
+ typedef xsltElemPreCompPtr (*xsltPreComputeFunction)
142
+ (xsltStylesheetPtr style,
143
+ xmlNodePtr inst,
144
+ xsltTransformFunction function);
145
+
146
+ XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
147
+ xsltNewElemPreComp (xsltStylesheetPtr style,
148
+ xmlNodePtr inst,
149
+ xsltTransformFunction function);
150
+ XSLTPUBFUN void XSLTCALL
151
+ xsltInitElemPreComp (xsltElemPreCompPtr comp,
152
+ xsltStylesheetPtr style,
153
+ xmlNodePtr inst,
154
+ xsltTransformFunction function,
155
+ xsltElemPreCompDeallocator freeFunc);
156
+
157
+ XSLTPUBFUN int XSLTCALL
158
+ xsltRegisterExtModuleElement
159
+ (const xmlChar *name,
160
+ const xmlChar *URI,
161
+ xsltPreComputeFunction precomp,
162
+ xsltTransformFunction transform);
163
+ XSLTPUBFUN xsltTransformFunction XSLTCALL
164
+ xsltExtElementLookup (xsltTransformContextPtr ctxt,
165
+ const xmlChar *name,
166
+ const xmlChar *URI);
167
+ XSLTPUBFUN xsltTransformFunction XSLTCALL
168
+ xsltExtModuleElementLookup
169
+ (const xmlChar *name,
170
+ const xmlChar *URI);
171
+ XSLTPUBFUN xsltPreComputeFunction XSLTCALL
172
+ xsltExtModuleElementPreComputeLookup
173
+ (const xmlChar *name,
174
+ const xmlChar *URI);
175
+ XSLTPUBFUN int XSLTCALL
176
+ xsltUnregisterExtModuleElement
177
+ (const xmlChar *name,
178
+ const xmlChar *URI);
179
+
180
+ /*
181
+ * top-level elements
182
+ */
183
+ typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style,
184
+ xmlNodePtr inst);
185
+
186
+ XSLTPUBFUN int XSLTCALL
187
+ xsltRegisterExtModuleTopLevel
188
+ (const xmlChar *name,
189
+ const xmlChar *URI,
190
+ xsltTopLevelFunction function);
191
+ XSLTPUBFUN xsltTopLevelFunction XSLTCALL
192
+ xsltExtModuleTopLevelLookup
193
+ (const xmlChar *name,
194
+ const xmlChar *URI);
195
+ XSLTPUBFUN int XSLTCALL
196
+ xsltUnregisterExtModuleTopLevel
197
+ (const xmlChar *name,
198
+ const xmlChar *URI);
199
+
200
+
201
+ /* These 2 functions are deprecated for use within modules. */
202
+ XSLTPUBFUN int XSLTCALL
203
+ xsltRegisterExtFunction (xsltTransformContextPtr ctxt,
204
+ const xmlChar *name,
205
+ const xmlChar *URI,
206
+ xmlXPathFunction function);
207
+ XSLTPUBFUN int XSLTCALL
208
+ xsltRegisterExtElement (xsltTransformContextPtr ctxt,
209
+ const xmlChar *name,
210
+ const xmlChar *URI,
211
+ xsltTransformFunction function);
212
+
213
+ /*
214
+ * Extension Prefix handling API.
215
+ * Those are used by the XSLT (pre)processor.
216
+ */
217
+
218
+ XSLTPUBFUN int XSLTCALL
219
+ xsltRegisterExtPrefix (xsltStylesheetPtr style,
220
+ const xmlChar *prefix,
221
+ const xmlChar *URI);
222
+ XSLTPUBFUN int XSLTCALL
223
+ xsltCheckExtPrefix (xsltStylesheetPtr style,
224
+ const xmlChar *URI);
225
+ XSLTPUBFUN int XSLTCALL
226
+ xsltCheckExtURI (xsltStylesheetPtr style,
227
+ const xmlChar *URI);
228
+ XSLTPUBFUN int XSLTCALL
229
+ xsltInitCtxtExts (xsltTransformContextPtr ctxt);
230
+ XSLTPUBFUN void XSLTCALL
231
+ xsltFreeCtxtExts (xsltTransformContextPtr ctxt);
232
+ XSLTPUBFUN void XSLTCALL
233
+ xsltFreeExts (xsltStylesheetPtr style);
234
+
235
+ XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
236
+ xsltPreComputeExtModuleElement
237
+ (xsltStylesheetPtr style,
238
+ xmlNodePtr inst);
239
+ /*
240
+ * Extension Infos access.
241
+ * Used by exslt initialisation
242
+ */
243
+
244
+ XSLTPUBFUN xmlHashTablePtr XSLTCALL
245
+ xsltGetExtInfo (xsltStylesheetPtr style,
246
+ const xmlChar *URI);
247
+
248
+ /**
249
+ * Test of the extension module API
250
+ */
251
+ XSLTPUBFUN void XSLTCALL
252
+ xsltRegisterTestModule (void);
253
+ XSLTPUBFUN void XSLTCALL
254
+ xsltDebugDumpExtensions (FILE * output);
255
+
256
+
257
+ #ifdef __cplusplus
258
+ }
259
+ #endif
260
+
261
+ #endif /* __XML_XSLT_EXTENSION_H__ */
262
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/extra.h ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the non-standard features
3
+ * Description: implement some extension outside the XSLT namespace
4
+ * but not EXSLT with is in a different library.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_EXTRA_H__
12
+ #define __XML_XSLT_EXTRA_H__
13
+
14
+ #include <libxml/xpath.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * XSLT_LIBXSLT_NAMESPACE:
24
+ *
25
+ * This is the libxslt namespace for specific extensions.
26
+ */
27
+ #define XSLT_LIBXSLT_NAMESPACE ((xmlChar *) "http://xmlsoft.org/XSLT/namespace")
28
+
29
+ /**
30
+ * XSLT_SAXON_NAMESPACE:
31
+ *
32
+ * This is Michael Kay's Saxon processor namespace for extensions.
33
+ */
34
+ #define XSLT_SAXON_NAMESPACE ((xmlChar *) "http://icl.com/saxon")
35
+
36
+ /**
37
+ * XSLT_XT_NAMESPACE:
38
+ *
39
+ * This is James Clark's XT processor namespace for extensions.
40
+ */
41
+ #define XSLT_XT_NAMESPACE ((xmlChar *) "http://www.jclark.com/xt")
42
+
43
+ /**
44
+ * XSLT_XALAN_NAMESPACE:
45
+ *
46
+ * This is the Apache project XALAN processor namespace for extensions.
47
+ */
48
+ #define XSLT_XALAN_NAMESPACE ((xmlChar *) \
49
+ "org.apache.xalan.xslt.extensions.Redirect")
50
+
51
+
52
+ XSLTPUBFUN void XSLTCALL
53
+ xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt,
54
+ int nargs);
55
+ XSLTPUBFUN void XSLTCALL
56
+ xsltDebug (xsltTransformContextPtr ctxt,
57
+ xmlNodePtr node,
58
+ xmlNodePtr inst,
59
+ xsltElemPreCompPtr comp);
60
+
61
+
62
+ XSLTPUBFUN void XSLTCALL
63
+ xsltRegisterExtras (xsltTransformContextPtr ctxt);
64
+ XSLTPUBFUN void XSLTCALL
65
+ xsltRegisterAllExtras (void);
66
+
67
+ #ifdef __cplusplus
68
+ }
69
+ #endif
70
+
71
+ #endif /* __XML_XSLT_EXTRA_H__ */
72
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/functions.h ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the XSLT functions not from XPath
3
+ * Description: a set of extra functions coming from XSLT but not in XPath
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard and Bjorn Reese <[email protected]>
8
+ */
9
+
10
+ #ifndef __XML_XSLT_FUNCTIONS_H__
11
+ #define __XML_XSLT_FUNCTIONS_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include <libxml/xpathInternals.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * XSLT_REGISTER_FUNCTION_LOOKUP:
24
+ *
25
+ * Registering macro, not general purpose at all but used in different modules.
26
+ */
27
+ #define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \
28
+ xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \
29
+ xsltXPathFunctionLookup, \
30
+ (void *)(ctxt->xpathCtxt));
31
+
32
+ XSLTPUBFUN xmlXPathFunction XSLTCALL
33
+ xsltXPathFunctionLookup (void *vctxt,
34
+ const xmlChar *name,
35
+ const xmlChar *ns_uri);
36
+
37
+ /*
38
+ * Interfaces for the functions implementations.
39
+ */
40
+
41
+ XSLTPUBFUN void XSLTCALL
42
+ xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
43
+ int nargs);
44
+ XSLTPUBFUN void XSLTCALL
45
+ xsltKeyFunction (xmlXPathParserContextPtr ctxt,
46
+ int nargs);
47
+ XSLTPUBFUN void XSLTCALL
48
+ xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
49
+ int nargs);
50
+ XSLTPUBFUN void XSLTCALL
51
+ xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
52
+ int nargs);
53
+ XSLTPUBFUN void XSLTCALL
54
+ xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
55
+ int nargs);
56
+ XSLTPUBFUN void XSLTCALL
57
+ xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
58
+ int nargs);
59
+ XSLTPUBFUN void XSLTCALL
60
+ xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
61
+ int nargs);
62
+ XSLTPUBFUN void XSLTCALL
63
+ xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
64
+ int nargs);
65
+
66
+ /*
67
+ * And the registration
68
+ */
69
+
70
+ XSLTPUBFUN void XSLTCALL
71
+ xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
72
+
73
+ #ifdef __cplusplus
74
+ }
75
+ #endif
76
+
77
+ #endif /* __XML_XSLT_FUNCTIONS_H__ */
78
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/imports.h ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the XSLT import support
3
+ * Description: macros and fuctions needed to implement and
4
+ * access the import tree
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_IMPORTS_H__
12
+ #define __XML_XSLT_IMPORTS_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * XSLT_GET_IMPORT_PTR:
24
+ *
25
+ * A macro to import pointers from the stylesheet cascading order.
26
+ */
27
+ #define XSLT_GET_IMPORT_PTR(res, style, name) { \
28
+ xsltStylesheetPtr st = style; \
29
+ res = NULL; \
30
+ while (st != NULL) { \
31
+ if (st->name != NULL) { res = st->name; break; } \
32
+ st = xsltNextImport(st); \
33
+ }}
34
+
35
+ /**
36
+ * XSLT_GET_IMPORT_INT:
37
+ *
38
+ * A macro to import intergers from the stylesheet cascading order.
39
+ */
40
+ #define XSLT_GET_IMPORT_INT(res, style, name) { \
41
+ xsltStylesheetPtr st = style; \
42
+ res = -1; \
43
+ while (st != NULL) { \
44
+ if (st->name != -1) { res = st->name; break; } \
45
+ st = xsltNextImport(st); \
46
+ }}
47
+
48
+ /*
49
+ * Module interfaces
50
+ */
51
+ XSLTPUBFUN int XSLTCALL
52
+ xsltParseStylesheetImport(xsltStylesheetPtr style,
53
+ xmlNodePtr cur);
54
+ XSLTPUBFUN int XSLTCALL
55
+ xsltParseStylesheetInclude
56
+ (xsltStylesheetPtr style,
57
+ xmlNodePtr cur);
58
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
59
+ xsltNextImport (xsltStylesheetPtr style);
60
+ XSLTPUBFUN int XSLTCALL
61
+ xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
62
+ XSLTPUBFUN int XSLTCALL
63
+ xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
64
+ xmlNodePtr node);
65
+ XSLTPUBFUN xsltTemplatePtr XSLTCALL
66
+ xsltFindTemplate (xsltTransformContextPtr ctxt,
67
+ const xmlChar *name,
68
+ const xmlChar *nameURI);
69
+
70
+ #ifdef __cplusplus
71
+ }
72
+ #endif
73
+
74
+ #endif /* __XML_XSLT_IMPORTS_H__ */
75
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/keys.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the key matching used in key() and template matches.
3
+ * Description: implementation of the key mechanims.
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_KEY_H__
11
+ #define __XML_XSLT_KEY_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include "xsltexports.h"
15
+ #include "xsltInternals.h"
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ /**
22
+ * NODE_IS_KEYED:
23
+ *
24
+ * check for bit 15 set
25
+ */
26
+ #define NODE_IS_KEYED (1 >> 15)
27
+
28
+ XSLTPUBFUN int XSLTCALL
29
+ xsltAddKey (xsltStylesheetPtr style,
30
+ const xmlChar *name,
31
+ const xmlChar *nameURI,
32
+ const xmlChar *match,
33
+ const xmlChar *use,
34
+ xmlNodePtr inst);
35
+ XSLTPUBFUN xmlNodeSetPtr XSLTCALL
36
+ xsltGetKey (xsltTransformContextPtr ctxt,
37
+ const xmlChar *name,
38
+ const xmlChar *nameURI,
39
+ const xmlChar *value);
40
+ XSLTPUBFUN void XSLTCALL
41
+ xsltInitCtxtKeys (xsltTransformContextPtr ctxt,
42
+ xsltDocumentPtr doc);
43
+ XSLTPUBFUN void XSLTCALL
44
+ xsltFreeKeys (xsltStylesheetPtr style);
45
+ XSLTPUBFUN void XSLTCALL
46
+ xsltFreeDocumentKeys (xsltDocumentPtr doc);
47
+
48
+ #ifdef __cplusplus
49
+ }
50
+ #endif
51
+
52
+ #endif /* __XML_XSLT_H__ */
53
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/namespaces.h ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the XSLT namespace handling
3
+ * Description: set of function easing the processing and generation
4
+ * of namespace nodes in XSLT.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_NAMESPACES_H__
12
+ #define __XML_XSLT_NAMESPACES_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ /*
22
+ * Used within nsAliases hashtable when the default namespace is required
23
+ * but it's not been explicitly defined
24
+ */
25
+ /**
26
+ * UNDEFINED_DEFAULT_NS:
27
+ *
28
+ * Special value for undefined namespace, internal
29
+ */
30
+ #define UNDEFINED_DEFAULT_NS (const xmlChar *) -1L
31
+
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltNamespaceAlias (xsltStylesheetPtr style,
34
+ xmlNodePtr node);
35
+ XSLTPUBFUN xmlNsPtr XSLTCALL
36
+ xsltGetNamespace (xsltTransformContextPtr ctxt,
37
+ xmlNodePtr cur,
38
+ xmlNsPtr ns,
39
+ xmlNodePtr out);
40
+ XSLTPUBFUN xmlNsPtr XSLTCALL
41
+ xsltGetPlainNamespace (xsltTransformContextPtr ctxt,
42
+ xmlNodePtr cur,
43
+ xmlNsPtr ns,
44
+ xmlNodePtr out);
45
+ XSLTPUBFUN xmlNsPtr XSLTCALL
46
+ xsltGetSpecialNamespace (xsltTransformContextPtr ctxt,
47
+ xmlNodePtr cur,
48
+ const xmlChar *URI,
49
+ const xmlChar *prefix,
50
+ xmlNodePtr out);
51
+ XSLTPUBFUN xmlNsPtr XSLTCALL
52
+ xsltCopyNamespace (xsltTransformContextPtr ctxt,
53
+ xmlNodePtr elem,
54
+ xmlNsPtr ns);
55
+ XSLTPUBFUN xmlNsPtr XSLTCALL
56
+ xsltCopyNamespaceList (xsltTransformContextPtr ctxt,
57
+ xmlNodePtr node,
58
+ xmlNsPtr cur);
59
+ XSLTPUBFUN void XSLTCALL
60
+ xsltFreeNamespaceAliasHashes
61
+ (xsltStylesheetPtr style);
62
+
63
+ #ifdef __cplusplus
64
+ }
65
+ #endif
66
+
67
+ #endif /* __XML_XSLT_NAMESPACES_H__ */
68
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/numbersInternals.h ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Implementation of the XSLT number functions
3
+ * Description: Implementation of the XSLT number functions
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Bjorn Reese <[email protected]> and Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_NUMBERSINTERNALS_H__
11
+ #define __XML_XSLT_NUMBERSINTERNALS_H__
12
+
13
+ #include <libxml/tree.h>
14
+ #include "xsltexports.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ struct _xsltCompMatch;
21
+
22
+ /**
23
+ * xsltNumberData:
24
+ *
25
+ * This data structure is just a wrapper to pass xsl:number data in.
26
+ */
27
+ typedef struct _xsltNumberData xsltNumberData;
28
+ typedef xsltNumberData *xsltNumberDataPtr;
29
+
30
+ struct _xsltNumberData {
31
+ const xmlChar *level;
32
+ const xmlChar *count;
33
+ const xmlChar *from;
34
+ const xmlChar *value;
35
+ const xmlChar *format;
36
+ int has_format;
37
+ int digitsPerGroup;
38
+ int groupingCharacter;
39
+ int groupingCharacterLen;
40
+ xmlDocPtr doc;
41
+ xmlNodePtr node;
42
+ struct _xsltCompMatch *countPat;
43
+ struct _xsltCompMatch *fromPat;
44
+
45
+ /*
46
+ * accelerators
47
+ */
48
+ };
49
+
50
+ /**
51
+ * xsltFormatNumberInfo,:
52
+ *
53
+ * This data structure lists the various parameters needed to format numbers.
54
+ */
55
+ typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
56
+ typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
57
+
58
+ struct _xsltFormatNumberInfo {
59
+ int integer_hash; /* Number of '#' in integer part */
60
+ int integer_digits; /* Number of '0' in integer part */
61
+ int frac_digits; /* Number of '0' in fractional part */
62
+ int frac_hash; /* Number of '#' in fractional part */
63
+ int group; /* Number of chars per display 'group' */
64
+ int multiplier; /* Scaling for percent or permille */
65
+ char add_decimal; /* Flag for whether decimal point appears in pattern */
66
+ char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
67
+ char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
68
+ };
69
+
70
+ #ifdef __cplusplus
71
+ }
72
+ #endif
73
+ #endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxslt/pattern.h ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the pattern matching used in template matches.
3
+ * Description: the implementation of the lookup of the right template
4
+ * for a given node must be really fast in order to keep
5
+ * decent performances.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_PATTERN_H__
13
+ #define __XML_XSLT_PATTERN_H__
14
+
15
+ #include "xsltInternals.h"
16
+ #include "xsltexports.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * xsltCompMatch:
24
+ *
25
+ * Data structure used for the implementation of patterns.
26
+ * It is kept private (in pattern.c).
27
+ */
28
+ typedef struct _xsltCompMatch xsltCompMatch;
29
+ typedef xsltCompMatch *xsltCompMatchPtr;
30
+
31
+ /*
32
+ * Pattern related interfaces.
33
+ */
34
+
35
+ XSLTPUBFUN xsltCompMatchPtr XSLTCALL
36
+ xsltCompilePattern (const xmlChar *pattern,
37
+ xmlDocPtr doc,
38
+ xmlNodePtr node,
39
+ xsltStylesheetPtr style,
40
+ xsltTransformContextPtr runtime);
41
+ XSLTPUBFUN void XSLTCALL
42
+ xsltFreeCompMatchList (xsltCompMatchPtr comp);
43
+ XSLTPUBFUN int XSLTCALL
44
+ xsltTestCompMatchList (xsltTransformContextPtr ctxt,
45
+ xmlNodePtr node,
46
+ xsltCompMatchPtr comp);
47
+ XSLTPUBFUN void XSLTCALL
48
+ xsltCompMatchClearCache (xsltTransformContextPtr ctxt,
49
+ xsltCompMatchPtr comp);
50
+ XSLTPUBFUN void XSLTCALL
51
+ xsltNormalizeCompSteps (void *payload,
52
+ void *data,
53
+ const xmlChar *name);
54
+
55
+ /*
56
+ * Template related interfaces.
57
+ */
58
+ XSLTPUBFUN int XSLTCALL
59
+ xsltAddTemplate (xsltStylesheetPtr style,
60
+ xsltTemplatePtr cur,
61
+ const xmlChar *mode,
62
+ const xmlChar *modeURI);
63
+ XSLTPUBFUN xsltTemplatePtr XSLTCALL
64
+ xsltGetTemplate (xsltTransformContextPtr ctxt,
65
+ xmlNodePtr node,
66
+ xsltStylesheetPtr style);
67
+ XSLTPUBFUN void XSLTCALL
68
+ xsltFreeTemplateHashes (xsltStylesheetPtr style);
69
+ XSLTPUBFUN void XSLTCALL
70
+ xsltCleanupTemplates (xsltStylesheetPtr style);
71
+
72
+ #if 0
73
+ int xsltMatchPattern (xsltTransformContextPtr ctxt,
74
+ xmlNodePtr node,
75
+ const xmlChar *pattern,
76
+ xmlDocPtr ctxtdoc,
77
+ xmlNodePtr ctxtnode);
78
+ #endif
79
+ #ifdef __cplusplus
80
+ }
81
+ #endif
82
+
83
+ #endif /* __XML_XSLT_PATTERN_H__ */
84
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/preproc.h ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: precomputing stylesheets
3
+ * Description: this is the compilation phase, where most of the
4
+ * stylesheet is "compiled" into faster to use data.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_PRECOMP_H__
12
+ #define __XML_XSLT_PRECOMP_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /*
23
+ * Interfaces
24
+ */
25
+ XSLTPUBVAR const xmlChar *xsltExtMarker;
26
+
27
+ XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
28
+ xsltDocumentComp (xsltStylesheetPtr style,
29
+ xmlNodePtr inst,
30
+ xsltTransformFunction function);
31
+
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltStylePreCompute (xsltStylesheetPtr style,
34
+ xmlNodePtr inst);
35
+ XSLTPUBFUN void XSLTCALL
36
+ xsltFreeStylePreComps (xsltStylesheetPtr style);
37
+
38
+ #ifdef __cplusplus
39
+ }
40
+ #endif
41
+
42
+ #endif /* __XML_XSLT_PRECOMP_H__ */
43
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/security.h ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the libxslt security framework
3
+ * Description: the libxslt security framework allow to restrict
4
+ * the access to new resources (file or URL) from
5
+ * the stylesheet at runtime.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_SECURITY_H__
13
+ #define __XML_XSLT_SECURITY_H__
14
+
15
+ #include <libxml/tree.h>
16
+ #include "xsltexports.h"
17
+ #include "xsltInternals.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ /**
24
+ * xsltSecurityPref:
25
+ *
26
+ * structure to indicate the preferences for security in the XSLT
27
+ * transformation.
28
+ */
29
+ typedef struct _xsltSecurityPrefs xsltSecurityPrefs;
30
+ typedef xsltSecurityPrefs *xsltSecurityPrefsPtr;
31
+
32
+ /**
33
+ * xsltSecurityOption:
34
+ *
35
+ * the set of option that can be configured
36
+ */
37
+ typedef enum {
38
+ XSLT_SECPREF_READ_FILE = 1,
39
+ XSLT_SECPREF_WRITE_FILE,
40
+ XSLT_SECPREF_CREATE_DIRECTORY,
41
+ XSLT_SECPREF_READ_NETWORK,
42
+ XSLT_SECPREF_WRITE_NETWORK
43
+ } xsltSecurityOption;
44
+
45
+ /**
46
+ * xsltSecurityCheck:
47
+ *
48
+ * User provided function to check the value of a string like a file
49
+ * path or an URL ...
50
+ */
51
+ typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec,
52
+ xsltTransformContextPtr ctxt,
53
+ const char *value);
54
+
55
+ /*
56
+ * Module interfaces
57
+ */
58
+ XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
59
+ xsltNewSecurityPrefs (void);
60
+ XSLTPUBFUN void XSLTCALL
61
+ xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec);
62
+ XSLTPUBFUN int XSLTCALL
63
+ xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec,
64
+ xsltSecurityOption option,
65
+ xsltSecurityCheck func);
66
+ XSLTPUBFUN xsltSecurityCheck XSLTCALL
67
+ xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec,
68
+ xsltSecurityOption option);
69
+
70
+ XSLTPUBFUN void XSLTCALL
71
+ xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
72
+ XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
73
+ xsltGetDefaultSecurityPrefs (void);
74
+
75
+ XSLTPUBFUN int XSLTCALL
76
+ xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec,
77
+ xsltTransformContextPtr ctxt);
78
+
79
+ XSLTPUBFUN int XSLTCALL
80
+ xsltSecurityAllow (xsltSecurityPrefsPtr sec,
81
+ xsltTransformContextPtr ctxt,
82
+ const char *value);
83
+ XSLTPUBFUN int XSLTCALL
84
+ xsltSecurityForbid (xsltSecurityPrefsPtr sec,
85
+ xsltTransformContextPtr ctxt,
86
+ const char *value);
87
+ /*
88
+ * internal interfaces
89
+ */
90
+ XSLTPUBFUN int XSLTCALL
91
+ xsltCheckWrite (xsltSecurityPrefsPtr sec,
92
+ xsltTransformContextPtr ctxt,
93
+ const xmlChar *URL);
94
+ XSLTPUBFUN int XSLTCALL
95
+ xsltCheckRead (xsltSecurityPrefsPtr sec,
96
+ xsltTransformContextPtr ctxt,
97
+ const xmlChar *URL);
98
+
99
+ #ifdef __cplusplus
100
+ }
101
+ #endif
102
+
103
+ #endif /* __XML_XSLT_SECURITY_H__ */
104
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/templates.h ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the template processing
3
+ * Description: This set of routine encapsulates XPath calls
4
+ * and Attribute Value Templates evaluation.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_TEMPLATES_H__
12
+ #define __XML_XSLT_TEMPLATES_H__
13
+
14
+ #include <libxml/xpath.h>
15
+ #include <libxml/xpathInternals.h>
16
+ #include "xsltexports.h"
17
+ #include "xsltInternals.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ XSLTPUBFUN int XSLTCALL
24
+ xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
25
+ xmlXPathCompExprPtr comp,
26
+ xmlNsPtr *nsList,
27
+ int nsNr);
28
+ XSLTPUBFUN xmlChar * XSLTCALL
29
+ xsltEvalTemplateString (xsltTransformContextPtr ctxt,
30
+ xmlNodePtr contextNode,
31
+ xmlNodePtr inst);
32
+ XSLTPUBFUN xmlChar * XSLTCALL
33
+ xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
34
+ xmlNodePtr node,
35
+ const xmlChar *name,
36
+ const xmlChar *ns);
37
+ XSLTPUBFUN const xmlChar * XSLTCALL
38
+ xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
39
+ xmlNodePtr node,
40
+ const xmlChar *name,
41
+ const xmlChar *ns,
42
+ int *found);
43
+
44
+ /* TODO: this is obviously broken ... the namespaces should be passed too ! */
45
+ XSLTPUBFUN xmlChar * XSLTCALL
46
+ xsltEvalXPathString (xsltTransformContextPtr ctxt,
47
+ xmlXPathCompExprPtr comp);
48
+ XSLTPUBFUN xmlChar * XSLTCALL
49
+ xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
50
+ xmlXPathCompExprPtr comp,
51
+ int nsNr,
52
+ xmlNsPtr *nsList);
53
+
54
+ XSLTPUBFUN xmlNodePtr * XSLTCALL
55
+ xsltTemplateProcess (xsltTransformContextPtr ctxt,
56
+ xmlNodePtr node);
57
+ XSLTPUBFUN xmlAttrPtr XSLTCALL
58
+ xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
59
+ xmlNodePtr target,
60
+ xmlAttrPtr cur);
61
+ XSLTPUBFUN xmlAttrPtr XSLTCALL
62
+ xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
63
+ xmlNodePtr target,
64
+ xmlAttrPtr attr);
65
+ XSLTPUBFUN xmlChar * XSLTCALL
66
+ xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
67
+ const xmlChar* attr);
68
+ XSLTPUBFUN xmlChar * XSLTCALL
69
+ xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
70
+ const xmlChar* str,
71
+ xmlNodePtr node);
72
+ #ifdef __cplusplus
73
+ }
74
+ #endif
75
+
76
+ #endif /* __XML_XSLT_TEMPLATES_H__ */
77
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/transform.h ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: the XSLT engine transformation part.
3
+ * Description: This module implements the bulk of the actual
4
+ * transformation processing. Most of the xsl: element
5
+ * constructs are implemented in this module.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_TRANSFORM_H__
13
+ #define __XML_XSLT_TRANSFORM_H__
14
+
15
+ #include <libxml/parser.h>
16
+ #include <libxml/xmlIO.h>
17
+ #include "xsltexports.h"
18
+ #include <libxslt/xsltInternals.h>
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /**
25
+ * XInclude default processing.
26
+ */
27
+ XSLTPUBFUN void XSLTCALL
28
+ xsltSetXIncludeDefault (int xinclude);
29
+ XSLTPUBFUN int XSLTCALL
30
+ xsltGetXIncludeDefault (void);
31
+
32
+ /**
33
+ * Export context to users.
34
+ */
35
+ XSLTPUBFUN xsltTransformContextPtr XSLTCALL
36
+ xsltNewTransformContext (xsltStylesheetPtr style,
37
+ xmlDocPtr doc);
38
+
39
+ XSLTPUBFUN void XSLTCALL
40
+ xsltFreeTransformContext(xsltTransformContextPtr ctxt);
41
+
42
+ XSLTPUBFUN xmlDocPtr XSLTCALL
43
+ xsltApplyStylesheetUser (xsltStylesheetPtr style,
44
+ xmlDocPtr doc,
45
+ const char **params,
46
+ const char *output,
47
+ FILE * profile,
48
+ xsltTransformContextPtr userCtxt);
49
+ XSLTPUBFUN void XSLTCALL
50
+ xsltProcessOneNode (xsltTransformContextPtr ctxt,
51
+ xmlNodePtr node,
52
+ xsltStackElemPtr params);
53
+ /**
54
+ * Private Interfaces.
55
+ */
56
+ XSLTPUBFUN void XSLTCALL
57
+ xsltApplyStripSpaces (xsltTransformContextPtr ctxt,
58
+ xmlNodePtr node);
59
+ XSLTPUBFUN xmlDocPtr XSLTCALL
60
+ xsltApplyStylesheet (xsltStylesheetPtr style,
61
+ xmlDocPtr doc,
62
+ const char **params);
63
+ XSLTPUBFUN xmlDocPtr XSLTCALL
64
+ xsltProfileStylesheet (xsltStylesheetPtr style,
65
+ xmlDocPtr doc,
66
+ const char **params,
67
+ FILE * output);
68
+ XSLTPUBFUN int XSLTCALL
69
+ xsltRunStylesheet (xsltStylesheetPtr style,
70
+ xmlDocPtr doc,
71
+ const char **params,
72
+ const char *output,
73
+ xmlSAXHandlerPtr SAX,
74
+ xmlOutputBufferPtr IObuf);
75
+ XSLTPUBFUN int XSLTCALL
76
+ xsltRunStylesheetUser (xsltStylesheetPtr style,
77
+ xmlDocPtr doc,
78
+ const char **params,
79
+ const char *output,
80
+ xmlSAXHandlerPtr SAX,
81
+ xmlOutputBufferPtr IObuf,
82
+ FILE * profile,
83
+ xsltTransformContextPtr userCtxt);
84
+ XSLTPUBFUN void XSLTCALL
85
+ xsltApplyOneTemplate (xsltTransformContextPtr ctxt,
86
+ xmlNodePtr node,
87
+ xmlNodePtr list,
88
+ xsltTemplatePtr templ,
89
+ xsltStackElemPtr params);
90
+ XSLTPUBFUN void XSLTCALL
91
+ xsltDocumentElem (xsltTransformContextPtr ctxt,
92
+ xmlNodePtr node,
93
+ xmlNodePtr inst,
94
+ xsltElemPreCompPtr comp);
95
+ XSLTPUBFUN void XSLTCALL
96
+ xsltSort (xsltTransformContextPtr ctxt,
97
+ xmlNodePtr node,
98
+ xmlNodePtr inst,
99
+ xsltElemPreCompPtr comp);
100
+ XSLTPUBFUN void XSLTCALL
101
+ xsltCopy (xsltTransformContextPtr ctxt,
102
+ xmlNodePtr node,
103
+ xmlNodePtr inst,
104
+ xsltElemPreCompPtr comp);
105
+ XSLTPUBFUN void XSLTCALL
106
+ xsltText (xsltTransformContextPtr ctxt,
107
+ xmlNodePtr node,
108
+ xmlNodePtr inst,
109
+ xsltElemPreCompPtr comp);
110
+ XSLTPUBFUN void XSLTCALL
111
+ xsltElement (xsltTransformContextPtr ctxt,
112
+ xmlNodePtr node,
113
+ xmlNodePtr inst,
114
+ xsltElemPreCompPtr comp);
115
+ XSLTPUBFUN void XSLTCALL
116
+ xsltComment (xsltTransformContextPtr ctxt,
117
+ xmlNodePtr node,
118
+ xmlNodePtr inst,
119
+ xsltElemPreCompPtr comp);
120
+ XSLTPUBFUN void XSLTCALL
121
+ xsltAttribute (xsltTransformContextPtr ctxt,
122
+ xmlNodePtr node,
123
+ xmlNodePtr inst,
124
+ xsltElemPreCompPtr comp);
125
+ XSLTPUBFUN void XSLTCALL
126
+ xsltProcessingInstruction(xsltTransformContextPtr ctxt,
127
+ xmlNodePtr node,
128
+ xmlNodePtr inst,
129
+ xsltElemPreCompPtr comp);
130
+ XSLTPUBFUN void XSLTCALL
131
+ xsltCopyOf (xsltTransformContextPtr ctxt,
132
+ xmlNodePtr node,
133
+ xmlNodePtr inst,
134
+ xsltElemPreCompPtr comp);
135
+ XSLTPUBFUN void XSLTCALL
136
+ xsltValueOf (xsltTransformContextPtr ctxt,
137
+ xmlNodePtr node,
138
+ xmlNodePtr inst,
139
+ xsltElemPreCompPtr comp);
140
+ XSLTPUBFUN void XSLTCALL
141
+ xsltNumber (xsltTransformContextPtr ctxt,
142
+ xmlNodePtr node,
143
+ xmlNodePtr inst,
144
+ xsltElemPreCompPtr comp);
145
+ XSLTPUBFUN void XSLTCALL
146
+ xsltApplyImports (xsltTransformContextPtr ctxt,
147
+ xmlNodePtr node,
148
+ xmlNodePtr inst,
149
+ xsltElemPreCompPtr comp);
150
+ XSLTPUBFUN void XSLTCALL
151
+ xsltCallTemplate (xsltTransformContextPtr ctxt,
152
+ xmlNodePtr node,
153
+ xmlNodePtr inst,
154
+ xsltElemPreCompPtr comp);
155
+ XSLTPUBFUN void XSLTCALL
156
+ xsltApplyTemplates (xsltTransformContextPtr ctxt,
157
+ xmlNodePtr node,
158
+ xmlNodePtr inst,
159
+ xsltElemPreCompPtr comp);
160
+ XSLTPUBFUN void XSLTCALL
161
+ xsltChoose (xsltTransformContextPtr ctxt,
162
+ xmlNodePtr node,
163
+ xmlNodePtr inst,
164
+ xsltElemPreCompPtr comp);
165
+ XSLTPUBFUN void XSLTCALL
166
+ xsltIf (xsltTransformContextPtr ctxt,
167
+ xmlNodePtr node,
168
+ xmlNodePtr inst,
169
+ xsltElemPreCompPtr comp);
170
+ XSLTPUBFUN void XSLTCALL
171
+ xsltForEach (xsltTransformContextPtr ctxt,
172
+ xmlNodePtr node,
173
+ xmlNodePtr inst,
174
+ xsltElemPreCompPtr comp);
175
+ XSLTPUBFUN void XSLTCALL
176
+ xsltRegisterAllElement (xsltTransformContextPtr ctxt);
177
+
178
+ XSLTPUBFUN xmlNodePtr XSLTCALL
179
+ xsltCopyTextString (xsltTransformContextPtr ctxt,
180
+ xmlNodePtr target,
181
+ const xmlChar *string,
182
+ int noescape);
183
+
184
+ /* Following 2 functions needed for libexslt/functions.c */
185
+ XSLTPUBFUN void XSLTCALL
186
+ xsltLocalVariablePop (xsltTransformContextPtr ctxt,
187
+ int limitNr,
188
+ int level);
189
+ XSLTPUBFUN int XSLTCALL
190
+ xsltLocalVariablePush (xsltTransformContextPtr ctxt,
191
+ xsltStackElemPtr variable,
192
+ int level);
193
+ /*
194
+ * Hook for the debugger if activated.
195
+ */
196
+ XSLTPUBFUN void XSLTCALL
197
+ xslHandleDebugger (xmlNodePtr cur,
198
+ xmlNodePtr node,
199
+ xsltTemplatePtr templ,
200
+ xsltTransformContextPtr ctxt);
201
+
202
+ #ifdef __cplusplus
203
+ }
204
+ #endif
205
+
206
+ #endif /* __XML_XSLT_TRANSFORM_H__ */
207
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/variables.h ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: interface for the variable matching and lookup.
3
+ * Description: interface for the variable matching and lookup.
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_VARIABLES_H__
11
+ #define __XML_XSLT_VARIABLES_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include <libxml/xpathInternals.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+ #include "functions.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+
24
+ /**
25
+ * XSLT_REGISTER_VARIABLE_LOOKUP:
26
+ *
27
+ * Registering macro, not general purpose at all but used in different modules.
28
+ */
29
+
30
+ #define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt) \
31
+ xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt, \
32
+ xsltXPathVariableLookup, (void *)(ctxt)); \
33
+ xsltRegisterAllFunctions((ctxt)->xpathCtxt); \
34
+ xsltRegisterAllElement(ctxt); \
35
+ (ctxt)->xpathCtxt->extra = ctxt
36
+
37
+ /*
38
+ * Flags for memory management of RVTs
39
+ */
40
+
41
+ /**
42
+ * XSLT_RVT_LOCAL:
43
+ *
44
+ * RVT is destroyed after the current instructions ends.
45
+ */
46
+ #define XSLT_RVT_LOCAL 1
47
+
48
+ /**
49
+ * XSLT_RVT_FUNC_RESULT:
50
+ *
51
+ * RVT is part of results returned with func:result. The RVT won't be
52
+ * destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
53
+ * XSLT_RVT_VARIABLE in the template that receives the return value.
54
+ */
55
+ #define XSLT_RVT_FUNC_RESULT 2
56
+
57
+ /**
58
+ * XSLT_RVT_GLOBAL:
59
+ *
60
+ * RVT is part of a global variable.
61
+ */
62
+ #define XSLT_RVT_GLOBAL 3
63
+
64
+ /*
65
+ * Interfaces for the variable module.
66
+ */
67
+
68
+ XSLTPUBFUN int XSLTCALL
69
+ xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
70
+ XSLTPUBFUN int XSLTCALL
71
+ xsltEvalUserParams (xsltTransformContextPtr ctxt,
72
+ const char **params);
73
+ XSLTPUBFUN int XSLTCALL
74
+ xsltQuoteUserParams (xsltTransformContextPtr ctxt,
75
+ const char **params);
76
+ XSLTPUBFUN int XSLTCALL
77
+ xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
78
+ const xmlChar * name,
79
+ const xmlChar * value);
80
+ XSLTPUBFUN int XSLTCALL
81
+ xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
82
+ const xmlChar * name,
83
+ const xmlChar * value);
84
+
85
+ XSLTPUBFUN void XSLTCALL
86
+ xsltParseGlobalVariable (xsltStylesheetPtr style,
87
+ xmlNodePtr cur);
88
+ XSLTPUBFUN void XSLTCALL
89
+ xsltParseGlobalParam (xsltStylesheetPtr style,
90
+ xmlNodePtr cur);
91
+ XSLTPUBFUN void XSLTCALL
92
+ xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
93
+ xmlNodePtr cur);
94
+ XSLTPUBFUN void XSLTCALL
95
+ xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
96
+ xmlNodePtr cur);
97
+ XSLTPUBFUN xsltStackElemPtr XSLTCALL
98
+ xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
99
+ xmlNodePtr cur);
100
+ XSLTPUBFUN int XSLTCALL
101
+ xsltAddStackElemList (xsltTransformContextPtr ctxt,
102
+ xsltStackElemPtr elems);
103
+ XSLTPUBFUN void XSLTCALL
104
+ xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
105
+ XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
106
+ xsltVariableLookup (xsltTransformContextPtr ctxt,
107
+ const xmlChar *name,
108
+ const xmlChar *ns_uri);
109
+ XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
110
+ xsltXPathVariableLookup (void *ctxt,
111
+ const xmlChar *name,
112
+ const xmlChar *ns_uri);
113
+ #ifdef __cplusplus
114
+ }
115
+ #endif
116
+
117
+ #endif /* __XML_XSLT_VARIABLES_H__ */
118
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xslt.h ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Interfaces, constants and types related to the XSLT engine
3
+ * Description: Interfaces, constants and types related to the XSLT engine
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_H__
11
+ #define __XML_XSLT_H__
12
+
13
+ #include <libxml/tree.h>
14
+ #include "xsltexports.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ /**
21
+ * XSLT_DEFAULT_VERSION:
22
+ *
23
+ * The default version of XSLT supported.
24
+ */
25
+ #define XSLT_DEFAULT_VERSION "1.0"
26
+
27
+ /**
28
+ * XSLT_DEFAULT_VENDOR:
29
+ *
30
+ * The XSLT "vendor" string for this processor.
31
+ */
32
+ #define XSLT_DEFAULT_VENDOR "libxslt"
33
+
34
+ /**
35
+ * XSLT_DEFAULT_URL:
36
+ *
37
+ * The XSLT "vendor" URL for this processor.
38
+ */
39
+ #define XSLT_DEFAULT_URL "http://xmlsoft.org/XSLT/"
40
+
41
+ /**
42
+ * XSLT_NAMESPACE:
43
+ *
44
+ * The XSLT specification namespace.
45
+ */
46
+ #define XSLT_NAMESPACE ((const xmlChar *)"http://www.w3.org/1999/XSL/Transform")
47
+
48
+ /**
49
+ * XSLT_PARSE_OPTIONS:
50
+ *
51
+ * The set of options to pass to an xmlReadxxx when loading files for
52
+ * XSLT consumption.
53
+ */
54
+ #define XSLT_PARSE_OPTIONS \
55
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_NOCDATA
56
+
57
+ /**
58
+ * xsltMaxDepth:
59
+ *
60
+ * This value is used to detect templates loops.
61
+ */
62
+ XSLTPUBVAR int xsltMaxDepth;
63
+
64
+ /**
65
+ * * xsltMaxVars:
66
+ * *
67
+ * * This value is used to detect templates loops.
68
+ * */
69
+ XSLTPUBVAR int xsltMaxVars;
70
+
71
+ /**
72
+ * xsltEngineVersion:
73
+ *
74
+ * The version string for libxslt.
75
+ */
76
+ XSLTPUBVAR const char *xsltEngineVersion;
77
+
78
+ /**
79
+ * xsltLibxsltVersion:
80
+ *
81
+ * The version of libxslt compiled.
82
+ */
83
+ XSLTPUBVAR const int xsltLibxsltVersion;
84
+
85
+ /**
86
+ * xsltLibxmlVersion:
87
+ *
88
+ * The version of libxml libxslt was compiled against.
89
+ */
90
+ XSLTPUBVAR const int xsltLibxmlVersion;
91
+
92
+ /*
93
+ * Global initialization function.
94
+ */
95
+
96
+ XSLTPUBFUN void XSLTCALL
97
+ xsltInit (void);
98
+
99
+ /*
100
+ * Global cleanup function.
101
+ */
102
+ XSLTPUBFUN void XSLTCALL
103
+ xsltCleanupGlobals (void);
104
+
105
+ #ifdef __cplusplus
106
+ }
107
+ #endif
108
+
109
+ #endif /* __XML_XSLT_H__ */
110
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltInternals.h ADDED
@@ -0,0 +1,1992 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: internal data structures, constants and functions
3
+ * Description: Internal data structures, constants and functions used
4
+ * by the XSLT engine.
5
+ * They are not part of the API or ABI, i.e. they can change
6
+ * without prior notice, use carefully.
7
+ *
8
+ * Copy: See Copyright for the status of this software.
9
+ *
10
+ * Author: Daniel Veillard
11
+ */
12
+
13
+ #ifndef __XML_XSLT_INTERNALS_H__
14
+ #define __XML_XSLT_INTERNALS_H__
15
+
16
+ #include <libxml/tree.h>
17
+ #include <libxml/hash.h>
18
+ #include <libxml/xpath.h>
19
+ #include <libxml/xmlerror.h>
20
+ #include <libxml/dict.h>
21
+ #include <libxml/xmlstring.h>
22
+ #include <libxslt/xslt.h>
23
+ #include "xsltexports.h"
24
+ #include "numbersInternals.h"
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+ /* #define XSLT_DEBUG_PROFILE_CACHE */
31
+
32
+ /**
33
+ * XSLT_IS_TEXT_NODE:
34
+ *
35
+ * check if the argument is a text node
36
+ */
37
+ #define XSLT_IS_TEXT_NODE(n) ((n != NULL) && \
38
+ (((n)->type == XML_TEXT_NODE) || \
39
+ ((n)->type == XML_CDATA_SECTION_NODE)))
40
+
41
+
42
+ /**
43
+ * XSLT_MARK_RES_TREE_FRAG:
44
+ *
45
+ * internal macro to set up tree fragments
46
+ */
47
+ #define XSLT_MARK_RES_TREE_FRAG(n) \
48
+ (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt");
49
+
50
+ /**
51
+ * XSLT_IS_RES_TREE_FRAG:
52
+ *
53
+ * internal macro to test tree fragments
54
+ */
55
+ #define XSLT_IS_RES_TREE_FRAG(n) \
56
+ ((n != NULL) && ((n)->type == XML_DOCUMENT_NODE) && \
57
+ ((n)->name != NULL) && ((n)->name[0] == ' '))
58
+
59
+ /**
60
+ * XSLT_REFACTORED_KEYCOMP:
61
+ *
62
+ * Internal define to enable on-demand xsl:key computation.
63
+ * That's the only mode now but the define is kept for compatibility
64
+ */
65
+ #define XSLT_REFACTORED_KEYCOMP
66
+
67
+ /**
68
+ * XSLT_FAST_IF:
69
+ *
70
+ * Internal define to enable usage of xmlXPathCompiledEvalToBoolean()
71
+ * for XSLT "tests"; e.g. in <xsl:if test="/foo/bar">
72
+ */
73
+ #define XSLT_FAST_IF
74
+
75
+ /**
76
+ * XSLT_REFACTORED:
77
+ *
78
+ * Internal define to enable the refactored parts of Libxslt.
79
+ */
80
+ /* #define XSLT_REFACTORED */
81
+ /* ==================================================================== */
82
+
83
+ /**
84
+ * XSLT_REFACTORED_VARS:
85
+ *
86
+ * Internal define to enable the refactored variable part of libxslt
87
+ */
88
+ #define XSLT_REFACTORED_VARS
89
+
90
+ #ifdef XSLT_REFACTORED
91
+
92
+ extern const xmlChar *xsltXSLTAttrMarker;
93
+
94
+
95
+ /* TODO: REMOVE: #define XSLT_REFACTORED_EXCLRESNS */
96
+
97
+ /* TODO: REMOVE: #define XSLT_REFACTORED_NSALIAS */
98
+
99
+ /**
100
+ * XSLT_REFACTORED_XSLT_NSCOMP
101
+ *
102
+ * Internal define to enable the pointer-comparison of
103
+ * namespaces of XSLT elements.
104
+ */
105
+ /* #define XSLT_REFACTORED_XSLT_NSCOMP */
106
+
107
+ #ifdef XSLT_REFACTORED_XSLT_NSCOMP
108
+
109
+ extern const xmlChar *xsltConstNamespaceNameXSLT;
110
+
111
+ /**
112
+ * IS_XSLT_ELEM_FAST:
113
+ *
114
+ * quick test to detect XSLT elements
115
+ */
116
+ #define IS_XSLT_ELEM_FAST(n) \
117
+ (((n) != NULL) && ((n)->ns != NULL) && \
118
+ ((n)->ns->href == xsltConstNamespaceNameXSLT))
119
+
120
+ /**
121
+ * IS_XSLT_ATTR_FAST:
122
+ *
123
+ * quick test to detect XSLT attributes
124
+ */
125
+ #define IS_XSLT_ATTR_FAST(a) \
126
+ (((a) != NULL) && ((a)->ns != NULL) && \
127
+ ((a)->ns->href == xsltConstNamespaceNameXSLT))
128
+
129
+ /**
130
+ * XSLT_HAS_INTERNAL_NSMAP:
131
+ *
132
+ * check for namespace mapping
133
+ */
134
+ #define XSLT_HAS_INTERNAL_NSMAP(s) \
135
+ (((s) != NULL) && ((s)->principal) && \
136
+ ((s)->principal->principalData) && \
137
+ ((s)->principal->principalData->nsMap))
138
+
139
+ /**
140
+ * XSLT_GET_INTERNAL_NSMAP:
141
+ *
142
+ * get pointer to namespace map
143
+ */
144
+ #define XSLT_GET_INTERNAL_NSMAP(s) ((s)->principal->principalData->nsMap)
145
+
146
+ #else /* XSLT_REFACTORED_XSLT_NSCOMP */
147
+
148
+ /**
149
+ * IS_XSLT_ELEM_FAST:
150
+ *
151
+ * quick check whether this is an xslt element
152
+ */
153
+ #define IS_XSLT_ELEM_FAST(n) \
154
+ (((n) != NULL) && ((n)->ns != NULL) && \
155
+ (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
156
+
157
+ /**
158
+ * IS_XSLT_ATTR_FAST:
159
+ *
160
+ * quick check for xslt namespace attribute
161
+ */
162
+ #define IS_XSLT_ATTR_FAST(a) \
163
+ (((a) != NULL) && ((a)->ns != NULL) && \
164
+ (xmlStrEqual((a)->ns->href, XSLT_NAMESPACE)))
165
+
166
+
167
+ #endif /* XSLT_REFACTORED_XSLT_NSCOMP */
168
+
169
+
170
+ /**
171
+ * XSLT_REFACTORED_MANDATORY_VERSION:
172
+ *
173
+ * TODO: Currently disabled to surpress regression test failures, since
174
+ * the old behaviour was that a missing version attribute
175
+ * produced a only a warning and not an error, which was incerrect.
176
+ * So the regression tests need to be fixed if this is enabled.
177
+ */
178
+ /* #define XSLT_REFACTORED_MANDATORY_VERSION */
179
+
180
+ /**
181
+ * xsltPointerList:
182
+ *
183
+ * Pointer-list for various purposes.
184
+ */
185
+ typedef struct _xsltPointerList xsltPointerList;
186
+ typedef xsltPointerList *xsltPointerListPtr;
187
+ struct _xsltPointerList {
188
+ void **items;
189
+ int number;
190
+ int size;
191
+ };
192
+
193
+ #endif
194
+
195
+ /**
196
+ * XSLT_REFACTORED_PARSING:
197
+ *
198
+ * Internal define to enable the refactored parts of Libxslt
199
+ * related to parsing.
200
+ */
201
+ /* #define XSLT_REFACTORED_PARSING */
202
+
203
+ /**
204
+ * XSLT_MAX_SORT:
205
+ *
206
+ * Max number of specified xsl:sort on an element.
207
+ */
208
+ #define XSLT_MAX_SORT 15
209
+
210
+ /**
211
+ * XSLT_PAT_NO_PRIORITY:
212
+ *
213
+ * Specific value for pattern without priority expressed.
214
+ */
215
+ #define XSLT_PAT_NO_PRIORITY -12345789
216
+
217
+ /**
218
+ * xsltRuntimeExtra:
219
+ *
220
+ * Extra information added to the transformation context.
221
+ */
222
+ typedef struct _xsltRuntimeExtra xsltRuntimeExtra;
223
+ typedef xsltRuntimeExtra *xsltRuntimeExtraPtr;
224
+ struct _xsltRuntimeExtra {
225
+ void *info; /* pointer to the extra data */
226
+ xmlFreeFunc deallocate; /* pointer to the deallocation routine */
227
+ union { /* dual-purpose field */
228
+ void *ptr; /* data not needing deallocation */
229
+ int ival; /* integer value storage */
230
+ } val;
231
+ };
232
+
233
+ /**
234
+ * XSLT_RUNTIME_EXTRA_LST:
235
+ * @ctxt: the transformation context
236
+ * @nr: the index
237
+ *
238
+ * Macro used to access extra information stored in the context
239
+ */
240
+ #define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info
241
+ /**
242
+ * XSLT_RUNTIME_EXTRA_FREE:
243
+ * @ctxt: the transformation context
244
+ * @nr: the index
245
+ *
246
+ * Macro used to free extra information stored in the context
247
+ */
248
+ #define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate
249
+ /**
250
+ * XSLT_RUNTIME_EXTRA:
251
+ * @ctxt: the transformation context
252
+ * @nr: the index
253
+ *
254
+ * Macro used to define extra information stored in the context
255
+ */
256
+ #define XSLT_RUNTIME_EXTRA(ctxt, nr, typ) (ctxt)->extras[(nr)].val.typ
257
+
258
+ /**
259
+ * xsltTemplate:
260
+ *
261
+ * The in-memory structure corresponding to an XSLT Template.
262
+ */
263
+ typedef struct _xsltTemplate xsltTemplate;
264
+ typedef xsltTemplate *xsltTemplatePtr;
265
+ struct _xsltTemplate {
266
+ struct _xsltTemplate *next;/* chained list sorted by priority */
267
+ struct _xsltStylesheet *style;/* the containing stylesheet */
268
+ xmlChar *match; /* the matching string */
269
+ float priority; /* as given from the stylesheet, not computed */
270
+ const xmlChar *name; /* the local part of the name QName */
271
+ const xmlChar *nameURI; /* the URI part of the name QName */
272
+ const xmlChar *mode;/* the local part of the mode QName */
273
+ const xmlChar *modeURI;/* the URI part of the mode QName */
274
+ xmlNodePtr content; /* the template replacement value */
275
+ xmlNodePtr elem; /* the source element */
276
+
277
+ /*
278
+ * TODO: @inheritedNsNr and @inheritedNs won't be used in the
279
+ * refactored code.
280
+ */
281
+ int inheritedNsNr; /* number of inherited namespaces */
282
+ xmlNsPtr *inheritedNs;/* inherited non-excluded namespaces */
283
+
284
+ /* Profiling information */
285
+ int nbCalls; /* the number of time the template was called */
286
+ unsigned long time; /* the time spent in this template */
287
+ void *params; /* xsl:param instructions */
288
+
289
+ int templNr; /* Nb of templates in the stack */
290
+ int templMax; /* Size of the templtes stack */
291
+ xsltTemplatePtr *templCalledTab; /* templates called */
292
+ int *templCountTab; /* .. and how often */
293
+
294
+ /* Conflict resolution */
295
+ int position;
296
+ };
297
+
298
+ /**
299
+ * xsltDecimalFormat:
300
+ *
301
+ * Data structure of decimal-format.
302
+ */
303
+ typedef struct _xsltDecimalFormat xsltDecimalFormat;
304
+ typedef xsltDecimalFormat *xsltDecimalFormatPtr;
305
+ struct _xsltDecimalFormat {
306
+ struct _xsltDecimalFormat *next; /* chained list */
307
+ xmlChar *name;
308
+ /* Used for interpretation of pattern */
309
+ xmlChar *digit;
310
+ xmlChar *patternSeparator;
311
+ /* May appear in result */
312
+ xmlChar *minusSign;
313
+ xmlChar *infinity;
314
+ xmlChar *noNumber; /* Not-a-number */
315
+ /* Used for interpretation of pattern and may appear in result */
316
+ xmlChar *decimalPoint;
317
+ xmlChar *grouping;
318
+ xmlChar *percent;
319
+ xmlChar *permille;
320
+ xmlChar *zeroDigit;
321
+ const xmlChar *nsUri;
322
+ };
323
+
324
+ /**
325
+ * xsltDocument:
326
+ *
327
+ * Data structure associated to a parsed document.
328
+ */
329
+ typedef struct _xsltDocument xsltDocument;
330
+ typedef xsltDocument *xsltDocumentPtr;
331
+ struct _xsltDocument {
332
+ struct _xsltDocument *next; /* documents are kept in a chained list */
333
+ int main; /* is this the main document */
334
+ xmlDocPtr doc; /* the parsed document */
335
+ void *keys; /* key tables storage */
336
+ struct _xsltDocument *includes; /* subsidiary includes */
337
+ int preproc; /* pre-processing already done */
338
+ int nbKeysComputed;
339
+ };
340
+
341
+ /**
342
+ * xsltKeyDef:
343
+ *
344
+ * Representation of an xsl:key.
345
+ */
346
+ typedef struct _xsltKeyDef xsltKeyDef;
347
+ typedef xsltKeyDef *xsltKeyDefPtr;
348
+ struct _xsltKeyDef {
349
+ struct _xsltKeyDef *next;
350
+ xmlNodePtr inst;
351
+ xmlChar *name;
352
+ xmlChar *nameURI;
353
+ xmlChar *match;
354
+ xmlChar *use;
355
+ xmlXPathCompExprPtr comp;
356
+ xmlXPathCompExprPtr usecomp;
357
+ xmlNsPtr *nsList; /* the namespaces in scope */
358
+ int nsNr; /* the number of namespaces in scope */
359
+ };
360
+
361
+ /**
362
+ * xsltKeyTable:
363
+ *
364
+ * Holds the computed keys for key definitions of the same QName.
365
+ * Is owned by an xsltDocument.
366
+ */
367
+ typedef struct _xsltKeyTable xsltKeyTable;
368
+ typedef xsltKeyTable *xsltKeyTablePtr;
369
+ struct _xsltKeyTable {
370
+ struct _xsltKeyTable *next;
371
+ xmlChar *name;
372
+ xmlChar *nameURI;
373
+ xmlHashTablePtr keys;
374
+ };
375
+
376
+ /*
377
+ * The in-memory structure corresponding to an XSLT Stylesheet.
378
+ * NOTE: most of the content is simply linked from the doc tree
379
+ * structure, no specific allocation is made.
380
+ */
381
+ typedef struct _xsltStylesheet xsltStylesheet;
382
+ typedef xsltStylesheet *xsltStylesheetPtr;
383
+
384
+ typedef struct _xsltTransformContext xsltTransformContext;
385
+ typedef xsltTransformContext *xsltTransformContextPtr;
386
+
387
+ /**
388
+ * xsltElemPreComp:
389
+ *
390
+ * The in-memory structure corresponding to element precomputed data,
391
+ * designed to be extended by extension implementors.
392
+ */
393
+ typedef struct _xsltElemPreComp xsltElemPreComp;
394
+ typedef xsltElemPreComp *xsltElemPreCompPtr;
395
+
396
+ /**
397
+ * xsltTransformFunction:
398
+ * @ctxt: the XSLT transformation context
399
+ * @node: the input node
400
+ * @inst: the stylesheet node
401
+ * @comp: the compiled information from the stylesheet
402
+ *
403
+ * Signature of the function associated to elements part of the
404
+ * stylesheet language like xsl:if or xsl:apply-templates.
405
+ */
406
+ typedef void (*xsltTransformFunction) (xsltTransformContextPtr ctxt,
407
+ xmlNodePtr node,
408
+ xmlNodePtr inst,
409
+ xsltElemPreCompPtr comp);
410
+
411
+ /**
412
+ * xsltSortFunc:
413
+ * @ctxt: a transformation context
414
+ * @sorts: the node-set to sort
415
+ * @nbsorts: the number of sorts
416
+ *
417
+ * Signature of the function to use during sorting
418
+ */
419
+ typedef void (*xsltSortFunc) (xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
420
+ int nbsorts);
421
+
422
+ typedef enum {
423
+ XSLT_FUNC_COPY=1,
424
+ XSLT_FUNC_SORT,
425
+ XSLT_FUNC_TEXT,
426
+ XSLT_FUNC_ELEMENT,
427
+ XSLT_FUNC_ATTRIBUTE,
428
+ XSLT_FUNC_COMMENT,
429
+ XSLT_FUNC_PI,
430
+ XSLT_FUNC_COPYOF,
431
+ XSLT_FUNC_VALUEOF,
432
+ XSLT_FUNC_NUMBER,
433
+ XSLT_FUNC_APPLYIMPORTS,
434
+ XSLT_FUNC_CALLTEMPLATE,
435
+ XSLT_FUNC_APPLYTEMPLATES,
436
+ XSLT_FUNC_CHOOSE,
437
+ XSLT_FUNC_IF,
438
+ XSLT_FUNC_FOREACH,
439
+ XSLT_FUNC_DOCUMENT,
440
+ XSLT_FUNC_WITHPARAM,
441
+ XSLT_FUNC_PARAM,
442
+ XSLT_FUNC_VARIABLE,
443
+ XSLT_FUNC_WHEN,
444
+ XSLT_FUNC_EXTENSION
445
+ #ifdef XSLT_REFACTORED
446
+ ,
447
+ XSLT_FUNC_OTHERWISE,
448
+ XSLT_FUNC_FALLBACK,
449
+ XSLT_FUNC_MESSAGE,
450
+ XSLT_FUNC_INCLUDE,
451
+ XSLT_FUNC_ATTRSET,
452
+ XSLT_FUNC_LITERAL_RESULT_ELEMENT,
453
+ XSLT_FUNC_UNKOWN_FORWARDS_COMPAT
454
+ #endif
455
+ } xsltStyleType;
456
+
457
+ /**
458
+ * xsltElemPreCompDeallocator:
459
+ * @comp: the #xsltElemPreComp to free up
460
+ *
461
+ * Deallocates an #xsltElemPreComp structure.
462
+ */
463
+ typedef void (*xsltElemPreCompDeallocator) (xsltElemPreCompPtr comp);
464
+
465
+ /**
466
+ * xsltElemPreComp:
467
+ *
468
+ * The basic structure for compiled items of the AST of the XSLT processor.
469
+ * This structure is also intended to be extended by extension implementors.
470
+ * TODO: This is somehow not nice, since it has a "free" field, which
471
+ * derived stylesheet-structs do not have.
472
+ */
473
+ struct _xsltElemPreComp {
474
+ xsltElemPreCompPtr next; /* next item in the global chained
475
+ list held by xsltStylesheet. */
476
+ xsltStyleType type; /* type of the element */
477
+ xsltTransformFunction func; /* handling function */
478
+ xmlNodePtr inst; /* the node in the stylesheet's tree
479
+ corresponding to this item */
480
+
481
+ /* end of common part */
482
+ xsltElemPreCompDeallocator free; /* the deallocator */
483
+ };
484
+
485
+ /**
486
+ * xsltStylePreComp:
487
+ *
488
+ * The abstract basic structure for items of the XSLT processor.
489
+ * This includes:
490
+ * 1) compiled forms of XSLT instructions (xsl:if, xsl:attribute, etc.)
491
+ * 2) compiled forms of literal result elements
492
+ * 3) compiled forms of extension elements
493
+ */
494
+ typedef struct _xsltStylePreComp xsltStylePreComp;
495
+ typedef xsltStylePreComp *xsltStylePreCompPtr;
496
+
497
+ #ifdef XSLT_REFACTORED
498
+
499
+ /*
500
+ * Some pointer-list utility functions.
501
+ */
502
+ XSLTPUBFUN xsltPointerListPtr XSLTCALL
503
+ xsltPointerListCreate (int initialSize);
504
+ XSLTPUBFUN void XSLTCALL
505
+ xsltPointerListFree (xsltPointerListPtr list);
506
+ XSLTPUBFUN void XSLTCALL
507
+ xsltPointerListClear (xsltPointerListPtr list);
508
+ XSLTPUBFUN int XSLTCALL
509
+ xsltPointerListAddSize (xsltPointerListPtr list,
510
+ void *item,
511
+ int initialSize);
512
+
513
+ /************************************************************************
514
+ * *
515
+ * Refactored structures *
516
+ * *
517
+ ************************************************************************/
518
+
519
+ typedef struct _xsltNsListContainer xsltNsListContainer;
520
+ typedef xsltNsListContainer *xsltNsListContainerPtr;
521
+ struct _xsltNsListContainer {
522
+ xmlNsPtr *list;
523
+ int totalNumber;
524
+ int xpathNumber;
525
+ };
526
+
527
+ /**
528
+ * XSLT_ITEM_COMPATIBILITY_FIELDS:
529
+ *
530
+ * Fields for API compatibility to the structure
531
+ * _xsltElemPreComp which is used for extension functions.
532
+ * Note that @next is used for storage; it does not reflect a next
533
+ * sibling in the tree.
534
+ * TODO: Evaluate if we really need such a compatibility.
535
+ */
536
+ #define XSLT_ITEM_COMPATIBILITY_FIELDS \
537
+ xsltElemPreCompPtr next;\
538
+ xsltStyleType type;\
539
+ xsltTransformFunction func;\
540
+ xmlNodePtr inst;
541
+
542
+ /**
543
+ * XSLT_ITEM_NAVIGATION_FIELDS:
544
+ *
545
+ * Currently empty.
546
+ * TODO: It is intended to hold navigational fields in the future.
547
+ */
548
+ #define XSLT_ITEM_NAVIGATION_FIELDS
549
+ /*
550
+ xsltStylePreCompPtr parent;\
551
+ xsltStylePreCompPtr children;\
552
+ xsltStylePreCompPtr nextItem;
553
+ */
554
+
555
+ /**
556
+ * XSLT_ITEM_NSINSCOPE_FIELDS:
557
+ *
558
+ * The in-scope namespaces.
559
+ */
560
+ #define XSLT_ITEM_NSINSCOPE_FIELDS xsltNsListContainerPtr inScopeNs;
561
+
562
+ /**
563
+ * XSLT_ITEM_COMMON_FIELDS:
564
+ *
565
+ * Common fields used for all items.
566
+ */
567
+ #define XSLT_ITEM_COMMON_FIELDS \
568
+ XSLT_ITEM_COMPATIBILITY_FIELDS \
569
+ XSLT_ITEM_NAVIGATION_FIELDS \
570
+ XSLT_ITEM_NSINSCOPE_FIELDS
571
+
572
+ /**
573
+ * _xsltStylePreComp:
574
+ *
575
+ * The abstract basic structure for items of the XSLT processor.
576
+ * This includes:
577
+ * 1) compiled forms of XSLT instructions (e.g. xsl:if, xsl:attribute, etc.)
578
+ * 2) compiled forms of literal result elements
579
+ * 3) various properties for XSLT instructions (e.g. xsl:when,
580
+ * xsl:with-param)
581
+ *
582
+ * REVISIT TODO: Keep this structure equal to the fields
583
+ * defined by XSLT_ITEM_COMMON_FIELDS
584
+ */
585
+ struct _xsltStylePreComp {
586
+ xsltElemPreCompPtr next; /* next item in the global chained
587
+ list held by xsltStylesheet */
588
+ xsltStyleType type; /* type of the item */
589
+ xsltTransformFunction func; /* handling function */
590
+ xmlNodePtr inst; /* the node in the stylesheet's tree
591
+ corresponding to this item. */
592
+ /* Currently no navigational fields. */
593
+ xsltNsListContainerPtr inScopeNs;
594
+ };
595
+
596
+ /**
597
+ * xsltStyleBasicEmptyItem:
598
+ *
599
+ * Abstract structure only used as a short-cut for
600
+ * XSLT items with no extra fields.
601
+ * NOTE that it is intended that this structure looks the same as
602
+ * _xsltStylePreComp.
603
+ */
604
+ typedef struct _xsltStyleBasicEmptyItem xsltStyleBasicEmptyItem;
605
+ typedef xsltStyleBasicEmptyItem *xsltStyleBasicEmptyItemPtr;
606
+
607
+ struct _xsltStyleBasicEmptyItem {
608
+ XSLT_ITEM_COMMON_FIELDS
609
+ };
610
+
611
+ /**
612
+ * xsltStyleBasicExpressionItem:
613
+ *
614
+ * Abstract structure only used as a short-cut for
615
+ * XSLT items with just an expression.
616
+ */
617
+ typedef struct _xsltStyleBasicExpressionItem xsltStyleBasicExpressionItem;
618
+ typedef xsltStyleBasicExpressionItem *xsltStyleBasicExpressionItemPtr;
619
+
620
+ struct _xsltStyleBasicExpressionItem {
621
+ XSLT_ITEM_COMMON_FIELDS
622
+
623
+ const xmlChar *select; /* TODO: Change this to "expression". */
624
+ xmlXPathCompExprPtr comp; /* TODO: Change this to compExpr. */
625
+ };
626
+
627
+ /************************************************************************
628
+ * *
629
+ * XSLT-instructions/declarations *
630
+ * *
631
+ ************************************************************************/
632
+
633
+ /**
634
+ * xsltStyleItemElement:
635
+ *
636
+ * <!-- Category: instruction -->
637
+ * <xsl:element
638
+ * name = { qname }
639
+ * namespace = { uri-reference }
640
+ * use-attribute-sets = qnames>
641
+ * <!-- Content: template -->
642
+ * </xsl:element>
643
+ */
644
+ typedef struct _xsltStyleItemElement xsltStyleItemElement;
645
+ typedef xsltStyleItemElement *xsltStyleItemElementPtr;
646
+
647
+ struct _xsltStyleItemElement {
648
+ XSLT_ITEM_COMMON_FIELDS
649
+
650
+ const xmlChar *use;
651
+ int has_use;
652
+ const xmlChar *name;
653
+ int has_name;
654
+ const xmlChar *ns;
655
+ const xmlChar *nsPrefix;
656
+ int has_ns;
657
+ };
658
+
659
+ /**
660
+ * xsltStyleItemAttribute:
661
+ *
662
+ * <!-- Category: instruction -->
663
+ * <xsl:attribute
664
+ * name = { qname }
665
+ * namespace = { uri-reference }>
666
+ * <!-- Content: template -->
667
+ * </xsl:attribute>
668
+ */
669
+ typedef struct _xsltStyleItemAttribute xsltStyleItemAttribute;
670
+ typedef xsltStyleItemAttribute *xsltStyleItemAttributePtr;
671
+
672
+ struct _xsltStyleItemAttribute {
673
+ XSLT_ITEM_COMMON_FIELDS
674
+ const xmlChar *name;
675
+ int has_name;
676
+ const xmlChar *ns;
677
+ const xmlChar *nsPrefix;
678
+ int has_ns;
679
+ };
680
+
681
+ /**
682
+ * xsltStyleItemText:
683
+ *
684
+ * <!-- Category: instruction -->
685
+ * <xsl:text
686
+ * disable-output-escaping = "yes" | "no">
687
+ * <!-- Content: #PCDATA -->
688
+ * </xsl:text>
689
+ */
690
+ typedef struct _xsltStyleItemText xsltStyleItemText;
691
+ typedef xsltStyleItemText *xsltStyleItemTextPtr;
692
+
693
+ struct _xsltStyleItemText {
694
+ XSLT_ITEM_COMMON_FIELDS
695
+ int noescape; /* text */
696
+ };
697
+
698
+ /**
699
+ * xsltStyleItemComment:
700
+ *
701
+ * <!-- Category: instruction -->
702
+ * <xsl:comment>
703
+ * <!-- Content: template -->
704
+ * </xsl:comment>
705
+ */
706
+ typedef xsltStyleBasicEmptyItem xsltStyleItemComment;
707
+ typedef xsltStyleItemComment *xsltStyleItemCommentPtr;
708
+
709
+ /**
710
+ * xsltStyleItemPI:
711
+ *
712
+ * <!-- Category: instruction -->
713
+ * <xsl:processing-instruction
714
+ * name = { ncname }>
715
+ * <!-- Content: template -->
716
+ * </xsl:processing-instruction>
717
+ */
718
+ typedef struct _xsltStyleItemPI xsltStyleItemPI;
719
+ typedef xsltStyleItemPI *xsltStyleItemPIPtr;
720
+
721
+ struct _xsltStyleItemPI {
722
+ XSLT_ITEM_COMMON_FIELDS
723
+ const xmlChar *name;
724
+ int has_name;
725
+ };
726
+
727
+ /**
728
+ * xsltStyleItemApplyImports:
729
+ *
730
+ * <!-- Category: instruction -->
731
+ * <xsl:apply-imports />
732
+ */
733
+ typedef xsltStyleBasicEmptyItem xsltStyleItemApplyImports;
734
+ typedef xsltStyleItemApplyImports *xsltStyleItemApplyImportsPtr;
735
+
736
+ /**
737
+ * xsltStyleItemApplyTemplates:
738
+ *
739
+ * <!-- Category: instruction -->
740
+ * <xsl:apply-templates
741
+ * select = node-set-expression
742
+ * mode = qname>
743
+ * <!-- Content: (xsl:sort | xsl:with-param)* -->
744
+ * </xsl:apply-templates>
745
+ */
746
+ typedef struct _xsltStyleItemApplyTemplates xsltStyleItemApplyTemplates;
747
+ typedef xsltStyleItemApplyTemplates *xsltStyleItemApplyTemplatesPtr;
748
+
749
+ struct _xsltStyleItemApplyTemplates {
750
+ XSLT_ITEM_COMMON_FIELDS
751
+
752
+ const xmlChar *mode; /* apply-templates */
753
+ const xmlChar *modeURI; /* apply-templates */
754
+ const xmlChar *select; /* sort, copy-of, value-of, apply-templates */
755
+ xmlXPathCompExprPtr comp; /* a precompiled XPath expression */
756
+ /* TODO: with-params */
757
+ };
758
+
759
+ /**
760
+ * xsltStyleItemCallTemplate:
761
+ *
762
+ * <!-- Category: instruction -->
763
+ * <xsl:call-template
764
+ * name = qname>
765
+ * <!-- Content: xsl:with-param* -->
766
+ * </xsl:call-template>
767
+ */
768
+ typedef struct _xsltStyleItemCallTemplate xsltStyleItemCallTemplate;
769
+ typedef xsltStyleItemCallTemplate *xsltStyleItemCallTemplatePtr;
770
+
771
+ struct _xsltStyleItemCallTemplate {
772
+ XSLT_ITEM_COMMON_FIELDS
773
+
774
+ xsltTemplatePtr templ; /* call-template */
775
+ const xmlChar *name; /* element, attribute, pi */
776
+ int has_name; /* element, attribute, pi */
777
+ const xmlChar *ns; /* element */
778
+ int has_ns; /* element */
779
+ /* TODO: with-params */
780
+ };
781
+
782
+ /**
783
+ * xsltStyleItemCopy:
784
+ *
785
+ * <!-- Category: instruction -->
786
+ * <xsl:copy
787
+ * use-attribute-sets = qnames>
788
+ * <!-- Content: template -->
789
+ * </xsl:copy>
790
+ */
791
+ typedef struct _xsltStyleItemCopy xsltStyleItemCopy;
792
+ typedef xsltStyleItemCopy *xsltStyleItemCopyPtr;
793
+
794
+ struct _xsltStyleItemCopy {
795
+ XSLT_ITEM_COMMON_FIELDS
796
+ const xmlChar *use; /* copy, element */
797
+ int has_use; /* copy, element */
798
+ };
799
+
800
+ /**
801
+ * xsltStyleItemIf:
802
+ *
803
+ * <!-- Category: instruction -->
804
+ * <xsl:if
805
+ * test = boolean-expression>
806
+ * <!-- Content: template -->
807
+ * </xsl:if>
808
+ */
809
+ typedef struct _xsltStyleItemIf xsltStyleItemIf;
810
+ typedef xsltStyleItemIf *xsltStyleItemIfPtr;
811
+
812
+ struct _xsltStyleItemIf {
813
+ XSLT_ITEM_COMMON_FIELDS
814
+
815
+ const xmlChar *test; /* if */
816
+ xmlXPathCompExprPtr comp; /* a precompiled XPath expression */
817
+ };
818
+
819
+
820
+ /**
821
+ * xsltStyleItemCopyOf:
822
+ *
823
+ * <!-- Category: instruction -->
824
+ * <xsl:copy-of
825
+ * select = expression />
826
+ */
827
+ typedef xsltStyleBasicExpressionItem xsltStyleItemCopyOf;
828
+ typedef xsltStyleItemCopyOf *xsltStyleItemCopyOfPtr;
829
+
830
+ /**
831
+ * xsltStyleItemValueOf:
832
+ *
833
+ * <!-- Category: instruction -->
834
+ * <xsl:value-of
835
+ * select = string-expression
836
+ * disable-output-escaping = "yes" | "no" />
837
+ */
838
+ typedef struct _xsltStyleItemValueOf xsltStyleItemValueOf;
839
+ typedef xsltStyleItemValueOf *xsltStyleItemValueOfPtr;
840
+
841
+ struct _xsltStyleItemValueOf {
842
+ XSLT_ITEM_COMMON_FIELDS
843
+
844
+ const xmlChar *select;
845
+ xmlXPathCompExprPtr comp; /* a precompiled XPath expression */
846
+ int noescape;
847
+ };
848
+
849
+ /**
850
+ * xsltStyleItemNumber:
851
+ *
852
+ * <!-- Category: instruction -->
853
+ * <xsl:number
854
+ * level = "single" | "multiple" | "any"
855
+ * count = pattern
856
+ * from = pattern
857
+ * value = number-expression
858
+ * format = { string }
859
+ * lang = { nmtoken }
860
+ * letter-value = { "alphabetic" | "traditional" }
861
+ * grouping-separator = { char }
862
+ * grouping-size = { number } />
863
+ */
864
+ typedef struct _xsltStyleItemNumber xsltStyleItemNumber;
865
+ typedef xsltStyleItemNumber *xsltStyleItemNumberPtr;
866
+
867
+ struct _xsltStyleItemNumber {
868
+ XSLT_ITEM_COMMON_FIELDS
869
+ xsltNumberData numdata; /* number */
870
+ };
871
+
872
+ /**
873
+ * xsltStyleItemChoose:
874
+ *
875
+ * <!-- Category: instruction -->
876
+ * <xsl:choose>
877
+ * <!-- Content: (xsl:when+, xsl:otherwise?) -->
878
+ * </xsl:choose>
879
+ */
880
+ typedef xsltStyleBasicEmptyItem xsltStyleItemChoose;
881
+ typedef xsltStyleItemChoose *xsltStyleItemChoosePtr;
882
+
883
+ /**
884
+ * xsltStyleItemFallback:
885
+ *
886
+ * <!-- Category: instruction -->
887
+ * <xsl:fallback>
888
+ * <!-- Content: template -->
889
+ * </xsl:fallback>
890
+ */
891
+ typedef xsltStyleBasicEmptyItem xsltStyleItemFallback;
892
+ typedef xsltStyleItemFallback *xsltStyleItemFallbackPtr;
893
+
894
+ /**
895
+ * xsltStyleItemForEach:
896
+ *
897
+ * <!-- Category: instruction -->
898
+ * <xsl:for-each
899
+ * select = node-set-expression>
900
+ * <!-- Content: (xsl:sort*, template) -->
901
+ * </xsl:for-each>
902
+ */
903
+ typedef xsltStyleBasicExpressionItem xsltStyleItemForEach;
904
+ typedef xsltStyleItemForEach *xsltStyleItemForEachPtr;
905
+
906
+ /**
907
+ * xsltStyleItemMessage:
908
+ *
909
+ * <!-- Category: instruction -->
910
+ * <xsl:message
911
+ * terminate = "yes" | "no">
912
+ * <!-- Content: template -->
913
+ * </xsl:message>
914
+ */
915
+ typedef struct _xsltStyleItemMessage xsltStyleItemMessage;
916
+ typedef xsltStyleItemMessage *xsltStyleItemMessagePtr;
917
+
918
+ struct _xsltStyleItemMessage {
919
+ XSLT_ITEM_COMMON_FIELDS
920
+ int terminate;
921
+ };
922
+
923
+ /**
924
+ * xsltStyleItemDocument:
925
+ *
926
+ * NOTE: This is not an instruction of XSLT 1.0.
927
+ */
928
+ typedef struct _xsltStyleItemDocument xsltStyleItemDocument;
929
+ typedef xsltStyleItemDocument *xsltStyleItemDocumentPtr;
930
+
931
+ struct _xsltStyleItemDocument {
932
+ XSLT_ITEM_COMMON_FIELDS
933
+ int ver11; /* assigned: in xsltDocumentComp;
934
+ read: nowhere;
935
+ TODO: Check if we need. */
936
+ const xmlChar *filename; /* document URL */
937
+ int has_filename;
938
+ };
939
+
940
+ /************************************************************************
941
+ * *
942
+ * Non-instructions (actually properties of instructions/declarations) *
943
+ * *
944
+ ************************************************************************/
945
+
946
+ /**
947
+ * xsltStyleBasicItemVariable:
948
+ *
949
+ * Basic struct for xsl:variable, xsl:param and xsl:with-param.
950
+ * It's currently important to have equal fields, since
951
+ * xsltParseStylesheetCallerParam() is used with xsl:with-param from
952
+ * the xslt side and with xsl:param from the exslt side (in
953
+ * exsltFuncFunctionFunction()).
954
+ *
955
+ * FUTURE NOTE: In XSLT 2.0 xsl:param, xsl:variable and xsl:with-param
956
+ * have additional different fields.
957
+ */
958
+ typedef struct _xsltStyleBasicItemVariable xsltStyleBasicItemVariable;
959
+ typedef xsltStyleBasicItemVariable *xsltStyleBasicItemVariablePtr;
960
+
961
+ struct _xsltStyleBasicItemVariable {
962
+ XSLT_ITEM_COMMON_FIELDS
963
+
964
+ const xmlChar *select;
965
+ xmlXPathCompExprPtr comp;
966
+
967
+ const xmlChar *name;
968
+ int has_name;
969
+ const xmlChar *ns;
970
+ int has_ns;
971
+ };
972
+
973
+ /**
974
+ * xsltStyleItemVariable:
975
+ *
976
+ * <!-- Category: top-level-element -->
977
+ * <xsl:param
978
+ * name = qname
979
+ * select = expression>
980
+ * <!-- Content: template -->
981
+ * </xsl:param>
982
+ */
983
+ typedef xsltStyleBasicItemVariable xsltStyleItemVariable;
984
+ typedef xsltStyleItemVariable *xsltStyleItemVariablePtr;
985
+
986
+ /**
987
+ * xsltStyleItemParam:
988
+ *
989
+ * <!-- Category: top-level-element -->
990
+ * <xsl:param
991
+ * name = qname
992
+ * select = expression>
993
+ * <!-- Content: template -->
994
+ * </xsl:param>
995
+ */
996
+ typedef struct _xsltStyleItemParam xsltStyleItemParam;
997
+ typedef xsltStyleItemParam *xsltStyleItemParamPtr;
998
+
999
+ struct _xsltStyleItemParam {
1000
+ XSLT_ITEM_COMMON_FIELDS
1001
+
1002
+ const xmlChar *select;
1003
+ xmlXPathCompExprPtr comp;
1004
+
1005
+ const xmlChar *name;
1006
+ int has_name;
1007
+ const xmlChar *ns;
1008
+ int has_ns;
1009
+ };
1010
+
1011
+ /**
1012
+ * xsltStyleItemWithParam:
1013
+ *
1014
+ * <xsl:with-param
1015
+ * name = qname
1016
+ * select = expression>
1017
+ * <!-- Content: template -->
1018
+ * </xsl:with-param>
1019
+ */
1020
+ typedef xsltStyleBasicItemVariable xsltStyleItemWithParam;
1021
+ typedef xsltStyleItemWithParam *xsltStyleItemWithParamPtr;
1022
+
1023
+ /**
1024
+ * xsltStyleItemSort:
1025
+ *
1026
+ * Reflects the XSLT xsl:sort item.
1027
+ * Allowed parents: xsl:apply-templates, xsl:for-each
1028
+ * <xsl:sort
1029
+ * select = string-expression
1030
+ * lang = { nmtoken }
1031
+ * data-type = { "text" | "number" | qname-but-not-ncname }
1032
+ * order = { "ascending" | "descending" }
1033
+ * case-order = { "upper-first" | "lower-first" } />
1034
+ */
1035
+ typedef struct _xsltStyleItemSort xsltStyleItemSort;
1036
+ typedef xsltStyleItemSort *xsltStyleItemSortPtr;
1037
+
1038
+ struct _xsltStyleItemSort {
1039
+ XSLT_ITEM_COMMON_FIELDS
1040
+
1041
+ const xmlChar *stype; /* sort */
1042
+ int has_stype; /* sort */
1043
+ int number; /* sort */
1044
+ const xmlChar *order; /* sort */
1045
+ int has_order; /* sort */
1046
+ int descending; /* sort */
1047
+ const xmlChar *lang; /* sort */
1048
+ int has_lang; /* sort */
1049
+ const xmlChar *case_order; /* sort */
1050
+ int lower_first; /* sort */
1051
+
1052
+ const xmlChar *use;
1053
+ int has_use;
1054
+
1055
+ const xmlChar *select; /* sort, copy-of, value-of, apply-templates */
1056
+
1057
+ xmlXPathCompExprPtr comp; /* a precompiled XPath expression */
1058
+ };
1059
+
1060
+
1061
+ /**
1062
+ * xsltStyleItemWhen:
1063
+ *
1064
+ * <xsl:when
1065
+ * test = boolean-expression>
1066
+ * <!-- Content: template -->
1067
+ * </xsl:when>
1068
+ * Allowed parent: xsl:choose
1069
+ */
1070
+ typedef struct _xsltStyleItemWhen xsltStyleItemWhen;
1071
+ typedef xsltStyleItemWhen *xsltStyleItemWhenPtr;
1072
+
1073
+ struct _xsltStyleItemWhen {
1074
+ XSLT_ITEM_COMMON_FIELDS
1075
+
1076
+ const xmlChar *test;
1077
+ xmlXPathCompExprPtr comp;
1078
+ };
1079
+
1080
+ /**
1081
+ * xsltStyleItemOtherwise:
1082
+ *
1083
+ * Allowed parent: xsl:choose
1084
+ * <xsl:otherwise>
1085
+ * <!-- Content: template -->
1086
+ * </xsl:otherwise>
1087
+ */
1088
+ typedef struct _xsltStyleItemOtherwise xsltStyleItemOtherwise;
1089
+ typedef xsltStyleItemOtherwise *xsltStyleItemOtherwisePtr;
1090
+
1091
+ struct _xsltStyleItemOtherwise {
1092
+ XSLT_ITEM_COMMON_FIELDS
1093
+ };
1094
+
1095
+ typedef struct _xsltStyleItemInclude xsltStyleItemInclude;
1096
+ typedef xsltStyleItemInclude *xsltStyleItemIncludePtr;
1097
+
1098
+ struct _xsltStyleItemInclude {
1099
+ XSLT_ITEM_COMMON_FIELDS
1100
+ xsltDocumentPtr include;
1101
+ };
1102
+
1103
+ /************************************************************************
1104
+ * *
1105
+ * XSLT elements in forwards-compatible mode *
1106
+ * *
1107
+ ************************************************************************/
1108
+
1109
+ typedef struct _xsltStyleItemUknown xsltStyleItemUknown;
1110
+ typedef xsltStyleItemUknown *xsltStyleItemUknownPtr;
1111
+ struct _xsltStyleItemUknown {
1112
+ XSLT_ITEM_COMMON_FIELDS
1113
+ };
1114
+
1115
+
1116
+ /************************************************************************
1117
+ * *
1118
+ * Extension elements *
1119
+ * *
1120
+ ************************************************************************/
1121
+
1122
+ /*
1123
+ * xsltStyleItemExtElement:
1124
+ *
1125
+ * Reflects extension elements.
1126
+ *
1127
+ * NOTE: Due to the fact that the structure xsltElemPreComp is most
1128
+ * probably already heavily in use out there by users, so we cannot
1129
+ * easily change it, we'll create an intermediate structure which will
1130
+ * hold an xsltElemPreCompPtr.
1131
+ * BIG NOTE: The only problem I see here is that the user processes the
1132
+ * content of the stylesheet tree, possibly he'll lookup the node->psvi
1133
+ * fields in order to find subsequent extension functions.
1134
+ * In this case, the user's code will break, since the node->psvi
1135
+ * field will hold now the xsltStyleItemExtElementPtr and not
1136
+ * the xsltElemPreCompPtr.
1137
+ * However the place where the structure is anchored in the node-tree,
1138
+ * namely node->psvi, has beed already once been moved from node->_private
1139
+ * to node->psvi, so we have a precedent here, which, I think, should allow
1140
+ * us to change such semantics without headaches.
1141
+ */
1142
+ typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement;
1143
+ typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr;
1144
+ struct _xsltStyleItemExtElement {
1145
+ XSLT_ITEM_COMMON_FIELDS
1146
+ xsltElemPreCompPtr item;
1147
+ };
1148
+
1149
+ /************************************************************************
1150
+ * *
1151
+ * Literal result elements *
1152
+ * *
1153
+ ************************************************************************/
1154
+
1155
+ typedef struct _xsltEffectiveNs xsltEffectiveNs;
1156
+ typedef xsltEffectiveNs *xsltEffectiveNsPtr;
1157
+ struct _xsltEffectiveNs {
1158
+ xsltEffectiveNsPtr nextInStore; /* storage next */
1159
+ xsltEffectiveNsPtr next; /* next item in the list */
1160
+ const xmlChar *prefix;
1161
+ const xmlChar *nsName;
1162
+ /*
1163
+ * Indicates if eclared on the literal result element; dunno if really
1164
+ * needed.
1165
+ */
1166
+ int holdByElem;
1167
+ };
1168
+
1169
+ /*
1170
+ * Info for literal result elements.
1171
+ * This will be set on the elem->psvi field and will be
1172
+ * shared by literal result elements, which have the same
1173
+ * excluded result namespaces; i.e., this *won't* be created uniquely
1174
+ * for every literal result element.
1175
+ */
1176
+ typedef struct _xsltStyleItemLRElementInfo xsltStyleItemLRElementInfo;
1177
+ typedef xsltStyleItemLRElementInfo *xsltStyleItemLRElementInfoPtr;
1178
+ struct _xsltStyleItemLRElementInfo {
1179
+ XSLT_ITEM_COMMON_FIELDS
1180
+ /*
1181
+ * @effectiveNs is the set of effective ns-nodes
1182
+ * on the literal result element, which will be added to the result
1183
+ * element if not already existing in the result tree.
1184
+ * This means that excluded namespaces (via exclude-result-prefixes,
1185
+ * extension-element-prefixes and the XSLT namespace) not added
1186
+ * to the set.
1187
+ * Namespace-aliasing was applied on the @effectiveNs.
1188
+ */
1189
+ xsltEffectiveNsPtr effectiveNs;
1190
+
1191
+ };
1192
+
1193
+ #ifdef XSLT_REFACTORED
1194
+
1195
+ typedef struct _xsltNsAlias xsltNsAlias;
1196
+ typedef xsltNsAlias *xsltNsAliasPtr;
1197
+ struct _xsltNsAlias {
1198
+ xsltNsAliasPtr next; /* next in the list */
1199
+ xmlNsPtr literalNs;
1200
+ xmlNsPtr targetNs;
1201
+ xmlDocPtr docOfTargetNs;
1202
+ };
1203
+ #endif
1204
+
1205
+ #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1206
+
1207
+ typedef struct _xsltNsMap xsltNsMap;
1208
+ typedef xsltNsMap *xsltNsMapPtr;
1209
+ struct _xsltNsMap {
1210
+ xsltNsMapPtr next; /* next in the list */
1211
+ xmlDocPtr doc;
1212
+ xmlNodePtr elem; /* the element holding the ns-decl */
1213
+ xmlNsPtr ns; /* the xmlNs structure holding the XML namespace name */
1214
+ const xmlChar *origNsName; /* the original XML namespace name */
1215
+ const xmlChar *newNsName; /* the mapped XML namespace name */
1216
+ };
1217
+ #endif
1218
+
1219
+ /************************************************************************
1220
+ * *
1221
+ * Compile-time structures for *internal* use only *
1222
+ * *
1223
+ ************************************************************************/
1224
+
1225
+ typedef struct _xsltPrincipalStylesheetData xsltPrincipalStylesheetData;
1226
+ typedef xsltPrincipalStylesheetData *xsltPrincipalStylesheetDataPtr;
1227
+
1228
+ typedef struct _xsltNsList xsltNsList;
1229
+ typedef xsltNsList *xsltNsListPtr;
1230
+ struct _xsltNsList {
1231
+ xsltNsListPtr next; /* next in the list */
1232
+ xmlNsPtr ns;
1233
+ };
1234
+
1235
+ /*
1236
+ * xsltVarInfo:
1237
+ *
1238
+ * Used at compilation time for parameters and variables.
1239
+ */
1240
+ typedef struct _xsltVarInfo xsltVarInfo;
1241
+ typedef xsltVarInfo *xsltVarInfoPtr;
1242
+ struct _xsltVarInfo {
1243
+ xsltVarInfoPtr next; /* next in the list */
1244
+ xsltVarInfoPtr prev;
1245
+ int depth; /* the depth in the tree */
1246
+ const xmlChar *name;
1247
+ const xmlChar *nsName;
1248
+ };
1249
+
1250
+ /**
1251
+ * xsltCompilerNodeInfo:
1252
+ *
1253
+ * Per-node information during compile-time.
1254
+ */
1255
+ typedef struct _xsltCompilerNodeInfo xsltCompilerNodeInfo;
1256
+ typedef xsltCompilerNodeInfo *xsltCompilerNodeInfoPtr;
1257
+ struct _xsltCompilerNodeInfo {
1258
+ xsltCompilerNodeInfoPtr next;
1259
+ xsltCompilerNodeInfoPtr prev;
1260
+ xmlNodePtr node;
1261
+ int depth;
1262
+ xsltTemplatePtr templ; /* The owning template */
1263
+ int category; /* XSLT element, LR-element or
1264
+ extension element */
1265
+ xsltStyleType type;
1266
+ xsltElemPreCompPtr item; /* The compiled information */
1267
+ /* The current in-scope namespaces */
1268
+ xsltNsListContainerPtr inScopeNs;
1269
+ /* The current excluded result namespaces */
1270
+ xsltPointerListPtr exclResultNs;
1271
+ /* The current extension instruction namespaces */
1272
+ xsltPointerListPtr extElemNs;
1273
+
1274
+ /* The current info for literal result elements. */
1275
+ xsltStyleItemLRElementInfoPtr litResElemInfo;
1276
+ /*
1277
+ * Set to 1 if in-scope namespaces changed,
1278
+ * or excluded result namespaces changed,
1279
+ * or extension element namespaces changed.
1280
+ * This will trigger creation of new infos
1281
+ * for literal result elements.
1282
+ */
1283
+ int nsChanged;
1284
+ int preserveWhitespace;
1285
+ int stripWhitespace;
1286
+ int isRoot; /* whether this is the stylesheet's root node */
1287
+ int forwardsCompat; /* whether forwards-compatible mode is enabled */
1288
+ /* whether the content of an extension element was processed */
1289
+ int extContentHandled;
1290
+ /* the type of the current child */
1291
+ xsltStyleType curChildType;
1292
+ };
1293
+
1294
+ /**
1295
+ * XSLT_CCTXT:
1296
+ *
1297
+ * get pointer to compiler context
1298
+ */
1299
+ #define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
1300
+
1301
+ typedef enum {
1302
+ XSLT_ERROR_SEVERITY_ERROR = 0,
1303
+ XSLT_ERROR_SEVERITY_WARNING
1304
+ } xsltErrorSeverityType;
1305
+
1306
+ typedef struct _xsltCompilerCtxt xsltCompilerCtxt;
1307
+ typedef xsltCompilerCtxt *xsltCompilerCtxtPtr;
1308
+ struct _xsltCompilerCtxt {
1309
+ void *errorCtxt; /* user specific error context */
1310
+ /*
1311
+ * used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING */
1312
+ xsltErrorSeverityType errSeverity;
1313
+ int warnings; /* TODO: number of warnings found at
1314
+ compilation */
1315
+ int errors; /* TODO: number of errors found at
1316
+ compilation */
1317
+ xmlDictPtr dict;
1318
+ xsltStylesheetPtr style;
1319
+ int simplified; /* whether this is a simplified stylesheet */
1320
+ /* TODO: structured/unstructured error contexts. */
1321
+ int depth; /* Current depth of processing */
1322
+
1323
+ xsltCompilerNodeInfoPtr inode;
1324
+ xsltCompilerNodeInfoPtr inodeList;
1325
+ xsltCompilerNodeInfoPtr inodeLast;
1326
+ xsltPointerListPtr tmpList; /* Used for various purposes */
1327
+ /*
1328
+ * The XSLT version as specified by the stylesheet's root element.
1329
+ */
1330
+ int isInclude;
1331
+ int hasForwardsCompat; /* whether forwards-compatible mode was used
1332
+ in a parsing episode */
1333
+ int maxNodeInfos; /* TEMP TODO: just for the interest */
1334
+ int maxLREs; /* TEMP TODO: just for the interest */
1335
+ /*
1336
+ * In order to keep the old behaviour, applying strict rules of
1337
+ * the spec can be turned off. This has effect only on special
1338
+ * mechanisms like whitespace-stripping in the stylesheet.
1339
+ */
1340
+ int strict;
1341
+ xsltPrincipalStylesheetDataPtr psData;
1342
+ xsltStyleItemUknownPtr unknownItem;
1343
+ int hasNsAliases; /* Indicator if there was an xsl:namespace-alias. */
1344
+ xsltNsAliasPtr nsAliases;
1345
+ xsltVarInfoPtr ivars; /* Storage of local in-scope variables/params. */
1346
+ xsltVarInfoPtr ivar; /* topmost local variable/param. */
1347
+ };
1348
+
1349
+ #else /* XSLT_REFACTORED */
1350
+ /*
1351
+ * The old structures before refactoring.
1352
+ */
1353
+
1354
+ /**
1355
+ * _xsltStylePreComp:
1356
+ *
1357
+ * The in-memory structure corresponding to XSLT stylesheet constructs
1358
+ * precomputed data.
1359
+ */
1360
+ struct _xsltStylePreComp {
1361
+ xsltElemPreCompPtr next; /* chained list */
1362
+ xsltStyleType type; /* type of the element */
1363
+ xsltTransformFunction func; /* handling function */
1364
+ xmlNodePtr inst; /* the instruction */
1365
+
1366
+ /*
1367
+ * Pre computed values.
1368
+ */
1369
+
1370
+ const xmlChar *stype; /* sort */
1371
+ int has_stype; /* sort */
1372
+ int number; /* sort */
1373
+ const xmlChar *order; /* sort */
1374
+ int has_order; /* sort */
1375
+ int descending; /* sort */
1376
+ const xmlChar *lang; /* sort */
1377
+ int has_lang; /* sort */
1378
+ const xmlChar *case_order; /* sort */
1379
+ int lower_first; /* sort */
1380
+
1381
+ const xmlChar *use; /* copy, element */
1382
+ int has_use; /* copy, element */
1383
+
1384
+ int noescape; /* text */
1385
+
1386
+ const xmlChar *name; /* element, attribute, pi */
1387
+ int has_name; /* element, attribute, pi */
1388
+ const xmlChar *ns; /* element */
1389
+ int has_ns; /* element */
1390
+
1391
+ const xmlChar *mode; /* apply-templates */
1392
+ const xmlChar *modeURI; /* apply-templates */
1393
+
1394
+ const xmlChar *test; /* if */
1395
+
1396
+ xsltTemplatePtr templ; /* call-template */
1397
+
1398
+ const xmlChar *select; /* sort, copy-of, value-of, apply-templates */
1399
+
1400
+ int ver11; /* document */
1401
+ const xmlChar *filename; /* document URL */
1402
+ int has_filename; /* document */
1403
+
1404
+ xsltNumberData numdata; /* number */
1405
+
1406
+ xmlXPathCompExprPtr comp; /* a precompiled XPath expression */
1407
+ xmlNsPtr *nsList; /* the namespaces in scope */
1408
+ int nsNr; /* the number of namespaces in scope */
1409
+ };
1410
+
1411
+ #endif /* XSLT_REFACTORED */
1412
+
1413
+
1414
+ /*
1415
+ * The in-memory structure corresponding to an XSLT Variable
1416
+ * or Param.
1417
+ */
1418
+ typedef struct _xsltStackElem xsltStackElem;
1419
+ typedef xsltStackElem *xsltStackElemPtr;
1420
+ struct _xsltStackElem {
1421
+ struct _xsltStackElem *next;/* chained list */
1422
+ xsltStylePreCompPtr comp; /* the compiled form */
1423
+ int computed; /* was the evaluation done */
1424
+ const xmlChar *name; /* the local part of the name QName */
1425
+ const xmlChar *nameURI; /* the URI part of the name QName */
1426
+ const xmlChar *select; /* the eval string */
1427
+ xmlNodePtr tree; /* the sequence constructor if no eval
1428
+ string or the location */
1429
+ xmlXPathObjectPtr value; /* The value if computed */
1430
+ xmlDocPtr fragment; /* The Result Tree Fragments (needed for XSLT 1.0)
1431
+ which are bound to the variable's lifetime. */
1432
+ int level; /* the depth in the tree;
1433
+ -1 if persistent (e.g. a given xsl:with-param) */
1434
+ xsltTransformContextPtr context; /* The transformation context; needed to cache
1435
+ the variables */
1436
+ int flags;
1437
+ };
1438
+
1439
+ #ifdef XSLT_REFACTORED
1440
+
1441
+ struct _xsltPrincipalStylesheetData {
1442
+ /*
1443
+ * Namespace dictionary for ns-prefixes and ns-names:
1444
+ * TODO: Shared between stylesheets, and XPath mechanisms.
1445
+ * Not used yet.
1446
+ */
1447
+ xmlDictPtr namespaceDict;
1448
+ /*
1449
+ * Global list of in-scope namespaces.
1450
+ */
1451
+ xsltPointerListPtr inScopeNamespaces;
1452
+ /*
1453
+ * Global list of information for [xsl:]excluded-result-prefixes.
1454
+ */
1455
+ xsltPointerListPtr exclResultNamespaces;
1456
+ /*
1457
+ * Global list of information for [xsl:]extension-element-prefixes.
1458
+ */
1459
+ xsltPointerListPtr extElemNamespaces;
1460
+ xsltEffectiveNsPtr effectiveNs;
1461
+ #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1462
+ /*
1463
+ * Namespace name map to get rid of string comparison of namespace names.
1464
+ */
1465
+ xsltNsMapPtr nsMap;
1466
+ #endif
1467
+ };
1468
+
1469
+
1470
+ #endif
1471
+ /*
1472
+ * Note that we added a @compCtxt field to anchor an stylesheet compilation
1473
+ * context, since, due to historical reasons, various compile-time function
1474
+ * take only the stylesheet as argument and not a compilation context.
1475
+ */
1476
+ struct _xsltStylesheet {
1477
+ /*
1478
+ * The stylesheet import relation is kept as a tree.
1479
+ */
1480
+ struct _xsltStylesheet *parent;
1481
+ struct _xsltStylesheet *next;
1482
+ struct _xsltStylesheet *imports;
1483
+
1484
+ xsltDocumentPtr docList; /* the include document list */
1485
+
1486
+ /*
1487
+ * General data on the style sheet document.
1488
+ */
1489
+ xmlDocPtr doc; /* the parsed XML stylesheet */
1490
+ xmlHashTablePtr stripSpaces;/* the hash table of the strip-space and
1491
+ preserve space elements */
1492
+ int stripAll; /* strip-space * (1) preserve-space * (-1) */
1493
+ xmlHashTablePtr cdataSection;/* the hash table of the cdata-section */
1494
+
1495
+ /*
1496
+ * Global variable or parameters.
1497
+ */
1498
+ xsltStackElemPtr variables; /* linked list of param and variables */
1499
+
1500
+ /*
1501
+ * Template descriptions.
1502
+ */
1503
+ xsltTemplatePtr templates; /* the ordered list of templates */
1504
+ xmlHashTablePtr templatesHash; /* hash table or wherever compiled
1505
+ templates information is stored */
1506
+ struct _xsltCompMatch *rootMatch; /* template based on / */
1507
+ struct _xsltCompMatch *keyMatch; /* template based on key() */
1508
+ struct _xsltCompMatch *elemMatch; /* template based on * */
1509
+ struct _xsltCompMatch *attrMatch; /* template based on @* */
1510
+ struct _xsltCompMatch *parentMatch; /* template based on .. */
1511
+ struct _xsltCompMatch *textMatch; /* template based on text() */
1512
+ struct _xsltCompMatch *piMatch; /* template based on
1513
+ processing-instruction() */
1514
+ struct _xsltCompMatch *commentMatch; /* template based on comment() */
1515
+
1516
+ /*
1517
+ * Namespace aliases.
1518
+ * NOTE: Not used in the refactored code.
1519
+ */
1520
+ xmlHashTablePtr nsAliases; /* the namespace alias hash tables */
1521
+
1522
+ /*
1523
+ * Attribute sets.
1524
+ */
1525
+ xmlHashTablePtr attributeSets;/* the attribute sets hash tables */
1526
+
1527
+ /*
1528
+ * Namespaces.
1529
+ * TODO: Eliminate this.
1530
+ */
1531
+ xmlHashTablePtr nsHash; /* the set of namespaces in use:
1532
+ ATTENTION: This is used for
1533
+ execution of XPath expressions; unfortunately
1534
+ it restricts the stylesheet to have distinct
1535
+ prefixes.
1536
+ TODO: We need to get rid of this.
1537
+ */
1538
+ void *nsDefs; /* ATTENTION TODO: This is currently used to store
1539
+ xsltExtDefPtr (in extensions.c) and
1540
+ *not* xmlNsPtr.
1541
+ */
1542
+
1543
+ /*
1544
+ * Key definitions.
1545
+ */
1546
+ void *keys; /* key definitions */
1547
+
1548
+ /*
1549
+ * Output related stuff.
1550
+ */
1551
+ xmlChar *method; /* the output method */
1552
+ xmlChar *methodURI; /* associated namespace if any */
1553
+ xmlChar *version; /* version string */
1554
+ xmlChar *encoding; /* encoding string */
1555
+ int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */
1556
+
1557
+ /*
1558
+ * Number formatting.
1559
+ */
1560
+ xsltDecimalFormatPtr decimalFormat;
1561
+ int standalone; /* standalone = "yes" | "no" */
1562
+ xmlChar *doctypePublic; /* doctype-public string */
1563
+ xmlChar *doctypeSystem; /* doctype-system string */
1564
+ int indent; /* should output being indented */
1565
+ xmlChar *mediaType; /* media-type string */
1566
+
1567
+ /*
1568
+ * Precomputed blocks.
1569
+ */
1570
+ xsltElemPreCompPtr preComps;/* list of precomputed blocks */
1571
+ int warnings; /* number of warnings found at compilation */
1572
+ int errors; /* number of errors found at compilation */
1573
+
1574
+ xmlChar *exclPrefix; /* last excluded prefixes */
1575
+ xmlChar **exclPrefixTab; /* array of excluded prefixes */
1576
+ int exclPrefixNr; /* number of excluded prefixes in scope */
1577
+ int exclPrefixMax; /* size of the array */
1578
+
1579
+ void *_private; /* user defined data */
1580
+
1581
+ /*
1582
+ * Extensions.
1583
+ */
1584
+ xmlHashTablePtr extInfos; /* the extension data */
1585
+ int extrasNr; /* the number of extras required */
1586
+
1587
+ /*
1588
+ * For keeping track of nested includes
1589
+ */
1590
+ xsltDocumentPtr includes; /* points to last nested include */
1591
+
1592
+ /*
1593
+ * dictionary: shared between stylesheet, context and documents.
1594
+ */
1595
+ xmlDictPtr dict;
1596
+ /*
1597
+ * precompiled attribute value templates.
1598
+ */
1599
+ void *attVTs;
1600
+ /*
1601
+ * if namespace-alias has an alias for the default stylesheet prefix
1602
+ * NOTE: Not used in the refactored code.
1603
+ */
1604
+ const xmlChar *defaultAlias;
1605
+ /*
1606
+ * bypass pre-processing (already done) (used in imports)
1607
+ */
1608
+ int nopreproc;
1609
+ /*
1610
+ * all document text strings were internalized
1611
+ */
1612
+ int internalized;
1613
+ /*
1614
+ * Literal Result Element as Stylesheet c.f. section 2.3
1615
+ */
1616
+ int literal_result;
1617
+ /*
1618
+ * The principal stylesheet
1619
+ */
1620
+ xsltStylesheetPtr principal;
1621
+ #ifdef XSLT_REFACTORED
1622
+ /*
1623
+ * Compilation context used during compile-time.
1624
+ */
1625
+ xsltCompilerCtxtPtr compCtxt; /* TODO: Change this to (void *). */
1626
+
1627
+ xsltPrincipalStylesheetDataPtr principalData;
1628
+ #endif
1629
+ /*
1630
+ * Forwards-compatible processing
1631
+ */
1632
+ int forwards_compatible;
1633
+
1634
+ xmlHashTablePtr namedTemplates; /* hash table of named templates */
1635
+
1636
+ xmlXPathContextPtr xpathCtxt;
1637
+ };
1638
+
1639
+ typedef struct _xsltTransformCache xsltTransformCache;
1640
+ typedef xsltTransformCache *xsltTransformCachePtr;
1641
+ struct _xsltTransformCache {
1642
+ xmlDocPtr RVT;
1643
+ int nbRVT;
1644
+ xsltStackElemPtr stackItems;
1645
+ int nbStackItems;
1646
+ #ifdef XSLT_DEBUG_PROFILE_CACHE
1647
+ int dbgCachedRVTs;
1648
+ int dbgReusedRVTs;
1649
+ int dbgCachedVars;
1650
+ int dbgReusedVars;
1651
+ #endif
1652
+ };
1653
+
1654
+ /*
1655
+ * The in-memory structure corresponding to an XSLT Transformation.
1656
+ */
1657
+ typedef enum {
1658
+ XSLT_OUTPUT_XML = 0,
1659
+ XSLT_OUTPUT_HTML,
1660
+ XSLT_OUTPUT_TEXT
1661
+ } xsltOutputType;
1662
+
1663
+ typedef void *
1664
+ (*xsltNewLocaleFunc)(const xmlChar *lang, int lowerFirst);
1665
+ typedef void
1666
+ (*xsltFreeLocaleFunc)(void *locale);
1667
+ typedef xmlChar *
1668
+ (*xsltGenSortKeyFunc)(void *locale, const xmlChar *lang);
1669
+
1670
+ typedef enum {
1671
+ XSLT_STATE_OK = 0,
1672
+ XSLT_STATE_ERROR,
1673
+ XSLT_STATE_STOPPED
1674
+ } xsltTransformState;
1675
+
1676
+ struct _xsltTransformContext {
1677
+ xsltStylesheetPtr style; /* the stylesheet used */
1678
+ xsltOutputType type; /* the type of output */
1679
+
1680
+ xsltTemplatePtr templ; /* the current template */
1681
+ int templNr; /* Nb of templates in the stack */
1682
+ int templMax; /* Size of the templtes stack */
1683
+ xsltTemplatePtr *templTab; /* the template stack */
1684
+
1685
+ xsltStackElemPtr vars; /* the current variable list */
1686
+ int varsNr; /* Nb of variable list in the stack */
1687
+ int varsMax; /* Size of the variable list stack */
1688
+ xsltStackElemPtr *varsTab; /* the variable list stack */
1689
+ int varsBase; /* the var base for current templ */
1690
+
1691
+ /*
1692
+ * Extensions
1693
+ */
1694
+ xmlHashTablePtr extFunctions; /* the extension functions */
1695
+ xmlHashTablePtr extElements; /* the extension elements */
1696
+ xmlHashTablePtr extInfos; /* the extension data */
1697
+
1698
+ const xmlChar *mode; /* the current mode */
1699
+ const xmlChar *modeURI; /* the current mode URI */
1700
+
1701
+ xsltDocumentPtr docList; /* the document list */
1702
+
1703
+ xsltDocumentPtr document; /* the current source document; can be NULL if an RTF */
1704
+ xmlNodePtr node; /* the current node being processed */
1705
+ xmlNodeSetPtr nodeList; /* the current node list */
1706
+ /* xmlNodePtr current; the node */
1707
+
1708
+ xmlDocPtr output; /* the resulting document */
1709
+ xmlNodePtr insert; /* the insertion node */
1710
+
1711
+ xmlXPathContextPtr xpathCtxt; /* the XPath context */
1712
+ xsltTransformState state; /* the current state */
1713
+
1714
+ /*
1715
+ * Global variables
1716
+ */
1717
+ xmlHashTablePtr globalVars; /* the global variables and params */
1718
+
1719
+ xmlNodePtr inst; /* the instruction in the stylesheet */
1720
+
1721
+ int xinclude; /* should XInclude be processed */
1722
+
1723
+ const char * outputFile; /* the output URI if known */
1724
+
1725
+ int profile; /* is this run profiled */
1726
+ long prof; /* the current profiled value */
1727
+ int profNr; /* Nb of templates in the stack */
1728
+ int profMax; /* Size of the templtaes stack */
1729
+ long *profTab; /* the profile template stack */
1730
+
1731
+ void *_private; /* user defined data */
1732
+
1733
+ int extrasNr; /* the number of extras used */
1734
+ int extrasMax; /* the number of extras allocated */
1735
+ xsltRuntimeExtraPtr extras; /* extra per runtime information */
1736
+
1737
+ xsltDocumentPtr styleList; /* the stylesheet docs list */
1738
+ void * sec; /* the security preferences if any */
1739
+
1740
+ xmlGenericErrorFunc error; /* a specific error handler */
1741
+ void * errctx; /* context for the error handler */
1742
+
1743
+ xsltSortFunc sortfunc; /* a ctxt specific sort routine */
1744
+
1745
+ /*
1746
+ * handling of temporary Result Value Tree
1747
+ * (XSLT 1.0 term: "Result Tree Fragment")
1748
+ */
1749
+ xmlDocPtr tmpRVT; /* list of RVT without persistance */
1750
+ xmlDocPtr persistRVT; /* list of persistant RVTs */
1751
+ int ctxtflags; /* context processing flags */
1752
+
1753
+ /*
1754
+ * Speed optimization when coalescing text nodes
1755
+ */
1756
+ const xmlChar *lasttext; /* last text node content */
1757
+ int lasttsize; /* last text node size */
1758
+ int lasttuse; /* last text node use */
1759
+ /*
1760
+ * Per Context Debugging
1761
+ */
1762
+ int debugStatus; /* the context level debug status */
1763
+ unsigned long* traceCode; /* pointer to the variable holding the mask */
1764
+
1765
+ int parserOptions; /* parser options xmlParserOption */
1766
+
1767
+ /*
1768
+ * dictionary: shared between stylesheet, context and documents.
1769
+ */
1770
+ xmlDictPtr dict;
1771
+ xmlDocPtr tmpDoc; /* Obsolete; not used in the library. */
1772
+ /*
1773
+ * all document text strings are internalized
1774
+ */
1775
+ int internalized;
1776
+ int nbKeys;
1777
+ int hasTemplKeyPatterns;
1778
+ xsltTemplatePtr currentTemplateRule; /* the Current Template Rule */
1779
+ xmlNodePtr initialContextNode;
1780
+ xmlDocPtr initialContextDoc;
1781
+ xsltTransformCachePtr cache;
1782
+ void *contextVariable; /* the current variable item */
1783
+ xmlDocPtr localRVT; /* list of local tree fragments; will be freed when
1784
+ the instruction which created the fragment
1785
+ exits */
1786
+ xmlDocPtr localRVTBase; /* Obsolete */
1787
+ int keyInitLevel; /* Needed to catch recursive keys issues */
1788
+ int depth; /* Needed to catch recursions */
1789
+ int maxTemplateDepth;
1790
+ int maxTemplateVars;
1791
+ unsigned long opLimit;
1792
+ unsigned long opCount;
1793
+ int sourceDocDirty;
1794
+ unsigned long currentId; /* For generate-id() */
1795
+
1796
+ xsltNewLocaleFunc newLocale;
1797
+ xsltFreeLocaleFunc freeLocale;
1798
+ xsltGenSortKeyFunc genSortKey;
1799
+ };
1800
+
1801
+ /**
1802
+ * CHECK_STOPPED:
1803
+ *
1804
+ * Macro to check if the XSLT processing should be stopped.
1805
+ * Will return from the function.
1806
+ */
1807
+ #define CHECK_STOPPED if (ctxt->state == XSLT_STATE_STOPPED) return;
1808
+
1809
+ /**
1810
+ * CHECK_STOPPEDE:
1811
+ *
1812
+ * Macro to check if the XSLT processing should be stopped.
1813
+ * Will goto the error: label.
1814
+ */
1815
+ #define CHECK_STOPPEDE if (ctxt->state == XSLT_STATE_STOPPED) goto error;
1816
+
1817
+ /**
1818
+ * CHECK_STOPPED0:
1819
+ *
1820
+ * Macro to check if the XSLT processing should be stopped.
1821
+ * Will return from the function with a 0 value.
1822
+ */
1823
+ #define CHECK_STOPPED0 if (ctxt->state == XSLT_STATE_STOPPED) return(0);
1824
+
1825
+ /*
1826
+ * The macro XML_CAST_FPTR is a hack to avoid a gcc warning about
1827
+ * possible incompatibilities between function pointers and object
1828
+ * pointers. It is defined in libxml/hash.h within recent versions
1829
+ * of libxml2, but is put here for compatibility.
1830
+ */
1831
+ #ifndef XML_CAST_FPTR
1832
+ /**
1833
+ * XML_CAST_FPTR:
1834
+ * @fptr: pointer to a function
1835
+ *
1836
+ * Macro to do a casting from an object pointer to a
1837
+ * function pointer without encountering a warning from
1838
+ * gcc
1839
+ *
1840
+ * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
1841
+ * This macro violated ISO C aliasing rules (gcc4 on s390 broke)
1842
+ * so it is disabled now
1843
+ */
1844
+
1845
+ #define XML_CAST_FPTR(fptr) fptr
1846
+ #endif
1847
+ /*
1848
+ * Functions associated to the internal types
1849
+ xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet,
1850
+ xmlChar *name);
1851
+ */
1852
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1853
+ xsltNewStylesheet (void);
1854
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1855
+ xsltParseStylesheetFile (const xmlChar* filename);
1856
+ XSLTPUBFUN void XSLTCALL
1857
+ xsltFreeStylesheet (xsltStylesheetPtr style);
1858
+ XSLTPUBFUN int XSLTCALL
1859
+ xsltIsBlank (xmlChar *str);
1860
+ XSLTPUBFUN void XSLTCALL
1861
+ xsltFreeStackElemList (xsltStackElemPtr elem);
1862
+ XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
1863
+ xsltDecimalFormatGetByName(xsltStylesheetPtr style,
1864
+ xmlChar *name);
1865
+ XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
1866
+ xsltDecimalFormatGetByQName(xsltStylesheetPtr style,
1867
+ const xmlChar *nsUri,
1868
+ const xmlChar *name);
1869
+
1870
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1871
+ xsltParseStylesheetProcess(xsltStylesheetPtr ret,
1872
+ xmlDocPtr doc);
1873
+ XSLTPUBFUN void XSLTCALL
1874
+ xsltParseStylesheetOutput(xsltStylesheetPtr style,
1875
+ xmlNodePtr cur);
1876
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1877
+ xsltParseStylesheetDoc (xmlDocPtr doc);
1878
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1879
+ xsltParseStylesheetImportedDoc(xmlDocPtr doc,
1880
+ xsltStylesheetPtr style);
1881
+ XSLTPUBFUN int XSLTCALL
1882
+ xsltParseStylesheetUser(xsltStylesheetPtr style,
1883
+ xmlDocPtr doc);
1884
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1885
+ xsltLoadStylesheetPI (xmlDocPtr doc);
1886
+ XSLTPUBFUN void XSLTCALL
1887
+ xsltNumberFormat (xsltTransformContextPtr ctxt,
1888
+ xsltNumberDataPtr data,
1889
+ xmlNodePtr node);
1890
+ XSLTPUBFUN xmlXPathError XSLTCALL
1891
+ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
1892
+ xmlChar *format,
1893
+ double number,
1894
+ xmlChar **result);
1895
+
1896
+ XSLTPUBFUN void XSLTCALL
1897
+ xsltParseTemplateContent(xsltStylesheetPtr style,
1898
+ xmlNodePtr templ);
1899
+ XSLTPUBFUN int XSLTCALL
1900
+ xsltAllocateExtra (xsltStylesheetPtr style);
1901
+ XSLTPUBFUN int XSLTCALL
1902
+ xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt);
1903
+ /*
1904
+ * Extra functions for Result Value Trees
1905
+ */
1906
+ XSLTPUBFUN xmlDocPtr XSLTCALL
1907
+ xsltCreateRVT (xsltTransformContextPtr ctxt);
1908
+ XSLTPUBFUN int XSLTCALL
1909
+ xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
1910
+ xmlDocPtr RVT);
1911
+ XSLTPUBFUN int XSLTCALL
1912
+ xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
1913
+ xmlDocPtr RVT);
1914
+ XSLTPUBFUN int XSLTCALL
1915
+ xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
1916
+ xmlDocPtr RVT);
1917
+ XSLTPUBFUN int XSLTCALL
1918
+ xsltExtensionInstructionResultRegister(
1919
+ xsltTransformContextPtr ctxt,
1920
+ xmlXPathObjectPtr obj);
1921
+ XSLTPUBFUN int XSLTCALL
1922
+ xsltExtensionInstructionResultFinalize(
1923
+ xsltTransformContextPtr ctxt);
1924
+ XSLTPUBFUN int XSLTCALL
1925
+ xsltFlagRVTs(
1926
+ xsltTransformContextPtr ctxt,
1927
+ xmlXPathObjectPtr obj,
1928
+ int val);
1929
+ XSLTPUBFUN void XSLTCALL
1930
+ xsltFreeRVTs (xsltTransformContextPtr ctxt);
1931
+ XSLTPUBFUN void XSLTCALL
1932
+ xsltReleaseRVT (xsltTransformContextPtr ctxt,
1933
+ xmlDocPtr RVT);
1934
+ /*
1935
+ * Extra functions for Attribute Value Templates
1936
+ */
1937
+ XSLTPUBFUN void XSLTCALL
1938
+ xsltCompileAttr (xsltStylesheetPtr style,
1939
+ xmlAttrPtr attr);
1940
+ XSLTPUBFUN xmlChar * XSLTCALL
1941
+ xsltEvalAVT (xsltTransformContextPtr ctxt,
1942
+ void *avt,
1943
+ xmlNodePtr node);
1944
+ XSLTPUBFUN void XSLTCALL
1945
+ xsltFreeAVTList (void *avt);
1946
+
1947
+ /*
1948
+ * Extra function for successful xsltCleanupGlobals / xsltInit sequence.
1949
+ */
1950
+
1951
+ XSLTPUBFUN void XSLTCALL
1952
+ xsltUninit (void);
1953
+
1954
+ /************************************************************************
1955
+ * *
1956
+ * Compile-time functions for *internal* use only *
1957
+ * *
1958
+ ************************************************************************/
1959
+
1960
+ #ifdef XSLT_REFACTORED
1961
+ XSLTPUBFUN void XSLTCALL
1962
+ xsltParseSequenceConstructor(
1963
+ xsltCompilerCtxtPtr cctxt,
1964
+ xmlNodePtr start);
1965
+ XSLTPUBFUN int XSLTCALL
1966
+ xsltParseAnyXSLTElem (xsltCompilerCtxtPtr cctxt,
1967
+ xmlNodePtr elem);
1968
+ #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1969
+ XSLTPUBFUN int XSLTCALL
1970
+ xsltRestoreDocumentNamespaces(
1971
+ xsltNsMapPtr ns,
1972
+ xmlDocPtr doc);
1973
+ #endif
1974
+ #endif /* XSLT_REFACTORED */
1975
+
1976
+ /************************************************************************
1977
+ * *
1978
+ * Transformation-time functions for *internal* use only *
1979
+ * *
1980
+ ************************************************************************/
1981
+ XSLTPUBFUN int XSLTCALL
1982
+ xsltInitCtxtKey (xsltTransformContextPtr ctxt,
1983
+ xsltDocumentPtr doc,
1984
+ xsltKeyDefPtr keyd);
1985
+ XSLTPUBFUN int XSLTCALL
1986
+ xsltInitAllDocKeys (xsltTransformContextPtr ctxt);
1987
+ #ifdef __cplusplus
1988
+ }
1989
+ #endif
1990
+
1991
+ #endif /* __XML_XSLT_H__ */
1992
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltconfig.h ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: compile-time version information for the XSLT engine
3
+ * Description: compile-time version information for the XSLT engine
4
+ * this module is autogenerated.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLTCONFIG_H__
12
+ #define __XML_XSLTCONFIG_H__
13
+
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+
18
+ /**
19
+ * LIBXSLT_DOTTED_VERSION:
20
+ *
21
+ * the version string like "1.2.3"
22
+ */
23
+ #define LIBXSLT_DOTTED_VERSION "1.1.39"
24
+
25
+ /**
26
+ * LIBXSLT_VERSION:
27
+ *
28
+ * the version number: 1.2.3 value is 10203
29
+ */
30
+ #define LIBXSLT_VERSION 10139
31
+
32
+ /**
33
+ * LIBXSLT_VERSION_STRING:
34
+ *
35
+ * the version number string, 1.2.3 value is "10203"
36
+ */
37
+ #define LIBXSLT_VERSION_STRING "10139"
38
+
39
+ /**
40
+ * LIBXSLT_VERSION_EXTRA:
41
+ *
42
+ * extra version information, used to show a Git commit description
43
+ */
44
+ #define LIBXSLT_VERSION_EXTRA ""
45
+
46
+ /**
47
+ * WITH_XSLT_DEBUG:
48
+ *
49
+ * Activate the compilation of the debug reporting. Speed penalty
50
+ * is insignifiant and being able to run xsltpoc -v is useful. On
51
+ * by default unless --without-debug is passed to configure
52
+ */
53
+ #if 1
54
+ #define WITH_XSLT_DEBUG
55
+ #endif
56
+
57
+ #if 0
58
+ /**
59
+ * DEBUG_MEMORY:
60
+ *
61
+ * should be activated only when debugging libxslt. It replaces the
62
+ * allocator with a collect and debug shell to the libc allocator.
63
+ * Use configure --with-mem-debug to activate it on both library
64
+ */
65
+ #define DEBUG_MEMORY
66
+
67
+ /**
68
+ * DEBUG_MEMORY_LOCATION:
69
+ *
70
+ * should be activated only when debugging libxslt.
71
+ * DEBUG_MEMORY_LOCATION should be activated only when libxml has
72
+ * been configured with --with-debug-mem too
73
+ */
74
+ #define DEBUG_MEMORY_LOCATION
75
+ #endif
76
+
77
+ /**
78
+ * XSLT_NEED_TRIO:
79
+ *
80
+ * should be activated if the existing libc library lacks some of the
81
+ * string formatting function, in that case reuse the Trio ones already
82
+ * compiled in the libxml2 library.
83
+ */
84
+
85
+ #if 0
86
+ #define XSLT_NEED_TRIO
87
+ #endif
88
+ #ifdef __VMS
89
+ #define HAVE_SYS_STAT_H 1
90
+ #ifndef XSLT_NEED_TRIO
91
+ #define XSLT_NEED_TRIO
92
+ #endif
93
+ #endif
94
+
95
+ #ifdef XSLT_NEED_TRIO
96
+ #define TRIO_REPLACE_STDIO
97
+ #endif
98
+
99
+ /**
100
+ * WITH_XSLT_DEBUGGER:
101
+ *
102
+ * Activate the compilation of the debugger support. Speed penalty
103
+ * is insignifiant.
104
+ * On by default unless --without-debugger is passed to configure
105
+ */
106
+ #if 1
107
+ #ifndef WITH_DEBUGGER
108
+ #define WITH_DEBUGGER
109
+ #endif
110
+ #endif
111
+
112
+ /**
113
+ * WITH_PROFILER:
114
+ *
115
+ * Activate the compilation of the profiler. Speed penalty
116
+ * is insignifiant.
117
+ * On by default unless --without-profiler is passed to configure
118
+ */
119
+ #if 1
120
+ #ifndef WITH_PROFILER
121
+ #define WITH_PROFILER
122
+ #endif
123
+ #endif
124
+
125
+ /**
126
+ * WITH_MODULES:
127
+ *
128
+ * Whether module support is configured into libxslt
129
+ * Note: no default module path for win32 platforms
130
+ */
131
+ #if 0
132
+ #ifndef WITH_MODULES
133
+ #define WITH_MODULES
134
+ #endif
135
+ #define LIBXSLT_DEFAULT_PLUGINS_PATH() "/project/build/tmp/libxml2/lib/libxslt-plugins"
136
+ #endif
137
+
138
+ /**
139
+ * ATTRIBUTE_UNUSED:
140
+ *
141
+ * This macro is used to flag unused function parameters to GCC
142
+ */
143
+ #ifdef __GNUC__
144
+ #ifndef ATTRIBUTE_UNUSED
145
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
146
+ #endif
147
+ #else
148
+ #define ATTRIBUTE_UNUSED
149
+ #endif
150
+
151
+ /**
152
+ * LIBXSLT_ATTR_FORMAT:
153
+ *
154
+ * This macro is used to indicate to GCC the parameters are printf-like
155
+ */
156
+ #ifdef __GNUC__
157
+ #define LIBXSLT_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
158
+ #else
159
+ #define LIBXSLT_ATTR_FORMAT(fmt,args)
160
+ #endif
161
+
162
+ /**
163
+ * LIBXSLT_PUBLIC:
164
+ *
165
+ * This macro is used to declare PUBLIC variables for Cygwin and for MSC on Windows
166
+ */
167
+ #if !defined LIBXSLT_PUBLIC
168
+ #if (defined(__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
169
+ #define LIBXSLT_PUBLIC __declspec(dllimport)
170
+ #else
171
+ #define LIBXSLT_PUBLIC
172
+ #endif
173
+ #endif
174
+
175
+ #ifdef __cplusplus
176
+ }
177
+ #endif
178
+
179
+ #endif /* __XML_XSLTCONFIG_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltexports.h ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: macros for marking symbols as exportable/importable.
3
+ * Description: macros for marking symbols as exportable/importable.
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ */
7
+
8
+ #ifndef __XSLT_EXPORTS_H__
9
+ #define __XSLT_EXPORTS_H__
10
+
11
+ #if defined(_WIN32) || defined(__CYGWIN__)
12
+ /** DOC_DISABLE */
13
+
14
+ #ifdef LIBXSLT_STATIC
15
+ #define XSLTPUBLIC
16
+ #elif defined(IN_LIBXSLT)
17
+ #define XSLTPUBLIC __declspec(dllexport)
18
+ #else
19
+ #define XSLTPUBLIC __declspec(dllimport)
20
+ #endif
21
+
22
+ #define XSLTCALL __cdecl
23
+
24
+ /** DOC_ENABLE */
25
+ #else /* not Windows */
26
+
27
+ /**
28
+ * XSLTPUBLIC:
29
+ *
30
+ * Macro which declares a public symbol
31
+ */
32
+ #define XSLTPUBLIC
33
+
34
+ /**
35
+ * XSLTCALL:
36
+ *
37
+ * Macro which declares the calling convention for exported functions
38
+ */
39
+ #define XSLTCALL
40
+
41
+ #endif /* platform switch */
42
+
43
+ /*
44
+ * XSLTPUBFUN:
45
+ *
46
+ * Macro which declares an exportable function
47
+ */
48
+ #define XSLTPUBFUN XSLTPUBLIC
49
+
50
+ /**
51
+ * XSLTPUBVAR:
52
+ *
53
+ * Macro which declares an exportable variable
54
+ */
55
+ #define XSLTPUBVAR XSLTPUBLIC extern
56
+
57
+ /* Compatibility */
58
+ #if !defined(LIBXSLT_PUBLIC)
59
+ #define LIBXSLT_PUBLIC XSLTPUBVAR
60
+ #endif
61
+
62
+ #endif /* __XSLT_EXPORTS_H__ */
63
+
64
+
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltlocale.h ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: Locale handling
3
+ * Description: Interfaces for locale handling. Needed for language dependent
4
+ * sorting.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Nick Wellnhofer
9
+ */
10
+
11
+ #ifndef __XML_XSLTLOCALE_H__
12
+ #define __XML_XSLTLOCALE_H__
13
+
14
+ #include <libxml/xmlstring.h>
15
+ #include "xsltexports.h"
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ XSLTPUBFUN void * XSLTCALL
22
+ xsltNewLocale (const xmlChar *langName,
23
+ int lowerFirst);
24
+ XSLTPUBFUN void XSLTCALL
25
+ xsltFreeLocale (void *locale);
26
+ XSLTPUBFUN xmlChar * XSLTCALL
27
+ xsltStrxfrm (void *locale,
28
+ const xmlChar *string);
29
+ XSLTPUBFUN void XSLTCALL
30
+ xsltFreeLocales (void);
31
+
32
+ /* Backward compatibility */
33
+ typedef void *xsltLocale;
34
+ typedef xmlChar xsltLocaleChar;
35
+ XSLTPUBFUN int XSLTCALL
36
+ xsltLocaleStrcmp (void *locale,
37
+ const xmlChar *str1,
38
+ const xmlChar *str2);
39
+
40
+ #ifdef __cplusplus
41
+ }
42
+ #endif
43
+
44
+ #endif /* __XML_XSLTLOCALE_H__ */
venv/lib/python3.10/site-packages/lxml/includes/libxslt/xsltutils.h ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Summary: set of utilities for the XSLT engine
3
+ * Description: interfaces for the utilities module of the XSLT engine.
4
+ * things like message handling, profiling, and other
5
+ * generally useful routines.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLTUTILS_H__
13
+ #define __XML_XSLTUTILS_H__
14
+
15
+ #include <libxslt/xsltconfig.h>
16
+ #include <libxml/xpath.h>
17
+ #include <libxml/dict.h>
18
+ #include <libxml/xmlerror.h>
19
+ #include "xsltexports.h"
20
+ #include "xsltInternals.h"
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ /**
27
+ * XSLT_TODO:
28
+ *
29
+ * Macro to flag unimplemented blocks.
30
+ */
31
+ #define XSLT_TODO \
32
+ xsltGenericError(xsltGenericErrorContext, \
33
+ "Unimplemented block at %s:%d\n", \
34
+ __FILE__, __LINE__);
35
+
36
+ /**
37
+ * XSLT_STRANGE:
38
+ *
39
+ * Macro to flag that a problem was detected internally.
40
+ */
41
+ #define XSLT_STRANGE \
42
+ xsltGenericError(xsltGenericErrorContext, \
43
+ "Internal error at %s:%d\n", \
44
+ __FILE__, __LINE__);
45
+
46
+ /**
47
+ * IS_XSLT_ELEM:
48
+ *
49
+ * Checks that the element pertains to XSLT namespace.
50
+ */
51
+ #define IS_XSLT_ELEM(n) \
52
+ (((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \
53
+ ((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
54
+
55
+ /**
56
+ * IS_XSLT_NAME:
57
+ *
58
+ * Checks the value of an element in XSLT namespace.
59
+ */
60
+ #define IS_XSLT_NAME(n, val) \
61
+ (xmlStrEqual((n)->name, (const xmlChar *) (val)))
62
+
63
+ /**
64
+ * IS_XSLT_REAL_NODE:
65
+ *
66
+ * Check that a node is a 'real' one: document, element, text or attribute.
67
+ */
68
+ #define IS_XSLT_REAL_NODE(n) \
69
+ (((n) != NULL) && \
70
+ (((n)->type == XML_ELEMENT_NODE) || \
71
+ ((n)->type == XML_TEXT_NODE) || \
72
+ ((n)->type == XML_CDATA_SECTION_NODE) || \
73
+ ((n)->type == XML_ATTRIBUTE_NODE) || \
74
+ ((n)->type == XML_DOCUMENT_NODE) || \
75
+ ((n)->type == XML_HTML_DOCUMENT_NODE) || \
76
+ ((n)->type == XML_COMMENT_NODE) || \
77
+ ((n)->type == XML_PI_NODE)))
78
+
79
+ /*
80
+ * Our own version of namespaced attributes lookup.
81
+ */
82
+ XSLTPUBFUN xmlChar * XSLTCALL
83
+ xsltGetNsProp (xmlNodePtr node,
84
+ const xmlChar *name,
85
+ const xmlChar *nameSpace);
86
+ XSLTPUBFUN const xmlChar * XSLTCALL
87
+ xsltGetCNsProp (xsltStylesheetPtr style,
88
+ xmlNodePtr node,
89
+ const xmlChar *name,
90
+ const xmlChar *nameSpace);
91
+ XSLTPUBFUN int XSLTCALL
92
+ xsltGetUTF8Char (const unsigned char *utf,
93
+ int *len);
94
+ #ifdef IN_LIBXSLT
95
+ /** DOC_DISABLE */
96
+ XSLTPUBFUN int XSLTCALL
97
+ xsltGetUTF8CharZ (const unsigned char *utf,
98
+ int *len);
99
+ /** DOC_ENABLE */
100
+ #endif
101
+
102
+ /*
103
+ * XSLT Debug Tracing Tracing Types
104
+ */
105
+ typedef enum {
106
+ XSLT_TRACE_ALL = -1,
107
+ XSLT_TRACE_NONE = 0,
108
+ XSLT_TRACE_COPY_TEXT = 1<<0,
109
+ XSLT_TRACE_PROCESS_NODE = 1<<1,
110
+ XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
111
+ XSLT_TRACE_COPY = 1<<3,
112
+ XSLT_TRACE_COMMENT = 1<<4,
113
+ XSLT_TRACE_PI = 1<<5,
114
+ XSLT_TRACE_COPY_OF = 1<<6,
115
+ XSLT_TRACE_VALUE_OF = 1<<7,
116
+ XSLT_TRACE_CALL_TEMPLATE = 1<<8,
117
+ XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
118
+ XSLT_TRACE_CHOOSE = 1<<10,
119
+ XSLT_TRACE_IF = 1<<11,
120
+ XSLT_TRACE_FOR_EACH = 1<<12,
121
+ XSLT_TRACE_STRIP_SPACES = 1<<13,
122
+ XSLT_TRACE_TEMPLATES = 1<<14,
123
+ XSLT_TRACE_KEYS = 1<<15,
124
+ XSLT_TRACE_VARIABLES = 1<<16
125
+ } xsltDebugTraceCodes;
126
+
127
+ /**
128
+ * XSLT_TRACE:
129
+ *
130
+ * Control the type of xsl debugtrace messages emitted.
131
+ */
132
+ #define XSLT_TRACE(ctxt,code,call) \
133
+ if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
134
+ call
135
+
136
+ XSLTPUBFUN void XSLTCALL
137
+ xsltDebugSetDefaultTrace(xsltDebugTraceCodes val);
138
+ XSLTPUBFUN xsltDebugTraceCodes XSLTCALL
139
+ xsltDebugGetDefaultTrace(void);
140
+
141
+ /*
142
+ * XSLT specific error and debug reporting functions.
143
+ */
144
+ XSLTPUBVAR xmlGenericErrorFunc xsltGenericError;
145
+ XSLTPUBVAR void *xsltGenericErrorContext;
146
+ XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
147
+ XSLTPUBVAR void *xsltGenericDebugContext;
148
+
149
+ XSLTPUBFUN void XSLTCALL
150
+ xsltPrintErrorContext (xsltTransformContextPtr ctxt,
151
+ xsltStylesheetPtr style,
152
+ xmlNodePtr node);
153
+ XSLTPUBFUN void XSLTCALL
154
+ xsltMessage (xsltTransformContextPtr ctxt,
155
+ xmlNodePtr node,
156
+ xmlNodePtr inst);
157
+ XSLTPUBFUN void XSLTCALL
158
+ xsltSetGenericErrorFunc (void *ctx,
159
+ xmlGenericErrorFunc handler);
160
+ XSLTPUBFUN void XSLTCALL
161
+ xsltSetGenericDebugFunc (void *ctx,
162
+ xmlGenericErrorFunc handler);
163
+ XSLTPUBFUN void XSLTCALL
164
+ xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
165
+ void *ctx,
166
+ xmlGenericErrorFunc handler);
167
+ XSLTPUBFUN void XSLTCALL
168
+ xsltTransformError (xsltTransformContextPtr ctxt,
169
+ xsltStylesheetPtr style,
170
+ xmlNodePtr node,
171
+ const char *msg,
172
+ ...) LIBXSLT_ATTR_FORMAT(4,5);
173
+
174
+ XSLTPUBFUN int XSLTCALL
175
+ xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt,
176
+ int options);
177
+ /*
178
+ * Sorting.
179
+ */
180
+
181
+ XSLTPUBFUN void XSLTCALL
182
+ xsltDocumentSortFunction (xmlNodeSetPtr list);
183
+ XSLTPUBFUN void XSLTCALL
184
+ xsltSetSortFunc (xsltSortFunc handler);
185
+ XSLTPUBFUN void XSLTCALL
186
+ xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
187
+ xsltSortFunc handler);
188
+ XSLTPUBFUN void XSLTCALL
189
+ xsltSetCtxtLocaleHandlers (xsltTransformContextPtr ctxt,
190
+ xsltNewLocaleFunc newLocale,
191
+ xsltFreeLocaleFunc freeLocale,
192
+ xsltGenSortKeyFunc genSortKey);
193
+ XSLTPUBFUN void XSLTCALL
194
+ xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
195
+ xmlNodePtr *sorts,
196
+ int nbsorts);
197
+ XSLTPUBFUN void XSLTCALL
198
+ xsltDoSortFunction (xsltTransformContextPtr ctxt,
199
+ xmlNodePtr * sorts,
200
+ int nbsorts);
201
+ XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
202
+ xsltComputeSortResult (xsltTransformContextPtr ctxt,
203
+ xmlNodePtr sort);
204
+
205
+ /*
206
+ * QNames handling.
207
+ */
208
+
209
+ XSLTPUBFUN const xmlChar * XSLTCALL
210
+ xsltSplitQName (xmlDictPtr dict,
211
+ const xmlChar *name,
212
+ const xmlChar **prefix);
213
+ XSLTPUBFUN const xmlChar * XSLTCALL
214
+ xsltGetQNameURI (xmlNodePtr node,
215
+ xmlChar **name);
216
+
217
+ XSLTPUBFUN const xmlChar * XSLTCALL
218
+ xsltGetQNameURI2 (xsltStylesheetPtr style,
219
+ xmlNodePtr node,
220
+ const xmlChar **name);
221
+
222
+ /*
223
+ * Output, reuse libxml I/O buffers.
224
+ */
225
+ XSLTPUBFUN int XSLTCALL
226
+ xsltSaveResultTo (xmlOutputBufferPtr buf,
227
+ xmlDocPtr result,
228
+ xsltStylesheetPtr style);
229
+ XSLTPUBFUN int XSLTCALL
230
+ xsltSaveResultToFilename (const char *URI,
231
+ xmlDocPtr result,
232
+ xsltStylesheetPtr style,
233
+ int compression);
234
+ XSLTPUBFUN int XSLTCALL
235
+ xsltSaveResultToFile (FILE *file,
236
+ xmlDocPtr result,
237
+ xsltStylesheetPtr style);
238
+ XSLTPUBFUN int XSLTCALL
239
+ xsltSaveResultToFd (int fd,
240
+ xmlDocPtr result,
241
+ xsltStylesheetPtr style);
242
+ XSLTPUBFUN int XSLTCALL
243
+ xsltSaveResultToString (xmlChar **doc_txt_ptr,
244
+ int * doc_txt_len,
245
+ xmlDocPtr result,
246
+ xsltStylesheetPtr style);
247
+
248
+ /*
249
+ * XPath interface
250
+ */
251
+ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
252
+ xsltXPathCompile (xsltStylesheetPtr style,
253
+ const xmlChar *str);
254
+ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
255
+ xsltXPathCompileFlags (xsltStylesheetPtr style,
256
+ const xmlChar *str,
257
+ int flags);
258
+
259
+ #ifdef IN_LIBXSLT
260
+ /** DOC_DISABLE */
261
+ #define XSLT_SOURCE_NODE_MASK 15u
262
+ #define XSLT_SOURCE_NODE_HAS_KEY 1u
263
+ #define XSLT_SOURCE_NODE_HAS_ID 2u
264
+ int
265
+ xsltGetSourceNodeFlags(xmlNodePtr node);
266
+ int
267
+ xsltSetSourceNodeFlags(xsltTransformContextPtr ctxt, xmlNodePtr node,
268
+ int flags);
269
+ int
270
+ xsltClearSourceNodeFlags(xmlNodePtr node, int flags);
271
+ void **
272
+ xsltGetPSVIPtr(xmlNodePtr cur);
273
+ /** DOC_ENABLE */
274
+ #endif
275
+
276
+ #ifdef WITH_PROFILER
277
+ /*
278
+ * Profiling.
279
+ */
280
+ XSLTPUBFUN void XSLTCALL
281
+ xsltSaveProfiling (xsltTransformContextPtr ctxt,
282
+ FILE *output);
283
+ XSLTPUBFUN xmlDocPtr XSLTCALL
284
+ xsltGetProfileInformation (xsltTransformContextPtr ctxt);
285
+
286
+ XSLTPUBFUN long XSLTCALL
287
+ xsltTimestamp (void);
288
+ XSLTPUBFUN void XSLTCALL
289
+ xsltCalibrateAdjust (long delta);
290
+ #endif
291
+
292
+ /**
293
+ * XSLT_TIMESTAMP_TICS_PER_SEC:
294
+ *
295
+ * Sampling precision for profiling
296
+ */
297
+ #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
298
+
299
+ /*
300
+ * Hooks for the debugger.
301
+ */
302
+
303
+ typedef enum {
304
+ XSLT_DEBUG_NONE = 0, /* no debugging allowed */
305
+ XSLT_DEBUG_INIT,
306
+ XSLT_DEBUG_STEP,
307
+ XSLT_DEBUG_STEPOUT,
308
+ XSLT_DEBUG_NEXT,
309
+ XSLT_DEBUG_STOP,
310
+ XSLT_DEBUG_CONT,
311
+ XSLT_DEBUG_RUN,
312
+ XSLT_DEBUG_RUN_RESTART,
313
+ XSLT_DEBUG_QUIT
314
+ } xsltDebugStatusCodes;
315
+
316
+ XSLTPUBVAR int xslDebugStatus;
317
+
318
+ typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node,
319
+ xsltTemplatePtr templ, xsltTransformContextPtr ctxt);
320
+ typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source);
321
+ typedef void (*xsltDropCallCallback) (void);
322
+
323
+ XSLTPUBFUN int XSLTCALL
324
+ xsltGetDebuggerStatus (void);
325
+ #ifdef WITH_DEBUGGER
326
+ XSLTPUBFUN void XSLTCALL
327
+ xsltSetDebuggerStatus (int value);
328
+ XSLTPUBFUN int XSLTCALL
329
+ xsltSetDebuggerCallbacks (int no, void *block);
330
+ XSLTPUBFUN int XSLTCALL
331
+ xslAddCall (xsltTemplatePtr templ,
332
+ xmlNodePtr source);
333
+ XSLTPUBFUN void XSLTCALL
334
+ xslDropCall (void);
335
+ #endif
336
+
337
+ #ifdef __cplusplus
338
+ }
339
+ #endif
340
+
341
+ #endif /* __XML_XSLTUTILS_H__ */
342
+
343
+