nokogiri 1.14.0.rc1-arm-linux

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 (200) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +38 -0
  3. data/LICENSE-DEPENDENCIES.md +2224 -0
  4. data/LICENSE.md +9 -0
  5. data/README.md +287 -0
  6. data/bin/nokogiri +131 -0
  7. data/dependencies.yml +41 -0
  8. data/ext/nokogiri/depend +38 -0
  9. data/ext/nokogiri/extconf.rb +1082 -0
  10. data/ext/nokogiri/gumbo.c +594 -0
  11. data/ext/nokogiri/html4_document.c +166 -0
  12. data/ext/nokogiri/html4_element_description.c +294 -0
  13. data/ext/nokogiri/html4_entity_lookup.c +37 -0
  14. data/ext/nokogiri/html4_sax_parser_context.c +114 -0
  15. data/ext/nokogiri/html4_sax_push_parser.c +95 -0
  16. data/ext/nokogiri/include/libexslt/exslt.h +108 -0
  17. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  18. data/ext/nokogiri/include/libexslt/exsltexports.h +63 -0
  19. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
  20. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  21. data/ext/nokogiri/include/libxml2/libxml/SAX.h +204 -0
  22. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +172 -0
  23. data/ext/nokogiri/include/libxml2/libxml/c14n.h +128 -0
  24. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  25. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  26. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  27. data/ext/nokogiri/include/libxml2/libxml/dict.h +81 -0
  28. data/ext/nokogiri/include/libxml2/libxml/encoding.h +232 -0
  29. data/ext/nokogiri/include/libxml2/libxml/entities.h +153 -0
  30. data/ext/nokogiri/include/libxml2/libxml/globals.h +499 -0
  31. data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
  32. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  33. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +186 -0
  34. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
  35. data/ext/nokogiri/include/libxml2/libxml/parser.h +1244 -0
  36. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +656 -0
  37. data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
  38. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +218 -0
  39. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
  40. data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
  41. data/ext/nokogiri/include/libxml2/libxml/threads.h +91 -0
  42. data/ext/nokogiri/include/libxml2/libxml/tree.h +1312 -0
  43. data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
  44. data/ext/nokogiri/include/libxml2/libxml/valid.h +463 -0
  45. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +368 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +947 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +77 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +226 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +152 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
  60. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +503 -0
  61. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
  62. data/ext/nokogiri/include/libxml2/libxml/xpath.h +575 -0
  63. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
  64. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +137 -0
  65. data/ext/nokogiri/include/libxslt/attributes.h +38 -0
  66. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  67. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  68. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  69. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  70. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  71. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  72. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  73. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  74. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  75. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  76. data/ext/nokogiri/include/libxslt/security.h +104 -0
  77. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  78. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  79. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  80. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  81. data/ext/nokogiri/include/libxslt/xsltInternals.h +1982 -0
  82. data/ext/nokogiri/include/libxslt/xsltconfig.h +179 -0
  83. data/ext/nokogiri/include/libxslt/xsltexports.h +64 -0
  84. data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
  85. data/ext/nokogiri/include/libxslt/xsltutils.h +310 -0
  86. data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
  87. data/ext/nokogiri/nokogiri.c +259 -0
  88. data/ext/nokogiri/nokogiri.h +235 -0
  89. data/ext/nokogiri/test_global_handlers.c +40 -0
  90. data/ext/nokogiri/xml_attr.c +103 -0
  91. data/ext/nokogiri/xml_attribute_decl.c +70 -0
  92. data/ext/nokogiri/xml_cdata.c +57 -0
  93. data/ext/nokogiri/xml_comment.c +62 -0
  94. data/ext/nokogiri/xml_document.c +689 -0
  95. data/ext/nokogiri/xml_document_fragment.c +44 -0
  96. data/ext/nokogiri/xml_dtd.c +208 -0
  97. data/ext/nokogiri/xml_element_content.c +128 -0
  98. data/ext/nokogiri/xml_element_decl.c +69 -0
  99. data/ext/nokogiri/xml_encoding_handler.c +104 -0
  100. data/ext/nokogiri/xml_entity_decl.c +112 -0
  101. data/ext/nokogiri/xml_entity_reference.c +50 -0
  102. data/ext/nokogiri/xml_namespace.c +186 -0
  103. data/ext/nokogiri/xml_node.c +2425 -0
  104. data/ext/nokogiri/xml_node_set.c +496 -0
  105. data/ext/nokogiri/xml_processing_instruction.c +54 -0
  106. data/ext/nokogiri/xml_reader.c +794 -0
  107. data/ext/nokogiri/xml_relax_ng.c +183 -0
  108. data/ext/nokogiri/xml_sax_parser.c +316 -0
  109. data/ext/nokogiri/xml_sax_parser_context.c +283 -0
  110. data/ext/nokogiri/xml_sax_push_parser.c +166 -0
  111. data/ext/nokogiri/xml_schema.c +282 -0
  112. data/ext/nokogiri/xml_syntax_error.c +85 -0
  113. data/ext/nokogiri/xml_text.c +48 -0
  114. data/ext/nokogiri/xml_xpath_context.c +413 -0
  115. data/ext/nokogiri/xslt_stylesheet.c +363 -0
  116. data/gumbo-parser/CHANGES.md +63 -0
  117. data/gumbo-parser/Makefile +111 -0
  118. data/gumbo-parser/THANKS +27 -0
  119. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  120. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  121. data/lib/nokogiri/3.1/nokogiri.so +0 -0
  122. data/lib/nokogiri/3.2/nokogiri.so +0 -0
  123. data/lib/nokogiri/class_resolver.rb +67 -0
  124. data/lib/nokogiri/css/node.rb +54 -0
  125. data/lib/nokogiri/css/parser.rb +770 -0
  126. data/lib/nokogiri/css/parser.y +277 -0
  127. data/lib/nokogiri/css/parser_extras.rb +96 -0
  128. data/lib/nokogiri/css/syntax_error.rb +9 -0
  129. data/lib/nokogiri/css/tokenizer.rb +155 -0
  130. data/lib/nokogiri/css/tokenizer.rex +56 -0
  131. data/lib/nokogiri/css/xpath_visitor.rb +359 -0
  132. data/lib/nokogiri/css.rb +66 -0
  133. data/lib/nokogiri/decorators/slop.rb +44 -0
  134. data/lib/nokogiri/encoding_handler.rb +57 -0
  135. data/lib/nokogiri/extension.rb +32 -0
  136. data/lib/nokogiri/gumbo.rb +15 -0
  137. data/lib/nokogiri/html.rb +48 -0
  138. data/lib/nokogiri/html4/builder.rb +37 -0
  139. data/lib/nokogiri/html4/document.rb +214 -0
  140. data/lib/nokogiri/html4/document_fragment.rb +54 -0
  141. data/lib/nokogiri/html4/element_description.rb +25 -0
  142. data/lib/nokogiri/html4/element_description_defaults.rb +572 -0
  143. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  144. data/lib/nokogiri/html4/entity_lookup.rb +15 -0
  145. data/lib/nokogiri/html4/sax/parser.rb +63 -0
  146. data/lib/nokogiri/html4/sax/parser_context.rb +20 -0
  147. data/lib/nokogiri/html4/sax/push_parser.rb +37 -0
  148. data/lib/nokogiri/html4.rb +47 -0
  149. data/lib/nokogiri/html5/document.rb +168 -0
  150. data/lib/nokogiri/html5/document_fragment.rb +90 -0
  151. data/lib/nokogiri/html5/node.rb +98 -0
  152. data/lib/nokogiri/html5.rb +389 -0
  153. data/lib/nokogiri/jruby/dependencies.rb +3 -0
  154. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  155. data/lib/nokogiri/syntax_error.rb +6 -0
  156. data/lib/nokogiri/version/constant.rb +6 -0
  157. data/lib/nokogiri/version/info.rb +223 -0
  158. data/lib/nokogiri/version.rb +4 -0
  159. data/lib/nokogiri/xml/attr.rb +66 -0
  160. data/lib/nokogiri/xml/attribute_decl.rb +20 -0
  161. data/lib/nokogiri/xml/builder.rb +487 -0
  162. data/lib/nokogiri/xml/cdata.rb +13 -0
  163. data/lib/nokogiri/xml/character_data.rb +9 -0
  164. data/lib/nokogiri/xml/document.rb +471 -0
  165. data/lib/nokogiri/xml/document_fragment.rb +205 -0
  166. data/lib/nokogiri/xml/dtd.rb +34 -0
  167. data/lib/nokogiri/xml/element_content.rb +38 -0
  168. data/lib/nokogiri/xml/element_decl.rb +15 -0
  169. data/lib/nokogiri/xml/entity_decl.rb +21 -0
  170. data/lib/nokogiri/xml/entity_reference.rb +20 -0
  171. data/lib/nokogiri/xml/namespace.rb +58 -0
  172. data/lib/nokogiri/xml/node/save_options.rb +68 -0
  173. data/lib/nokogiri/xml/node.rb +1563 -0
  174. data/lib/nokogiri/xml/node_set.rb +446 -0
  175. data/lib/nokogiri/xml/notation.rb +19 -0
  176. data/lib/nokogiri/xml/parse_options.rb +213 -0
  177. data/lib/nokogiri/xml/pp/character_data.rb +21 -0
  178. data/lib/nokogiri/xml/pp/node.rb +57 -0
  179. data/lib/nokogiri/xml/pp.rb +4 -0
  180. data/lib/nokogiri/xml/processing_instruction.rb +11 -0
  181. data/lib/nokogiri/xml/reader.rb +105 -0
  182. data/lib/nokogiri/xml/relax_ng.rb +38 -0
  183. data/lib/nokogiri/xml/sax/document.rb +167 -0
  184. data/lib/nokogiri/xml/sax/parser.rb +125 -0
  185. data/lib/nokogiri/xml/sax/parser_context.rb +21 -0
  186. data/lib/nokogiri/xml/sax/push_parser.rb +61 -0
  187. data/lib/nokogiri/xml/sax.rb +6 -0
  188. data/lib/nokogiri/xml/schema.rb +73 -0
  189. data/lib/nokogiri/xml/searchable.rb +270 -0
  190. data/lib/nokogiri/xml/syntax_error.rb +72 -0
  191. data/lib/nokogiri/xml/text.rb +11 -0
  192. data/lib/nokogiri/xml/xpath/syntax_error.rb +13 -0
  193. data/lib/nokogiri/xml/xpath.rb +21 -0
  194. data/lib/nokogiri/xml/xpath_context.rb +16 -0
  195. data/lib/nokogiri/xml.rb +76 -0
  196. data/lib/nokogiri/xslt/stylesheet.rb +27 -0
  197. data/lib/nokogiri/xslt.rb +65 -0
  198. data/lib/nokogiri.rb +120 -0
  199. data/lib/xsd/xmlparser/nokogiri.rb +104 -0
  200. metadata +317 -0
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Summary: unfinished XLink detection module
3
+ * Description: unfinished XLink detection module
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XLINK_H__
11
+ #define __XML_XLINK_H__
12
+
13
+ #include <libxml/xmlversion.h>
14
+ #include <libxml/tree.h>
15
+
16
+ #ifdef LIBXML_XPTR_ENABLED
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * Various defines for the various Link properties.
24
+ *
25
+ * NOTE: the link detection layer will try to resolve QName expansion
26
+ * of namespaces. If "foo" is the prefix for "http://foo.com/"
27
+ * then the link detection layer will expand role="foo:myrole"
28
+ * to "http://foo.com/:myrole".
29
+ * NOTE: the link detection layer will expand URI-References found on
30
+ * href attributes by using the base mechanism if found.
31
+ */
32
+ typedef xmlChar *xlinkHRef;
33
+ typedef xmlChar *xlinkRole;
34
+ typedef xmlChar *xlinkTitle;
35
+
36
+ typedef enum {
37
+ XLINK_TYPE_NONE = 0,
38
+ XLINK_TYPE_SIMPLE,
39
+ XLINK_TYPE_EXTENDED,
40
+ XLINK_TYPE_EXTENDED_SET
41
+ } xlinkType;
42
+
43
+ typedef enum {
44
+ XLINK_SHOW_NONE = 0,
45
+ XLINK_SHOW_NEW,
46
+ XLINK_SHOW_EMBED,
47
+ XLINK_SHOW_REPLACE
48
+ } xlinkShow;
49
+
50
+ typedef enum {
51
+ XLINK_ACTUATE_NONE = 0,
52
+ XLINK_ACTUATE_AUTO,
53
+ XLINK_ACTUATE_ONREQUEST
54
+ } xlinkActuate;
55
+
56
+ /**
57
+ * xlinkNodeDetectFunc:
58
+ * @ctx: user data pointer
59
+ * @node: the node to check
60
+ *
61
+ * This is the prototype for the link detection routine.
62
+ * It calls the default link detection callbacks upon link detection.
63
+ */
64
+ typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
65
+
66
+ /*
67
+ * The link detection module interact with the upper layers using
68
+ * a set of callback registered at parsing time.
69
+ */
70
+
71
+ /**
72
+ * xlinkSimpleLinkFunk:
73
+ * @ctx: user data pointer
74
+ * @node: the node carrying the link
75
+ * @href: the target of the link
76
+ * @role: the role string
77
+ * @title: the link title
78
+ *
79
+ * This is the prototype for a simple link detection callback.
80
+ */
81
+ typedef void
82
+ (*xlinkSimpleLinkFunk) (void *ctx,
83
+ xmlNodePtr node,
84
+ const xlinkHRef href,
85
+ const xlinkRole role,
86
+ const xlinkTitle title);
87
+
88
+ /**
89
+ * xlinkExtendedLinkFunk:
90
+ * @ctx: user data pointer
91
+ * @node: the node carrying the link
92
+ * @nbLocators: the number of locators detected on the link
93
+ * @hrefs: pointer to the array of locator hrefs
94
+ * @roles: pointer to the array of locator roles
95
+ * @nbArcs: the number of arcs detected on the link
96
+ * @from: pointer to the array of source roles found on the arcs
97
+ * @to: pointer to the array of target roles found on the arcs
98
+ * @show: array of values for the show attributes found on the arcs
99
+ * @actuate: array of values for the actuate attributes found on the arcs
100
+ * @nbTitles: the number of titles detected on the link
101
+ * @title: array of titles detected on the link
102
+ * @langs: array of xml:lang values for the titles
103
+ *
104
+ * This is the prototype for a extended link detection callback.
105
+ */
106
+ typedef void
107
+ (*xlinkExtendedLinkFunk)(void *ctx,
108
+ xmlNodePtr node,
109
+ int nbLocators,
110
+ const xlinkHRef *hrefs,
111
+ const xlinkRole *roles,
112
+ int nbArcs,
113
+ const xlinkRole *from,
114
+ const xlinkRole *to,
115
+ xlinkShow *show,
116
+ xlinkActuate *actuate,
117
+ int nbTitles,
118
+ const xlinkTitle *titles,
119
+ const xmlChar **langs);
120
+
121
+ /**
122
+ * xlinkExtendedLinkSetFunk:
123
+ * @ctx: user data pointer
124
+ * @node: the node carrying the link
125
+ * @nbLocators: the number of locators detected on the link
126
+ * @hrefs: pointer to the array of locator hrefs
127
+ * @roles: pointer to the array of locator roles
128
+ * @nbTitles: the number of titles detected on the link
129
+ * @title: array of titles detected on the link
130
+ * @langs: array of xml:lang values for the titles
131
+ *
132
+ * This is the prototype for a extended link set detection callback.
133
+ */
134
+ typedef void
135
+ (*xlinkExtendedLinkSetFunk) (void *ctx,
136
+ xmlNodePtr node,
137
+ int nbLocators,
138
+ const xlinkHRef *hrefs,
139
+ const xlinkRole *roles,
140
+ int nbTitles,
141
+ const xlinkTitle *titles,
142
+ const xmlChar **langs);
143
+
144
+ /**
145
+ * This is the structure containing a set of Links detection callbacks.
146
+ *
147
+ * There is no default xlink callbacks, if one want to get link
148
+ * recognition activated, those call backs must be provided before parsing.
149
+ */
150
+ typedef struct _xlinkHandler xlinkHandler;
151
+ typedef xlinkHandler *xlinkHandlerPtr;
152
+ struct _xlinkHandler {
153
+ xlinkSimpleLinkFunk simple;
154
+ xlinkExtendedLinkFunk extended;
155
+ xlinkExtendedLinkSetFunk set;
156
+ };
157
+
158
+ /*
159
+ * The default detection routine, can be overridden, they call the default
160
+ * detection callbacks.
161
+ */
162
+
163
+ XMLPUBFUN xlinkNodeDetectFunc XMLCALL
164
+ xlinkGetDefaultDetect (void);
165
+ XMLPUBFUN void XMLCALL
166
+ xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
167
+
168
+ /*
169
+ * Routines to set/get the default handlers.
170
+ */
171
+ XMLPUBFUN xlinkHandlerPtr XMLCALL
172
+ xlinkGetDefaultHandler (void);
173
+ XMLPUBFUN void XMLCALL
174
+ xlinkSetDefaultHandler (xlinkHandlerPtr handler);
175
+
176
+ /*
177
+ * Link detection module itself.
178
+ */
179
+ XMLPUBFUN xlinkType XMLCALL
180
+ xlinkIsLink (xmlDocPtr doc,
181
+ xmlNodePtr node);
182
+
183
+ #ifdef __cplusplus
184
+ }
185
+ #endif
186
+
187
+ #endif /* LIBXML_XPTR_ENABLED */
188
+
189
+ #endif /* __XML_XLINK_H__ */
@@ -0,0 +1,368 @@
1
+ /*
2
+ * Summary: interface for the I/O interfaces used by the parser
3
+ * Description: interface for the I/O interfaces used by the parser
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_IO_H__
11
+ #define __XML_IO_H__
12
+
13
+ #include <stdio.h>
14
+ #include <libxml/xmlversion.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ /*
21
+ * Those are the functions and datatypes for the parser input
22
+ * I/O structures.
23
+ */
24
+
25
+ /**
26
+ * xmlInputMatchCallback:
27
+ * @filename: the filename or URI
28
+ *
29
+ * Callback used in the I/O Input API to detect if the current handler
30
+ * can provide input functionality for this resource.
31
+ *
32
+ * Returns 1 if yes and 0 if another Input module should be used
33
+ */
34
+ typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename);
35
+ /**
36
+ * xmlInputOpenCallback:
37
+ * @filename: the filename or URI
38
+ *
39
+ * Callback used in the I/O Input API to open the resource
40
+ *
41
+ * Returns an Input context or NULL in case or error
42
+ */
43
+ typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename);
44
+ /**
45
+ * xmlInputReadCallback:
46
+ * @context: an Input context
47
+ * @buffer: the buffer to store data read
48
+ * @len: the length of the buffer in bytes
49
+ *
50
+ * Callback used in the I/O Input API to read the resource
51
+ *
52
+ * Returns the number of bytes read or -1 in case of error
53
+ */
54
+ typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len);
55
+ /**
56
+ * xmlInputCloseCallback:
57
+ * @context: an Input context
58
+ *
59
+ * Callback used in the I/O Input API to close the resource
60
+ *
61
+ * Returns 0 or -1 in case of error
62
+ */
63
+ typedef int (XMLCALL *xmlInputCloseCallback) (void * context);
64
+
65
+ #ifdef LIBXML_OUTPUT_ENABLED
66
+ /*
67
+ * Those are the functions and datatypes for the library output
68
+ * I/O structures.
69
+ */
70
+
71
+ /**
72
+ * xmlOutputMatchCallback:
73
+ * @filename: the filename or URI
74
+ *
75
+ * Callback used in the I/O Output API to detect if the current handler
76
+ * can provide output functionality for this resource.
77
+ *
78
+ * Returns 1 if yes and 0 if another Output module should be used
79
+ */
80
+ typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename);
81
+ /**
82
+ * xmlOutputOpenCallback:
83
+ * @filename: the filename or URI
84
+ *
85
+ * Callback used in the I/O Output API to open the resource
86
+ *
87
+ * Returns an Output context or NULL in case or error
88
+ */
89
+ typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
90
+ /**
91
+ * xmlOutputWriteCallback:
92
+ * @context: an Output context
93
+ * @buffer: the buffer of data to write
94
+ * @len: the length of the buffer in bytes
95
+ *
96
+ * Callback used in the I/O Output API to write to the resource
97
+ *
98
+ * Returns the number of bytes written or -1 in case of error
99
+ */
100
+ typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
101
+ int len);
102
+ /**
103
+ * xmlOutputCloseCallback:
104
+ * @context: an Output context
105
+ *
106
+ * Callback used in the I/O Output API to close the resource
107
+ *
108
+ * Returns 0 or -1 in case of error
109
+ */
110
+ typedef int (XMLCALL *xmlOutputCloseCallback) (void * context);
111
+ #endif /* LIBXML_OUTPUT_ENABLED */
112
+
113
+ #ifdef __cplusplus
114
+ }
115
+ #endif
116
+
117
+ #include <libxml/globals.h>
118
+ #include <libxml/tree.h>
119
+ #include <libxml/parser.h>
120
+ #include <libxml/encoding.h>
121
+
122
+ #ifdef __cplusplus
123
+ extern "C" {
124
+ #endif
125
+ struct _xmlParserInputBuffer {
126
+ void* context;
127
+ xmlInputReadCallback readcallback;
128
+ xmlInputCloseCallback closecallback;
129
+
130
+ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
131
+
132
+ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
133
+ xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
134
+ int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
135
+ int error;
136
+ unsigned long rawconsumed;/* amount consumed from raw */
137
+ };
138
+
139
+
140
+ #ifdef LIBXML_OUTPUT_ENABLED
141
+ struct _xmlOutputBuffer {
142
+ void* context;
143
+ xmlOutputWriteCallback writecallback;
144
+ xmlOutputCloseCallback closecallback;
145
+
146
+ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
147
+
148
+ xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
149
+ xmlBufPtr conv; /* if encoder != NULL buffer for output */
150
+ int written; /* total number of byte written */
151
+ int error;
152
+ };
153
+ #endif /* LIBXML_OUTPUT_ENABLED */
154
+
155
+ /*
156
+ * Interfaces for input
157
+ */
158
+ XMLPUBFUN void XMLCALL
159
+ xmlCleanupInputCallbacks (void);
160
+
161
+ XMLPUBFUN int XMLCALL
162
+ xmlPopInputCallbacks (void);
163
+
164
+ XMLPUBFUN void XMLCALL
165
+ xmlRegisterDefaultInputCallbacks (void);
166
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
167
+ xmlAllocParserInputBuffer (xmlCharEncoding enc);
168
+
169
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
170
+ xmlParserInputBufferCreateFilename (const char *URI,
171
+ xmlCharEncoding enc);
172
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
173
+ xmlParserInputBufferCreateFile (FILE *file,
174
+ xmlCharEncoding enc);
175
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
176
+ xmlParserInputBufferCreateFd (int fd,
177
+ xmlCharEncoding enc);
178
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
179
+ xmlParserInputBufferCreateMem (const char *mem, int size,
180
+ xmlCharEncoding enc);
181
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
182
+ xmlParserInputBufferCreateStatic (const char *mem, int size,
183
+ xmlCharEncoding enc);
184
+ XMLPUBFUN xmlParserInputBufferPtr XMLCALL
185
+ xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
186
+ xmlInputCloseCallback ioclose,
187
+ void *ioctx,
188
+ xmlCharEncoding enc);
189
+ XMLPUBFUN int XMLCALL
190
+ xmlParserInputBufferRead (xmlParserInputBufferPtr in,
191
+ int len);
192
+ XMLPUBFUN int XMLCALL
193
+ xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
194
+ int len);
195
+ XMLPUBFUN int XMLCALL
196
+ xmlParserInputBufferPush (xmlParserInputBufferPtr in,
197
+ int len,
198
+ const char *buf);
199
+ XMLPUBFUN void XMLCALL
200
+ xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
201
+ XMLPUBFUN char * XMLCALL
202
+ xmlParserGetDirectory (const char *filename);
203
+
204
+ XMLPUBFUN int XMLCALL
205
+ xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
206
+ xmlInputOpenCallback openFunc,
207
+ xmlInputReadCallback readFunc,
208
+ xmlInputCloseCallback closeFunc);
209
+
210
+ xmlParserInputBufferPtr
211
+ __xmlParserInputBufferCreateFilename(const char *URI,
212
+ xmlCharEncoding enc);
213
+
214
+ #ifdef LIBXML_OUTPUT_ENABLED
215
+ /*
216
+ * Interfaces for output
217
+ */
218
+ XMLPUBFUN void XMLCALL
219
+ xmlCleanupOutputCallbacks (void);
220
+ XMLPUBFUN int XMLCALL
221
+ xmlPopOutputCallbacks (void);
222
+ XMLPUBFUN void XMLCALL
223
+ xmlRegisterDefaultOutputCallbacks(void);
224
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
225
+ xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
226
+
227
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
228
+ xmlOutputBufferCreateFilename (const char *URI,
229
+ xmlCharEncodingHandlerPtr encoder,
230
+ int compression);
231
+
232
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
233
+ xmlOutputBufferCreateFile (FILE *file,
234
+ xmlCharEncodingHandlerPtr encoder);
235
+
236
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
237
+ xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
238
+ xmlCharEncodingHandlerPtr encoder);
239
+
240
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
241
+ xmlOutputBufferCreateFd (int fd,
242
+ xmlCharEncodingHandlerPtr encoder);
243
+
244
+ XMLPUBFUN xmlOutputBufferPtr XMLCALL
245
+ xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
246
+ xmlOutputCloseCallback ioclose,
247
+ void *ioctx,
248
+ xmlCharEncodingHandlerPtr encoder);
249
+
250
+ /* Couple of APIs to get the output without digging into the buffers */
251
+ XMLPUBFUN const xmlChar * XMLCALL
252
+ xmlOutputBufferGetContent (xmlOutputBufferPtr out);
253
+ XMLPUBFUN size_t XMLCALL
254
+ xmlOutputBufferGetSize (xmlOutputBufferPtr out);
255
+
256
+ XMLPUBFUN int XMLCALL
257
+ xmlOutputBufferWrite (xmlOutputBufferPtr out,
258
+ int len,
259
+ const char *buf);
260
+ XMLPUBFUN int XMLCALL
261
+ xmlOutputBufferWriteString (xmlOutputBufferPtr out,
262
+ const char *str);
263
+ XMLPUBFUN int XMLCALL
264
+ xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
265
+ const xmlChar *str,
266
+ xmlCharEncodingOutputFunc escaping);
267
+
268
+ XMLPUBFUN int XMLCALL
269
+ xmlOutputBufferFlush (xmlOutputBufferPtr out);
270
+ XMLPUBFUN int XMLCALL
271
+ xmlOutputBufferClose (xmlOutputBufferPtr out);
272
+
273
+ XMLPUBFUN int XMLCALL
274
+ xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
275
+ xmlOutputOpenCallback openFunc,
276
+ xmlOutputWriteCallback writeFunc,
277
+ xmlOutputCloseCallback closeFunc);
278
+
279
+ xmlOutputBufferPtr
280
+ __xmlOutputBufferCreateFilename(const char *URI,
281
+ xmlCharEncodingHandlerPtr encoder,
282
+ int compression);
283
+
284
+ #ifdef LIBXML_HTTP_ENABLED
285
+ /* This function only exists if HTTP support built into the library */
286
+ XMLPUBFUN void XMLCALL
287
+ xmlRegisterHTTPPostCallbacks (void );
288
+ #endif /* LIBXML_HTTP_ENABLED */
289
+
290
+ #endif /* LIBXML_OUTPUT_ENABLED */
291
+
292
+ XMLPUBFUN xmlParserInputPtr XMLCALL
293
+ xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
294
+ xmlParserInputPtr ret);
295
+
296
+ /*
297
+ * A predefined entity loader disabling network accesses
298
+ */
299
+ XMLPUBFUN xmlParserInputPtr XMLCALL
300
+ xmlNoNetExternalEntityLoader (const char *URL,
301
+ const char *ID,
302
+ xmlParserCtxtPtr ctxt);
303
+
304
+ /*
305
+ * xmlNormalizeWindowsPath is obsolete, don't use it.
306
+ * Check xmlCanonicPath in uri.h for a better alternative.
307
+ */
308
+ XMLPUBFUN xmlChar * XMLCALL
309
+ xmlNormalizeWindowsPath (const xmlChar *path);
310
+
311
+ XMLPUBFUN int XMLCALL
312
+ xmlCheckFilename (const char *path);
313
+ /**
314
+ * Default 'file://' protocol callbacks
315
+ */
316
+ XMLPUBFUN int XMLCALL
317
+ xmlFileMatch (const char *filename);
318
+ XMLPUBFUN void * XMLCALL
319
+ xmlFileOpen (const char *filename);
320
+ XMLPUBFUN int XMLCALL
321
+ xmlFileRead (void * context,
322
+ char * buffer,
323
+ int len);
324
+ XMLPUBFUN int XMLCALL
325
+ xmlFileClose (void * context);
326
+
327
+ /**
328
+ * Default 'http://' protocol callbacks
329
+ */
330
+ #ifdef LIBXML_HTTP_ENABLED
331
+ XMLPUBFUN int XMLCALL
332
+ xmlIOHTTPMatch (const char *filename);
333
+ XMLPUBFUN void * XMLCALL
334
+ xmlIOHTTPOpen (const char *filename);
335
+ #ifdef LIBXML_OUTPUT_ENABLED
336
+ XMLPUBFUN void * XMLCALL
337
+ xmlIOHTTPOpenW (const char * post_uri,
338
+ int compression );
339
+ #endif /* LIBXML_OUTPUT_ENABLED */
340
+ XMLPUBFUN int XMLCALL
341
+ xmlIOHTTPRead (void * context,
342
+ char * buffer,
343
+ int len);
344
+ XMLPUBFUN int XMLCALL
345
+ xmlIOHTTPClose (void * context);
346
+ #endif /* LIBXML_HTTP_ENABLED */
347
+
348
+ /**
349
+ * Default 'ftp://' protocol callbacks
350
+ */
351
+ #ifdef LIBXML_FTP_ENABLED
352
+ XMLPUBFUN int XMLCALL
353
+ xmlIOFTPMatch (const char *filename);
354
+ XMLPUBFUN void * XMLCALL
355
+ xmlIOFTPOpen (const char *filename);
356
+ XMLPUBFUN int XMLCALL
357
+ xmlIOFTPRead (void * context,
358
+ char * buffer,
359
+ int len);
360
+ XMLPUBFUN int XMLCALL
361
+ xmlIOFTPClose (void * context);
362
+ #endif /* LIBXML_FTP_ENABLED */
363
+
364
+ #ifdef __cplusplus
365
+ }
366
+ #endif
367
+
368
+ #endif /* __XML_IO_H__ */
@@ -0,0 +1,146 @@
1
+ /*
2
+ * Summary: API to build regexp automata
3
+ * Description: the API to build regexp automata
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_AUTOMATA_H__
11
+ #define __XML_AUTOMATA_H__
12
+
13
+ #include <libxml/xmlversion.h>
14
+ #include <libxml/tree.h>
15
+
16
+ #ifdef LIBXML_REGEXP_ENABLED
17
+ #ifdef LIBXML_AUTOMATA_ENABLED
18
+ #include <libxml/xmlregexp.h>
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /**
25
+ * xmlAutomataPtr:
26
+ *
27
+ * A libxml automata description, It can be compiled into a regexp
28
+ */
29
+ typedef struct _xmlAutomata xmlAutomata;
30
+ typedef xmlAutomata *xmlAutomataPtr;
31
+
32
+ /**
33
+ * xmlAutomataStatePtr:
34
+ *
35
+ * A state int the automata description,
36
+ */
37
+ typedef struct _xmlAutomataState xmlAutomataState;
38
+ typedef xmlAutomataState *xmlAutomataStatePtr;
39
+
40
+ /*
41
+ * Building API
42
+ */
43
+ XMLPUBFUN xmlAutomataPtr XMLCALL
44
+ xmlNewAutomata (void);
45
+ XMLPUBFUN void XMLCALL
46
+ xmlFreeAutomata (xmlAutomataPtr am);
47
+
48
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
49
+ xmlAutomataGetInitState (xmlAutomataPtr am);
50
+ XMLPUBFUN int XMLCALL
51
+ xmlAutomataSetFinalState (xmlAutomataPtr am,
52
+ xmlAutomataStatePtr state);
53
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
54
+ xmlAutomataNewState (xmlAutomataPtr am);
55
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
56
+ xmlAutomataNewTransition (xmlAutomataPtr am,
57
+ xmlAutomataStatePtr from,
58
+ xmlAutomataStatePtr to,
59
+ const xmlChar *token,
60
+ void *data);
61
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
62
+ xmlAutomataNewTransition2 (xmlAutomataPtr am,
63
+ xmlAutomataStatePtr from,
64
+ xmlAutomataStatePtr to,
65
+ const xmlChar *token,
66
+ const xmlChar *token2,
67
+ void *data);
68
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
69
+ xmlAutomataNewNegTrans (xmlAutomataPtr am,
70
+ xmlAutomataStatePtr from,
71
+ xmlAutomataStatePtr to,
72
+ const xmlChar *token,
73
+ const xmlChar *token2,
74
+ void *data);
75
+
76
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
77
+ xmlAutomataNewCountTrans (xmlAutomataPtr am,
78
+ xmlAutomataStatePtr from,
79
+ xmlAutomataStatePtr to,
80
+ const xmlChar *token,
81
+ int min,
82
+ int max,
83
+ void *data);
84
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
85
+ xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
86
+ xmlAutomataStatePtr from,
87
+ xmlAutomataStatePtr to,
88
+ const xmlChar *token,
89
+ const xmlChar *token2,
90
+ int min,
91
+ int max,
92
+ void *data);
93
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
94
+ xmlAutomataNewOnceTrans (xmlAutomataPtr am,
95
+ xmlAutomataStatePtr from,
96
+ xmlAutomataStatePtr to,
97
+ const xmlChar *token,
98
+ int min,
99
+ int max,
100
+ void *data);
101
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
102
+ xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
103
+ xmlAutomataStatePtr from,
104
+ xmlAutomataStatePtr to,
105
+ const xmlChar *token,
106
+ const xmlChar *token2,
107
+ int min,
108
+ int max,
109
+ void *data);
110
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
111
+ xmlAutomataNewAllTrans (xmlAutomataPtr am,
112
+ xmlAutomataStatePtr from,
113
+ xmlAutomataStatePtr to,
114
+ int lax);
115
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
116
+ xmlAutomataNewEpsilon (xmlAutomataPtr am,
117
+ xmlAutomataStatePtr from,
118
+ xmlAutomataStatePtr to);
119
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
120
+ xmlAutomataNewCountedTrans (xmlAutomataPtr am,
121
+ xmlAutomataStatePtr from,
122
+ xmlAutomataStatePtr to,
123
+ int counter);
124
+ XMLPUBFUN xmlAutomataStatePtr XMLCALL
125
+ xmlAutomataNewCounterTrans (xmlAutomataPtr am,
126
+ xmlAutomataStatePtr from,
127
+ xmlAutomataStatePtr to,
128
+ int counter);
129
+ XMLPUBFUN int XMLCALL
130
+ xmlAutomataNewCounter (xmlAutomataPtr am,
131
+ int min,
132
+ int max);
133
+
134
+ XMLPUBFUN xmlRegexpPtr XMLCALL
135
+ xmlAutomataCompile (xmlAutomataPtr am);
136
+ XMLPUBFUN int XMLCALL
137
+ xmlAutomataIsDeterminist (xmlAutomataPtr am);
138
+
139
+ #ifdef __cplusplus
140
+ }
141
+ #endif
142
+
143
+ #endif /* LIBXML_AUTOMATA_ENABLED */
144
+ #endif /* LIBXML_REGEXP_ENABLED */
145
+
146
+ #endif /* __XML_AUTOMATA_H__ */