|
| c23_nodiscard infix_type * | infix_type_create_primitive (infix_primitive_type_id id) |
| | Creates a static descriptor for a primitive C type.
|
| |
| c23_nodiscard infix_type * | infix_type_create_pointer (void) |
| | Creates a static descriptor for a generic pointer (void*).
|
| |
| c23_nodiscard infix_type * | infix_type_create_void (void) |
| | Creates a static descriptor for the void type.
|
| |
| infix_struct_member | infix_type_create_member (const char *name, infix_type *type, size_t offset) |
| | A factory function to create an infix_struct_member.
|
| |
| static infix_status | _create_aggregate_setup (infix_arena_t *arena, infix_type **out_type, infix_struct_member **out_arena_members, infix_struct_member *members, size_t num_members) |
| |
| c23_nodiscard infix_status | infix_type_create_pointer_to (infix_arena_t *arena, infix_type **out_type, infix_type *pointee_type) |
| | Creates a new pointer type that points to a specific type.
|
| |
| c23_nodiscard infix_status | infix_type_create_array (infix_arena_t *arena, infix_type **out_type, infix_type *element_type, size_t num_elements) |
| | Creates a new fixed-size array type.
|
| |
| c23_nodiscard infix_status | infix_type_create_enum (infix_arena_t *arena, infix_type **out_type, infix_type *underlying_type) |
| | Creates a new enum type with a specified underlying integer type.
|
| |
| c23_nodiscard infix_status | infix_type_create_complex (infix_arena_t *arena, infix_type **out_type, infix_type *base_type) |
| | Creates a new _Complex number type.
|
| |
| c23_nodiscard infix_status | infix_type_create_vector (infix_arena_t *arena, infix_type **out_type, infix_type *element_type, size_t num_elements) |
| | Creates a new SIMD vector type.
|
| |
| c23_nodiscard infix_status | infix_type_create_union (infix_arena_t *arena, infix_type **out_type, infix_struct_member *members, size_t num_members) |
| | Creates a new union type from an array of members.
|
| |
| c23_nodiscard infix_status | infix_type_create_struct (infix_arena_t *arena, infix_type **out_type, infix_struct_member *members, size_t num_members) |
| | Creates a new struct type from an array of members, calculating layout automatically.
|
| |
| c23_nodiscard infix_status | infix_type_create_packed_struct (infix_arena_t *arena, infix_type **out_type, size_t total_size, size_t alignment, infix_struct_member *members, size_t num_members) |
| | Creates a new packed struct type with a user-specified layout.
|
| |
| c23_nodiscard infix_status | infix_type_create_named_reference (infix_arena_t *arena, infix_type **out_type, const char *name, infix_aggregate_category_t agg_cat) |
| | Creates a placeholder for a named type that will be resolved later by a type registry.
|
| |
| static void | _infix_type_recalculate_layout_recursive (infix_arena_t *temp_arena, infix_type *type, recalc_visited_node_t **visited_head) |
| |
| void | _infix_type_recalculate_layout (infix_type *type) |
| | Recalculates the layout of a fully resolved type graph.
|
| |
| static infix_type * | _copy_type_graph_to_arena_recursive (infix_arena_t *dest_arena, const infix_type *src_type, memo_node_t **memo_head) |
| |
| infix_type * | _copy_type_graph_to_arena (infix_arena_t *dest_arena, const infix_type *src_type) |
| | Performs a deep copy of a type graph into a destination arena.
|
| |
| static size_t | _estimate_graph_size_recursive (infix_arena_t *temp_arena, const infix_type *type, estimate_visited_node_t **visited_head) |
| |
| size_t | _infix_estimate_graph_size (infix_arena_t *temp_arena, const infix_type *type) |
| | Estimates the total memory required to deep-copy a complete type graph.
|
| |
| c23_nodiscard const char * | infix_type_get_name (const infix_type *type) |
| | Gets the semantic alias of a type, if one exists.
|
| |
| c23_nodiscard infix_type_category | infix_type_get_category (const infix_type *type) |
| | Gets the fundamental category of a type.
|
| |
| c23_nodiscard size_t | infix_type_get_size (const infix_type *type) |
| | Gets the size of a type in bytes.
|
| |
| c23_nodiscard size_t | infix_type_get_alignment (const infix_type *type) |
| | Gets the alignment requirement of a type in bytes.
|
| |
| c23_nodiscard size_t | infix_type_get_member_count (const infix_type *type) |
| | Gets the number of members in a struct or union type.
|
| |
| c23_nodiscard const infix_struct_member * | infix_type_get_member (const infix_type *type, size_t index) |
| | Gets a specific member from a struct or union type.
|
| |
| c23_nodiscard const char * | infix_type_get_arg_name (const infix_type *func_type, size_t index) |
| | Gets the name of a specific argument from a function type.
|
| |
| c23_nodiscard const infix_type * | infix_type_get_arg_type (const infix_type *func_type, size_t index) |
| | Gets the type of a specific argument from a function type.
|
| |
| c23_nodiscard size_t | infix_forward_get_num_args (const infix_forward_t *trampoline) |
| | Gets the total number of arguments for a forward trampoline.
|
| |
| c23_nodiscard size_t | infix_forward_get_num_fixed_args (const infix_forward_t *trampoline) |
| | Gets the number of fixed (non-variadic) arguments for a forward trampoline.
|
| |
| c23_nodiscard const infix_type * | infix_forward_get_return_type (const infix_forward_t *trampoline) |
| | Gets the return type for a forward trampoline.
|
| |
| c23_nodiscard const infix_type * | infix_forward_get_arg_type (const infix_forward_t *trampoline, size_t index) |
| | Gets the type of a specific argument for a forward trampoline.
|
| |
| c23_nodiscard size_t | infix_reverse_get_num_args (const infix_reverse_t *trampoline) |
| | Gets the total number of arguments for a reverse trampoline.
|
| |
| c23_nodiscard size_t | infix_reverse_get_num_fixed_args (const infix_reverse_t *trampoline) |
| | Gets the number of fixed (non-variadic) arguments for a reverse trampoline.
|
| |
| c23_nodiscard const infix_type * | infix_reverse_get_return_type (const infix_reverse_t *trampoline) |
| | Gets the return type for a reverse trampoline.
|
| |
| c23_nodiscard const infix_type * | infix_reverse_get_arg_type (const infix_reverse_t *trampoline, size_t index) |
| | Gets the type of a specific argument for a reverse trampoline.
|
| |
Implements the public API for creating and managing type descriptions.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
This module serves two primary functions:
- It provides the public functions for programmatically constructing
infix_type objects (the "Manual API"). These functions are the building blocks for users who need to create type information dynamically without parsing strings.
- It contains the crucial internal logic for two core stages of the data pipeline:
- **Copying (
_copy_type_graph_to_arena):** Deep-copies a type graph to a new memory arena, which is fundamental to creating self-contained trampoline objects and ensuring memory safety.
- **Layout (
_infix_type_recalculate_layout):** Traverses a fully resolved type graph to compute the final memory layout (size, alignment, and offsets) of all structures and unions.
The creation functions (infix_type_create_*) perform an initial, preliminary layout calculation. This layout is considered unresolved until a final pass with _infix_type_recalculate_layout is performed after all named types have been resolved by the type registry.