|
infix
A JIT-Powered FFI Library for C
|
Cookbook Chapter 4: Receiving and Calling a Function Pointer. More...
Functions | |
| static int | multiply_handler (int x) |
| static int | harness_func (int(*worker_func)(int), int base_val) |
| int | main () |
Cookbook Chapter 4: Receiving and Calling a Function Pointer.
This example demonstrates a powerful composition of forward and reverse calls. We create a reverse trampoline (a callback) and then pass its function pointer as an argument to another C function using a forward trampoline.
This pattern is very common in C APIs that use callbacks for event handling, sorting, or iteration.
|
static |
| int main | ( | void | ) |
|
static |