leptris 1.9.338.0-arm-linux → 1.9.341.0-arm-linux
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 +4 -4
- data/CHANGELOG.md +33 -0
- data/Rakefile +1 -1
- data/ext/leptris/native/native.c +18 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/descriptor.rb +39 -3
- data/lib/leptris/xml/element.rb +18 -7
- data/lib/leptris/xml/ffi.rb +27 -0
- data/lib/leptris/xml/native.so +0 -0
- data/lib/leptris/xml/node.rb +22 -0
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +87 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/include/leptris/descriptor.h +27 -0
- data/vendor-src/libleptris/src/include/leptris.h +12 -0
- data/vendor-src/libleptris/src/leptris/descriptor/plan.c +226 -12
- data/vendor-src/libleptris/src/leptris/dom/element_modify.c +88 -4
- data/vendor-src/libleptris/src/leptris/serialize/serialize.c +38 -0
- data/vendor-src/libleptris/src/leptris/xsd/compile.c +79 -0
- data/vendor-src/libleptris/test/abi/test_descriptor.cpp +120 -0
- data/vendor-src/libleptris/test/dom/test_dom.cpp +193 -0
- data/vendor-src/libleptris/test/serializer/test_serialize.cpp +25 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/a1.xsd +5 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/a2.xsd +4 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/b1.xsd +5 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/b2.xsd +4 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/s.xsd +3 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/import_dag/w.xsd +5 -0
- data/vendor-src/libleptris/test/xsd/test_xsd_compile.cpp +15 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9bbbab612bfe67926410800b80e4cdb8d9f210c6f58414dfa08be812ec94bf23
|
|
4
|
+
data.tar.gz: c55050347c62887096b9c3d2f4b00ce7814f95a5bdb691c7424d8fc55372ea88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94b0121b2fc062f872c3a22b4173c2ceb18ffc8c894696b1e525d01b3acbe52f9813b0b4f4694126b849a731a20941a97378d8aae5e9c6e60636b5199a31110b
|
|
7
|
+
data.tar.gz: b1c925a2de51a17dc90da01ae36a957fc1b7252683a6ecff904dcf8f2791add34802980a23d6044c2473ae49dca30a3084bb5bebf8eff2d38960dde6ecbbfc63
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.9.340.0] - 2026-10-11
|
|
2
|
+
|
|
3
|
+
### Added — engine sync (libleptris 1.9.338-1.9.340)
|
|
4
|
+
|
|
5
|
+
- **`leptris_element_add_child_addr_installed` (1.9.340)**: the
|
|
6
|
+
addr-attach twin returning the EFFECTIVE installed address — a
|
|
7
|
+
foreign node adopted by copy (#1528) reports the copy's address,
|
|
8
|
+
which callers must use for every later handle (the dangling-
|
|
9
|
+
wrapper mechanism behind the Windows `fast_element_xml`
|
|
10
|
+
segfault). Audit 385/384.
|
|
11
|
+
|
|
12
|
+
### Fixed — engine sync
|
|
13
|
+
|
|
14
|
+
- 1.9.339: cycle-creating reparents rejected (#1636) — appending
|
|
15
|
+
a node into its own descendant subtree built parent cycles that
|
|
16
|
+
unbounded the serializer's recursion.
|
|
17
|
+
- 1.9.338: in-body drops table-structure start tags (#1634);
|
|
18
|
+
indent_html ext option (#1635).
|
|
19
|
+
|
|
20
|
+
Note: the #425/#426 plan faces (engine PR #1645, merged) were cut
|
|
21
|
+
AFTER the v1.9.340 tag — they ride the next engine release.
|
|
22
|
+
|
|
1
23
|
## [1.9.337.0] - 2026-10-11
|
|
2
24
|
|
|
3
25
|
### Added — engine sync (libleptris 1.9.337)
|
|
@@ -1143,6 +1165,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1143
1165
|
|
|
1144
1166
|
## [Unreleased]
|
|
1145
1167
|
|
|
1168
|
+
## [1.9.341.0] - 2026-10-12
|
|
1169
|
+
|
|
1170
|
+
### Changed
|
|
1171
|
+
|
|
1172
|
+
- **Ride libleptris v1.9.341** — XSD import-DAG dedup (the
|
|
1173
|
+
dml-main multi-GB/minutes compile fix, leptris#1644 /
|
|
1174
|
+
leptris-ruby#423), indent_html last-block-child nesting
|
|
1175
|
+
(leptris#1647), and the absorb/copy survival specs
|
|
1176
|
+
(leptris#1646).
|
|
1177
|
+
|
|
1178
|
+
|
|
1146
1179
|
### Added — Descriptor typed scalars + the fused materialize entry (#230's consumer contract)
|
|
1147
1180
|
|
|
1148
1181
|
- **Typed scalars**: attribute and child plan rows accept
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.341"
|
|
12
12
|
# Vendored alongside libleptris for fn:normalize-unicode (TODO
|
|
13
13
|
# .restructure/20): built per platform with a RELOCATABLE @rpath
|
|
14
14
|
# install name, loaded by ffi.rb before libleptris so the
|
data/ext/leptris/native/native.c
CHANGED
|
@@ -56,6 +56,7 @@ typedef void *(*elem_new_attrs_fn)(void *, const char *, const char **,
|
|
|
56
56
|
typedef void *(*text_create_fn)(void *, const char *);
|
|
57
57
|
typedef void *(*create_child_fn)(void *, const char *);
|
|
58
58
|
typedef int (*append_child_fn)(void *, void *);
|
|
59
|
+
typedef int (*append_child_installed_fn)(void *, void *, void **);
|
|
59
60
|
typedef int (*set_attr_fn)(void *, const char *, const char *);
|
|
60
61
|
typedef int (*set_root_fn)(void *, void *);
|
|
61
62
|
typedef void (*doc_free_fn)(void *);
|
|
@@ -90,6 +91,7 @@ static elem_new_attrs_fn f_elem_new_with_attrs;
|
|
|
90
91
|
static text_create_fn f_text_create;
|
|
91
92
|
static create_child_fn f_create_child;
|
|
92
93
|
static append_child_fn f_append_child;
|
|
94
|
+
static append_child_installed_fn f_append_child_installed;
|
|
93
95
|
static append_child_fn f_prepend_child, f_insert_after, f_insert_before;
|
|
94
96
|
typedef void *(*elem_new_attrs_fn)(void *, const char *, const char **,
|
|
95
97
|
const char **, size_t);
|
|
@@ -241,6 +243,8 @@ static void resolve_symbols(const char *lib_path)
|
|
|
241
243
|
f_text_create = (text_create_fn)lib_sym(h, "leptris_text_node_create");
|
|
242
244
|
f_create_child = (create_child_fn)lib_sym(h, "leptris_element_create_child");
|
|
243
245
|
f_append_child = (append_child_fn)lib_sym(h, "leptris_element_append_child");
|
|
246
|
+
f_append_child_installed = (append_child_installed_fn)lib_sym(
|
|
247
|
+
h, "leptris_element_add_child_addr_installed");
|
|
244
248
|
f_prepend_child = (append_child_fn)lib_sym(h, "leptris_element_prepend_child");
|
|
245
249
|
f_insert_after = (append_child_fn)lib_sym(h, "leptris_element_insert_after");
|
|
246
250
|
f_insert_before = (append_child_fn)lib_sym(h, "leptris_element_insert_before");
|
|
@@ -789,9 +793,22 @@ static VALUE nf_append_binding_child(VALUE self, VALUE document,
|
|
|
789
793
|
* mutation merely discards memos. */
|
|
790
794
|
rb_ivar_set(document, id_iv_version,
|
|
791
795
|
LONG2FIX(FIX2LONG(rb_ivar_get(document, id_iv_version)) + 1));
|
|
796
|
+
/* leptris#1636: cross-pool children are adopted by COPY inside
|
|
797
|
+
* the engine — return the INSTALLED address so the caller can
|
|
798
|
+
* rebase its wrapper. 0 means the move was by reference; the
|
|
799
|
+
* argument address stays valid. The twin reads element-form
|
|
800
|
+
* fields on the child (get_document misreads non-element
|
|
801
|
+
* structs), so text/comment/PI children keep the legacy face. */
|
|
802
|
+
if (f_append_child_installed &&
|
|
803
|
+
f_node_type(child) == NT_ELEMENT) {
|
|
804
|
+
void *installed = NULL;
|
|
805
|
+
st = f_append_child_installed(parent, child, &installed);
|
|
806
|
+
check_status_c(st);
|
|
807
|
+
return ULL2NUM((unsigned long long)(uintptr_t)installed);
|
|
808
|
+
}
|
|
792
809
|
st = f_append_child(parent, child);
|
|
793
810
|
check_status_c(st);
|
|
794
|
-
return
|
|
811
|
+
return ULL2NUM(0);
|
|
795
812
|
}
|
|
796
813
|
|
|
797
814
|
/* Batch append (leptris-ruby#366): one crossing for N children.
|
data/lib/leptris/version.rb
CHANGED
|
@@ -410,11 +410,28 @@ class Leptris::XML::Descriptor
|
|
|
410
410
|
# declared exactly once, on the output root, first-encounter
|
|
411
411
|
# order. Text and attribute values are escaped; RAW members are
|
|
412
412
|
# verbatim.
|
|
413
|
-
def serialize(plan_value)
|
|
413
|
+
def serialize(plan_value, indent: 0, indent_unit: nil)
|
|
414
414
|
result_ptr = plan_value.result_ptr
|
|
415
415
|
status = ::FFI::MemoryPointer.new(:int)
|
|
416
|
-
raw =
|
|
417
|
-
|
|
416
|
+
raw =
|
|
417
|
+
if indent.to_i > 0
|
|
418
|
+
# libleptris 1.9.341 (leptris-ruby#425): the ext face owns
|
|
419
|
+
# the formatting; the optionless call keeps the compact
|
|
420
|
+
# historical shape.
|
|
421
|
+
opts = Leptris::XML::FFI::PlanSerializeOptions.new
|
|
422
|
+
opts[:indent] = indent.to_i
|
|
423
|
+
unit_anchor = nil
|
|
424
|
+
if indent_unit
|
|
425
|
+
unit_anchor = ::FFI::MemoryPointer.from_string(indent_unit.to_s)
|
|
426
|
+
opts[:indent_unit] = unit_anchor
|
|
427
|
+
end
|
|
428
|
+
Leptris::XML::FFI.leptris_plan_serialize_ext(
|
|
429
|
+
@handle, result_ptr, opts,
|
|
430
|
+
Leptris::XML::FFI::PlanSerializeOptions.size, status)
|
|
431
|
+
else
|
|
432
|
+
Leptris::XML::FFI.leptris_plan_serialize(
|
|
433
|
+
@handle, result_ptr, status)
|
|
434
|
+
end
|
|
418
435
|
if raw.null?
|
|
419
436
|
raise Leptris::XML::Error,
|
|
420
437
|
"plan serialize failed (status=#{status.read_int})"
|
|
@@ -422,6 +439,25 @@ class Leptris::XML::Descriptor
|
|
|
422
439
|
Leptris::XML::FFI.read_owned_string(raw)
|
|
423
440
|
end
|
|
424
441
|
|
|
442
|
+
# libleptris 1.9.341 (leptris-ruby#426): install a built result
|
|
443
|
+
# as a native document tree — build_result -> this -> the
|
|
444
|
+
# document writer, with no string round trip. Attributes carry
|
|
445
|
+
# verbatim (wire spellings); root namespace declarations ride as
|
|
446
|
+
# xmlns attributes. Only an ELEMENT root is accepted. The
|
|
447
|
+
# returned document owns its pool (GC/freed like any parsed
|
|
448
|
+
# document).
|
|
449
|
+
def to_document(plan_value)
|
|
450
|
+
result_ptr = plan_value.result_ptr
|
|
451
|
+
status = ::FFI::MemoryPointer.new(:int)
|
|
452
|
+
raw = Leptris::XML::FFI.leptris_document_from_plan_result(
|
|
453
|
+
@handle, result_ptr, status)
|
|
454
|
+
if raw.null?
|
|
455
|
+
raise Leptris::XML::Error,
|
|
456
|
+
"document from plan result failed (status=#{status.read_int})"
|
|
457
|
+
end
|
|
458
|
+
Leptris::XML::Document.wrap(raw)
|
|
459
|
+
end
|
|
460
|
+
|
|
425
461
|
# The fused loop (#1269b): source bytes → typed rows in ONE C
|
|
426
462
|
# call — leptris_plan_materialize runs parse, walk, and free
|
|
427
463
|
# natively; the returned PlanValue tree is standalone and the
|
data/lib/leptris/xml/element.rb
CHANGED
|
@@ -696,9 +696,16 @@ class Leptris::XML::Element < Leptris::XML::Node
|
|
|
696
696
|
# C-side version bump invalidates this document's memos.
|
|
697
697
|
if native_fast_children?
|
|
698
698
|
# The face raises on failure (TODO.perf/36); Qnil = the
|
|
699
|
-
# child needs the lift — the full path handles it.
|
|
700
|
-
|
|
701
|
-
|
|
699
|
+
# child needs the lift — the full path handles it. The
|
|
700
|
+
# return is the INSTALLED address (leptris#1636): the
|
|
701
|
+
# engine adopts cross-pool children by copy, and the
|
|
702
|
+
# wrapper must follow the installed node or it addresses
|
|
703
|
+
# the foreign original, freed with its source document.
|
|
704
|
+
installed = Leptris::XML::Native.append_binding_child(
|
|
705
|
+
@document, @c_address, node_or_markup.c_address)
|
|
706
|
+
unless installed.nil?
|
|
707
|
+
Leptris::XML::Node.rebase_installed!(node_or_markup,
|
|
708
|
+
installed, @document)
|
|
702
709
|
return node_or_markup
|
|
703
710
|
end
|
|
704
711
|
end
|
|
@@ -706,11 +713,15 @@ class Leptris::XML::Element < Leptris::XML::Node
|
|
|
706
713
|
unless Leptris::XML::Element.skip_adoption_lift?(node_or_markup)
|
|
707
714
|
Leptris::XML::Element.lift_namespaces_for_adoption(node_or_markup, namespaces)
|
|
708
715
|
end
|
|
709
|
-
# Address-based attach (#408):
|
|
710
|
-
#
|
|
716
|
+
# Address-based attach (#408 + leptris#1636): the installed
|
|
717
|
+
# twin returns the adopted address — rebase the wrapper when
|
|
718
|
+
# the engine copied the child out of its pool.
|
|
719
|
+
installed_out = ::FFI::MemoryPointer.new(:uint64)
|
|
711
720
|
Leptris::XML::FFI.check_status(
|
|
712
|
-
Leptris::XML::FFI.
|
|
713
|
-
@c_address, node_or_markup.c_address))
|
|
721
|
+
Leptris::XML::FFI.leptris_element_add_child_addr_installed(
|
|
722
|
+
@c_address, node_or_markup.c_address, installed_out))
|
|
723
|
+
Leptris::XML::Node.rebase_installed!(
|
|
724
|
+
node_or_markup, installed_out.read_uint64, @document)
|
|
714
725
|
node_or_markup
|
|
715
726
|
when String
|
|
716
727
|
# TODO.perf/34: one dispatch parses the markup and appends
|
data/lib/leptris/xml/ffi.rb
CHANGED
|
@@ -449,6 +449,26 @@ module Leptris
|
|
|
449
449
|
# content. Caller-freed string (leptris_free_string).
|
|
450
450
|
attach_function :leptris_plan_serialize,
|
|
451
451
|
[:leptris_plan, :leptris_plan_result, :pointer], :pointer
|
|
452
|
+
# libleptris 1.9.341 (leptris-ruby#425): formatting-bearing
|
|
453
|
+
# plan serialization. Zero-init = the compact historical
|
|
454
|
+
# form; indent > 0 pretty-prints element boundaries (one
|
|
455
|
+
# newline + indent per level, RAW/CONTENT runs verbatim
|
|
456
|
+
# inline); indent_unit replaces the two-space default
|
|
457
|
+
# (requires indent > 0). options NULL is the compact form;
|
|
458
|
+
# opts_size must cover the struct as compiled here.
|
|
459
|
+
class PlanSerializeOptions < ::FFI::Struct
|
|
460
|
+
layout :indent, :int,
|
|
461
|
+
:indent_unit, :pointer
|
|
462
|
+
end
|
|
463
|
+
attach_function :leptris_plan_serialize_ext,
|
|
464
|
+
[:leptris_plan, :leptris_plan_result, :pointer, :size_t,
|
|
465
|
+
:pointer], :pointer
|
|
466
|
+
# libleptris 1.9.341 (leptris-ruby#426): materialize a built
|
|
467
|
+
# result as a native document tree — build_result -> this ->
|
|
468
|
+
# the document writer, no string round trip. Only an ELEMENT
|
|
469
|
+
# root is accepted.
|
|
470
|
+
attach_function :leptris_document_from_plan_result,
|
|
471
|
+
[:leptris_plan, :leptris_plan_result, :pointer], :pointer
|
|
452
472
|
attach_function :leptris_plan_value_kind,
|
|
453
473
|
[:leptris_plan_result], :int
|
|
454
474
|
attach_function :leptris_plan_value_name,
|
|
@@ -888,6 +908,13 @@ attach_function :leptris_parse_string,
|
|
|
888
908
|
# semantics and status contract as the pointer face.
|
|
889
909
|
attach_function :leptris_element_add_child_addr,
|
|
890
910
|
[:ulong_long, :ulong_long], :leptris_status
|
|
911
|
+
# #1636: the addr-attach twin returning the EFFECTIVE
|
|
912
|
+
# installed child address — a foreign node is adopted by
|
|
913
|
+
# copy (#1528) and the caller must use the copy's address
|
|
914
|
+
# for every later handle. installed may be NULL
|
|
915
|
+
# (status-only).
|
|
916
|
+
attach_function :leptris_element_add_child_addr_installed,
|
|
917
|
+
[:ulong_long, :ulong_long, :pointer], :leptris_status
|
|
891
918
|
# Fused create+append (libleptris 1.9.153): one document
|
|
892
919
|
# resolution, identical tree semantics to the two-call pair.
|
|
893
920
|
attach_function :leptris_element_create_child,
|
data/lib/leptris/xml/native.so
CHANGED
|
Binary file
|
data/lib/leptris/xml/node.rb
CHANGED
|
@@ -255,6 +255,28 @@ class Leptris::XML::Node
|
|
|
255
255
|
# structural stamps (stamped against the SOURCE version) and the
|
|
256
256
|
# source document's sibling/parent stamps. Scope-owned nodes
|
|
257
257
|
# answer nil from #document and never memoize — nothing to do.
|
|
258
|
+
# leptris#1636: after an address-based attach the engine may have
|
|
259
|
+
# adopted a cross-pool child BY COPY — the wrapper must follow the
|
|
260
|
+
# installed node, or it addresses the foreign original, freed with
|
|
261
|
+
# its source document (the Windows SEGV in fast_element_xml).
|
|
262
|
+
def self.rebase_installed!(node, installed_address, target_document)
|
|
263
|
+
return if installed_address.nil? || installed_address.zero? ||
|
|
264
|
+
installed_address == node.c_address
|
|
265
|
+
node.rebase_to(installed_address, target_document)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Point the wrapper at a different native node and forget every
|
|
269
|
+
# memo derived from the old one. The owning document follows
|
|
270
|
+
# +new_document+ (post-adoption, the node lives in the target).
|
|
271
|
+
def rebase_to(installed_address, new_document)
|
|
272
|
+
@c_address = installed_address
|
|
273
|
+
@c_ptr = nil
|
|
274
|
+
invalidate_structural_stamps!
|
|
275
|
+
@document = new_document
|
|
276
|
+
@pub_document = new_document
|
|
277
|
+
nil
|
|
278
|
+
end
|
|
279
|
+
|
|
258
280
|
def self.invalidate_cross_document!(node, target_document)
|
|
259
281
|
source = node.document
|
|
260
282
|
return if source.nil? || source.equal?(target_document)
|
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.341] - 2026-10-11
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **XSD compilation of large multi-import schemas (leptris#1644,
|
|
8
|
+
leptris-ruby#423).** `xsd_capture_root` recursed into
|
|
9
|
+
`xs:include`/`xs:import`/`xs:redefine` with no visited set —
|
|
10
|
+
`include_depth<16` bounds depth only, so a dense import DAG (every
|
|
11
|
+
OOXML schema family) was re-parsed and re-captured along every
|
|
12
|
+
path through the graph. dml-main.xsd (155 KB): >300s / 3.5GB+
|
|
13
|
+
timeout -> **0.0s / 8MB**; the "per-compile accumulation" (6.7GB
|
|
14
|
+
across sequential compiles) was allocator survival of that blowup —
|
|
15
|
+
now a 12MB plateau returned fully after each free. Each unique
|
|
16
|
+
schema unit is captured exactly once (lexically normalized path
|
|
17
|
+
key, marked before recursing so cycles close). Red-first spec
|
|
18
|
+
`ImportDagCapturesEachUnitOnce` (6-file DAG fixture).
|
|
19
|
+
- **`indent_html`: a LAST block child now nests (leptris#1647).**
|
|
20
|
+
The single-child inline rule set `mixed=1`, which the layout
|
|
21
|
+
machinery inherits down the subtree — a trailing block child
|
|
22
|
+
(body > div > p+span) glued to its parent's tag and its own
|
|
23
|
+
children fell flat. indent_html-only refinement
|
|
24
|
+
(`html_block_child_needs_lines`): a block parent whose single
|
|
25
|
+
child is itself a line-taking block breaks before its children
|
|
26
|
+
and before its close tag; `head>title` stays inline; the legacy
|
|
27
|
+
16.2 byte shape is untouched.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **`leptris_plan_serialize_ext` (#425, leptris-ruby#425)**:
|
|
32
|
+
formatting-bearing plan serialization — `indent` (+ optional
|
|
33
|
+
`indent_unit`) pretty-prints element boundaries; RAW/CONTENT
|
|
34
|
+
runs stay verbatim inline (the byte-exact mixed-content rule).
|
|
35
|
+
The 3-arg face is the compact default, unchanged. Options ride
|
|
36
|
+
the growable size-tagged struct pattern (#129).
|
|
37
|
+
- **`leptris_document_from_plan_result` (#426,
|
|
38
|
+
leptris-ruby#426)**: materialize a built result as a native
|
|
39
|
+
document tree — build_result → this → the document writer, no
|
|
40
|
+
string round trip. Attributes verbatim, #1626 root declarations
|
|
41
|
+
as xmlns attributes, op-order member emission (#1625's rank)
|
|
42
|
+
preserved; non-ELEMENT roots rejected.
|
|
43
|
+
- **Absorb/copy attach survival specs (leptris#1646)**: both C-level
|
|
44
|
+
attach shapes (absorb-move and adopt-by-copy) pinned as
|
|
45
|
+
`DomAbsorbSurvival.*` with post-free reads of names, text,
|
|
46
|
+
attributes, and the expanded-QName prefix/URI views — the engine
|
|
47
|
+
is ASAN-clean on both; the residual dangling is binding-side
|
|
48
|
+
(leptris-ruby#1636's wrapper rebase, landed on the binding).
|
|
49
|
+
|
|
50
|
+
## [Unreleased]
|
|
51
|
+
|
|
52
|
+
## [1.9.340] - 2026-10-11
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- **`leptris_element_add_child_addr_installed` — the add_child_addr
|
|
57
|
+
twin reporting the effective installed address (leptris-ruby#1636,
|
|
58
|
+
PR #1642).** `add_child_addr` is status-only: a foreign node is
|
|
59
|
+
adopted by copy (#1528) and the installed copy's address is
|
|
60
|
+
dropped, so callers kept addressing the foreign original — which
|
|
61
|
+
dies with its document (the dangling-wrapper mechanism behind the
|
|
62
|
+
Windows `fast_element_xml` segfault). The twin returns the
|
|
63
|
+
effective node: same-document attaches return the argument
|
|
64
|
+
unchanged (zero extra cost), foreign attaches return the copy the
|
|
65
|
+
caller must rebase its wrapper to. `installed_addr = NULL` is the
|
|
66
|
+
status-only form; the status contract is identical to
|
|
67
|
+
`add_child_addr`, and the #1639 cycle rejection rides the append.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [1.9.339] - 2026-10-11
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- **reject cycle-creating reparents (#1636, PR #1640).** The
|
|
76
|
+
Windows `fast_element_xml` CFUNC segfault in leptris 1.9.33x:
|
|
77
|
+
mutation could append a node into its own descendant subtree,
|
|
78
|
+
building a parent cycle — any serialize then recursed without
|
|
79
|
+
bound and the process died (the `_chkstk` signature in the
|
|
80
|
+
metanorma-standoc dump is the stack probe hitting the exhausted
|
|
81
|
+
stack; reproduced deterministically under ASAN). All four
|
|
82
|
+
reparenting mutators — `append_child`, `prepend_child`,
|
|
83
|
+
`insert_before`, `insert_after`, and `add_child_addr` through
|
|
84
|
+
the append contract — now reject the cycle edge with
|
|
85
|
+
`LEPTRIS_ERROR_INVALID_ARG`. Legal appends are byte-identical
|
|
86
|
+
(spec-pinned).
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
3
90
|
## [1.9.338] - 2026-10-11
|
|
4
91
|
|
|
5
92
|
### Added
|
|
@@ -303,6 +303,33 @@ LEPTRIS_API char* leptris_plan_serialize(LeptrisPlan plan,
|
|
|
303
303
|
const LeptrisPlanResult result,
|
|
304
304
|
LeptrisStatus* status);
|
|
305
305
|
|
|
306
|
+
/* #425: formatting-bearing plan serialization (leptris-ruby#425).
|
|
307
|
+
* Zero-initialize; every field defaults to the compact historical
|
|
308
|
+
* form. indent > 0 pretty-prints element boundaries (one newline
|
|
309
|
+
* + indent per level; RAW/CONTENT runs stay verbatim inline);
|
|
310
|
+
* indent_unit replaces the two-space default per level.
|
|
311
|
+
* options NULL = the compact form. opts_size must cover the
|
|
312
|
+
* struct as compiled by the caller (growable, #129 pattern). */
|
|
313
|
+
typedef struct {
|
|
314
|
+
int indent; /* spaces per level; 0 = compact */
|
|
315
|
+
const char* indent_unit; /* NULL = spaces; requires indent > 0 */
|
|
316
|
+
} leptris_plan_serialize_options;
|
|
317
|
+
|
|
318
|
+
LEPTRIS_API char* leptris_plan_serialize_ext(
|
|
319
|
+
LeptrisPlan plan, const LeptrisPlanResult result,
|
|
320
|
+
const leptris_plan_serialize_options* options, size_t options_size,
|
|
321
|
+
LeptrisStatus* status);
|
|
322
|
+
|
|
323
|
+
/* #426 (leptris-ruby#426): materialize a built result as a native
|
|
324
|
+
* document tree — build_result -> this -> the document writer,
|
|
325
|
+
* with no string round trip. Attributes carry verbatim (wire
|
|
326
|
+
* spellings); root namespace declarations ride as xmlns
|
|
327
|
+
* attributes. Only an ELEMENT root is accepted. Caller frees with
|
|
328
|
+
* leptris_document_free. */
|
|
329
|
+
LEPTRIS_API LeptrisDocument leptris_document_from_plan_result(
|
|
330
|
+
LeptrisPlan plan, const LeptrisPlanResult result,
|
|
331
|
+
LeptrisStatus* status);
|
|
332
|
+
|
|
306
333
|
/* ---- Result accessors (NULL-tolerant: NULL in, 0/NULL out) ------- */
|
|
307
334
|
|
|
308
335
|
LEPTRIS_API LeptrisPlanValueKind leptris_plan_value_kind(const LeptrisPlanResult v);
|
|
@@ -2158,6 +2158,18 @@ LEPTRIS_API LeptrisStatus leptris_element_set_name(LeptrisElement elem, const ch
|
|
|
2158
2158
|
* status contract as leptris_element_append_child. */
|
|
2159
2159
|
LEPTRIS_API LeptrisStatus leptris_element_add_child_addr(uintptr_t parent_addr,
|
|
2160
2160
|
uintptr_t child_addr);
|
|
2161
|
+
|
|
2162
|
+
/* #1636: add_child_addr twin returning the EFFECTIVE installed
|
|
2163
|
+
* child address. A same-document attach installs the argument —
|
|
2164
|
+
* installed_addr receives it unchanged; a foreign node is adopted
|
|
2165
|
+
* by copy (#1528) and installed_addr receives the copy's address,
|
|
2166
|
+
* which the caller must use for every later handle. installed_addr
|
|
2167
|
+
* may be NULL (status-only). Same status contract as
|
|
2168
|
+
* add_child_addr.
|
|
2169
|
+
* Memory: the installed node is owned by parent's document. */
|
|
2170
|
+
LEPTRIS_API LeptrisStatus leptris_element_add_child_addr_installed(
|
|
2171
|
+
uintptr_t parent_addr, uintptr_t child_addr,
|
|
2172
|
+
uintptr_t* installed_addr);
|
|
2161
2173
|
LEPTRIS_API LeptrisStatus leptris_element_append_child(LeptrisElement parent, LeptrisElement child);
|
|
2162
2174
|
|
|
2163
2175
|
/**
|