c-api: Add a way to get type of wasmtime_module_t (#3959)

My previous PR at #3958 accidentally removed the only way to get type
information from a `wasmtime_module_t`, so this commit re-adds methods
back in to continue to be able to get import/export information from a
compiled module.
This commit is contained in:
Alex Crichton
2022-03-24 13:32:56 -05:00
committed by GitHub
parent 76b82910c9
commit 13ec5ff64c
2 changed files with 44 additions and 6 deletions

View File

@@ -59,6 +59,22 @@ WASM_API_EXTERN void wasmtime_module_delete(wasmtime_module_t *m);
*/
WASM_API_EXTERN wasmtime_module_t *wasmtime_module_clone(wasmtime_module_t *m);
/**
* \brief Same as #wasm_module_imports, but for #wasmtime_module_t.
*/
WASM_API_EXTERN void wasmtime_module_imports(
const wasmtime_module_t *module,
wasm_importtype_vec_t *out
);
/**
* \brief Same as #wasm_module_exports, but for #wasmtime_module_t.
*/
WASM_API_EXTERN void wasmtime_module_exports(
const wasmtime_module_t *module,
wasm_exporttype_vec_t *out
);
/**
* \brief Validate a WebAssembly binary.
*