- Adapted indenation to new agreed upon system
- Added support for second generation scriptcontext based counter
This commit is contained in:
134
histdriv.c
134
histdriv.c
@ -50,73 +50,71 @@
|
||||
#include "HistDriv.i"
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
pHistDriver CreateHistDriver(pStringDict pOption)
|
||||
{
|
||||
pHistDriver pNew = NULL;
|
||||
char pDim[20];
|
||||
int i;
|
||||
pHistDriver CreateHistDriver(pStringDict pOption)
|
||||
{
|
||||
pHistDriver pNew = NULL;
|
||||
char pDim[20];
|
||||
int i;
|
||||
|
||||
/* allocate some more memory */
|
||||
pNew = (pHistDriver)malloc(sizeof(HistDriver));
|
||||
if(!pNew)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
memset(pNew,0,sizeof(HistDriver));
|
||||
|
||||
pNew->data = makeHMData();
|
||||
if(!pNew->data)
|
||||
{
|
||||
free(pNew);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* initialise defaults */
|
||||
StringDictAddPair(pOption,"rank","1");
|
||||
for(i = 0; i < MAXDIM; i++)
|
||||
{
|
||||
sprintf(pDim,"dim%1.1d",i);
|
||||
StringDictAddPair(pOption,pDim,"-126");
|
||||
}
|
||||
pNew->fCountPreset = 10.;
|
||||
pNew->eCount = eTimer;
|
||||
pNew->iReconfig = 1;
|
||||
pNew->iUpdate = 0;
|
||||
|
||||
return pNew;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
void DeleteHistDriver(pHistDriver self)
|
||||
{
|
||||
assert(self);
|
||||
|
||||
if(self->FreePrivate)
|
||||
{
|
||||
self->FreePrivate(self);
|
||||
}
|
||||
if(self->pOption){
|
||||
DeleteStringDict(self->pOption);
|
||||
}
|
||||
if(self->data)
|
||||
{
|
||||
killHMData(self->data);
|
||||
}
|
||||
free(self);
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int HistDriverConfig(pHistDriver self, pStringDict pOpt, SConnection *pCon)
|
||||
{
|
||||
int iRet;
|
||||
char pBueffel[512];
|
||||
char pValue[80];
|
||||
float fVal;
|
||||
TokenList *pList = NULL, *pCurrent;
|
||||
char *pBuf = NULL;
|
||||
int i;
|
||||
|
||||
assert(self);
|
||||
assert(pOpt);
|
||||
assert(pCon);
|
||||
|
||||
return configureHMdata(self->data,pOpt,pCon);
|
||||
/* allocate some more memory */
|
||||
pNew = (pHistDriver) malloc(sizeof(HistDriver));
|
||||
if (!pNew) {
|
||||
return NULL;
|
||||
}
|
||||
memset(pNew, 0, sizeof(HistDriver));
|
||||
|
||||
pNew->data = makeHMData();
|
||||
if (!pNew->data) {
|
||||
free(pNew);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* initialise defaults */
|
||||
StringDictAddPair(pOption, "rank", "1");
|
||||
for (i = 0; i < MAXDIM; i++) {
|
||||
sprintf(pDim, "dim%1.1d", i);
|
||||
StringDictAddPair(pOption, pDim, "-126");
|
||||
}
|
||||
pNew->fCountPreset = 10.;
|
||||
pNew->eCount = eTimer;
|
||||
pNew->iReconfig = 1;
|
||||
pNew->iUpdate = 0;
|
||||
|
||||
return pNew;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
void DeleteHistDriver(pHistDriver self)
|
||||
{
|
||||
assert(self);
|
||||
|
||||
if (self->FreePrivate) {
|
||||
self->FreePrivate(self);
|
||||
}
|
||||
if (self->pOption) {
|
||||
DeleteStringDict(self->pOption);
|
||||
}
|
||||
if (self->data) {
|
||||
killHMData(self->data);
|
||||
}
|
||||
free(self);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
int HistDriverConfig(pHistDriver self, pStringDict pOpt,
|
||||
SConnection * pCon)
|
||||
{
|
||||
int iRet;
|
||||
char pBueffel[512];
|
||||
char pValue[80];
|
||||
float fVal;
|
||||
TokenList *pList = NULL, *pCurrent;
|
||||
char *pBuf = NULL;
|
||||
int i;
|
||||
|
||||
assert(self);
|
||||
assert(pOpt);
|
||||
assert(pCon);
|
||||
|
||||
return configureHMdata(self->data, pOpt, pCon);
|
||||
}
|
||||
|
Reference in New Issue
Block a user