lxml 5.3.0__cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.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-i386-linux-gnu.so +0 -0
  4. lxml/_elementpath.py +341 -0
  5. lxml/apihelpers.pxi +1793 -0
  6. lxml/builder.cpython-313-i386-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-i386-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-i386-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-i386-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-i386-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 +8 -0
  172. lxml-5.3.0.dist-info/top_level.txt +1 -0
@@ -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__ */
@@ -0,0 +1,155 @@
1
+ /*
2
+ * Summary: interface for the XML entities handling
3
+ * Description: this module provides some of the entity API needed
4
+ * for the parser and applications.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_ENTITIES_H__
12
+ #define __XML_ENTITIES_H__
13
+
14
+ #include <libxml/xmlversion.h>
15
+ #define XML_TREE_INTERNALS
16
+ #include <libxml/tree.h>
17
+ #undef XML_TREE_INTERNALS
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ /*
24
+ * The different valid entity types.
25
+ */
26
+ typedef enum {
27
+ XML_INTERNAL_GENERAL_ENTITY = 1,
28
+ XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
29
+ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
30
+ XML_INTERNAL_PARAMETER_ENTITY = 4,
31
+ XML_EXTERNAL_PARAMETER_ENTITY = 5,
32
+ XML_INTERNAL_PREDEFINED_ENTITY = 6
33
+ } xmlEntityType;
34
+
35
+ /*
36
+ * An unit of storage for an entity, contains the string, the value
37
+ * and the linkind data needed for the linking in the hash table.
38
+ */
39
+
40
+ struct _xmlEntity {
41
+ void *_private; /* application data */
42
+ xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
43
+ const xmlChar *name; /* Entity name */
44
+ struct _xmlNode *children; /* First child link */
45
+ struct _xmlNode *last; /* Last child link */
46
+ struct _xmlDtd *parent; /* -> DTD */
47
+ struct _xmlNode *next; /* next sibling link */
48
+ struct _xmlNode *prev; /* previous sibling link */
49
+ struct _xmlDoc *doc; /* the containing document */
50
+
51
+ xmlChar *orig; /* content without ref substitution */
52
+ xmlChar *content; /* content or ndata if unparsed */
53
+ int length; /* the content length */
54
+ xmlEntityType etype; /* The entity type */
55
+ const xmlChar *ExternalID; /* External identifier for PUBLIC */
56
+ const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
57
+
58
+ struct _xmlEntity *nexte; /* unused */
59
+ const xmlChar *URI; /* the full URI as computed */
60
+ int owner; /* does the entity own the childrens */
61
+ int flags; /* various flags */
62
+ unsigned long expandedSize; /* expanded size */
63
+ };
64
+
65
+ /*
66
+ * All entities are stored in an hash table.
67
+ * There is 2 separate hash tables for global and parameter entities.
68
+ */
69
+
70
+ typedef struct _xmlHashTable xmlEntitiesTable;
71
+ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
72
+
73
+ /*
74
+ * External functions:
75
+ */
76
+
77
+ #ifdef LIBXML_LEGACY_ENABLED
78
+ XML_DEPRECATED
79
+ XMLPUBFUN void
80
+ xmlInitializePredefinedEntities (void);
81
+ #endif /* LIBXML_LEGACY_ENABLED */
82
+
83
+ XMLPUBFUN xmlEntityPtr
84
+ xmlNewEntity (xmlDocPtr doc,
85
+ const xmlChar *name,
86
+ int type,
87
+ const xmlChar *ExternalID,
88
+ const xmlChar *SystemID,
89
+ const xmlChar *content);
90
+ XMLPUBFUN void
91
+ xmlFreeEntity (xmlEntityPtr entity);
92
+ XMLPUBFUN xmlEntityPtr
93
+ xmlAddDocEntity (xmlDocPtr doc,
94
+ const xmlChar *name,
95
+ int type,
96
+ const xmlChar *ExternalID,
97
+ const xmlChar *SystemID,
98
+ const xmlChar *content);
99
+ XMLPUBFUN xmlEntityPtr
100
+ xmlAddDtdEntity (xmlDocPtr doc,
101
+ const xmlChar *name,
102
+ int type,
103
+ const xmlChar *ExternalID,
104
+ const xmlChar *SystemID,
105
+ const xmlChar *content);
106
+ XMLPUBFUN xmlEntityPtr
107
+ xmlGetPredefinedEntity (const xmlChar *name);
108
+ XMLPUBFUN xmlEntityPtr
109
+ xmlGetDocEntity (const xmlDoc *doc,
110
+ const xmlChar *name);
111
+ XMLPUBFUN xmlEntityPtr
112
+ xmlGetDtdEntity (xmlDocPtr doc,
113
+ const xmlChar *name);
114
+ XMLPUBFUN xmlEntityPtr
115
+ xmlGetParameterEntity (xmlDocPtr doc,
116
+ const xmlChar *name);
117
+ #ifdef LIBXML_LEGACY_ENABLED
118
+ XML_DEPRECATED
119
+ XMLPUBFUN const xmlChar *
120
+ xmlEncodeEntities (xmlDocPtr doc,
121
+ const xmlChar *input);
122
+ #endif /* LIBXML_LEGACY_ENABLED */
123
+ XMLPUBFUN xmlChar *
124
+ xmlEncodeEntitiesReentrant(xmlDocPtr doc,
125
+ const xmlChar *input);
126
+ XMLPUBFUN xmlChar *
127
+ xmlEncodeSpecialChars (const xmlDoc *doc,
128
+ const xmlChar *input);
129
+ XMLPUBFUN xmlEntitiesTablePtr
130
+ xmlCreateEntitiesTable (void);
131
+ #ifdef LIBXML_TREE_ENABLED
132
+ XMLPUBFUN xmlEntitiesTablePtr
133
+ xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
134
+ #endif /* LIBXML_TREE_ENABLED */
135
+ XMLPUBFUN void
136
+ xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
137
+ #ifdef LIBXML_OUTPUT_ENABLED
138
+ XMLPUBFUN void
139
+ xmlDumpEntitiesTable (xmlBufferPtr buf,
140
+ xmlEntitiesTablePtr table);
141
+ XMLPUBFUN void
142
+ xmlDumpEntityDecl (xmlBufferPtr buf,
143
+ xmlEntityPtr ent);
144
+ #endif /* LIBXML_OUTPUT_ENABLED */
145
+ #ifdef LIBXML_LEGACY_ENABLED
146
+ XMLPUBFUN void
147
+ xmlCleanupPredefinedEntities(void);
148
+ #endif /* LIBXML_LEGACY_ENABLED */
149
+
150
+
151
+ #ifdef __cplusplus
152
+ }
153
+ #endif
154
+
155
+ # endif /* __XML_ENTITIES_H__ */
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Summary: interface for all global variables of the library
3
+ * Description: Deprecated, don't use
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ */
7
+
8
+ #ifndef __XML_GLOBALS_H
9
+ #define __XML_GLOBALS_H
10
+
11
+ #include <libxml/xmlversion.h>
12
+
13
+ /*
14
+ * This file was required to access global variables until version v2.12.0.
15
+ *
16
+ * These includes are for backward compatibility.
17
+ */
18
+ #include <libxml/HTMLparser.h>
19
+ #include <libxml/parser.h>
20
+ #include <libxml/xmlerror.h>
21
+ #include <libxml/xmlIO.h>
22
+ #include <libxml/xmlsave.h>
23
+ #include <libxml/threads.h>
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ typedef struct _xmlGlobalState xmlGlobalState;
30
+ typedef xmlGlobalState *xmlGlobalStatePtr;
31
+
32
+ XML_DEPRECATED XMLPUBFUN void
33
+ xmlInitializeGlobalState(xmlGlobalStatePtr gs);
34
+ XML_DEPRECATED XMLPUBFUN
35
+ xmlGlobalStatePtr xmlGetGlobalState(void);
36
+
37
+ #ifdef __cplusplus
38
+ }
39
+ #endif
40
+
41
+ #endif /* __XML_GLOBALS_H */
@@ -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 <bjorn.reese@systematic.dk>
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__ */