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

Function call_i_r

example/hostref.c:99–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99own wasm_ref_t* call_i_r(const wasm_func_t* func, int32_t i) {
100 printf("call_i_r... "); fflush(stdout);
101 wasm_val_t vs[1] = { WASM_I32_VAL(i) };
102 wasm_val_t rs[1] = { WASM_INIT_VAL };
103 wasm_val_vec_t args = WASM_ARRAY_VEC(vs);
104 wasm_val_vec_t results = WASM_ARRAY_VEC(rs);
105 if (wasm_func_call(func, &args, &results)) {
106 printf("> Error calling function!\n");
107 exit(1);
108 }
109 printf("okay\n");
110 return rs[0].of.ref;
111}
112
113void check(own wasm_ref_t* actual, const wasm_ref_t* expected) {
114 if (actual != expected &&

Callers 1

mainFunction · 0.70

Calls 1

wasm_func_callFunction · 0.85

Tested by

no test coverage detected