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
//! The `hegel_*` C ABI as seen by the frontend.
//!
//! Everything the frontend knows about libhegel comes through this module:
//! the opaque handle types, the `repr(C)` enums and structs, and the
//! `hegel_*` functions themselves. It has two interchangeable forms. By
//! default the engine is a separately built `libhegel_c` shared library:
//! [`types`] mirrors the `repr(C)` types and [`loader`] resolves each
//! function out of the library at runtime, so the `hegeltest-c` crate — and
//! its whole dependency tree — never appears in a consumer's cargo graph.
//! With the `static-engine` feature the module is instead a re-export of the
//! `hegel_c` rlib, linking the engine into the binary like any other Rust
//! dependency.
//!
//! Either way the surface is identical, down to every function being
//! `unsafe`: the one safe C function, `hegel_context_new`, is wrapped so
//! call sites cannot tell the modes apart. [`for_each_hegel_fn`] is the
//! single list of functions both forms are generated from, itself generated
//! from the engine source by `scripts/gen-ffi-list.py` so it is the whole
//! exported ABI rather than whatever this frontend happens to call; the
//! embedded tests compile-assert it, and the mirrored types, against the
//! real `hegel_c` definitions whenever `static-engine` makes both visible.
pub use for_each_hegel_fn;
pub use *;
pub unsafe
pub use *;
pub use *;