pub unsafe extern "C" fn ghostty_type_json() -> *const c_charExpand description
Return a pointer to a null-terminated JSON string describing the layout of every C API struct for the current target.
This is primarily useful for language bindings that can’t easily set C struct fields and need to do so via byte offsets. For example, WebAssembly modules can’t share struct definitions with the host.
Example (abbreviated): { “GhosttyMouseEncoderSize”: { “size”: 40, “align”: 8, “fields”: { “size”: { “offset”: 0, “size”: 8, “type”: “u64” }, “screen_width”: { “offset”: 8, “size”: 4, “type”: “u32” }, “screen_height”: { “offset”: 12, “size”: 4, “type”: “u32” }, “cell_width”: { “offset”: 16, “size”: 4, “type”: “u32” }, “cell_height”: { “offset”: 20, “size”: 4, “type”: “u32” }, “padding_top”: { “offset”: 24, “size”: 4, “type”: “u32” }, “padding_bottom”: { “offset”: 28, “size”: 4, “type”: “u32” }, “padding_right”: { “offset”: 32, “size”: 4, “type”: “u32” }, “padding_left”: { “offset”: 36, “size”: 4, “type”: “u32” } } } }
The returned pointer is valid for the lifetime of the process.