-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/worker.c,v 6.29 2007-04-14 21:49:37 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/worker.c,v 6.30 2008-05-28 14:56:16 hadaq Exp $";
#define WORKER_NEW_PROTOCOL
}
return retVal;
}
+
+int Worker_setStatistic(const char *name, const char *stat, unsigned long int *value)
+{
+ int retVal = -1;
+ int i;
+ Worker myS, *my = &myS;
+ strcpy(my->name, name);
+
+ if (-1 == openStatShm(my)) {
+ *value = 0;
+ } else {
+ for (i = 0; i < WORKER_MAX_NUM_STATS && strcmp(my->statistics[i].name, "") != 0; i++) {
+ if (strcasecmp(stat, my->statistics[i].name) == 0) {
+ my->statistics[i].value = *value;
+ retVal = 0;
+ i = WORKER_MAX_NUM_STATS;
+ }
+ }
+ closeStatShm(my);
+ }
+ return retVal;
+}
unsigned long *Worker_addStatistic(Worker *my, const char *name);
void Worker_dump(Worker *my, time_t interval);
int Worker_getStatistic(const char *name, const char *stat, unsigned long int *value);
+int Worker_setStatistic(const char *name, const char *stat, unsigned long int *value);
#endif