5.2. C API
The C API is defined in ffi/l4yaml.h with a bridge layer in
ffi/l4yaml_shim.c.
It provides approximately 26 exported functions covering:
-
Parsing —
l4yaml_parse_safeand related functions -
Dumping — converting
YamlValueback to YAML text -
Schema — tag handle registration and type resolution
-
Limits — configuring
ParserLimitsvia preset codes or individual parameter setters -
Memory — proper Lean object lifecycle management (
lean_inc_ref/lean_dec_ref)
All C API functions operate on opaque Lean object pointers. The shim layer handles the Lean runtime initialization and provides stable C-callable entry points.