FFIModules: ffi/c_types, ffi/cinterop

FFI

Modules: ffi/c_types, ffi/cinterop

The FFI stdlib modules provide C type mapping helpers and string conversion utilities used with extern fun and seen import-c.

Type or FunctionModulePurpose
CTypeInfoffi/c_typesC type size/alignment metadata
CFunctionSignatureffi/c_typesParsed C function signature helper
CStringffi/cinteropbootstrap wrapper around a Seen String; not a raw NUL-terminated char *

For an actual native string boundary, use a reviewed shim or the runtime seen_str_to_cstr/seen_cstr_to_str helpers and document who owns any allocated copy. Release a pointer returned by seen_str_to_cstr exactly once with seen_cstr_free; seen_cstr_to_str returns a borrowed view. A Seen String is the { length, data } SeenString representation.

Related guide: Foreign Function Interface.

Architected in Kotlin. Rendered with Materia. Powered by Aether.
© 2026 Yousef.