diff --git a/core/iwasm/products/alios-things/src/main.c b/core/iwasm/products/alios-things/src/main.c index 395c9b852..336247856 100644 --- a/core/iwasm/products/alios-things/src/main.c +++ b/core/iwasm/products/alios-things/src/main.c @@ -29,6 +29,20 @@ static int app_argc; static char **app_argv; +/** + * 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 + * + * @return true if the main function is called, false otherwise. + */ +bool +wasm_application_execute_main(wasm_module_inst_t module_inst, + int argc, char *argv[]); + static void* app_instance_main(wasm_module_inst_t module_inst) { diff --git a/core/iwasm/products/linux/main.c b/core/iwasm/products/linux/main.c index e415de7d4..86c6e5e75 100644 --- a/core/iwasm/products/linux/main.c +++ b/core/iwasm/products/linux/main.c @@ -46,6 +46,35 @@ static int print_help() return 1; } +/** + * 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 + * + * @return true if the main function is called, false otherwise. + */ +bool +wasm_application_execute_main(wasm_module_inst_t module_inst, + int argc, char *argv[]); + +/** + * Find the specified function in argv[0] from WASM module of current instance + * and execute that function. + * + * @param module_inst the WASM module instance + * @param name the name of the function to execute + * @param argc the number of arguments + * @param argv the arguments array + * + * @return true if the specified function is called, false otherwise. + */ +bool +wasm_application_execute_func(wasm_module_inst_t module_inst, + const char *name, int argc, char *argv[]); + static void* app_instance_main(wasm_module_inst_t module_inst) { diff --git a/core/iwasm/products/vxworks/main.c b/core/iwasm/products/vxworks/main.c index dc2630428..a1a503f31 100644 --- a/core/iwasm/products/vxworks/main.c +++ b/core/iwasm/products/vxworks/main.c @@ -46,6 +46,35 @@ static int print_help() return 1; } +/** + * 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 + * + * @return true if the main function is called, false otherwise. + */ +bool +wasm_application_execute_main(wasm_module_inst_t module_inst, + int argc, char *argv[]); + +/** + * Find the specified function in argv[0] from WASM module of current instance + * and execute that function. + * + * @param module_inst the WASM module instance + * @param name the name of the function to execute + * @param argc the number of arguments + * @param argv the arguments array + * + * @return true if the specified function is called, false otherwise. + */ +bool +wasm_application_execute_func(wasm_module_inst_t module_inst, + const char *name, int argc, char *argv[]); + static void* app_instance_main(wasm_module_inst_t module_inst) { diff --git a/core/iwasm/products/zephyr/simple/src/main.c b/core/iwasm/products/zephyr/simple/src/main.c index a6a9260a7..fee58f9de 100644 --- a/core/iwasm/products/zephyr/simple/src/main.c +++ b/core/iwasm/products/zephyr/simple/src/main.c @@ -29,6 +29,20 @@ static int app_argc; static char **app_argv; +/** + * 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 + * + * @return true if the main function is called, false otherwise. + */ +bool +wasm_application_execute_main(wasm_module_inst_t module_inst, + int argc, char *argv[]); + static void* app_instance_main(wasm_module_inst_t module_inst) { diff --git a/core/iwasm/runtime/include/wasm_export.h b/core/iwasm/runtime/include/wasm_export.h index c62bc8cb6..61de09678 100644 --- a/core/iwasm/runtime/include/wasm_export.h +++ b/core/iwasm/runtime/include/wasm_export.h @@ -391,36 +391,6 @@ int32_t wasm_runtime_addr_native_to_app(wasm_module_inst_t module_inst, void *native_ptr); -/** - * 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 - * - * @return true if the main function is called, false otherwise. - */ -bool -wasm_application_execute_main(wasm_module_inst_t module_inst, - int argc, char *argv[]); - -/** - * Find the specified function in argv[0] from WASM module of current instance - * and execute that function. - * - * @param module_inst the WASM module instance - * @param name the name of the function to execute - * @param argc the number of arguments - * @param argv the arguments array - * - * @return true if the specified function is called, false otherwise. - */ -bool -wasm_application_execute_func(wasm_module_inst_t module_inst, - const char *name, int argc, char *argv[]); - - #ifdef __cplusplus } #endif