Advanced functions for manually building infix_type
objects.
More...
|
c23_nodiscard infix_status | infix_forward_create_manual (infix_forward_t **, infix_type *, infix_type **, size_t, size_t, void *) |
| Generates a bound forward-call trampoline for a given function signature.
|
|
c23_nodiscard infix_status | infix_forward_create_unbound_manual (infix_forward_t **, infix_type *, infix_type **, size_t, size_t) |
| Generates an unbound forward-call trampoline for a given function signature.
|
|
c23_nodiscard infix_status | infix_reverse_create_callback_manual (infix_reverse_t **, infix_type *, infix_type **, size_t, size_t, void *) |
| Generates a type-safe reverse-call trampoline (callback) from infix_type objects.
|
|
c23_nodiscard infix_status | infix_reverse_create_closure_manual (infix_reverse_t **, infix_type *, infix_type **, size_t, size_t, infix_closure_handler_fn, void *) |
| Generates a generic reverse-call trampoline (closure) from infix_type objects.
|
|
void | infix_forward_destroy (infix_forward_t *) |
| Frees a forward trampoline and its associated executable memory.
|
|
void | infix_reverse_destroy (infix_reverse_t *) |
| Frees a reverse trampoline, its JIT-compiled stub, and its context.
|
|
Advanced functions for manually building infix_type
objects.
◆ infix_forward_create_manual()
Generates a bound forward-call trampoline for a given function signature.
- Parameters
-
[out] | out_trampoline | On success, will point to the handle for the new trampoline. |
| return_type | The infix_type of the function's return value. |
| arg_types | An array of infix_type* for each argument. |
| num_args | The total number of arguments. |
| num_fixed_args | For variadic functions, the number of non-variadic arguments. |
| target_function | A pointer to the native C function to be bound to the trampoline. |
- Returns
INFIX_SUCCESS
on success, or an error code on failure.
- Note
- The function pointer returned by
infix_forward_get_code
should be used.
◆ infix_forward_create_unbound_manual()
Generates an unbound forward-call trampoline for a given function signature.
- Parameters
-
[out] | out_trampoline | On success, will point to the handle for the new trampoline. |
| return_type | The infix_type of the function's return value. |
| arg_types | An array of infix_type* for each argument. |
| num_args | The total number of arguments. |
| num_fixed_args | For variadic functions, the number of non-variadic arguments. |
- Returns
INFIX_SUCCESS
on success, or an error code on failure.
- Note
- The function pointer returned by
infix_forward_get_unbound_code
must be used.
Generates an unbound forward-call trampoline for a given function signature.
Creates a trampoline where the target function pointer is not hardcoded.
- Parameters
-
[out] | out_trampoline | On success, will point to the handle for the new trampoline. |
| return_type | The infix_type of the function's return value. |
| arg_types | An array of infix_type* for each argument. |
| num_args | The total number of arguments. |
| num_fixed_args | For variadic functions, the number of non-variadic arguments. |
- Returns
INFIX_SUCCESS
on success, or an error code on failure.
- Note
- The returned trampoline must be freed with
infix_forward_destroy
.
◆ infix_forward_destroy()
Frees a forward trampoline and its associated executable memory.
- Parameters
-
trampoline | The trampoline to free. Can be nullptr . |
◆ infix_reverse_create_callback_manual()
Generates a type-safe reverse-call trampoline (callback) from infix_type
objects.
- Parameters
-
[out] | out_context | On success, will point to the new reverse trampoline context. |
| return_type | The return type of the callback. |
| arg_types | An array of infix_type pointers for the callback's arguments. |
| num_args | The total number of arguments in arg_types . |
| num_fixed_args | The number of fixed arguments. |
| user_callback_fn | A function pointer to your type-safe C callback handler. |
- Returns
INFIX_SUCCESS
on success, or an error code on failure.
- Note
- See
infix_reverse_create_callback
for details on the handler's signature.
◆ infix_reverse_create_closure_manual()
Generates a generic reverse-call trampoline (closure) from infix_type
objects.
- Parameters
-
[out] | out_context | On success, will point to the new reverse trampoline context. |
| return_type | The return type of the callback. |
| arg_types | An array of infix_type pointers for the callback's arguments. |
| num_args | The total number of arguments in arg_types . |
| num_fixed_args | The number of fixed arguments. |
| user_callback_fn | A function pointer to your generic infix_closure_handler_fn . |
| user_data | A user-defined pointer for passing state to the handler. |
- Returns
INFIX_SUCCESS
on success.
◆ infix_reverse_destroy()
Frees a reverse trampoline, its JIT-compiled stub, and its context.
- Parameters
-
reverse_trampoline | The reverse trampoline to free. Can be nullptr . |