Ignore:
Timestamp:
Jul 14, 2011 8:46:19 AM (13 years ago)
Author:
ming
Message:

Re #1278: NSApplication and NSAutoreleasePool management for Mac OS X

Application now needs to call pj_run_app() from its main() function and pass a pointer to the application's main function. For some examples, please refer to aviplay, pjmedia_test, and pjsua.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjlib/include/pj/os.h

    r2843 r3643  
    13321332/* **************************************************************************/ 
    13331333/** 
     1334 * @defgroup PJ_APP_OS Application execution 
     1335 * @ingroup PJ_OS 
     1336 * @{ 
     1337 */ 
     1338 
     1339/* Type for main function. */ 
     1340typedef int (*pj_main_func_ptr)(int argc, char *argv[]); 
     1341 
     1342/** 
     1343 * Run the application. This function has to be called in the main thread 
     1344 * and after doing the necessary initialization according to the flags 
     1345 * provided, it will call main_func() function. 
     1346 * 
     1347 * @param main_func Application's main function. 
     1348 * @param argc      Number of arguments from the main() function, which 
     1349 *                  will be passed to main_func() function. 
     1350 * @param argv      The arguments from the main() function, which will 
     1351 *                  be passed to main_func() function. 
     1352 * @param flags     Flags for application execution, currently must be 0. 
     1353 * 
     1354 * @return          main_func()'s return value. 
     1355 */ 
     1356int pj_run_app(pj_main_func_ptr main_func, int argc, char *argv[], 
     1357               unsigned flags); 
     1358 
     1359/** @} */ 
     1360 
     1361 
     1362/* **************************************************************************/ 
     1363/** 
    13341364 * Internal PJLIB function to initialize the threading subsystem. 
    13351365 * @return          PJ_SUCCESS or the appropriate error code. 
Note: See TracChangeset for help on using the changeset viewer.