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

Function neg_callback

example/table.cc:11–17  ·  view source on GitHub ↗

A function to be called from Wasm code.

Source from the content-addressed store, hash-verified

9
10// A function to be called from Wasm code.
11auto neg_callback(
12 const wasm::vec<wasm::Val>& args, wasm::vec<wasm::Val>& results
13) -> wasm::own<wasm::Trap> {
14 std::cout << "Calling back..." << std::endl;
15 results[0] = wasm::Val(-args[0].i32());
16 return nullptr;
17}
18
19
20auto get_export_table(wasm::ownvec<wasm::Extern>& exports, size_t i) -> wasm::Table* {

Callers

nothing calls this directly

Calls 2

ValClass · 0.85
i32Method · 0.80

Tested by

no test coverage detected