nokogiri 1.10.10-java → 1.11.0-java

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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1015 -947
  4. data/README.md +165 -91
  5. data/ext/java/nokogiri/HtmlDocument.java +34 -46
  6. data/ext/java/nokogiri/HtmlSaxParserContext.java +88 -58
  7. data/ext/java/nokogiri/HtmlSaxPushParser.java +1 -1
  8. data/ext/java/nokogiri/NokogiriService.java +1 -1
  9. data/ext/java/nokogiri/XmlAttr.java +13 -20
  10. data/ext/java/nokogiri/XmlAttributeDecl.java +11 -12
  11. data/ext/java/nokogiri/XmlCdata.java +3 -4
  12. data/ext/java/nokogiri/XmlComment.java +1 -1
  13. data/ext/java/nokogiri/XmlDocument.java +148 -175
  14. data/ext/java/nokogiri/XmlDocumentFragment.java +13 -31
  15. data/ext/java/nokogiri/XmlDtd.java +5 -8
  16. data/ext/java/nokogiri/XmlElement.java +1 -20
  17. data/ext/java/nokogiri/XmlElementDecl.java +23 -28
  18. data/ext/java/nokogiri/XmlEntityDecl.java +23 -27
  19. data/ext/java/nokogiri/XmlEntityReference.java +2 -2
  20. data/ext/java/nokogiri/XmlNamespace.java +72 -89
  21. data/ext/java/nokogiri/XmlNode.java +303 -406
  22. data/ext/java/nokogiri/XmlNodeSet.java +70 -76
  23. data/ext/java/nokogiri/XmlReader.java +12 -13
  24. data/ext/java/nokogiri/XmlRelaxng.java +10 -3
  25. data/ext/java/nokogiri/XmlSaxParserContext.java +15 -10
  26. data/ext/java/nokogiri/XmlSchema.java +87 -27
  27. data/ext/java/nokogiri/XmlSyntaxError.java +2 -6
  28. data/ext/java/nokogiri/XmlText.java +12 -9
  29. data/ext/java/nokogiri/XmlXpathContext.java +55 -25
  30. data/ext/java/nokogiri/XsltStylesheet.java +7 -15
  31. data/ext/java/nokogiri/internals/HtmlDomParserContext.java +52 -46
  32. data/ext/java/nokogiri/internals/NokogiriHandler.java +1 -1
  33. data/ext/java/nokogiri/internals/NokogiriHelpers.java +71 -135
  34. data/ext/java/nokogiri/internals/NokogiriNamespaceCache.java +90 -58
  35. data/ext/java/nokogiri/internals/NokogiriNamespaceContext.java +9 -2
  36. data/ext/java/nokogiri/internals/NokogiriXPathFunction.java +67 -10
  37. data/ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java +4 -2
  38. data/ext/java/nokogiri/internals/ParserContext.java +27 -73
  39. data/ext/java/nokogiri/internals/ReaderNode.java +2 -4
  40. data/ext/java/nokogiri/internals/XmlDomParserContext.java +18 -33
  41. data/ext/nokogiri/depend +476 -357
  42. data/ext/nokogiri/extconf.rb +507 -357
  43. data/ext/nokogiri/html_document.c +79 -78
  44. data/ext/nokogiri/html_sax_parser_context.c +2 -2
  45. data/ext/nokogiri/nokogiri.c +34 -40
  46. data/ext/nokogiri/xml_document.c +18 -4
  47. data/ext/nokogiri/xml_io.c +8 -6
  48. data/ext/nokogiri/xml_node.c +21 -1
  49. data/ext/nokogiri/xml_node_set.c +1 -1
  50. data/ext/nokogiri/xml_reader.c +6 -17
  51. data/ext/nokogiri/xml_relax_ng.c +29 -11
  52. data/ext/nokogiri/xml_sax_parser.c +2 -7
  53. data/ext/nokogiri/xml_sax_parser_context.c +2 -2
  54. data/ext/nokogiri/xml_schema.c +55 -13
  55. data/ext/nokogiri/xml_xpath_context.c +80 -4
  56. data/ext/nokogiri/xslt_stylesheet.c +1 -8
  57. data/lib/nokogiri.rb +22 -22
  58. data/lib/nokogiri/css.rb +1 -0
  59. data/lib/nokogiri/css/node.rb +1 -0
  60. data/lib/nokogiri/css/parser.rb +63 -62
  61. data/lib/nokogiri/css/parser.y +2 -2
  62. data/lib/nokogiri/css/parser_extras.rb +39 -36
  63. data/lib/nokogiri/css/syntax_error.rb +1 -0
  64. data/lib/nokogiri/css/tokenizer.rb +1 -0
  65. data/lib/nokogiri/css/xpath_visitor.rb +73 -43
  66. data/lib/nokogiri/decorators/slop.rb +1 -0
  67. data/lib/nokogiri/html.rb +1 -0
  68. data/lib/nokogiri/html/builder.rb +1 -0
  69. data/lib/nokogiri/html/document.rb +13 -26
  70. data/lib/nokogiri/html/document_fragment.rb +1 -0
  71. data/lib/nokogiri/html/element_description.rb +1 -0
  72. data/lib/nokogiri/html/element_description_defaults.rb +1 -0
  73. data/lib/nokogiri/html/entity_lookup.rb +1 -0
  74. data/lib/nokogiri/html/sax/parser.rb +1 -0
  75. data/lib/nokogiri/html/sax/parser_context.rb +1 -0
  76. data/lib/nokogiri/html/sax/push_parser.rb +1 -0
  77. data/lib/nokogiri/jruby/dependencies.rb +20 -0
  78. data/lib/nokogiri/nokogiri.jar +0 -0
  79. data/lib/nokogiri/syntax_error.rb +1 -0
  80. data/lib/nokogiri/version.rb +3 -109
  81. data/lib/nokogiri/version/constant.rb +5 -0
  82. data/lib/nokogiri/version/info.rb +182 -0
  83. data/lib/nokogiri/xml.rb +1 -0
  84. data/lib/nokogiri/xml/attr.rb +1 -0
  85. data/lib/nokogiri/xml/attribute_decl.rb +1 -0
  86. data/lib/nokogiri/xml/builder.rb +3 -2
  87. data/lib/nokogiri/xml/cdata.rb +1 -0
  88. data/lib/nokogiri/xml/character_data.rb +1 -0
  89. data/lib/nokogiri/xml/document.rb +20 -15
  90. data/lib/nokogiri/xml/document_fragment.rb +5 -6
  91. data/lib/nokogiri/xml/dtd.rb +1 -0
  92. data/lib/nokogiri/xml/element_content.rb +1 -0
  93. data/lib/nokogiri/xml/element_decl.rb +1 -0
  94. data/lib/nokogiri/xml/entity_decl.rb +1 -0
  95. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  96. data/lib/nokogiri/xml/namespace.rb +1 -0
  97. data/lib/nokogiri/xml/node.rb +587 -249
  98. data/lib/nokogiri/xml/node/save_options.rb +1 -0
  99. data/lib/nokogiri/xml/node_set.rb +1 -0
  100. data/lib/nokogiri/xml/notation.rb +1 -0
  101. data/lib/nokogiri/xml/parse_options.rb +10 -3
  102. data/lib/nokogiri/xml/pp.rb +1 -0
  103. data/lib/nokogiri/xml/pp/character_data.rb +1 -0
  104. data/lib/nokogiri/xml/pp/node.rb +1 -0
  105. data/lib/nokogiri/xml/processing_instruction.rb +1 -0
  106. data/lib/nokogiri/xml/reader.rb +7 -3
  107. data/lib/nokogiri/xml/relax_ng.rb +7 -2
  108. data/lib/nokogiri/xml/sax.rb +1 -0
  109. data/lib/nokogiri/xml/sax/document.rb +1 -0
  110. data/lib/nokogiri/xml/sax/parser.rb +1 -0
  111. data/lib/nokogiri/xml/sax/parser_context.rb +1 -0
  112. data/lib/nokogiri/xml/sax/push_parser.rb +1 -0
  113. data/lib/nokogiri/xml/schema.rb +13 -4
  114. data/lib/nokogiri/xml/searchable.rb +25 -16
  115. data/lib/nokogiri/xml/syntax_error.rb +1 -0
  116. data/lib/nokogiri/xml/text.rb +1 -0
  117. data/lib/nokogiri/xml/xpath.rb +1 -0
  118. data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -0
  119. data/lib/nokogiri/xml/xpath_context.rb +1 -0
  120. data/lib/nokogiri/xslt.rb +1 -0
  121. data/lib/nokogiri/xslt/stylesheet.rb +1 -0
  122. data/lib/xsd/xmlparser/nokogiri.rb +1 -0
  123. metadata +86 -159
  124. data/ext/java/nokogiri/internals/NokogiriEncodingReaderWrapper.java +0 -107
  125. data/ext/java/nokogiri/internals/UncloseableInputStream.java +0 -102
  126. data/ext/nokogiri/html_document.h +0 -10
  127. data/ext/nokogiri/html_element_description.h +0 -10
  128. data/ext/nokogiri/html_entity_lookup.h +0 -8
  129. data/ext/nokogiri/html_sax_parser_context.h +0 -11
  130. data/ext/nokogiri/html_sax_push_parser.h +0 -9
  131. data/ext/nokogiri/nokogiri.h +0 -121
  132. data/ext/nokogiri/xml_attr.h +0 -9
  133. data/ext/nokogiri/xml_attribute_decl.h +0 -9
  134. data/ext/nokogiri/xml_cdata.h +0 -9
  135. data/ext/nokogiri/xml_comment.h +0 -9
  136. data/ext/nokogiri/xml_document.h +0 -23
  137. data/ext/nokogiri/xml_document_fragment.h +0 -10
  138. data/ext/nokogiri/xml_dtd.h +0 -10
  139. data/ext/nokogiri/xml_element_content.h +0 -10
  140. data/ext/nokogiri/xml_element_decl.h +0 -9
  141. data/ext/nokogiri/xml_encoding_handler.h +0 -8
  142. data/ext/nokogiri/xml_entity_decl.h +0 -10
  143. data/ext/nokogiri/xml_entity_reference.h +0 -9
  144. data/ext/nokogiri/xml_io.h +0 -11
  145. data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
  146. data/ext/nokogiri/xml_namespace.h +0 -14
  147. data/ext/nokogiri/xml_node.h +0 -13
  148. data/ext/nokogiri/xml_node_set.h +0 -12
  149. data/ext/nokogiri/xml_processing_instruction.h +0 -9
  150. data/ext/nokogiri/xml_reader.h +0 -10
  151. data/ext/nokogiri/xml_relax_ng.h +0 -9
  152. data/ext/nokogiri/xml_sax_parser.h +0 -39
  153. data/ext/nokogiri/xml_sax_parser_context.h +0 -10
  154. data/ext/nokogiri/xml_sax_push_parser.h +0 -9
  155. data/ext/nokogiri/xml_schema.h +0 -9
  156. data/ext/nokogiri/xml_syntax_error.h +0 -13
  157. data/ext/nokogiri/xml_text.h +0 -9
  158. data/ext/nokogiri/xml_xpath_context.h +0 -10
  159. data/ext/nokogiri/xslt_stylesheet.h +0 -14
@@ -1,107 +0,0 @@
1
- package nokogiri.internals;
2
-
3
- import java.io.InputStream;
4
-
5
- import org.jruby.Ruby;
6
- import org.jruby.RubyObject;
7
- import org.jruby.exceptions.RaiseException;
8
- import org.jruby.runtime.Helpers;
9
- import org.jruby.runtime.ThreadContext;
10
- import org.jruby.runtime.builtin.IRubyObject;
11
- import org.jruby.util.ByteList;
12
-
13
- /**
14
- * This class wraps the EncodingReader which act like a rewinding input stream,
15
- * it tries to read the first 1K of data to detect the encoding, but save
16
- * this data in a buffer for the subsequent read. Unfortunately, the EncodingReader
17
- * will behave as expected only if encoding was detected, otherwise, the read data
18
- * won't be stored and EncodingReader will fallback to read directory from the io stream.
19
- * this is kind of lame, since we need to have similar logic in both layers. The alternative
20
- * is to implement the encoding detection similar to the way C-Nokogiri does it; it starts
21
- * parsing assuming encoding is unknown and if encoding is detected it will throw an exception
22
- * causing parsing to stop, in which case we have to intercept the exception and set the encoding.
23
- * Also in this case we don't have to restart the parsing since html/document.rb does that for us.
24
- *
25
- * @author John Shahid <jvshahid@gmail.com>
26
- *
27
- */
28
- public class NokogiriEncodingReaderWrapper extends InputStream {
29
- private final ThreadContext context;
30
- private final IRubyObject encodingReader;
31
- private final Ruby ruby;
32
- private IRubyObject detectedEncoding;
33
- private final byte[] firstChunk = new byte[1024];
34
- private int firstChunkOff = 0;
35
- private int firstChunkLength = 0;
36
-
37
- public NokogiriEncodingReaderWrapper(ThreadContext context, RubyObject encodingReader) {
38
- this.context = context;
39
- this.encodingReader = encodingReader;
40
- this.ruby = context.getRuntime();
41
-
42
- if (!Helpers.invoke(context, encodingReader, "respond_to?", ruby.newSymbol("read")).isTrue()
43
- || encodingReader.getInstanceVariable("@io") == null) {
44
- throw ruby.newArgumentError("Argument doesn't respond to read or doesn't have instance variable @io");
45
- }
46
- }
47
-
48
- public boolean detectEncoding() {
49
- try {
50
- firstChunkLength = read(firstChunk);
51
- } catch (RaiseException e) {
52
- detectedEncoding = e.getException().getInstanceVariable("@found_encoding");
53
- return true;
54
- }
55
- detectedEncoding = context.nil;
56
- return false;
57
- }
58
-
59
- public IRubyObject getEncoding() {
60
- return detectedEncoding;
61
- }
62
-
63
- @Override
64
- public int read(byte b[]) {
65
- return read(b, 0, b.length);
66
- }
67
-
68
- @Override
69
- public int read(byte b[], int off, int len) {
70
- if (b == null) {
71
- throw new NullPointerException();
72
- } else if (off < 0 || len < 0 || len > b.length - off) {
73
- throw new IndexOutOfBoundsException();
74
- } else if (len == 0) {
75
- return 0;
76
- }
77
-
78
- int copyLength = Math.min(firstChunkLength - firstChunkOff, len);
79
- if (copyLength > 0) {
80
- System.arraycopy(firstChunk, firstChunkOff, b, off, copyLength);
81
- len -= copyLength;
82
- firstChunkOff += copyLength;
83
- }
84
-
85
- if (len <= 0)
86
- return copyLength;
87
-
88
- IRubyObject returnValue = encodingReader.callMethod(context, "read", ruby.newFixnum(len));
89
- if (returnValue.isNil())
90
- return -1;
91
-
92
- ByteList bytes = returnValue.asString().getByteList();
93
- int length = bytes.length();
94
- System.arraycopy(bytes.unsafeBytes(), bytes.getBegin(), b, off + copyLength, length);
95
- return length + copyLength;
96
- }
97
-
98
- @Override
99
- public int read() {
100
- byte[] bytes = new byte[1];
101
- int count = read(bytes, 0, 1);
102
- if (count < 1)
103
- return count;
104
- return bytes[0];
105
- }
106
-
107
- }
@@ -1,102 +0,0 @@
1
- /**
2
- * (The MIT License)
3
- *
4
- * Copyright (c) 2008 - 2012:
5
- *
6
- * * {Aaron Patterson}[http://tenderlovemaking.com]
7
- * * {Mike Dalessio}[http://mike.daless.io]
8
- * * {Charles Nutter}[http://blog.headius.com]
9
- * * {Sergio Arbeo}[http://www.serabe.com]
10
- * * {Patrick Mahoney}[http://polycrystal.org]
11
- * * {Yoko Harada}[http://yokolet.blogspot.com]
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining
14
- * a copy of this software and associated documentation files (the
15
- * 'Software'), to deal in the Software without restriction, including
16
- * without limitation the rights to use, copy, modify, merge, publish,
17
- * distribute, sublicense, and/or sell copies of the Software, and to
18
- * permit persons to whom the Software is furnished to do so, subject to
19
- * the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be
22
- * included in all copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
25
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
27
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
28
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
- */
32
-
33
- package nokogiri.internals;
34
-
35
- import java.io.IOException;
36
- import java.io.InputStream;
37
-
38
- /**
39
- * Delegates all the methods to another InputStream except the
40
- * close() method, which is ignored. This is used to fix #495.
41
- *
42
- * @author John Shahid <jvshahid@gmail.com>
43
- */
44
- public class UncloseableInputStream extends InputStream {
45
- private final InputStream delegate;
46
-
47
- /**
48
- * Create a new uncloseable stream.
49
- *
50
- * @param delegate The InputStream to which all methods (except close)
51
- * will be delegated.
52
- */
53
- public UncloseableInputStream(InputStream delegate) {
54
- this.delegate = delegate;
55
- }
56
-
57
- @Override
58
- public int read() throws IOException {
59
- return delegate.read();
60
- }
61
-
62
- @Override
63
- public int read(byte []b) throws IOException {
64
- return delegate.read(b);
65
- }
66
-
67
- @Override
68
- public int read(byte []b, int offset, int len) throws IOException {
69
- return delegate.read(b, offset, len);
70
- }
71
-
72
- @Override
73
- public long skip(long n) throws IOException {
74
- return delegate.skip(n);
75
- }
76
-
77
- @Override
78
- public int available() throws IOException {
79
- return delegate.available();
80
- }
81
-
82
- @Override
83
- public void close() {
84
- // don't forward this to the InputStream we're delegating from
85
- // we don't want the InputStream of the RubyIO to be closed
86
- }
87
-
88
- @Override
89
- public void mark(int readlimit) {
90
- delegate.mark(readlimit);
91
- }
92
-
93
- @Override
94
- public void reset() throws IOException {
95
- delegate.reset();
96
- }
97
-
98
- @Override
99
- public boolean markSupported() {
100
- return delegate.markSupported();
101
- }
102
- }
@@ -1,10 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_DOCUMENT
2
- #define NOKOGIRI_HTML_DOCUMENT
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_html_document();
7
-
8
- extern VALUE cNokogiriHtmlDocument ;
9
-
10
- #endif
@@ -1,10 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_ELEMENT_DESCRIPTION
2
- #define NOKOGIRI_HTML_ELEMENT_DESCRIPTION
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_html_element_description();
7
-
8
- extern VALUE cNokogiriHtmlElementDescription ;
9
-
10
- #endif
@@ -1,8 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_ENTITY_LOOKUP
2
- #define NOKOGIRI_HTML_ENTITY_LOOKUP
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_html_entity_lookup();
7
-
8
- #endif
@@ -1,11 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_SAX_PARSER_CONTEXT
2
- #define NOKOGIRI_HTML_SAX_PARSER_CONTEXT
3
-
4
- #include <nokogiri.h>
5
-
6
- extern VALUE cNokogiriHtmlSaxParserContext;
7
-
8
- void init_html_sax_parser_context();
9
-
10
- #endif
11
-
@@ -1,9 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_SAX_PUSH_PARSER
2
- #define NOKOGIRI_HTML_SAX_PUSH_PARSER
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_html_sax_push_parser();
7
-
8
- extern VALUE cNokogiriHtmlSaxPushParser ;
9
- #endif
@@ -1,121 +0,0 @@
1
- #ifndef NOKOGIRI_NATIVE
2
- #define NOKOGIRI_NATIVE
3
-
4
- #include <stdlib.h>
5
- #include <string.h>
6
- #include <assert.h>
7
- #include <stdarg.h>
8
-
9
- #ifdef USE_INCLUDED_VASPRINTF
10
- int vasprintf (char **strp, const char *fmt, va_list ap);
11
- #else
12
-
13
- #define _GNU_SOURCE
14
- # include <stdio.h>
15
- #undef _GNU_SOURCE
16
-
17
- #endif
18
-
19
- #include <libxml/parser.h>
20
- #include <libxml/entities.h>
21
- #include <libxml/parserInternals.h>
22
- #include <libxml/xpath.h>
23
- #include <libxml/xpathInternals.h>
24
- #include <libxml/xmlreader.h>
25
- #include <libxml/xmlsave.h>
26
- #include <libxml/xmlschemas.h>
27
- #include <libxml/HTMLparser.h>
28
- #include <libxml/HTMLtree.h>
29
- #include <libxml/relaxng.h>
30
- #include <libxml/xinclude.h>
31
- #include <libxslt/extensions.h>
32
- #include <libxml/c14n.h>
33
- #include <ruby.h>
34
- #include <ruby/st.h>
35
- #include <ruby/encoding.h>
36
-
37
- #ifndef NORETURN
38
- # if defined(__GNUC__)
39
- # define NORETURN(name) __attribute__((noreturn)) name
40
- # else
41
- # define NORETURN(name) name
42
- # endif
43
- #endif
44
-
45
- #define NOKOGIRI_STR_NEW2(str) \
46
- NOKOGIRI_STR_NEW(str, strlen((const char *)(str)))
47
-
48
- #define NOKOGIRI_STR_NEW(str, len) \
49
- rb_external_str_new_with_enc((const char *)(str), (long)(len), rb_utf8_encoding())
50
-
51
- #define RBSTR_OR_QNIL(_str) \
52
- (_str ? NOKOGIRI_STR_NEW2(_str) : Qnil)
53
-
54
- #include <xml_libxml2_hacks.h>
55
-
56
- #include <xml_io.h>
57
- #include <xml_document.h>
58
- #include <html_entity_lookup.h>
59
- #include <html_document.h>
60
- #include <xml_node.h>
61
- #include <xml_text.h>
62
- #include <xml_cdata.h>
63
- #include <xml_attr.h>
64
- #include <xml_processing_instruction.h>
65
- #include <xml_entity_reference.h>
66
- #include <xml_document_fragment.h>
67
- #include <xml_comment.h>
68
- #include <xml_node_set.h>
69
- #include <xml_dtd.h>
70
- #include <xml_attribute_decl.h>
71
- #include <xml_element_decl.h>
72
- #include <xml_entity_decl.h>
73
- #include <xml_xpath_context.h>
74
- #include <xml_element_content.h>
75
- #include <xml_sax_parser_context.h>
76
- #include <xml_sax_parser.h>
77
- #include <xml_sax_push_parser.h>
78
- #include <xml_reader.h>
79
- #include <html_sax_parser_context.h>
80
- #include <html_sax_push_parser.h>
81
- #include <xslt_stylesheet.h>
82
- #include <xml_syntax_error.h>
83
- #include <xml_schema.h>
84
- #include <xml_relax_ng.h>
85
- #include <html_element_description.h>
86
- #include <xml_namespace.h>
87
- #include <xml_encoding_handler.h>
88
-
89
- extern VALUE mNokogiri ;
90
- extern VALUE mNokogiriXml ;
91
- extern VALUE mNokogiriXmlSax ;
92
- extern VALUE mNokogiriHtml ;
93
- extern VALUE mNokogiriHtmlSax ;
94
- extern VALUE mNokogiriXslt ;
95
-
96
- void nokogiri_root_node(xmlNodePtr);
97
- void nokogiri_root_nsdef(xmlNsPtr, xmlDocPtr);
98
-
99
- #ifdef DEBUG
100
-
101
- #define NOKOGIRI_DEBUG_START(p) if (getenv("NOKOGIRI_NO_FREE")) return ; if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p start\n", __FILE__, __LINE__, p);
102
- #define NOKOGIRI_DEBUG_END(p) if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p end\n", __FILE__, __LINE__, p);
103
-
104
- #else
105
-
106
- #define NOKOGIRI_DEBUG_START(p)
107
- #define NOKOGIRI_DEBUG_END(p)
108
-
109
- #endif
110
-
111
- #ifndef __builtin_expect
112
- # if defined(__GNUC__)
113
- # define __builtin_expect(expr, c) __builtin_expect((long)(expr), (long)(c))
114
- # endif
115
- #endif
116
-
117
- #define XMLNS_PREFIX "xmlns"
118
- #define XMLNS_PREFIX_LEN 6 /* including either colon or \0 */
119
- #define XMLNS_BUFFER_LEN 128
120
-
121
- #endif
@@ -1,9 +0,0 @@
1
- #ifndef NOKOGIRI_XML_ATTR
2
- #define NOKOGIRI_XML_ATTR
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_xml_attr();
7
-
8
- extern VALUE cNokogiriXmlAttr;
9
- #endif
@@ -1,9 +0,0 @@
1
- #ifndef NOKOGIRI_XML_ATTRIBUTE_DECL
2
- #define NOKOGIRI_XML_ATTRIBUTE_DECL
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_xml_attribute_decl();
7
-
8
- extern VALUE cNokogiriXmlAttributeDecl;
9
- #endif
@@ -1,9 +0,0 @@
1
- #ifndef NOKOGIRI_XML_CDATA
2
- #define NOKOGIRI_XML_CDATA
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_xml_cdata();
7
-
8
- extern VALUE cNokogiriXmlCData;
9
- #endif
@@ -1,9 +0,0 @@
1
- #ifndef NOKOGIRI_XML_COMMENT
2
- #define NOKOGIRI_XML_COMMENT
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_xml_comment();
7
-
8
- extern VALUE cNokogiriXmlComment;
9
- #endif
@@ -1,23 +0,0 @@
1
- #ifndef NOKOGIRI_XML_DOCUMENT
2
- #define NOKOGIRI_XML_DOCUMENT
3
-
4
- #include <nokogiri.h>
5
-
6
- struct _nokogiriTuple {
7
- VALUE doc;
8
- st_table *unlinkedNodes;
9
- VALUE node_cache;
10
- };
11
- typedef struct _nokogiriTuple nokogiriTuple;
12
- typedef nokogiriTuple * nokogiriTuplePtr;
13
-
14
- void init_xml_document();
15
- VALUE Nokogiri_wrap_xml_document(VALUE klass, xmlDocPtr doc);
16
-
17
- #define DOC_RUBY_OBJECT_TEST(x) ((nokogiriTuplePtr)(x->_private))
18
- #define DOC_RUBY_OBJECT(x) (((nokogiriTuplePtr)(x->_private))->doc)
19
- #define DOC_UNLINKED_NODE_HASH(x) (((nokogiriTuplePtr)(x->_private))->unlinkedNodes)
20
- #define DOC_NODE_CACHE(x) (((nokogiriTuplePtr)(x->_private))->node_cache)
21
-
22
- extern VALUE cNokogiriXmlDocument ;
23
- #endif