nokogiri 1.18.0-arm-linux-musl

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

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,96 @@
1
+ #include <nokogiri.h>
2
+
3
+ VALUE cNokogiriHtml4SaxPushParser;
4
+
5
+ /*
6
+ * Write +chunk+ to PushParser. +last_chunk+ triggers the end_document handle
7
+ */
8
+ static VALUE
9
+ noko_html4_sax_push_parser__native_write(VALUE self, VALUE rb_chunk, VALUE rb_last_chunk)
10
+ {
11
+ xmlParserCtxtPtr ctx;
12
+ const char *chunk = NULL;
13
+ int size = 0;
14
+ int status = 0;
15
+ libxmlStructuredErrorHandlerState handler_state;
16
+
17
+ ctx = noko_xml_sax_push_parser_unwrap(self);
18
+
19
+ if (Qnil != rb_chunk) {
20
+ chunk = StringValuePtr(rb_chunk);
21
+ size = (int)RSTRING_LEN(rb_chunk);
22
+ }
23
+
24
+ noko__structured_error_func_save_and_set(&handler_state, NULL, NULL);
25
+
26
+ status = htmlParseChunk(ctx, chunk, size, Qtrue == rb_last_chunk ? 1 : 0);
27
+
28
+ noko__structured_error_func_restore(&handler_state);
29
+
30
+ if ((status != 0) && !(xmlCtxtGetOptions(ctx) & XML_PARSE_RECOVER)) {
31
+ // TODO: there appear to be no tests for this block
32
+ xmlErrorConstPtr e = xmlCtxtGetLastError(ctx);
33
+ noko__error_raise(NULL, e);
34
+ }
35
+
36
+ return self;
37
+ }
38
+
39
+ /*
40
+ * Initialize the push parser with +xml_sax+ using +filename+
41
+ */
42
+ static VALUE
43
+ noko_html4_sax_push_parser__initialize_native(
44
+ VALUE self,
45
+ VALUE rb_xml_sax,
46
+ VALUE rb_filename,
47
+ VALUE encoding
48
+ )
49
+ {
50
+ htmlSAXHandlerPtr sax;
51
+ const char *filename = NULL;
52
+ htmlParserCtxtPtr ctx;
53
+ xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
54
+
55
+ sax = noko_xml_sax_parser_unwrap(rb_xml_sax);
56
+
57
+ if (rb_filename != Qnil) { filename = StringValueCStr(rb_filename); }
58
+
59
+ if (!NIL_P(encoding)) {
60
+ enc = xmlParseCharEncoding(StringValueCStr(encoding));
61
+ if (enc == XML_CHAR_ENCODING_ERROR) {
62
+ rb_raise(rb_eArgError, "Unsupported Encoding");
63
+ }
64
+ }
65
+
66
+ ctx = htmlCreatePushParserCtxt(
67
+ sax,
68
+ NULL,
69
+ NULL,
70
+ 0,
71
+ filename,
72
+ enc
73
+ );
74
+ if (ctx == NULL) {
75
+ rb_raise(rb_eRuntimeError, "Could not create a parser context");
76
+ }
77
+
78
+ ctx->userData = ctx;
79
+ ctx->_private = (void *)rb_xml_sax;
80
+
81
+ DATA_PTR(self) = ctx;
82
+ return self;
83
+ }
84
+
85
+ void
86
+ noko_init_html_sax_push_parser(void)
87
+ {
88
+ assert(cNokogiriXmlSaxPushParser);
89
+ cNokogiriHtml4SaxPushParser =
90
+ rb_define_class_under(mNokogiriHtml4Sax, "PushParser", cNokogiriXmlSaxPushParser);
91
+
92
+ rb_define_private_method(cNokogiriHtml4SaxPushParser, "initialize_native",
93
+ noko_html4_sax_push_parser__initialize_native, 3);
94
+ rb_define_private_method(cNokogiriHtml4SaxPushParser, "native_write",
95
+ noko_html4_sax_push_parser__native_write, 2);
96
+ }
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Summary: main header file
3
+ *
4
+ * Copy: See Copyright for the status of this software.
5
+ */
6
+
7
+
8
+ #ifndef __EXSLT_H__
9
+ #define __EXSLT_H__
10
+
11
+ #include <libxml/tree.h>
12
+ #include <libxml/xpath.h>
13
+ #include "exsltexports.h"
14
+ #include <libexslt/exsltconfig.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ EXSLTPUBVAR const char *exsltLibraryVersion;
21
+ EXSLTPUBVAR const int exsltLibexsltVersion;
22
+ EXSLTPUBVAR const int exsltLibxsltVersion;
23
+ EXSLTPUBVAR const int exsltLibxmlVersion;
24
+
25
+ /**
26
+ * EXSLT_COMMON_NAMESPACE:
27
+ *
28
+ * Namespace for EXSLT common functions
29
+ */
30
+ #define EXSLT_COMMON_NAMESPACE ((const xmlChar *) "http://exslt.org/common")
31
+ /**
32
+ * EXSLT_CRYPTO_NAMESPACE:
33
+ *
34
+ * Namespace for EXSLT crypto functions
35
+ */
36
+ #define EXSLT_CRYPTO_NAMESPACE ((const xmlChar *) "http://exslt.org/crypto")
37
+ /**
38
+ * EXSLT_MATH_NAMESPACE:
39
+ *
40
+ * Namespace for EXSLT math functions
41
+ */
42
+ #define EXSLT_MATH_NAMESPACE ((const xmlChar *) "http://exslt.org/math")
43
+ /**
44
+ * EXSLT_SETS_NAMESPACE:
45
+ *
46
+ * Namespace for EXSLT set functions
47
+ */
48
+ #define EXSLT_SETS_NAMESPACE ((const xmlChar *) "http://exslt.org/sets")
49
+ /**
50
+ * EXSLT_FUNCTIONS_NAMESPACE:
51
+ *
52
+ * Namespace for EXSLT functions extension functions
53
+ */
54
+ #define EXSLT_FUNCTIONS_NAMESPACE ((const xmlChar *) "http://exslt.org/functions")
55
+ /**
56
+ * EXSLT_STRINGS_NAMESPACE:
57
+ *
58
+ * Namespace for EXSLT strings functions
59
+ */
60
+ #define EXSLT_STRINGS_NAMESPACE ((const xmlChar *) "http://exslt.org/strings")
61
+ /**
62
+ * EXSLT_DATE_NAMESPACE:
63
+ *
64
+ * Namespace for EXSLT date functions
65
+ */
66
+ #define EXSLT_DATE_NAMESPACE ((const xmlChar *) "http://exslt.org/dates-and-times")
67
+ /**
68
+ * EXSLT_DYNAMIC_NAMESPACE:
69
+ *
70
+ * Namespace for EXSLT dynamic functions
71
+ */
72
+ #define EXSLT_DYNAMIC_NAMESPACE ((const xmlChar *) "http://exslt.org/dynamic")
73
+
74
+ /**
75
+ * SAXON_NAMESPACE:
76
+ *
77
+ * Namespace for SAXON extensions functions
78
+ */
79
+ #define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon")
80
+
81
+ EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void);
82
+ #ifdef EXSLT_CRYPTO_ENABLED
83
+ EXSLTPUBFUN void EXSLTCALL exsltCryptoRegister (void);
84
+ #endif
85
+ EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void);
86
+ EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void);
87
+ EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void);
88
+ EXSLTPUBFUN void EXSLTCALL exsltStrRegister (void);
89
+ EXSLTPUBFUN void EXSLTCALL exsltDateRegister (void);
90
+ EXSLTPUBFUN void EXSLTCALL exsltSaxonRegister (void);
91
+ EXSLTPUBFUN void EXSLTCALL exsltDynRegister(void);
92
+
93
+ EXSLTPUBFUN void EXSLTCALL exsltRegisterAll (void);
94
+
95
+ EXSLTPUBFUN int EXSLTCALL exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt,
96
+ const xmlChar *prefix);
97
+ EXSLTPUBFUN int EXSLTCALL exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt,
98
+ const xmlChar *prefix);
99
+ EXSLTPUBFUN int EXSLTCALL exsltSetsXpathCtxtRegister (xmlXPathContextPtr ctxt,
100
+ const xmlChar *prefix);
101
+ EXSLTPUBFUN int EXSLTCALL exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt,
102
+ const xmlChar *prefix);
103
+
104
+ #ifdef __cplusplus
105
+ }
106
+ #endif
107
+ #endif /* __EXSLT_H__ */
108
+
@@ -0,0 +1,70 @@
1
+ /*
2
+ * exsltconfig.h: compile-time version information for the EXSLT library
3
+ *
4
+ * See Copyright for the status of this software.
5
+ *
6
+ * daniel@veillard.com
7
+ */
8
+
9
+ #ifndef __XML_EXSLTCONFIG_H__
10
+ #define __XML_EXSLTCONFIG_H__
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif
15
+
16
+ /**
17
+ * LIBEXSLT_DOTTED_VERSION:
18
+ *
19
+ * the version string like "1.2.3"
20
+ */
21
+ #define LIBEXSLT_DOTTED_VERSION "0.8.23"
22
+
23
+ /**
24
+ * LIBEXSLT_VERSION:
25
+ *
26
+ * the version number: 1.2.3 value is 10203
27
+ */
28
+ #define LIBEXSLT_VERSION 823
29
+
30
+ /**
31
+ * LIBEXSLT_VERSION_STRING:
32
+ *
33
+ * the version number string, 1.2.3 value is "10203"
34
+ */
35
+ #define LIBEXSLT_VERSION_STRING "823"
36
+
37
+ /**
38
+ * LIBEXSLT_VERSION_EXTRA:
39
+ *
40
+ * extra version information, used to show a Git commit description
41
+ */
42
+ #define LIBEXSLT_VERSION_EXTRA ""
43
+
44
+ /**
45
+ * WITH_CRYPTO:
46
+ *
47
+ * Whether crypto support is configured into exslt
48
+ */
49
+ #if 0
50
+ #define EXSLT_CRYPTO_ENABLED
51
+ #endif
52
+
53
+ /**
54
+ * ATTRIBUTE_UNUSED:
55
+ *
56
+ * This macro is used to flag unused function parameters to GCC
57
+ */
58
+ #ifdef __GNUC__
59
+ #ifndef ATTRIBUTE_UNUSED
60
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
61
+ #endif
62
+ #else
63
+ #define ATTRIBUTE_UNUSED
64
+ #endif
65
+
66
+ #ifdef __cplusplus
67
+ }
68
+ #endif
69
+
70
+ #endif /* __XML_EXSLTCONFIG_H__ */
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Summary: macros for marking symbols as exportable/importable.
3
+ *
4
+ * Copy: See Copyright for the status of this software.
5
+ */
6
+
7
+ #ifndef __EXSLT_EXPORTS_H__
8
+ #define __EXSLT_EXPORTS_H__
9
+
10
+ #if defined(_WIN32) || defined(__CYGWIN__)
11
+ /** DOC_DISABLE */
12
+
13
+ #ifdef LIBEXSLT_STATIC
14
+ #define EXSLTPUBLIC
15
+ #elif defined(IN_LIBEXSLT)
16
+ #define EXSLTPUBLIC __declspec(dllexport)
17
+ #else
18
+ #define EXSLTPUBLIC __declspec(dllimport)
19
+ #endif
20
+
21
+ #define EXSLTCALL __cdecl
22
+
23
+ /** DOC_ENABLE */
24
+ #else /* not Windows */
25
+
26
+ /**
27
+ * EXSLTPUBLIC:
28
+ *
29
+ * Macro which declares a public symbol
30
+ */
31
+ #define EXSLTPUBLIC
32
+
33
+ /**
34
+ * EXSLTCALL:
35
+ *
36
+ * Macro which declares the calling convention for exported functions
37
+ */
38
+ #define EXSLTCALL
39
+
40
+ #endif /* platform switch */
41
+
42
+ /*
43
+ * EXSLTPUBFUN:
44
+ *
45
+ * Macro which declares an exportable function
46
+ */
47
+ #define EXSLTPUBFUN EXSLTPUBLIC
48
+
49
+ /**
50
+ * EXSLTPUBVAR:
51
+ *
52
+ * Macro which declares an exportable variable
53
+ */
54
+ #define EXSLTPUBVAR EXSLTPUBLIC extern
55
+
56
+ /* Compatibility */
57
+ #if !defined(LIBEXSLT_PUBLIC)
58
+ #define LIBEXSLT_PUBLIC EXSLTPUBVAR
59
+ #endif
60
+
61
+ #endif /* __EXSLT_EXPORTS_H__ */
62
+
63
+
@@ -0,0 +1,336 @@
1
+ /*
2
+ * Summary: interface for an HTML 4.0 non-verifying parser
3
+ * Description: this module implements an HTML 4.0 non-verifying parser
4
+ * with API compatible with the XML parser ones. It should
5
+ * be able to parse "real world" HTML, even if severely
6
+ * broken from a specification point of view.
7
+ *
8
+ * Copy: See Copyright for the status of this software.
9
+ *
10
+ * Author: Daniel Veillard
11
+ */
12
+
13
+ #ifndef __HTML_PARSER_H__
14
+ #define __HTML_PARSER_H__
15
+ #include <libxml/xmlversion.h>
16
+ #include <libxml/parser.h>
17
+
18
+ #ifdef LIBXML_HTML_ENABLED
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /*
25
+ * Most of the back-end structures from XML and HTML are shared.
26
+ */
27
+ typedef xmlParserCtxt htmlParserCtxt;
28
+ typedef xmlParserCtxtPtr htmlParserCtxtPtr;
29
+ typedef xmlParserNodeInfo htmlParserNodeInfo;
30
+ typedef xmlSAXHandler htmlSAXHandler;
31
+ typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
32
+ typedef xmlParserInput htmlParserInput;
33
+ typedef xmlParserInputPtr htmlParserInputPtr;
34
+ typedef xmlDocPtr htmlDocPtr;
35
+ typedef xmlNodePtr htmlNodePtr;
36
+
37
+ /*
38
+ * Internal description of an HTML element, representing HTML 4.01
39
+ * and XHTML 1.0 (which share the same structure).
40
+ */
41
+ typedef struct _htmlElemDesc htmlElemDesc;
42
+ typedef htmlElemDesc *htmlElemDescPtr;
43
+ struct _htmlElemDesc {
44
+ const char *name; /* The tag name */
45
+ char startTag; /* Whether the start tag can be implied */
46
+ char endTag; /* Whether the end tag can be implied */
47
+ char saveEndTag; /* Whether the end tag should be saved */
48
+ char empty; /* Is this an empty element ? */
49
+ char depr; /* Is this a deprecated element ? */
50
+ char dtd; /* 1: only in Loose DTD, 2: only Frameset one */
51
+ char isinline; /* is this a block 0 or inline 1 element */
52
+ const char *desc; /* the description */
53
+
54
+ /* NRK Jan.2003
55
+ * New fields encapsulating HTML structure
56
+ *
57
+ * Bugs:
58
+ * This is a very limited representation. It fails to tell us when
59
+ * an element *requires* subelements (we only have whether they're
60
+ * allowed or not), and it doesn't tell us where CDATA and PCDATA
61
+ * are allowed. Some element relationships are not fully represented:
62
+ * these are flagged with the word MODIFIER
63
+ */
64
+ const char** subelts; /* allowed sub-elements of this element */
65
+ const char* defaultsubelt; /* subelement for suggested auto-repair
66
+ if necessary or NULL */
67
+ const char** attrs_opt; /* Optional Attributes */
68
+ const char** attrs_depr; /* Additional deprecated attributes */
69
+ const char** attrs_req; /* Required attributes */
70
+ };
71
+
72
+ /*
73
+ * Internal description of an HTML entity.
74
+ */
75
+ typedef struct _htmlEntityDesc htmlEntityDesc;
76
+ typedef htmlEntityDesc *htmlEntityDescPtr;
77
+ struct _htmlEntityDesc {
78
+ unsigned int value; /* the UNICODE value for the character */
79
+ const char *name; /* The entity name */
80
+ const char *desc; /* the description */
81
+ };
82
+
83
+ #ifdef LIBXML_SAX1_ENABLED
84
+
85
+ XML_DEPRECATED
86
+ XMLPUBVAR const xmlSAXHandlerV1 htmlDefaultSAXHandler;
87
+
88
+ #ifdef LIBXML_THREAD_ENABLED
89
+ XML_DEPRECATED
90
+ XMLPUBFUN const xmlSAXHandlerV1 *__htmlDefaultSAXHandler(void);
91
+ #endif
92
+
93
+ #endif /* LIBXML_SAX1_ENABLED */
94
+
95
+ /*
96
+ * There is only few public functions.
97
+ */
98
+ XML_DEPRECATED
99
+ XMLPUBFUN void
100
+ htmlInitAutoClose (void);
101
+ XMLPUBFUN const htmlElemDesc *
102
+ htmlTagLookup (const xmlChar *tag);
103
+ XMLPUBFUN const htmlEntityDesc *
104
+ htmlEntityLookup(const xmlChar *name);
105
+ XMLPUBFUN const htmlEntityDesc *
106
+ htmlEntityValueLookup(unsigned int value);
107
+
108
+ XMLPUBFUN int
109
+ htmlIsAutoClosed(htmlDocPtr doc,
110
+ htmlNodePtr elem);
111
+ XMLPUBFUN int
112
+ htmlAutoCloseTag(htmlDocPtr doc,
113
+ const xmlChar *name,
114
+ htmlNodePtr elem);
115
+ XML_DEPRECATED
116
+ XMLPUBFUN const htmlEntityDesc *
117
+ htmlParseEntityRef(htmlParserCtxtPtr ctxt,
118
+ const xmlChar **str);
119
+ XML_DEPRECATED
120
+ XMLPUBFUN int
121
+ htmlParseCharRef(htmlParserCtxtPtr ctxt);
122
+ XML_DEPRECATED
123
+ XMLPUBFUN void
124
+ htmlParseElement(htmlParserCtxtPtr ctxt);
125
+
126
+ XMLPUBFUN htmlParserCtxtPtr
127
+ htmlNewParserCtxt(void);
128
+ XMLPUBFUN htmlParserCtxtPtr
129
+ htmlNewSAXParserCtxt(const htmlSAXHandler *sax,
130
+ void *userData);
131
+
132
+ XMLPUBFUN htmlParserCtxtPtr
133
+ htmlCreateMemoryParserCtxt(const char *buffer,
134
+ int size);
135
+
136
+ XMLPUBFUN int
137
+ htmlParseDocument(htmlParserCtxtPtr ctxt);
138
+ XML_DEPRECATED
139
+ XMLPUBFUN htmlDocPtr
140
+ htmlSAXParseDoc (const xmlChar *cur,
141
+ const char *encoding,
142
+ htmlSAXHandlerPtr sax,
143
+ void *userData);
144
+ XMLPUBFUN htmlDocPtr
145
+ htmlParseDoc (const xmlChar *cur,
146
+ const char *encoding);
147
+ XMLPUBFUN htmlParserCtxtPtr
148
+ htmlCreateFileParserCtxt(const char *filename,
149
+ const char *encoding);
150
+ XML_DEPRECATED
151
+ XMLPUBFUN htmlDocPtr
152
+ htmlSAXParseFile(const char *filename,
153
+ const char *encoding,
154
+ htmlSAXHandlerPtr sax,
155
+ void *userData);
156
+ XMLPUBFUN htmlDocPtr
157
+ htmlParseFile (const char *filename,
158
+ const char *encoding);
159
+ XMLPUBFUN int
160
+ UTF8ToHtml (unsigned char *out,
161
+ int *outlen,
162
+ const unsigned char *in,
163
+ int *inlen);
164
+ XMLPUBFUN int
165
+ htmlEncodeEntities(unsigned char *out,
166
+ int *outlen,
167
+ const unsigned char *in,
168
+ int *inlen, int quoteChar);
169
+ XMLPUBFUN int
170
+ htmlIsScriptAttribute(const xmlChar *name);
171
+ XML_DEPRECATED
172
+ XMLPUBFUN int
173
+ htmlHandleOmittedElem(int val);
174
+
175
+ #ifdef LIBXML_PUSH_ENABLED
176
+ /**
177
+ * Interfaces for the Push mode.
178
+ */
179
+ XMLPUBFUN htmlParserCtxtPtr
180
+ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
181
+ void *user_data,
182
+ const char *chunk,
183
+ int size,
184
+ const char *filename,
185
+ xmlCharEncoding enc);
186
+ XMLPUBFUN int
187
+ htmlParseChunk (htmlParserCtxtPtr ctxt,
188
+ const char *chunk,
189
+ int size,
190
+ int terminate);
191
+ #endif /* LIBXML_PUSH_ENABLED */
192
+
193
+ XMLPUBFUN void
194
+ htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
195
+
196
+ /*
197
+ * New set of simpler/more flexible APIs
198
+ */
199
+ /**
200
+ * xmlParserOption:
201
+ *
202
+ * This is the set of XML parser options that can be passed down
203
+ * to the xmlReadDoc() and similar calls.
204
+ */
205
+ typedef enum {
206
+ HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */
207
+ HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
208
+ HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
209
+ HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
210
+ HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
211
+ HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
212
+ HTML_PARSE_NONET = 1<<11,/* Forbid network access */
213
+ HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
214
+ HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */
215
+ HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
216
+ } htmlParserOption;
217
+
218
+ XMLPUBFUN void
219
+ htmlCtxtReset (htmlParserCtxtPtr ctxt);
220
+ XMLPUBFUN int
221
+ htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
222
+ int options);
223
+ XMLPUBFUN htmlDocPtr
224
+ htmlReadDoc (const xmlChar *cur,
225
+ const char *URL,
226
+ const char *encoding,
227
+ int options);
228
+ XMLPUBFUN htmlDocPtr
229
+ htmlReadFile (const char *URL,
230
+ const char *encoding,
231
+ int options);
232
+ XMLPUBFUN htmlDocPtr
233
+ htmlReadMemory (const char *buffer,
234
+ int size,
235
+ const char *URL,
236
+ const char *encoding,
237
+ int options);
238
+ XMLPUBFUN htmlDocPtr
239
+ htmlReadFd (int fd,
240
+ const char *URL,
241
+ const char *encoding,
242
+ int options);
243
+ XMLPUBFUN htmlDocPtr
244
+ htmlReadIO (xmlInputReadCallback ioread,
245
+ xmlInputCloseCallback ioclose,
246
+ void *ioctx,
247
+ const char *URL,
248
+ const char *encoding,
249
+ int options);
250
+ XMLPUBFUN htmlDocPtr
251
+ htmlCtxtParseDocument (htmlParserCtxtPtr ctxt,
252
+ xmlParserInputPtr input);
253
+ XMLPUBFUN htmlDocPtr
254
+ htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
255
+ const xmlChar *cur,
256
+ const char *URL,
257
+ const char *encoding,
258
+ int options);
259
+ XMLPUBFUN htmlDocPtr
260
+ htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
261
+ const char *filename,
262
+ const char *encoding,
263
+ int options);
264
+ XMLPUBFUN htmlDocPtr
265
+ htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
266
+ const char *buffer,
267
+ int size,
268
+ const char *URL,
269
+ const char *encoding,
270
+ int options);
271
+ XMLPUBFUN htmlDocPtr
272
+ htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
273
+ int fd,
274
+ const char *URL,
275
+ const char *encoding,
276
+ int options);
277
+ XMLPUBFUN htmlDocPtr
278
+ htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
279
+ xmlInputReadCallback ioread,
280
+ xmlInputCloseCallback ioclose,
281
+ void *ioctx,
282
+ const char *URL,
283
+ const char *encoding,
284
+ int options);
285
+
286
+ /* NRK/Jan2003: further knowledge of HTML structure
287
+ */
288
+ typedef enum {
289
+ HTML_NA = 0 , /* something we don't check at all */
290
+ HTML_INVALID = 0x1 ,
291
+ HTML_DEPRECATED = 0x2 ,
292
+ HTML_VALID = 0x4 ,
293
+ HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
294
+ } htmlStatus ;
295
+
296
+ /* Using htmlElemDesc rather than name here, to emphasise the fact
297
+ that otherwise there's a lookup overhead
298
+ */
299
+ XMLPUBFUN htmlStatus htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
300
+ XMLPUBFUN int htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
301
+ XMLPUBFUN htmlStatus htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
302
+ XMLPUBFUN htmlStatus htmlNodeStatus(htmlNodePtr, int) ;
303
+ /**
304
+ * htmlDefaultSubelement:
305
+ * @elt: HTML element
306
+ *
307
+ * Returns the default subelement for this element
308
+ */
309
+ #define htmlDefaultSubelement(elt) elt->defaultsubelt
310
+ /**
311
+ * htmlElementAllowedHereDesc:
312
+ * @parent: HTML parent element
313
+ * @elt: HTML element
314
+ *
315
+ * Checks whether an HTML element description may be a
316
+ * direct child of the specified element.
317
+ *
318
+ * Returns 1 if allowed; 0 otherwise.
319
+ */
320
+ #define htmlElementAllowedHereDesc(parent,elt) \
321
+ htmlElementAllowedHere((parent), (elt)->name)
322
+ /**
323
+ * htmlRequiredAttrs:
324
+ * @elt: HTML element
325
+ *
326
+ * Returns the attributes required for the specified element.
327
+ */
328
+ #define htmlRequiredAttrs(elt) (elt)->attrs_req
329
+
330
+
331
+ #ifdef __cplusplus
332
+ }
333
+ #endif
334
+
335
+ #endif /* LIBXML_HTML_ENABLED */
336
+ #endif /* __HTML_PARSER_H__ */