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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! 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
// Lint policy, sealed at 11.1-Z. This crate is a C-ABI mirror of
// libxml2/libxslt; the hot lint surface is raw-pointer plumbing and
// C-signal integer casts that are *deliberate* parity decisions (e.g.
// `i32` -> `usize` mirrors what upstream C does; rewriting cast_sign_loss
// sites with `try_from().unwrap()` would introduce panics that do not
// exist in the oracle). Consequently:
//
// - `clippy::all` plus the rustc doc lints is the enforced gate and is
// kept clean: `cargo clippy --all-targets --all-features -- -D warnings`
// passes at the 11.1-Z seal (every remaining unsafe fn carries a
// `# Safety` section; missing_docs is allowed only on the C-header
// mirror modules structs.rs/types.rs, where the C headers are the
// canonical documentation, matching bindgen's default).
// - `clippy::pedantic`/`clippy::nursery` are NOT gated. clippy documents
// pedantic as "opinionated" and nursery as "experimental"; their two
// largest families here (ptr_as_ptr ~4.5k and cast_* ~1.6k instances
// in the lib) are inherent to the ABI-mirror domain, so enforcing them
// would force either semantically-worse code or thousands of per-site
// `#[allow]` attributes. They were enabled-but-dirty since crate
// inception; the seal converts the policy to what is actually enforced.
// - `clippy::missing_inline_in_public_items` is not gated: the
// `#[no_mangle] extern "C"` export surface cannot be inlined across
// the FFI boundary, making the lint noise on ~500 exports.
// 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)
// Property-based fuzzing smoke targets (proptest, runs in `cargo test`).
/// 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;