[−][src]Function wamr_sys::wasm_runtime_register_natives
pub unsafe extern "C" fn wasm_runtime_register_natives(
module_name: *const c_char,
native_symbols: *mut NativeSymbol,
n_native_symbols: u32
) -> bool
Register native functions with same module name
@param module_name the module name of the native functions @param native_symbols specifies an array of NativeSymbol structures which contain the names, function pointers and signatures Note: WASM runtime will not allocate memory to clone the data, so user must ensure the array can be used forever Meanings of letters in function signature: 'i': the parameter is i32 type 'I': the parameter is i64 type 'f': the parameter is f32 type 'F': the parameter is f64 type '': the parameter is a pointer (i32 in WASM), and runtime will auto check its boundary before calling the native function. If it is followed by '~', the checked length of the pointer is gotten from the following parameter, if not, the checked length of the pointer is 1. '~': the parameter is the pointer's length with i32 type, and must follow after '' '$': the parameter is a string (i32 in WASM), and runtime will auto check its boundary before calling the native function @param n_native_symbols specifies the number of native symbols in the array
@return true if success, false otherwise