nokogiri 1.11.0.rc3-x86-mingw32 → 1.11.3-x86-mingw32

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 (174) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1015 -947
  4. data/LICENSE.md +1 -1
  5. data/README.md +168 -91
  6. data/ext/nokogiri/depend +37 -358
  7. data/ext/nokogiri/extconf.rb +581 -374
  8. data/ext/nokogiri/html_document.c +78 -82
  9. data/ext/nokogiri/html_element_description.c +84 -71
  10. data/ext/nokogiri/html_entity_lookup.c +21 -16
  11. data/ext/nokogiri/html_sax_parser_context.c +69 -66
  12. data/ext/nokogiri/html_sax_push_parser.c +42 -34
  13. data/ext/nokogiri/include/libexslt/exslt.h +102 -0
  14. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  15. data/ext/nokogiri/include/libexslt/exsltexports.h +140 -0
  16. data/ext/nokogiri/include/libxml2/libxml/DOCBparser.h +96 -0
  17. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
  18. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  19. data/ext/nokogiri/include/libxml2/libxml/SAX.h +173 -0
  20. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +178 -0
  21. data/ext/nokogiri/include/libxml2/libxml/c14n.h +126 -0
  22. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  23. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  24. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  25. data/ext/nokogiri/include/libxml2/libxml/dict.h +79 -0
  26. data/ext/nokogiri/include/libxml2/libxml/encoding.h +245 -0
  27. data/ext/nokogiri/include/libxml2/libxml/entities.h +151 -0
  28. data/ext/nokogiri/include/libxml2/libxml/globals.h +508 -0
  29. data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
  30. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  31. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +163 -0
  32. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
  33. data/ext/nokogiri/include/libxml2/libxml/parser.h +1241 -0
  34. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +644 -0
  35. data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
  36. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +217 -0
  37. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
  38. data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
  39. data/ext/nokogiri/include/libxml2/libxml/threads.h +89 -0
  40. data/ext/nokogiri/include/libxml2/libxml/tree.h +1311 -0
  41. data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
  42. data/ext/nokogiri/include/libxml2/libxml/valid.h +458 -0
  43. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
  44. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  45. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +366 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +945 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +153 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +224 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +151 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +485 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
  60. data/ext/nokogiri/include/libxml2/libxml/xpath.h +566 -0
  61. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
  62. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +114 -0
  63. data/ext/nokogiri/include/libxslt/attributes.h +38 -0
  64. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  65. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  66. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  67. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  68. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  69. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  70. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  71. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  72. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  73. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  74. data/ext/nokogiri/include/libxslt/security.h +104 -0
  75. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  76. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  77. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  78. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  79. data/ext/nokogiri/include/libxslt/xsltInternals.h +1978 -0
  80. data/ext/nokogiri/include/libxslt/xsltconfig.h +180 -0
  81. data/ext/nokogiri/include/libxslt/xsltexports.h +142 -0
  82. data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
  83. data/ext/nokogiri/include/libxslt/xsltutils.h +313 -0
  84. data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
  85. data/ext/nokogiri/nokogiri.c +192 -93
  86. data/ext/nokogiri/nokogiri.h +177 -98
  87. data/ext/nokogiri/test_global_handlers.c +40 -0
  88. data/ext/nokogiri/xml_attr.c +15 -15
  89. data/ext/nokogiri/xml_attribute_decl.c +18 -18
  90. data/ext/nokogiri/xml_cdata.c +13 -18
  91. data/ext/nokogiri/xml_comment.c +19 -26
  92. data/ext/nokogiri/xml_document.c +246 -188
  93. data/ext/nokogiri/xml_document_fragment.c +13 -15
  94. data/ext/nokogiri/xml_dtd.c +54 -48
  95. data/ext/nokogiri/xml_element_content.c +30 -27
  96. data/ext/nokogiri/xml_element_decl.c +22 -22
  97. data/ext/nokogiri/xml_encoding_handler.c +17 -11
  98. data/ext/nokogiri/xml_entity_decl.c +32 -30
  99. data/ext/nokogiri/xml_entity_reference.c +16 -18
  100. data/ext/nokogiri/xml_namespace.c +56 -49
  101. data/ext/nokogiri/xml_node.c +371 -320
  102. data/ext/nokogiri/xml_node_set.c +168 -156
  103. data/ext/nokogiri/xml_processing_instruction.c +17 -19
  104. data/ext/nokogiri/xml_reader.c +191 -157
  105. data/ext/nokogiri/xml_relax_ng.c +52 -28
  106. data/ext/nokogiri/xml_sax_parser.c +118 -118
  107. data/ext/nokogiri/xml_sax_parser_context.c +103 -86
  108. data/ext/nokogiri/xml_sax_push_parser.c +36 -27
  109. data/ext/nokogiri/xml_schema.c +95 -47
  110. data/ext/nokogiri/xml_syntax_error.c +42 -21
  111. data/ext/nokogiri/xml_text.c +13 -17
  112. data/ext/nokogiri/xml_xpath_context.c +206 -123
  113. data/ext/nokogiri/xslt_stylesheet.c +158 -161
  114. data/lib/nokogiri.rb +3 -7
  115. data/lib/nokogiri/2.5/nokogiri.so +0 -0
  116. data/lib/nokogiri/2.6/nokogiri.so +0 -0
  117. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  118. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  119. data/lib/nokogiri/css/parser.rb +3 -3
  120. data/lib/nokogiri/css/parser.y +2 -2
  121. data/lib/nokogiri/css/xpath_visitor.rb +70 -42
  122. data/lib/nokogiri/extension.rb +26 -0
  123. data/lib/nokogiri/html/document.rb +12 -26
  124. data/lib/nokogiri/html/document_fragment.rb +15 -15
  125. data/lib/nokogiri/version.rb +2 -149
  126. data/lib/nokogiri/version/constant.rb +5 -0
  127. data/lib/nokogiri/version/info.rb +205 -0
  128. data/lib/nokogiri/xml/document.rb +91 -35
  129. data/lib/nokogiri/xml/document_fragment.rb +4 -6
  130. data/lib/nokogiri/xml/node.rb +89 -69
  131. data/lib/nokogiri/xml/parse_options.rb +6 -0
  132. data/lib/nokogiri/xml/reader.rb +2 -9
  133. data/lib/nokogiri/xml/relax_ng.rb +6 -2
  134. data/lib/nokogiri/xml/schema.rb +12 -4
  135. data/lib/nokogiri/xml/searchable.rb +3 -1
  136. data/lib/nokogiri/xml/xpath.rb +1 -3
  137. data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -1
  138. metadata +150 -171
  139. data/ext/nokogiri/html_document.h +0 -10
  140. data/ext/nokogiri/html_element_description.h +0 -10
  141. data/ext/nokogiri/html_entity_lookup.h +0 -8
  142. data/ext/nokogiri/html_sax_parser_context.h +0 -11
  143. data/ext/nokogiri/html_sax_push_parser.h +0 -9
  144. data/ext/nokogiri/xml_attr.h +0 -9
  145. data/ext/nokogiri/xml_attribute_decl.h +0 -9
  146. data/ext/nokogiri/xml_cdata.h +0 -9
  147. data/ext/nokogiri/xml_comment.h +0 -9
  148. data/ext/nokogiri/xml_document.h +0 -23
  149. data/ext/nokogiri/xml_document_fragment.h +0 -10
  150. data/ext/nokogiri/xml_dtd.h +0 -10
  151. data/ext/nokogiri/xml_element_content.h +0 -10
  152. data/ext/nokogiri/xml_element_decl.h +0 -9
  153. data/ext/nokogiri/xml_encoding_handler.h +0 -8
  154. data/ext/nokogiri/xml_entity_decl.h +0 -10
  155. data/ext/nokogiri/xml_entity_reference.h +0 -9
  156. data/ext/nokogiri/xml_io.c +0 -63
  157. data/ext/nokogiri/xml_io.h +0 -11
  158. data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
  159. data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
  160. data/ext/nokogiri/xml_namespace.h +0 -14
  161. data/ext/nokogiri/xml_node.h +0 -13
  162. data/ext/nokogiri/xml_node_set.h +0 -12
  163. data/ext/nokogiri/xml_processing_instruction.h +0 -9
  164. data/ext/nokogiri/xml_reader.h +0 -10
  165. data/ext/nokogiri/xml_relax_ng.h +0 -9
  166. data/ext/nokogiri/xml_sax_parser.h +0 -39
  167. data/ext/nokogiri/xml_sax_parser_context.h +0 -10
  168. data/ext/nokogiri/xml_sax_push_parser.h +0 -9
  169. data/ext/nokogiri/xml_schema.h +0 -9
  170. data/ext/nokogiri/xml_syntax_error.h +0 -13
  171. data/ext/nokogiri/xml_text.h +0 -9
  172. data/ext/nokogiri/xml_xpath_context.h +0 -10
  173. data/ext/nokogiri/xslt_stylesheet.h +0 -14
  174. data/lib/nokogiri/2.4/nokogiri.so +0 -0
@@ -0,0 +1,644 @@
1
+ /*
2
+ * Summary: internals routines and limits exported by the parser.
3
+ * Description: this module exports a number of internal parsing routines
4
+ * they are not really all intended for applications but
5
+ * can prove useful doing low level processing.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_PARSER_INTERNALS_H__
13
+ #define __XML_PARSER_INTERNALS_H__
14
+
15
+ #include <libxml/xmlversion.h>
16
+ #include <libxml/parser.h>
17
+ #include <libxml/HTMLparser.h>
18
+ #include <libxml/chvalid.h>
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /**
25
+ * xmlParserMaxDepth:
26
+ *
27
+ * arbitrary depth limit for the XML documents that we allow to
28
+ * process. This is not a limitation of the parser but a safety
29
+ * boundary feature, use XML_PARSE_HUGE option to override it.
30
+ */
31
+ XMLPUBVAR unsigned int xmlParserMaxDepth;
32
+
33
+ /**
34
+ * XML_MAX_TEXT_LENGTH:
35
+ *
36
+ * Maximum size allowed for a single text node when building a tree.
37
+ * This is not a limitation of the parser but a safety boundary feature,
38
+ * use XML_PARSE_HUGE option to override it.
39
+ * Introduced in 2.9.0
40
+ */
41
+ #define XML_MAX_TEXT_LENGTH 10000000
42
+
43
+ /**
44
+ * XML_MAX_NAME_LENGTH:
45
+ *
46
+ * Maximum size allowed for a markup identifier.
47
+ * This is not a limitation of the parser but a safety boundary feature,
48
+ * use XML_PARSE_HUGE option to override it.
49
+ * Note that with the use of parsing dictionaries overriding the limit
50
+ * may result in more runtime memory usage in face of "unfriendly' content
51
+ * Introduced in 2.9.0
52
+ */
53
+ #define XML_MAX_NAME_LENGTH 50000
54
+
55
+ /**
56
+ * XML_MAX_DICTIONARY_LIMIT:
57
+ *
58
+ * Maximum size allowed by the parser for a dictionary by default
59
+ * This is not a limitation of the parser but a safety boundary feature,
60
+ * use XML_PARSE_HUGE option to override it.
61
+ * Introduced in 2.9.0
62
+ */
63
+ #define XML_MAX_DICTIONARY_LIMIT 10000000
64
+
65
+ /**
66
+ * XML_MAX_LOOKUP_LIMIT:
67
+ *
68
+ * Maximum size allowed by the parser for ahead lookup
69
+ * This is an upper boundary enforced by the parser to avoid bad
70
+ * behaviour on "unfriendly' content
71
+ * Introduced in 2.9.0
72
+ */
73
+ #define XML_MAX_LOOKUP_LIMIT 10000000
74
+
75
+ /**
76
+ * XML_MAX_NAMELEN:
77
+ *
78
+ * Identifiers can be longer, but this will be more costly
79
+ * at runtime.
80
+ */
81
+ #define XML_MAX_NAMELEN 100
82
+
83
+ /**
84
+ * INPUT_CHUNK:
85
+ *
86
+ * The parser tries to always have that amount of input ready.
87
+ * One of the point is providing context when reporting errors.
88
+ */
89
+ #define INPUT_CHUNK 250
90
+
91
+ /************************************************************************
92
+ * *
93
+ * UNICODE version of the macros. *
94
+ * *
95
+ ************************************************************************/
96
+ /**
97
+ * IS_BYTE_CHAR:
98
+ * @c: an byte value (int)
99
+ *
100
+ * Macro to check the following production in the XML spec:
101
+ *
102
+ * [2] Char ::= #x9 | #xA | #xD | [#x20...]
103
+ * any byte character in the accepted range
104
+ */
105
+ #define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
106
+
107
+ /**
108
+ * IS_CHAR:
109
+ * @c: an UNICODE value (int)
110
+ *
111
+ * Macro to check the following production in the XML spec:
112
+ *
113
+ * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
114
+ * | [#x10000-#x10FFFF]
115
+ * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
116
+ */
117
+ #define IS_CHAR(c) xmlIsCharQ(c)
118
+
119
+ /**
120
+ * IS_CHAR_CH:
121
+ * @c: an xmlChar (usually an unsigned char)
122
+ *
123
+ * Behaves like IS_CHAR on single-byte value
124
+ */
125
+ #define IS_CHAR_CH(c) xmlIsChar_ch(c)
126
+
127
+ /**
128
+ * IS_BLANK:
129
+ * @c: an UNICODE value (int)
130
+ *
131
+ * Macro to check the following production in the XML spec:
132
+ *
133
+ * [3] S ::= (#x20 | #x9 | #xD | #xA)+
134
+ */
135
+ #define IS_BLANK(c) xmlIsBlankQ(c)
136
+
137
+ /**
138
+ * IS_BLANK_CH:
139
+ * @c: an xmlChar value (normally unsigned char)
140
+ *
141
+ * Behaviour same as IS_BLANK
142
+ */
143
+ #define IS_BLANK_CH(c) xmlIsBlank_ch(c)
144
+
145
+ /**
146
+ * IS_BASECHAR:
147
+ * @c: an UNICODE value (int)
148
+ *
149
+ * Macro to check the following production in the XML spec:
150
+ *
151
+ * [85] BaseChar ::= ... long list see REC ...
152
+ */
153
+ #define IS_BASECHAR(c) xmlIsBaseCharQ(c)
154
+
155
+ /**
156
+ * IS_DIGIT:
157
+ * @c: an UNICODE value (int)
158
+ *
159
+ * Macro to check the following production in the XML spec:
160
+ *
161
+ * [88] Digit ::= ... long list see REC ...
162
+ */
163
+ #define IS_DIGIT(c) xmlIsDigitQ(c)
164
+
165
+ /**
166
+ * IS_DIGIT_CH:
167
+ * @c: an xmlChar value (usually an unsigned char)
168
+ *
169
+ * Behaves like IS_DIGIT but with a single byte argument
170
+ */
171
+ #define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
172
+
173
+ /**
174
+ * IS_COMBINING:
175
+ * @c: an UNICODE value (int)
176
+ *
177
+ * Macro to check the following production in the XML spec:
178
+ *
179
+ * [87] CombiningChar ::= ... long list see REC ...
180
+ */
181
+ #define IS_COMBINING(c) xmlIsCombiningQ(c)
182
+
183
+ /**
184
+ * IS_COMBINING_CH:
185
+ * @c: an xmlChar (usually an unsigned char)
186
+ *
187
+ * Always false (all combining chars > 0xff)
188
+ */
189
+ #define IS_COMBINING_CH(c) 0
190
+
191
+ /**
192
+ * IS_EXTENDER:
193
+ * @c: an UNICODE value (int)
194
+ *
195
+ * Macro to check the following production in the XML spec:
196
+ *
197
+ *
198
+ * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
199
+ * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
200
+ * [#x309D-#x309E] | [#x30FC-#x30FE]
201
+ */
202
+ #define IS_EXTENDER(c) xmlIsExtenderQ(c)
203
+
204
+ /**
205
+ * IS_EXTENDER_CH:
206
+ * @c: an xmlChar value (usually an unsigned char)
207
+ *
208
+ * Behaves like IS_EXTENDER but with a single-byte argument
209
+ */
210
+ #define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
211
+
212
+ /**
213
+ * IS_IDEOGRAPHIC:
214
+ * @c: an UNICODE value (int)
215
+ *
216
+ * Macro to check the following production in the XML spec:
217
+ *
218
+ *
219
+ * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
220
+ */
221
+ #define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
222
+
223
+ /**
224
+ * IS_LETTER:
225
+ * @c: an UNICODE value (int)
226
+ *
227
+ * Macro to check the following production in the XML spec:
228
+ *
229
+ *
230
+ * [84] Letter ::= BaseChar | Ideographic
231
+ */
232
+ #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
233
+
234
+ /**
235
+ * IS_LETTER_CH:
236
+ * @c: an xmlChar value (normally unsigned char)
237
+ *
238
+ * Macro behaves like IS_LETTER, but only check base chars
239
+ *
240
+ */
241
+ #define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
242
+
243
+ /**
244
+ * IS_ASCII_LETTER:
245
+ * @c: an xmlChar value
246
+ *
247
+ * Macro to check [a-zA-Z]
248
+ *
249
+ */
250
+ #define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
251
+ ((0x61 <= (c)) && ((c) <= 0x7a)))
252
+
253
+ /**
254
+ * IS_ASCII_DIGIT:
255
+ * @c: an xmlChar value
256
+ *
257
+ * Macro to check [0-9]
258
+ *
259
+ */
260
+ #define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
261
+
262
+ /**
263
+ * IS_PUBIDCHAR:
264
+ * @c: an UNICODE value (int)
265
+ *
266
+ * Macro to check the following production in the XML spec:
267
+ *
268
+ *
269
+ * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
270
+ */
271
+ #define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
272
+
273
+ /**
274
+ * IS_PUBIDCHAR_CH:
275
+ * @c: an xmlChar value (normally unsigned char)
276
+ *
277
+ * Same as IS_PUBIDCHAR but for single-byte value
278
+ */
279
+ #define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
280
+
281
+ /**
282
+ * SKIP_EOL:
283
+ * @p: and UTF8 string pointer
284
+ *
285
+ * Skips the end of line chars.
286
+ */
287
+ #define SKIP_EOL(p) \
288
+ if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
289
+ if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
290
+
291
+ /**
292
+ * MOVETO_ENDTAG:
293
+ * @p: and UTF8 string pointer
294
+ *
295
+ * Skips to the next '>' char.
296
+ */
297
+ #define MOVETO_ENDTAG(p) \
298
+ while ((*p) && (*(p) != '>')) (p)++
299
+
300
+ /**
301
+ * MOVETO_STARTTAG:
302
+ * @p: and UTF8 string pointer
303
+ *
304
+ * Skips to the next '<' char.
305
+ */
306
+ #define MOVETO_STARTTAG(p) \
307
+ while ((*p) && (*(p) != '<')) (p)++
308
+
309
+ /**
310
+ * Global variables used for predefined strings.
311
+ */
312
+ XMLPUBVAR const xmlChar xmlStringText[];
313
+ XMLPUBVAR const xmlChar xmlStringTextNoenc[];
314
+ XMLPUBVAR const xmlChar xmlStringComment[];
315
+
316
+ /*
317
+ * Function to finish the work of the macros where needed.
318
+ */
319
+ XMLPUBFUN int XMLCALL xmlIsLetter (int c);
320
+
321
+ /**
322
+ * Parser context.
323
+ */
324
+ XMLPUBFUN xmlParserCtxtPtr XMLCALL
325
+ xmlCreateFileParserCtxt (const char *filename);
326
+ XMLPUBFUN xmlParserCtxtPtr XMLCALL
327
+ xmlCreateURLParserCtxt (const char *filename,
328
+ int options);
329
+ XMLPUBFUN xmlParserCtxtPtr XMLCALL
330
+ xmlCreateMemoryParserCtxt(const char *buffer,
331
+ int size);
332
+ XMLPUBFUN xmlParserCtxtPtr XMLCALL
333
+ xmlCreateEntityParserCtxt(const xmlChar *URL,
334
+ const xmlChar *ID,
335
+ const xmlChar *base);
336
+ XMLPUBFUN int XMLCALL
337
+ xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
338
+ xmlCharEncoding enc);
339
+ XMLPUBFUN int XMLCALL
340
+ xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
341
+ xmlCharEncodingHandlerPtr handler);
342
+ XMLPUBFUN int XMLCALL
343
+ xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
344
+ xmlParserInputPtr input,
345
+ xmlCharEncodingHandlerPtr handler);
346
+
347
+ #ifdef IN_LIBXML
348
+ /* internal error reporting */
349
+ XMLPUBFUN void XMLCALL
350
+ __xmlErrEncoding (xmlParserCtxtPtr ctxt,
351
+ xmlParserErrors xmlerr,
352
+ const char *msg,
353
+ const xmlChar * str1,
354
+ const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
355
+ #endif
356
+
357
+ /**
358
+ * Input Streams.
359
+ */
360
+ XMLPUBFUN xmlParserInputPtr XMLCALL
361
+ xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
362
+ const xmlChar *buffer);
363
+ XMLPUBFUN xmlParserInputPtr XMLCALL
364
+ xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
365
+ xmlEntityPtr entity);
366
+ XMLPUBFUN int XMLCALL
367
+ xmlPushInput (xmlParserCtxtPtr ctxt,
368
+ xmlParserInputPtr input);
369
+ XMLPUBFUN xmlChar XMLCALL
370
+ xmlPopInput (xmlParserCtxtPtr ctxt);
371
+ XMLPUBFUN void XMLCALL
372
+ xmlFreeInputStream (xmlParserInputPtr input);
373
+ XMLPUBFUN xmlParserInputPtr XMLCALL
374
+ xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
375
+ const char *filename);
376
+ XMLPUBFUN xmlParserInputPtr XMLCALL
377
+ xmlNewInputStream (xmlParserCtxtPtr ctxt);
378
+
379
+ /**
380
+ * Namespaces.
381
+ */
382
+ XMLPUBFUN xmlChar * XMLCALL
383
+ xmlSplitQName (xmlParserCtxtPtr ctxt,
384
+ const xmlChar *name,
385
+ xmlChar **prefix);
386
+
387
+ /**
388
+ * Generic production rules.
389
+ */
390
+ XMLPUBFUN const xmlChar * XMLCALL
391
+ xmlParseName (xmlParserCtxtPtr ctxt);
392
+ XMLPUBFUN xmlChar * XMLCALL
393
+ xmlParseNmtoken (xmlParserCtxtPtr ctxt);
394
+ XMLPUBFUN xmlChar * XMLCALL
395
+ xmlParseEntityValue (xmlParserCtxtPtr ctxt,
396
+ xmlChar **orig);
397
+ XMLPUBFUN xmlChar * XMLCALL
398
+ xmlParseAttValue (xmlParserCtxtPtr ctxt);
399
+ XMLPUBFUN xmlChar * XMLCALL
400
+ xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
401
+ XMLPUBFUN xmlChar * XMLCALL
402
+ xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
403
+ XMLPUBFUN void XMLCALL
404
+ xmlParseCharData (xmlParserCtxtPtr ctxt,
405
+ int cdata);
406
+ XMLPUBFUN xmlChar * XMLCALL
407
+ xmlParseExternalID (xmlParserCtxtPtr ctxt,
408
+ xmlChar **publicID,
409
+ int strict);
410
+ XMLPUBFUN void XMLCALL
411
+ xmlParseComment (xmlParserCtxtPtr ctxt);
412
+ XMLPUBFUN const xmlChar * XMLCALL
413
+ xmlParsePITarget (xmlParserCtxtPtr ctxt);
414
+ XMLPUBFUN void XMLCALL
415
+ xmlParsePI (xmlParserCtxtPtr ctxt);
416
+ XMLPUBFUN void XMLCALL
417
+ xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
418
+ XMLPUBFUN void XMLCALL
419
+ xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
420
+ XMLPUBFUN int XMLCALL
421
+ xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
422
+ xmlChar **value);
423
+ XMLPUBFUN xmlEnumerationPtr XMLCALL
424
+ xmlParseNotationType (xmlParserCtxtPtr ctxt);
425
+ XMLPUBFUN xmlEnumerationPtr XMLCALL
426
+ xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
427
+ XMLPUBFUN int XMLCALL
428
+ xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
429
+ xmlEnumerationPtr *tree);
430
+ XMLPUBFUN int XMLCALL
431
+ xmlParseAttributeType (xmlParserCtxtPtr ctxt,
432
+ xmlEnumerationPtr *tree);
433
+ XMLPUBFUN void XMLCALL
434
+ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
435
+ XMLPUBFUN xmlElementContentPtr XMLCALL
436
+ xmlParseElementMixedContentDecl
437
+ (xmlParserCtxtPtr ctxt,
438
+ int inputchk);
439
+ XMLPUBFUN xmlElementContentPtr XMLCALL
440
+ xmlParseElementChildrenContentDecl
441
+ (xmlParserCtxtPtr ctxt,
442
+ int inputchk);
443
+ XMLPUBFUN int XMLCALL
444
+ xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
445
+ const xmlChar *name,
446
+ xmlElementContentPtr *result);
447
+ XMLPUBFUN int XMLCALL
448
+ xmlParseElementDecl (xmlParserCtxtPtr ctxt);
449
+ XMLPUBFUN void XMLCALL
450
+ xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
451
+ XMLPUBFUN int XMLCALL
452
+ xmlParseCharRef (xmlParserCtxtPtr ctxt);
453
+ XMLPUBFUN xmlEntityPtr XMLCALL
454
+ xmlParseEntityRef (xmlParserCtxtPtr ctxt);
455
+ XMLPUBFUN void XMLCALL
456
+ xmlParseReference (xmlParserCtxtPtr ctxt);
457
+ XMLPUBFUN void XMLCALL
458
+ xmlParsePEReference (xmlParserCtxtPtr ctxt);
459
+ XMLPUBFUN void XMLCALL
460
+ xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
461
+ #ifdef LIBXML_SAX1_ENABLED
462
+ XMLPUBFUN const xmlChar * XMLCALL
463
+ xmlParseAttribute (xmlParserCtxtPtr ctxt,
464
+ xmlChar **value);
465
+ XMLPUBFUN const xmlChar * XMLCALL
466
+ xmlParseStartTag (xmlParserCtxtPtr ctxt);
467
+ XMLPUBFUN void XMLCALL
468
+ xmlParseEndTag (xmlParserCtxtPtr ctxt);
469
+ #endif /* LIBXML_SAX1_ENABLED */
470
+ XMLPUBFUN void XMLCALL
471
+ xmlParseCDSect (xmlParserCtxtPtr ctxt);
472
+ XMLPUBFUN void XMLCALL
473
+ xmlParseContent (xmlParserCtxtPtr ctxt);
474
+ XMLPUBFUN void XMLCALL
475
+ xmlParseElement (xmlParserCtxtPtr ctxt);
476
+ XMLPUBFUN xmlChar * XMLCALL
477
+ xmlParseVersionNum (xmlParserCtxtPtr ctxt);
478
+ XMLPUBFUN xmlChar * XMLCALL
479
+ xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
480
+ XMLPUBFUN xmlChar * XMLCALL
481
+ xmlParseEncName (xmlParserCtxtPtr ctxt);
482
+ XMLPUBFUN const xmlChar * XMLCALL
483
+ xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
484
+ XMLPUBFUN int XMLCALL
485
+ xmlParseSDDecl (xmlParserCtxtPtr ctxt);
486
+ XMLPUBFUN void XMLCALL
487
+ xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
488
+ XMLPUBFUN void XMLCALL
489
+ xmlParseTextDecl (xmlParserCtxtPtr ctxt);
490
+ XMLPUBFUN void XMLCALL
491
+ xmlParseMisc (xmlParserCtxtPtr ctxt);
492
+ XMLPUBFUN void XMLCALL
493
+ xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
494
+ const xmlChar *ExternalID,
495
+ const xmlChar *SystemID);
496
+ /**
497
+ * XML_SUBSTITUTE_NONE:
498
+ *
499
+ * If no entities need to be substituted.
500
+ */
501
+ #define XML_SUBSTITUTE_NONE 0
502
+ /**
503
+ * XML_SUBSTITUTE_REF:
504
+ *
505
+ * Whether general entities need to be substituted.
506
+ */
507
+ #define XML_SUBSTITUTE_REF 1
508
+ /**
509
+ * XML_SUBSTITUTE_PEREF:
510
+ *
511
+ * Whether parameter entities need to be substituted.
512
+ */
513
+ #define XML_SUBSTITUTE_PEREF 2
514
+ /**
515
+ * XML_SUBSTITUTE_BOTH:
516
+ *
517
+ * Both general and parameter entities need to be substituted.
518
+ */
519
+ #define XML_SUBSTITUTE_BOTH 3
520
+
521
+ XMLPUBFUN xmlChar * XMLCALL
522
+ xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
523
+ const xmlChar *str,
524
+ int what,
525
+ xmlChar end,
526
+ xmlChar end2,
527
+ xmlChar end3);
528
+ XMLPUBFUN xmlChar * XMLCALL
529
+ xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
530
+ const xmlChar *str,
531
+ int len,
532
+ int what,
533
+ xmlChar end,
534
+ xmlChar end2,
535
+ xmlChar end3);
536
+
537
+ /*
538
+ * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
539
+ */
540
+ XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
541
+ xmlNodePtr value);
542
+ XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
543
+ XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
544
+ xmlParserInputPtr value);
545
+ XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
546
+ XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
547
+ XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
548
+ const xmlChar *value);
549
+
550
+ /*
551
+ * other commodities shared between parser.c and parserInternals.
552
+ */
553
+ XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
554
+ XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
555
+ const xmlChar *cur,
556
+ int *len);
557
+ XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
558
+ XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
559
+
560
+ /*
561
+ * Really core function shared with HTML parser.
562
+ */
563
+ XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
564
+ int *len);
565
+ XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
566
+ int val);
567
+ XMLPUBFUN int XMLCALL xmlCopyChar (int len,
568
+ xmlChar *out,
569
+ int val);
570
+ XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
571
+ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
572
+
573
+ #ifdef LIBXML_HTML_ENABLED
574
+ /*
575
+ * Actually comes from the HTML parser but launched from the init stuff.
576
+ */
577
+ XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
578
+ XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
579
+ const char *encoding);
580
+ #endif
581
+
582
+ /*
583
+ * Specific function to keep track of entities references
584
+ * and used by the XSLT debugger.
585
+ */
586
+ #ifdef LIBXML_LEGACY_ENABLED
587
+ /**
588
+ * xmlEntityReferenceFunc:
589
+ * @ent: the entity
590
+ * @firstNode: the fist node in the chunk
591
+ * @lastNode: the last nod in the chunk
592
+ *
593
+ * Callback function used when one needs to be able to track back the
594
+ * provenance of a chunk of nodes inherited from an entity replacement.
595
+ */
596
+ typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
597
+ xmlNodePtr firstNode,
598
+ xmlNodePtr lastNode);
599
+
600
+ XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
601
+
602
+ XMLPUBFUN xmlChar * XMLCALL
603
+ xmlParseQuotedString (xmlParserCtxtPtr ctxt);
604
+ XMLPUBFUN void XMLCALL
605
+ xmlParseNamespace (xmlParserCtxtPtr ctxt);
606
+ XMLPUBFUN xmlChar * XMLCALL
607
+ xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
608
+ XMLPUBFUN xmlChar * XMLCALL
609
+ xmlScanName (xmlParserCtxtPtr ctxt);
610
+ XMLPUBFUN xmlChar * XMLCALL
611
+ xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
612
+ XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
613
+ XMLPUBFUN xmlChar * XMLCALL
614
+ xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
615
+ xmlChar **prefix);
616
+ /**
617
+ * Entities
618
+ */
619
+ XMLPUBFUN xmlChar * XMLCALL
620
+ xmlDecodeEntities (xmlParserCtxtPtr ctxt,
621
+ int len,
622
+ int what,
623
+ xmlChar end,
624
+ xmlChar end2,
625
+ xmlChar end3);
626
+ XMLPUBFUN void XMLCALL
627
+ xmlHandleEntity (xmlParserCtxtPtr ctxt,
628
+ xmlEntityPtr entity);
629
+
630
+ #endif /* LIBXML_LEGACY_ENABLED */
631
+
632
+ #ifdef IN_LIBXML
633
+ /*
634
+ * internal only
635
+ */
636
+ XMLPUBFUN void XMLCALL
637
+ xmlErrMemory (xmlParserCtxtPtr ctxt,
638
+ const char *extra);
639
+ #endif
640
+
641
+ #ifdef __cplusplus
642
+ }
643
+ #endif
644
+ #endif /* __XML_PARSER_INTERNALS_H__ */