63
65
std::string general_area;
64
66
std::string specific_area;
65
67
std::string description;
68
std::string home; // sponsoring organization
69
std::string image; // URL of logo
70
std::vector<std::string> platforms;
71
// platforms supported by project, or empty
70
73
PROJECT_LIST_ENTRY();
71
74
~PROJECT_LIST_ENTRY();
73
76
int parse(XML_PARSER&);
76
bool operator<(const PROJECT_LIST_ENTRY& compare);
84
std::string description;
90
int parse(XML_PARSER&);
94
class ALL_PROJECTS_LIST {
96
std::vector<PROJECT_LIST_ENTRY*> projects;
97
std::vector<AM_LIST_ENTRY*> account_managers;
100
~ALL_PROJECTS_LIST();
81
std::string master_url;
108
char master_url[256];
82
109
double resource_share;
83
110
std::string project_name;
84
111
std::string user_name;
85
112
std::string team_name;
86
114
std::vector<GUI_URL> gui_urls;
87
115
double user_total_credit;
88
116
double user_expavg_credit;
93
121
// contact all scheduling servers
94
122
int master_fetch_failures;
95
123
double min_rpc_time; // earliest time to contact any server
96
double short_term_debt;
97
double long_term_debt;
124
double download_backoff;
125
double upload_backoff;
127
double cpu_short_term_debt;
128
double cpu_long_term_debt;
129
double cpu_backoff_time;
130
double cpu_backoff_interval;
132
double cuda_short_term_debt;
133
double cuda_backoff_time;
134
double cuda_backoff_interval;
136
double ati_short_term_debt;
137
double ati_backoff_time;
138
double ati_backoff_interval;
98
139
double duration_correction_factor;
141
bool anonymous_platform;
100
142
bool master_url_fetch_pending; // need to fetch and parse the master URL
101
143
int sched_rpc_pending; // need to contact scheduling server
102
int rr_sim_deadlines_missed;
144
// encodes the reason for the request
103
145
bool non_cpu_intensive;
104
146
bool suspended_via_gui;
105
147
bool dont_request_more_work;
107
149
bool attached_via_acct_mgr;
108
150
bool detach_when_done;
152
bool trickle_up_pending;
110
153
double project_files_downloaded_time;
111
154
// when the last project file download was finished
112
155
// (i.e. the time when ALL project files were finished downloading)
113
156
double last_rpc_time;
114
157
// when the last successful scheduler RPC finished
115
158
std::vector<DAILY_STATS> statistics; // credit data over the last x days
117
163
// NOTE: if you add any data items above,
118
// update parse(), copy() and clear() to include them!!
164
// update parse(), and clear() to include them!!
123
169
int parse(MIOFILE&);
171
void print_disk_usage();
126
173
void get_name(std::string&);
127
void copy(PROJECT&); // copy to this object
129
175
// temp - keep track of whether or not this record needs to be deleted
130
176
bool flag_for_delete;
188
std::string project_url;
240
char project_url[256];
243
double report_deadline;
244
double received_time;
190
245
bool ready_to_report;
191
246
bool got_server_ack;
192
247
double final_cpu_time;
248
double final_elapsed_time;
194
250
int scheduler_state;
197
std::string stderr_out;
253
//std::string stderr_out;
198
254
bool suspended_via_gui;
199
255
bool project_suspended_via_gui;
201
259
// the following defined if active
202
260
bool active_task;
203
261
int active_task_state;
204
262
int app_version_num;
205
265
double checkpoint_cpu_time;
206
266
double current_cpu_time;
207
267
double fraction_done;
208
269
double swap_size;
209
270
double working_set_size_smoothed;
210
271
double estimated_cpu_time_remaining;
272
// actually, estimated elapsed time remaining
211
273
bool supports_graphics;
212
274
int graphics_mode_acked;
214
276
bool needs_shmem;
215
277
bool edf_scheduled;
216
std::string graphics_exec_path;
217
std::string slot_path;
218
std::string resources;
278
char graphics_exec_path[512];
280
// only present if graphics_exec_path is
222
285
PROJECT* project;
307
372
std::vector<APP_VERSION*> app_versions;
308
373
std::vector<WORKUNIT*> wus;
309
374
std::vector<RESULT*> results;
375
std::vector<std::string> platforms;
376
// platforms supported by client
311
377
GLOBAL_PREFS global_prefs; // working prefs, i.e. network + override
312
378
VERSION_INFO version_info; // populated only if talking to pre-5.6 CC
313
379
bool executing_as_daemon; // true if Client is running as a service / daemon
318
PROJECT* lookup_project(std::string&);
319
APP* lookup_app(std::string&, std::string&);
320
APP* lookup_app(PROJECT*, std::string&);
321
APP_VERSION* lookup_app_version(std::string&, std::string&, int);
322
APP_VERSION* lookup_app_version(PROJECT*, std::string&, int);
323
WORKUNIT* lookup_wu(std::string&, std::string&);
324
WORKUNIT* lookup_wu(PROJECT*, std::string&);
325
RESULT* lookup_result(std::string&, std::string&);
326
RESULT* lookup_result(PROJECT*, std::string&);
387
PROJECT* lookup_project(char* url);
388
APP* lookup_app(PROJECT*, char* name);
389
APP_VERSION* lookup_app_version(PROJECT*, APP*, int, char* plan_class);
390
APP_VERSION* lookup_app_version_old(PROJECT*, APP*, int);
391
WORKUNIT* lookup_wu(PROJECT*, char* name);
392
RESULT* lookup_result(PROJECT*, char* name);
393
RESULT* lookup_result(char* url, char* name);
332
class ALL_PROJECTS_LIST {
334
std::vector<PROJECT_LIST_ENTRY*> projects;
337
~ALL_PROJECTS_LIST();
461
// whether vector contains all notices, or just new ones
462
std::vector<NOTICE*> notices;
401
471
struct DISPLAY_INFO {
402
472
char window_station[256]; // windows
403
473
char desktop[256]; // windows
456
529
struct PROJECT_CONFIG {
458
531
std::string name;
532
std::string master_url;
533
int local_revision; // SVN changeset# of server software
459
534
int min_passwd_length;
460
535
bool account_manager;
536
bool uses_username; // true for WCG
462
537
bool account_creation_disabled;
463
bool client_account_creation_disabled;
538
bool client_account_creation_disabled; // must create account on web
539
bool sched_stopped; // scheduler disabled
540
bool web_stopped; // DB-driven web functions disabled
541
int min_client_version;
464
542
std::string error_msg;
465
543
std::string terms_of_use;
466
544
// if present, show this text in an "accept terms of use?" dialog
467
545
// before allowing attachment to continue.
546
std::vector<std::string> platforms;
547
// platforms supported by project, or empty
469
549
PROJECT_CONFIG();
470
550
~PROJECT_CONFIG();
505
586
bool ams_password_error;
506
587
bool manager_must_quit;
507
588
int task_suspend_reason; // bitmap, see common_defs.h
589
int task_mode; // always/auto/never; see common_defs.h
590
int task_mode_perm; // same, but permanent version
591
double task_mode_delay; // time until perm becomes actual
592
int gpu_suspend_reason;
595
double gpu_mode_delay;
508
596
int network_suspend_reason;
509
int task_mode; // always/auto/never; see common_defs.h
510
597
int network_mode;
511
int task_mode_perm; // same, but permanent version
512
598
int network_mode_perm;
513
double task_mode_delay; // time until perm becomes actual
514
599
double network_mode_delay;
515
600
bool disallow_attach;
516
601
bool simple_gui_only;
535
620
double start_time;
623
sockaddr_storage addr;
540
625
int send_request(const char*);
541
626
int get_reply(char*&);
629
int get_ip_addr(const char* host, int port);
544
630
int init(const char* host, int port=0);
546
632
const char* host, double timeout, bool retry, int port=GUI_RPC_PORT
559
645
int authorize(const char* passwd);
560
646
int exchange_versions(VERSION_INFO&);
561
647
int get_state(CC_STATE&);
562
int get_results(RESULTS&);
648
int get_results(RESULTS&, bool active_only = false);
563
649
int get_file_transfers(FILE_TRANSFERS&);
564
650
int get_simple_gui_info(SIMPLE_GUI_INFO&);
565
int get_simple_gui_info(CC_STATE&, RESULTS&);
566
int get_project_status(CC_STATE&);
567
651
int get_project_status(PROJECTS&);
568
652
int get_all_projects_list(ALL_PROJECTS_LIST&);
569
653
int get_disk_usage(DISK_USAGE&);
576
660
// if duration is zero, change is permanent.
577
661
// otherwise, after duration expires,
578
662
// restore last permanent mode
663
int set_gpu_mode(int mode, double duration);
579
664
int set_network_mode(int mode, double duration);
580
665
int get_screensaver_tasks(int& suspend_reason, RESULTS&);
581
666
int run_benchmarks();
582
667
int set_proxy_settings(GR_PROXY_INFO&);
583
668
int get_proxy_settings(GR_PROXY_INFO&);
584
int get_messages(int seqno, MESSAGES&);
669
int get_messages(int seqno, MESSAGES&, bool translatable=false);
670
int get_message_count(int& seqno);
671
int get_notices(int seqno, NOTICES&);
672
int get_notices_public(int seqno, NOTICES&);
585
673
int file_transfer_op(FILE_TRANSFER&, const char*);
586
674
int result_op(RESULT&, const char*);
587
675
int get_host_info(HOST_INFO&);
615
703
int acct_mgr_rpc_poll(ACCT_MGR_RPC_REPLY&);
617
int get_newer_version(std::string&);
705
int get_newer_version(std::string&, std::string&);
618
706
int read_global_prefs_override();
619
707
int read_cc_config();
620
708
int get_cc_status(CC_STATUS&);
639
727
int parse_reply();
730
// We recommend using the XCode project under OS 10.5 to compile
731
// the BOINC library, but some projects still use config & make,
732
// so the following compatibility code avoids compiler errors when
733
// building libboinc.a using config & make on system OS 10.3.9 or
734
// with the OS 10.3.9 SDK (but using config & make is not recommended.)
736
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4) && (!defined(BUILDING_MANAGER))
737
#define NO_PER_THREAD_LOCALE 1
740
// uselocal() API should be available on UNIX, Fedora & Ubuntu.
741
// For any platforms which do not support setting locale on a
742
// per-thread basis, add code here similar to the following sample:
743
//#if defined(__UNIVAC__)
744
//#define NO_PER_THREAD_LOCALE 1
746
#if defined(__HAIKU__)
747
#define NO_PER_THREAD_LOCALE 1
751
#ifdef NO_PER_THREAD_LOCALE
752
// Use this code for any platforms which do not support
753
// setting locale on a per-thread basis (see comment above)
643
755
std::string locale;
644
756
inline SET_LOCALE() {
645
757
locale = setlocale(LC_ALL, NULL);
649
761
setlocale(LC_ALL, locale.c_str());
765
#elif defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4)
766
// uselocale() is not available in OS 10.3.9 so use weak linking
768
extern int freelocale(locale_t) __attribute__((weak_import));
769
extern locale_t newlocale(int, __const char *, locale_t) __attribute__((weak_import));
770
extern locale_t uselocale(locale_t) __attribute__((weak_import));
773
locale_t old_locale, RPC_locale;
775
inline SET_LOCALE() {
776
if (uselocale == NULL) {
777
locale = setlocale(LC_ALL, NULL);
778
setlocale(LC_ALL, "C");
781
inline ~SET_LOCALE() {
782
if (uselocale == NULL) {
783
setlocale(LC_ALL, locale.c_str());
791
// Don't need to juggle locales if we have per-thread locale
792
inline SET_LOCALE() {
794
inline ~SET_LOCALE() {
799
extern int read_gui_rpc_password(char*);