Expand description
C ABI bridge: drop-in extern "C" replacements with the original names and signatures.
The port is safe Rust over C’s ABI types (c_int, usize, f64, …), with each
const char * as Option<&[u8]> (None for NULL). lib.rs is the only place with
unsafe: reading C strings, and exporting unmangled symbols.
Structs§
- CStruct
- A struct of scalar fields that crosses the bridge by value.
Enums§
- CKind
- How a C parameter crosses the bridge.
Functions§
- c_decl
- A C declaration of
namewith typec_type(const uint8_t *in). - c_
prototype - The function’s prototype with typedefs resolved to the scalars they stand for, so it compiles without the project’s headers.
- c_
struct - The struct a dialect type stands for (
struct:AVRational:int num,int den). - c_
struct_ defs - C definitions of
m’s structs, for files that do not include the project’s headers. - cargo_
toml - header
include/<lib>.h: the prototypes, and therust_anything_aliases.- kind
- lib_rs
- pointee
- What a pointer type points to, without
const. - port_rs
- returns_
into - The parameter a returned pointer points into (
returnsisptr:<index>). - shadow_
c - A C shadow file: each function calls the original (compiled renamed) and the Rust port. The port gets copies of what the function writes, so the caller sees the original’s writes once, and both are compared.
- shadow_
flags -Dflags that rename the originals for a shadow build.- structs
- The structs
m’s functions take or return by value, each once. - writes
- Whether recorded results carry what the function wrote through its pointers.