libesedb_sys/
lib.rs

1//! # libesedb-sys
2//!
3//! [![Repository](https://img.shields.io/static/v1?label=GitHub&message=Repository&color=9f7be1&logo=github)](https://github.com/sunsetkookaburra/rust-libesedb)
4//! [![Upstream](https://img.shields.io/static/v1?label=GitHub&message=Upstream&color=9f7be1&logo=github)](https://github.com/libyal/libesedb)
5//! [![Crate Page](https://img.shields.io/crates/v/libesedb-sys?logo=rust)](https://crates.io/crates/libesedb-sys)
6//! [![Documentation](https://img.shields.io/docsrs/libesedb-sys?logo=rust)](https://docs.rs/libesedb-sys)
7//! [![License](https://img.shields.io/crates/l/libesedb-sys)](https://github.com/sunsetkookaburra/rust-libesedb/blob/main/COPYING.LESSER)
8//!
9//! Rust `-sys` bindings to [`libyal/libesedb`](https://github.com/libyal/libesedb).
10//!
11//!
12//! ## Building
13//!
14//! * Have a compiler installed (if you're using Rust, you have one).
15//! * (Optionally) LLVM for `bindgen` to regenerate the bindings.
16//! * Should use `cargo build -vv` for very verbose output to verify `cc` compiling.
17//!
18//! ### Rebuilding Bindings
19//!
20//! ```
21//! bindgen libesedb-20230824/include/libesedb.h -o src/bindings.rs -- -Ilibesedb-20230824/include -fparse-all-comments
22//! ```
23//!
24//!
25//! ## Downstream Patches
26//!
27//! ### Bugfix: Multi-Value Binary Data
28//!
29//! <https://github.com/libyal/libesedb/pull/69>
30//!
31//! ### QoL: Maximum Leaf-Pages
32//!
33//! Note: the original value of `16 * 1024` has been increased as far as possible to `(INT_MAX - 1)` in order for large databases to load. In my testing the value makes no meaningful difference beyond limiting the sorts/sizes of files you can open.
34//!
35//! Via the command-line:
36//!
37//! ```
38//! LIBESEDB_MAXIMUM_NUMBER_OF_LEAF_PAGES="32 * 1024" cargo build -vv
39//! ```
40//!
41//! In your Cargo.toml:
42//!
43//! ```
44//! [env]
45//! LIBESEDB_MAXIMUM_NUMBER_OF_LEAF_PAGES = "32 * 1024"
46//! ```
47//!
48//! ### QoL: Counting Leaf-Pages
49//!
50//! If you do set a leaf-page maximum, when it is exceeded the error message actually reports back that limit so anyone downstream can provide useful debugging information.
51//!
52//!
53//! ## Updating Bundled libesedb
54//!
55//! * Download/Clone head of the `main` branch
56//!   * `git clone --branch main --depth 1 https://github.com/libyal/libesedb`
57//!   * <https://github.com/libyal/libesedb/archive/refs/heads/main.zip>
58//! * Follow build instructions <https://github.com/libyal/libesedb/wiki/Building>
59//!   * Run the following
60//!     * `./synclibs.sh`
61//!     * `./autogen.sh`
62//!     * `./configure`
63//!     * `make dist`
64//!   * Output should include a `.tar.gz` containing the source distribution version
65//!   * Note: I used Cygwin on Windows, you will need the packages mentioned here: <https://github.com/libyal/libesedb/wiki/Building#cygwin>
66//!     * (for reference: `autoconf`, `automake`, `binutils`, `gcc-core`, `gcc-g++`, `gettext-devel`, `libiconv`, `libtool`, `make`, `pkg-config`)
67//! * Rebuild bindings (see above)
68//!
69//!
70//! ## Authors
71//!
72//! ```
73//! libesedb
74//! Copyright (C) 2009-2023, Joachim Metz <joachim.metz@gmail.com>
75//!
76//! libesedb-sys
77//! Copyright (C) 2022-2025, Oliver Lenehan ~sunsetkookaburra
78//! ```
79//!
80//!
81//! ## License
82//!
83//! * [`libyal/libesedb`](https://github.com/libyal/libesedb) is the hard work of [`Joachim Metz (~joachimmetz)`](https://github.com/joachimmetz), provided under [LGPL-3.0-or-later](./COPYING.LESSER). A distribution version of the library is bundled here.
84//! * This `-sys` binding is also provided under [LGPL-3.0-or-later](./COPYING.LESSER).
85
86#![allow(non_upper_case_globals)]
87#![allow(non_camel_case_types)]
88#![allow(non_snake_case)]
89#![allow(deref_nullptr)]
90
91include!("bindings.rs");