mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
Add a new C API function that returns a comptime-generated JSON string describing the size, alignment, and field layout of every C API extern struct. This lets FFI consumers (particularly WASM) construct structs by byte offset without hardcoding platform-specific layout. The JSON is built at comptime using std.json.Stringify via a StructInfo type that holds per-struct metadata and implements jsonStringify. A StaticStringMap keyed by C struct name provides lookup by name as well as iteration for the JSON serialization. The function is declared in types.h alongside the other common types and exported as ghostty_type_json.