libxml-ruby 0.8.3-x86-mswin32-60 → 0.9.0-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. data/CHANGES +18 -0
  2. data/RAKEFILE +15 -39
  3. data/README +48 -47
  4. data/ext/libxml/libxml.c +847 -22
  5. data/ext/libxml/ruby_libxml.h +71 -95
  6. data/ext/libxml/ruby_xml_attr.c +500 -500
  7. data/ext/libxml/ruby_xml_attributes.c +1 -1
  8. data/ext/libxml/ruby_xml_document.c +1144 -1135
  9. data/ext/libxml/ruby_xml_document.h +4 -11
  10. data/ext/libxml/ruby_xml_dtd.c +27 -0
  11. data/ext/libxml/ruby_xml_encoding.c +164 -0
  12. data/ext/libxml/ruby_xml_encoding.h +13 -0
  13. data/ext/libxml/ruby_xml_error.c +941 -0
  14. data/ext/libxml/ruby_xml_error.h +13 -0
  15. data/ext/libxml/ruby_xml_html_parser.c +71 -387
  16. data/ext/libxml/ruby_xml_html_parser.h +1 -17
  17. data/ext/libxml/ruby_xml_input.c +179 -0
  18. data/ext/libxml/ruby_xml_input.h +18 -0
  19. data/ext/libxml/ruby_xml_input_cbg.c +17 -3
  20. data/ext/libxml/ruby_xml_node.c +1566 -1582
  21. data/ext/libxml/ruby_xml_node.h +1 -4
  22. data/ext/libxml/ruby_xml_ns.c +14 -3
  23. data/ext/libxml/ruby_xml_parser.c +164 -1398
  24. data/ext/libxml/ruby_xml_parser.h +5 -17
  25. data/ext/libxml/ruby_xml_parser_context.c +131 -169
  26. data/ext/libxml/ruby_xml_parser_context.h +2 -9
  27. data/ext/libxml/ruby_xml_reader.c +910 -945
  28. data/ext/libxml/ruby_xml_relaxng.c +32 -3
  29. data/ext/libxml/ruby_xml_sax_parser.c +106 -364
  30. data/ext/libxml/ruby_xml_sax_parser.h +1 -37
  31. data/ext/libxml/ruby_xml_schema.c +174 -145
  32. data/ext/libxml/ruby_xml_xinclude.c +9 -5
  33. data/ext/libxml/ruby_xml_xpath.c +25 -6
  34. data/ext/libxml/ruby_xml_xpath.h +1 -2
  35. data/ext/libxml/ruby_xml_xpath_context.c +17 -19
  36. data/ext/libxml/ruby_xml_xpath_object.c +60 -56
  37. data/ext/libxml/ruby_xml_xpointer.c +11 -5
  38. data/ext/libxml/sax_parser_callbacks.inc +42 -37
  39. data/ext/libxml/version.h +3 -3
  40. data/ext/mingw/Rakefile +20 -27
  41. data/ext/mingw/build.rake +41 -0
  42. data/{lib → ext/mingw}/libiconv-2.dll +0 -0
  43. data/ext/mingw/libxml2-2.dll +0 -0
  44. data/ext/mingw/libxml_ruby.dll.a +0 -0
  45. data/ext/mingw/libxml_ruby.so +0 -0
  46. data/ext/vc/libxml_ruby.vcproj +23 -15
  47. data/lib/libxml.rb +8 -2
  48. data/lib/libxml/document.rb +16 -4
  49. data/lib/libxml/error.rb +84 -0
  50. data/lib/libxml/hpricot.rb +76 -0
  51. data/lib/libxml/html_parser.rb +61 -0
  52. data/lib/libxml/node.rb +36 -25
  53. data/lib/libxml/parser.rb +312 -33
  54. data/lib/libxml/parser_context.rb +17 -0
  55. data/lib/libxml/properties.rb +15 -2
  56. data/lib/libxml/reader.rb +15 -0
  57. data/lib/libxml/sax_callbacks.rb +179 -0
  58. data/lib/libxml/sax_parser.rb +42 -0
  59. data/lib/libxml/tree.rb +1 -2
  60. data/lib/libxml/xpath_object.rb +12 -0
  61. data/test/model/atom.xml +4 -0
  62. data/test/tc_attributes.rb +43 -19
  63. data/test/tc_document.rb +1 -1
  64. data/test/tc_document_write.rb +15 -8
  65. data/test/tc_dtd.rb +36 -20
  66. data/test/tc_encoding.rb +13 -0
  67. data/test/tc_error.rb +136 -0
  68. data/test/tc_node.rb +2 -3
  69. data/test/tc_node_copy.rb +1 -1
  70. data/test/tc_node_edit.rb +6 -0
  71. data/test/tc_ns.rb +18 -0
  72. data/test/tc_parser.rb +113 -228
  73. data/test/tc_parser_context.rb +1 -2
  74. data/test/tc_reader.rb +24 -14
  75. data/test/tc_relaxng.rb +18 -6
  76. data/test/tc_sax_parser.rb +48 -13
  77. data/test/tc_schema.rb +20 -8
  78. data/test/tc_well_formed.rb +2 -1
  79. data/test/tc_xml.rb +212 -0
  80. data/test/tc_xpath.rb +60 -46
  81. data/test/tc_xpointer.rb +7 -11
  82. data/test/test_suite.rb +4 -3
  83. metadata +32 -115
  84. data/doc/rdoc/classes/LibXML.html +0 -241
  85. data/doc/rdoc/classes/LibXML/XML.html +0 -185
  86. data/doc/rdoc/classes/LibXML/XML/Attr.html +0 -1010
  87. data/doc/rdoc/classes/LibXML/XML/Attributes.html +0 -526
  88. data/doc/rdoc/classes/LibXML/XML/Document.html +0 -1489
  89. data/doc/rdoc/classes/LibXML/XML/Dtd.html +0 -213
  90. data/doc/rdoc/classes/LibXML/XML/Error.html +0 -117
  91. data/doc/rdoc/classes/LibXML/XML/HTMLParser.html +0 -348
  92. data/doc/rdoc/classes/LibXML/XML/InputCallbacks.html +0 -160
  93. data/doc/rdoc/classes/LibXML/XML/NS.html +0 -381
  94. data/doc/rdoc/classes/LibXML/XML/Node.html +0 -3396
  95. data/doc/rdoc/classes/LibXML/XML/Node/FailedModify.html +0 -123
  96. data/doc/rdoc/classes/LibXML/XML/Node/Set.html +0 -440
  97. data/doc/rdoc/classes/LibXML/XML/Node/SetNamespace.html +0 -123
  98. data/doc/rdoc/classes/LibXML/XML/Node/UnknownType.html +0 -123
  99. data/doc/rdoc/classes/LibXML/XML/Parser.html +0 -2239
  100. data/doc/rdoc/classes/LibXML/XML/Parser/Context.html +0 -1255
  101. data/doc/rdoc/classes/LibXML/XML/Parser/ParseError.html +0 -123
  102. data/doc/rdoc/classes/LibXML/XML/Reader.html +0 -2264
  103. data/doc/rdoc/classes/LibXML/XML/RelaxNG.html +0 -237
  104. data/doc/rdoc/classes/LibXML/XML/SaxParser.html +0 -415
  105. data/doc/rdoc/classes/LibXML/XML/Schema.html +0 -308
  106. data/doc/rdoc/classes/LibXML/XML/State.html +0 -124
  107. data/doc/rdoc/classes/LibXML/XML/Tree.html +0 -111
  108. data/doc/rdoc/classes/LibXML/XML/XInclude.html +0 -123
  109. data/doc/rdoc/classes/LibXML/XML/XInclude/Error.html +0 -117
  110. data/doc/rdoc/classes/LibXML/XML/XMLParserOptions.html +0 -198
  111. data/doc/rdoc/classes/LibXML/XML/XPath.html +0 -184
  112. data/doc/rdoc/classes/LibXML/XML/XPath/Context.html +0 -404
  113. data/doc/rdoc/classes/LibXML/XML/XPath/InvalidPath.html +0 -172
  114. data/doc/rdoc/classes/LibXML/XML/XPath/Object.html +0 -627
  115. data/doc/rdoc/classes/LibXML/XML/XPointer.html +0 -170
  116. data/doc/rdoc/classes/LibXML/XML/XPointer/Context.html +0 -123
  117. data/doc/rdoc/classes/LibXML/XML/XPointer/Context/InvalidPath.html +0 -117
  118. data/doc/rdoc/classes/LibXML/XML/XPointer/InvalidExpression.html +0 -124
  119. data/doc/rdoc/classes/singleton.html +0 -114
  120. data/doc/rdoc/created.rid +0 -1
  121. data/doc/rdoc/files/CHANGES.html +0 -442
  122. data/doc/rdoc/files/LICENSE.html +0 -133
  123. data/doc/rdoc/files/README.html +0 -388
  124. data/doc/rdoc/files/VERSION.html +0 -107
  125. data/doc/rdoc/files/ext/libxml/cbg_c.html +0 -101
  126. data/doc/rdoc/files/ext/libxml/libxml_c.html +0 -101
  127. data/doc/rdoc/files/ext/libxml/ruby_xml_attr_c.html +0 -101
  128. data/doc/rdoc/files/ext/libxml/ruby_xml_attributes_c.html +0 -101
  129. data/doc/rdoc/files/ext/libxml/ruby_xml_document_c.html +0 -101
  130. data/doc/rdoc/files/ext/libxml/ruby_xml_dtd_c.html +0 -101
  131. data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_c.html +0 -101
  132. data/doc/rdoc/files/ext/libxml/ruby_xml_input_cbg_c.html +0 -101
  133. data/doc/rdoc/files/ext/libxml/ruby_xml_node_c.html +0 -101
  134. data/doc/rdoc/files/ext/libxml/ruby_xml_node_set_c.html +0 -101
  135. data/doc/rdoc/files/ext/libxml/ruby_xml_ns_c.html +0 -101
  136. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_c.html +0 -101
  137. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_context_c.html +0 -101
  138. data/doc/rdoc/files/ext/libxml/ruby_xml_reader_c.html +0 -101
  139. data/doc/rdoc/files/ext/libxml/ruby_xml_relaxng_c.html +0 -101
  140. data/doc/rdoc/files/ext/libxml/ruby_xml_sax_parser_c.html +0 -101
  141. data/doc/rdoc/files/ext/libxml/ruby_xml_schema_c.html +0 -101
  142. data/doc/rdoc/files/ext/libxml/ruby_xml_state_c.html +0 -101
  143. data/doc/rdoc/files/ext/libxml/ruby_xml_xinclude_c.html +0 -101
  144. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_c.html +0 -101
  145. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_context_c.html +0 -101
  146. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_object_c.html +0 -101
  147. data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_c.html +0 -101
  148. data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_context_c.html +0 -101
  149. data/doc/rdoc/files/lib/libxml/attr_rb.html +0 -108
  150. data/doc/rdoc/files/lib/libxml/attributes_rb.html +0 -108
  151. data/doc/rdoc/files/lib/libxml/document_rb.html +0 -108
  152. data/doc/rdoc/files/lib/libxml/node_rb.html +0 -108
  153. data/doc/rdoc/files/lib/libxml/node_set_rb.html +0 -108
  154. data/doc/rdoc/files/lib/libxml/parser_options_rb.html +0 -107
  155. data/doc/rdoc/files/lib/libxml/parser_rb.html +0 -101
  156. data/doc/rdoc/files/lib/libxml/properties_rb.html +0 -108
  157. data/doc/rdoc/files/lib/libxml/tree_rb.html +0 -107
  158. data/doc/rdoc/files/lib/libxml_rb.html +0 -124
  159. data/doc/rdoc/files/lib/xml/libxml_rb.html +0 -124
  160. data/doc/rdoc/files/lib/xml_rb.html +0 -134
  161. data/doc/rdoc/fr_class_index.html +0 -62
  162. data/doc/rdoc/fr_file_index.html +0 -66
  163. data/doc/rdoc/fr_method_index.html +0 -392
  164. data/doc/rdoc/index.html +0 -24
  165. data/doc/rdoc/rdoc-style.css +0 -208
  166. data/ext/libxml/ruby_xml_node_set.c +0 -172
  167. data/ext/libxml/ruby_xml_node_set.h +0 -20
  168. data/ext/libxml/ruby_xml_xpointer_context.c +0 -22
  169. data/ext/libxml/ruby_xml_xpointer_context.h +0 -18
  170. data/lib/libxml/node_set.rb +0 -27
  171. data/lib/libxml2-2.dll +0 -0
  172. data/lib/libxml_ruby.dll.a +0 -0
  173. data/lib/libxml_ruby.so +0 -0
  174. data/test/tc_node_set.rb +0 -24
  175. data/test/tc_node_set2.rb +0 -37
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_parser.h 39 2006-02-21 20:40:16Z roscopeco $ */
1
+ /* $Id: ruby_xml_parser.h 550 2008-11-17 23:26:53Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -7,25 +7,13 @@
7
7
 
8
8
  #define MAX_LIBXML_FEATURES_LEN 50
9
9
 
10
- extern int ruby_xml_parser_count;
10
+
11
11
  extern VALUE cXMLParser;
12
- extern VALUE eXMLParserParseError;
13
12
 
14
- typedef struct ruby_xml_parser {
15
- VALUE ctxt;
16
- int parsed;
17
- void *data;
18
- int data_type;
19
- } ruby_xml_parser;
13
+ void ruby_init_parser();
20
14
 
21
- VALUE ruby_xml_parser_default_load_external_dtd_set(VALUE class, VALUE bool);
22
15
  VALUE ruby_xml_parser_default_substitute_entities_set(VALUE class, VALUE bool);
23
- VALUE ruby_xml_parser_features(VALUE self);
24
- VALUE ruby_xml_parser_filename_get(VALUE self);
25
- VALUE ruby_xml_parser_filename_set(VALUE self, VALUE filename);
26
- VALUE ruby_xml_parser_new(VALUE class);
27
- VALUE ruby_xml_parser_parse(VALUE self);
28
- VALUE ruby_xml_parser_str_get(VALUE self);
29
- VALUE ruby_xml_parser_str_set(VALUE self, VALUE str);
16
+ VALUE ruby_xml_parser_default_load_external_dtd_set(VALUE class, VALUE bool);
17
+
30
18
 
31
19
  #endif
@@ -1,20 +1,30 @@
1
- /* $Id: ruby_xml_parser_context.c 461 2008-07-15 21:35:56Z cfis $ */
1
+ /* $Id: ruby_xml_parser_context.c 566 2008-11-18 06:53:36Z cfis $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
5
5
  #include "ruby_libxml.h"
6
6
  #include "ruby_xml_parser_context.h"
7
7
 
8
- /* TODO:
8
+ VALUE cXMLParserContext;
9
+
10
+ /*
11
+ * Document-class: LibXML::XML::Parser::Context
9
12
  *
10
- * *) xmlParserInput class/structure
11
- * *) errNo and mappings
12
- * *) validity context
13
- * *) record_info or stats class/structure
14
- * *) xmlParserNodeInfoSeq
15
- * *) xmlParserInputState
13
+ * The XML::Parser::Context class provides in-depth control over how
14
+ * a document is parsed.
16
15
  */
17
- VALUE cXMLParserContext;
16
+
17
+
18
+ void
19
+ ruby_xml_parser_context_free(xmlParserCtxtPtr ctxt) {
20
+ if (ctxt != NULL)
21
+ xmlFreeParserCtxt(ctxt);
22
+ }
23
+
24
+ VALUE
25
+ ruby_xml_parser_context_wrap(xmlParserCtxtPtr ctxt) {
26
+ return Data_Wrap_Struct(cXMLParserContext, NULL, ruby_xml_parser_context_free, ctxt);
27
+ }
18
28
 
19
29
  /*
20
30
  * call-seq:
@@ -24,13 +34,13 @@ VALUE cXMLParserContext;
24
34
  */
25
35
  VALUE
26
36
  ruby_xml_parser_context_data_directory_get(VALUE self) {
27
- ruby_xml_parser_context *rxpc;
28
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
37
+ xmlParserCtxtPtr ctxt;
38
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
29
39
 
30
- if (rxpc->ctxt->directory == NULL)
40
+ if (ctxt->directory == NULL)
31
41
  return(Qnil);
32
42
  else
33
- return(rb_str_new2(rxpc->ctxt->directory));
43
+ return(rb_str_new2(ctxt->directory));
34
44
  }
35
45
 
36
46
 
@@ -42,10 +52,10 @@ ruby_xml_parser_context_data_directory_get(VALUE self) {
42
52
  */
43
53
  VALUE
44
54
  ruby_xml_parser_context_depth_get(VALUE self) {
45
- ruby_xml_parser_context *rxpc;
46
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
55
+ xmlParserCtxtPtr ctxt;
56
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
47
57
 
48
- return(INT2NUM(rxpc->ctxt->depth));
58
+ return(INT2NUM(ctxt->depth));
49
59
  }
50
60
 
51
61
 
@@ -58,10 +68,10 @@ ruby_xml_parser_context_depth_get(VALUE self) {
58
68
  */
59
69
  VALUE
60
70
  ruby_xml_parser_context_disable_sax_q(VALUE self) {
61
- ruby_xml_parser_context *rxpc;
62
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
71
+ xmlParserCtxtPtr ctxt;
72
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
63
73
 
64
- if (rxpc->ctxt->disableSAX)
74
+ if (ctxt->disableSAX)
65
75
  return(Qtrue);
66
76
  else
67
77
  return(Qfalse);
@@ -77,10 +87,10 @@ ruby_xml_parser_context_disable_sax_q(VALUE self) {
77
87
  */
78
88
  VALUE
79
89
  ruby_xml_parser_context_docbook_q(VALUE self) {
80
- ruby_xml_parser_context *rxpc;
81
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
90
+ xmlParserCtxtPtr ctxt;
91
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
82
92
 
83
- if (rxpc->ctxt->html == 2) // TODO check this
93
+ if (ctxt->html == 2) // TODO check this
84
94
  return(Qtrue);
85
95
  else
86
96
  return(Qfalse);
@@ -96,13 +106,13 @@ ruby_xml_parser_context_docbook_q(VALUE self) {
96
106
  */
97
107
  VALUE
98
108
  ruby_xml_parser_context_encoding_get(VALUE self) {
99
- ruby_xml_parser_context *rxpc;
100
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
109
+ xmlParserCtxtPtr ctxt;
110
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
101
111
 
102
- if (rxpc->ctxt->encoding == NULL)
112
+ if (ctxt->encoding == NULL)
103
113
  return(Qnil);
104
114
  else
105
- return(rb_str_new2((const char*)rxpc->ctxt->encoding));
115
+ return(rb_str_new2((const char*)ctxt->encoding));
106
116
  }
107
117
 
108
118
 
@@ -114,23 +124,13 @@ ruby_xml_parser_context_encoding_get(VALUE self) {
114
124
  */
115
125
  VALUE
116
126
  ruby_xml_parser_context_errno_get(VALUE self) {
117
- ruby_xml_parser_context *rxpc;
118
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
127
+ xmlParserCtxtPtr ctxt;
128
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
119
129
 
120
- return(INT2NUM(rxpc->ctxt->errNo));
130
+ return(INT2NUM(ctxt->errNo));
121
131
  }
122
132
 
123
133
 
124
- void
125
- ruby_xml_parser_context_free(ruby_xml_parser_context *rxpc) {
126
- if (rxpc->ctxt != NULL) {
127
- xmlFreeParserCtxt(rxpc->ctxt);
128
- rxpc->ctxt = NULL;
129
- }
130
-
131
- ruby_xfree(rxpc);
132
- }
133
-
134
134
 
135
135
  /*
136
136
  * call-seq:
@@ -140,10 +140,10 @@ ruby_xml_parser_context_free(ruby_xml_parser_context *rxpc) {
140
140
  */
141
141
  VALUE
142
142
  ruby_xml_parser_context_html_q(VALUE self) {
143
- ruby_xml_parser_context *rxpc;
144
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
143
+ xmlParserCtxtPtr ctxt;
144
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
145
145
 
146
- if (rxpc->ctxt->html == 1)
146
+ if (ctxt->html == 1)
147
147
  return(Qtrue);
148
148
  else
149
149
  return(Qfalse);
@@ -160,10 +160,10 @@ ruby_xml_parser_context_html_q(VALUE self) {
160
160
  VALUE
161
161
  ruby_xml_parser_context_io_max_num_streams_get(VALUE self) {
162
162
  // TODO alias to max_streams and dep this?
163
- ruby_xml_parser_context *rxpc;
164
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
163
+ xmlParserCtxtPtr ctxt;
164
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
165
165
 
166
- return(INT2NUM(rxpc->ctxt->inputMax));
166
+ return(INT2NUM(ctxt->inputMax));
167
167
  }
168
168
 
169
169
 
@@ -176,10 +176,10 @@ ruby_xml_parser_context_io_max_num_streams_get(VALUE self) {
176
176
  */
177
177
  VALUE
178
178
  ruby_xml_parser_context_io_num_streams_get(VALUE self) {
179
- ruby_xml_parser_context *rxpc;
180
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
179
+ xmlParserCtxtPtr ctxt;
180
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
181
181
 
182
- return(INT2NUM(rxpc->ctxt->inputNr));
182
+ return(INT2NUM(ctxt->inputNr));
183
183
  }
184
184
 
185
185
 
@@ -192,10 +192,10 @@ ruby_xml_parser_context_io_num_streams_get(VALUE self) {
192
192
  */
193
193
  VALUE
194
194
  ruby_xml_parser_context_keep_blanks_q(VALUE self) {
195
- ruby_xml_parser_context *rxpc;
196
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
195
+ xmlParserCtxtPtr ctxt;
196
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
197
197
 
198
- if (rxpc->ctxt->keepBlanks)
198
+ if (ctxt->keepBlanks)
199
199
  return(Qtrue);
200
200
  else
201
201
  return(Qfalse);
@@ -210,10 +210,10 @@ ruby_xml_parser_context_keep_blanks_q(VALUE self) {
210
210
  */
211
211
  VALUE
212
212
  ruby_xml_parser_context_name_depth_get(VALUE self) {
213
- ruby_xml_parser_context *rxpc;
214
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
213
+ xmlParserCtxtPtr ctxt;
214
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
215
215
 
216
- return(INT2NUM(rxpc->ctxt->nameNr));
216
+ return(INT2NUM(ctxt->nameNr));
217
217
  }
218
218
 
219
219
 
@@ -225,10 +225,10 @@ ruby_xml_parser_context_name_depth_get(VALUE self) {
225
225
  */
226
226
  VALUE
227
227
  ruby_xml_parser_context_name_depth_max_get(VALUE self) {
228
- ruby_xml_parser_context *rxpc;
229
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
228
+ xmlParserCtxtPtr ctxt;
229
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
230
230
 
231
- return(INT2NUM(rxpc->ctxt->nameMax));
231
+ return(INT2NUM(ctxt->nameMax));
232
232
  }
233
233
 
234
234
 
@@ -240,13 +240,13 @@ ruby_xml_parser_context_name_depth_max_get(VALUE self) {
240
240
  */
241
241
  VALUE
242
242
  ruby_xml_parser_context_name_node_get(VALUE self) {
243
- ruby_xml_parser_context *rxpc;
244
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
243
+ xmlParserCtxtPtr ctxt;
244
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
245
245
 
246
- if (rxpc->ctxt->name == NULL)
246
+ if (ctxt->name == NULL)
247
247
  return(Qnil);
248
248
  else
249
- return(rb_str_new2((const char*)rxpc->ctxt->name));
249
+ return(rb_str_new2((const char*)ctxt->name));
250
250
  }
251
251
 
252
252
 
@@ -259,21 +259,21 @@ ruby_xml_parser_context_name_node_get(VALUE self) {
259
259
  VALUE
260
260
  ruby_xml_parser_context_name_tab_get(VALUE self) {
261
261
  int i;
262
- ruby_xml_parser_context *rxpc;
262
+ xmlParserCtxtPtr ctxt;
263
263
  VALUE tab_ary;
264
264
 
265
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
265
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
266
266
 
267
- if (rxpc->ctxt->nameTab == NULL)
267
+ if (ctxt->nameTab == NULL)
268
268
  return(Qnil);
269
269
 
270
270
  tab_ary = rb_ary_new();
271
271
 
272
- for (i = (rxpc->ctxt->nameNr - 1); i >= 0; i--) {
273
- if (rxpc->ctxt->nameTab[i] == NULL)
272
+ for (i = (ctxt->nameNr - 1); i >= 0; i--) {
273
+ if (ctxt->nameTab[i] == NULL)
274
274
  continue;
275
275
  else
276
- rb_ary_push(tab_ary, rb_str_new2((const char*)rxpc->ctxt->nameTab[i]));
276
+ rb_ary_push(tab_ary, rb_str_new2((const char*)ctxt->nameTab[i]));
277
277
  }
278
278
 
279
279
  return(tab_ary);
@@ -288,10 +288,10 @@ ruby_xml_parser_context_name_tab_get(VALUE self) {
288
288
  */
289
289
  VALUE
290
290
  ruby_xml_parser_context_node_depth_get(VALUE self) {
291
- ruby_xml_parser_context *rxpc;
292
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
291
+ xmlParserCtxtPtr ctxt;
292
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
293
293
 
294
- return(INT2NUM(rxpc->ctxt->nodeNr));
294
+ return(INT2NUM(ctxt->nodeNr));
295
295
  }
296
296
 
297
297
 
@@ -303,14 +303,14 @@ ruby_xml_parser_context_node_depth_get(VALUE self) {
303
303
  */
304
304
  VALUE
305
305
  ruby_xml_parser_context_node_get(VALUE self) {
306
- ruby_xml_parser_context *rxpc;
307
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
306
+ xmlParserCtxtPtr ctxt;
307
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
308
308
 
309
- if (rxpc->ctxt->node == NULL)
309
+ if (ctxt->node == NULL)
310
310
  return(Qnil);
311
311
  else
312
312
  return(ruby_xml_node2_wrap(cXMLNode,
313
- rxpc->ctxt->node));
313
+ ctxt->node));
314
314
  }
315
315
 
316
316
 
@@ -322,10 +322,10 @@ ruby_xml_parser_context_node_get(VALUE self) {
322
322
  */
323
323
  VALUE
324
324
  ruby_xml_parser_context_node_depth_max_get(VALUE self) {
325
- ruby_xml_parser_context *rxpc;
326
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
325
+ xmlParserCtxtPtr ctxt;
326
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
327
327
 
328
- return(INT2NUM(rxpc->ctxt->nodeMax));
328
+ return(INT2NUM(ctxt->nodeMax));
329
329
  }
330
330
 
331
331
 
@@ -337,39 +337,10 @@ ruby_xml_parser_context_node_depth_max_get(VALUE self) {
337
337
  */
338
338
  VALUE
339
339
  ruby_xml_parser_context_num_chars_get(VALUE self) {
340
- ruby_xml_parser_context *rxpc;
341
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
340
+ xmlParserCtxtPtr ctxt;
341
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
342
342
 
343
- return(LONG2NUM(rxpc->ctxt->nbChars));
344
- }
345
-
346
-
347
- VALUE
348
- ruby_xml_parser_context_new() {
349
- ruby_xml_parser_context *rxpc = ALLOC(ruby_xml_parser_context);
350
- return Data_Wrap_Struct(cXMLParserContext,
351
- NULL,
352
- ruby_xml_parser_context_free,
353
- rxpc);
354
- }
355
-
356
-
357
- VALUE
358
- ruby_xml_parser_context_options_set(VALUE self, VALUE options) {
359
- ruby_xml_parser_context *rxpc;
360
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
361
-
362
- if (xmlCtxtUseOptions(rxpc->ctxt, NUM2INT(options)))
363
- return Qfalse;
364
- else
365
- return Qtrue;
366
- }
367
-
368
- VALUE
369
- ruby_xml_parser_context_options_get(VALUE self) {
370
- ruby_xml_parser_context *rxpc;
371
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
372
- return INT2NUM(rxpc->ctxt->options);
343
+ return(LONG2NUM(ctxt->nbChars));
373
344
  }
374
345
 
375
346
  /*
@@ -381,10 +352,10 @@ ruby_xml_parser_context_options_get(VALUE self) {
381
352
  */
382
353
  VALUE
383
354
  ruby_xml_parser_context_replace_entities_q(VALUE self) {
384
- ruby_xml_parser_context *rxpc;
385
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
355
+ xmlParserCtxtPtr ctxt;
356
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
386
357
 
387
- if (rxpc->ctxt->replaceEntities)
358
+ if (ctxt->replaceEntities)
388
359
  return(Qtrue);
389
360
  else
390
361
  return(Qfalse);
@@ -400,14 +371,14 @@ ruby_xml_parser_context_replace_entities_q(VALUE self) {
400
371
  */
401
372
  VALUE
402
373
  ruby_xml_parser_context_replace_entities_set(VALUE self, VALUE bool) {
403
- ruby_xml_parser_context *rxpc;
404
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
374
+ xmlParserCtxtPtr ctxt;
375
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
405
376
 
406
377
  if (TYPE(bool) == T_FALSE) {
407
- rxpc->ctxt->replaceEntities = 0;
378
+ ctxt->replaceEntities = 0;
408
379
  return(Qfalse);
409
380
  } else {
410
- rxpc->ctxt->replaceEntities = 1;
381
+ ctxt->replaceEntities = 1;
411
382
  return(Qfalse);
412
383
  }
413
384
  }
@@ -420,10 +391,10 @@ ruby_xml_parser_context_replace_entities_set(VALUE self, VALUE bool) {
420
391
  */
421
392
  VALUE
422
393
  ruby_xml_parser_context_space_depth_get(VALUE self) {
423
- ruby_xml_parser_context *rxpc;
424
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
394
+ xmlParserCtxtPtr ctxt;
395
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
425
396
 
426
- return(INT2NUM(rxpc->ctxt->spaceNr));
397
+ return(INT2NUM(ctxt->spaceNr));
427
398
  }
428
399
 
429
400
 
@@ -435,10 +406,10 @@ ruby_xml_parser_context_space_depth_get(VALUE self) {
435
406
  */
436
407
  VALUE
437
408
  ruby_xml_parser_context_space_depth_max_get(VALUE self) {
438
- ruby_xml_parser_context *rxpc;
439
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
409
+ xmlParserCtxtPtr ctxt;
410
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
440
411
 
441
- return(INT2NUM(rxpc->ctxt->spaceMax));
412
+ return(INT2NUM(ctxt->spaceMax));
442
413
  }
443
414
 
444
415
 
@@ -451,10 +422,10 @@ ruby_xml_parser_context_space_depth_max_get(VALUE self) {
451
422
  */
452
423
  VALUE
453
424
  ruby_xml_parser_context_subset_external_q(VALUE self) {
454
- ruby_xml_parser_context *rxpc;
455
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
425
+ xmlParserCtxtPtr ctxt;
426
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
456
427
 
457
- if (rxpc->ctxt->inSubset == 2)
428
+ if (ctxt->inSubset == 2)
458
429
  return(Qtrue);
459
430
  else
460
431
  return(Qfalse);
@@ -470,10 +441,10 @@ ruby_xml_parser_context_subset_external_q(VALUE self) {
470
441
  */
471
442
  VALUE
472
443
  ruby_xml_parser_context_subset_internal_q(VALUE self) {
473
- ruby_xml_parser_context *rxpc;
474
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
444
+ xmlParserCtxtPtr ctxt;
445
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
475
446
 
476
- if (rxpc->ctxt->inSubset == 1)
447
+ if (ctxt->inSubset == 1)
477
448
  return(Qtrue);
478
449
  else
479
450
  return(Qfalse);
@@ -490,13 +461,13 @@ ruby_xml_parser_context_subset_internal_q(VALUE self) {
490
461
  */
491
462
  VALUE
492
463
  ruby_xml_parser_context_subset_name_get(VALUE self) {
493
- ruby_xml_parser_context *rxpc;
494
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
464
+ xmlParserCtxtPtr ctxt;
465
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
495
466
 
496
- if (rxpc->ctxt->intSubName == NULL)
467
+ if (ctxt->intSubName == NULL)
497
468
  return(Qnil);
498
469
  else
499
- return(rb_str_new2((const char*)rxpc->ctxt->intSubName));
470
+ return(rb_str_new2((const char*)ctxt->intSubName));
500
471
  }
501
472
 
502
473
 
@@ -510,13 +481,13 @@ ruby_xml_parser_context_subset_name_get(VALUE self) {
510
481
  */
511
482
  VALUE
512
483
  ruby_xml_parser_context_subset_external_uri_get(VALUE self) {
513
- ruby_xml_parser_context *rxpc;
514
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
484
+ xmlParserCtxtPtr ctxt;
485
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
515
486
 
516
- if (rxpc->ctxt->extSubURI == NULL)
487
+ if (ctxt->extSubURI == NULL)
517
488
  return(Qnil);
518
489
  else
519
- return(rb_str_new2((const char*)rxpc->ctxt->extSubURI));
490
+ return(rb_str_new2((const char*)ctxt->extSubURI));
520
491
  }
521
492
 
522
493
 
@@ -530,13 +501,13 @@ ruby_xml_parser_context_subset_external_uri_get(VALUE self) {
530
501
  */
531
502
  VALUE
532
503
  ruby_xml_parser_context_subset_external_system_id_get(VALUE self) {
533
- ruby_xml_parser_context *rxpc;
534
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
504
+ xmlParserCtxtPtr ctxt;
505
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
535
506
 
536
- if (rxpc->ctxt->extSubSystem == NULL)
507
+ if (ctxt->extSubSystem == NULL)
537
508
  return(Qnil);
538
509
  else
539
- return(rb_str_new2((const char*)rxpc->ctxt->extSubSystem));
510
+ return(rb_str_new2((const char*)ctxt->extSubSystem));
540
511
  }
541
512
 
542
513
 
@@ -548,10 +519,10 @@ ruby_xml_parser_context_subset_external_system_id_get(VALUE self) {
548
519
  */
549
520
  VALUE
550
521
  ruby_xml_parser_context_standalone_q(VALUE self) {
551
- ruby_xml_parser_context *rxpc;
552
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
522
+ xmlParserCtxtPtr ctxt;
523
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
553
524
 
554
- if (rxpc->ctxt->standalone)
525
+ if (ctxt->standalone)
555
526
  return(Qtrue);
556
527
  else
557
528
  return(Qfalse);
@@ -566,10 +537,10 @@ ruby_xml_parser_context_standalone_q(VALUE self) {
566
537
  */
567
538
  VALUE
568
539
  ruby_xml_parser_context_stats_q(VALUE self) {
569
- ruby_xml_parser_context *rxpc;
570
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
540
+ xmlParserCtxtPtr ctxt;
541
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
571
542
 
572
- if (rxpc->ctxt->record_info)
543
+ if (ctxt->record_info)
573
544
  return(Qtrue);
574
545
  else
575
546
  return(Qfalse);
@@ -584,10 +555,10 @@ ruby_xml_parser_context_stats_q(VALUE self) {
584
555
  */
585
556
  VALUE
586
557
  ruby_xml_parser_context_valid_q(VALUE self) {
587
- ruby_xml_parser_context *rxpc;
588
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
558
+ xmlParserCtxtPtr ctxt;
559
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
589
560
 
590
- if (rxpc->ctxt->valid)
561
+ if (ctxt->valid)
591
562
  return(Qtrue);
592
563
  else
593
564
  return(Qfalse);
@@ -602,10 +573,10 @@ ruby_xml_parser_context_valid_q(VALUE self) {
602
573
  */
603
574
  VALUE
604
575
  ruby_xml_parser_context_validate_q(VALUE self) {
605
- ruby_xml_parser_context *rxpc;
606
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
576
+ xmlParserCtxtPtr ctxt;
577
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
607
578
 
608
- if (rxpc->ctxt->validate)
579
+ if (ctxt->validate)
609
580
  return(Qtrue);
610
581
  else
611
582
  return(Qfalse);
@@ -620,13 +591,13 @@ ruby_xml_parser_context_validate_q(VALUE self) {
620
591
  */
621
592
  VALUE
622
593
  ruby_xml_parser_context_version_get(VALUE self) {
623
- ruby_xml_parser_context *rxpc;
624
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
594
+ xmlParserCtxtPtr ctxt;
595
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
625
596
 
626
- if (rxpc->ctxt->version == NULL)
597
+ if (ctxt->version == NULL)
627
598
  return(Qnil);
628
599
  else
629
- return(rb_str_new2((const char*)rxpc->ctxt->version));
600
+ return(rb_str_new2((const char*)ctxt->version));
630
601
  }
631
602
 
632
603
 
@@ -638,26 +609,19 @@ ruby_xml_parser_context_version_get(VALUE self) {
638
609
  */
639
610
  VALUE
640
611
  ruby_xml_parser_context_well_formed_q(VALUE self) {
641
- ruby_xml_parser_context *rxpc;
642
- Data_Get_Struct(self, ruby_xml_parser_context, rxpc);
612
+ xmlParserCtxtPtr ctxt;
613
+ Data_Get_Struct(self, xmlParserCtxt, ctxt);
643
614
 
644
- if (rxpc->ctxt->wellFormed)
615
+ if (ctxt->wellFormed)
645
616
  return(Qtrue);
646
617
  else
647
618
  return(Qfalse);
648
619
  }
649
620
 
650
-
651
- // Rdoc needs to know
652
- #ifdef RDOC_NEVER_DEFINED
653
- mLibXML = rb_define_module("LibXML");
654
- mXML = rb_define_module_under(mLibXML, "XML");
655
- cXMLParser = rb_define_class_under(mXML, "Parser", rb_cObject);
656
- #endif
657
-
658
621
  void
659
622
  ruby_init_xml_parser_context(void) {
660
623
  cXMLParserContext = rb_define_class_under(cXMLParser, "Context", rb_cObject);
624
+ rb_undef_alloc_func(cXMLParserContext);
661
625
 
662
626
  rb_define_method(cXMLParserContext, "data_directory", ruby_xml_parser_context_data_directory_get, 0);
663
627
  rb_define_method(cXMLParserContext, "depth", ruby_xml_parser_context_depth_get, 0);
@@ -677,8 +641,6 @@ ruby_init_xml_parser_context(void) {
677
641
  rb_define_method(cXMLParserContext, "node_depth", ruby_xml_parser_context_node_depth_get, 0);
678
642
  rb_define_method(cXMLParserContext, "node_depth_max", ruby_xml_parser_context_node_depth_max_get, 0);
679
643
  rb_define_method(cXMLParserContext, "num_chars", ruby_xml_parser_context_num_chars_get, 0);
680
- rb_define_method(cXMLParserContext, "options", ruby_xml_parser_context_options_get, 0);
681
- rb_define_method(cXMLParserContext, "options=", ruby_xml_parser_context_options_set, 1);
682
644
  rb_define_method(cXMLParserContext, "replace_entities?", ruby_xml_parser_context_replace_entities_q, 0);
683
645
  rb_define_method(cXMLParserContext, "replace_entities=", ruby_xml_parser_context_replace_entities_set, 1);
684
646
  rb_define_method(cXMLParserContext, "space_depth", ruby_xml_parser_context_space_depth_get, 0);