libxml-ruby 5.0.5 → 5.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +7 -0
  3. data/Rakefile +98 -98
  4. data/ext/libxml/extconf.h +1 -0
  5. data/ext/libxml/libxml.c +79 -79
  6. data/ext/libxml/ruby_xml_attr.c +333 -333
  7. data/ext/libxml/ruby_xml_attr.h +12 -12
  8. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  9. data/ext/libxml/ruby_xml_cbg.c +85 -85
  10. data/ext/libxml/ruby_xml_dtd.h +9 -9
  11. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  12. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  13. data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
  14. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  15. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  16. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  17. data/ext/libxml/ruby_xml_io.c +47 -47
  18. data/ext/libxml/ruby_xml_io.h +10 -10
  19. data/ext/libxml/ruby_xml_namespace.h +10 -10
  20. data/ext/libxml/ruby_xml_namespaces.c +293 -293
  21. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  22. data/ext/libxml/ruby_xml_node.h +13 -13
  23. data/ext/libxml/ruby_xml_parser.c +91 -91
  24. data/ext/libxml/ruby_xml_parser_context.h +10 -10
  25. data/ext/libxml/ruby_xml_reader.h +14 -14
  26. data/ext/libxml/ruby_xml_relaxng.h +8 -8
  27. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  28. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  29. data/ext/libxml/ruby_xml_schema.h +25 -25
  30. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  31. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  32. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  33. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  34. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  35. data/ext/libxml/ruby_xml_version.h +2 -2
  36. data/ext/libxml/ruby_xml_writer.c +1124 -1124
  37. data/ext/libxml/ruby_xml_writer.h +6 -6
  38. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  39. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  40. data/ext/libxml/ruby_xml_xpath.c +195 -195
  41. data/ext/libxml/ruby_xml_xpath.h +15 -15
  42. data/ext/libxml/ruby_xml_xpath_context.c +362 -362
  43. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  44. data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
  45. data/ext/libxml/ruby_xml_xpath_object.h +17 -17
  46. data/lib/libxml-ruby.rb +2 -2
  47. data/test/test_error.rb +5 -2
  48. data/test/test_helper.rb +1 -0
  49. data/test/test_writer.rb +500 -468
  50. metadata +3 -4
  51. data/test/test.rb +0 -5
@@ -1,47 +1,47 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #include "ruby_libxml.h"
4
- #include <ruby/io.h>
5
-
6
- static ID READ_METHOD;
7
- static ID WRITE_METHOD;
8
-
9
- /* This method is called by libxml when it wants to read
10
- more data from a stream. We go with the duck typing
11
- solution to support StringIO objects. */
12
- int rxml_read_callback(void *context, char *buffer, int len)
13
- {
14
- VALUE io = (VALUE) context;
15
- VALUE string = rb_funcall(io, READ_METHOD, 1, INT2NUM(len));
16
- size_t size;
17
-
18
- if (string == Qnil)
19
- return 0;
20
-
21
- size = RSTRING_LEN(string);
22
- memcpy(buffer, StringValuePtr(string), size);
23
-
24
- return (int)size;
25
- }
26
-
27
- int rxml_write_callback(VALUE io, const char *buffer, int len)
28
- {
29
- if (rb_io_check_io(io) == Qnil)
30
- {
31
- // Could be StringIO
32
- VALUE written, string;
33
- string = rb_external_str_new_with_enc(buffer, (long)strlen(buffer), rb_enc_get(io));
34
- written = rb_funcall(io, WRITE_METHOD, 1, string);
35
- return NUM2INT(written);
36
- }
37
- else
38
- {
39
- return (int)rb_io_bufwrite(io, buffer, (size_t)len);
40
- }
41
- }
42
-
43
- void rxml_init_io(void)
44
- {
45
- READ_METHOD = rb_intern("read");
46
- WRITE_METHOD = rb_intern("write");
47
- }
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #include "ruby_libxml.h"
4
+ #include <ruby/io.h>
5
+
6
+ static ID READ_METHOD;
7
+ static ID WRITE_METHOD;
8
+
9
+ /* This method is called by libxml when it wants to read
10
+ more data from a stream. We go with the duck typing
11
+ solution to support StringIO objects. */
12
+ int rxml_read_callback(void *context, char *buffer, int len)
13
+ {
14
+ VALUE io = (VALUE) context;
15
+ VALUE string = rb_funcall(io, READ_METHOD, 1, INT2NUM(len));
16
+ size_t size;
17
+
18
+ if (string == Qnil)
19
+ return 0;
20
+
21
+ size = RSTRING_LEN(string);
22
+ memcpy(buffer, StringValuePtr(string), size);
23
+
24
+ return (int)size;
25
+ }
26
+
27
+ int rxml_write_callback(VALUE io, const char *buffer, int len)
28
+ {
29
+ if (rb_io_check_io(io) == Qnil)
30
+ {
31
+ // Could be StringIO
32
+ VALUE written, string;
33
+ string = rb_external_str_new_with_enc(buffer, (long)strlen(buffer), rb_enc_get(io));
34
+ written = rb_funcall(io, WRITE_METHOD, 1, string);
35
+ return NUM2INT(written);
36
+ }
37
+ else
38
+ {
39
+ return (int)rb_io_bufwrite(io, buffer, (size_t)len);
40
+ }
41
+ }
42
+
43
+ void rxml_init_io(void)
44
+ {
45
+ READ_METHOD = rb_intern("read");
46
+ WRITE_METHOD = rb_intern("write");
47
+ }
@@ -1,10 +1,10 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_IO__
4
- #define __RXML_IO__
5
-
6
- int rxml_read_callback(void *context, char *buffer, int len);
7
- int rxml_write_callback(VALUE io, const char *buffer, int len);
8
- void rxml_init_io(void);
9
-
10
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_IO__
4
+ #define __RXML_IO__
5
+
6
+ int rxml_read_callback(void *context, char *buffer, int len);
7
+ int rxml_write_callback(VALUE io, const char *buffer, int len);
8
+ void rxml_init_io(void);
9
+
10
+ #endif
@@ -1,10 +1,10 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_NAMESPACE__
4
- #define __RXML_NAMESPACE__
5
-
6
- extern VALUE cXMLNamespace;
7
-
8
- void rxml_init_namespace(void);
9
- VALUE rxml_namespace_wrap(xmlNsPtr xns);
10
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_NAMESPACE__
4
+ #define __RXML_NAMESPACE__
5
+
6
+ extern VALUE cXMLNamespace;
7
+
8
+ void rxml_init_namespace(void);
9
+ VALUE rxml_namespace_wrap(xmlNsPtr xns);
10
+ #endif