cache values of config params

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@1004 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drotos 2007-01-16 12:53:15 +00:00 committed by Adam Visegradi
parent 2f72882a82
commit 08cf3222a8
1 changed files with 14 additions and 8 deletions

View File

@ -152,16 +152,22 @@ char *
_DC_wu_cfg(DC_Workunit *wu,
enum _DC_e_param what)
{
char *v;
if (!_DC_wu_check(wu))
return(NULL);
v= DC_getClientCfgStr(wu->data.client_name,
_DC_params[what].name,
/*TRUE*/1);
if (v &&
*v)
return(v);
if (what >= cfg_nuof)
return(NULL);
if (!_DC_params[what].name)
return(NULL);
if (_DC_params[what].gvalue)
return(_DC_params[what].gvalue);
_DC_params[what].gvalue=
DC_getClientCfgStr(wu->data.client_name,
_DC_params[what].name,
/*TRUE*/1);
if (_DC_params[what].gvalue)
return(_DC_params[what].gvalue);
return(_DC_params[what].def);
}