libxml-ruby 3.2.4-x64-mingw-ucrt → 4.1.1-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 133d86e0978fad8ee63caac2b000d64528da03c5141e484327dc1bd443f85ad5
4
- data.tar.gz: 3d43359e5daed2d0e6ea23481aaf405aa9422419edaefe8a51d18767c463c052
3
+ metadata.gz: d6eefbf4cf6f18a76d82973c0c297dd1ef37892a83ec1eea6b2b8a041e51a905
4
+ data.tar.gz: 427764544b4ca067c643cb9d504502dc56d22c4a722be2b7248016edd282b098
5
5
  SHA512:
6
- metadata.gz: 7b91fe3b0daa9a90706a531e552ff16a3e785612e259aa7e379d9e948f72c0d2738c34a33a5e5697cee6ba4cb43c991e657347e40d35a13f749c494a64e54bea
7
- data.tar.gz: 68afd10bef5ba4f05bdc275b526c319c0d6f98492ba039bff0ce599b58c5eeb72789669a361175491cca6225934a053054955a36ad4833d3bd5a79eee7e4da3d
6
+ metadata.gz: 9314838d6d6cbe1f0d87e48d2037ec3ad20eb70371f8022f5244a9a15b3d515bd901e577ebae90a39e7a36667bc5a0505e4ccc210471c3787dbf788adb396ec4
7
+ data.tar.gz: f1409c4f6e05cdd89e1596f49760b62ef1a65d22da343913488e74ee9d52c6a7c87019ceb61f958b1217064249d0f9a1ce3ee2fbd776ff234c67543a1ecd1d81
data/HISTORY CHANGED
@@ -1,5 +1,20 @@
1
1
  = Release History
2
2
 
3
+ == 4.1.1 / 2023-05-01
4
+
5
+ * Fix compile warning (or error) for input_callbacks_register_input_callbacks (Charlie Savage)
6
+ * Remove call to deprecated function htmlDefaultSAXHandlerInit (Charlie Savage)
7
+
8
+ == 4.1.0 / 2023-04-30
9
+
10
+ * Fix compile warning (or error) for rxml_encoding_to_rb_encoding (Charlie Savage)
11
+ * Breaking - Remove LibXML::XML.features since its uses functionality deprecated in LibXML (Charlie Savage)
12
+
13
+ == 4.0.0 / 2022-12-28
14
+
15
+ * Breaking - Remove support for XPointer since libxml2 has deprecated it and will remove it (Charlie Savage)
16
+ * Breaking - Remove support for ancient setup.rb script (Charlie Savage)
17
+
3
18
  == 3.2.4 / 2022-10-29
4
19
 
5
20
  * Support libxml2 version 2.10.2 (Charlie Savage)
data/ext/libxml/libxml.c CHANGED
@@ -67,7 +67,6 @@ void Init_libxml_ruby(void)
67
67
  rxml_init_xpath_object();
68
68
  rxml_init_xpath_context();
69
69
  rxml_init_xpath_expression();
70
- rxml_init_xpointer();
71
70
  rxml_init_html_parser();
72
71
  rxml_init_html_parser_options();
73
72
  rxml_init_html_parser_context();
@@ -25,7 +25,6 @@ cXMLXInclude DATA
25
25
  cXMLXPathContext DATA
26
26
  cXMLXPathExpression DATA
27
27
  cXMLXPathObject DATA
28
- cXMLXPointer DATA
29
28
  eXMLError DATA
30
29
  mLibXML DATA
31
30
  mXML DATA
@@ -34,7 +34,6 @@
34
34
  #include "ruby_xml_xpath_expression.h"
35
35
  #include "ruby_xml_xpath_context.h"
36
36
  #include "ruby_xml_xpath_object.h"
37
- #include "ruby_xml_xpointer.h"
38
37
  #include "ruby_xml_input_cbg.h"
39
38
  #include "ruby_xml_dtd.h"
40
39
  #include "ruby_xml_schema.h"
@@ -479,7 +479,7 @@ static VALUE rxml_default_line_numbers_set(VALUE klass, VALUE value)
479
479
  }
480
480
  }
481
481
 
482
- int rxml_libxml_default_options()
482
+ int rxml_libxml_default_options(void)
483
483
  {
484
484
  int options = 0;
485
485
 
@@ -757,45 +757,6 @@ static VALUE rxml_default_save_no_empty_tags_set(VALUE klass, VALUE value)
757
757
  }
758
758
  }
759
759
 
760
- /*
761
- * call-seq:
762
- * XML.features -> ["feature", ..., "feature"]
763
- *
764
- * Obtains an array of strings representing features supported
765
- * (and enabled) by the installed libxml.
766
- */
767
- static VALUE rxml_features(VALUE klass)
768
- {
769
- #ifndef LIBXML_LEGACY_ENABLED
770
- return Qnil;
771
- #else
772
- VALUE arr, str;
773
- int i, len = MAX_LIBXML_FEATURES_LEN;
774
- char **list = NULL;
775
-
776
- list = ALLOC_N(char *,MAX_LIBXML_FEATURES_LEN);
777
- MEMZERO(list, char *, MAX_LIBXML_FEATURES_LEN);
778
-
779
- arr = rb_ary_new();
780
- if (xmlGetFeaturesList(&len, (const char **) list) == -1)
781
- return Qnil;
782
-
783
- for (i = 0; i < len; i++)
784
- {
785
- str = rb_str_new2((const char *) list[i]);
786
- rb_gc_unregister_address(&str);
787
- rb_ary_push(arr, str);
788
- }
789
-
790
- if (len == MAX_LIBXML_FEATURES_LEN)
791
- rb_warn(
792
- "Please contact libxml-devel@rubyforge.org and ask to have the \"MAX_LIBXML_FEATURES_LEN increased\" because you could possibly be seeing an incomplete list");
793
-
794
- ruby_xfree(list);
795
- return (arr);
796
- #endif /* LIBXML_LEGACY_ENABLED */
797
- }
798
-
799
760
  /*
800
761
  * call-seq:
801
762
  * XML.indent_tree_output -> (true|false)
@@ -931,7 +892,6 @@ void rxml_init_xml(void)
931
892
  rb_define_module_function(mXML, "default_warnings=", rxml_default_warnings_set, 1);
932
893
  rb_define_module_function(mXML, "default_save_no_empty_tags", rxml_default_save_no_empty_tags_get, 0);
933
894
  rb_define_module_function(mXML, "default_save_no_empty_tags=", rxml_default_save_no_empty_tags_set, 1);
934
- rb_define_module_function(mXML, "features", rxml_features, 0);
935
895
  rb_define_module_function(mXML, "indent_tree_output", rxml_indent_tree_output_get, 0);
936
896
  rb_define_module_function(mXML, "indent_tree_output=", rxml_indent_tree_output_set, 1);
937
897
  rb_define_module_function(mXML, "memory_dump", rxml_memory_dump, 0);
@@ -4,7 +4,7 @@
4
4
  #define __RUBY_XML_H__
5
5
 
6
6
  extern VALUE mXML;
7
- int rxml_libxml_default_options();
7
+ int rxml_libxml_default_options(void);
8
8
  void rxml_init_xml(void);
9
9
 
10
10
  #endif
@@ -79,7 +79,7 @@ int deb_Close(void *context)
79
79
  return 1;
80
80
  }
81
81
 
82
- void deb_register_cbg()
82
+ void deb_register_cbg(void)
83
83
  {
84
84
  xmlRegisterInputCallbacks(deb_Match, deb_Open, deb_Read, deb_Close);
85
85
  }
@@ -235,7 +235,7 @@ static VALUE rxml_dtd_initialize(int argc, VALUE *argv, VALUE self)
235
235
  return self;
236
236
  }
237
237
 
238
- void rxml_init_dtd()
238
+ void rxml_init_dtd(void)
239
239
  {
240
240
  cXMLDtd = rb_define_class_under(mXML, "Dtd", rb_cObject);
241
241
  rb_define_alloc_func(cXMLDtd, rxml_dtd_alloc);
@@ -182,7 +182,7 @@ rb_encoding* rxml_figure_encoding(const xmlChar* xencoding)
182
182
  VALUE rxml_new_cstr(const xmlChar* xstr, const xmlChar* xencoding)
183
183
  {
184
184
  rb_encoding *rbencoding = rxml_figure_encoding(xencoding);
185
- return rb_external_str_new_with_enc((const char*)xstr, strlen((const char*)xstr), rbencoding);
185
+ return rb_external_str_new_with_enc((const char*)xstr, (long)strlen((const char*)xstr), rbencoding);
186
186
  }
187
187
 
188
188
  VALUE rxml_new_cstr_len(const xmlChar* xstr, const long length, const xmlChar* xencoding)
@@ -197,7 +197,7 @@ void rxml_init_encoding(void)
197
197
  rb_define_module_function(mXMLEncoding, "from_s", rxml_encoding_from_s, 1);
198
198
  rb_define_module_function(mXMLEncoding, "to_s", rxml_encoding_to_s, 1);
199
199
 
200
- rb_define_module_function(mXMLEncoding, "to_rb_encoding", rxml_encoding_to_rb_encoding, 2);
200
+ rb_define_module_function(mXMLEncoding, "to_rb_encoding", rxml_encoding_to_rb_encoding, 1);
201
201
 
202
202
  /* -1: No char encoding detected. */
203
203
  rb_define_const(mXMLEncoding, "ERROR", INT2NUM(XML_CHAR_ENCODING_ERROR));
@@ -44,7 +44,7 @@ static ID ERROR_HANDLER_ID;
44
44
  * Returns the proc that will be called when libxml generates
45
45
  * warning, error or fatal error messages.
46
46
  */
47
- static VALUE rxml_error_get_handler()
47
+ static VALUE rxml_error_get_handler(VALUE self)
48
48
  {
49
49
  VALUE block = rb_cvar_get(eXMLError, ERROR_HANDLER_ID);
50
50
  return block;
@@ -102,7 +102,7 @@ static void structuredErrorFunc(void *userData, xmlErrorPtr xerror)
102
102
  VALUE error = rxml_error_wrap(xerror);
103
103
 
104
104
  /* Wrap error up as Ruby object and send it off to ruby */
105
- VALUE block = rxml_error_get_handler();
105
+ VALUE block = rxml_error_get_handler(error);
106
106
 
107
107
  /* Now call global handler */
108
108
  if (block != Qnil)
@@ -165,7 +165,7 @@ NORETURN(void rxml_raise(xmlErrorPtr xerror))
165
165
  rb_exc_raise(error);
166
166
  }
167
167
 
168
- void rxml_init_error()
168
+ void rxml_init_error(void)
169
169
  {
170
170
  CALL_METHOD = rb_intern("call");
171
171
  ERROR_HANDLER_ID = rb_intern("@@__error_handler_callback__");
@@ -7,7 +7,7 @@
7
7
 
8
8
  extern VALUE eXMLError;
9
9
 
10
- void rxml_init_error();
10
+ void rxml_init_error(void);
11
11
  VALUE rxml_error_wrap(xmlErrorPtr xerror);
12
12
  NORETURN(void rxml_raise(xmlErrorPtr xerror));
13
13
 
@@ -243,7 +243,6 @@ static VALUE rxml_html_parser_context_string(VALUE klass, VALUE string)
243
243
  sets to 0 and xmlCtxtUseOptionsInternal sets to 1. So we have to call both. */
244
244
  htmlCtxtUseOptions(ctxt, rxml_libxml_default_options());
245
245
 
246
- htmlDefaultSAXHandlerInit();
247
246
  if (ctxt->sax != NULL)
248
247
  memcpy(ctxt->sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1));
249
248
 
@@ -88,7 +88,7 @@ int ic_close(void *context)
88
88
  *
89
89
  * Register a new set of I/O callback for handling parser input.
90
90
  */
91
- static VALUE input_callbacks_register_input_callbacks()
91
+ static VALUE input_callbacks_register_input_callbacks(VALUE self)
92
92
  {
93
93
  xmlRegisterInputCallbacks(ic_match, ic_open, ic_read, ic_close);
94
94
  return (Qtrue);
@@ -182,10 +182,7 @@ void rxml_init_input_callbacks(void)
182
182
  cInputCallbacks = rb_define_class_under(mXML, "InputCallbacks", rb_cObject);
183
183
 
184
184
  /* Class Methods */
185
- rb_define_singleton_method(cInputCallbacks, "register",
186
- input_callbacks_register_input_callbacks, 0);
187
- rb_define_singleton_method(cInputCallbacks, "add_scheme",
188
- input_callbacks_add_scheme, 2);
189
- rb_define_singleton_method(cInputCallbacks, "remove_scheme",
190
- input_callbacks_remove_scheme, 1);
185
+ rb_define_singleton_method(cInputCallbacks, "register", input_callbacks_register_input_callbacks, 0);
186
+ rb_define_singleton_method(cInputCallbacks, "add_scheme", input_callbacks_add_scheme, 2);
187
+ rb_define_singleton_method(cInputCallbacks, "remove_scheme", input_callbacks_remove_scheme, 1);
191
188
  }
@@ -30,7 +30,7 @@ int rxml_write_callback(VALUE io, const char *buffer, int len)
30
30
  {
31
31
  // Could be StringIO
32
32
  VALUE written, string;
33
- string = rb_external_str_new_with_enc(buffer, strlen(buffer), rb_enc_get(io));
33
+ string = rb_external_str_new_with_enc(buffer, (long)strlen(buffer), rb_enc_get(io));
34
34
  written = rb_funcall(io, WRITE_METHOD, 1, string);
35
35
  return NUM2INT(written);
36
36
  }
@@ -1001,17 +1001,6 @@ static VALUE rxml_node_path(VALUE self)
1001
1001
  return result;
1002
1002
  }
1003
1003
 
1004
- /*
1005
- * call-seq:
1006
- * node.pointer -> XML::NodeSet
1007
- *
1008
- * Evaluates an XPointer expression relative to this node.
1009
- */
1010
- static VALUE rxml_node_pointer(VALUE self, VALUE xptr_str)
1011
- {
1012
- return (rxml_xpointer_point2(self, xptr_str));
1013
- }
1014
-
1015
1004
  /*
1016
1005
  * call-seq:
1017
1006
  * node.prev -> XML::Node
@@ -1397,7 +1386,6 @@ void rxml_init_node(void)
1397
1386
  rb_define_method(cXMLNode, "output_escaping?", rxml_node_output_escaping_q, 0);
1398
1387
  rb_define_method(cXMLNode, "output_escaping=", rxml_node_output_escaping_set, 1);
1399
1388
  rb_define_method(cXMLNode, "path", rxml_node_path, 0);
1400
- rb_define_method(cXMLNode, "pointer", rxml_node_pointer, 1);
1401
1389
  rb_define_method(cXMLNode, "remove!", rxml_node_remove_ex, 0);
1402
1390
  rb_define_method(cXMLNode, "space_preserve", rxml_node_space_preserve_get, 0);
1403
1391
  rb_define_method(cXMLNode, "space_preserve=", rxml_node_space_preserve_set, 1);
@@ -3,8 +3,6 @@
3
3
  #ifndef __RXML_PARSER__
4
4
  #define __RXML_PARSER__
5
5
 
6
- #define MAX_LIBXML_FEATURES_LEN 50
7
-
8
6
  extern VALUE cXMLParser;
9
7
 
10
8
  void rxml_init_parser();
@@ -3,8 +3,6 @@
3
3
  #ifndef __RXML_PARSER_OPTIONS__
4
4
  #define __RXML_PARSER_OPTIONS__
5
5
 
6
- #define MAX_LIBXML_FEATURES_LEN 50
7
-
8
6
  extern VALUE mXMLParserOptions;
9
7
 
10
8
  void rxml_init_parser_options();
@@ -1,9 +1,9 @@
1
1
  /* Don't nuke this block! It is used for automatically updating the
2
2
  * versions below. VERSION = string formatting, VERNUM = numbered
3
3
  * version for inline testing: increment both or none at all.*/
4
- #define RUBY_LIBXML_VERSION "3.2.4"
5
- #define RUBY_LIBXML_VERNUM 324
6
- #define RUBY_LIBXML_VER_MAJ 3
7
- #define RUBY_LIBXML_VER_MIN 2
8
- #define RUBY_LIBXML_VER_MIC 4
4
+ #define RUBY_LIBXML_VERSION "4.1.1"
5
+ #define RUBY_LIBXML_VERNUM 400
6
+ #define RUBY_LIBXML_VER_MAJ 4
7
+ #define RUBY_LIBXML_VER_MIN 1
8
+ #define RUBY_LIBXML_VER_MIC 1
9
9
  #define RUBY_LIBXML_VER_PATCH 0
Binary file
Binary file
data/lib/libxml/error.rb CHANGED
@@ -3,24 +3,24 @@
3
3
  module LibXML
4
4
  module XML
5
5
  class Error
6
- # Create mapping from domain constant value to keys
6
+ # Create mapping from domain constant values to keys
7
7
  DOMAIN_CODE_MAP = [:NO_ERROR, :PARSER, :TREE, :NAMESPACE, :DTD, :HTML, :MEMORY,
8
8
  :OUTPUT, :IO, :FTP, :HTTP, :XINCLUDE, :XPATH, :XPOINTER, :REGEXP,
9
9
  :DATATYPE, :SCHEMASP, :SCHEMASV, :RELAXNGP, :RELAXNGV, :CATALOG,
10
10
  :C14N, :XSLT, :VALID, :CHECK, :WRITER, :MODULE, :I18N, :SCHEMATRONV].inject(Hash.new) do |hash, code|
11
11
  if const_defined?(code)
12
- hash[const_get(code)] = code.to_s
12
+ hash[const_get(code)] = code
13
13
  end
14
14
  hash
15
15
  end
16
16
 
17
- # Create mapping from domain constant value to keys
17
+ # Create mapping from error constant values (so need to remove domain_codes) to keys
18
18
  ERROR_CODE_MAP = Hash.new.tap do |map|
19
19
  (constants -
20
20
  DOMAIN_CODE_MAP.values - #Domains
21
21
  [:NONE, :WARNING, :ERROR, :FATAL] # Levels
22
22
  ).each do |code|
23
- map[const_get(code)] = code.to_s
23
+ map[const_get(code)] = code
24
24
  end
25
25
  end
26
26
 
@@ -70,11 +70,11 @@ module LibXML
70
70
  end
71
71
 
72
72
  def domain_to_s
73
- DOMAIN_CODE_MAP[self.domain]
73
+ DOMAIN_CODE_MAP[self.domain].to_s
74
74
  end
75
75
 
76
76
  def code_to_s
77
- ERROR_CODE_MAP[self.code]
77
+ ERROR_CODE_MAP[self.code].to_s
78
78
  end
79
79
 
80
80
  def to_s
@@ -92,4 +92,4 @@ module LibXML
92
92
  end
93
93
  end
94
94
 
95
- LibXML::XML::Error.set_handler(&LibXML::XML::Error::VERBOSE_HANDLER)
95
+ LibXML::XML::Error.set_handler(&LibXML::XML::Error::VERBOSE_HANDLER)
data/lib/libxml-ruby.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  begin
5
5
  RUBY_VERSION =~ /(\d+.\d+)/
6
6
  require "#{$1}/libxml_ruby"
7
- rescue LoadError => e
7
+ rescue LoadError
8
8
  require "libxml_ruby"
9
9
  end
10
10