2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2004-07-13 13:54:09 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation;
|
|
|
|
// either version 2.1 of the License, or (at your option) any later version.
|
2004-07-13 13:54:09 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2002-04-30 22:22:54 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
#ifndef _PREFS_
|
|
|
|
#define _PREFS_
|
|
|
|
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdio>
|
2005-06-22 10:51:34 +00:00
|
|
|
#include "miofile.h"
|
2002-06-21 06:52:47 +00:00
|
|
|
|
2002-09-26 05:57:10 +00:00
|
|
|
// Global preferences are edited and stored on BOINC servers.
|
2002-06-01 20:26:21 +00:00
|
|
|
// The native representation of preferences is XML.
|
|
|
|
// The client maintains the preferences (in XML form)
|
|
|
|
// and mod time in the state file and in memory.
|
|
|
|
// It includes these items in each scheduler request message.
|
|
|
|
// A scheduler reply message may contain a more recent set of preferences.
|
|
|
|
//
|
|
|
|
|
2002-06-21 06:52:47 +00:00
|
|
|
// The following structure is a parsed version of the prefs file
|
|
|
|
//
|
2002-09-29 00:32:11 +00:00
|
|
|
struct GLOBAL_PREFS {
|
2003-09-02 23:49:53 +00:00
|
|
|
int mod_time;
|
2003-02-21 01:38:16 +00:00
|
|
|
bool run_on_batteries;
|
|
|
|
bool run_if_user_active;
|
2003-03-25 01:30:13 +00:00
|
|
|
int start_hour; // 0..23; no restriction if start==end
|
|
|
|
int end_hour;
|
2005-06-08 23:55:21 +00:00
|
|
|
int net_start_hour; // 0..23; no restriction if start==end
|
|
|
|
int net_end_hour;
|
2004-08-06 23:17:59 +00:00
|
|
|
bool leave_apps_in_memory;
|
2002-06-01 20:26:21 +00:00
|
|
|
bool confirm_before_connecting;
|
2003-02-04 01:07:19 +00:00
|
|
|
bool run_minimized;
|
|
|
|
bool run_on_startup;
|
2003-02-06 19:01:49 +00:00
|
|
|
bool hangup_if_dialed;
|
2005-04-06 19:41:31 +00:00
|
|
|
bool dont_verify_images;
|
2003-02-26 00:47:57 +00:00
|
|
|
double work_buf_min_days;
|
2003-03-20 02:05:25 +00:00
|
|
|
int max_cpus;
|
2004-10-13 18:30:18 +00:00
|
|
|
double cpu_scheduling_period_minutes;
|
2003-03-20 02:05:25 +00:00
|
|
|
double disk_interval;
|
2002-06-01 20:26:21 +00:00
|
|
|
double disk_max_used_gb;
|
|
|
|
double disk_max_used_pct;
|
|
|
|
double disk_min_free_gb;
|
2004-08-06 23:17:59 +00:00
|
|
|
double vm_max_used_pct;
|
2002-11-19 22:57:05 +00:00
|
|
|
double idle_time_to_run;
|
2003-02-26 00:47:57 +00:00
|
|
|
double max_bytes_sec_up;
|
|
|
|
double max_bytes_sec_down;
|
2004-10-06 19:09:37 +00:00
|
|
|
//int max_memory_mbytes;
|
2003-06-16 23:40:20 +00:00
|
|
|
int proc_priority;
|
2003-06-16 18:47:17 +00:00
|
|
|
int cpu_affinity;
|
2004-10-06 19:09:37 +00:00
|
|
|
char source_project[256];
|
|
|
|
char source_scheduler[256];
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2002-09-29 00:32:11 +00:00
|
|
|
GLOBAL_PREFS();
|
2004-10-17 02:18:59 +00:00
|
|
|
void defaults();
|
|
|
|
void clear_bools();
|
2005-06-22 10:51:34 +00:00
|
|
|
int parse(MIOFILE&, const char* venue, bool& found_venue);
|
2005-02-16 23:17:43 +00:00
|
|
|
int parse_file(const char* filename, const char* venue, bool& found_venue);
|
2005-06-22 10:51:34 +00:00
|
|
|
int write(MIOFILE&);
|
2002-04-30 22:22:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|