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
// SPDX-License-Identifier: GPL-3.0-or-later
//! Library support for inspecting, extracting, creating, and updating Bethesda archives.
//!
//! `dream_archivetool` wraps the [`dream_archive`] crate behind a small, application-oriented API that is
//! shared by the CLI and optional Lua bindings. The main entry point is [`ArchiveTool`]; callers doing
//! repeated operations against one archive can use [`OpenArchive`] to keep the archive loaded.
//! `dream_archive` is re-exported so embedding applications can register the matching lower-level Lua
//! API without adding a second dependency just to spell the same crate name. That re-export is part
//! of this crate's embedding compatibility surface; `dream_archive` upgrades can affect downstream
//! Lua/module integration even when `dream_archivetool` policy APIs do not change.
//!
//! # Example
//!
//! ```no_run
//! use dream_archivetool::{ArchiveTool, CreateOptions};
//!
//! # fn main() -> dream_archivetool::Result<()> {
//! let archive = ArchiveTool::open("Morrowind.bsa")?;
//! let entries = archive.list()?;
//! let bytes = archive.read_entry("icons/gold.dds")?;
//! let count = ArchiveTool::create("out.bsa", "input_dir", &CreateOptions::default())?;
//! # Ok(())
//! # }
//! ```
//!
//! Extraction rejects absolute paths, parent-directory traversal, NUL bytes, and colon-containing
//! components. Disk extraction streams payloads into temporary files before replacing the
//! destination, but it is not an `openat`-style jail against pre-existing symlinks in the output
//! tree. Archive creation and update reject input symlinks encountered during collection unless
//! `follow_symlinks` is explicitly enabled; callers must keep input trees trusted and stable during
//! the write. Paths are preflighted before handing file/archive-entry sources to `dream_archive`
//! builders, including BA2 DX10 texture preservation where the backend can copy native chunks.
//!
//! Enable the `lua` feature to compile the Luau module for embedding applications that already
//! choose an `mlua` runtime. This crate deliberately does not select a Lua runtime for normal
//! library consumers.
//!
//! Enable `standalone-lua` only for this crate's tests, examples, and documentation builds. It
//! selects `mlua`'s Luau backend, which is useful here and rude everywhere else. Since 0.2.0 the
//! bindings target Luau instead of `LuaJIT`, and every Lua-facing name is camelCase.
//!
pub use dream_archive;
pub use ;
pub use ;
pub use ;
pub use ArchiveEntry;
pub use ;
pub use ;
pub use ArchiveFormat;
pub use ;
pub use ;