Stream: wasmtime

Topic: how to get function signature in c


view this post on Zulip Nelson-He (Oct 13 2022 at 03:01):

Hi all
I am working on invoke the wasm exported function from c. I have get the wasmtime_extern_t of WASMTIME_EXTERN_FUNC using wasmtime_instance_export_nth, but how can I get the function inputs and outputs?

view this post on Zulip Nelson-He (Oct 13 2022 at 03:15):

I just find out that I can use wasmtime_func_type first to get the wasm_functype_t. After get the wasm_functype_t, I
can use wasm_functype_params and wasm_functype_results to get the function signature.

view this post on Zulip Karl Werner (Oct 13 2022 at 07:43):

you can check out this example. maybe it helps: https://docs.wasmtime.dev/examples-c-gcd.html


Last updated: Nov 22 2024 at 17:03 UTC