1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! libxml-rs: Custodial native-Rust reimplementation of libxml2 and libxslt
//!
//! This is not an XML crate. This is not an XSLT crate. This is not a wrapper.
//! This is a forensic reconstruction of the observable behavior of the libxml2 + libxslt
//! ecosystem across its historical lifetime, implemented in native Rust.
//!
//! # Architecture
//!
//! The crate is organized into semantic modules corresponding to real ownership boundaries:
//!
//! - `abi` - C ABI compatibility layer: types, structs, constants, exports, callbacks, allocator, ownership, versioning
//! - `xml` - libxml2 implementation: parser, SAX, tree, entities, namespaces, DTD, validation, reader, writer, encoding, I/O, catalog, URI, XPath, XPointer, XInclude, RELAX NG, schemas, Schematron, C14N, HTML, regex, automata, dictionary, hash, list, debug, globals, threads, errors, memory
//! - `xslt` - libxslt implementation: stylesheet, compiler, transform, templates, patterns, variables, parameters, keys, attributes, namespace_alias, whitespace, sorting, numbering, documents, imports, extensions, serialization, security, errors
//! - `exslt` - EXSLT modules: common, math, sets, strings, dynamic, functions, dates
//! - `compatibility` - Historical profiles, quirks, platform-specific behavior
//! - `bin` - CLI tools: xmllint, xmlcatalog, xsltproc
//!
//! # Safety
//!
//! This crate uses `unsafe` only where fundamentally required for C ABI export, raw-pointer
//! compatibility, foreign allocator interoperability, public C structure layout, callbacks,
//! variadic compatibility, OS interfaces, and dynamic-loader interaction.
//!
//! Every unsafe block documents:
//! - What must be true
//! - Who establishes it
//! - How long it remains true
//! - Which oracle/parity court exercises the assumption
//! - What would constitute violation
// Public ABI compatibility layer
// libxml2 implementation
// libxslt implementation
// EXSLT implementation
// Compatibility profiles and historical behavior
// Binary entry points are defined as [[bin]] targets in Cargo.toml.
// They are NOT library modules — they depend on libxml_rs as a library.
// See src/bin/xmllint.rs, src/bin/xmlcatalog.rs, src/bin/xsltproc.rs
// Phase 0: ABI re-exports will be populated when types are defined.
// The `allow(unused_imports)` is intentional — these will be used in Phase 1+.
use *;
use *;
use *;
use *;
use *;
use *;
use *;
// Internal modules (not part of public C ABI)
/// The full version string of the libxml-rs crate (from Cargo.toml).
pub const LIBXML_RS_VERSION: &str = env!;
/// Major version number of libxml-rs.
pub const LIBXML_RS_VERSION_MAJOR: u32 = 0;
/// Minor version number of libxml-rs.
pub const LIBXML_RS_VERSION_MINOR: u32 = 1;
/// Micro version (patch) number of libxml-rs.
pub const LIBXML_RS_VERSION_MICRO: u32 = 0;