infix
A JIT-Powered FFI Library for C
|
Functions for defining, managing, and using a registry of named types. More...
Functions | |
c23_nodiscard infix_registry_t * | infix_registry_create (void) |
Creates a new, empty type registry. | |
void | infix_registry_destroy (infix_registry_t *registry) |
Frees a type registry and all type definitions and metadata contained within it. | |
c23_nodiscard infix_status | infix_register_types (infix_registry_t *, const char *) |
Parses a string of definitions and populates a type registry. | |
Functions for defining, managing, and using a registry of named types.
c23_nodiscard infix_status infix_register_types | ( | infix_registry_t * | registry, |
const char * | definitions | ||
) |
Parses a string of definitions and populates a type registry.
This function is the primary way to define named types. The definition string is a semicolon-separated list of @Name = <TypeDefinition>;
entries.
registry | The registry to populate. |
definitions | A null-terminated, semicolon-separated string of type definitions. |
INFIX_SUCCESS
on success. INFIX_ERROR_INVALID_ARGUMENT
if the definition string contains a syntax error or attempts to redefine an existing type in the registry.Parses a string of definitions and populates a type registry.
c23_nodiscard infix_registry_t * infix_registry_create | ( | void | ) |
Creates a new, empty type registry.
A type registry is a self-contained object that stores named type definitions. These definitions can then be referenced by name (e.g., @Point
) in any signature string passed to the library.
nullptr
if memory allocation fails. infix_registry_destroy
.Creates a new, empty type registry.
void infix_registry_destroy | ( | infix_registry_t * | registry | ) |
Frees a type registry and all type definitions and metadata contained within it.
registry | The registry to destroy. Can be nullptr (no-op). |
Frees a type registry and all type definitions and metadata contained within it.