Functions for inspecting the properties of trampolines and infix_type objects at runtime.
More...
|
| | Type System |
| | The core data structures and APIs for describing C types and function signatures.
|
| |
|
| c23_nodiscard infix_status | infix_type_print (char *, size_t, const infix_type *, infix_print_dialect_t) |
| | Serializes an infix_type object graph back into a signature string.
|
| |
| c23_nodiscard infix_status | infix_function_print (char *, size_t, const char *, const infix_type *, const infix_function_argument *, size_t, size_t, infix_print_dialect_t) |
| | Serializes a function signature's components into a string.
|
| |
| c23_nodiscard infix_unbound_cif_func | infix_forward_get_unbound_code (infix_forward_t *) |
| | Gets the callable function pointer from an unbound forward trampoline.
|
| |
| c23_nodiscard infix_cif_func | infix_forward_get_code (infix_forward_t *) |
| | Gets the callable function pointer from a bound forward trampoline.
|
| |
| c23_nodiscard void * | infix_reverse_get_code (const infix_reverse_t *) |
| | Gets the native, callable C function pointer from a reverse trampoline.
|
| |
| c23_nodiscard void * | infix_reverse_get_user_data (const infix_reverse_t *) |
| | Gets the user-provided data pointer from a closure context.
|
| |
| c23_nodiscard size_t | infix_forward_get_num_args (const infix_forward_t *) |
| | Gets the total number of arguments for a forward trampoline.
|
| |
Functions for inspecting the properties of trampolines and infix_type objects at runtime.
This API is essential for building dynamic language bindings, serializers, or any tool that needs to understand the memory layout and signature of C data structures and functions.
◆ infix_print_dialect_t
Specifies the output format for printing types and function signatures.
| Enumerator |
|---|
| INFIX_DIALECT_SIGNATURE | The standard, human-readable infix signature format.
|
| INFIX_DIALECT_ITANIUM_MANGLING | (Not yet implemented) Itanium C++ ABI name mangling.
|
| INFIX_DIALECT_MSVC_MANGLING | (Not yet implemented) MSVC C++ name mangling.
|
◆ infix_forward_get_code()
Gets the callable function pointer from a bound forward trampoline.
- Parameters
-
- Returns
- A callable
infix_cif_func pointer on success, or nullptr if the trampoline is nullptr or if it is an unbound trampoline.
◆ infix_forward_get_num_args()
Gets the total number of arguments for a forward trampoline.
- Parameters
-
| [in] | trampoline | The trampoline handle. |
- Returns
- The number of arguments, or 0 if
trampoline is nullptr.
◆ infix_forward_get_unbound_code()
Gets the callable function pointer from an unbound forward trampoline.
- Parameters
-
- Returns
- A callable
infix_unbound_cif_func pointer on success, or nullptr if the trampoline is nullptr or if it is a bound trampoline.
◆ infix_function_print()
Serializes a function signature's components into a string.
- Parameters
-
| [out] | buffer | The output buffer. |
| [in] | buffer_size | The size of the output buffer. |
| [in] | function_name | Optional name for dialects that support it. |
| [in] | ret_type | The return type. |
| [in] | args | The array of arguments. |
| [in] | num_args | The total number of arguments. |
| [in] | num_fixed_args | The number of fixed arguments. |
| [in] | dialect | The output dialect. |
- Returns
INFIX_SUCCESS on success, or INFIX_ERROR_INVALID_ARGUMENT if the buffer is too small.
- Parameters
-
| [out] | buffer | The output buffer. |
| [in] | buffer_size | The size of the output buffer. |
| [in] | function_name | Optional name for dialects that support it (currently unused). |
| [in] | ret_type | The return type. |
| [in] | args | The array of arguments. |
| [in] | num_args | The total number of arguments. |
| [in] | num_fixed_args | The number of fixed arguments. |
| [in] | dialect | The output dialect. |
- Returns
INFIX_SUCCESS on success, or INFIX_ERROR_INVALID_ARGUMENT if the buffer is too small.
◆ infix_reverse_get_code()
Gets the native, callable C function pointer from a reverse trampoline.
- Parameters
-
- Returns
- A
void* that can be cast to the appropriate C function pointer type and called. The returned pointer is valid for the lifetime of the context handle.
◆ infix_reverse_get_user_data()
Gets the user-provided data pointer from a closure context.
- Parameters
-
| [in] | reverse_trampoline | The infix_reverse_t context handle created with infix_reverse_create_closure. |
- Returns
- The
void* user_data that was provided during creation.
◆ infix_type_print()
Serializes an infix_type object graph back into a signature string.
- Parameters
-
| [out] | buffer | The output buffer to write the string into. |
| [in] | buffer_size | The size of the output buffer. |
| [in] | type | The infix_type to print. |
| [in] | dialect | The desired output format dialect. |
- Returns
INFIX_SUCCESS on success, or INFIX_ERROR_INVALID_ARGUMENT if the buffer is too small.