Skip to main content

Module cabi

Module cabi 

Source
Expand description

C ABI wrapper generation and metadata serialization.

This module contains all logic for generating pub export fn C ABI wrapper code (consumed by project::generate as part of lib.zig) and for writing C ABI export/import JSON metadata files (consumed by js2rust-bridge-macro).

Functionsยง

gen_cabi_wrappers
Generate pub export fn wrapper code for lib.zig. Each wrapper calls the per-file module function and lives in the root lib.zig, so Zig correctly propagates the symbols into the final .lib.
write_cabi_metadata
Write C ABI exports/imports JSON metadata.