The C ABI for libasdf, implemented in Rust.
This crate is a thin projection of [asdf_core] onto libasdf's exported
C interface. It holds no behaviour of its own: everything here converts
between C representations and the engine's, and every entry point is
wrapped so that a panic can never unwind into a C caller.
What lives here versus in C
Almost all of the ABI is expressed directly in Rust. Two things cannot be,
and live in shim.c instead:
- the three variadic entry points (
asdf_file_log,asdf_file_error_common,asdf_value_error_common), because defining variadicextern "C"functions needs unstable Rust; and asdf_ndarray_read_float16_at, because_Float16is unstable and its return ABI differs fromuint16_t's.
Headers
The public headers are vendored verbatim from upstream rather than
generated, because several API entry points exist only as _Generic
macros or static inline functions. See include/PROVENANCE.md.