lxml 5.3.0__cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. lxml/ElementInclude.py +244 -0
  2. lxml/__init__.py +22 -0
  3. lxml/_elementpath.cpython-313-x86_64-linux-gnu.so +0 -0
  4. lxml/_elementpath.py +341 -0
  5. lxml/apihelpers.pxi +1793 -0
  6. lxml/builder.cpython-313-x86_64-linux-gnu.so +0 -0
  7. lxml/builder.py +232 -0
  8. lxml/classlookup.pxi +580 -0
  9. lxml/cleanup.pxi +215 -0
  10. lxml/cssselect.py +101 -0
  11. lxml/debug.pxi +90 -0
  12. lxml/docloader.pxi +178 -0
  13. lxml/doctestcompare.py +488 -0
  14. lxml/dtd.pxi +478 -0
  15. lxml/etree.cpython-313-x86_64-linux-gnu.so +0 -0
  16. lxml/etree.h +248 -0
  17. lxml/etree.pyx +3731 -0
  18. lxml/etree_api.h +195 -0
  19. lxml/extensions.pxi +833 -0
  20. lxml/html/ElementSoup.py +10 -0
  21. lxml/html/__init__.py +1923 -0
  22. lxml/html/_diffcommand.py +86 -0
  23. lxml/html/_html5builder.py +100 -0
  24. lxml/html/_setmixin.py +56 -0
  25. lxml/html/builder.py +133 -0
  26. lxml/html/clean.py +21 -0
  27. lxml/html/defs.py +135 -0
  28. lxml/html/diff.cpython-313-x86_64-linux-gnu.so +0 -0
  29. lxml/html/diff.py +878 -0
  30. lxml/html/formfill.py +299 -0
  31. lxml/html/html5parser.py +260 -0
  32. lxml/html/soupparser.py +314 -0
  33. lxml/html/usedoctest.py +13 -0
  34. lxml/includes/__init__.pxd +0 -0
  35. lxml/includes/__init__.py +0 -0
  36. lxml/includes/c14n.pxd +25 -0
  37. lxml/includes/config.pxd +3 -0
  38. lxml/includes/dtdvalid.pxd +18 -0
  39. lxml/includes/etree_defs.h +379 -0
  40. lxml/includes/etreepublic.pxd +237 -0
  41. lxml/includes/extlibs/__init__.py +0 -0
  42. lxml/includes/extlibs/libcharset.h +45 -0
  43. lxml/includes/extlibs/localcharset.h +137 -0
  44. lxml/includes/extlibs/zconf.h +543 -0
  45. lxml/includes/extlibs/zlib.h +1938 -0
  46. lxml/includes/htmlparser.pxd +56 -0
  47. lxml/includes/libexslt/__init__.py +0 -0
  48. lxml/includes/libexslt/exslt.h +108 -0
  49. lxml/includes/libexslt/exsltconfig.h +70 -0
  50. lxml/includes/libexslt/exsltexports.h +63 -0
  51. lxml/includes/libxml/HTMLparser.h +343 -0
  52. lxml/includes/libxml/HTMLtree.h +147 -0
  53. lxml/includes/libxml/SAX.h +202 -0
  54. lxml/includes/libxml/SAX2.h +171 -0
  55. lxml/includes/libxml/__init__.py +0 -0
  56. lxml/includes/libxml/c14n.h +126 -0
  57. lxml/includes/libxml/catalog.h +182 -0
  58. lxml/includes/libxml/chvalid.h +230 -0
  59. lxml/includes/libxml/debugXML.h +217 -0
  60. lxml/includes/libxml/dict.h +82 -0
  61. lxml/includes/libxml/encoding.h +235 -0
  62. lxml/includes/libxml/entities.h +155 -0
  63. lxml/includes/libxml/globals.h +41 -0
  64. lxml/includes/libxml/hash.h +232 -0
  65. lxml/includes/libxml/list.h +137 -0
  66. lxml/includes/libxml/nanoftp.h +186 -0
  67. lxml/includes/libxml/nanohttp.h +81 -0
  68. lxml/includes/libxml/parser.h +1384 -0
  69. lxml/includes/libxml/parserInternals.h +663 -0
  70. lxml/includes/libxml/relaxng.h +219 -0
  71. lxml/includes/libxml/schemasInternals.h +959 -0
  72. lxml/includes/libxml/schematron.h +143 -0
  73. lxml/includes/libxml/threads.h +87 -0
  74. lxml/includes/libxml/tree.h +1362 -0
  75. lxml/includes/libxml/uri.h +95 -0
  76. lxml/includes/libxml/valid.h +450 -0
  77. lxml/includes/libxml/xinclude.h +129 -0
  78. lxml/includes/libxml/xlink.h +189 -0
  79. lxml/includes/libxml/xmlIO.h +421 -0
  80. lxml/includes/libxml/xmlautomata.h +146 -0
  81. lxml/includes/libxml/xmlerror.h +948 -0
  82. lxml/includes/libxml/xmlexports.h +50 -0
  83. lxml/includes/libxml/xmlmemory.h +225 -0
  84. lxml/includes/libxml/xmlmodule.h +57 -0
  85. lxml/includes/libxml/xmlreader.h +434 -0
  86. lxml/includes/libxml/xmlregexp.h +215 -0
  87. lxml/includes/libxml/xmlsave.h +97 -0
  88. lxml/includes/libxml/xmlschemas.h +249 -0
  89. lxml/includes/libxml/xmlschemastypes.h +152 -0
  90. lxml/includes/libxml/xmlstring.h +140 -0
  91. lxml/includes/libxml/xmlunicode.h +202 -0
  92. lxml/includes/libxml/xmlversion.h +511 -0
  93. lxml/includes/libxml/xmlwriter.h +488 -0
  94. lxml/includes/libxml/xpath.h +575 -0
  95. lxml/includes/libxml/xpathInternals.h +633 -0
  96. lxml/includes/libxml/xpointer.h +138 -0
  97. lxml/includes/libxslt/__init__.py +0 -0
  98. lxml/includes/libxslt/attributes.h +39 -0
  99. lxml/includes/libxslt/documents.h +93 -0
  100. lxml/includes/libxslt/extensions.h +262 -0
  101. lxml/includes/libxslt/extra.h +72 -0
  102. lxml/includes/libxslt/functions.h +78 -0
  103. lxml/includes/libxslt/imports.h +75 -0
  104. lxml/includes/libxslt/keys.h +53 -0
  105. lxml/includes/libxslt/namespaces.h +68 -0
  106. lxml/includes/libxslt/numbersInternals.h +73 -0
  107. lxml/includes/libxslt/pattern.h +84 -0
  108. lxml/includes/libxslt/preproc.h +43 -0
  109. lxml/includes/libxslt/security.h +104 -0
  110. lxml/includes/libxslt/templates.h +77 -0
  111. lxml/includes/libxslt/transform.h +207 -0
  112. lxml/includes/libxslt/variables.h +118 -0
  113. lxml/includes/libxslt/xslt.h +110 -0
  114. lxml/includes/libxslt/xsltInternals.h +1995 -0
  115. lxml/includes/libxslt/xsltconfig.h +146 -0
  116. lxml/includes/libxslt/xsltexports.h +64 -0
  117. lxml/includes/libxslt/xsltlocale.h +44 -0
  118. lxml/includes/libxslt/xsltutils.h +343 -0
  119. lxml/includes/lxml-version.h +3 -0
  120. lxml/includes/relaxng.pxd +64 -0
  121. lxml/includes/schematron.pxd +34 -0
  122. lxml/includes/tree.pxd +494 -0
  123. lxml/includes/uri.pxd +5 -0
  124. lxml/includes/xinclude.pxd +22 -0
  125. lxml/includes/xmlerror.pxd +852 -0
  126. lxml/includes/xmlparser.pxd +265 -0
  127. lxml/includes/xmlschema.pxd +35 -0
  128. lxml/includes/xpath.pxd +136 -0
  129. lxml/includes/xslt.pxd +190 -0
  130. lxml/isoschematron/__init__.py +348 -0
  131. lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
  132. lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
  133. lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
  134. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
  135. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
  136. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  137. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
  138. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
  139. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
  140. lxml/iterparse.pxi +438 -0
  141. lxml/lxml.etree.h +248 -0
  142. lxml/lxml.etree_api.h +195 -0
  143. lxml/nsclasses.pxi +281 -0
  144. lxml/objectify.cpython-313-x86_64-linux-gnu.so +0 -0
  145. lxml/objectify.pyx +2145 -0
  146. lxml/objectpath.pxi +332 -0
  147. lxml/parser.pxi +2000 -0
  148. lxml/parsertarget.pxi +180 -0
  149. lxml/proxy.pxi +619 -0
  150. lxml/public-api.pxi +178 -0
  151. lxml/pyclasslookup.py +3 -0
  152. lxml/readonlytree.pxi +565 -0
  153. lxml/relaxng.pxi +165 -0
  154. lxml/sax.cpython-313-x86_64-linux-gnu.so +0 -0
  155. lxml/sax.py +275 -0
  156. lxml/saxparser.pxi +875 -0
  157. lxml/schematron.pxi +168 -0
  158. lxml/serializer.pxi +1781 -0
  159. lxml/usedoctest.py +13 -0
  160. lxml/xinclude.pxi +67 -0
  161. lxml/xmlerror.pxi +1654 -0
  162. lxml/xmlid.pxi +179 -0
  163. lxml/xmlschema.pxi +215 -0
  164. lxml/xpath.pxi +487 -0
  165. lxml/xslt.pxi +950 -0
  166. lxml/xsltext.pxi +242 -0
  167. lxml-5.3.0.dist-info/LICENSE.txt +29 -0
  168. lxml-5.3.0.dist-info/LICENSES.txt +29 -0
  169. lxml-5.3.0.dist-info/METADATA +103 -0
  170. lxml-5.3.0.dist-info/RECORD +172 -0
  171. lxml-5.3.0.dist-info/WHEEL +6 -0
  172. lxml-5.3.0.dist-info/top_level.txt +1 -0
@@ -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__ */
@@ -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__ */