move argc member of wu structure into the "static" part

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@657 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drdani 2006-06-08 09:11:57 +00:00 committed by Adam Visegradi
parent a2900d96b0
commit 30396cfbbb
4 changed files with 20 additions and 4 deletions

View File

@ -30,6 +30,7 @@ struct _DC_condor_event
struct _DC_wu_data
{
char *client_name;
int argc;
};
struct _DC_Workunit
@ -38,7 +39,6 @@ struct _DC_Workunit
int chk;
struct _DC_wu_data data;
char **argv;
int argc;
char *tag;
int subresults;

View File

@ -73,7 +73,7 @@ DC_initMaster(const char *configFile)
/* Enforce a canonical string representation of the UUID */
uuid_unparse_lower(_DC_project_uuid, _DC_project_uuid_str);
return(0);
return(DC_OK);
}
@ -96,7 +96,9 @@ DC_createWU(const char *clientName,
_DC_wu_set_client_name(wu, clientName);
wu->argv= g_strdupv((char **) arguments);
for (wu->argc= 0; arguments && arguments[wu->argc]; wu->argc++)
for (_DC_wu_set_argc(wu, 0);
arguments && arguments[wu->data.argc];
_DC_wu_set_argc(wu, wu->data.argc+1))
;
wu->subresults= subresults;
wu->tag= g_strdup(tag);
@ -135,7 +137,7 @@ DC_createWU(const char *clientName,
"Failed to create WU working directory %s: %s",
str->str, strerror(errno));
DC_destroyWU(wu);
return NULL;
return(NULL);
}
wu->workdir= str->str;

View File

@ -39,6 +39,7 @@ _DC_wu_check(const DC_Workunit *wu)
return(TRUE);
}
int
_DC_wu_set_client_name(DC_Workunit *wu,
const char *new_name)
@ -51,6 +52,17 @@ _DC_wu_set_client_name(DC_Workunit *wu,
return(DC_OK);
}
int
_DC_wu_set_argc(DC_Workunit *wu,
int new_argc)
{
if (!_DC_wu_check(wu))
return(DC_ERR_UNKNOWN_WU);
wu->data.argc= new_argc;
_DC_wu_changed(wu);
return(DC_OK);
}
/* Check if the logical name is not already registered */
int

View File

@ -16,6 +16,8 @@ extern void _DC_wu_changed(DC_Workunit *wu);
extern int _DC_wu_check(const DC_Workunit *wu);
extern int _DC_wu_set_client_name(DC_Workunit *wu,
const char *new_name);
extern int _DC_wu_set_argc(DC_Workunit *wu,
int new_argc);
extern int _DC_wu_check_logical_name(DC_Workunit *wu,
const char *logicalFileName);
extern char *_DC_wu_get_workdir_path(DC_Workunit *wu,