MCPcopy Create free account
hub / github.com/WebAssembly/wasm-c-api / closure_callback

Function closure_callback

example/multi.c:29–39  ·  view source on GitHub ↗

A function closure.

Source from the content-addressed store, hash-verified

27
28// A function closure.
29own wasm_trap_t* closure_callback(
30 void* env, const wasm_val_vec_t* args, wasm_val_vec_t* results
31) {
32 int i = *(int*)env;
33 printf("Calling back closure...\n");
34 printf("> %d\n", i);
35
36 results->data[0].kind = WASM_I32;
37 results->data[0].of.i32 = (int32_t)i;
38 return NULL;
39}
40
41
42int main(int argc, const char* argv[]) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected