Skip to main content

Module c_consumer

Module c_consumer 

Source
Expand description

Shared C-FFI consumer scaffolding for language backends.

This module provides utilities for generating language bindings that consume the C FFI layer produced by cbindgen. Each consumer backend (Go, Java, C#, Zig) uses the same C interface:

  • A C header file (config.ffi_header_name())
  • A library name (config.ffi_lib_name())
  • A symbol prefix (config.ffi_prefix())
  • Standard helper symbols: {prefix}_free_string, {prefix}_last_error_code, {prefix}_last_error_context

Structs§

CConsumerContext
Context capturing the shared FFI consumer inputs across all language backends.

Functions§

default_output_dir
Resolve the per-backend output directory for generated files.
free_string_symbol
Return the C symbol name for freeing FFI-allocated strings.
last_error_code_symbol
Return the C symbol name for reading the thread-local last error code.
last_error_context_symbol
Return the C symbol name for reading the thread-local last error context message.