infix
A JIT-Powered FFI Library for C
|
The central structure for describing any data type in the FFI system. More...
#include <infix.h>
Public Attributes | ||
infix_type_category | category | |
The fundamental category of the type. | ||
size_t | size | |
The total size of the type in bytes, per sizeof . | ||
size_t | alignment | |
The alignment requirement of the type in bytes, per _Alignof . | ||
bool | is_arena_allocated | |
If true, this type was allocated from an arena and should not be individually freed. | ||
union { | ||
infix_primitive_type_id primitive_id | ||
For INFIX_TYPE_PRIMITIVE . More... | ||
struct { | ||
struct infix_type_t * pointee_type | ||
The type this pointer points to. More... | ||
} pointer_info | ||
For INFIX_TYPE_POINTER . More... | ||
struct { | ||
const char * name | ||
Optional name of the aggregate. More... | ||
infix_struct_member * members | ||
Array of members for the aggregate. More... | ||
size_t num_members | ||
Number of members in the aggregate. More... | ||
} aggregate_info | ||
For INFIX_TYPE_STRUCT and INFIX_TYPE_UNION . More... | ||
struct { | ||
struct infix_type_t * element_type | ||
The type of elements in the array. More... | ||
size_t num_elements | ||
The number of elements in the array. More... | ||
} array_info | ||
For INFIX_TYPE_ARRAY . More... | ||
struct { | ||
struct infix_type_t * return_type | ||
Reverse trampoline return value. More... | ||
infix_function_argument * args | ||
Array of function arguments (name and type). More... | ||
size_t num_args | ||
The total number of fixed and variadic arguments. More... | ||
size_t num_fixed_args | ||
The number of non-variadic arguments. More... | ||
} func_ptr_info | ||
For INFIX_TYPE_REVERSE_TRAMPOLINE . More... | ||
struct { | ||
struct infix_type_t * underlying_type | ||
The integer type this enum is based on. More... | ||
} enum_info | ||
For INFIX_TYPE_ENUM . More... | ||
struct { | ||
struct infix_type_t * base_type | ||
The floating point type of the real and imaginary parts. More... | ||
} complex_info | ||
For INFIX_TYPE_COMPLEX . More... | ||
struct { | ||
struct infix_type_t * element_type | ||
The type of the elements in the vector. More... | ||
size_t num_elements | ||
The number of elements in the vector. More... | ||
} vector_info | ||
For INFIX_TYPE_VECTOR . More... | ||
struct { | ||
const char * name | ||
infix_aggregate_category_t aggregate_category | ||
} named_reference | ||
For INFIX_TYPE_NAMED_REFERENCE . This is an internal placeholder for a named type like @Point . More... | ||
} | meta | |
Type-specific metadata. | ||
The central structure for describing any data type in the FFI system.
This structure provides the FFI code generator with the necessary metadata (size, alignment, category, and contents) to correctly handle arguments and return values according to the target ABI.
infix_aggregate_category_t infix_type_t::aggregate_category |
struct { ... } infix_type_t::aggregate_info |
For INFIX_TYPE_STRUCT
and INFIX_TYPE_UNION
.
size_t infix_type_t::alignment |
The alignment requirement of the type in bytes, per _Alignof
.
infix_function_argument* infix_type_t::args |
Array of function arguments (name and type).
struct { ... } infix_type_t::array_info |
For INFIX_TYPE_ARRAY
.
struct infix_type_t* infix_type_t::base_type |
The floating point type of the real and imaginary parts.
infix_type_category infix_type_t::category |
The fundamental category of the type.
struct { ... } infix_type_t::complex_info |
For INFIX_TYPE_COMPLEX
.
struct infix_type_t* infix_type_t::element_type |
The type of elements in the array.
The type of the elements in the vector.
struct { ... } infix_type_t::enum_info |
For INFIX_TYPE_ENUM
.
struct { ... } infix_type_t::func_ptr_info |
For INFIX_TYPE_REVERSE_TRAMPOLINE
.
bool infix_type_t::is_arena_allocated |
If true, this type was allocated from an arena and should not be individually freed.
infix_struct_member* infix_type_t::members |
Array of members for the aggregate.
union { ... } infix_type_t::meta |
Type-specific metadata.
struct { ... } infix_type_t::named_reference |
For INFIX_TYPE_NAMED_REFERENCE
. This is an internal placeholder for a named type like @Point
.
size_t infix_type_t::num_args |
The total number of fixed and variadic arguments.
size_t infix_type_t::num_elements |
The number of elements in the array.
The number of elements in the vector.
size_t infix_type_t::num_fixed_args |
The number of non-variadic arguments.
struct infix_type_t* infix_type_t::pointee_type |
The type this pointer points to.
struct { ... } infix_type_t::pointer_info |
For INFIX_TYPE_POINTER
.
infix_primitive_type_id infix_type_t::primitive_id |
For INFIX_TYPE_PRIMITIVE
.
struct infix_type_t* infix_type_t::return_type |
Reverse trampoline return value.
size_t infix_type_t::size |
The total size of the type in bytes, per sizeof
.
struct infix_type_t* infix_type_t::underlying_type |
The integer type this enum is based on.
struct { ... } infix_type_t::vector_info |
For INFIX_TYPE_VECTOR
.