Commit 3cdaba60 authored by Arne Øslebø's avatar Arne Øslebø
Browse files

reset of value is now optional

git-svn-id: file:///home/svn/mapi/trunk@803 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent b088f49b
......@@ -31,6 +31,7 @@ typedef struct res2file_inst {
void *data;
int save;
int type;
int reset;
unsigned long long ticks;
unsigned long long last;
} res2file_inst_t;
......@@ -193,7 +194,7 @@ static int res2file_process(mapidflib_function_instance_t *instance,
raw(i->functs[c],i->file);
}
if(s==1) {
if(i->functs[c]->def->reset!=NULL)
if(i->functs[c]->def->reset!=NULL && i->reset==1)
i->functs[c]->def->reset(i->functs[c]);
}
}
......@@ -219,7 +220,7 @@ static int res2file_init(mapidflib_function_instance_t *instance,
types=getargstr(&fargs);
fids=getargstr(&fargs);
head=getargstr(&fargs);
i->file=getargint(&fargs);
i->file=getargint(&fargs);
i->save=parse_save((s=getargstr(&fargs)));
if(i->save==PERIODIC) {
......@@ -228,6 +229,12 @@ static int res2file_init(mapidflib_function_instance_t *instance,
return MFUNCT_INVALID_ARGUMENT_5;
}
i->reset=getargint(&fargs);
if(!(i->reset==0 || i->reset==1))
return MFUNCT_INVALID_ARGUMENT;
//Count number of fids
c=0;
f=fids;
......@@ -303,7 +310,7 @@ static mapidflib_function_def_t finfo={
"", //libname
"RES2FILE", //name
"Stores the results from one or more functions to a file.", //descr
"sssws", //argdescr
"ssswsi", //argdescr
MAPI_DEVICE_ALL, //devoid
MAPIRES_NONE, //Method for returning results
0, //shm size
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment