*** empty log message ***

svn path=/trunk/boinc/; revision=902
This commit is contained in:
David Anderson 2003-02-13 22:49:26 +00:00
parent 23e408303f
commit de752bceb7
2 changed files with 23 additions and 17 deletions

View File

@ -68,17 +68,18 @@ int CLIENT_STATE::parse_account_files() {
return 0;
}
int CLIENT_STATE::add_project(char* master_url, char* authenticator)
{
int CLIENT_STATE::add_project(char* master_url, char* authenticator) {
char path[256];
PROJECT* project;
FILE* f;
int retval;
// check if this project is already running
if(lookup_project(master_url)) return -1;
//
if (lookup_project(master_url)) return -1;
// create project state
//
write_account_file(master_url, authenticator);
get_account_filename(master_url, path);
f = fopen(path, "r");
@ -91,41 +92,42 @@ int CLIENT_STATE::add_project(char* master_url, char* authenticator)
}
// remove any old files
//
retval = remove_project_dir(*project);
retval = make_project_dir(*project);
if(retval) {
return retval;
}
if (retval) return retval;
projects.push_back(project);
return 0;
}
int CLIENT_STATE::change_project(int index, char* master_url, char* authenticator)
{
int CLIENT_STATE::change_project(
int index, char* master_url, char* authenticator
) {
char path[256];
PROJECT* project;
FILE* f;
int retval;
// check if this project is already running
if(lookup_project(master_url)) return -1;
//
if (lookup_project(master_url)) return -1;
// delete old file
//
project = projects[index];
get_account_filename(project->master_url, path);
retval = file_delete(path);
// create project state
//
write_account_file(master_url, authenticator);
get_account_filename(master_url, path);
f = fopen(path, "r");
if (!f) return ERR_FOPEN;
retval = project->parse_account(f);
fclose(f);
if(retval) {
return retval;
}
if (retval) return retval;
// remove any old files
retval = remove_project_dir(*project);

View File

@ -8,13 +8,15 @@ home directory:
<ul>
<li>
<b>prefs.xml</b>:
The user's latest preferences; see below.
The user's global preferences; see below.
<li>
<b>client_state.xml</b>: a description of the files,
<b>client_state.xml</b> describes of the files,
application, workunits and results present on this client.
<li>
<b>Account files</b> describing the participant's account
in each subscribed project.
<b>Account files</b> describes the participant's account
in each subscribed project,
including the resource share and project-specific preferences.
It contains no host-specific information.
The name of the account file is <b>account_PROJECT.xml</b>,
where PROJECT is an encoded version of the project's master URL.
<li>
@ -35,7 +37,7 @@ The core client creates "soft link" files in the slot directory,
linking to the corresponding files in the project directory.
<h3>Format of account files</h3>
This format of an account file is as follows:
The format of an account file is as follows:
<pre>
&lt;account>
&lt;master_url>http://www.myproject.com/&lt;/master_url>
@ -57,4 +59,6 @@ This format of prefs.xml is as follows:
&lt;high_water_days>2&lt;/high_water_days>
&lt;low_water_days>1&lt;/low_water_days>
&lt;/preferences>
XXX this is not complete
</pre>