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

Function print_callback

example/callback.cc:37–43  ·  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.
37auto print_callback(
38 const wasm::vec<wasm::Val>& args, wasm::vec<wasm::Val>& results
39) -> wasm::own<wasm::Trap> {
40 std::cout << "Calling back..." << std::endl << "> " << args[0] << std::endl;
41 results[0] = args[0].copy();
42 return nullptr;
43}
44
45
46// A function closure.

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected