L4YAML

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:

  • Parsingl4yaml_parse_safe and related functions

  • Dumping — converting YamlValue back to YAML text

  • Schema — tag handle registration and type resolution

  • Limits — configuring ParserLimits via 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.