A function to be called from Wasm code.
| 25 | |
| 26 | // A function to be called from Wasm code. |
| 27 | wasm_trap_t *callback(void *env, wasmtime_caller_t *caller, |
| 28 | const wasmtime_val_t *args, size_t nargs, |
| 29 | wasmtime_val_t *results, size_t nresults) { |
| 30 | (void)env; |
| 31 | (void)caller; |
| 32 | (void)nargs; |
| 33 | (void)nresults; |
| 34 | |
| 35 | printf("Calling back...\n"); |
| 36 | printf("> %" PRIu32 " %" PRIu64 "\n", args[0].of.i32, args[1].of.i64); |
| 37 | printf("\n"); |
| 38 | |
| 39 | results[0] = args[1]; |
| 40 | results[1] = args[0]; |
| 41 | return NULL; |
| 42 | } |
| 43 | |
| 44 | // A function closure. |
| 45 | wasm_trap_t *closure_callback(void *env, wasmtime_caller_t *caller, |
no outgoing calls
no test coverage detected