libxml-ruby 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data/LICENSE +23 -23
  2. data/README +144 -144
  3. data/ext/libxml/extconf.rb +26 -27
  4. data/ext/libxml/libxml.c +7 -37
  5. data/ext/libxml/{libxml.h → ruby_libxml.h} +93 -98
  6. data/ext/libxml/ruby_xml_attr.c +405 -387
  7. data/ext/libxml/ruby_xml_attr.h +19 -18
  8. data/ext/libxml/ruby_xml_document.c +1111 -1115
  9. data/ext/libxml/ruby_xml_document.h +27 -24
  10. data/ext/libxml/ruby_xml_dtd.c +168 -168
  11. data/ext/libxml/ruby_xml_html_parser.c +449 -450
  12. data/ext/libxml/ruby_xml_html_parser.h +1 -1
  13. data/ext/libxml/ruby_xml_input_cbg.c +158 -158
  14. data/ext/libxml/ruby_xml_node.c +2410 -2395
  15. data/ext/libxml/ruby_xml_node.h +1 -1
  16. data/ext/libxml/ruby_xml_node_set.c +170 -170
  17. data/ext/libxml/ruby_xml_node_set.h +1 -1
  18. data/ext/libxml/ruby_xml_ns.c +153 -153
  19. data/ext/libxml/ruby_xml_ns.h +1 -1
  20. data/ext/libxml/ruby_xml_parser.c +1425 -1422
  21. data/ext/libxml/ruby_xml_parser.h +1 -1
  22. data/ext/libxml/ruby_xml_parser_context.c +750 -716
  23. data/ext/libxml/ruby_xml_parser_context.h +1 -1
  24. data/ext/libxml/ruby_xml_reader.c +900 -896
  25. data/ext/libxml/ruby_xml_sax_parser.c +485 -485
  26. data/ext/libxml/ruby_xml_sax_parser.h +1 -1
  27. data/ext/libxml/ruby_xml_schema.c +146 -142
  28. data/ext/libxml/ruby_xml_state.c +5 -6
  29. data/ext/libxml/ruby_xml_state.h +1 -0
  30. data/ext/libxml/ruby_xml_tree.c +43 -43
  31. data/ext/libxml/ruby_xml_tree.h +1 -1
  32. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  33. data/ext/libxml/ruby_xml_xinclude.h +1 -1
  34. data/ext/libxml/ruby_xml_xpath.c +243 -252
  35. data/ext/libxml/ruby_xml_xpath.h +1 -1
  36. data/ext/libxml/ruby_xml_xpath_context.c +118 -118
  37. data/ext/libxml/ruby_xml_xpath_context.h +1 -1
  38. data/ext/libxml/ruby_xml_xpath_object.c +43 -29
  39. data/ext/libxml/ruby_xml_xpath_object.h +0 -1
  40. data/ext/libxml/ruby_xml_xpointer.c +100 -100
  41. data/ext/libxml/ruby_xml_xpointer.h +1 -1
  42. data/ext/libxml/ruby_xml_xpointer_context.c +21 -21
  43. data/ext/libxml/ruby_xml_xpointer_context.h +1 -1
  44. data/ext/libxml/sax_parser_callbacks.inc +213 -213
  45. data/ext/libxml/version.h +9 -9
  46. data/lib/libxml.rb +24 -3
  47. data/mingw/libiconv-2.dll +0 -0
  48. data/mingw/libxml2-2.dll +0 -0
  49. data/mingw/libxml_ruby.so +0 -0
  50. data/mingw/mingw.rake +36 -0
  51. data/test/dtd-test.rb +24 -24
  52. data/test/etc_doc_to_s.rb +1 -3
  53. data/test/ets_copy_bug.rb +21 -21
  54. data/test/ets_copy_bug2.rb +32 -32
  55. data/test/ets_copy_bug3.rb +38 -0
  56. data/test/ets_doc_file.rb +1 -0
  57. data/test/{model/default_validation_bug.rb → gc.log} +0 -0
  58. data/test/merge_bug.rb +55 -55
  59. data/test/schema-test.rb +74 -74
  60. data/test/tc_well_formed.rb +11 -0
  61. data/test/tc_xml_document.rb +52 -52
  62. data/test/tc_xml_document_write.rb +24 -24
  63. data/test/tc_xml_document_write2.rb +54 -54
  64. data/test/tc_xml_document_write3.rb +96 -96
  65. data/test/tc_xml_html_parser.rb +63 -63
  66. data/test/tc_xml_node.rb +59 -59
  67. data/test/tc_xml_node2.rb +25 -25
  68. data/test/tc_xml_node3.rb +27 -27
  69. data/test/tc_xml_node4.rb +86 -86
  70. data/test/tc_xml_node5.rb +52 -52
  71. data/test/tc_xml_node6.rb +27 -27
  72. data/test/tc_xml_node7.rb +35 -35
  73. data/test/tc_xml_node8.rb +32 -32
  74. data/test/tc_xml_node9.rb +32 -32
  75. data/test/tc_xml_node_set.rb +24 -24
  76. data/test/tc_xml_node_set2.rb +37 -37
  77. data/test/tc_xml_node_xlink.rb +28 -28
  78. data/test/tc_xml_parser.rb +190 -178
  79. data/test/tc_xml_parser2.rb +16 -17
  80. data/test/tc_xml_parser3.rb +23 -23
  81. data/test/tc_xml_parser4.rb +33 -33
  82. data/test/tc_xml_parser5.rb +27 -27
  83. data/test/tc_xml_parser6.rb +23 -23
  84. data/test/tc_xml_parser7.rb +28 -28
  85. data/test/tc_xml_parser8.rb +32 -32
  86. data/test/tc_xml_parser9.rb +11 -0
  87. data/test/tc_xml_parser_context.rb +88 -88
  88. data/test/tc_xml_reader.rb +112 -109
  89. data/test/tc_xml_sax_parser.rb +104 -94
  90. data/test/tc_xml_sax_parser2.rb +51 -0
  91. data/test/tc_xml_xinclude.rb +30 -30
  92. data/test/tc_xml_xpath.rb +38 -38
  93. data/test/tc_xml_xpath2.rb +14 -0
  94. data/test/tc_xml_xpointer.rb +78 -78
  95. data/vc/libxml.sln +20 -0
  96. data/vc/libxml.vcproj +389 -0
  97. data/work/Rakefile +247 -0
  98. data/work/task/make +26 -0
  99. data/work/task/memory +37 -0
  100. data/work/task/rdoc +39 -0
  101. data/work/task/setup +1616 -0
  102. data/work/task/test +29 -0
  103. data/work/test/ets_runner.rb +33 -0
  104. data/work/test/libxml_test.rb +3 -0
  105. data/work/test/runner.rb +0 -0
  106. data/work/test/runner_ets.rb +33 -0
  107. data/work/vc/debug/libxml.exp +0 -0
  108. data/work/vc/debug/libxml.ilk +0 -0
  109. data/work/vc/debug/libxml.lib +0 -0
  110. data/work/vc/debug/libxml.pdb +0 -0
  111. data/work/vc/debug/libxml.so +0 -0
  112. metadata +158 -189
  113. data/MANIFEST +0 -138
  114. data/NOTES +0 -9
  115. data/Rakefile +0 -38
  116. data/TODO +0 -75
  117. data/VERSION +0 -1
  118. data/log/Changelog-0.txt +0 -426
  119. data/log/Changelog.txt +0 -435
  120. data/meta/project.yaml +0 -27
  121. data/meta/unixname +0 -1
  122. data/setup.rb +0 -1472
  123. data/site/css/normal.css +0 -182
  124. data/site/img/raze-tiny.png +0 -0
  125. data/site/img/red-cube.jpg +0 -0
  126. data/site/img/xml-ruby.png +0 -0
  127. data/site/index.xml +0 -43
  128. data/site/install.xml +0 -77
  129. data/site/layout.rhtml +0 -38
  130. data/site/layout.xsl +0 -67
  131. data/site/license.xml +0 -32
  132. data/site/log/changelog.xml +0 -1324
  133. data/site/log/changelog.xsl +0 -42
  134. data/test/model/merge_bug_data.xml +0 -58
  135. data/test/model/rubynet.xml +0 -78
  136. data/test/model/rubynet_project +0 -13
  137. data/test/model/saxtest.xml +0 -5
  138. data/test/model/simple.xml +0 -7
  139. data/test/model/xinclude.xml +0 -5
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_sax_parser.h 225 2007-12-07 04:58:09Z transami $ */
1
+ /* $Id: ruby_xml_sax_parser.h 111 2006-11-20 01:39:14Z roscopeco $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -1,142 +1,146 @@
1
- #include "libxml.h"
2
- #include "ruby_xml_schema.h"
3
-
4
- VALUE cXMLSchema;
5
-
6
- static void
7
- ruby_xml_schema_mark(ruby_xml_schema *rxschema) {
8
- return;
9
- }
10
-
11
- void
12
- ruby_xml_schema_free(ruby_xml_schema *rxschema) {
13
- if (rxschema->schema != NULL) {
14
- xmlSchemaFree(rxschema->schema);
15
- rxschema->schema = NULL;
16
- }
17
-
18
- free(rxschema);
19
- }
20
-
21
- /*
22
- * call-seq:
23
- * XML::Schema.new(schema_uri) => schema
24
- *
25
- * Create a new schema from the specified URI.
26
- */
27
- VALUE
28
- ruby_xml_schema_init_from_uri(int argc, VALUE *argv, VALUE class) {
29
- VALUE uri;
30
- xmlSchemaParserCtxtPtr parser;
31
- xmlSchemaPtr sptr;
32
-
33
- switch (argc) {
34
- case 1:
35
- rb_scan_args(argc, argv, "10", &uri);
36
-
37
- Check_Type(uri, T_STRING);
38
-
39
- parser = xmlSchemaNewParserCtxt(StringValuePtr(uri));
40
- sptr = xmlSchemaParse(parser);
41
- xmlSchemaFreeParserCtxt(parser);
42
- break;
43
- default:
44
- rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
45
- }
46
- return Qnil;
47
- }
48
-
49
- /*
50
- * call-seq:
51
- * XML::Schema.from_string("schema_data") => "value"
52
- *
53
- * Create a new schema using the specified string.
54
- */
55
- VALUE
56
- ruby_xml_schema_init_from_str(int argc, VALUE *argv, VALUE class) {
57
- VALUE schema_str;
58
-
59
- xmlSchemaParserCtxtPtr parser;
60
- //xmlSchemaPtr sptr;
61
- ruby_xml_schema *rxschema;
62
-
63
- switch (argc) {
64
- case 1:
65
- rb_scan_args(argc, argv, "10", &schema_str);
66
-
67
- Check_Type(schema_str, T_STRING);
68
-
69
- parser = xmlSchemaNewMemParserCtxt(StringValuePtr(schema_str), strlen(StringValuePtr(schema_str)));
70
- rxschema = ALLOC(ruby_xml_schema);
71
- rxschema->schema = xmlSchemaParse(parser);
72
- xmlSchemaFreeParserCtxt(parser);
73
-
74
- return( Data_Wrap_Struct(cXMLSchema, ruby_xml_schema_mark, ruby_xml_schema_free, rxschema) );
75
- default:
76
- rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
77
- }
78
- return Qnil;
79
- }
80
-
81
- /* TODO what is this patch doing here?
82
-
83
- xmlSchemaParserCtxtPtr parser;
84
- xmlSchemaPtr sptr;
85
- xmlSchemaValidCtxtPtr vptr;
86
- + int is_invalid;
87
-
88
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &source) == FAILURE) {
89
- return;
90
- @@ -598,26 +598,24 @@
91
- convert_to_string_ex(&source);
92
- parser = xmlSchemaNewParserCtxt(Z_STRVAL_P(source));
93
- sptr = xmlSchemaParse(parser);
94
- break;
95
- case SCHEMA_BLOB:
96
- convert_to_string_ex(&source);
97
- parser = xmlSchemaNewMemParserCtxt(Z_STRVAL_P(source), Z_STRLEN_P(source));
98
- sptr = xmlSchemaParse(parser);
99
- break;
100
- }
101
-
102
- vptr = xmlSchemaNewValidCtxt(sptr);
103
- + is_invalid = xmlSchemaValidateDoc(vptr, (xmlDocPtr) sxe->document->ptr);
104
- xmlSchemaFree(sptr);
105
- xmlSchemaFreeValidCtxt(vptr);
106
- xmlSchemaFreeParserCtxt(parser);
107
-
108
- - if (is_valid) {
109
- - RETURN_TRUE;
110
- - } else {
111
- + if (is_invalid) {
112
- RETURN_FALSE;
113
- + } else {
114
- + RETURN_TRUE;
115
- }
116
- }
117
- }}}
118
- @@ -695,7 +693,7 @@
119
- {
120
- if (!strcmp(method, "xsearch")) {
121
- simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAM_PASSTHRU);
122
- -#ifdef xmlSchemaParserCtxtPtr
123
- +#ifdef LIBXML_SCHEMAS_ENABLED
124
- } else if (!strcmp(method, "validate_schema_file")) {
125
- simplexml_ce_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, SCHEMA_FILE);
126
- } else if (!strcmp(method, "validate_schema_buffer")) {
127
- */
128
-
129
- void ruby_schema_free(ruby_xml_schema *rxs) {
130
- }
131
-
132
- // Rdoc needs to know
133
- #ifdef RDOC_NEVER_DEFINED
134
- mXML = rb_define_module("XML");
135
- #endif
136
-
137
- void ruby_init_xml_schema(void) {
138
- cXMLSchema = rb_define_class_under(mXML, "Schema", rb_cObject);
139
- rb_define_singleton_method(cXMLSchema, "new", ruby_xml_schema_init_from_uri, -1);
140
- rb_define_singleton_method(cXMLSchema, "from_string", ruby_xml_schema_init_from_str, -1);
141
- }
142
-
1
+ #include "ruby_libxml.h"
2
+ #include "ruby_xml_schema.h"
3
+
4
+ VALUE cXMLSchema;
5
+
6
+ static void
7
+ ruby_xml_schema_mark(ruby_xml_schema *rxschema) {
8
+ return;
9
+ }
10
+
11
+ void
12
+ ruby_xml_schema_free(ruby_xml_schema *rxschema) {
13
+ if (rxschema->schema != NULL) {
14
+ xmlSchemaFree(rxschema->schema);
15
+ rxschema->schema = NULL;
16
+ }
17
+
18
+ ruby_xfree(rxschema);
19
+ }
20
+
21
+ /*
22
+ * call-seq:
23
+ * XML::Schema.new(schema_uri) => schema
24
+ *
25
+ * Create a new schema from the specified URI.
26
+ */
27
+ VALUE
28
+ ruby_xml_schema_init_from_uri(int argc, VALUE *argv, VALUE class) {
29
+ xmlSchemaParserCtxtPtr parser;
30
+ ruby_xml_schema *schema;
31
+
32
+ VALUE uri;
33
+ VALUE result = Qnil;
34
+
35
+ switch (argc) {
36
+ case 1:
37
+ rb_scan_args(argc, argv, "10", &uri);
38
+ Check_Type(uri, T_STRING);
39
+
40
+ parser = xmlSchemaNewParserCtxt(StringValuePtr(uri));
41
+ schema = ALLOC(ruby_xml_schema);
42
+ schema->schema = xmlSchemaParse(parser);
43
+ xmlSchemaFreeParserCtxt(parser);
44
+
45
+ result = Data_Wrap_Struct(cXMLSchema, ruby_xml_schema_mark, ruby_xml_schema_free, schema);
46
+ break;
47
+ default:
48
+ rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
49
+ }
50
+ return(result);
51
+ }
52
+
53
+ /*
54
+ * call-seq:
55
+ * XML::Schema.from_string("schema_data") => "value"
56
+ *
57
+ * Create a new schema using the specified string.
58
+ */
59
+ VALUE
60
+ ruby_xml_schema_init_from_str(int argc, VALUE *argv, VALUE class) {
61
+ VALUE schema_str;
62
+
63
+ xmlSchemaParserCtxtPtr parser;
64
+ //xmlSchemaPtr sptr;
65
+ ruby_xml_schema *rxschema;
66
+
67
+ switch (argc) {
68
+ case 1:
69
+ rb_scan_args(argc, argv, "10", &schema_str);
70
+
71
+ Check_Type(schema_str, T_STRING);
72
+
73
+ parser = xmlSchemaNewMemParserCtxt(StringValuePtr(schema_str), strlen(StringValuePtr(schema_str)));
74
+ rxschema = ALLOC(ruby_xml_schema);
75
+ rxschema->schema = xmlSchemaParse(parser);
76
+ xmlSchemaFreeParserCtxt(parser);
77
+
78
+ return( Data_Wrap_Struct(cXMLSchema, ruby_xml_schema_mark, ruby_xml_schema_free, rxschema) );
79
+ default:
80
+ rb_raise(rb_eArgError, "wrong number of arguments (need 1)");
81
+ }
82
+ return Qnil;
83
+ }
84
+
85
+ /* TODO what is this patch doing here?
86
+
87
+ xmlSchemaParserCtxtPtr parser;
88
+ xmlSchemaPtr sptr;
89
+ xmlSchemaValidCtxtPtr vptr;
90
+ + int is_invalid;
91
+
92
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &source) == FAILURE) {
93
+ return;
94
+ @@ -598,26 +598,24 @@
95
+ convert_to_string_ex(&source);
96
+ parser = xmlSchemaNewParserCtxt(Z_STRVAL_P(source));
97
+ sptr = xmlSchemaParse(parser);
98
+ break;
99
+ case SCHEMA_BLOB:
100
+ convert_to_string_ex(&source);
101
+ parser = xmlSchemaNewMemParserCtxt(Z_STRVAL_P(source), Z_STRLEN_P(source));
102
+ sptr = xmlSchemaParse(parser);
103
+ break;
104
+ }
105
+
106
+ vptr = xmlSchemaNewValidCtxt(sptr);
107
+ + is_invalid = xmlSchemaValidateDoc(vptr, (xmlDocPtr) sxe->document->ptr);
108
+ xmlSchemaFree(sptr);
109
+ xmlSchemaFreeValidCtxt(vptr);
110
+ xmlSchemaFreeParserCtxt(parser);
111
+
112
+ - if (is_valid) {
113
+ - RETURN_TRUE;
114
+ - } else {
115
+ + if (is_invalid) {
116
+ RETURN_FALSE;
117
+ + } else {
118
+ + RETURN_TRUE;
119
+ }
120
+ }
121
+ }}}
122
+ @@ -695,7 +693,7 @@
123
+ {
124
+ if (!strcmp(method, "xsearch")) {
125
+ simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAM_PASSTHRU);
126
+ -#ifdef xmlSchemaParserCtxtPtr
127
+ +#ifdef LIBXML_SCHEMAS_ENABLED
128
+ } else if (!strcmp(method, "validate_schema_file")) {
129
+ simplexml_ce_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, SCHEMA_FILE);
130
+ } else if (!strcmp(method, "validate_schema_buffer")) {
131
+ */
132
+
133
+ void ruby_schema_free(ruby_xml_schema *rxs) {
134
+ }
135
+
136
+ // Rdoc needs to know
137
+ #ifdef RDOC_NEVER_DEFINED
138
+ mXML = rb_define_module("XML");
139
+ #endif
140
+
141
+ void ruby_init_xml_schema(void) {
142
+ cXMLSchema = rb_define_class_under(mXML, "Schema", rb_cObject);
143
+ rb_define_singleton_method(cXMLSchema, "new", ruby_xml_schema_init_from_uri, -1);
144
+ rb_define_singleton_method(cXMLSchema, "from_string", ruby_xml_schema_init_from_str, -1);
145
+ }
146
+
@@ -1,6 +1,6 @@
1
1
  /* $Id$ */
2
2
 
3
- #include "libxml.h"
3
+ #include "ruby_libxml.h"
4
4
 
5
5
  VALUE cXMLState;
6
6
  static VALUE weak_holder;
@@ -14,7 +14,7 @@ void
14
14
  ruby_xml_state_free(int * dummy) {
15
15
  if ( dummy==NULL ) return;
16
16
  xmlCleanupParser();
17
- free(dummy);
17
+ ruby_xfree(dummy);
18
18
  dummy=NULL;
19
19
  weak_holder=Qnil;
20
20
  rb_ivar_set(cXMLState,id_state,Qnil);
@@ -57,10 +57,9 @@ ruby_xml_state_object() {
57
57
 
58
58
  VALUE
59
59
  ruby_xml_state_object_find_aux(VALUE id) {
60
- rb_funcall(rb_const_get(rb_cModule,rb_intern("ObjectSpace")),
61
- rb_intern("_id2ref"),
62
- 1,
63
- id);
60
+ return rb_funcall(rb_const_get(rb_cModule,rb_intern("ObjectSpace")),
61
+ rb_intern("_id2ref"),
62
+ 1, id);
64
63
  }
65
64
 
66
65
 
@@ -5,6 +5,7 @@
5
5
 
6
6
  extern VALUE cXMLState;
7
7
 
8
+ void ruby_init_state(void);
8
9
  void ruby_xml_state_marker(void);
9
10
  VALUE ruby_xml_state_object_find(VALUE id);
10
11
 
@@ -1,43 +1,43 @@
1
- /* $Id: ruby_xml_tree.c 225 2007-12-07 04:58:09Z transami $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #include "libxml.h"
6
- #include "ruby_xml_tree.h"
7
-
8
- VALUE cXMLTree;
9
-
10
- // Rdoc needs to know
11
- #ifdef RDOC_NEVER_DEFINED
12
- mXML = rb_define_module("XML");
13
- #endif
14
-
15
- void
16
- ruby_init_xml_tree(void) {
17
- cXMLTree = rb_define_class_under(mXML, "Tree", rb_cObject);
18
-
19
- rb_define_const(cXMLTree, "ELEMENT_NODE", INT2FIX(XML_ELEMENT_NODE));
20
- rb_define_const(cXMLTree, "ATTRIBUTE_NODE", INT2FIX(XML_ATTRIBUTE_NODE));
21
- rb_define_const(cXMLTree, "TEXT_NODE", INT2FIX(XML_TEXT_NODE));
22
- rb_define_const(cXMLTree, "CDATA_SECTION_NODE", INT2FIX(XML_CDATA_SECTION_NODE));
23
- rb_define_const(cXMLTree, "ENTITY_REF_NODE", INT2FIX(XML_ENTITY_REF_NODE));
24
- rb_define_const(cXMLTree, "ENTITY_NODE", INT2FIX(XML_ENTITY_NODE));
25
- rb_define_const(cXMLTree, "PI_NODE", INT2FIX(XML_PI_NODE));
26
- rb_define_const(cXMLTree, "COMMENT_NODE", INT2FIX(XML_COMMENT_NODE));
27
- rb_define_const(cXMLTree, "DOCUMENT_NODE", INT2FIX(XML_DOCUMENT_NODE));
28
- rb_define_const(cXMLTree, "DOCUMENT_TYPE_NODE", INT2FIX(XML_DOCUMENT_TYPE_NODE));
29
- rb_define_const(cXMLTree, "DOCUMENT_FRAG_NODE", INT2FIX(XML_DOCUMENT_FRAG_NODE));
30
- rb_define_const(cXMLTree, "NOTATION_NODE", INT2FIX(XML_NOTATION_NODE));
31
- rb_define_const(cXMLTree, "HTML_DOCUMENT_NODE", INT2FIX(XML_HTML_DOCUMENT_NODE));
32
- rb_define_const(cXMLTree, "DTD_NODE", INT2FIX(XML_DTD_NODE));
33
- rb_define_const(cXMLTree, "ELEMENT_DECL", INT2FIX(XML_ELEMENT_DECL));
34
- rb_define_const(cXMLTree, "ATTRIBUTE_DECL", INT2FIX(XML_ATTRIBUTE_DECL));
35
- rb_define_const(cXMLTree, "ENTITY_DECL", INT2FIX(XML_ENTITY_DECL));
36
- rb_define_const(cXMLTree, "NAMESPACE_DECL", INT2FIX(XML_NAMESPACE_DECL));
37
- rb_define_const(cXMLTree, "XINCLUDE_START", INT2FIX(XML_XINCLUDE_START));
38
- rb_define_const(cXMLTree, "XINCLUDE_END", INT2FIX(XML_XINCLUDE_END));
39
-
40
- #ifdef LIBXML_DOCB_ENABLED
41
- rb_define_const(cXMLTree, "DOCB_DOCUMENT_NODE", INT2FIX(XML_DOCB_DOCUMENT_NODE));
42
- #endif
43
- }
1
+ /* $Id: ruby_xml_tree.c 300 2008-07-01 19:14:15Z cfis $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #include "ruby_libxml.h"
6
+ #include "ruby_xml_tree.h"
7
+
8
+ VALUE cXMLTree;
9
+
10
+ // Rdoc needs to know
11
+ #ifdef RDOC_NEVER_DEFINED
12
+ mXML = rb_define_module("XML");
13
+ #endif
14
+
15
+ void
16
+ ruby_init_xml_tree(void) {
17
+ cXMLTree = rb_define_class_under(mXML, "Tree", rb_cObject);
18
+
19
+ rb_define_const(cXMLTree, "ELEMENT_NODE", INT2FIX(XML_ELEMENT_NODE));
20
+ rb_define_const(cXMLTree, "ATTRIBUTE_NODE", INT2FIX(XML_ATTRIBUTE_NODE));
21
+ rb_define_const(cXMLTree, "TEXT_NODE", INT2FIX(XML_TEXT_NODE));
22
+ rb_define_const(cXMLTree, "CDATA_SECTION_NODE", INT2FIX(XML_CDATA_SECTION_NODE));
23
+ rb_define_const(cXMLTree, "ENTITY_REF_NODE", INT2FIX(XML_ENTITY_REF_NODE));
24
+ rb_define_const(cXMLTree, "ENTITY_NODE", INT2FIX(XML_ENTITY_NODE));
25
+ rb_define_const(cXMLTree, "PI_NODE", INT2FIX(XML_PI_NODE));
26
+ rb_define_const(cXMLTree, "COMMENT_NODE", INT2FIX(XML_COMMENT_NODE));
27
+ rb_define_const(cXMLTree, "DOCUMENT_NODE", INT2FIX(XML_DOCUMENT_NODE));
28
+ rb_define_const(cXMLTree, "DOCUMENT_TYPE_NODE", INT2FIX(XML_DOCUMENT_TYPE_NODE));
29
+ rb_define_const(cXMLTree, "DOCUMENT_FRAG_NODE", INT2FIX(XML_DOCUMENT_FRAG_NODE));
30
+ rb_define_const(cXMLTree, "NOTATION_NODE", INT2FIX(XML_NOTATION_NODE));
31
+ rb_define_const(cXMLTree, "HTML_DOCUMENT_NODE", INT2FIX(XML_HTML_DOCUMENT_NODE));
32
+ rb_define_const(cXMLTree, "DTD_NODE", INT2FIX(XML_DTD_NODE));
33
+ rb_define_const(cXMLTree, "ELEMENT_DECL", INT2FIX(XML_ELEMENT_DECL));
34
+ rb_define_const(cXMLTree, "ATTRIBUTE_DECL", INT2FIX(XML_ATTRIBUTE_DECL));
35
+ rb_define_const(cXMLTree, "ENTITY_DECL", INT2FIX(XML_ENTITY_DECL));
36
+ rb_define_const(cXMLTree, "NAMESPACE_DECL", INT2FIX(XML_NAMESPACE_DECL));
37
+ rb_define_const(cXMLTree, "XINCLUDE_START", INT2FIX(XML_XINCLUDE_START));
38
+ rb_define_const(cXMLTree, "XINCLUDE_END", INT2FIX(XML_XINCLUDE_END));
39
+
40
+ #ifdef LIBXML_DOCB_ENABLED
41
+ rb_define_const(cXMLTree, "DOCB_DOCUMENT_NODE", INT2FIX(XML_DOCB_DOCUMENT_NODE));
42
+ #endif
43
+ }
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_tree.h 225 2007-12-07 04:58:09Z transami $ */
1
+ /* $Id: ruby_xml_tree.h 39 2006-02-21 20:40:16Z roscopeco $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4
 
@@ -1,20 +1,20 @@
1
- /* $Id: ruby_xml_xinclude.c 225 2007-12-07 04:58:09Z transami $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #include "libxml.h"
6
- #include "ruby_xml_xinclude.h"
7
-
8
- VALUE cXMLXInclude;
9
- VALUE eXMLXIncludeError;
10
-
11
- // Rdoc needs to know
12
- #ifdef RDOC_NEVER_DEFINED
13
- mXML = rb_define_module("XML");
14
- #endif
15
-
16
- void
17
- ruby_init_xml_xinclude(void) {
18
- cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
19
- eXMLXIncludeError = rb_define_class_under(cXMLXInclude, "Error", rb_eRuntimeError);
20
- }
1
+ /* $Id: ruby_xml_xinclude.c 300 2008-07-01 19:14:15Z cfis $ */
2
+
3
+ /* Please see the LICENSE file for copyright and distribution information */
4
+
5
+ #include "ruby_libxml.h"
6
+ #include "ruby_xml_xinclude.h"
7
+
8
+ VALUE cXMLXInclude;
9
+ VALUE eXMLXIncludeError;
10
+
11
+ // Rdoc needs to know
12
+ #ifdef RDOC_NEVER_DEFINED
13
+ mXML = rb_define_module("XML");
14
+ #endif
15
+
16
+ void
17
+ ruby_init_xml_xinclude(void) {
18
+ cXMLXInclude = rb_define_class_under(mXML, "XInclude", rb_cObject);
19
+ eXMLXIncludeError = rb_define_class_under(cXMLXInclude, "Error", rb_eRuntimeError);
20
+ }
@@ -1,4 +1,4 @@
1
- /* $Id: ruby_xml_xinclude.h 225 2007-12-07 04:58:09Z transami $ */
1
+ /* $Id: ruby_xml_xinclude.h 39 2006-02-21 20:40:16Z roscopeco $ */
2
2
 
3
3
  /* Please see the LICENSE file for copyright and distribution information */
4
4