jovanivanovic opened Issue #2196:
Hello, I've been going through the C Hello World embed and I've seen that in order to get an exported function from wasm, you get it by an index:
wasm_extern_vec_t externs; wasm_instance_exports(instance, &externs); assert(externs.size == 1); wasm_func_t *run = wasm_extern_as_func(externs.data[0]);
Is there a possibility that I can lookup the function using it's name,
run
for example?
alexcrichton commented on Issue #2196:
Currently this can't be directly done with one function, but you can match up the list returned by
wasm_module_exports
with the list returned bywasm_instance_exports
to get the name of each item.
jovanivanovic commented on Issue #2196:
@alexcrichton Thanks for the answer. Would it be possible for you to write an example on the matter please?
jovanivanovic closed Issue #2196:
Hello, I've been going through the C Hello World embed and I've seen that in order to get an exported function from wasm, you get it by an index:
wasm_extern_vec_t externs; wasm_instance_exports(instance, &externs); assert(externs.size == 1); wasm_func_t *run = wasm_extern_as_func(externs.data[0]);
Is there a possibility that I can lookup the function using it's name,
run
for example?
Last updated: Nov 22 2024 at 17:03 UTC