leptris 1.9.232.0 → 1.9.232.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5716284785d7f3ff534b89dbacab287b7479ffe7ab66609db4c0df0cdab2ad0
4
- data.tar.gz: fa2e4f4a8ab6e5e2aed150b6ee246c63a5711853c72c33179012db27d6122a4d
3
+ metadata.gz: 930bd899886c49109f40ce372e089ea775208a8fbf936f480bd6d7ff54b75af1
4
+ data.tar.gz: 67272e8d6523e527136c00dc22fe6e43fdb544d382dfb264e938280887c94d90
5
5
  SHA512:
6
- metadata.gz: e2737c46a2462a96a9f98e17106fc7ca921d9f5718273b5a2a6abd424e6351feff2a3af1ac716ee5b54dda923cd68f9b8adc2f044935cc6838b24204474b727b
7
- data.tar.gz: c3e1340928ec767dc669960b09e83c74f000b559c6a90607e5ec9a5316cc25077d6e7564c90fea50d4900180ce0fb6d1ceb33fc916753e252c7d452e17aaca64
6
+ metadata.gz: ece58bfa9c03ac493493fe72be20e998043158b87e10e83228c4f099e4f87032f9969334a52190868fc89b288b83a028cdae88df66e48296517d402bedf0f937
7
+ data.tar.gz: 0013a56c78fc813ac9863f293ad77dc6818de54d07cb7e7ef2ee8ed1cc2c69173feec20a62700a968174d8914718e8117964d12da082e3938340a5964f611b49
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.232.0"
4
+ VERSION = "1.9.232.1"
5
5
  end
@@ -7,6 +7,28 @@ module Leptris
7
7
  module FFI
8
8
  extend ::FFI::Library
9
9
 
10
+ # FFI's :string return type always tags returned bytes
11
+ # ASCII-8BIT, but libleptris produces character data (UTF-8,
12
+ # the XML default encoding). Every string-returning function
13
+ # therefore uses this converter: same NUL-terminated copy
14
+ # semantics as :string, tagged UTF-8. Input arguments keep
15
+ # plain :string (Ruby-to-C reads bytes regardless of tag).
16
+ UTF8_STRING = Class.new do
17
+ include ::FFI::DataConverter
18
+
19
+ def from_native(ptr, _ctx)
20
+ return nil if ptr.null? || ptr.address.zero?
21
+
22
+ ptr.read_string.force_encoding(Encoding::UTF_8)
23
+ end
24
+
25
+ def to_native(value, _ctx)
26
+ return nil if value.nil?
27
+
28
+ ::FFI::MemoryPointer.from_string(value.to_s)
29
+ end
30
+ end.new.tap { |c| c.native_type(::FFI::Type::POINTER) }
31
+
10
32
  # The per-OS vendor directory of the ruby-platform gem
11
33
  # (zero-setup TruffleRuby/JRuby, #160): binaries for the
12
34
  # common engines' OSes under lib/leptris/vendor/<platform>/.
@@ -321,11 +343,11 @@ module Leptris
321
343
  attach_function :leptris_plan_value_kind,
322
344
  [:leptris_plan_result], :int
323
345
  attach_function :leptris_plan_value_name,
324
- [:leptris_plan_result], :string
346
+ [:leptris_plan_result], UTF8_STRING
325
347
  attach_function :leptris_plan_value_type_tag,
326
348
  [:leptris_plan_result], :uint8
327
349
  attach_function :leptris_plan_value_string,
328
- [:leptris_plan_result], :string
350
+ [:leptris_plan_result], UTF8_STRING
329
351
  attach_function :leptris_plan_value_length,
330
352
  [:leptris_plan_result], :size_t
331
353
  attach_function :leptris_plan_value_position,
@@ -335,7 +357,7 @@ module Leptris
335
357
  attach_function :leptris_plan_value_at,
336
358
  [:leptris_plan_result, :size_t], :leptris_plan_result
337
359
  attach_function :leptris_plan_value_attribute,
338
- [:leptris_plan_result, :string], :string
360
+ [:leptris_plan_result, :string], UTF8_STRING
339
361
  # #1254 (leptris 1.9.216): one-call flat attribute read —
340
362
  # parallel name/value/handle arrays, capacity-bounded; total
341
363
  # count returned (min(total, max_count) copied). Also the
@@ -367,7 +389,7 @@ module Leptris
367
389
  [:string, :size_t, :leptris_plan, :pointer],
368
390
  :leptris_plan_result
369
391
 
370
- attach_function :leptris_version, [], :string
392
+ attach_function :leptris_version, [], UTF8_STRING
371
393
  attach_function :leptris_version_components, [:pointer, :pointer, :pointer], :void
372
394
 
373
395
  # Tolerant HTML4/5 parse into the STANDARD DOM (libleptris
@@ -424,9 +446,9 @@ attach_function :leptris_parse_string,
424
446
  attach_function :leptris_entity_ref_node_create,
425
447
  [:leptris_document, :string], :leptris_node_ref
426
448
  attach_function :leptris_entity_ref_node_name,
427
- [:leptris_node_ref], :string
449
+ [:leptris_node_ref], UTF8_STRING
428
450
  attach_function :leptris_document_version,
429
- [:leptris_document], :string
451
+ [:leptris_document], UTF8_STRING
430
452
  attach_function :leptris_document_standalone,
431
453
  [:leptris_document], :int
432
454
  attach_function :leptris_document_set_version,
@@ -456,9 +478,9 @@ attach_function :leptris_parse_string,
456
478
  attach_function :leptris_document_pi_count,
457
479
  [:leptris_document], :size_t
458
480
  attach_function :leptris_document_pi_target,
459
- [:leptris_document, :size_t], :string
481
+ [:leptris_document, :size_t], UTF8_STRING
460
482
  attach_function :leptris_document_pi_data,
461
- [:leptris_document, :size_t], :string
483
+ [:leptris_document, :size_t], UTF8_STRING
462
484
  # Document-level PI removal by target or index (1.9.9, #612):
463
485
  # unlinks from the child chain; the node is pool-owned and
464
486
  # stays valid until document free.
@@ -476,13 +498,13 @@ attach_function :leptris_parse_string,
476
498
  attach_function :leptris_document_comment_count,
477
499
  [:leptris_document], :size_t
478
500
  attach_function :leptris_document_comment_content,
479
- [:leptris_document, :size_t], :string
501
+ [:leptris_document, :size_t], UTF8_STRING
480
502
  # Options-struct parse (v1.6.0): supersedes the flags variants;
481
503
  # the flags path remains bound for compatibility.
482
504
  attach_function :leptris_parse_string_ex,
483
505
  [:string, :size_t, :pointer, :pointer], :leptris_document
484
506
  attach_function :leptris_document_encoding,
485
- [:leptris_document], :string
507
+ [:leptris_document], UTF8_STRING
486
508
  attach_function :leptris_document_finalize_strings,
487
509
  [:leptris_document], :int
488
510
  attach_function :leptris_document_adopt_child,
@@ -505,10 +527,10 @@ attach_function :leptris_parse_string,
505
527
  [:leptris_element], :int
506
528
  attach_function :leptris_xinclude_is_fallback_element,
507
529
  [:leptris_element], :int
508
- attach_function :leptris_xinclude_get_href, [:leptris_element], :string
509
- attach_function :leptris_xinclude_get_parse, [:leptris_element], :string
510
- attach_function :leptris_xinclude_get_xpointer, [:leptris_element], :string
511
- attach_function :leptris_xinclude_get_encoding, [:leptris_element], :string
530
+ attach_function :leptris_xinclude_get_href, [:leptris_element], UTF8_STRING
531
+ attach_function :leptris_xinclude_get_parse, [:leptris_element], UTF8_STRING
532
+ attach_function :leptris_xinclude_get_xpointer, [:leptris_element], UTF8_STRING
533
+ attach_function :leptris_xinclude_get_encoding, [:leptris_element], UTF8_STRING
512
534
 
513
535
  attach_function :leptris_node_get_type,
514
536
  [:leptris_node_ref], :int
@@ -570,15 +592,15 @@ attach_function :leptris_parse_string,
570
592
  [:leptris_node_ref, :int, :pointer, :pointer], :int
571
593
 
572
594
  attach_function :leptris_text_node_get_content,
573
- [:leptris_node_ref], :string
595
+ [:leptris_node_ref], UTF8_STRING
574
596
  attach_function :leptris_comment_node_get_content,
575
- [:leptris_node_ref], :string
597
+ [:leptris_node_ref], UTF8_STRING
576
598
  attach_function :leptris_cdata_node_get_content,
577
- [:leptris_node_ref], :string
599
+ [:leptris_node_ref], UTF8_STRING
578
600
  attach_function :leptris_pi_node_get_target,
579
- [:leptris_node_ref], :string
601
+ [:leptris_node_ref], UTF8_STRING
580
602
  attach_function :leptris_pi_node_get_data,
581
- [:leptris_node_ref], :string
603
+ [:leptris_node_ref], UTF8_STRING
582
604
  attach_function :leptris_text_node_create,
583
605
  [:leptris_document, :string], :leptris_node_ref
584
606
  attach_function :leptris_comment_node_create,
@@ -599,9 +621,9 @@ attach_function :leptris_parse_string,
599
621
  [:leptris_node_ref, :string], :leptris_status
600
622
 
601
623
  attach_function :leptris_element_name,
602
- [:leptris_element], :string
624
+ [:leptris_element], UTF8_STRING
603
625
  attach_function :leptris_element_text,
604
- [:leptris_element], :string
626
+ [:leptris_element], UTF8_STRING
605
627
  attach_function :leptris_element_text_int,
606
628
  [:leptris_element, :int], :int
607
629
  attach_function :leptris_element_text_uint,
@@ -613,9 +635,9 @@ attach_function :leptris_parse_string,
613
635
  attach_function :leptris_element_text_bool,
614
636
  [:leptris_element, :int], :int
615
637
  attach_function :leptris_element_attribute,
616
- [:leptris_element, :string], :string
638
+ [:leptris_element, :string], UTF8_STRING
617
639
  attach_function :leptris_element_attribute_string,
618
- [:leptris_element, :string, :string], :string
640
+ [:leptris_element, :string, :string], UTF8_STRING
619
641
  attach_function :leptris_element_attribute_int,
620
642
  [:leptris_element, :string, :int], :int
621
643
  attach_function :leptris_element_attribute_uint,
@@ -632,32 +654,32 @@ attach_function :leptris_parse_string,
632
654
  # XML Namespaces 1.0 semantics; NULL/"" uri matches only
633
655
  # no-namespace attributes, xmlns declarations never match.
634
656
  attach_function :leptris_element_attribute_ns,
635
- [:leptris_element, :string, :string], :string
657
+ [:leptris_element, :string, :string], UTF8_STRING
636
658
  attach_function :leptris_element_has_attribute_ns,
637
659
  [:leptris_element, :string, :string], :int
638
660
  # libleptris 1.8.0: per-attribute prefix (name-derived) and
639
661
  # namespace URI (resolved through the owning element's
640
662
  # in-scope declarations at read time).
641
663
  attach_function :leptris_attribute_prefix,
642
- [:leptris_attribute], :string
664
+ [:leptris_attribute], UTF8_STRING
643
665
  attach_function :leptris_attribute_namespace_uri,
644
- [:leptris_attribute], :string
666
+ [:leptris_attribute], UTF8_STRING
645
667
  attach_function :leptris_element_first_attribute,
646
668
  [:leptris_element], :leptris_attribute
647
669
  attach_function :leptris_attribute_next,
648
670
  [:leptris_attribute], :leptris_attribute
649
671
  attach_function :leptris_attribute_get_name,
650
- [:leptris_attribute], :string
672
+ [:leptris_attribute], UTF8_STRING
651
673
  attach_function :leptris_attribute_get_value,
652
- [:leptris_element, :leptris_attribute], :string
674
+ [:leptris_element, :leptris_attribute], UTF8_STRING
653
675
  attach_function :leptris_element_prefix,
654
- [:leptris_element], :string
676
+ [:leptris_element], UTF8_STRING
655
677
  attach_function :leptris_element_attribute_count,
656
678
  [:leptris_element], :size_t
657
679
  attach_function :leptris_element_attribute_name_at,
658
- [:leptris_element, :size_t], :string
680
+ [:leptris_element, :size_t], UTF8_STRING
659
681
  attach_function :leptris_element_attribute_value_at,
660
- [:leptris_element, :size_t], :string
682
+ [:leptris_element, :size_t], UTF8_STRING
661
683
  attach_function :leptris_element_remove_all_attributes,
662
684
  [:leptris_element], :leptris_status
663
685
 
@@ -670,7 +692,7 @@ attach_function :leptris_parse_string,
670
692
  attach_function :leptris_element_root,
671
693
  [:leptris_element], :leptris_element
672
694
  attach_function :leptris_element_child_value,
673
- [:leptris_element], :string
695
+ [:leptris_element], UTF8_STRING
674
696
  attach_function :leptris_element_hash_value,
675
697
  [:leptris_element], :size_t
676
698
  attach_function :leptris_element_find_child,
@@ -756,23 +778,23 @@ attach_function :leptris_parse_string,
756
778
  attach_function :leptris_element_set_namespace,
757
779
  [:leptris_element, :string], :leptris_status
758
780
  attach_function :leptris_element_namespace,
759
- [:leptris_element], :string
781
+ [:leptris_element], UTF8_STRING
760
782
  attach_function :leptris_element_namespace_for_prefix,
761
- [:leptris_element, :string], :string
783
+ [:leptris_element, :string], UTF8_STRING
762
784
  attach_function :leptris_element_namespace_count,
763
785
  [:leptris_element], :size_t
764
786
  attach_function :leptris_element_namespace_decl_prefix,
765
- [:leptris_element, :size_t], :string
787
+ [:leptris_element, :size_t], UTF8_STRING
766
788
  attach_function :leptris_element_namespace_decl_uri,
767
- [:leptris_element, :size_t], :string
789
+ [:leptris_element, :size_t], UTF8_STRING
768
790
  attach_function :leptris_element_add_namespace_definition,
769
791
  [:leptris_element, :string, :string], :leptris_status
770
792
  attach_function :leptris_element_set_default_namespace,
771
793
  [:leptris_element, :string], :leptris_status
772
794
  attach_function :leptris_element_remove_namespace_definition,
773
795
  [:leptris_element, :string], :leptris_status
774
- attach_function :leptris_namespace_uri, [:string], :string
775
- attach_function :leptris_namespace_prefix, [:string], :string
796
+ attach_function :leptris_namespace_uri, [:string], UTF8_STRING
797
+ attach_function :leptris_namespace_prefix, [:string], UTF8_STRING
776
798
 
777
799
  attach_function :leptris_xpath_eval,
778
800
  [:leptris_document, :leptris_element, :string], :leptris_xpath_result
@@ -807,9 +829,9 @@ attach_function :leptris_parse_string,
807
829
  attach_function :leptris_xpath_result_get_node,
808
830
  [:leptris_xpath_result, :size_t], :leptris_node_ref
809
831
  attach_function :leptris_xpath_result_node_name,
810
- [:leptris_xpath_result, :size_t], :string
832
+ [:leptris_xpath_result, :size_t], UTF8_STRING
811
833
  attach_function :leptris_xpath_result_node_value,
812
- [:leptris_xpath_result, :size_t], :string
834
+ [:leptris_xpath_result, :size_t], UTF8_STRING
813
835
  # Document-scoped custom XPath functions. The callback receives
814
836
  # (const char* const* args, int argc, void* user_data) and returns
815
837
  # a heap string the library frees.
@@ -877,7 +899,7 @@ attach_function :leptris_parse_string,
877
899
  :leptris_xpath_result
878
900
  # Source text of a compiled expression (owned by the handle).
879
901
  attach_function :leptris_xpath_compiled_text,
880
- [:leptris_xpath_compiled], :string
902
+ [:leptris_xpath_compiled], UTF8_STRING
881
903
  attach_function :leptris_xpath_compiled_free,
882
904
 
883
905
  [:leptris_xpath_compiled], :void
@@ -922,9 +944,9 @@ attach_function :leptris_parse_string,
922
944
  attach_function :leptris_pull_attr_count,
923
945
  [:leptris_pull_parser], :size_t
924
946
  attach_function :leptris_pull_attr_name,
925
- [:leptris_pull_parser, :size_t], :string
947
+ [:leptris_pull_parser, :size_t], UTF8_STRING
926
948
  attach_function :leptris_pull_attr_value,
927
- [:leptris_pull_parser, :size_t], :string
949
+ [:leptris_pull_parser, :size_t], UTF8_STRING
928
950
  attach_function :leptris_pull_attrs,
929
951
  [:leptris_pull_parser, :pointer, :size_t], :size_t
930
952
  attach_function :leptris_pull_free,
@@ -948,9 +970,9 @@ attach_function :leptris_parse_string,
948
970
  attach_function :leptris_iterparse_ns_count,
949
971
  [:leptris_iterparse], :size_t
950
972
  attach_function :leptris_iterparse_ns_uri,
951
- [:leptris_iterparse, :string], :string
973
+ [:leptris_iterparse, :string], UTF8_STRING
952
974
  attach_function :leptris_iterparse_error,
953
- [:leptris_iterparse], :string
975
+ [:leptris_iterparse], UTF8_STRING
954
976
  attach_function :leptris_iterparse_free,
955
977
  [:leptris_iterparse], :void
956
978
 
@@ -1020,7 +1042,7 @@ attach_function :leptris_parse_string,
1020
1042
  attach_function :leptris_sax_records_data, [:pointer], :pointer
1021
1043
  attach_function :leptris_sax_records_attrs,
1022
1044
  [:pointer, :pointer], :pointer
1023
- attach_function :leptris_sax_records_buffer, [:pointer], :string
1045
+ attach_function :leptris_sax_records_buffer, [:pointer], UTF8_STRING
1024
1046
  attach_function :leptris_sax_records_free, [:pointer], :void
1025
1047
  # XSLT 1.0 engine (libleptris 1.9.1): compile once, apply many.
1026
1048
  # XQuery 1.0 core (libleptris 1.9.64-1.9.66): orchestration
@@ -1061,7 +1083,7 @@ attach_function :leptris_parse_string,
1061
1083
  attach_function :leptris_schematron_validate,
1062
1084
  [:leptris_schematron, :leptris_document], :leptris_document
1063
1085
  attach_function :leptris_schematron_error,
1064
- [:leptris_schematron], :string
1086
+ [:leptris_schematron], UTF8_STRING
1065
1087
 
1066
1088
  # Tree diff (libleptris >= 1.9.126 family): equal subtrees
1067
1089
  # prune in O(1) by the #869 Merkle digest; diverging regions
@@ -1074,13 +1096,13 @@ attach_function :leptris_parse_string,
1074
1096
  attach_function :leptris_diff_op_type,
1075
1097
  [:leptris_diff, :size_t], :int
1076
1098
  attach_function :leptris_diff_op_name,
1077
- [:leptris_diff, :size_t], :string
1099
+ [:leptris_diff, :size_t], UTF8_STRING
1078
1100
  attach_function :leptris_diff_op_path,
1079
- [:leptris_diff, :size_t], :string
1101
+ [:leptris_diff, :size_t], UTF8_STRING
1080
1102
  attach_function :leptris_diff_op_before,
1081
- [:leptris_diff, :size_t], :string
1103
+ [:leptris_diff, :size_t], UTF8_STRING
1082
1104
  attach_function :leptris_diff_op_after,
1083
- [:leptris_diff, :size_t], :string
1105
+ [:leptris_diff, :size_t], UTF8_STRING
1084
1106
  attach_function :leptris_diff_serialize,
1085
1107
  [:leptris_diff], :pointer
1086
1108
 
@@ -1127,14 +1149,14 @@ attach_function :leptris_parse_string,
1127
1149
  attach_function :leptris_rng_validate,
1128
1150
  [:leptris_relaxng, :leptris_document], :int
1129
1151
  attach_function :leptris_rng_error,
1130
- [:leptris_relaxng], :string
1152
+ [:leptris_relaxng], UTF8_STRING
1131
1153
  # Accumulated validation errors (libleptris 1.9.179, #878):
1132
1154
  # the validator no longer stops at the first failure;
1133
1155
  # leptris_rng_error keeps returning the first (back-compat).
1134
1156
  attach_function :leptris_rng_error_count,
1135
1157
  [:leptris_relaxng], :size_t
1136
1158
  attach_function :leptris_rng_error_message,
1137
- [:leptris_relaxng, :size_t], :string
1159
+ [:leptris_relaxng, :size_t], UTF8_STRING
1138
1160
  attach_function :leptris_rng_error_line,
1139
1161
  [:leptris_relaxng, :size_t], :int
1140
1162
  attach_function :leptris_rng_error_column,
@@ -1182,15 +1204,15 @@ attach_function :leptris_parse_string,
1182
1204
  attach_function :leptris_document_internal_subset,
1183
1205
  [:leptris_document], :leptris_doctype
1184
1206
  attach_function :leptris_doctype_get_name,
1185
- [:leptris_doctype], :string
1207
+ [:leptris_doctype], UTF8_STRING
1186
1208
  attach_function :leptris_doctype_get_root_name,
1187
- [:leptris_doctype], :string
1209
+ [:leptris_doctype], UTF8_STRING
1188
1210
  attach_function :leptris_doctype_get_public_id,
1189
- [:leptris_doctype], :string
1211
+ [:leptris_doctype], UTF8_STRING
1190
1212
  attach_function :leptris_doctype_get_system_id,
1191
- [:leptris_doctype], :string
1213
+ [:leptris_doctype], UTF8_STRING
1192
1214
  attach_function :leptris_doctype_get_internal_subset,
1193
- [:leptris_doctype], :string
1215
+ [:leptris_doctype], UTF8_STRING
1194
1216
 
1195
1217
  attach_function :leptris_free_string, [:pointer], :void
1196
1218
  attach_function :leptris_explicit_cleanup, [], :void
@@ -1200,8 +1222,8 @@ attach_function :leptris_parse_string,
1200
1222
  attach_function :leptris_get_memory_deallocation_function, [], :pointer
1201
1223
  attach_function :leptris_document_set_allocators,
1202
1224
  [:leptris_document, :pointer, :pointer], :leptris_status
1203
- attach_function :leptris_status_string, [:leptris_status], :string
1204
- attach_function :leptris_error_message, [:leptris_status], :string
1225
+ attach_function :leptris_status_string, [:leptris_status], UTF8_STRING
1226
+ attach_function :leptris_error_message, [:leptris_status], UTF8_STRING
1205
1227
  # Engine surface adopted with libleptris 1.9.206 (the FFI
1206
1228
  # mirror audit keeps attachments and exports in lockstep):
1207
1229
  # recover diagnostics (#1200), the standalone DTD family
@@ -1235,9 +1257,9 @@ attach_function :leptris_parse_string,
1235
1257
  [:pointer, :pointer], :void
1236
1258
  # Thread-local since v1.3.0; reliable under the
1237
1259
  # one-document-per-thread contract.
1238
- attach_function :leptris_last_error, [], :string
1260
+ attach_function :leptris_last_error, [], UTF8_STRING
1239
1261
  attach_function :leptris_document_last_error,
1240
- [:leptris_document], :string
1262
+ [:leptris_document], UTF8_STRING
1241
1263
  # Optional: release per-thread registry entries when a worker
1242
1264
  # thread exits (long-lived threads never need it).
1243
1265
  attach_function :leptris_thread_cleanup, [], :void
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.232.0
4
+ version: 1.9.232.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.