wamr_sys

Function wasm_application_execute_main

Source
pub unsafe extern "C" fn wasm_application_execute_main(
    module_inst: wasm_module_inst_t,
    argc: i32,
    argv: *mut *mut c_char,
) -> bool
Expand description

Find the unique main function from a WASM module instance and execute that function.

@param module_inst the WASM module instance @param argc the number of arguments @param argv the arguments array, if the main function has return value, (int)argv stores the return value of the called main function after this function returns.

@return true if the main function is called, false otherwise and exception will be thrown, the caller can call wasm_runtime_get_exception to get the exception info.