Implement wasm_func_type.

This commit implements the missing `wasm_func_type` C API function.
This commit is contained in:
Peter Huene
2020-02-18 11:34:54 -08:00
parent b15b5cd05a
commit efc19b593a

View File

@@ -1230,6 +1230,16 @@ pub unsafe extern "C" fn wasm_externtype_kind(et: *const wasm_externtype_t) -> w
}
}
#[no_mangle]
pub unsafe extern "C" fn wasm_func_type(f: *const wasm_func_t) -> *mut wasm_functype_t {
let ft = Box::new(wasm_functype_t {
functype: (*f).func().borrow().ty().clone(),
params_cache: None,
returns_cache: None,
});
Box::into_raw(ft)
}
#[no_mangle]
pub unsafe extern "C" fn wasm_func_param_arity(f: *const wasm_func_t) -> usize {
(*f).func().borrow().param_arity()