Hi, I have been trying recently to run WASI-WASM in a C/C++ environment using the C-API provided by Wasmer, and I hope to use some of its internal export functions.
And I referred to the sample code related to WASI provided in the Wasmer documentation, and it can indeed run normally, and I can also obtain exports by wasm_instance_exports(instance, &exports);
I can only get the type of the exports by wasm_extern_kind()
, But I want to call a specific function here. I look up all the api that wasmer provided but I just can't find one. So I have no idea how to get the function name.
here is part of the sample code:
// ...
own wasm_extern_vec_t exports;
wasm_instance_exports(instance, &exports);
for (int i = 0; i < exports.size; i++) {
if (wasm_extern_kind(exports.data[i]) == WASM_EXTERN_FUNC) {
wasm_func_t *func = wasm_extern_as_func(exports.data[i]);
// I wonder how can I get the name of the `func`
}
}
How can I fix that?