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

Function print_callback

example/callback.c:37–46  ·  view source on GitHub ↗

A function to be called from Wasm code.

Source from the content-addressed store, hash-verified

35
36// A function to be called from Wasm code.
37own wasm_trap_t* print_callback(
38 const wasm_val_vec_t* args, wasm_val_vec_t* results
39) {
40 printf("Calling back...\n> ");
41 wasm_val_print(args->data[0]);
42 printf("\n");
43
44 wasm_val_copy(&results->data[0], &args->data[0]);
45 return NULL;
46}
47
48
49// A function closure.

Callers

nothing calls this directly

Calls 2

wasm_val_printFunction · 0.85
wasm_val_copyFunction · 0.85

Tested by

no test coverage detected