diff options
Diffstat (limited to 'pjlib/include/pj/os.h')
-rw-r--r-- | pjlib/include/pj/os.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h index 45f9ce8f..3ce877af 100644 --- a/pjlib/include/pj/os.h +++ b/pjlib/include/pj/os.h @@ -1434,6 +1434,36 @@ PJ_DECL(pj_uint32_t) pj_elapsed_cycle( const pj_timestamp *start, /* **************************************************************************/ /** + * @defgroup PJ_APP_OS Application execution + * @ingroup PJ_OS + * @{ + */ + +/* Type for main function. */ +typedef int (*pj_main_func_ptr)(int argc, char *argv[]); + +/** + * Run the application. This function has to be called in the main thread + * and after doing the necessary initialization according to the flags + * provided, it will call main_func() function. + * + * @param main_func Application's main function. + * @param argc Number of arguments from the main() function, which + * will be passed to main_func() function. + * @param argv The arguments from the main() function, which will + * be passed to main_func() function. + * @param flags Flags for application execution, currently must be 0. + * + * @return main_func()'s return value. + */ +int pj_run_app(pj_main_func_ptr main_func, int argc, char *argv[], + unsigned flags); + +/** @} */ + + +/* **************************************************************************/ +/** * Internal PJLIB function to initialize the threading subsystem. * @return PJ_SUCCESS or the appropriate error code. */ |