= Startup and status data = == Getting startup data == The following functions return startup data: {{{ #!c++ int boinc_get_init_data_p(APP_INIT_DATA*); int boinc_get_init_data(APP_INIT_DATA&); struct APP_INIT_DATA { int major_version; int minor_version; int release; int app_version; char app_name[256]; char symstore[256]; char acct_mgr_url[256]; char* project_preferences; int hostid; char user_name[256]; char team_name[256]; char project_dir[256]; char boinc_dir[256]; char wu_name[256]; char authenticator[256]; int slot; double user_total_credit; double user_expavg_credit; double host_total_credit; double host_expavg_credit; double resource_share_fraction; HOST_INFO host_info; PROXY_INFO proxy_info; // in case app wants to use network GLOBAL_PREFS global_prefs; double starting_elapsed_time; // info about the WU double rsc_fpops_est; double rsc_fpops_bound; double rsc_memory_bound; double rsc_disk_bound; // the following are used for compound apps, // where each stage of the computation is a fixed // fraction of the total. double fraction_done_start; double fraction_done_end; }; }}} to get the following information: ||'''core version'''||The version number of the core client|| ||'''app_name'''||The application name (from the server's DB)|| ||'''project_preferences'''||An XML string containing the user's project-specific preferences.|| ||'''user_name'''||The user's 'screen name' on this project.|| ||'''team_name'''||The user's team name, if any.|| ||'''project_dir'''||Absolute path of project directory|| ||'''boinc_dir'''||Absolute path of BOINC root directory|| ||'''wu_name'''||Name of workunit being processed|| ||'''authenticator'''||User's authenticator for this project|| ||'''slot'''||The number of the app's 'slot'|| ||'''user_total_credit'''||User's total work for this project.|| ||'''user_expavg_credit'''||User's recent average work per day.|| ||'''team_total_credit'''||Team's total work for this project.|| ||'''team_expavg_credit'''||Team's recent average work per day.|| ||'''host_info'''||A structure describing the host hardware and OS|| ||'''starting_elapsed_time'''||Elapsed time, counting previous episodes (provided only by 6.10 and later clients)|| == Getting runtime system status == The status of the runtime system is represented by the following structure: {{{ typedef struct BOINC_STATUS { int no_heartbeat; int suspended; int quit_request; int reread_init_data_file; int abort_request; double working_set_size; double max_working_set_size; int network_suspended; } BOINC_STATUS; }}} '''no_heartbeat''':: no heartbeat from client; clean up and exit(0). '''suspended''':: the client has requested that we suspend ourself. '''quit_request''':: the client has requested that we exit (will restart). '''reread_init_data_file''': project preferences have changed; reread them if needed. '''abort_request''': the client has request that we abort (no restart). '''working_set_size''':: our current working-set size '''max_working_set_size''':: the amount of available RAM '''network_suspended''':: set of network activity is not currently allowed You can get the current status using {{{ void boinc_get_status(BOINC_STATUS*); }}}