infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
Named Type Registry API

Functions for defining, managing, and using a registry of named types. More...

Collaboration diagram for Named Type Registry API:

Functions

c23_nodiscard infix_registry_tinfix_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.
 

Detailed Description

Functions for defining, managing, and using a registry of named types.

Function Documentation

◆ infix_register_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.

Parameters
registryThe registry to populate.
definitionsA null-terminated, semicolon-separated string of type definitions.
Returns
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.

◆ infix_registry_create()

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.

Returns
A handle to the new registry, or nullptr if memory allocation fails.
Note
The returned registry must be freed with infix_registry_destroy.

Creates a new, empty type registry.

◆ infix_registry_destroy()

void infix_registry_destroy ( infix_registry_t registry)

Frees a type registry and all type definitions and metadata contained within it.

Parameters
registryThe registry to destroy. Can be nullptr (no-op).

Frees a type registry and all type definitions and metadata contained within it.