nokogiri 1.18.0-aarch64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +39 -0
  3. data/LICENSE-DEPENDENCIES.md +2224 -0
  4. data/LICENSE.md +9 -0
  5. data/README.md +293 -0
  6. data/bin/nokogiri +131 -0
  7. data/dependencies.yml +42 -0
  8. data/ext/nokogiri/depend +38 -0
  9. data/ext/nokogiri/extconf.rb +1173 -0
  10. data/ext/nokogiri/gumbo.c +610 -0
  11. data/ext/nokogiri/html4_document.c +171 -0
  12. data/ext/nokogiri/html4_element_description.c +299 -0
  13. data/ext/nokogiri/html4_entity_lookup.c +37 -0
  14. data/ext/nokogiri/html4_sax_parser.c +40 -0
  15. data/ext/nokogiri/html4_sax_parser_context.c +98 -0
  16. data/ext/nokogiri/html4_sax_push_parser.c +96 -0
  17. data/ext/nokogiri/include/libexslt/exslt.h +108 -0
  18. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  19. data/ext/nokogiri/include/libexslt/exsltexports.h +63 -0
  20. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +336 -0
  21. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  22. data/ext/nokogiri/include/libxml2/libxml/SAX.h +202 -0
  23. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +171 -0
  24. data/ext/nokogiri/include/libxml2/libxml/c14n.h +115 -0
  25. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  26. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  27. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  28. data/ext/nokogiri/include/libxml2/libxml/dict.h +82 -0
  29. data/ext/nokogiri/include/libxml2/libxml/encoding.h +244 -0
  30. data/ext/nokogiri/include/libxml2/libxml/entities.h +166 -0
  31. data/ext/nokogiri/include/libxml2/libxml/globals.h +41 -0
  32. data/ext/nokogiri/include/libxml2/libxml/hash.h +251 -0
  33. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  34. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +186 -0
  35. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +98 -0
  36. data/ext/nokogiri/include/libxml2/libxml/parser.h +1390 -0
  37. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +671 -0
  38. data/ext/nokogiri/include/libxml2/libxml/pattern.h +106 -0
  39. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +219 -0
  40. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +959 -0
  41. data/ext/nokogiri/include/libxml2/libxml/schematron.h +143 -0
  42. data/ext/nokogiri/include/libxml2/libxml/threads.h +87 -0
  43. data/ext/nokogiri/include/libxml2/libxml/tree.h +1382 -0
  44. data/ext/nokogiri/include/libxml2/libxml/uri.h +106 -0
  45. data/ext/nokogiri/include/libxml2/libxml/valid.h +477 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +136 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +438 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +962 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +146 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +188 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +436 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +215 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +102 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +249 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +152 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  60. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +366 -0
  61. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +347 -0
  62. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +489 -0
  63. data/ext/nokogiri/include/libxml2/libxml/xpath.h +579 -0
  64. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +633 -0
  65. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +138 -0
  66. data/ext/nokogiri/include/libxslt/attributes.h +39 -0
  67. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  68. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  69. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  70. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  71. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  72. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  73. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  74. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  75. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  76. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  77. data/ext/nokogiri/include/libxslt/security.h +104 -0
  78. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  79. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  80. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  81. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  82. data/ext/nokogiri/include/libxslt/xsltInternals.h +1995 -0
  83. data/ext/nokogiri/include/libxslt/xsltconfig.h +146 -0
  84. data/ext/nokogiri/include/libxslt/xsltexports.h +64 -0
  85. data/ext/nokogiri/include/libxslt/xsltlocale.h +44 -0
  86. data/ext/nokogiri/include/libxslt/xsltutils.h +343 -0
  87. data/ext/nokogiri/libxml2_polyfill.c +114 -0
  88. data/ext/nokogiri/nokogiri.c +294 -0
  89. data/ext/nokogiri/nokogiri.h +238 -0
  90. data/ext/nokogiri/test_global_handlers.c +40 -0
  91. data/ext/nokogiri/xml_attr.c +103 -0
  92. data/ext/nokogiri/xml_attribute_decl.c +70 -0
  93. data/ext/nokogiri/xml_cdata.c +62 -0
  94. data/ext/nokogiri/xml_comment.c +57 -0
  95. data/ext/nokogiri/xml_document.c +784 -0
  96. data/ext/nokogiri/xml_document_fragment.c +29 -0
  97. data/ext/nokogiri/xml_dtd.c +208 -0
  98. data/ext/nokogiri/xml_element_content.c +131 -0
  99. data/ext/nokogiri/xml_element_decl.c +69 -0
  100. data/ext/nokogiri/xml_encoding_handler.c +112 -0
  101. data/ext/nokogiri/xml_entity_decl.c +112 -0
  102. data/ext/nokogiri/xml_entity_reference.c +50 -0
  103. data/ext/nokogiri/xml_namespace.c +181 -0
  104. data/ext/nokogiri/xml_node.c +2459 -0
  105. data/ext/nokogiri/xml_node_set.c +518 -0
  106. data/ext/nokogiri/xml_processing_instruction.c +54 -0
  107. data/ext/nokogiri/xml_reader.c +777 -0
  108. data/ext/nokogiri/xml_relax_ng.c +149 -0
  109. data/ext/nokogiri/xml_sax_parser.c +403 -0
  110. data/ext/nokogiri/xml_sax_parser_context.c +390 -0
  111. data/ext/nokogiri/xml_sax_push_parser.c +206 -0
  112. data/ext/nokogiri/xml_schema.c +226 -0
  113. data/ext/nokogiri/xml_syntax_error.c +93 -0
  114. data/ext/nokogiri/xml_text.c +59 -0
  115. data/ext/nokogiri/xml_xpath_context.c +486 -0
  116. data/ext/nokogiri/xslt_stylesheet.c +421 -0
  117. data/gumbo-parser/CHANGES.md +63 -0
  118. data/gumbo-parser/Makefile +129 -0
  119. data/gumbo-parser/THANKS +27 -0
  120. data/lib/nokogiri/3.1/nokogiri.so +0 -0
  121. data/lib/nokogiri/3.2/nokogiri.so +0 -0
  122. data/lib/nokogiri/3.3/nokogiri.so +0 -0
  123. data/lib/nokogiri/3.4/nokogiri.so +0 -0
  124. data/lib/nokogiri/class_resolver.rb +67 -0
  125. data/lib/nokogiri/css/node.rb +58 -0
  126. data/lib/nokogiri/css/parser.rb +772 -0
  127. data/lib/nokogiri/css/parser.y +277 -0
  128. data/lib/nokogiri/css/parser_extras.rb +36 -0
  129. data/lib/nokogiri/css/selector_cache.rb +38 -0
  130. data/lib/nokogiri/css/syntax_error.rb +9 -0
  131. data/lib/nokogiri/css/tokenizer.rb +155 -0
  132. data/lib/nokogiri/css/tokenizer.rex +57 -0
  133. data/lib/nokogiri/css/xpath_visitor.rb +375 -0
  134. data/lib/nokogiri/css.rb +132 -0
  135. data/lib/nokogiri/decorators/slop.rb +42 -0
  136. data/lib/nokogiri/encoding_handler.rb +57 -0
  137. data/lib/nokogiri/extension.rb +32 -0
  138. data/lib/nokogiri/gumbo.rb +15 -0
  139. data/lib/nokogiri/html.rb +48 -0
  140. data/lib/nokogiri/html4/builder.rb +37 -0
  141. data/lib/nokogiri/html4/document.rb +235 -0
  142. data/lib/nokogiri/html4/document_fragment.rb +166 -0
  143. data/lib/nokogiri/html4/element_description.rb +25 -0
  144. data/lib/nokogiri/html4/element_description_defaults.rb +2040 -0
  145. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  146. data/lib/nokogiri/html4/entity_lookup.rb +15 -0
  147. data/lib/nokogiri/html4/sax/parser.rb +48 -0
  148. data/lib/nokogiri/html4/sax/parser_context.rb +15 -0
  149. data/lib/nokogiri/html4/sax/push_parser.rb +37 -0
  150. data/lib/nokogiri/html4.rb +42 -0
  151. data/lib/nokogiri/html5/builder.rb +40 -0
  152. data/lib/nokogiri/html5/document.rb +199 -0
  153. data/lib/nokogiri/html5/document_fragment.rb +200 -0
  154. data/lib/nokogiri/html5/node.rb +103 -0
  155. data/lib/nokogiri/html5.rb +368 -0
  156. data/lib/nokogiri/jruby/dependencies.rb +3 -0
  157. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  158. data/lib/nokogiri/syntax_error.rb +6 -0
  159. data/lib/nokogiri/version/constant.rb +6 -0
  160. data/lib/nokogiri/version/info.rb +224 -0
  161. data/lib/nokogiri/version.rb +4 -0
  162. data/lib/nokogiri/xml/attr.rb +66 -0
  163. data/lib/nokogiri/xml/attribute_decl.rb +22 -0
  164. data/lib/nokogiri/xml/builder.rb +494 -0
  165. data/lib/nokogiri/xml/cdata.rb +13 -0
  166. data/lib/nokogiri/xml/character_data.rb +9 -0
  167. data/lib/nokogiri/xml/document.rb +514 -0
  168. data/lib/nokogiri/xml/document_fragment.rb +276 -0
  169. data/lib/nokogiri/xml/dtd.rb +34 -0
  170. data/lib/nokogiri/xml/element_content.rb +46 -0
  171. data/lib/nokogiri/xml/element_decl.rb +17 -0
  172. data/lib/nokogiri/xml/entity_decl.rb +23 -0
  173. data/lib/nokogiri/xml/entity_reference.rb +20 -0
  174. data/lib/nokogiri/xml/namespace.rb +57 -0
  175. data/lib/nokogiri/xml/node/save_options.rb +76 -0
  176. data/lib/nokogiri/xml/node.rb +1650 -0
  177. data/lib/nokogiri/xml/node_set.rb +449 -0
  178. data/lib/nokogiri/xml/notation.rb +19 -0
  179. data/lib/nokogiri/xml/parse_options.rb +213 -0
  180. data/lib/nokogiri/xml/pp/character_data.rb +21 -0
  181. data/lib/nokogiri/xml/pp/node.rb +73 -0
  182. data/lib/nokogiri/xml/pp.rb +4 -0
  183. data/lib/nokogiri/xml/processing_instruction.rb +11 -0
  184. data/lib/nokogiri/xml/reader.rb +139 -0
  185. data/lib/nokogiri/xml/relax_ng.rb +75 -0
  186. data/lib/nokogiri/xml/sax/document.rb +258 -0
  187. data/lib/nokogiri/xml/sax/parser.rb +199 -0
  188. data/lib/nokogiri/xml/sax/parser_context.rb +129 -0
  189. data/lib/nokogiri/xml/sax/push_parser.rb +64 -0
  190. data/lib/nokogiri/xml/sax.rb +54 -0
  191. data/lib/nokogiri/xml/schema.rb +140 -0
  192. data/lib/nokogiri/xml/searchable.rb +274 -0
  193. data/lib/nokogiri/xml/syntax_error.rb +94 -0
  194. data/lib/nokogiri/xml/text.rb +11 -0
  195. data/lib/nokogiri/xml/xpath/syntax_error.rb +13 -0
  196. data/lib/nokogiri/xml/xpath.rb +21 -0
  197. data/lib/nokogiri/xml/xpath_context.rb +27 -0
  198. data/lib/nokogiri/xml.rb +65 -0
  199. data/lib/nokogiri/xslt/stylesheet.rb +49 -0
  200. data/lib/nokogiri/xslt.rb +129 -0
  201. data/lib/nokogiri.rb +128 -0
  202. data/lib/xsd/xmlparser/nokogiri.rb +105 -0
  203. metadata +321 -0
@@ -0,0 +1,244 @@
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 int
166
+ xmlLookupCharEncodingHandler (xmlCharEncoding enc,
167
+ xmlCharEncodingHandlerPtr *out);
168
+ XMLPUBFUN int
169
+ xmlOpenCharEncodingHandler (const char *name,
170
+ int output,
171
+ xmlCharEncodingHandlerPtr *out);
172
+ XMLPUBFUN xmlCharEncodingHandlerPtr
173
+ xmlGetCharEncodingHandler (xmlCharEncoding enc);
174
+ XMLPUBFUN xmlCharEncodingHandlerPtr
175
+ xmlFindCharEncodingHandler (const char *name);
176
+ XMLPUBFUN xmlCharEncodingHandlerPtr
177
+ xmlNewCharEncodingHandler (const char *name,
178
+ xmlCharEncodingInputFunc input,
179
+ xmlCharEncodingOutputFunc output);
180
+
181
+ /*
182
+ * Interfaces for encoding names and aliases.
183
+ */
184
+ XMLPUBFUN int
185
+ xmlAddEncodingAlias (const char *name,
186
+ const char *alias);
187
+ XMLPUBFUN int
188
+ xmlDelEncodingAlias (const char *alias);
189
+ XMLPUBFUN const char *
190
+ xmlGetEncodingAlias (const char *alias);
191
+ XMLPUBFUN void
192
+ xmlCleanupEncodingAliases (void);
193
+ XMLPUBFUN xmlCharEncoding
194
+ xmlParseCharEncoding (const char *name);
195
+ XMLPUBFUN const char *
196
+ xmlGetCharEncodingName (xmlCharEncoding enc);
197
+
198
+ /*
199
+ * Interfaces directly used by the parsers.
200
+ */
201
+ XMLPUBFUN xmlCharEncoding
202
+ xmlDetectCharEncoding (const unsigned char *in,
203
+ int len);
204
+
205
+ /** DOC_DISABLE */
206
+ struct _xmlBuffer;
207
+ /** DOC_ENABLE */
208
+ XMLPUBFUN int
209
+ xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
210
+ struct _xmlBuffer *out,
211
+ struct _xmlBuffer *in);
212
+
213
+ XMLPUBFUN int
214
+ xmlCharEncInFunc (xmlCharEncodingHandler *handler,
215
+ struct _xmlBuffer *out,
216
+ struct _xmlBuffer *in);
217
+ XML_DEPRECATED
218
+ XMLPUBFUN int
219
+ xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
220
+ struct _xmlBuffer *out,
221
+ struct _xmlBuffer *in);
222
+ XMLPUBFUN int
223
+ xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
224
+
225
+ /*
226
+ * Export a few useful functions
227
+ */
228
+ #ifdef LIBXML_OUTPUT_ENABLED
229
+ XMLPUBFUN int
230
+ UTF8Toisolat1 (unsigned char *out,
231
+ int *outlen,
232
+ const unsigned char *in,
233
+ int *inlen);
234
+ #endif /* LIBXML_OUTPUT_ENABLED */
235
+ XMLPUBFUN int
236
+ isolat1ToUTF8 (unsigned char *out,
237
+ int *outlen,
238
+ const unsigned char *in,
239
+ int *inlen);
240
+ #ifdef __cplusplus
241
+ }
242
+ #endif
243
+
244
+ #endif /* __XML_CHAR_ENCODING_H__ */
@@ -0,0 +1,166 @@
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
+ /** DOC_DISABLE */
15
+ #include <libxml/xmlversion.h>
16
+ #define XML_TREE_INTERNALS
17
+ #include <libxml/tree.h>
18
+ #undef XML_TREE_INTERNALS
19
+ /** DOC_ENABLE */
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ /*
26
+ * The different valid entity types.
27
+ */
28
+ typedef enum {
29
+ XML_INTERNAL_GENERAL_ENTITY = 1,
30
+ XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
31
+ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
32
+ XML_INTERNAL_PARAMETER_ENTITY = 4,
33
+ XML_EXTERNAL_PARAMETER_ENTITY = 5,
34
+ XML_INTERNAL_PREDEFINED_ENTITY = 6
35
+ } xmlEntityType;
36
+
37
+ /*
38
+ * An unit of storage for an entity, contains the string, the value
39
+ * and the linkind data needed for the linking in the hash table.
40
+ */
41
+
42
+ struct _xmlEntity {
43
+ void *_private; /* application data */
44
+ xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
45
+ const xmlChar *name; /* Entity name */
46
+ struct _xmlNode *children; /* First child link */
47
+ struct _xmlNode *last; /* Last child link */
48
+ struct _xmlDtd *parent; /* -> DTD */
49
+ struct _xmlNode *next; /* next sibling link */
50
+ struct _xmlNode *prev; /* previous sibling link */
51
+ struct _xmlDoc *doc; /* the containing document */
52
+
53
+ xmlChar *orig; /* content without ref substitution */
54
+ xmlChar *content; /* content or ndata if unparsed */
55
+ int length; /* the content length */
56
+ xmlEntityType etype; /* The entity type */
57
+ const xmlChar *ExternalID; /* External identifier for PUBLIC */
58
+ const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
59
+
60
+ struct _xmlEntity *nexte; /* unused */
61
+ const xmlChar *URI; /* the full URI as computed */
62
+ int owner; /* unused */
63
+ int flags; /* various flags */
64
+ unsigned long expandedSize; /* expanded size */
65
+ };
66
+
67
+ /*
68
+ * All entities are stored in an hash table.
69
+ * There is 2 separate hash tables for global and parameter entities.
70
+ */
71
+
72
+ typedef struct _xmlHashTable xmlEntitiesTable;
73
+ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
74
+
75
+ /*
76
+ * External functions:
77
+ */
78
+
79
+ #ifdef LIBXML_LEGACY_ENABLED
80
+ XML_DEPRECATED
81
+ XMLPUBFUN void
82
+ xmlInitializePredefinedEntities (void);
83
+ #endif /* LIBXML_LEGACY_ENABLED */
84
+
85
+ XMLPUBFUN xmlEntityPtr
86
+ xmlNewEntity (xmlDocPtr doc,
87
+ const xmlChar *name,
88
+ int type,
89
+ const xmlChar *ExternalID,
90
+ const xmlChar *SystemID,
91
+ const xmlChar *content);
92
+ XMLPUBFUN void
93
+ xmlFreeEntity (xmlEntityPtr entity);
94
+ XMLPUBFUN int
95
+ xmlAddEntity (xmlDocPtr doc,
96
+ int extSubset,
97
+ const xmlChar *name,
98
+ int type,
99
+ const xmlChar *ExternalID,
100
+ const xmlChar *SystemID,
101
+ const xmlChar *content,
102
+ xmlEntityPtr *out);
103
+ XMLPUBFUN xmlEntityPtr
104
+ xmlAddDocEntity (xmlDocPtr doc,
105
+ const xmlChar *name,
106
+ int type,
107
+ const xmlChar *ExternalID,
108
+ const xmlChar *SystemID,
109
+ const xmlChar *content);
110
+ XMLPUBFUN xmlEntityPtr
111
+ xmlAddDtdEntity (xmlDocPtr doc,
112
+ const xmlChar *name,
113
+ int type,
114
+ const xmlChar *ExternalID,
115
+ const xmlChar *SystemID,
116
+ const xmlChar *content);
117
+ XMLPUBFUN xmlEntityPtr
118
+ xmlGetPredefinedEntity (const xmlChar *name);
119
+ XMLPUBFUN xmlEntityPtr
120
+ xmlGetDocEntity (const xmlDoc *doc,
121
+ const xmlChar *name);
122
+ XMLPUBFUN xmlEntityPtr
123
+ xmlGetDtdEntity (xmlDocPtr doc,
124
+ const xmlChar *name);
125
+ XMLPUBFUN xmlEntityPtr
126
+ xmlGetParameterEntity (xmlDocPtr doc,
127
+ const xmlChar *name);
128
+ #ifdef LIBXML_LEGACY_ENABLED
129
+ XML_DEPRECATED
130
+ XMLPUBFUN const xmlChar *
131
+ xmlEncodeEntities (xmlDocPtr doc,
132
+ const xmlChar *input);
133
+ #endif /* LIBXML_LEGACY_ENABLED */
134
+ XMLPUBFUN xmlChar *
135
+ xmlEncodeEntitiesReentrant(xmlDocPtr doc,
136
+ const xmlChar *input);
137
+ XMLPUBFUN xmlChar *
138
+ xmlEncodeSpecialChars (const xmlDoc *doc,
139
+ const xmlChar *input);
140
+ XMLPUBFUN xmlEntitiesTablePtr
141
+ xmlCreateEntitiesTable (void);
142
+ #ifdef LIBXML_TREE_ENABLED
143
+ XMLPUBFUN xmlEntitiesTablePtr
144
+ xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
145
+ #endif /* LIBXML_TREE_ENABLED */
146
+ XMLPUBFUN void
147
+ xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
148
+ #ifdef LIBXML_OUTPUT_ENABLED
149
+ XMLPUBFUN void
150
+ xmlDumpEntitiesTable (xmlBufferPtr buf,
151
+ xmlEntitiesTablePtr table);
152
+ XMLPUBFUN void
153
+ xmlDumpEntityDecl (xmlBufferPtr buf,
154
+ xmlEntityPtr ent);
155
+ #endif /* LIBXML_OUTPUT_ENABLED */
156
+ #ifdef LIBXML_LEGACY_ENABLED
157
+ XMLPUBFUN void
158
+ xmlCleanupPredefinedEntities(void);
159
+ #endif /* LIBXML_LEGACY_ENABLED */
160
+
161
+
162
+ #ifdef __cplusplus
163
+ }
164
+ #endif
165
+
166
+ # 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,251 @@
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
+ xmlHashAdd (xmlHashTablePtr hash,
114
+ const xmlChar *name,
115
+ void *userdata);
116
+ XMLPUBFUN int
117
+ xmlHashAddEntry (xmlHashTablePtr hash,
118
+ const xmlChar *name,
119
+ void *userdata);
120
+ XMLPUBFUN int
121
+ xmlHashUpdateEntry (xmlHashTablePtr hash,
122
+ const xmlChar *name,
123
+ void *userdata,
124
+ xmlHashDeallocator dealloc);
125
+ XMLPUBFUN int
126
+ xmlHashAdd2 (xmlHashTablePtr hash,
127
+ const xmlChar *name,
128
+ const xmlChar *name2,
129
+ void *userdata);
130
+ XMLPUBFUN int
131
+ xmlHashAddEntry2 (xmlHashTablePtr hash,
132
+ const xmlChar *name,
133
+ const xmlChar *name2,
134
+ void *userdata);
135
+ XMLPUBFUN int
136
+ xmlHashUpdateEntry2 (xmlHashTablePtr hash,
137
+ const xmlChar *name,
138
+ const xmlChar *name2,
139
+ void *userdata,
140
+ xmlHashDeallocator dealloc);
141
+ XMLPUBFUN int
142
+ xmlHashAdd3 (xmlHashTablePtr hash,
143
+ const xmlChar *name,
144
+ const xmlChar *name2,
145
+ const xmlChar *name3,
146
+ void *userdata);
147
+ XMLPUBFUN int
148
+ xmlHashAddEntry3 (xmlHashTablePtr hash,
149
+ const xmlChar *name,
150
+ const xmlChar *name2,
151
+ const xmlChar *name3,
152
+ void *userdata);
153
+ XMLPUBFUN int
154
+ xmlHashUpdateEntry3 (xmlHashTablePtr hash,
155
+ const xmlChar *name,
156
+ const xmlChar *name2,
157
+ const xmlChar *name3,
158
+ void *userdata,
159
+ xmlHashDeallocator dealloc);
160
+
161
+ /*
162
+ * Remove an entry from the hash table.
163
+ */
164
+ XMLPUBFUN int
165
+ xmlHashRemoveEntry (xmlHashTablePtr hash,
166
+ const xmlChar *name,
167
+ xmlHashDeallocator dealloc);
168
+ XMLPUBFUN int
169
+ xmlHashRemoveEntry2 (xmlHashTablePtr hash,
170
+ const xmlChar *name,
171
+ const xmlChar *name2,
172
+ xmlHashDeallocator dealloc);
173
+ XMLPUBFUN int
174
+ xmlHashRemoveEntry3 (xmlHashTablePtr hash,
175
+ const xmlChar *name,
176
+ const xmlChar *name2,
177
+ const xmlChar *name3,
178
+ xmlHashDeallocator dealloc);
179
+
180
+ /*
181
+ * Retrieve the payload.
182
+ */
183
+ XMLPUBFUN void *
184
+ xmlHashLookup (xmlHashTablePtr hash,
185
+ const xmlChar *name);
186
+ XMLPUBFUN void *
187
+ xmlHashLookup2 (xmlHashTablePtr hash,
188
+ const xmlChar *name,
189
+ const xmlChar *name2);
190
+ XMLPUBFUN void *
191
+ xmlHashLookup3 (xmlHashTablePtr hash,
192
+ const xmlChar *name,
193
+ const xmlChar *name2,
194
+ const xmlChar *name3);
195
+ XMLPUBFUN void *
196
+ xmlHashQLookup (xmlHashTablePtr hash,
197
+ const xmlChar *prefix,
198
+ const xmlChar *name);
199
+ XMLPUBFUN void *
200
+ xmlHashQLookup2 (xmlHashTablePtr hash,
201
+ const xmlChar *prefix,
202
+ const xmlChar *name,
203
+ const xmlChar *prefix2,
204
+ const xmlChar *name2);
205
+ XMLPUBFUN void *
206
+ xmlHashQLookup3 (xmlHashTablePtr hash,
207
+ const xmlChar *prefix,
208
+ const xmlChar *name,
209
+ const xmlChar *prefix2,
210
+ const xmlChar *name2,
211
+ const xmlChar *prefix3,
212
+ const xmlChar *name3);
213
+
214
+ /*
215
+ * Helpers.
216
+ */
217
+ XMLPUBFUN xmlHashTablePtr
218
+ xmlHashCopySafe (xmlHashTablePtr hash,
219
+ xmlHashCopier copy,
220
+ xmlHashDeallocator dealloc);
221
+ XMLPUBFUN xmlHashTablePtr
222
+ xmlHashCopy (xmlHashTablePtr hash,
223
+ xmlHashCopier copy);
224
+ XMLPUBFUN int
225
+ xmlHashSize (xmlHashTablePtr hash);
226
+ XMLPUBFUN void
227
+ xmlHashScan (xmlHashTablePtr hash,
228
+ xmlHashScanner scan,
229
+ void *data);
230
+ XMLPUBFUN void
231
+ xmlHashScan3 (xmlHashTablePtr hash,
232
+ const xmlChar *name,
233
+ const xmlChar *name2,
234
+ const xmlChar *name3,
235
+ xmlHashScanner scan,
236
+ void *data);
237
+ XMLPUBFUN void
238
+ xmlHashScanFull (xmlHashTablePtr hash,
239
+ xmlHashScannerFull scan,
240
+ void *data);
241
+ XMLPUBFUN void
242
+ xmlHashScanFull3 (xmlHashTablePtr hash,
243
+ const xmlChar *name,
244
+ const xmlChar *name2,
245
+ const xmlChar *name3,
246
+ xmlHashScannerFull scan,
247
+ void *data);
248
+ #ifdef __cplusplus
249
+ }
250
+ #endif
251
+ #endif /* ! __XML_HASH_H__ */